path
stringlengths
5
300
repo_name
stringlengths
6
76
content
stringlengths
26
1.05M
packages/material-ui-icons/src/RowingTwoTone.js
callemall/material-ui
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M8.5 14.5L4 19l1.5 1.5L9 17h2l-2.5-2.5zM15 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 20.01L18 24l-2.99-3.01V19.5l-7.1-7.09c-.31.05-.61.07-.91.07v-2.16c1.66.03 3.61-.87 4.67-2.04l1.4-1.55c.19-.21.43-.38.69-.5.29-.14.62-.23.96-.23h.03C15.99 6.01 17 7.02 17 8.26v5.75c0 .84-.35 1.61-.92 2.16l-3.58-3.58v-2.27c-.63.52-1.43 1.02-2.29 1.39L16.5 18H18l3 3.01z" /> , 'RowingTwoTone');
src/static/containers/Root/DevTools.js
SeaItRise/SeaItRise-webportal
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */ import React from 'react'; import { createDevTools } from 'redux-devtools'; // Monitors are separate packages, and you can make a custom one import LogMonitor from 'redux-devtools-log-monitor'; import DockMonitor from 'redux-devtools-dock-monitor'; // createDevTools takes a monitor and produces a DevTools component const DevTools = createDevTools( // Monitors are individually adjustable with props. // Consult their repositories to learn about those props. // Here, we put LogMonitor inside a DockMonitor. <DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-q" defaultIsVisible={false} > <LogMonitor theme="tomorrow" /> </DockMonitor> ); export default DevTools;
node_modules/react-icons/lib/fa/bullhorn.js
bengimbel/Solstice-React-Contacts-Project
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactIconBase = require('react-icon-base'); var _reactIconBase2 = _interopRequireDefault(_reactIconBase); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var FaBullhorn = function FaBullhorn(props) { return _react2.default.createElement( _reactIconBase2.default, _extends({ viewBox: '0 0 40 40' }, props), _react2.default.createElement( 'g', null, _react2.default.createElement('path', { d: 'm37.1 14.3q1.2 0 2.1 0.8t0.8 2-0.8 2.1-2.1 0.8v8.6q0 1.1-0.8 2t-2 0.8q-9.3-7.7-18.1-8.5-1.3 0.5-2.1 1.5t-0.7 2.3 0.9 2q-0.4 0.8-0.5 1.5t0.2 1.3 0.7 1.2 1.1 1.1 1.3 1.2q-0.6 1.2-2.4 1.8t-3.8 0.3-2.9-1.3q-0.2-0.5-0.7-1.9t-0.7-2.1-0.5-2-0.4-2.3 0.1-2.2 0.5-2.4h-2.7q-1.5 0-2.5-1.1t-1.1-2.5v-4.3q0-1.5 1.1-2.5t2.5-1.1h10.7q9.7 0 20-8.5 1.1 0 2 0.8t0.8 2v8.6z m-2.8 13.5v-21.3q-8.8 6.7-17.2 7.6v6.1q8.5 0.9 17.2 7.6z' }) ) ); }; exports.default = FaBullhorn; module.exports = exports['default'];
ajax/libs/react-select/1.1.0/react-select.es.js
sashberd/cdnjs
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { findDOMNode } from 'react-dom'; import AutosizeInput from 'react-input-autosize'; import classNames from 'classnames'; function arrowRenderer(_ref) { var onMouseDown = _ref.onMouseDown; return React.createElement('span', { className: 'Select-arrow', onMouseDown: onMouseDown }); } arrowRenderer.propTypes = { onMouseDown: PropTypes.func }; var map = [{ 'base': 'A', 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g }, { 'base': 'AA', 'letters': /[\uA732]/g }, { 'base': 'AE', 'letters': /[\u00C6\u01FC\u01E2]/g }, { 'base': 'AO', 'letters': /[\uA734]/g }, { 'base': 'AU', 'letters': /[\uA736]/g }, { 'base': 'AV', 'letters': /[\uA738\uA73A]/g }, { 'base': 'AY', 'letters': /[\uA73C]/g }, { 'base': 'B', 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g }, { 'base': 'C', 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g }, { 'base': 'D', 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g }, { 'base': 'DZ', 'letters': /[\u01F1\u01C4]/g }, { 'base': 'Dz', 'letters': /[\u01F2\u01C5]/g }, { 'base': 'E', 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g }, { 'base': 'F', 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g }, { 'base': 'G', 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g }, { 'base': 'H', 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g }, { 'base': 'I', 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g }, { 'base': 'J', 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g }, { 'base': 'K', 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g }, { 'base': 'L', 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g }, { 'base': 'LJ', 'letters': /[\u01C7]/g }, { 'base': 'Lj', 'letters': /[\u01C8]/g }, { 'base': 'M', 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g }, { 'base': 'N', 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g }, { 'base': 'NJ', 'letters': /[\u01CA]/g }, { 'base': 'Nj', 'letters': /[\u01CB]/g }, { 'base': 'O', 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g }, { 'base': 'OI', 'letters': /[\u01A2]/g }, { 'base': 'OO', 'letters': /[\uA74E]/g }, { 'base': 'OU', 'letters': /[\u0222]/g }, { 'base': 'P', 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g }, { 'base': 'Q', 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g }, { 'base': 'R', 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g }, { 'base': 'S', 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g }, { 'base': 'T', 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g }, { 'base': 'TZ', 'letters': /[\uA728]/g }, { 'base': 'U', 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g }, { 'base': 'V', 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g }, { 'base': 'VY', 'letters': /[\uA760]/g }, { 'base': 'W', 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g }, { 'base': 'X', 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g }, { 'base': 'Y', 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g }, { 'base': 'Z', 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g }, { 'base': 'a', 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g }, { 'base': 'aa', 'letters': /[\uA733]/g }, { 'base': 'ae', 'letters': /[\u00E6\u01FD\u01E3]/g }, { 'base': 'ao', 'letters': /[\uA735]/g }, { 'base': 'au', 'letters': /[\uA737]/g }, { 'base': 'av', 'letters': /[\uA739\uA73B]/g }, { 'base': 'ay', 'letters': /[\uA73D]/g }, { 'base': 'b', 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g }, { 'base': 'c', 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g }, { 'base': 'd', 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g }, { 'base': 'dz', 'letters': /[\u01F3\u01C6]/g }, { 'base': 'e', 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g }, { 'base': 'f', 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g }, { 'base': 'g', 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g }, { 'base': 'h', 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g }, { 'base': 'hv', 'letters': /[\u0195]/g }, { 'base': 'i', 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g }, { 'base': 'j', 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g }, { 'base': 'k', 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g }, { 'base': 'l', 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g }, { 'base': 'lj', 'letters': /[\u01C9]/g }, { 'base': 'm', 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g }, { 'base': 'n', 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g }, { 'base': 'nj', 'letters': /[\u01CC]/g }, { 'base': 'o', 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g }, { 'base': 'oi', 'letters': /[\u01A3]/g }, { 'base': 'ou', 'letters': /[\u0223]/g }, { 'base': 'oo', 'letters': /[\uA74F]/g }, { 'base': 'p', 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g }, { 'base': 'q', 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g }, { 'base': 'r', 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g }, { 'base': 's', 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g }, { 'base': 't', 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g }, { 'base': 'tz', 'letters': /[\uA729]/g }, { 'base': 'u', 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g }, { 'base': 'v', 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g }, { 'base': 'vy', 'letters': /[\uA761]/g }, { 'base': 'w', 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g }, { 'base': 'x', 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g }, { 'base': 'y', 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g }, { 'base': 'z', 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g }]; function stripDiacritics(str) { for (var i = 0; i < map.length; i++) { str = str.replace(map[i].letters, map[i].base); } return str; } function trim(str) { return str.replace(/^\s+|\s+$/g, ''); } function filterOptions(options, filterValue, excludeOptions, props) { var _this = this; if (props.ignoreAccents) { filterValue = stripDiacritics(filterValue); } if (props.ignoreCase) { filterValue = filterValue.toLowerCase(); } if (props.trimFilter) { filterValue = trim(filterValue); } if (excludeOptions) excludeOptions = excludeOptions.map(function (i) { return i[props.valueKey]; }); return options.filter(function (option) { if (excludeOptions && excludeOptions.indexOf(option[props.valueKey]) > -1) return false; if (props.filterOption) return props.filterOption.call(_this, option, filterValue); if (!filterValue) return true; var valueTest = String(option[props.valueKey]); var labelTest = String(option[props.labelKey]); if (props.ignoreAccents) { if (props.matchProp !== 'label') valueTest = stripDiacritics(valueTest); if (props.matchProp !== 'value') labelTest = stripDiacritics(labelTest); } if (props.ignoreCase) { if (props.matchProp !== 'label') valueTest = valueTest.toLowerCase(); if (props.matchProp !== 'value') labelTest = labelTest.toLowerCase(); } return props.matchPos === 'start' ? props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0; }); } function menuRenderer(_ref) { var focusedOption = _ref.focusedOption, focusOption = _ref.focusOption, inputValue = _ref.inputValue, instancePrefix = _ref.instancePrefix, labelKey = _ref.labelKey, onFocus = _ref.onFocus, onOptionRef = _ref.onOptionRef, onSelect = _ref.onSelect, optionClassName = _ref.optionClassName, optionComponent = _ref.optionComponent, optionRenderer = _ref.optionRenderer, options = _ref.options, removeValue = _ref.removeValue, selectValue = _ref.selectValue, valueArray = _ref.valueArray, valueKey = _ref.valueKey; var Option = optionComponent; return options.map(function (option, i) { var isSelected = valueArray && valueArray.some(function (x) { return x[valueKey] == option[valueKey]; }); var isFocused = option === focusedOption; var optionClass = classNames(optionClassName, { 'Select-option': true, 'is-selected': isSelected, 'is-focused': isFocused, 'is-disabled': option.disabled }); return React.createElement( Option, { className: optionClass, focusOption: focusOption, inputValue: inputValue, instancePrefix: instancePrefix, isDisabled: option.disabled, isFocused: isFocused, isSelected: isSelected, key: 'option-' + i + '-' + option[valueKey], onFocus: onFocus, onSelect: onSelect, option: option, optionIndex: i, ref: function ref(_ref2) { onOptionRef(_ref2, isFocused); }, removeValue: removeValue, selectValue: selectValue }, optionRenderer(option, i, inputValue) ); }); } function clearRenderer() { return React.createElement('span', { className: 'Select-clear', dangerouslySetInnerHTML: { __html: '&times;' } }); } var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var asyncGenerator = function () { function AwaitValue(value) { this.value = value; } function AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; if (value instanceof AwaitValue) { Promise.resolve(value.value).then(function (arg) { resume("next", arg); }, function (arg) { resume("throw", arg); }); } else { settle(result.done ? "return" : "normal", result.value); } } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen.return !== "function") { this.return = undefined; } } if (typeof Symbol === "function" && Symbol.asyncIterator) { AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; } AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }; AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); }; return { wrap: function (fn) { return function () { return new AsyncGenerator(fn.apply(this, arguments)); }; }, await: function (value) { return new AwaitValue(value); } }; }(); var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; var possibleConstructorReturn = function (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; }; var Option = function (_React$Component) { inherits(Option, _React$Component); function Option(props) { classCallCheck(this, Option); var _this = possibleConstructorReturn(this, (Option.__proto__ || Object.getPrototypeOf(Option)).call(this, props)); _this.handleMouseDown = _this.handleMouseDown.bind(_this); _this.handleMouseEnter = _this.handleMouseEnter.bind(_this); _this.handleMouseMove = _this.handleMouseMove.bind(_this); _this.handleTouchStart = _this.handleTouchStart.bind(_this); _this.handleTouchEnd = _this.handleTouchEnd.bind(_this); _this.handleTouchMove = _this.handleTouchMove.bind(_this); _this.onFocus = _this.onFocus.bind(_this); return _this; } createClass(Option, [{ key: 'blockEvent', value: function blockEvent(event) { event.preventDefault(); event.stopPropagation(); if (event.target.tagName !== 'A' || !('href' in event.target)) { return; } if (event.target.target) { window.open(event.target.href, event.target.target); } else { window.location.href = event.target.href; } } }, { key: 'handleMouseDown', value: function handleMouseDown(event) { event.preventDefault(); event.stopPropagation(); this.props.onSelect(this.props.option, event); } }, { key: 'handleMouseEnter', value: function handleMouseEnter(event) { this.onFocus(event); } }, { key: 'handleMouseMove', value: function handleMouseMove(event) { this.onFocus(event); } }, { key: 'handleTouchEnd', value: function handleTouchEnd(event) { // Check if the view is being dragged, In this case // we don't want to fire the click event (because the user only wants to scroll) if (this.dragging) return; this.handleMouseDown(event); } }, { key: 'handleTouchMove', value: function handleTouchMove(event) { // Set a flag that the view is being dragged this.dragging = true; } }, { key: 'handleTouchStart', value: function handleTouchStart(event) { // Set a flag that the view is not being dragged this.dragging = false; } }, { key: 'onFocus', value: function onFocus(event) { if (!this.props.isFocused) { this.props.onFocus(this.props.option, event); } } }, { key: 'render', value: function render() { var _props = this.props, option = _props.option, instancePrefix = _props.instancePrefix, optionIndex = _props.optionIndex; var className = classNames(this.props.className, option.className); return option.disabled ? React.createElement( 'div', { className: className, onMouseDown: this.blockEvent, onClick: this.blockEvent }, this.props.children ) : React.createElement( 'div', { className: className, style: option.style, role: 'option', 'aria-label': option.label, onMouseDown: this.handleMouseDown, onMouseEnter: this.handleMouseEnter, onMouseMove: this.handleMouseMove, onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove, onTouchEnd: this.handleTouchEnd, id: instancePrefix + '-option-' + optionIndex, title: option.title }, this.props.children ); } }]); return Option; }(React.Component); Option.propTypes = { children: PropTypes.node, className: PropTypes.string, // className (based on mouse position) instancePrefix: PropTypes.string.isRequired, // unique prefix for the ids (used for aria) isDisabled: PropTypes.bool, // the option is disabled isFocused: PropTypes.bool, // the option is focused isSelected: PropTypes.bool, // the option is selected onFocus: PropTypes.func, // method to handle mouseEnter on option element onSelect: PropTypes.func, // method to handle click on option element onUnfocus: PropTypes.func, // method to handle mouseLeave on option element option: PropTypes.object.isRequired, // object that is base for that option optionIndex: PropTypes.number // index of the option, used to generate unique ids for aria }; var Value = function (_React$Component) { inherits(Value, _React$Component); function Value(props) { classCallCheck(this, Value); var _this = possibleConstructorReturn(this, (Value.__proto__ || Object.getPrototypeOf(Value)).call(this, props)); _this.handleMouseDown = _this.handleMouseDown.bind(_this); _this.onRemove = _this.onRemove.bind(_this); _this.handleTouchEndRemove = _this.handleTouchEndRemove.bind(_this); _this.handleTouchMove = _this.handleTouchMove.bind(_this); _this.handleTouchStart = _this.handleTouchStart.bind(_this); return _this; } createClass(Value, [{ key: 'handleMouseDown', value: function handleMouseDown(event) { if (event.type === 'mousedown' && event.button !== 0) { return; } if (this.props.onClick) { event.stopPropagation(); this.props.onClick(this.props.value, event); return; } if (this.props.value.href) { event.stopPropagation(); } } }, { key: 'onRemove', value: function onRemove(event) { event.preventDefault(); event.stopPropagation(); this.props.onRemove(this.props.value); } }, { key: 'handleTouchEndRemove', value: function handleTouchEndRemove(event) { // Check if the view is being dragged, In this case // we don't want to fire the click event (because the user only wants to scroll) if (this.dragging) return; // Fire the mouse events this.onRemove(event); } }, { key: 'handleTouchMove', value: function handleTouchMove(event) { // Set a flag that the view is being dragged this.dragging = true; } }, { key: 'handleTouchStart', value: function handleTouchStart(event) { // Set a flag that the view is not being dragged this.dragging = false; } }, { key: 'renderRemoveIcon', value: function renderRemoveIcon() { if (this.props.disabled || !this.props.onRemove) return; return React.createElement( 'span', { className: 'Select-value-icon', 'aria-hidden': 'true', onMouseDown: this.onRemove, onTouchEnd: this.handleTouchEndRemove, onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove }, '\xD7' ); } }, { key: 'renderLabel', value: function renderLabel() { var className = 'Select-value-label'; return this.props.onClick || this.props.value.href ? React.createElement( 'a', { className: className, href: this.props.value.href, target: this.props.value.target, onMouseDown: this.handleMouseDown, onTouchEnd: this.handleMouseDown }, this.props.children ) : React.createElement( 'span', { className: className, role: 'option', 'aria-selected': 'true', id: this.props.id }, this.props.children ); } }, { key: 'render', value: function render() { return React.createElement( 'div', { className: classNames('Select-value', this.props.value.className), style: this.props.value.style, title: this.props.value.title }, this.renderRemoveIcon(), this.renderLabel() ); } }]); return Value; }(React.Component); Value.propTypes = { children: PropTypes.node, disabled: PropTypes.bool, // disabled prop passed to ReactSelect id: PropTypes.string, // Unique id for the value - used for aria onClick: PropTypes.func, // method to handle click on value label onRemove: PropTypes.func, // method to handle removal of the value value: PropTypes.object.isRequired // the option object for this value }; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/react-select */ var stringifyValue = function stringifyValue(value) { return typeof value === 'string' ? value : value !== null && JSON.stringify(value) || ''; }; var stringOrNode = PropTypes.oneOfType([PropTypes.string, PropTypes.node]); var stringOrNumber = PropTypes.oneOfType([PropTypes.string, PropTypes.number]); var instanceId = 1; var Select$1 = function (_React$Component) { inherits(Select, _React$Component); function Select(props) { classCallCheck(this, Select); var _this = possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props)); ['clearValue', 'focusOption', 'handleInputBlur', 'handleInputChange', 'handleInputFocus', 'handleInputValueChange', 'handleKeyDown', 'handleMenuScroll', 'handleMouseDown', 'handleMouseDownOnArrow', 'handleMouseDownOnMenu', 'handleRequired', 'handleTouchOutside', 'handleTouchMove', 'handleTouchStart', 'handleTouchEnd', 'handleTouchEndClearValue', 'handleValueClick', 'getOptionLabel', 'onOptionRef', 'removeValue', 'selectValue'].forEach(function (fn) { return _this[fn] = _this[fn].bind(_this); }); _this.state = { inputValue: '', isFocused: false, isOpen: false, isPseudoFocused: false, required: false }; return _this; } createClass(Select, [{ key: 'componentWillMount', value: function componentWillMount() { this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-'; var valueArray = this.getValueArray(this.props.value); if (this.props.required) { this.setState({ required: this.handleRequired(valueArray[0], this.props.multi) }); } } }, { key: 'componentDidMount', value: function componentDidMount() { if (typeof this.props.autofocus !== 'undefined' && typeof console !== 'undefined') { console.warn('Warning: The autofocus prop has changed to autoFocus, support will be removed after react-select@1.0'); } if (this.props.autoFocus || this.props.autofocus) { this.focus(); } } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { var valueArray = this.getValueArray(nextProps.value, nextProps); if (nextProps.required) { this.setState({ required: this.handleRequired(valueArray[0], nextProps.multi) }); } else if (this.props.required) { // Used to be required but it's not any more this.setState({ required: false }); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps, prevState) { // focus to the selected option if (this.menu && this.focused && this.state.isOpen && !this.hasScrolledToOption) { var focusedOptionNode = findDOMNode(this.focused); var menuNode = findDOMNode(this.menu); var scrollTop = menuNode.scrollTop; var scrollBottom = scrollTop + menuNode.offsetHeight; var optionTop = focusedOptionNode.offsetTop; var optionBottom = optionTop + focusedOptionNode.offsetHeight; if (scrollTop > optionTop || scrollBottom < optionBottom) { menuNode.scrollTop = focusedOptionNode.offsetTop; } // We still set hasScrolledToOption to true even if we didn't // actually need to scroll, as we've still confirmed that the // option is in view. this.hasScrolledToOption = true; } else if (!this.state.isOpen) { this.hasScrolledToOption = false; } if (this._scrollToFocusedOptionOnUpdate && this.focused && this.menu) { this._scrollToFocusedOptionOnUpdate = false; var focusedDOM = findDOMNode(this.focused); var menuDOM = findDOMNode(this.menu); var focusedRect = focusedDOM.getBoundingClientRect(); var menuRect = menuDOM.getBoundingClientRect(); if (focusedRect.bottom > menuRect.bottom) { menuDOM.scrollTop = focusedDOM.offsetTop + focusedDOM.clientHeight - menuDOM.offsetHeight; } else if (focusedRect.top < menuRect.top) { menuDOM.scrollTop = focusedDOM.offsetTop; } } if (this.props.scrollMenuIntoView && this.menuContainer) { var menuContainerRect = this.menuContainer.getBoundingClientRect(); if (window.innerHeight < menuContainerRect.bottom + this.props.menuBuffer) { window.scrollBy(0, menuContainerRect.bottom + this.props.menuBuffer - window.innerHeight); } } if (prevProps.disabled !== this.props.disabled) { this.setState({ isFocused: false }); // eslint-disable-line react/no-did-update-set-state this.closeMenu(); } if (prevState.isOpen !== this.state.isOpen) { this.toggleTouchOutsideEvent(this.state.isOpen); var handler = this.state.isOpen ? this.props.onOpen : this.props.onClose; handler && handler(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.toggleTouchOutsideEvent(false); } }, { key: 'toggleTouchOutsideEvent', value: function toggleTouchOutsideEvent(enabled) { if (enabled) { if (!document.addEventListener && document.attachEvent) { document.attachEvent('ontouchstart', this.handleTouchOutside); } else { document.addEventListener('touchstart', this.handleTouchOutside); } } else { if (!document.removeEventListener && document.detachEvent) { document.detachEvent('ontouchstart', this.handleTouchOutside); } else { document.removeEventListener('touchstart', this.handleTouchOutside); } } } }, { key: 'handleTouchOutside', value: function handleTouchOutside(event) { // handle touch outside on ios to dismiss menu if (this.wrapper && !this.wrapper.contains(event.target)) { this.closeMenu(); } } }, { key: 'focus', value: function focus() { if (!this.input) return; this.input.focus(); } }, { key: 'blurInput', value: function blurInput() { if (!this.input) return; this.input.blur(); } }, { key: 'handleTouchMove', value: function handleTouchMove(event) { // Set a flag that the view is being dragged this.dragging = true; } }, { key: 'handleTouchStart', value: function handleTouchStart(event) { // Set a flag that the view is not being dragged this.dragging = false; } }, { key: 'handleTouchEnd', value: function handleTouchEnd(event) { // Check if the view is being dragged, In this case // we don't want to fire the click event (because the user only wants to scroll) if (this.dragging) return; // Fire the mouse events this.handleMouseDown(event); } }, { key: 'handleTouchEndClearValue', value: function handleTouchEndClearValue(event) { // Check if the view is being dragged, In this case // we don't want to fire the click event (because the user only wants to scroll) if (this.dragging) return; // Clear the value this.clearValue(event); } }, { key: 'handleMouseDown', value: function handleMouseDown(event) { // if the event was triggered by a mousedown and not the primary // button, or if the component is disabled, ignore it. if (this.props.disabled || event.type === 'mousedown' && event.button !== 0) { return; } if (event.target.tagName === 'INPUT') { if (!this.state.isFocused) { this._openAfterFocus = this.props.openOnClick; this.focus(); } else if (!this.state.isOpen) { this.setState({ isOpen: true, isPseudoFocused: false }); } return; } // prevent default event handlers event.preventDefault(); // for the non-searchable select, toggle the menu if (!this.props.searchable) { // TODO: This code means that if a select is searchable, onClick the options menu will not appear, only on subsequent click will it open. this.focus(); return this.setState({ isOpen: !this.state.isOpen }); } if (this.state.isFocused) { // On iOS, we can get into a state where we think the input is focused but it isn't really, // since iOS ignores programmatic calls to input.focus() that weren't triggered by a click event. // Call focus() again here to be safe. this.focus(); var input = this.input; if (typeof input.getInput === 'function') { // Get the actual DOM input if the ref is an <AutosizeInput /> component input = input.getInput(); } // clears the value so that the cursor will be at the end of input when the component re-renders input.value = ''; // if the input is focused, ensure the menu is open this.setState({ isOpen: true, isPseudoFocused: false }); } else { // otherwise, focus the input and open the menu this._openAfterFocus = this.props.openOnClick; this.focus(); } } }, { key: 'handleMouseDownOnArrow', value: function handleMouseDownOnArrow(event) { // if the event was triggered by a mousedown and not the primary // button, or if the component is disabled, ignore it. if (this.props.disabled || event.type === 'mousedown' && event.button !== 0) { return; } // If the menu isn't open, let the event bubble to the main handleMouseDown if (!this.state.isOpen) { this.setState({ isOpen: true }); } // prevent default event handlers event.stopPropagation(); event.preventDefault(); // close the menu if (this.state.isOpen) { this.closeMenu(); } } }, { key: 'handleMouseDownOnMenu', value: function handleMouseDownOnMenu(event) { // if the event was triggered by a mousedown and not the primary // button, or if the component is disabled, ignore it. if (this.props.disabled || event.type === 'mousedown' && event.button !== 0) { return; } event.stopPropagation(); event.preventDefault(); this._openAfterFocus = true; this.focus(); } }, { key: 'closeMenu', value: function closeMenu() { if (this.props.onCloseResetsInput) { this.setState({ isOpen: false, isPseudoFocused: this.state.isFocused && !this.props.multi, inputValue: this.handleInputValueChange('') }); } else { this.setState({ isOpen: false, isPseudoFocused: this.state.isFocused && !this.props.multi }); } this.hasScrolledToOption = false; } }, { key: 'handleInputFocus', value: function handleInputFocus(event) { if (this.props.disabled) return; var isOpen = this.state.isOpen || this._openAfterFocus || this.props.openOnFocus; if (this.props.onFocus) { this.props.onFocus(event); } this.setState({ isFocused: true, isOpen: isOpen }); this._openAfterFocus = false; } }, { key: 'handleInputBlur', value: function handleInputBlur(event) { // The check for menu.contains(activeElement) is necessary to prevent IE11's scrollbar from closing the menu in certain contexts. if (this.menu && (this.menu === document.activeElement || this.menu.contains(document.activeElement))) { this.focus(); return; } if (this.props.onBlur) { this.props.onBlur(event); } var onBlurredState = { isFocused: false, isOpen: false, isPseudoFocused: false }; if (this.props.onBlurResetsInput) { onBlurredState.inputValue = this.handleInputValueChange(''); } this.setState(onBlurredState); } }, { key: 'handleInputChange', value: function handleInputChange(event) { var newInputValue = event.target.value; if (this.state.inputValue !== event.target.value) { newInputValue = this.handleInputValueChange(newInputValue); } this.setState({ isOpen: true, isPseudoFocused: false, inputValue: newInputValue }); } }, { key: 'handleInputValueChange', value: function handleInputValueChange(newValue) { if (this.props.onInputChange) { var nextState = this.props.onInputChange(newValue); // Note: != used deliberately here to catch undefined and null if (nextState != null && (typeof nextState === 'undefined' ? 'undefined' : _typeof(nextState)) !== 'object') { newValue = '' + nextState; } } return newValue; } }, { key: 'handleKeyDown', value: function handleKeyDown(event) { if (this.props.disabled) return; if (typeof this.props.onInputKeyDown === 'function') { this.props.onInputKeyDown(event); if (event.defaultPrevented) { return; } } switch (event.keyCode) { case 8: // backspace if (!this.state.inputValue && this.props.backspaceRemoves) { event.preventDefault(); this.popValue(); } return; case 9: // tab if (event.shiftKey || !this.state.isOpen || !this.props.tabSelectsValue) { return; } event.preventDefault(); this.selectFocusedOption(); return; case 13: // enter event.preventDefault(); event.stopPropagation(); if (this.state.isOpen) { this.selectFocusedOption(); } else { this.focusNextOption(); } return; break; case 27: // escape if (this.state.isOpen) { this.closeMenu(); event.stopPropagation(); } else if (this.props.clearable && this.props.escapeClearsValue) { this.clearValue(event); event.stopPropagation(); } break; case 32: // space if (this.props.searchable) { return; } event.preventDefault(); if (!this.state.isOpen) { this.focusNextOption(); return; } event.stopPropagation(); this.selectFocusedOption(); break; case 38: // up this.focusPreviousOption(); break; case 40: // down this.focusNextOption(); break; case 33: // page up this.focusPageUpOption(); break; case 34: // page down this.focusPageDownOption(); break; case 35: // end key if (event.shiftKey) { return; } this.focusEndOption(); break; case 36: // home key if (event.shiftKey) { return; } this.focusStartOption(); break; case 46: // delete if (!this.state.inputValue && this.props.deleteRemoves) { event.preventDefault(); this.popValue(); } return; default: return; } event.preventDefault(); } }, { key: 'handleValueClick', value: function handleValueClick(option, event) { if (!this.props.onValueClick) return; this.props.onValueClick(option, event); } }, { key: 'handleMenuScroll', value: function handleMenuScroll(event) { if (!this.props.onMenuScrollToBottom) return; var target = event.target; if (target.scrollHeight > target.offsetHeight && target.scrollHeight - target.offsetHeight - target.scrollTop <= 0) { this.props.onMenuScrollToBottom(); } } }, { key: 'handleRequired', value: function handleRequired(value, multi) { if (!value) return true; return multi ? value.length === 0 : Object.keys(value).length === 0; } }, { key: 'getOptionLabel', value: function getOptionLabel(op) { return op[this.props.labelKey]; } /** * Turns a value into an array from the given options * @param {String|Number|Array} value - the value of the select input * @param {Object} nextProps - optionally specify the nextProps so the returned array uses the latest configuration * @returns {Array} the value of the select represented in an array */ }, { key: 'getValueArray', value: function getValueArray(value, nextProps) { var _this2 = this; /** support optionally passing in the `nextProps` so `componentWillReceiveProps` updates will function as expected */ var props = (typeof nextProps === 'undefined' ? 'undefined' : _typeof(nextProps)) === 'object' ? nextProps : this.props; if (props.multi) { if (typeof value === 'string') { value = value.split(props.delimiter); } if (!Array.isArray(value)) { if (value === null || value === undefined) return []; value = [value]; } return value.map(function (value) { return _this2.expandValue(value, props); }).filter(function (i) { return i; }); } var expandedValue = this.expandValue(value, props); return expandedValue ? [expandedValue] : []; } /** * Retrieve a value from the given options and valueKey * @param {String|Number|Array} value - the selected value(s) * @param {Object} props - the Select component's props (or nextProps) */ }, { key: 'expandValue', value: function expandValue(value, props) { var valueType = typeof value === 'undefined' ? 'undefined' : _typeof(value); if (valueType !== 'string' && valueType !== 'number' && valueType !== 'boolean') return value; var options = props.options, valueKey = props.valueKey; if (!options) return; for (var i = 0; i < options.length; i++) { if (String(options[i][valueKey]) === String(value)) return options[i]; } } }, { key: 'setValue', value: function setValue(value) { var _this3 = this; if (this.props.autoBlur) { this.blurInput(); } if (this.props.required) { var required = this.handleRequired(value, this.props.multi); this.setState({ required: required }); } if (this.props.onChange) { if (this.props.simpleValue && value) { value = this.props.multi ? value.map(function (i) { return i[_this3.props.valueKey]; }).join(this.props.delimiter) : value[this.props.valueKey]; } this.props.onChange(value); } } }, { key: 'selectValue', value: function selectValue(value) { var _this4 = this; // NOTE: we actually add/set the value in a callback to make sure the // input value is empty to avoid styling issues in Chrome if (this.props.closeOnSelect) { this.hasScrolledToOption = false; } if (this.props.multi) { var updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue; this.setState({ focusedIndex: null, inputValue: this.handleInputValueChange(updatedValue), isOpen: !this.props.closeOnSelect }, function () { var valueArray = _this4.getValueArray(_this4.props.value); if (valueArray.some(function (i) { return i[_this4.props.valueKey] === value[_this4.props.valueKey]; })) { _this4.removeValue(value); } else { _this4.addValue(value); } }); } else { this.setState({ inputValue: this.handleInputValueChange(''), isOpen: !this.props.closeOnSelect, isPseudoFocused: this.state.isFocused }, function () { _this4.setValue(value); }); } } }, { key: 'addValue', value: function addValue(value) { var valueArray = this.getValueArray(this.props.value); var visibleOptions = this._visibleOptions.filter(function (val) { return !val.disabled; }); var lastValueIndex = visibleOptions.indexOf(value); this.setValue(valueArray.concat(value)); if (visibleOptions.length - 1 === lastValueIndex) { // the last option was selected; focus the second-last one this.focusOption(visibleOptions[lastValueIndex - 1]); } else if (visibleOptions.length > lastValueIndex) { // focus the option below the selected one this.focusOption(visibleOptions[lastValueIndex + 1]); } } }, { key: 'popValue', value: function popValue() { var valueArray = this.getValueArray(this.props.value); if (!valueArray.length) return; if (valueArray[valueArray.length - 1].clearableValue === false) return; this.setValue(this.props.multi ? valueArray.slice(0, valueArray.length - 1) : null); } }, { key: 'removeValue', value: function removeValue(value) { var _this5 = this; var valueArray = this.getValueArray(this.props.value); this.setValue(valueArray.filter(function (i) { return i[_this5.props.valueKey] !== value[_this5.props.valueKey]; })); this.focus(); } }, { key: 'clearValue', value: function clearValue(event) { // if the event was triggered by a mousedown and not the primary // button, ignore it. if (event && event.type === 'mousedown' && event.button !== 0) { return; } event.preventDefault(); this.setValue(this.getResetValue()); this.setState({ isOpen: false, inputValue: this.handleInputValueChange('') }, this.focus); } }, { key: 'getResetValue', value: function getResetValue() { if (this.props.resetValue !== undefined) { return this.props.resetValue; } else if (this.props.multi) { return []; } else { return null; } } }, { key: 'focusOption', value: function focusOption(option) { this.setState({ focusedOption: option }); } }, { key: 'focusNextOption', value: function focusNextOption() { this.focusAdjacentOption('next'); } }, { key: 'focusPreviousOption', value: function focusPreviousOption() { this.focusAdjacentOption('previous'); } }, { key: 'focusPageUpOption', value: function focusPageUpOption() { this.focusAdjacentOption('page_up'); } }, { key: 'focusPageDownOption', value: function focusPageDownOption() { this.focusAdjacentOption('page_down'); } }, { key: 'focusStartOption', value: function focusStartOption() { this.focusAdjacentOption('start'); } }, { key: 'focusEndOption', value: function focusEndOption() { this.focusAdjacentOption('end'); } }, { key: 'focusAdjacentOption', value: function focusAdjacentOption(dir) { var options = this._visibleOptions.map(function (option, index) { return { option: option, index: index }; }).filter(function (option) { return !option.option.disabled; }); this._scrollToFocusedOptionOnUpdate = true; if (!this.state.isOpen) { this.setState({ isOpen: true, inputValue: '', focusedOption: this._focusedOption || (options.length ? options[dir === 'next' ? 0 : options.length - 1].option : null) }); return; } if (!options.length) return; var focusedIndex = -1; for (var i = 0; i < options.length; i++) { if (this._focusedOption === options[i].option) { focusedIndex = i; break; } } if (dir === 'next' && focusedIndex !== -1) { focusedIndex = (focusedIndex + 1) % options.length; } else if (dir === 'previous') { if (focusedIndex > 0) { focusedIndex = focusedIndex - 1; } else { focusedIndex = options.length - 1; } } else if (dir === 'start') { focusedIndex = 0; } else if (dir === 'end') { focusedIndex = options.length - 1; } else if (dir === 'page_up') { var potentialIndex = focusedIndex - this.props.pageSize; if (potentialIndex < 0) { focusedIndex = 0; } else { focusedIndex = potentialIndex; } } else if (dir === 'page_down') { var potentialIndex = focusedIndex + this.props.pageSize; if (potentialIndex > options.length - 1) { focusedIndex = options.length - 1; } else { focusedIndex = potentialIndex; } } if (focusedIndex === -1) { focusedIndex = 0; } this.setState({ focusedIndex: options[focusedIndex].index, focusedOption: options[focusedIndex].option }); } }, { key: 'getFocusedOption', value: function getFocusedOption() { return this._focusedOption; } }, { key: 'selectFocusedOption', value: function selectFocusedOption() { if (this._focusedOption) { return this.selectValue(this._focusedOption); } } }, { key: 'renderLoading', value: function renderLoading() { if (!this.props.isLoading) return; return React.createElement( 'span', { className: 'Select-loading-zone', 'aria-hidden': 'true' }, React.createElement('span', { className: 'Select-loading' }) ); } }, { key: 'renderValue', value: function renderValue(valueArray, isOpen) { var _this6 = this; var renderLabel = this.props.valueRenderer || this.getOptionLabel; var ValueComponent = this.props.valueComponent; if (!valueArray.length) { return !this.state.inputValue ? React.createElement( 'div', { className: 'Select-placeholder' }, this.props.placeholder ) : null; } var onClick = this.props.onValueClick ? this.handleValueClick : null; if (this.props.multi) { return valueArray.map(function (value, i) { return React.createElement( ValueComponent, { id: _this6._instancePrefix + '-value-' + i, instancePrefix: _this6._instancePrefix, disabled: _this6.props.disabled || value.clearableValue === false, key: 'value-' + i + '-' + value[_this6.props.valueKey], onClick: onClick, onRemove: _this6.removeValue, value: value }, renderLabel(value, i), React.createElement( 'span', { className: 'Select-aria-only' }, '\xA0' ) ); }); } else if (!this.state.inputValue) { if (isOpen) onClick = null; return React.createElement( ValueComponent, { id: this._instancePrefix + '-value-item', disabled: this.props.disabled, instancePrefix: this._instancePrefix, onClick: onClick, value: valueArray[0] }, renderLabel(valueArray[0]) ); } } }, { key: 'renderInput', value: function renderInput(valueArray, focusedOptionIndex) { var _classNames, _this7 = this; var className = classNames('Select-input', this.props.inputProps.className); var isOpen = !!this.state.isOpen; var ariaOwns = classNames((_classNames = {}, defineProperty(_classNames, this._instancePrefix + '-list', isOpen), defineProperty(_classNames, this._instancePrefix + '-backspace-remove-message', this.props.multi && !this.props.disabled && this.state.isFocused && !this.state.inputValue), _classNames)); var inputProps = _extends({}, this.props.inputProps, { role: 'combobox', 'aria-expanded': '' + isOpen, 'aria-owns': ariaOwns, 'aria-haspopup': '' + isOpen, 'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value', 'aria-describedby': this.props['aria-describedby'], 'aria-labelledby': this.props['aria-labelledby'], 'aria-label': this.props['aria-label'], className: className, tabIndex: this.props.tabIndex, onBlur: this.handleInputBlur, onChange: this.handleInputChange, onFocus: this.handleInputFocus, ref: function ref(_ref) { return _this7.input = _ref; }, required: this.state.required, value: this.state.inputValue }); if (this.props.inputRenderer) { return this.props.inputRenderer(inputProps); } if (this.props.disabled || !this.props.searchable) { var _props$inputProps = this.props.inputProps, inputClassName = _props$inputProps.inputClassName, divProps = objectWithoutProperties(_props$inputProps, ['inputClassName']); var _ariaOwns = classNames(defineProperty({}, this._instancePrefix + '-list', isOpen)); return React.createElement('div', _extends({}, divProps, { role: 'combobox', 'aria-expanded': isOpen, 'aria-owns': _ariaOwns, 'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value', 'aria-labelledby': this.props['aria-labelledby'], 'aria-label': this.props['aria-label'], className: className, tabIndex: this.props.tabIndex || 0, onBlur: this.handleInputBlur, onFocus: this.handleInputFocus, ref: function ref(_ref2) { return _this7.input = _ref2; }, 'aria-disabled': '' + !!this.props.disabled, style: { border: 0, width: 1, display: 'inline-block' } })); } if (this.props.autosize) { return React.createElement(AutosizeInput, _extends({ id: this.props.id }, inputProps, { minWidth: '5' })); } return React.createElement( 'div', { className: className, key: 'input-wrap' }, React.createElement('input', _extends({ id: this.props.id }, inputProps)) ); } }, { key: 'renderClear', value: function renderClear() { var valueArray = this.getValueArray(this.props.value); if (!this.props.clearable || !valueArray.length || this.props.disabled || this.props.isLoading) return; var clear = this.props.clearRenderer(); return React.createElement( 'span', { className: 'Select-clear-zone', title: this.props.multi ? this.props.clearAllText : this.props.clearValueText, 'aria-label': this.props.multi ? this.props.clearAllText : this.props.clearValueText, onMouseDown: this.clearValue, onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove, onTouchEnd: this.handleTouchEndClearValue }, clear ); } }, { key: 'renderArrow', value: function renderArrow() { if (!this.props.arrowRenderer) return; var onMouseDown = this.handleMouseDownOnArrow; var isOpen = this.state.isOpen; var arrow = this.props.arrowRenderer({ onMouseDown: onMouseDown, isOpen: isOpen }); if (!arrow) { return null; } return React.createElement( 'span', { className: 'Select-arrow-zone', onMouseDown: onMouseDown }, arrow ); } }, { key: 'filterOptions', value: function filterOptions$$1(excludeOptions) { var filterValue = this.state.inputValue; var options = this.props.options || []; if (this.props.filterOptions) { // Maintain backwards compatibility with boolean attribute var filterOptions$$1 = typeof this.props.filterOptions === 'function' ? this.props.filterOptions : filterOptions; return filterOptions$$1(options, filterValue, excludeOptions, { filterOption: this.props.filterOption, ignoreAccents: this.props.ignoreAccents, ignoreCase: this.props.ignoreCase, labelKey: this.props.labelKey, matchPos: this.props.matchPos, matchProp: this.props.matchProp, valueKey: this.props.valueKey, trimFilter: this.props.trimFilter }); } else { return options; } } }, { key: 'onOptionRef', value: function onOptionRef(ref, isFocused) { if (isFocused) { this.focused = ref; } } }, { key: 'renderMenu', value: function renderMenu(options, valueArray, focusedOption) { if (options && options.length) { return this.props.menuRenderer({ focusedOption: focusedOption, focusOption: this.focusOption, inputValue: this.state.inputValue, instancePrefix: this._instancePrefix, labelKey: this.props.labelKey, onFocus: this.focusOption, onSelect: this.selectValue, optionClassName: this.props.optionClassName, optionComponent: this.props.optionComponent, optionRenderer: this.props.optionRenderer || this.getOptionLabel, options: options, selectValue: this.selectValue, removeValue: this.removeValue, valueArray: valueArray, valueKey: this.props.valueKey, onOptionRef: this.onOptionRef }); } else if (this.props.noResultsText) { return React.createElement( 'div', { className: 'Select-noresults' }, this.props.noResultsText ); } else { return null; } } }, { key: 'renderHiddenField', value: function renderHiddenField(valueArray) { var _this8 = this; if (!this.props.name) return; if (this.props.joinValues) { var value = valueArray.map(function (i) { return stringifyValue(i[_this8.props.valueKey]); }).join(this.props.delimiter); return React.createElement('input', { type: 'hidden', ref: function ref(_ref3) { return _this8.value = _ref3; }, name: this.props.name, value: value, disabled: this.props.disabled }); } return valueArray.map(function (item, index) { return React.createElement('input', { key: 'hidden.' + index, type: 'hidden', ref: 'value' + index, name: _this8.props.name, value: stringifyValue(item[_this8.props.valueKey]), disabled: _this8.props.disabled }); }); } }, { key: 'getFocusableOptionIndex', value: function getFocusableOptionIndex(selectedOption) { var options = this._visibleOptions; if (!options.length) return null; var valueKey = this.props.valueKey; var focusedOption = this.state.focusedOption || selectedOption; if (focusedOption && !focusedOption.disabled) { var focusedOptionIndex = -1; options.some(function (option, index) { var isOptionEqual = option[valueKey] === focusedOption[valueKey]; if (isOptionEqual) { focusedOptionIndex = index; } return isOptionEqual; }); if (focusedOptionIndex !== -1) { return focusedOptionIndex; } } for (var i = 0; i < options.length; i++) { if (!options[i].disabled) return i; } return null; } }, { key: 'renderOuter', value: function renderOuter(options, valueArray, focusedOption) { var _this9 = this; var menu = this.renderMenu(options, valueArray, focusedOption); if (!menu) { return null; } return React.createElement( 'div', { ref: function ref(_ref5) { return _this9.menuContainer = _ref5; }, className: 'Select-menu-outer', style: this.props.menuContainerStyle }, React.createElement( 'div', { ref: function ref(_ref4) { return _this9.menu = _ref4; }, role: 'listbox', tabIndex: -1, className: 'Select-menu', id: this._instancePrefix + '-list', style: this.props.menuStyle, onScroll: this.handleMenuScroll, onMouseDown: this.handleMouseDownOnMenu }, menu ) ); } }, { key: 'render', value: function render() { var _this10 = this; var valueArray = this.getValueArray(this.props.value); var options = this._visibleOptions = this.filterOptions(this.props.multi && this.props.removeSelected ? valueArray : null); var isOpen = this.state.isOpen; if (this.props.multi && !options.length && valueArray.length && !this.state.inputValue) isOpen = false; var focusedOptionIndex = this.getFocusableOptionIndex(valueArray[0]); var focusedOption = null; if (focusedOptionIndex !== null) { focusedOption = this._focusedOption = options[focusedOptionIndex]; } else { focusedOption = this._focusedOption = null; } var className = classNames('Select', this.props.className, { 'Select--multi': this.props.multi, 'Select--single': !this.props.multi, 'is-clearable': this.props.clearable, 'is-disabled': this.props.disabled, 'is-focused': this.state.isFocused, 'is-loading': this.props.isLoading, 'is-open': isOpen, 'is-pseudo-focused': this.state.isPseudoFocused, 'is-searchable': this.props.searchable, 'has-value': valueArray.length, 'Select--rtl': this.props.rtl }); var removeMessage = null; if (this.props.multi && !this.props.disabled && valueArray.length && !this.state.inputValue && this.state.isFocused && this.props.backspaceRemoves) { removeMessage = React.createElement( 'span', { id: this._instancePrefix + '-backspace-remove-message', className: 'Select-aria-only', 'aria-live': 'assertive' }, this.props.backspaceToRemoveMessage.replace('{label}', valueArray[valueArray.length - 1][this.props.labelKey]) ); } return React.createElement( 'div', { ref: function ref(_ref7) { return _this10.wrapper = _ref7; }, className: className, style: this.props.wrapperStyle }, this.renderHiddenField(valueArray), React.createElement( 'div', { ref: function ref(_ref6) { return _this10.control = _ref6; }, className: 'Select-control', style: this.props.style, onKeyDown: this.handleKeyDown, onMouseDown: this.handleMouseDown, onTouchEnd: this.handleTouchEnd, onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove }, React.createElement( 'span', { className: 'Select-multi-value-wrapper', id: this._instancePrefix + '-value' }, this.renderValue(valueArray, isOpen), this.renderInput(valueArray, focusedOptionIndex) ), removeMessage, this.renderLoading(), this.renderClear(), this.renderArrow() ), isOpen ? this.renderOuter(options, valueArray, focusedOption) : null ); } }]); return Select; }(React.Component); Select$1.propTypes = { 'aria-describedby': PropTypes.string, // html id(s) of element(s) that should be used to describe this input (for assistive tech) 'aria-label': PropTypes.string, // aria label (for assistive tech) 'aria-labelledby': PropTypes.string, // html id of an element that should be used as the label (for assistive tech) arrowRenderer: PropTypes.func, // create the drop-down caret element autoBlur: PropTypes.bool, // automatically blur the component when an option is selected autoFocus: PropTypes.bool, // autofocus the component on mount autofocus: PropTypes.bool, // deprecated; use autoFocus instead autosize: PropTypes.bool, // whether to enable autosizing or not backspaceRemoves: PropTypes.bool, // whether backspace removes an item if there is no text input backspaceToRemoveMessage: PropTypes.string, // message to use for screenreaders to press backspace to remove the current item - {label} is replaced with the item label className: PropTypes.string, // className for the outer element clearAllText: stringOrNode, // title for the "clear" control when multi: true clearRenderer: PropTypes.func, // create clearable x element clearValueText: stringOrNode, // title for the "clear" control clearable: PropTypes.bool, // should it be possible to reset value closeOnSelect: PropTypes.bool, // whether to close the menu when a value is selected deleteRemoves: PropTypes.bool, // whether delete removes an item if there is no text input delimiter: PropTypes.string, // delimiter to use to join multiple values for the hidden field value disabled: PropTypes.bool, // whether the Select is disabled or not escapeClearsValue: PropTypes.bool, // whether escape clears the value when the menu is closed filterOption: PropTypes.func, // method to filter a single option (option, filterString) filterOptions: PropTypes.any, // boolean to enable default filtering or function to filter the options array ([options], filterString, [values]) id: PropTypes.string, // html id to set on the input element for accessibility or tests ignoreAccents: PropTypes.bool, // whether to strip diacritics when filtering ignoreCase: PropTypes.bool, // whether to perform case-insensitive filtering inputProps: PropTypes.object, // custom attributes for the Input inputRenderer: PropTypes.func, // returns a custom input component instanceId: PropTypes.string, // set the components instanceId isLoading: PropTypes.bool, // whether the Select is loading externally or not (such as options being loaded) joinValues: PropTypes.bool, // joins multiple values into a single form field with the delimiter (legacy mode) labelKey: PropTypes.string, // path of the label value in option objects matchPos: PropTypes.string, // (any|start) match the start or entire string when filtering matchProp: PropTypes.string, // (any|label|value) which option property to filter on menuBuffer: PropTypes.number, // optional buffer (in px) between the bottom of the viewport and the bottom of the menu menuContainerStyle: PropTypes.object, // optional style to apply to the menu container menuRenderer: PropTypes.func, // renders a custom menu with options menuStyle: PropTypes.object, // optional style to apply to the menu multi: PropTypes.bool, // multi-value input name: PropTypes.string, // generates a hidden <input /> tag with this field name for html forms noResultsText: stringOrNode, // placeholder displayed when there are no matching search results onBlur: PropTypes.func, // onBlur handler: function (event) {} onBlurResetsInput: PropTypes.bool, // whether input is cleared on blur onChange: PropTypes.func, // onChange handler: function (newValue) {} onClose: PropTypes.func, // fires when the menu is closed onCloseResetsInput: PropTypes.bool, // whether input is cleared when menu is closed through the arrow onFocus: PropTypes.func, // onFocus handler: function (event) {} onInputChange: PropTypes.func, // onInputChange handler: function (inputValue) {} onInputKeyDown: PropTypes.func, // input keyDown handler: function (event) {} onMenuScrollToBottom: PropTypes.func, // fires when the menu is scrolled to the bottom; can be used to paginate options onOpen: PropTypes.func, // fires when the menu is opened onSelectResetsInput: PropTypes.bool, // whether input is cleared on select (works only for multiselect) onValueClick: PropTypes.func, // onClick handler for value labels: function (value, event) {} openOnClick: PropTypes.bool, // boolean to control opening the menu when the control is clicked openOnFocus: PropTypes.bool, // always open options menu on focus optionClassName: PropTypes.string, // additional class(es) to apply to the <Option /> elements optionComponent: PropTypes.func, // option component to render in dropdown optionRenderer: PropTypes.func, // optionRenderer: function (option) {} options: PropTypes.array, // array of options pageSize: PropTypes.number, // number of entries to page when using page up/down keys placeholder: stringOrNode, // field placeholder, displayed when there's no value removeSelected: PropTypes.bool, // whether the selected option is removed from the dropdown on multi selects required: PropTypes.bool, // applies HTML5 required attribute when needed resetValue: PropTypes.any, // value to use when you clear the control rtl: PropTypes.bool, // set to true in order to use react-select in right-to-left direction scrollMenuIntoView: PropTypes.bool, // boolean to enable the viewport to shift so that the full menu fully visible when engaged searchable: PropTypes.bool, // whether to enable searching feature or not simpleValue: PropTypes.bool, // pass the value to onChange as a simple value (legacy pre 1.0 mode), defaults to false style: PropTypes.object, // optional style to apply to the control tabIndex: stringOrNumber, // optional tab index of the control tabSelectsValue: PropTypes.bool, // whether to treat tabbing out while focused to be value selection trimFilter: PropTypes.bool, // whether to trim whitespace around filter value value: PropTypes.any, // initial field value valueComponent: PropTypes.func, // value component to render valueKey: PropTypes.string, // path of the label value in option objects valueRenderer: PropTypes.func, // valueRenderer: function (option) {} wrapperStyle: PropTypes.object // optional style to apply to the component wrapper }; Select$1.defaultProps = { arrowRenderer: arrowRenderer, autosize: true, backspaceRemoves: true, backspaceToRemoveMessage: 'Press backspace to remove {label}', clearable: true, clearAllText: 'Clear all', clearRenderer: clearRenderer, clearValueText: 'Clear value', closeOnSelect: true, deleteRemoves: true, delimiter: ',', disabled: false, escapeClearsValue: true, filterOptions: filterOptions, ignoreAccents: true, ignoreCase: true, inputProps: {}, isLoading: false, joinValues: false, labelKey: 'label', matchPos: 'any', matchProp: 'any', menuBuffer: 0, menuRenderer: menuRenderer, multi: false, noResultsText: 'No results found', onBlurResetsInput: true, onSelectResetsInput: true, onCloseResetsInput: true, openOnClick: true, optionComponent: Option, pageSize: 5, placeholder: 'Select...', removeSelected: true, required: false, rtl: false, scrollMenuIntoView: true, searchable: true, simpleValue: false, tabSelectsValue: true, trimFilter: true, valueComponent: Value, valueKey: 'value' }; var propTypes = { autoload: PropTypes.bool.isRequired, // automatically call the `loadOptions` prop on-mount; defaults to true cache: PropTypes.any, // object to use to cache results; set to null/false to disable caching children: PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element ignoreAccents: PropTypes.bool, // strip diacritics when filtering; defaults to true ignoreCase: PropTypes.bool, // perform case-insensitive filtering; defaults to true loadOptions: PropTypes.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise loadingPlaceholder: PropTypes.oneOfType([// replaces the placeholder while options are loading PropTypes.string, PropTypes.node]), multi: PropTypes.bool, // multi-value input noResultsText: PropTypes.oneOfType([// field noResultsText, displayed when no options come back from the server PropTypes.string, PropTypes.node]), onChange: PropTypes.func, // onChange handler: function (newValue) {} onInputChange: PropTypes.func, // optional for keeping track of what is being typed options: PropTypes.array.isRequired, // array of options placeholder: PropTypes.oneOfType([// field placeholder, displayed when there's no value (shared with Select) PropTypes.string, PropTypes.node]), searchPromptText: PropTypes.oneOfType([// label to prompt for search input PropTypes.string, PropTypes.node]), value: PropTypes.any // initial field value }; var defaultCache = {}; var defaultProps = { autoload: true, cache: defaultCache, children: defaultChildren, ignoreAccents: true, ignoreCase: true, loadingPlaceholder: 'Loading...', options: [], searchPromptText: 'Type to search' }; var Async = function (_Component) { inherits(Async, _Component); function Async(props, context) { classCallCheck(this, Async); var _this = possibleConstructorReturn(this, (Async.__proto__ || Object.getPrototypeOf(Async)).call(this, props, context)); _this._cache = props.cache === defaultCache ? {} : props.cache; _this.state = { inputValue: '', isLoading: false, options: props.options }; _this.onInputChange = _this.onInputChange.bind(_this); return _this; } createClass(Async, [{ key: 'componentDidMount', value: function componentDidMount() { var autoload = this.props.autoload; if (autoload) { this.loadOptions(''); } } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (nextProps.options !== this.props.options) { this.setState({ options: nextProps.options }); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this._callback = null; } }, { key: 'loadOptions', value: function loadOptions(inputValue) { var _this2 = this; var loadOptions = this.props.loadOptions; var cache = this._cache; if (cache && Object.prototype.hasOwnProperty.call(cache, inputValue)) { this._callback = null; this.setState({ isLoading: false, options: cache[inputValue] }); return; } var callback = function callback(error, data) { var options = data && data.options || []; if (cache) { cache[inputValue] = options; } if (callback === _this2._callback) { _this2._callback = null; _this2.setState({ isLoading: false, options: options }); } }; // Ignore all but the most recent request this._callback = callback; var promise = loadOptions(inputValue, callback); if (promise) { promise.then(function (data) { return callback(null, data); }, function (error) { return callback(error); }); } if (this._callback && !this.state.isLoading) { this.setState({ isLoading: true }); } } }, { key: 'onInputChange', value: function onInputChange(inputValue) { var _props = this.props, ignoreAccents = _props.ignoreAccents, ignoreCase = _props.ignoreCase, onInputChange = _props.onInputChange; var newInputValue = inputValue; if (onInputChange) { var value = onInputChange(newInputValue); // Note: != used deliberately here to catch undefined and null if (value != null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object') { newInputValue = '' + value; } } var transformedInputValue = newInputValue; if (ignoreAccents) { transformedInputValue = stripDiacritics(transformedInputValue); } if (ignoreCase) { transformedInputValue = transformedInputValue.toLowerCase(); } this.setState({ inputValue: newInputValue }); this.loadOptions(transformedInputValue); // Return new input value, but without applying toLowerCase() to avoid modifying the user's view case of the input while typing. return newInputValue; } }, { key: 'noResultsText', value: function noResultsText() { var _props2 = this.props, loadingPlaceholder = _props2.loadingPlaceholder, noResultsText = _props2.noResultsText, searchPromptText = _props2.searchPromptText; var _state = this.state, inputValue = _state.inputValue, isLoading = _state.isLoading; if (isLoading) { return loadingPlaceholder; } if (inputValue && noResultsText) { return noResultsText; } return searchPromptText; } }, { key: 'focus', value: function focus() { this.select.focus(); } }, { key: 'render', value: function render() { var _this3 = this; var _props3 = this.props, children = _props3.children, loadingPlaceholder = _props3.loadingPlaceholder, multi = _props3.multi, onChange = _props3.onChange, placeholder = _props3.placeholder; var _state2 = this.state, isLoading = _state2.isLoading, options = _state2.options; var props = { noResultsText: this.noResultsText(), placeholder: isLoading ? loadingPlaceholder : placeholder, options: isLoading && loadingPlaceholder ? [] : options, ref: function ref(_ref) { return _this3.select = _ref; } }; return children(_extends({}, this.props, props, { isLoading: isLoading, onInputChange: this.onInputChange })); } }]); return Async; }(Component); Async.propTypes = propTypes; Async.defaultProps = defaultProps; function defaultChildren(props) { return React.createElement(Select$1, props); } var CreatableSelect = function (_React$Component) { inherits(CreatableSelect, _React$Component); function CreatableSelect(props, context) { classCallCheck(this, CreatableSelect); var _this = possibleConstructorReturn(this, (CreatableSelect.__proto__ || Object.getPrototypeOf(CreatableSelect)).call(this, props, context)); _this.filterOptions = _this.filterOptions.bind(_this); _this.menuRenderer = _this.menuRenderer.bind(_this); _this.onInputKeyDown = _this.onInputKeyDown.bind(_this); _this.onInputChange = _this.onInputChange.bind(_this); _this.onOptionSelect = _this.onOptionSelect.bind(_this); return _this; } createClass(CreatableSelect, [{ key: 'createNewOption', value: function createNewOption() { var _props = this.props, isValidNewOption = _props.isValidNewOption, newOptionCreator = _props.newOptionCreator, onNewOptionClick = _props.onNewOptionClick, _props$options = _props.options, options = _props$options === undefined ? [] : _props$options; if (isValidNewOption({ label: this.inputValue })) { var option = newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey }); var _isOptionUnique = this.isOptionUnique({ option: option }); // Don't add the same option twice. if (_isOptionUnique) { if (onNewOptionClick) { onNewOptionClick(option); } else { options.unshift(option); this.select.selectValue(option); } } } } }, { key: 'filterOptions', value: function filterOptions$$1() { var _props2 = this.props, filterOptions$$1 = _props2.filterOptions, isValidNewOption = _props2.isValidNewOption, promptTextCreator = _props2.promptTextCreator; // TRICKY Check currently selected options as well. // Don't display a create-prompt for a value that's selected. // This covers async edge-cases where a newly-created Option isn't yet in the async-loaded array. var excludeOptions = (arguments.length <= 2 ? undefined : arguments[2]) || []; var filteredOptions = filterOptions$$1.apply(undefined, arguments) || []; if (isValidNewOption({ label: this.inputValue })) { var _newOptionCreator = this.props.newOptionCreator; var option = _newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey }); // TRICKY Compare to all options (not just filtered options) in case option has already been selected). // For multi-selects, this would remove it from the filtered list. var _isOptionUnique2 = this.isOptionUnique({ option: option, options: excludeOptions.concat(filteredOptions) }); if (_isOptionUnique2) { var prompt = promptTextCreator(this.inputValue); this._createPlaceholderOption = _newOptionCreator({ label: prompt, labelKey: this.labelKey, valueKey: this.valueKey }); filteredOptions.unshift(this._createPlaceholderOption); } } return filteredOptions; } }, { key: 'isOptionUnique', value: function isOptionUnique(_ref) { var option = _ref.option, options = _ref.options; var isOptionUnique = this.props.isOptionUnique; options = options || this.props.options; return isOptionUnique({ labelKey: this.labelKey, option: option, options: options, valueKey: this.valueKey }); } }, { key: 'menuRenderer', value: function menuRenderer$$1(params) { var menuRenderer$$1 = this.props.menuRenderer; return menuRenderer$$1(_extends({}, params, { onSelect: this.onOptionSelect, selectValue: this.onOptionSelect })); } }, { key: 'onInputChange', value: function onInputChange(input) { var onInputChange = this.props.onInputChange; // This value may be needed in between Select mounts (when this.select is null) this.inputValue = input; if (onInputChange) { this.inputValue = onInputChange(input); } return this.inputValue; } }, { key: 'onInputKeyDown', value: function onInputKeyDown(event) { var _props3 = this.props, shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption, onInputKeyDown = _props3.onInputKeyDown; var focusedOption = this.select.getFocusedOption(); if (focusedOption && focusedOption === this._createPlaceholderOption && shouldKeyDownEventCreateNewOption({ keyCode: event.keyCode })) { this.createNewOption(); // Prevent decorated Select from doing anything additional with this keyDown event event.preventDefault(); } else if (onInputKeyDown) { onInputKeyDown(event); } } }, { key: 'onOptionSelect', value: function onOptionSelect(option, event) { if (option === this._createPlaceholderOption) { this.createNewOption(); } else { this.select.selectValue(option); } } }, { key: 'focus', value: function focus() { this.select.focus(); } }, { key: 'render', value: function render() { var _this2 = this; var _props4 = this.props, newOptionCreator = _props4.newOptionCreator, shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption, refProp = _props4.ref, restProps = objectWithoutProperties(_props4, ['newOptionCreator', 'shouldKeyDownEventCreateNewOption', 'ref']); var children = this.props.children; // We can't use destructuring default values to set the children, // because it won't apply work if `children` is null. A falsy check is // more reliable in real world use-cases. if (!children) { children = defaultChildren$2; } var props = _extends({}, restProps, { allowCreate: true, filterOptions: this.filterOptions, menuRenderer: this.menuRenderer, onInputChange: this.onInputChange, onInputKeyDown: this.onInputKeyDown, ref: function ref(_ref2) { _this2.select = _ref2; // These values may be needed in between Select mounts (when this.select is null) if (_ref2) { _this2.labelKey = _ref2.props.labelKey; _this2.valueKey = _ref2.props.valueKey; } if (refProp) { refProp(_ref2); } } }); return children(props); } }]); return CreatableSelect; }(React.Component); function defaultChildren$2(props) { return React.createElement(Select$1, props); } function isOptionUnique(_ref3) { var option = _ref3.option, options = _ref3.options, labelKey = _ref3.labelKey, valueKey = _ref3.valueKey; return options.filter(function (existingOption) { return existingOption[labelKey] === option[labelKey] || existingOption[valueKey] === option[valueKey]; }).length === 0; } function isValidNewOption(_ref4) { var label = _ref4.label; return !!label; } function newOptionCreator(_ref5) { var label = _ref5.label, labelKey = _ref5.labelKey, valueKey = _ref5.valueKey; var option = {}; option[valueKey] = label; option[labelKey] = label; option.className = 'Select-create-option-placeholder'; return option; } function promptTextCreator(label) { return 'Create option "' + label + '"'; } function shouldKeyDownEventCreateNewOption(_ref6) { var keyCode = _ref6.keyCode; switch (keyCode) { case 9: // TAB case 13: // ENTER case 188: // COMMA return true; default: return false; } } // Default prop methods CreatableSelect.isOptionUnique = isOptionUnique; CreatableSelect.isValidNewOption = isValidNewOption; CreatableSelect.newOptionCreator = newOptionCreator; CreatableSelect.promptTextCreator = promptTextCreator; CreatableSelect.shouldKeyDownEventCreateNewOption = shouldKeyDownEventCreateNewOption; CreatableSelect.defaultProps = { filterOptions: filterOptions, isOptionUnique: isOptionUnique, isValidNewOption: isValidNewOption, menuRenderer: menuRenderer, newOptionCreator: newOptionCreator, promptTextCreator: promptTextCreator, shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption }; CreatableSelect.propTypes = { // Child function responsible for creating the inner Select component // This component can be used to compose HOCs (eg Creatable and Async) // (props: Object): PropTypes.element children: PropTypes.func, // See Select.propTypes.filterOptions filterOptions: PropTypes.any, // Searches for any matching option within the set of options. // This function prevents duplicate options from being created. // ({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean isOptionUnique: PropTypes.func, // Determines if the current input text represents a valid option. // ({ label: string }): boolean isValidNewOption: PropTypes.func, // See Select.propTypes.menuRenderer menuRenderer: PropTypes.any, // Factory to create new option. // ({ label: string, labelKey: string, valueKey: string }): Object newOptionCreator: PropTypes.func, // input change handler: function (inputValue) {} onInputChange: PropTypes.func, // input keyDown handler: function (event) {} onInputKeyDown: PropTypes.func, // new option click handler: function (option) {} onNewOptionClick: PropTypes.func, // See Select.propTypes.options options: PropTypes.array, // Creates prompt/placeholder option text. // (filterText: string): string promptTextCreator: PropTypes.func, ref: PropTypes.func, // Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. shouldKeyDownEventCreateNewOption: PropTypes.func }; var AsyncCreatableSelect = function (_React$Component) { inherits(AsyncCreatableSelect, _React$Component); function AsyncCreatableSelect() { classCallCheck(this, AsyncCreatableSelect); return possibleConstructorReturn(this, (AsyncCreatableSelect.__proto__ || Object.getPrototypeOf(AsyncCreatableSelect)).apply(this, arguments)); } createClass(AsyncCreatableSelect, [{ key: 'focus', value: function focus() { this.select.focus(); } }, { key: 'render', value: function render() { var _this2 = this; return React.createElement( Async, this.props, function (_ref) { var ref = _ref.ref, asyncProps = objectWithoutProperties(_ref, ['ref']); var asyncRef = ref; return React.createElement( CreatableSelect, asyncProps, function (_ref2) { var ref = _ref2.ref, creatableProps = objectWithoutProperties(_ref2, ['ref']); var creatableRef = ref; return _this2.props.children(_extends({}, creatableProps, { ref: function ref(select) { creatableRef(select); asyncRef(select); _this2.select = select; } })); } ); } ); } }]); return AsyncCreatableSelect; }(React.Component); function defaultChildren$1(props) { return React.createElement(Select$1, props); } AsyncCreatableSelect.propTypes = { children: PropTypes.func.isRequired // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element }; AsyncCreatableSelect.defaultProps = { children: defaultChildren$1 }; Select$1.Async = Async; Select$1.AsyncCreatable = AsyncCreatableSelect; Select$1.Creatable = CreatableSelect; Select$1.Value = Value; Select$1.Option = Option; export { Async, AsyncCreatableSelect as AsyncCreatable, CreatableSelect as Creatable, Value, Option, menuRenderer as defaultMenuRenderer, arrowRenderer as defaultArrowRenderer, clearRenderer as defaultClearRenderer, filterOptions as defaultFilterOptions }; export default Select$1;
docs/src/app/components/pages/components/FloatingActionButton/Page.js
matthewoates/material-ui
import React from 'react'; import Title from 'react-title-component'; import CodeExample from '../../../CodeExample'; import PropTypeDescription from '../../../PropTypeDescription'; import MarkdownElement from '../../../MarkdownElement'; import floatingButtonReadmeText from './README'; import floatingButtonExampleSimpleCode from '!raw!./ExampleSimple'; import FloatingButtonExampleSimple from './ExampleSimple'; import floatingButtonCode from '!raw!material-ui/FloatingActionButton/FloatingActionButton'; const descriptions = { simple: 'Default size and `mini` FABs, in primary (default), `secondary` and `disabled` colors.', }; const FloatingActionButtonPage = () => ( <div> <Title render={(previousTitle) => `Floating Action Button - ${previousTitle}`} /> <MarkdownElement text={floatingButtonReadmeText} /> <CodeExample description={descriptions.simple} code={floatingButtonExampleSimpleCode}> <FloatingButtonExampleSimple /> </CodeExample> <PropTypeDescription code={floatingButtonCode} /> </div> ); export default FloatingActionButtonPage;
docs/src/PageFooter.js
xuorig/react-bootstrap
import React from 'react'; import packageJSON from '../../package.json'; let version = packageJSON.version; if (/docs/.test(version)) { version = version.split('-')[0]; } const PageHeader = React.createClass({ render() { return ( <footer className="bs-docs-footer" role="contentinfo"> <div className="container"> <div className="bs-docs-social"> <ul className="bs-docs-social-buttons"> <li> <iframe className="github-btn" src="https://ghbtns.com/github-btn.html?user=react-bootstrap&repo=react-bootstrap&type=watch&count=true" width={95} height={20} title="Star on GitHub" /> </li> <li> <iframe className="github-btn" src="https://ghbtns.com/github-btn.html?user=react-bootstrap&repo=react-bootstrap&type=fork&count=true" width={92} height={20} title="Fork on GitHub" /> </li> <li> <iframe src="https://platform.twitter.com/widgets/follow_button.html?screen_name=react_bootstrap&show_screen_name=true" width={230} height={20} allowTransparency="true" frameBorder="0" scrolling="no"> </iframe> </li> </ul> </div> <p>Code licensed under <a href="https://github.com/react-bootstrap/react-bootstrap/blob/master/LICENSE" target="_blank">MIT</a>.</p> <ul className="bs-docs-footer-links muted"> <li>Currently v{version}</li> <li>·</li> <li><a href="https://github.com/react-bootstrap/react-bootstrap/">GitHub</a></li> <li>·</li> <li><a href="https://github.com/react-bootstrap/react-bootstrap/issues?state=open">Issues</a></li> <li>·</li> <li><a href="https://github.com/react-bootstrap/react-bootstrap/releases">Releases</a></li> </ul> </div> </footer> ); } }); export default PageHeader;
ajax/libs/rxjs/2.3.7/rx.lite.js
BobbieBel/cdnjs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise // Detect if promise exists }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = Date.now, defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }; // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = { done: true, value: undefined }; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } function isFunction(value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFunction(/x/)) { isFunction = function(value) { return typeof value == 'function' && toString.call(value) == funcClass; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `-0` vs. `+0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; /** @private */ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; /** @private */ var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; // Collection polyfills function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections var IndexedItem = function (id, value) { this.id = id; this.value = value; }; IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); if (c === 0) { c = this.id - other.id; } return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { if (index === undefined) { index = 0; } if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable. */ CompositeDisposablePrototype.clear = function () { var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } }; /** * Determines whether the CompositeDisposable contains a specific disposable. * @param {Mixed} item Disposable to search for. * @returns {Boolean} true if the disposable was found; otherwise, false. */ CompositeDisposablePrototype.contains = function (item) { return this.disposables.indexOf(item) !== -1; }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var BooleanDisposable = (function () { function BooleanDisposable (isSingle) { this.isSingle = isSingle; this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { if (this.current && this.isSingle) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); /** * Represents a disposable resource which only allows a single assignment of its underlying disposable resource. * If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error. */ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function (super_) { inherits(SingleAssignmentDisposable, super_); function SingleAssignmentDisposable() { super_.call(this, true); } return SingleAssignmentDisposable; }(BooleanDisposable)); /** * Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. */ var SerialDisposable = Rx.SerialDisposable = (function (super_) { inherits(SerialDisposable, super_); function SerialDisposable() { super_.call(this, false); } return SerialDisposable; }(BooleanDisposable)); /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var s = state; var id = setInterval(function () { s = action(s); }, period); return disposableCreate(function () { clearInterval(id); }); }; }(Scheduler.prototype)); /** * Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dt); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); var scheduleMethod, clearMethod = noop; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('','*'); root.onmessage = oldHandler; return isAsync; } // Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return setTimeout(action, 0); }; clearMethod = clearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = setTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { clearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableFor = Enumerable.forEach = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * * @param observer Observer object. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * * @static * @memberOf Observer * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler) { return new AnonymousObserver(function (x) { return handler(notificationCreateOnNext(x)); }, function (exception) { return handler(notificationCreateOnError(exception)); }, function () { return handler(notificationCreateOnCompleted()); }); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (_super) { inherits(AbstractObserver, _super); /** * Creates a new observer in a non-stopped state. * * @constructor */ function AbstractObserver() { this.isStopped = false; _super.call(this); } /** * Notifies the observer of a new element in the sequence. * * @memberOf AbstractObserver * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * * @memberOf AbstractObserver * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (_super) { inherits(AnonymousObserver, _super); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { _super.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (exception) { this._onError(exception); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * * @example * 1 - source.subscribe(); * 2 - source.subscribe(observer); * 3 - source.subscribe(function (x) { console.log(x); }); * 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }); * 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); }); * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { var subscriber = typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted); return this._subscribe(subscriber); }; return Observable; })(); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (_super) { inherits(ScheduledObserver, _super); function ScheduledObserver(scheduler, observer) { _super.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; ScheduledObserver.prototype.error = function (exception) { var self = this; this.queue.push(function () { self.observer.onError(exception); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { _super.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** * Creates a list from an observable sequence. * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var self = this; return new AnonymousObservable(function(observer) { var arr = []; return self.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function isIterable(o) { return o[$iterator$] !== undefined; } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } function isCallable(f) { return Object.prototype.toString.call(f) === '[object Function]' && typeof f === 'function'; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isCallable(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var list = Object(iterable), objIsIterable = isIterable(list), len = objIsIterable ? 0 : toLength(list), it = objIsIterable ? list[$iterator$]() : null, i = 0; return scheduler.scheduleRecursive(function (self) { if (i < len || objIsIterable) { var result; if (objIsIterable) { var next = it.next(); if (next.done) { observer.onCompleted(); return; } result = next.value; } else { result = list[i]; } if (mapFn && isCallable(mapFn)) { try { result = thisArg ? mapFn.call(thisArg, result, i) : mapFn(result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); } else { observer.onCompleted(); } }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return observableFromArray(args); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ var observableOf = Observable.ofWithScheduler = function (scheduler) { var len = arguments.length - 1, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; } return observableFromArray(args, scheduler); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwException' for browsers <IE9. * * @example * var res = Rx.Observable.throw(new Error('Error')); * var res = Rx.Observable.throw(new Error('Error'), Rx.Scheduler.timeout); * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.catchException(xs, ys, zs); * 2 - res = Rx.Observable.catchException([xs, ys, zs]); * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable['catch'] = function () { var items = argsOrArray(arguments, 0); return enumerableFor(items).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * * @example * 1 - res = Rx.Observable.concat(xs, ys, zs); * 2 - res = Rx.Observable.concat([xs, ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var sources = argsOrArray(arguments, 0); return enumerableFor(sources).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [], subscribe = function (xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support if (isPromise(xs)) { xs = observableFromPromise(xs); } subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { var s; group.remove(subscription); if (q.length > 0) { s = q.shift(); subscribe(s); } else { activeCount--; if (isStopped && activeCount === 0) { observer.onCompleted(); } } })); }; group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; if (activeCount === 0) { observer.onCompleted(); } })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll =function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check if Promise or Observable if (isPromise(innerSource)) { innerSource = observableFromPromise(innerSource); } innerSubscription.setDisposable(innerSource.subscribe(function (x) { observer.onNext(x); }, observer.onError.bind(observer), function () { group.remove(innerSubscription); if (isStopped && group.length === 1) { observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; if (group.length === 1) { observer.onCompleted(); } })); return group; }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe(function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable if (isPromise(innerSource)) { innerSource = observableFromPromise(innerSource); } d.setDisposable(innerSource.subscribe(function (x) { if (latest === id) { observer.onNext(x); } }, function (e) { if (latest === id) { observer.onError(e); } }, function () { if (latest === id) { hasLatest = false; if (isStopped) { observer.onCompleted(); } } })); }, observer.onError.bind(observer), function () { isStopped = true; if (!hasLatest) { observer.onCompleted(); } }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(observer); }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * * @example * var res = observable.do(observer); * var res = observable.do(onNext); * var res = observable.do(onNext, onError); * var res = observable.do(onNext, onError, onCompleted); * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (!onError) { observer.onError(err); } else { try { onError(err); } catch (e) { observer.onError(e); } observer.onError(err); } }, function () { if (!onCompleted) { observer.onCompleted(); } else { try { onCompleted(); } catch (e) { observer.onError(e); } observer.onCompleted(); } }); }); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { try { if (!hasValue) { hasValue = true; } if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { if (!hasValue && hasSeed) { observer.onNext(seed); } observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { observer.onNext(q.shift()); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * * @memberOf Observable# * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && 'now' in Object(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableFor([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * * @example * var res = source.takeLast(5); * * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while(q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.concatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }); } return typeof selector === 'function' ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} property The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (property) { return this.select(function (x) { return x[property]; }); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.flatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }, thisArg); } return typeof selector === 'function' ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } if (running) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new Error(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining > 0) { remaining--; observer.onNext(x); if (remaining === 0) { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * * @example * var res = source.takeWhile(function (value) { return value < 10; }); * var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } if (shouldRun) { observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Converts a callback function to an observable sequence. * * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. */ Observable.fromCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(err) { if (err) { observer.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { observer.onError(e); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }); }; }; function createListener (element, name, handler) { if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } throw new Error('No listener found'); } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (Object.prototype.toString.call(el) === '[object NodeList]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Configuration option to determine whether to use native events only */ Rx.config.useNativeEvents = false; // Check for Angular/jQuery/Zepto support var jq = !!root.angular && !!angular.element ? angular.element : (!!root.jQuery ? root.jQuery : ( !!root.Zepto ? root.Zepto : null)); // Check for ember var ember = !!root.Ember && typeof root.Ember.addListener === 'function'; // Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs // for proper loading order! var marionette = !!root.Backbone && !!root.Backbone.Marionette; /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { // Node.js specific if (element.addListener) { return fromEventPattern( function (h) { element.addListener(eventName, h); }, function (h) { element.removeListener(eventName, h); }, selector); } // Use only if non-native events are allowed if (!Rx.config.useNativeEvents) { if (marionette) { return fromEventPattern( function (h) { element.on(eventName, h); }, function (h) { element.off(eventName, h); }, selector); } if (ember) { return fromEventPattern( function (h) { Ember.addListener(element, eventName, h); }, function (h) { Ember.removeListener(element, eventName, h); }, selector); } if (jq) { var $elem = jq(element); return fromEventPattern( function (h) { $elem.on(eventName, h); }, function (h) { $elem.off(eventName, h); }, selector); } } return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return new AnonymousObservable(function (observer) { promise.then( function (value) { observer.onNext(value); observer.onCompleted(); }, function (reason) { observer.onError(reason); }); return function () { if (promise && promise.abort) { promise.abort(); } } }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new Error('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, function (err) { reject(err); }, function () { if (hasValue) { resolve(value); } }); }); }; /** * Invokes the asynchronous function, surfacing the result through an observable sequence. * @param {Function} functionAsync Asynchronous function which returns a Promise to run. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. */ Observable.startAsync = function (functionAsync) { var promise; try { promise = functionAsync(); } catch (e) { return observableThrow(e); } return observableFromPromise(promise); } /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return !selector ? this.multicast(new Subject()) : this.multicast(function () { return new Subject(); }, selector); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.share(); * * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.share = function () { return this.publish(null).refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return !selector ? this.multicast(new AsyncSubject()) : this.multicast(function () { return new AsyncSubject(); }, selector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareValue(42); * * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareValue = function (initialValue) { return this.publishValue(initialValue). refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return !selector ? this.multicast(new ReplaySubject(bufferSize, window, scheduler)) : this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareReplay(3); * var res = source.shareReplay(3, 500); * var res = source.shareReplay(3, 500, scheduler); * * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareReplay = function (bufferSize, window, scheduler) { return this.replay(null, bufferSize, window, scheduler).refCount(); }; var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { var hasSubscription = false, subscription, sourceObservable = source.asObservable(); this.connect = function () { if (!hasSubscription) { hasSubscription = true; subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () { hasSubscription = false; })); } return subscription; }; __super__.call(this, subject.subscribe.bind(subject)); } ConnectableObservable.prototype.refCount = function () { var connectableSubscription, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect = ++count === 1, subscription = source.subscribe(observer); shouldConnect && (connectableSubscription = source.connect()); return function () { subscription.dispose(); --count === 0 && connectableSubscription.dispose(); }; }); }; return ConnectableObservable; }(Observable)); function observableTimerDate(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithAbsolute(dueTime, function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerDateAndPeriod(dueTime, period, scheduler) { return new AnonymousObservable(function (observer) { var count = 0, d = dueTime, p = normalizeTime(period); return scheduler.scheduleRecursiveWithAbsolute(d, function (self) { if (p > 0) { var now = scheduler.now(); d = d + p; d <= now && (d = now + p); } observer.onNext(count++); self(d); }); }); } function observableTimerTimeSpan(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { return dueTime === period ? new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }) : observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * * @example * 1 - res = Rx.Observable.timer(new Date()); * 2 - res = Rx.Observable.timer(new Date(), 1000); * 3 - res = Rx.Observable.timer(new Date(), Rx.Scheduler.timeout); * 4 - res = Rx.Observable.timer(new Date(), 1000, Rx.Scheduler.timeout); * * 5 - res = Rx.Observable.timer(5000); * 6 - res = Rx.Observable.timer(5000, 1000); * 7 - res = Rx.Observable.timer(5000, Rx.Scheduler.timeout); * 8 - res = Rx.Observable.timer(5000, 1000, Rx.Scheduler.timeout); * * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'object') { scheduler = periodOrScheduler; } if (dueTime instanceof Date && period === undefined) { return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { period = periodOrScheduler; return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; function observableDelayTimeSpan(source, dueTime, scheduler) { return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }); } function observableDelayDate(source, dueTime, scheduler) { return observableDefer(function () { return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); }); } /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * 1 - res = Rx.Observable.delay(new Date()); * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); * * 3 - res = Rx.Observable.delay(5000); * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return dueTime instanceof Date ? observableDelayDate(this, dueTime.getTime(), scheduler) : observableDelayTimeSpan(this, dueTime, scheduler); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * * @example * 1 - res = source.throttle(5000); // 5 seconds * 2 - res = source.throttle(5000, scheduler); * * @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The throttled sequence. */ observableProto.throttle = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.throttleWithSelector(function () { return observableTimer(dueTime, scheduler); }) }; /** * Records the timestamp for each value in an observable sequence. * * @example * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } * 2 - res = source.timestamp(Rx.Scheduler.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.map(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } atEnd && observer.onCompleted(); } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = function (intervalOrSampler, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return typeof intervalOrSampler === 'number' ? sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * * @example * 1 - res = source.timeout(new Date()); // As a date * 2 - res = source.timeout(5000); // 5 seconds * 3 - res = source.timeout(new Date(), Rx.Observable.returnValue(42)); // As a date and timeout observable * 4 - res = source.timeout(5000, Rx.Observable.returnValue(42)); // 5 seconds and timeout observable * 5 - res = source.timeout(new Date(), Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // As a date and timeout observable * 6 - res = source.timeout(5000, Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // 5 seconds and timeout observable * * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { other || (other = observableThrow(new Error('Timeout'))); isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); var createTimer = function () { var myId = id; timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); subscription.setDisposable(other.subscribe(observer)); } })); }; createTimer(); original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; observer.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; observer.onError(e); } }, function () { if (!switched) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Time shifts the observable sequence by delaying the subscription. * * @example * 1 - res = source.delaySubscription(5000); // 5s * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Number} dueTime Absolute or relative time to perform the subscription at. * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delaySubscription = function (dueTime, scheduler) { return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty); }; /** * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector * * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source. * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element. * @returns {Observable} Time-shifted sequence. */ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) { var source = this, subDelay, selector; if (typeof subscriptionDelay === 'function') { selector = subscriptionDelay; } else { subDelay = subscriptionDelay; selector = delayDurationSelector; } return new AnonymousObservable(function (observer) { var delays = new CompositeDisposable(), atEnd = false, done = function () { if (atEnd && delays.length === 0) { observer.onCompleted(); } }, subscription = new SerialDisposable(), start = function () { subscription.setDisposable(source.subscribe(function (x) { var delay; try { delay = selector(x); } catch (error) { observer.onError(error); return; } var d = new SingleAssignmentDisposable(); delays.add(d); d.setDisposable(delay.subscribe(function () { observer.onNext(x); delays.remove(d); done(); }, observer.onError.bind(observer), function () { observer.onNext(x); delays.remove(d); done(); })); }, observer.onError.bind(observer), function () { atEnd = true; subscription.dispose(); done(); })); }; if (!subDelay) { start(); } else { subscription.setDisposable(subDelay.subscribe(function () { start(); }, observer.onError.bind(observer), function () { start(); })); } return new CompositeDisposable(subscription, delays); }); }; /** * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled. * * @example * 1 - res = source.timeoutWithSelector(Rx.Observable.timer(500)); * 2 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }); * 3 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }, Rx.Observable.returnValue(42)); * * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never(). * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException(). * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) { if (arguments.length === 1) { timeoutdurationSelector = firstTimeout; var firstTimeout = observableNever(); } other || (other = observableThrow(new Error('Timeout'))); var source = this; return new AnonymousObservable(function (observer) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); subscription.setDisposable(original); var id = 0, switched = false, setTimer = function (timeout) { var myId = id, timerWins = function () { return id === myId; }; var d = new SingleAssignmentDisposable(); timer.setDisposable(d); d.setDisposable(timeout.subscribe(function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } d.dispose(); }, function (e) { if (timerWins()) { observer.onError(e); } }, function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } })); }; setTimer(firstTimeout); var observerWins = function () { var res = !switched; if (res) { id++; } return res; }; original.setDisposable(source.subscribe(function (x) { if (observerWins()) { observer.onNext(x); var timeout; try { timeout = timeoutdurationSelector(x); } catch (e) { observer.onError(e); return; } setTimer(timeout); } }, function (e) { if (observerWins()) { observer.onError(e); } }, function () { if (observerWins()) { observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Ignores values from an observable sequence which are followed by another value within a computed throttle duration. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(x + x); }); * * @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element. * @returns {Observable} The throttled sequence. */ observableProto.throttleWithSelector = function (throttleDurationSelector) { var source = this; return new AnonymousObservable(function (observer) { var value, hasValue = false, cancelable = new SerialDisposable(), id = 0, subscription = source.subscribe(function (x) { var throttle; try { throttle = throttleDurationSelector(x); } catch (e) { observer.onError(e); return; } hasValue = true; value = x; id++; var currentid = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(throttle.subscribe(function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); }, observer.onError.bind(observer), function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); })); }, function (e) { cancelable.dispose(); observer.onError(e); hasValue = false; id++; }, function () { cancelable.dispose(); if (hasValue) { observer.onNext(value); } observer.onCompleted(); hasValue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * 1 - res = source.skipLastWithTime(5000); * 2 - res = source.skipLastWithTime(5000, scheduler); * * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for skipping elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. */ observableProto.skipLastWithTime = function (duration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } observer.onCompleted(); }); }); }; /** * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. * * @example * 1 - res = source.takeLastWithTime(5000, [optional timer scheduler], [optional loop scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { observer.onNext(next.value); } } observer.onCompleted(); }); }); }; /** * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. */ observableProto.takeWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer)); }); }; /** * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.skipWithTime(5000, [optional scheduler]); * * @description * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded * may not execute immediately, despite the zero due time. * * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. * @param {Number} duration Duration for skipping elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. */ observableProto.skipWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler.scheduleWithRelative(duration, function () { open = true; }), source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }); }; var PausableObservable = (function (_super) { inherits(PausableObservable, _super); function subscribe(observer) { var conn = this.source.publish(), subscription = conn.subscribe(observer), connection = disposableEmpty; var pausable = this.subject.distinctUntilChanged().subscribe(function (b) { if (b) { connection = conn.connect(); } else { connection.dispose(); connection = disposableEmpty; } }); return new CompositeDisposable(subscription, connection, pausable); } function PausableObservable(source, subject) { this.source = source; this.subject = subject || new Subject(); this.isPaused = true; _super.call(this, subscribe); } PausableObservable.prototype.pause = function () { if (this.isPaused === true){ return; } this.isPaused = true; this.subject.onNext(false); }; PausableObservable.prototype.resume = function () { if (this.isPaused === false){ return; } this.isPaused = false; this.subject.onNext(true); }; return PausableObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausable(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausable = function (pauser) { return new PausableObservable(this, pauser); }; function combineLatestSource(source, subject, resultSelector) { return new AnonymousObservable(function (observer) { var n = 2, hasValue = [false, false], hasValueAll = false, isDone = false, values = new Array(n); function next(x, i) { values[i] = x var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe( function (x) { next(x, 0); }, observer.onError.bind(observer), function () { isDone = true; observer.onCompleted(); }), subject.subscribe( function (x) { next(x, 1); }, observer.onError.bind(observer)) ); }); } var PausableBufferedObservable = (function (_super) { inherits(PausableBufferedObservable, _super); function subscribe(observer) { var q = [], previousShouldFire; var subscription = combineLatestSource( this.source, this.subject.distinctUntilChanged(), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) .subscribe( function (results) { if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { // change in shouldFire if (results.shouldFire) { while (q.length > 0) { observer.onNext(q.shift()); } } } else { // new data if (results.shouldFire) { observer.onNext(results.data); } else { q.push(results.data); } } previousShouldFire = results.shouldFire; }, function (err) { // Empty buffer before sending error while (q.length > 0) { observer.onNext(q.shift()); } observer.onError(err); }, function () { // Empty buffer before sending completion while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); } ); this.subject.onNext(false); return subscription; } function PausableBufferedObservable(source, subject) { this.source = source; this.subject = subject || new Subject(); this.isPaused = true; _super.call(this, subscribe); } PausableBufferedObservable.prototype.pause = function () { if (this.isPaused === true){ return; } this.isPaused = true; this.subject.onNext(false); }; PausableBufferedObservable.prototype.resume = function () { if (this.isPaused === false){ return; } this.isPaused = false; this.subject.onNext(true); }; return PausableBufferedObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, * and yields the values that were buffered while paused. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausableBuffered(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausableBuffered = function (subject) { return new PausableBufferedObservable(this, subject); }; /** * Attaches a controller to the observable sequence with the ability to queue. * @example * var source = Rx.Observable.interval(100).controlled(); * source.request(3); // Reads 3 values * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.controlled = function (enableQueue) { if (enableQueue == null) { enableQueue = true; } return new ControlledObservable(this, enableQueue); }; var ControlledObservable = (function (_super) { inherits(ControlledObservable, _super); function subscribe (observer) { return this.source.subscribe(observer); } function ControlledObservable (source, enableQueue) { _super.call(this, subscribe); this.subject = new ControlledSubject(enableQueue); this.source = source.multicast(this.subject).refCount(); } ControlledObservable.prototype.request = function (numberOfItems) { if (numberOfItems == null) { numberOfItems = -1; } return this.subject.request(numberOfItems); }; return ControlledObservable; }(Observable)); var ControlledSubject = Rx.ControlledSubject = (function (_super) { function subscribe (observer) { return this.subject.subscribe(observer); } inherits(ControlledSubject, _super); function ControlledSubject(enableQueue) { if (enableQueue == null) { enableQueue = true; } _super.call(this, subscribe); this.subject = new Subject(); this.enableQueue = enableQueue; this.queue = enableQueue ? [] : null; this.requestedCount = 0; this.requestedDisposable = disposableEmpty; this.error = null; this.hasFailed = false; this.hasCompleted = false; this.controlledDisposable = disposableEmpty; } addProperties(ControlledSubject.prototype, Observer, { onCompleted: function () { checkDisposed.call(this); this.hasCompleted = true; if (!this.enableQueue || this.queue.length === 0) { this.subject.onCompleted(); } }, onError: function (error) { checkDisposed.call(this); this.hasFailed = true; this.error = error; if (!this.enableQueue || this.queue.length === 0) { this.subject.onError(error); } }, onNext: function (value) { checkDisposed.call(this); var hasRequested = false; if (this.requestedCount === 0) { if (this.enableQueue) { this.queue.push(value); } } else { if (this.requestedCount !== -1) { if (this.requestedCount-- === 0) { this.disposeCurrentRequest(); } } hasRequested = true; } if (hasRequested) { this.subject.onNext(value); } }, _processRequest: function (numberOfItems) { if (this.enableQueue) { //console.log('queue length', this.queue.length); while (this.queue.length >= numberOfItems && numberOfItems > 0) { //console.log('number of items', numberOfItems); this.subject.onNext(this.queue.shift()); numberOfItems--; } if (this.queue.length !== 0) { return { numberOfItems: numberOfItems, returnValue: true }; } else { return { numberOfItems: numberOfItems, returnValue: false }; } } if (this.hasFailed) { this.subject.onError(this.error); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } else if (this.hasCompleted) { this.subject.onCompleted(); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } return { numberOfItems: numberOfItems, returnValue: false }; }, request: function (number) { checkDisposed.call(this); this.disposeCurrentRequest(); var self = this, r = this._processRequest(number); number = r.numberOfItems; if (!r.returnValue) { this.requestedCount = number; this.requestedDisposable = disposableCreate(function () { self.requestedCount = 0; }); return this.requestedDisposable } else { return disposableEmpty; } }, disposeCurrentRequest: function () { this.requestedDisposable.dispose(); this.requestedDisposable = disposableEmpty; }, dispose: function () { this.isDisposed = true; this.error = null; this.subject.dispose(); this.requestedDisposable.dispose(); } }); return ControlledSubject; }(Observable)); /* * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @returns {Observable} A exclusive observable with only the results that happen when subscribed. */ observableProto.exclusive = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasCurrent = false, isStopped = false, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); var innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (!hasCurrent && g.length === 1) { observer.onCompleted(); } })); return g; }); }; /* * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @param {Function} selector Selector to invoke for every item in the current subscription. * @param {Any} [thisArg] An optional context to invoke with the selector parameter. * @returns {Observable} An exclusive observable with only the results that happen when subscribed. */ observableProto.exclusiveMap = function (selector, thisArg) { var sources = this; return new AnonymousObservable(function (observer) { var index = 0, hasCurrent = false, isStopped = true, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe( function (x) { var result; try { result = selector.call(thisArg, x, index++, innerSource); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (g.length === 1 && !hasCurrent) { observer.onCompleted(); } })); return g; }); }; var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, _super); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { _super.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; this.hasValue = true; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, _super); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { _super.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (_super) { function RemovableDisposable (subject, observer) { this.subject = subject; this.observer = observer; }; RemovableDisposable.prototype.dispose = function () { this.observer.dispose(); if (!this.subject.isDisposed) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); } }; function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = new RemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); var n = this.q.length; for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { n++; so.onError(this.error); } else if (this.isStopped) { n++; so.onCompleted(); } so.ensureActive(n); return subscription; } inherits(ReplaySubject, _super); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; _super.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /* @private */ _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { var observer; checkDisposed.call(this); if (!this.isStopped) { var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onNext(value); observer.ensureActive(); } } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; } }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } }.call(this));
monkey/monkey_island/cc/ui/src/components/attack/techniques/T1053.js
guardicore/monkey
import React from 'react'; import ReactTable from 'react-table'; import {renderMachineFromSystemData, ScanStatus} from './Helpers'; import MitigationsComponent from './MitigationsComponent'; class T1053 extends React.Component { constructor(props) { super(props); } static getColumns() { return ([{ columns: [ { Header: 'Machine', id: 'machine', accessor: x => renderMachineFromSystemData(x.machine), style: {'whiteSpace': 'unset'}}, { Header: 'Result', id: 'result', accessor: x => x.result, style: {'whiteSpace': 'unset'}} ] }]) } render() { return ( <div> <div>{this.props.data.message_html}</div> <br/> {this.props.data.status === ScanStatus.USED ? <ReactTable columns={T1053.getColumns()} data={this.props.data.info} showPagination={false} defaultPageSize={this.props.data.info.length} /> : ''} <MitigationsComponent mitigations={this.props.data.mitigations}/> </div> ); } } export default T1053;
ajax/libs/primereact/4.0.0/components/organizationchart/OrganizationChart.js
cdnjs/cdnjs
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OrganizationChart = exports.OrganizationChartNode = void 0; var _react = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _classnames = _interopRequireDefault(require("classnames")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var OrganizationChartNode = /*#__PURE__*/ function (_Component) { _inherits(OrganizationChartNode, _Component); function OrganizationChartNode(props) { var _this; _classCallCheck(this, OrganizationChartNode); _this = _possibleConstructorReturn(this, _getPrototypeOf(OrganizationChartNode).call(this, props)); _this.node = _this.props.node; _this.state = { expanded: _this.node.expanded }; return _this; } _createClass(OrganizationChartNode, [{ key: "getLeaf", value: function getLeaf() { return this.node.leaf === false ? false : !(this.node.children && this.node.children.length); } }, { key: "getColspan", value: function getColspan() { return this.node.children && this.node.children.length ? this.node.children.length * 2 : null; } }, { key: "onNodeClick", value: function onNodeClick(event, node) { this.props.onNodeClick(event, node); } }, { key: "toggleNode", value: function toggleNode(event, node) { var _expanded = !this.state.expanded; this.setState({ expanded: _expanded }); event.preventDefault(); } }, { key: "isSelected", value: function isSelected() { return this.props.isSelected(this.node); } }, { key: "render", value: function render() { var _this2 = this; this.node = this.props.node; var colspan = this.getColspan(); var nodeStyleClass = (0, _classnames.default)('p-organizationchart-node-content', this.node.className, { 'p-organizationchart-selectable-node': this.props.selectionMode && this.node.selectable !== false, 'p-highlight': this.isSelected() }), nodeLabel = this.props.nodeTemplate && this.props.nodeTemplate(this.node) ? _react.default.createElement("div", null, this.props.nodeTemplate(this.node)) : _react.default.createElement("div", null, this.node.label), toggleIcon = (0, _classnames.default)('p-node-toggler-icon', { 'pi pi-chevron-down': this.state.expanded, 'pi pi-chevron-up': !this.state.expanded }), nodeContent = _react.default.createElement("tr", null, _react.default.createElement("td", { colSpan: colspan }, _react.default.createElement("div", { className: nodeStyleClass, onClick: function onClick(e) { return _this2.onNodeClick(e, _this2.node); } }, nodeLabel, !this.getLeaf() && _react.default.createElement("button", { type: "button", className: "p-node-toggler p-link", onClick: function onClick(e) { return _this2.toggleNode(e, _this2.node); } }, _react.default.createElement("i", { className: toggleIcon }))))); var _visibility = !this.getLeaf() && this.state.expanded ? 'inherit' : 'hidden', linesDown = _react.default.createElement("tr", { style: { visibility: _visibility }, className: "p-organizationchart-lines" }, _react.default.createElement("td", { colSpan: colspan }, _react.default.createElement("div", { className: "p-organizationchart-line-down" }))), nodeChildLength = this.node.children && this.node.children.length, linesMiddle = _react.default.createElement("tr", { style: { visibility: _visibility }, className: "p-organizationchart-lines" }, this.node.children && this.node.children.map(function (item, index) { var leftClass = (0, _classnames.default)('p-organizationchart-line-left', { 'p-organizationchart-line-top': index !== 0 }), rightClass = (0, _classnames.default)('p-organizationchart-line-right', { 'p-organizationchart-line-top': index !== nodeChildLength - 1 }); return [_react.default.createElement("td", { key: index + '_lineleft', className: leftClass }, "\xA0"), _react.default.createElement("td", { key: index + '_lineright', className: rightClass }, "\xA0")]; })), childNodes = _react.default.createElement("tr", { style: { visibility: _visibility }, className: "p-organizationchart-nodes" }, this.node.children && this.node.children.map(function (child, index) { return _react.default.createElement("td", { key: index, colSpan: "2" }, _react.default.createElement(OrganizationChartNode, { node: child, nodeTemplate: _this2.props.nodeTemplate, selectionMode: _this2.props.selectionMode, onNodeClick: _this2.props.onNodeClick, isSelected: _this2.props.isSelected })); })); return _react.default.createElement("table", { className: "p-organizationchart-table" }, _react.default.createElement("tbody", null, nodeContent, linesDown, linesMiddle, childNodes)); } }]); return OrganizationChartNode; }(_react.Component); exports.OrganizationChartNode = OrganizationChartNode; _defineProperty(OrganizationChartNode, "defaultProps", { node: null, nodeTemplate: null, root: false, first: false, last: false, selectionMode: null, onNodeClick: null, isSelected: null }); _defineProperty(OrganizationChartNode, "propTypes", { node: _propTypes.default.any, nodeTemplate: _propTypes.default.any, root: _propTypes.default.bool, first: _propTypes.default.bool, last: _propTypes.default.bool, selectionMode: _propTypes.default.string, onNodeClick: _propTypes.default.func, isSelected: _propTypes.default.func }); var OrganizationChart = /*#__PURE__*/ function (_Component2) { _inherits(OrganizationChart, _Component2); function OrganizationChart(props) { var _this3; _classCallCheck(this, OrganizationChart); _this3 = _possibleConstructorReturn(this, _getPrototypeOf(OrganizationChart).call(this, props)); _this3.root = _this3.props.value && _this3.props.value.length ? _this3.props.value[0] : null; _this3.onNodeClick = _this3.onNodeClick.bind(_assertThisInitialized(_this3)); _this3.isSelected = _this3.isSelected.bind(_assertThisInitialized(_this3)); return _this3; } _createClass(OrganizationChart, [{ key: "onNodeClick", value: function onNodeClick(event, node) { if (this.props.selectionMode) { var eventTarget = event.target; if (eventTarget.className && (eventTarget.className.indexOf('p-node-toggler') !== -1 || eventTarget.className.indexOf('p-node-toggler-icon') !== -1)) { return; } if (node.selectable === false) { return; } var index = this.findIndexInSelection(node); var selected = index >= 0; var selection; if (this.props.selectionMode === 'single') { if (selected) { selection = null; if (this.props.onNodeUnselect) { this.props.onNodeUnselect({ originalEvent: event, node: node }); } } else { selection = node; if (this.props.onNodeSelect) { this.props.onNodeSelect({ originalEvent: event, node: node }); } } } else if (this.props.selectionMode === 'multiple') { if (selected) { selection = this.props.selection.filter(function (val, i) { return i !== index; }); if (this.props.onNodeUnselect) { this.props.onNodeUnselect({ originalEvent: event, node: node }); } } else { selection = [].concat(_toConsumableArray(this.props.selection || []), [node]); if (this.props.onNodeSelect) { this.props.onNodeSelect({ originalEvent: event, node: node }); } } } if (this.props.onSelectionChange) { this.props.onSelectionChange({ originalEvent: event, data: selection }); } } } }, { key: "findIndexInSelection", value: function findIndexInSelection(node) { var index = -1; if (this.props.selectionMode && this.props.selection) { if (this.props.selectionMode === 'single') { index = this.props.selection === node ? 0 : -1; } else if (this.props.selectionMode === 'multiple') { for (var i = 0; i < this.props.selection.length; i++) { if (this.props.selection[i] === node) { index = i; break; } } } } return index; } }, { key: "isSelected", value: function isSelected(node) { return this.findIndexInSelection(node) !== -1; } }, { key: "render", value: function render() { this.root = this.props.value && this.props.value.length ? this.props.value[0] : null; var className = (0, _classnames.default)('p-organizationchart p-component', this.props.className); return _react.default.createElement("div", { id: this.props.id, style: this.props.style, className: className }, _react.default.createElement(OrganizationChartNode, { node: this.root, nodeTemplate: this.props.nodeTemplate, selectionMode: this.props.selectionMode, onNodeClick: this.onNodeClick, isSelected: this.isSelected })); } }]); return OrganizationChart; }(_react.Component); exports.OrganizationChart = OrganizationChart; _defineProperty(OrganizationChart, "defaultProps", { id: null, value: null, style: null, className: null, selectionMode: null, selection: null, nodeTemplate: null, onSelectionChange: null, onNodeSelect: null, onNodeUnselect: null }); _defineProperty(OrganizationChart, "propTypes", { id: _propTypes.default.string, value: _propTypes.default.any, style: _propTypes.default.object, className: _propTypes.default.string, selectionMode: _propTypes.default.string, selection: _propTypes.default.any, nodeTemplate: _propTypes.default.any, onSelectionChange: _propTypes.default.func, onNodeSelect: _propTypes.default.func, onNodeUnselect: _propTypes.default.func });
docs/index.js
Scratch-it/react-color
'use strict' import React from 'react' import ReactDOM from 'react-dom' import Home from './components/home/Home' // var html = ReactDOMServer.renderToString(React.createElement(Home)); // console.log(html); if (typeof document !== 'undefined') { ReactDOM.render( React.createElement(Home), document.getElementById('root') ) } module.exports = Home
src/app/server.js
carlosazaustre/universal-js-boilerplate
import path from 'path'; import Express from 'express'; import qs from 'qs'; import engine from 'react-engine'; import favicon from 'serve-favicon'; import config from './config'; import webpack from 'webpack'; import webpackDevMiddleware from 'webpack-dev-middleware'; import webpackHotMiddleware from 'webpack-hot-middleware'; import webpackConfig from '../../webpack.config'; import React from 'react'; import { renderToString } from 'react-dom/server'; import { Provider } from 'react-redux'; import configureStore from './store/configureStore'; import App from './containers/App'; import { fetchCounter } from './api/counter'; const app = new Express(); const port = config.app.port; // -- Setup React Views engine ------------------------------------------------- app.engine('.jsx', engine.server.create({ reactRoutes: path.join(__dirname, '..', 'app', 'routes.js') })); app.set('views', path.join(__dirname, '..', 'app', 'components')); app.set('view engine', 'jsx'); app.set('view', engine.expressView); const publicPath = path.join(__dirname, '..', '..', 'build', 'public'); const faviconPath = path.join(__dirname, '..', '..', 'build', 'public', 'favicon.ico'); // Use this middleware to set up hot module reloading via webpack. const compiler = webpack(webpackConfig); app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: webpackConfig.output.publicPath })); app.use(webpackHotMiddleware(compiler)); app.use(Express.static(publicPath)); app.use(favicon(faviconPath)); app.get('*', (req, res) => { // Query our mock API asynchronously fetchCounter(apiResult => { // Read the counter from the request, if provided const params = qs.parse(req.query); const counter = parseInt(params.counter, 10) || apiResult || 0; // Compile an initial state const initialState = { counter }; // Create a new Redux store instance const store = configureStore(initialState); // Render the component to a string const html = renderToString( <Provider store={ store }> <App /> </Provider> ); // Grab the initial state from our Redux store const firstState = store.getState(); // Send the rendered page back to the client res.send(renderFullPage(html, firstState)); }); }); function renderFullPage(html, initialState) { return ` <!doctype html> <html> <head> <title>Redux Universal Example</title> </head> <body> <div id="app">${html}</div> <script> window.__INITIAL_STATE__ = ${JSON.stringify(initialState)}; </script> <script src="/app.js"></script> </body> </html> `; } app.listen(port, () => { console.log(`WebServer listening on port ${port}`); });
app/components/map/footer/index.js
Vizzuality/forest-watcher
// @flow import type { Alert, SelectedAlert } from 'types/alerts.types'; import type { MapItemFeatureProperties } from 'types/common.types'; import type { SelectedReport } from 'types/reports.types'; import type { LocationPoint } from 'types/routes.types'; import React, { Component } from 'react'; import { Animated, View } from 'react-native'; import CircleButton from 'components/common/circle-button'; import InfoBanner from 'components/map/info-banner'; import LocationErrorBanner from 'components/map/locationErrorBanner'; import { withSafeArea } from 'react-native-safe-area'; const FooterSafeAreaView = withSafeArea(View, 'margin', 'bottom'); const FooterBackgroundSafeAreaView = withSafeArea(View, 'padding', 'bottom'); const startTrackingIcon = require('assets/startTracking.png'); const stopTrackingIcon = require('assets/stopTracking.png'); const myLocationIcon = require('assets/my_location.png'); const createReportIcon = require('assets/createReport.png'); const addLocationIcon = require('assets/add_location.png'); const cancelIcon = require('assets/cancel.png'); import styles from './styles'; type Props = {| animatedPosition: Animated.Value, customReporting: boolean, isRouteTracking: boolean, locationError: ?number, onCustomReportingPress: () => void, onReportSelectionPress: () => void, onSelectAllConnectedAlertsPress: ($ReadOnlyArray<Alert>) => void, onSelectionCancelPress: () => void, onStartTrackingPress: () => void, onStopTrackingPress: () => void, onZoomToUserLocationPress: () => void, connectedAlerts: $ReadOnlyArray<SelectedAlert>, highlightedAlerts: $ReadOnlyArray<Alert>, selectedAlerts: $ReadOnlyArray<SelectedAlert>, selectedReports: $ReadOnlyArray<SelectedReport>, tappedOnFeatures: $ReadOnlyArray<MapItemFeatureProperties>, userLocation: ?LocationPoint |}; export default class MapFooter extends Component<Props> { renderButtonPanel() { const { animatedPosition, connectedAlerts, customReporting, isRouteTracking, userLocation, locationError, selectedAlerts, highlightedAlerts, selectedReports, tappedOnFeatures, onReportSelectionPress, onCustomReportingPress, onZoomToUserLocationPress, onSelectionCancelPress, onStartTrackingPress, onStopTrackingPress, onSelectAllConnectedAlertsPress } = this.props; const hasAlertsSelected = selectedAlerts && selectedAlerts.length > 0; const hasReportSelected = selectedReports?.length; const canReport = hasAlertsSelected || hasReportSelected || customReporting; // To fix the missing signal text overflow rendering in reverse row // last to render will be on top of the others return ( <React.Fragment> <LocationErrorBanner style={styles.locationErrorBanner} locationError={locationError} mostRecentLocationTime={userLocation?.timestamp} /> <Animated.View style={{ transform: [{ translateY: animatedPosition }] }}> <InfoBanner style={styles.infoBanner} tappedOnFeatures={tappedOnFeatures} connectedAlerts={connectedAlerts} highlightedAlerts={highlightedAlerts} onSelectAllConnectedAlertsPress={onSelectAllConnectedAlertsPress} /> </Animated.View> <View style={styles.buttonPanel}> {canReport ? ( <CircleButton shouldFillContainer onPress={onReportSelectionPress} light icon={createReportIcon} /> ) : ( <CircleButton shouldFillContainer onPress={onCustomReportingPress} icon={addLocationIcon} /> )} {userLocation ? ( <CircleButton shouldFillContainer onPress={onZoomToUserLocationPress} light icon={myLocationIcon} /> ) : null} {canReport ? ( <CircleButton shouldFillContainer onPress={onSelectionCancelPress} light icon={cancelIcon} /> ) : null} {isRouteTracking || canReport ? ( <CircleButton shouldFillContainer onPress={isRouteTracking ? onStopTrackingPress : onStartTrackingPress} light icon={isRouteTracking ? stopTrackingIcon : startTrackingIcon} /> ) : null} </View> </React.Fragment> ); } render() { return [ <FooterBackgroundSafeAreaView key="bg" pointerEvents="none" style={styles.footerBGContainer}> <View style={styles.buttonPanelTray} /> </FooterBackgroundSafeAreaView>, <FooterSafeAreaView key="footer" pointerEvents="box-none" style={styles.footer}> {this.renderButtonPanel()} </FooterSafeAreaView> ]; } }
src/components/extensions/overview/blocks/about.js
vFujin/HearthLounge
import React from 'react'; import _ from 'lodash'; import PropTypes from 'prop-types'; const About = ({about}) => { const {announce_date, release_date, no_cards, description} = about; const Li = ({label, value}) =>{ return ( <li> <p>{_.startCase(label)} <span>{value}</span></p> </li> ) }; return ( <ul className="container__blocks--block-content about"> <Li label="announced" value={announce_date}/> <Li label="released" value={release_date}/> <Li label="number of cards" value={no_cards}/> <li className="description"> <p><span>{description}</span></p> </li> </ul> ) }; export default About; About.propTypes = { about: PropTypes.object.isRequired };
ajax/libs/maple.js/1.0.11/maple.min.js
sashberd/cdnjs
!function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=t("./models/Module.js"),u=r(a),s=t("./models/Component.js"),l=r(s),c=t("./helpers/Selectors.js"),f=r(c),p=t("./helpers/Utility.js"),d=r(p),h=t("./helpers/Events.js"),v=r(h);!function(t,e){function n(t){var e=["interactive","complete"];return!r&&~e.indexOf(t)}"undefined"!=typeof System&&(System.transpiler="babel");var r=!1,a=function(){function t(){o(this,t),r=!0,this.findLinks(),this.findTemplates(),v["default"].setupDelegation()}return i(t,[{key:"findLinks",value:function(){f["default"].getLinks(e).forEach(function(t){return t["import"]?void new u["default"](t):void t.addEventListener("load",function(){return new u["default"](t)})})}},{key:"findTemplates",value:function(){f["default"].getTemplates(e).forEach(function(t){var e=f["default"].getAllScripts(t.content),n=t.getAttribute("ref"),r=d["default"].resolver(n,null).production;e.forEach(function(e){r.isLocalPath(e.getAttribute("src"))&&new l["default"](r,t,e)})})}}]),t}();n(e.readyState)&&new a,e.addEventListener("DOMContentLoaded",function(){return new a})}(window,document)},{"./helpers/Events.js":3,"./helpers/Selectors.js":5,"./helpers/Utility.js":6,"./models/Component.js":7,"./models/Module.js":9}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e={};return{fetch:function(n){return e[n]?e[n]:(e[n]=new Promise(function(r){e[n]=t.fetch(n).then(function(t){return t.text()}).then(function(t){r(t)})}),e[n])}}}(window),e.exports=n["default"]},{}],3:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=t("./Utility.js"),i=r(o);!function(){var t=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){this.isPropagationStopped=!0,t.apply(this,arguments)}}(),n["default"]=function(t){var e=[],n=null;return{findById:function(t){function n(e,o){return e._rootNodeID===t?void function(){r={properties:this._currentElement.props,component:o}}.bind(e)():void(e._renderedComponent&&!function(){var t=e._renderedComponent._renderedChildren;t&&Object.keys(t).forEach(function(e){n(t[e],o)})}())}var r=void 0;return e.forEach(function(t){n(t._reactInternalInstance._renderedComponent,t)}),r},transformKeys:function(t){var e=void 0===arguments[1]?"toLowerCase":arguments[1],n={};return Object.keys(t).forEach(function(r){n[r[e]()]=t[r]}),n},registerComponent:function(t){e.push(t)},setupDelegation:function(){var e=this,r=n||function(){return n=Object.keys(t.createElement("a")).filter(function(t){return t.match(/^on/i)}).map(function(t){return t.replace(/^on/i,"")})}();r.forEach(function(n){t.addEventListener(n,function(t){var n="on"+t.type,r=[];i["default"].toArray(t.path).forEach(function(o){if(!t.isPropagationStopped&&o.getAttribute&&o.hasAttribute(i["default"].ATTRIBUTE_REACTID)){var a=e.findById(o.getAttribute(i["default"].ATTRIBUTE_REACTID));if(a&&a.properties){var u=e.transformKeys(a.properties);n in u&&r.push(u[n].bind(a.component,t))}}}),r.forEach(function(t){return t()})})})}}}(window.document),e.exports=n["default"]},{"./Utility.js":6}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){return{warn:function(e){t.log("Maple.js: %c"+e+".","color: #dd4b39")},info:function(e){t.log("Maple.js: %c"+e+".","color: blue")},error:function(e){t.log("Maple.js: %c"+e+".","color: orange")}}}(window.console),e.exports=n["default"]},{}],5:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=t("./Utility.js"),i=r(o),a=function(t){return i["default"].toArray(this.querySelectorAll(t))};n["default"]=function(){return{getExternalStyles:function(t){return a.call(t,'link[type="text/css"]')},getInlineStyles:function(t){return a.call(t,'style[type="text/css"]')},getLinks:function(t){return a.call(t,'link[rel="import"]')},getTemplates:function(t){return a.call(t,"template[ref]")},getScripts:function(t){return a.call(t,'script[type="text/javascript"]')},getAllScripts:function(t){var e=a.call(t,'script[type="text/jsx"]');return[].concat(i["default"].toArray(this.getScripts(t)),i["default"].toArray(e))}}}(),e.exports=n["default"]},{"./Utility.js":6}],6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=3e4;return{ATTRIBUTE_REACTID:"data-reactid",resolver:function(e,n){function r(e){var n=void 0===arguments[1]?t:arguments[1],r=n.createElement("a");return r.href=e,r.href}var o=this.getPath(e),i=this.getPath.bind(this),a=this.getName.bind(this);return{production:{getPath:function(e){return this.isLocalPath(e)?""+this.getAbsolutePath()+"/"+a(e):r(e,t)},getSrc:function(t){return a(t)},getAbsolutePath:function(){return r(e)},getRelativePath:function(){return e},isLocalPath:function(t){return!!~t.indexOf(e)}},development:{getPath:function(e){return this.isLocalPath(e)?""+this.getAbsolutePath()+"/"+e:r(e,t)},getSrc:function(t){return t},getAbsolutePath:function(){return r(o)},getRelativePath:function(){return o},isLocalPath:function(t){return t=i(r(t,n)),!!~r(o).indexOf(t)}}}},toArray:function(t){return Array.from?Array.from(t):Array.prototype.slice.apply(t)},flattenArray:function(t){var e=this,n=void 0===arguments[1]?[]:arguments[1];return t.forEach(function(t){Array.isArray(t)&&e.flattenArray(t,n),!Array.isArray(t)&&n.push(t)}),n},timeoutPromise:function(t){var n=void 0===arguments[1]?"Timeout":arguments[1],r=void 0===arguments[2]?e:arguments[2];setTimeout(function(){return t(new Error(n))},r)},toSnakeCase:function(t){var e=void 0===arguments[1]?"-":arguments[1];return t.split(/([A-Z][a-z]{0,})/g).filter(function(t){return t}).join(e).toLowerCase()},getName:function(t){return t.split("/").slice(-1)},getPath:function(t){return t.split("/").slice(0,-1).join("/")},removeExtension:function(t){return t.split(".").slice(0,-1).join(".")}}}(window.document),e.exports=n["default"]},{}],7:[function(require,module,exports){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),_get=function(t,e,n){for(var r=!0;r;){u=l=s=void 0,r=!1;var o=t,i=e,a=n,u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;t=l,e=i,n=a,r=!0}},_ElementJs=require("./Element.js"),_ElementJs2=_interopRequireDefault(_ElementJs),_helpersUtilityJs=require("./../helpers/Utility.js"),_helpersUtilityJs2=_interopRequireDefault(_helpersUtilityJs),_helpersLoggerJs=require("./../helpers/Logger.js"),_helpersLoggerJs2=_interopRequireDefault(_helpersLoggerJs),_StateManagerJs=require("./StateManager.js"),Component=function(_StateManager){function Component(t,e,n){var r=this;_classCallCheck(this,Component),_get(Object.getPrototypeOf(Component.prototype),"constructor",this).call(this),this.path=t,this.elements={script:n,template:e};var o=n.getAttribute("src");if(this.setState(_StateManagerJs.State.RESOLVING),"text/jsx"===n.getAttribute("type"))return void this.loadJSX(o);var i=""+this.path.getRelativePath()+"/"+_helpersUtilityJs2["default"].removeExtension(o);System["import"](i).then(function(o){o["default"]&&Promise.all(r.loadThirdPartyScripts()).then(function(){new _ElementJs2["default"](t,e,n,o["default"]),r.setState(_StateManagerJs.State.RESOLVED)})})}return _inherits(Component,_StateManager),_createClass(Component,[{key:"loadThirdPartyScripts",value:function(){var t=this,e=_helpersUtilityJs2["default"].toArray(this.elements.template.content.querySelectorAll('script[type="text/javascript"]')),n=e.filter(function(e){return!t.path.isLocalPath(e.getAttribute("src"))});return n.map(function(t){return new Promise(function(e){t.addEventListener("load",function(){return e()}),document.head.appendChild(t)})})}},{key:"loadJSX",value:function loadJSX(src){var _this4=this;_helpersLoggerJs2["default"].warn("Using JSXTransformer which is highly experimental and should not be used for production"),fetch(""+this.path.getRelativePath()+"/"+this.path.getSrc(src)).then(function(t){return t.text()}).then(function(body){var component=babel.transform(body).code,transformed=eval('"use strict"; '+component);Promise.all(_this4.loadThirdPartyScripts()).then(function(){new _ElementJs2["default"](_this4.path,_this4.elements.template,_this4.elements.script,transformed),_this4.setState(_StateManagerJs.State.RESOLVED)})})}}]),Component}(_StateManagerJs.StateManager);exports["default"]=Component,module.exports=exports["default"]},{"./../helpers/Logger.js":4,"./../helpers/Utility.js":6,"./Element.js":8,"./StateManager.js":10}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e,n){for(var r=!0;r;){u=l=s=void 0,r=!1;var o=t,i=e,a=n,u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;t=l,e=i,n=a,r=!0}},s=t("./../helpers/Events.js"),l=r(s),c=t("./../helpers/Utility.js"),f=r(c),p=t("./../helpers/CacheFactory.js"),d=r(p),h=t("./../helpers/Selectors.js"),v=r(h),m=t("./StateManager.js"),y=function(t){function e(t,n,r,i){o(this,e),u(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.path=t,this.elements={script:r,template:n},this.script=i,document.registerElement(this.getElementName(),{prototype:this.getElementPrototype()})}return i(e,t),a(e,[{key:"loadStyles",value:function(t){function e(e){var n=void 0===arguments[1]?t:arguments[1],r=document.createElement("style");r.setAttribute("type","text/css"),r.innerHTML=e,n.appendChild(r)}var n=this;this.setState(m.State.RESOLVING);var r=this.elements.template.content,o=v["default"].getExternalStyles(r),i=v["default"].getInlineStyles(r),a=[].concat(o,i).map(function(r){return new Promise(function(o){return"style"===r.nodeName.toLowerCase()?(e(r.innerHTML,t),void o()):void d["default"].fetch(n.path.getPath(r.getAttribute("href"))).then(function(n){e(n,t),o()})})});return Promise.all(a).then(function(){return n.setState(m.State.RESOLVED)}),a}},{key:"getElementName",value:function(){return f["default"].toSnakeCase(this.script.toString().match(/(?:function|class)\s*([a-z]+)/i)[1])}},{key:"getElementPrototype",value:function(){var t=this.loadStyles.bind(this),e=this.script,n=this.path;return Object.create(HTMLElement.prototype,{attachedCallback:{value:function(){function r(t){for(var n=0;n<t.length;n++){var r=t.item(n),o=/^data-/i;if(r.value){if(r.name===f["default"].ATTRIBUTE_REACTID)continue;var i=r.name.replace(o,"");e.defaultProps[i]=r.value}}}function o(){var e=this;Promise.all(t(u)).then(function(){e.removeAttribute("unresolved"),e.setAttribute("resolved","")})}e.defaultProps={path:n,element:this.cloneNode(!0)},r.call(this,this.attributes),this.innerHTML="";var i=React.createElement(e),a=document.createElement("content"),u=this.createShadowRoot();u.appendChild(a);var s=React.render(i,a);l["default"].registerComponent(s),o.apply(this)}}})}}]),e}(m.StateManager);n["default"]=y,e.exports=n["default"]},{"./../helpers/CacheFactory.js":2,"./../helpers/Events.js":3,"./../helpers/Selectors.js":5,"./../helpers/Utility.js":6,"./StateManager.js":10}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e,n){for(var r=!0;r;){u=l=s=void 0,r=!1;var o=t,i=e,a=n,u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return void 0;t=l,e=i,n=a,r=!0}},s=t("./Component.js"),l=r(s),c=t("./../helpers/Utility.js"),f=r(c),p=t("./../helpers/Selectors.js"),d=r(p),h=t("./StateManager.js"),v=function(t){function e(t){var n=this;o(this,e),u(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.path=f["default"].resolver(t.getAttribute("href"),t["import"]).development,this.state=h.State.UNRESOLVED,this.elements={link:t},this.components=[],this.loadModule(t).then(function(){n.getTemplates().forEach(function(t){var e=d["default"].getAllScripts(t.content);e.map(function(e){var r=e.getAttribute("src");if(n.path.isLocalPath(r)){var o=new l["default"](n.path,t,e);n.components.push(o)}})}),n.setState(h.State.RESOLVED)})}return i(e,t),a(e,[{key:"setState",value:function(t){this.state=t}},{key:"loadModule",value:function(t){return this.setState(h.State.RESOLVING),new Promise(function(e){return t.hasAttribute("ref")?void e(t):t["import"]?void e(t):void t.addEventListener("load",function(){e(t)})})}},{key:"getTemplates",value:function(){var t=this.elements.link["import"];return f["default"].toArray(t.querySelectorAll("template"))}}]),e}(h.StateManager);n["default"]=v,e.exports=n["default"]},{"./../helpers/Selectors.js":5,"./../helpers/Utility.js":6,"./Component.js":7,"./StateManager.js":10}],10:[function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i={UNRESOLVED:0,RESOLVING:1,RESOLVED:2};n.State=i;var a=function(){function t(){r(this,t),this.state=i.UNRESOLVED}return o(t,[{key:"setState",value:function(t){this.state=t}}]),t}();n.StateManager=a},{}]},{},[1]);
frontend/src/components/dashboard/partnerDashboard/listOfSubmittedConceptNotes.js
unicef/un-partner-portal
import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import Typography from 'material-ui/Typography'; import { TableCell } from 'material-ui/Table'; import HeaderList from '../../common/list/headerList'; import { loadSubmittedCN } from '../../../reducers/submittedCN'; import PaginatedList from '../../common/list/paginatedList'; import TableWithLocalState from '../../common/hoc/tableWithLocalState'; import EoiCountryCell from '../../eois/cells/eoiCountryCell'; import EoiSectorCell from '../../eois/cells/eoiSectorCell'; import ApplicationStatusCell from '../../eois/cells/applicationStatusCell'; import ApplicationIDCell from './applicationId'; const messages = { title: 'List of Submitted Applications', }; const columns = [ { name: 'cn_id', title: 'Application ID' }, { name: 'project_title', title: 'Project Title', width: 250 }, { name: 'cfei_type', title: 'Application Type' }, { name: 'agency_name', title: 'UN Agency' }, { name: 'countries', title: 'Country' }, { name: 'specializations', title: 'Sector & Area of Specialization' }, { name: 'application_status', title: 'Status' }, ]; const renderCells = ({ row, column, value }) => { if (column.name === 'cn_id') { return (<ApplicationIDCell type={row.cfei_type} eoiId={`${row.eoi_id}`} cnId={`${row.cn_id}`} />); } else if (column.name === 'countries') { return ( <TableCell > {row.countries.map((code, index) => (<span key={code}> <EoiCountryCell code={code} /> {(index === row.countries.length - 1) ? '' : ', '} </span>), )} </TableCell>); } else if (column.name === 'specializations') { return ( <TableCell> <EoiSectorCell data={row.specializations} id={row.cn_id} /> </TableCell>); } else if (column.name === 'application_status') { return ( <ApplicationStatusCell status={'Pen'} applicationStatus={row.application_status} id={row.id} />); } return <TableCell><Typography>{value}</Typography></TableCell>; }; renderCells.propTypes = { row: PropTypes.object, column: PropTypes.object, }; const ListOfSubmittedCN = (props) => { const { loading, data = [], loadCN, itemsCount } = props; return ( <HeaderList header={<Typography style={{ margin: 'auto 0' }} type="headline" >{messages.title}</Typography>} loading={loading} > <TableWithLocalState component={PaginatedList} items={data} itemsCount={itemsCount} columns={columns} loading={loading} templateCell={renderCells} loadingFunction={loadCN} /> </HeaderList> ); }; ListOfSubmittedCN.propTypes = { loading: PropTypes.bool, data: PropTypes.array, loadCN: PropTypes.func, itemsCount: PropTypes.number, }; const mapStateToProps = state => ({ loading: state.submittedCN.status.loading, data: state.submittedCN.data.submittedCN, itemsCount: state.submittedCN.data.count, }); const mapDispatchToProps = dispatch => ({ loadCN: params => dispatch(loadSubmittedCN(params)), }); export default connect(mapStateToProps, mapDispatchToProps)(ListOfSubmittedCN);
react/Header/components/Menu/Menu.js
seekinternational/seek-asia-style-guide
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import styles from './Menu.less'; import MenuItem from './components/MenuItem/MenuItem'; import { Text, Section, Icon } from 'seek-asia-style-guide/react'; import { AUTHENTICATED, UNAUTHENTICATED, AUTH_PENDING } from 'seek-asia-style-guide/react/private/authStatusTypes'; import _get from 'lodash/get'; export default class Menu extends Component { state = { subMenuOpen: false, subMenuOpenIndex: 0, localesMenuOpen: false }; openSubMenu = i => { this.setState({ subMenuOpenIndex: i }); } toggleSubMenu = () => { this.setState({ subMenuOpen: !this.state.subMenuOpen }); } toggleLocalesMenu = () => { this.setState({ localesMenuOpen: !this.state.localesMenuOpen }); } renderMenuLinks = ({ menuMessage, brandStyles, linkRenderer }, links) => { if (links && links.map) { const menuItems = links.map((link, index) => ( link.children ? ( <div key={index}> <MenuItem handleClick={() => { this.openSubMenu(index); this.toggleSubMenu(); }} ItemIcon={link.ItemIcon} brandStyles={brandStyles} linkRenderer={linkRenderer}> {link.title} </MenuItem> {this.state.subMenuOpenIndex === index && ( <div className={this.state.subMenuOpen ? styles.showSubMenu : styles.subMenu}> <MenuItem handleClick={this.toggleSubMenu} className={styles.backLink} ItemIcon={<Icon type='chevron' lineHeight='loud' size='small' rotation="-90deg" className={styles.backLink} />} linkRenderer={linkRenderer}> {_get(menuMessage, 'backToMenu')} </MenuItem> { link.children && link.children.map((sublink, i) => { return ( <MenuItem key={i} linkUrl={sublink.url} className={styles.subItem} ItemIcon={sublink.ItemIcon} brandStyles={brandStyles} linkRenderer={linkRenderer}> {sublink.title} </MenuItem> ); }) } </div> )} </div> ) : ( <MenuItem key={index} linkUrl={link.url} ItemIcon={link.ItemIcon} brandStyles={brandStyles} linkRenderer={linkRenderer}> {link.title} </MenuItem> ) )); return ( <div className={styles.menuBody}> {menuItems} </div> ); } return null; } render() { const { menuMessage, headerMessage, shouldShowMenu, links, locales, brandStyles, employerSite, authenticationStatus, userName, linkRenderer, loginAvailable, HeaderComponent, pageType } = this.props; const selectedLocale = locales[0]; const openMenu = shouldShowMenu; return ( <div className={classnames(styles.root, { [styles.showMenu]: openMenu })}> <HeaderComponent /> <Section className={styles.headerMenu}> <Text whisperingTitle> {authenticationStatus === AUTHENTICATED ? userName.toUpperCase() : _get(menuMessage, 'jobSeekerHeader')}</Text> </Section> { authenticationStatus === AUTHENTICATED && (<div className={styles.menuBody}> <MenuItem linkUrl={_get(headerMessage, 'profile.url')} ItemIcon={<Icon type='profileMale' lineHeight='conversational' size='small' className={brandStyles.menuIcon} />} linkRenderer={linkRenderer} > {_get(headerMessage, 'profile.title')} </MenuItem> <MenuItem linkUrl={_get(headerMessage, 'invitation.url')} ItemIcon={<Icon type='jobInvitation' lineHeight='conversational' size='small' className={brandStyles.menuIcon} />} linkRenderer={linkRenderer} > {_get(headerMessage, 'invitation.title')} </MenuItem> </div>) } {this.renderMenuLinks({ menuMessage, brandStyles, linkRenderer }, links)} { authenticationStatus === UNAUTHENTICATED && employerSite && (<div className={styles.menuBody}> <MenuItem linkUrl={_get(headerMessage, 'employer.url')} ItemIcon={<Icon type='employer' lineHeight='conversational' size='small' className={styles.employer} />} linkRenderer={linkRenderer}> {_get(headerMessage, 'employer.title')} </MenuItem> </div>) } <Section className={styles.headerMenu}> <Text whisperingTitle>{_get(menuMessage, 'settingsHeader')}</Text> </Section> <div className={styles.menuBody}> {locales && locales.length && ( <MenuItem title={_get(menuMessage, 'countryAndLanguage')} handleClick={this.toggleLocalesMenu} ItemIcon={<Icon type='country' lineHeight='conversational' size='small' className={brandStyles.menuIcon} />} brandStyles={brandStyles} linkRenderer={linkRenderer}> {selectedLocale.title} </MenuItem> )} </div> { authenticationStatus === AUTHENTICATED && (<div className={styles.menuBody}> <MenuItem className={styles.loginSignup} linkUrl={_get(headerMessage, 'mobileLogoutUrl')} brandStyles={brandStyles} linkRenderer={linkRenderer}> {_get(headerMessage, 'logout.title')} </MenuItem> </div>) } { authenticationStatus === UNAUTHENTICATED && loginAvailable && ( <MenuItem className={styles.loginSignup} linkUrl={_get(headerMessage, ['mobileLoginUrl', pageType])} brandStyles={brandStyles} linkRenderer={linkRenderer}> {_get(headerMessage, 'login.title')} </MenuItem> ) } { authenticationStatus === UNAUTHENTICATED && loginAvailable && ( <MenuItem className={styles.loginSignup} linkUrl={_get(headerMessage, 'signUp.url')} brandStyles={brandStyles} linkRenderer={linkRenderer}> {_get(headerMessage, 'signUp.title')} </MenuItem> ) } <div className={this.state.localesMenuOpen ? styles.showSubMenu : styles.subMenu}> <MenuItem handleClick={this.toggleLocalesMenu} className={styles.backLink} ItemIcon={<Icon type='chevron' lineHeight='loud' size='small' rotation="-90deg" className={styles.backLink} />} linkRenderer={linkRenderer}> {_get(menuMessage, 'backToMenu')} </MenuItem> <MenuItem ItemIcon={<selectedLocale.ItemIcon className={styles.flag} />} descriptionProps={{ strong: true, className: styles.selectedLocale }}> {selectedLocale.title} </MenuItem> {locales && locales.map && locales.map((link, index) => { if (index > 0) { return ( <MenuItem key={index} linkUrl={link.url} ItemIcon={<link.ItemIcon className={styles.flag} />} brandStyles={brandStyles} linkRenderer={linkRenderer}> {link.title} </MenuItem> ); } return null; })} </div> </div> ); } } Menu.propTypes = { headerMessage: PropTypes.object.isRequired, menuMessage: PropTypes.object.isRequired, shouldShowMenu: PropTypes.bool, links: PropTypes.array, locales: PropTypes.array.isRequired, brandStyles: PropTypes.object.isRequired, rightLinks: PropTypes.array, menulinks: PropTypes.array, btns: PropTypes.array, employerSite: PropTypes.bool, authenticationStatus: PropTypes.oneOf([ AUTHENTICATED, UNAUTHENTICATED, AUTH_PENDING ]).isRequired, linkRenderer: PropTypes.func, userName: PropTypes.string, loginAvailable: PropTypes.bool, HeaderComponent: PropTypes.func, pageType: PropTypes.string };
docs/src/examples/collections/Form/States/FormExampleFieldError.js
Semantic-Org/Semantic-UI-React
import React from 'react' import { Form } from 'semantic-ui-react' const options = [ { key: 'm', text: 'Male', value: 'male' }, { key: 'f', text: 'Female', value: 'female' }, { key: 'o', text: 'Other', value: 'other' }, ] const FormExampleFieldError = () => ( <Form> <Form.Group widths='equal'> <Form.Input fluid label='First name' placeholder='First name' error /> <Form.Input fluid label='Last name' placeholder='Last name' /> </Form.Group> <Form.Select options={options} placeholder='Gender' error /> <Form.Checkbox label='I agree to the Terms and Conditions' error /> </Form> ) export default FormExampleFieldError
node_modules/react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.ios.js
odapplications/WebView-with-Lower-Tab-Menu
'use strict'; import React, { Component } from 'react'; import { StyleSheet, Text, View, } from 'react-native'; export default class WelcomeText extends Component { render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> This app shows the basics of navigating between a few screens, working with ListView and handling text input. </Text> <Text style={styles.instructions}> Modify any files to get started. For example try changing the file{'\n'}views/welcome/WelcomeText.ios.js. </Text> <Text style={styles.instructions}> Press Cmd+R to reload,{'\n'} Cmd+D or shake for dev menu. </Text> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white', padding: 20, }, welcome: { fontSize: 20, textAlign: 'center', margin: 16, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 12, }, });
src/svg-icons/device/add-alarm.js
mit-cml/iot-website-source
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceAddAlarm = (props) => ( <SvgIcon {...props}> <path d="M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm1-11h-2v3H8v2h3v3h2v-3h3v-2h-3V9z"/> </SvgIcon> ); DeviceAddAlarm = pure(DeviceAddAlarm); DeviceAddAlarm.displayName = 'DeviceAddAlarm'; DeviceAddAlarm.muiName = 'SvgIcon'; export default DeviceAddAlarm;
examples/shopping-cart/src/components/Cart.spec.js
roth1002/redux
import React from 'react' import { shallow } from 'enzyme' import Cart from './Cart' import Product from './Product' const setup = (total, products = []) => { const actions = { onCheckoutClicked: jest.fn() } const component = shallow( <Cart products={products} total={total} {...actions} /> ) return { component: component, actions: actions, button: component.find('button'), products: component.find(Product), em: component.find('em'), p: component.find('p') } } describe('Cart component', () => { it('should display total', () => { const { p } = setup('76') expect(p.text()).toMatch(/^Total: \$76/) }) it('should display add some products message', () => { const { em } = setup() expect(em.text()).toMatch(/^Please add some products to cart/) }) it('should disable button', () => { const { button } = setup() expect(button.prop('disabled')).toEqual('disabled') }) describe('when given product', () => { const product = [ { id: 1, title: 'Product 1', price: 9.99, quantity: 1 } ] it('should render products', () => { const { products } = setup('9.99', product) const props = { title: product[0].title, price: product[0].price, quantity: product[0].quantity } expect(products.at(0).props()).toEqual(props) }) it('should not disable button', () => { const { button } = setup('9.99', product) expect(button.prop('disabled')).toEqual('') }) it('should call action on button click', () => { const { button, actions } = setup('9.99', product) button.simulate('click') expect(actions.onCheckoutClicked).toBeCalled() }) }) })
src/js/Header/center-navbar.js
msdkeian/laleh-react
import React from 'react'; import {Link} from 'react-router-dom'; import uuid from 'uuid'; function CenterNavbar() { const productNames = [ 'clothing', 'shoes', 'accessories', 'sports' ]; const products = productNames.map((product) => ( <li key={uuid.v4()}> <Link to={product} className="nav-item"> {product.charAt(0).toUpperCase() + product.slice(1)} </Link> </li> )); return ( <div className="nav-center-wrapper"> <ul className="nav-center "> {products} </ul> </div> ); } export default CenterNavbar
ajax/libs/yui/3.2.0/event/event-debug.js
jaywcjlove/cdnjs
/* * DOM event listener abstraction layer * @module event * @submodule event-base */ (function() { // Unlike most of the library, this code has to be executed as soon as it is // introduced into the page -- and it should only be executed one time // regardless of the number of instances that use it. var stateChangeListener, GLOBAL_ENV = YUI.Env, config = YUI.config, doc = config.doc, docElement = doc && doc.documentElement, doScrollCap = docElement && docElement.doScroll, add = YUI.Env.add, remove = YUI.Env.remove, targetEvent = (doScrollCap) ? 'onreadystatechange' : 'DOMContentLoaded', pollInterval = config.pollInterval || 40, _ready = function(e) { GLOBAL_ENV._ready(); }; if (!GLOBAL_ENV._ready) { GLOBAL_ENV._ready = function() { if (!GLOBAL_ENV.DOMReady) { GLOBAL_ENV.DOMReady = true; remove(doc, targetEvent, _ready); // remove DOMContentLoaded listener } }; /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ // Internet Explorer: use the doScroll() method on the root element. This isolates what // appears to be a safe moment to manipulate the DOM prior to when the document's readyState // suggests it is safe to do so. if (doScrollCap) { if (self !== self.top) { stateChangeListener = function() { if (doc.readyState == 'complete') { remove(doc, targetEvent, stateChangeListener); // remove onreadystatechange listener _ready(); } }; add(doc, targetEvent, stateChangeListener); // add onreadystatechange listener } else { GLOBAL_ENV._dri = setInterval(function() { try { docElement.doScroll('left'); clearInterval(GLOBAL_ENV._dri); GLOBAL_ENV._dri = null; _ready(); } catch (domNotReady) { } }, pollInterval); } } else { // FireFox, Opera, Safari 3+ provide an event for this moment. add(doc, targetEvent, _ready); // add DOMContentLoaded listener } } })(); YUI.add('event-base', function(Y) { (function() { /* * DOM event listener abstraction layer * @module event * @submodule event-base */ var GLOBAL_ENV = YUI.Env, yready = function() { Y.fire('domready'); }; /** * The domready event fires at the moment the browser's DOM is * usable. In most cases, this is before images are fully * downloaded, allowing you to provide a more responsive user * interface. * * In YUI 3, domready subscribers will be notified immediately if * that moment has already passed when the subscription is created. * * One exception is if the yui.js file is dynamically injected into * the page. If this is done, you must tell the YUI instance that * you did this in order for DOMReady (and window load events) to * fire normally. That configuration option is 'injected' -- set * it to true if the yui.js script is not included inline. * * This method is part of the 'event-ready' module, which is a * submodule of 'event'. * * @event domready * @for YUI */ Y.publish('domready', { fireOnce: true, async: true }); if (GLOBAL_ENV.DOMReady) { // console.log('DOMReady already fired', 'info', 'event'); yready(); } else { // console.log('setting up before listener', 'info', 'event'); // console.log('env: ' + YUI.Env.windowLoaded, 'info', 'event'); Y.before(yready, GLOBAL_ENV, "_ready"); } })(); (function() { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ /** * Wraps a DOM event, properties requiring browser abstraction are * fixed here. Provids a security layer when required. * @class DOMEventFacade * @param ev {Event} the DOM event * @param currentTarget {HTMLElement} the element the listener was attached to * @param wrapper {Event.Custom} the custom event wrapper for this DOM event */ /* * @TODO constants? LEFTBUTTON, MIDDLEBUTTON, RIGHTBUTTON, keys */ /* var whitelist = { altKey : 1, // "button" : 1, // we supply // "bubbles" : 1, // needed? // "cancelable" : 1, // needed? // "charCode" : 1, // we supply cancelBubble : 1, // "currentTarget" : 1, // we supply ctrlKey : 1, clientX : 1, // needed? clientY : 1, // needed? detail : 1, // not fully implemented // "fromElement" : 1, keyCode : 1, // "height" : 1, // needed? // "initEvent" : 1, // need the init events? // "initMouseEvent" : 1, // "initUIEvent" : 1, // "layerX" : 1, // needed? // "layerY" : 1, // needed? metaKey : 1, // "modifiers" : 1, // needed? // "offsetX" : 1, // needed? // "offsetY" : 1, // needed? // "preventDefault" : 1, // we supply // "reason" : 1, // IE proprietary // "relatedTarget" : 1, // "returnValue" : 1, // needed? shiftKey : 1, // "srcUrn" : 1, // IE proprietary // "srcElement" : 1, // "srcFilter" : 1, IE proprietary // "stopPropagation" : 1, // we supply // "target" : 1, // "timeStamp" : 1, // needed? // "toElement" : 1, type : 1, // "view" : 1, // "which" : 1, // we supply // "width" : 1, // needed? x : 1, y : 1 }, */ var ua = Y.UA, /** * webkit key remapping required for Safari < 3.1 * @property webkitKeymap * @private */ webkitKeymap = { 63232: 38, // up 63233: 40, // down 63234: 37, // left 63235: 39, // right 63276: 33, // page up 63277: 34, // page down 25: 9, // SHIFT-TAB (Safari provides a different key code in // this case, even though the shiftKey modifier is set) 63272: 46, // delete 63273: 36, // home 63275: 35 // end }, /** * Returns a wrapped node. Intended to be used on event targets, * so it will return the node's parent if the target is a text * node. * * If accessing a property of the node throws an error, this is * probably the anonymous div wrapper Gecko adds inside text * nodes. This likely will only occur when attempting to access * the relatedTarget. In this case, we now return null because * the anonymous div is completely useless and we do not know * what the related target was because we can't even get to * the element's parent node. * * @method resolve * @private */ resolve = function(n) { try { if (n && 3 == n.nodeType) { n = n.parentNode; } } catch(e) { return null; } return Y.one(n); }; // provide a single event with browser abstractions resolved // // include all properties for both browers? // include only DOM2 spec properties? // provide browser-specific facade? Y.DOMEventFacade = function(ev, currentTarget, wrapper) { wrapper = wrapper || {}; var e = ev, ot = currentTarget, d = Y.config.doc, b = d.body, x = e.pageX, y = e.pageY, c, t, de = d.documentElement, overrides = wrapper.overrides || {}; this.altKey = e.altKey; this.ctrlKey = e.ctrlKey; this.metaKey = e.metaKey; this.shiftKey = e.shiftKey; this.type = overrides.type || e.type; this.clientX = e.clientX; this.clientY = e.clientY; ////////////////////////////////////////////////////// if (('clientX' in e) && (!x) && (0 !== x)) { x = e.clientX; y = e.clientY; if (ua.ie) { x += (de.scrollLeft || b.scrollLeft || 0); y += (de.scrollTop || b.scrollTop || 0); } } this._yuifacade = true; /** * The native event * @property _event */ this._event = e; /** * The X location of the event on the page (including scroll) * @property pageX * @type int */ this.pageX = x; /** * The Y location of the event on the page (including scroll) * @property pageY * @type int */ this.pageY = y; ////////////////////////////////////////////////////// c = e.keyCode || e.charCode || 0; if (ua.webkit && (c in webkitKeymap)) { c = webkitKeymap[c]; } /** * The keyCode for key events. Uses charCode if keyCode is not available * @property keyCode * @type int */ this.keyCode = c; /** * The charCode for key events. Same as keyCode * @property charCode * @type int */ this.charCode = c; ////////////////////////////////////////////////////// /** * The button that was pushed. * @property button * @type int */ this.button = e.which || e.button; /** * The button that was pushed. Same as button. * @property which * @type int */ this.which = this.button; ////////////////////////////////////////////////////// /** * Node reference for the targeted element * @propery target * @type Node */ this.target = resolve(e.target || e.srcElement); /** * Node reference for the element that the listener was attached to. * @propery currentTarget * @type Node */ this.currentTarget = resolve(ot); t = e.relatedTarget; if (!t) { if (e.type == "mouseout") { t = e.toElement; } else if (e.type == "mouseover") { t = e.fromElement; } } /** * Node reference to the relatedTarget * @propery relatedTarget * @type Node */ this.relatedTarget = resolve(t); /** * Number representing the direction and velocity of the movement of the mousewheel. * Negative is down, the higher the number, the faster. Applies to the mousewheel event. * @property wheelDelta * @type int */ if (e.type == "mousewheel" || e.type == "DOMMouseScroll") { this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1); } ////////////////////////////////////////////////////// // methods /** * Stops the propagation to the next bubble target * @method stopPropagation */ this.stopPropagation = function() { if (e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } wrapper.stopped = 1; this.stopped = 1; }; /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ this.stopImmediatePropagation = function() { if (e.stopImmediatePropagation) { e.stopImmediatePropagation(); } else { this.stopPropagation(); } wrapper.stopped = 2; this.stopped = 2; }; /** * Prevents the event's default behavior * @method preventDefault * @param returnValue {string} sets the returnValue of the event to this value * (rather than the default false value). This can be used to add a customized * confirmation query to the beforeunload event). */ this.preventDefault = function(returnValue) { if (e.preventDefault) { e.preventDefault(); } e.returnValue = returnValue || false; wrapper.prevented = 1; this.prevented = 1; }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ this.halt = function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); }; if (this._touch) { this._touch(e, currentTarget, wrapper); } }; })(); (function() { /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * * @class Event * @static */ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; var _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add, remove = YUI.Env.remove, onLoad = function() { YUI.Env.windowLoaded = true; Y.Event._load(); remove(win, "load", onLoad); }, onUnload = function() { Y.Event._unload(); remove(win, "unload", onUnload); }, EVENT_READY = 'domready', COMPAT_ARG = '~yui|2|compat~', shouldIterate = function(o) { try { return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !o.alert); } catch(ex) { Y.log("collection check failure", "warn", "event"); return false; } }, Event = function() { /** * True after the onload event has fired * @property _loadComplete * @type boolean * @static * @private */ var _loadComplete = false, /** * The number of times to poll after window.onload. This number is * increased if additional late-bound handlers are requested after * the page load. * @property _retryCount * @static * @private */ _retryCount = 0, /** * onAvailable listeners * @property _avail * @static * @private */ _avail = [], /** * Custom event wrappers for DOM events. Key is * 'event:' + Element uid stamp + event type * @property _wrappers * @type Y.Event.Custom * @static * @private */ _wrappers = _eventenv.dom_wrappers, _windowLoadKey = null, /** * Custom event wrapper map DOM events. Key is * Element uid stamp. Each item is a hash of custom event * wrappers as provided in the _wrappers collection. This * provides the infrastructure for getListeners. * @property _el_events * @static * @private */ _el_events = _eventenv.dom_map; return { /** * The number of times we should look for elements that are not * in the DOM at the time the event is requested after the document * has been loaded. The default is 1000@amp;40 ms, so it will poll * for 40 seconds or until all outstanding handlers are bound * (whichever comes first). * @property POLL_RETRYS * @type int * @static * @final */ POLL_RETRYS: 1000, /** * The poll interval in milliseconds * @property POLL_INTERVAL * @type int * @static * @final */ POLL_INTERVAL: 40, /** * addListener/removeListener can throw errors in unexpected scenarios. * These errors are suppressed, the method returns false, and this property * is set * @property lastError * @static * @type Error */ lastError: null, /** * poll handle * @property _interval * @static * @private */ _interval: null, /** * document readystate poll handle * @property _dri * @static * @private */ _dri: null, /** * True when the document is initially usable * @property DOMReady * @type boolean * @static */ DOMReady: false, /** * @method startInterval * @static * @private */ startInterval: function() { if (!Event._interval) { Event._interval = setInterval(Y.bind(Event._poll, Event), Event.POLL_INTERVAL); } }, /** * Executes the supplied callback when the item with the supplied * id is found. This is meant to be used to execute behavior as * soon as possible as the page loads. If you use this after the * initial page load it will poll for a fixed time for the element. * The number of times it will poll and the frequency are * configurable. By default it will poll for 10 seconds. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onAvailable * * @param {string||string[]} id the id of the element, or an array * of ids to look for. * @param {function} fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} p_override If set to true, fn will execute * in the context of p_obj, if set to an object it * will execute in the context of that object * @param checkContent {boolean} check child node readiness (onContentReady) * @static * @deprecated Use Y.on("available") */ // @TODO fix arguments onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) { var a = Y.Array(id), i, availHandle; // Y.log('onAvailable registered for: ' + id); for (i=0; i<a.length; i=i+1) { _avail.push({ id: a[i], fn: fn, obj: p_obj, override: p_override, checkReady: checkContent, compat: compat }); } _retryCount = this.POLL_RETRYS; // We want the first test to be immediate, but async setTimeout(Y.bind(Event._poll, Event), 0); availHandle = new Y.EventHandle({ _delete: function() { // set by the event system for lazy DOM listeners if (availHandle.handle) { availHandle.handle.detach(); return; } var i, j; // otherwise try to remove the onAvailable listener(s) for (i = 0; i < a.length; i++) { for (j = 0; j < _avail.length; j++) { if (a[i] === _avail[j].id) { _avail.splice(j, 1); } } } } }); return availHandle; }, /** * Works the same way as onAvailable, but additionally checks the * state of sibling elements to determine if the content of the * available element is safe to modify. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onContentReady * * @param {string} id the id of the element to look for. * @param {function} fn what to execute when the element is ready. * @param {object} p_obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} p_override If set to true, fn will execute * in the context of p_obj. If an object, fn will * exectute in the context of that object * * @static * @deprecated Use Y.on("contentready") */ // @TODO fix arguments onContentReady: function(id, fn, p_obj, p_override, compat) { return this.onAvailable(id, fn, p_obj, p_override, true, compat); }, /** * Adds an event listener * * @method attach * * @param {String} type The type of event to append * @param {Function} fn The method the event invokes * @param {String|HTMLElement|Array|NodeList} el An id, an element * reference, or a collection of ids and/or elements to assign the * listener to. * @param {Object} context optional context object * @param {Boolean|object} args 0..n arguments to pass to the callback * @return {EventHandle} an object to that can be used to detach the listener * * @static */ attach: function(type, fn, el, context) { return Event._attach(Y.Array(arguments, 0, true)); }, _createWrapper: function (el, type, capture, compat, facade) { var cewrapper, ek = Y.stamp(el), key = 'event:' + ek + type; if (false === facade) { key += 'native'; } if (capture) { key += 'capture'; } cewrapper = _wrappers[key]; if (!cewrapper) { // create CE wrapper cewrapper = Y.publish(key, { silent: true, bubbles: false, contextFn: function() { if (compat) { return cewrapper.el; } else { cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el); return cewrapper.nodeRef; } } }); cewrapper.overrides = {}; // for later removeListener calls cewrapper.el = el; cewrapper.key = key; cewrapper.domkey = ek; cewrapper.type = type; cewrapper.fn = function(e) { cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade)))); }; cewrapper.capture = capture; if (el == win && type == "load") { // window load happens once cewrapper.fireOnce = true; _windowLoadKey = key; } _wrappers[key] = cewrapper; _el_events[ek] = _el_events[ek] || {}; _el_events[ek][key] = cewrapper; add(el, type, cewrapper.fn, capture); } return cewrapper; }, _attach: function(args, conf) { var compat, handles, oEl, cewrapper, context, fireNow = false, ret, type = args[0], fn = args[1], el = args[2] || win, facade = conf && conf.facade, capture = conf && conf.capture, overrides = conf && conf.overrides; if (args[args.length-1] === COMPAT_ARG) { compat = true; // trimmedArgs.pop(); } if (!fn || !fn.call) { // throw new TypeError(type + " attach call failed, callback undefined"); Y.log(type + " attach call failed, invalid callback", "error", "event"); return false; } // The el argument can be an array of elements or element ids. if (shouldIterate(el)) { handles=[]; Y.each(el, function(v, k) { args[2] = v; handles.push(Event._attach(args, conf)); }); // return (handles.length === 1) ? handles[0] : handles; return new Y.EventHandle(handles); // If the el argument is a string, we assume it is // actually the id of the element. If the page is loaded // we convert el to the actual element, otherwise we // defer attaching the event until the element is // ready } else if (Y.Lang.isString(el)) { // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) { oEl = Y.DOM.byId(el); } else { oEl = Y.Selector.query(el); switch (oEl.length) { case 0: oEl = null; break; case 1: oEl = oEl[0]; break; default: args[2] = oEl; return Event._attach(args, conf); } } if (oEl) { el = oEl; // Not found = defer adding the event until the element is available } else { // Y.log(el + ' not found'); ret = this.onAvailable(el, function() { // Y.log('lazy attach: ' + args); ret.handle = Event._attach(args, conf); }, Event, true, false, compat); return ret; } } // Element should be an html element or node if (!el) { Y.log("unable to attach event " + type, "warn", "event"); return false; } if (Y.Node && el instanceof Y.Node) { el = Y.Node.getDOMNode(el); } cewrapper = this._createWrapper(el, type, capture, compat, facade); if (overrides) { Y.mix(cewrapper.overrides, overrides); } if (el == win && type == "load") { // if the load is complete, fire immediately. // all subscribers, including the current one // will be notified. if (YUI.Env.windowLoaded) { fireNow = true; } } if (compat) { args.pop(); } context = args[3]; // set context to the Node if not specified // ret = cewrapper.on.apply(cewrapper, trimmedArgs); ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null); if (fireNow) { cewrapper.fire(); } return ret; }, /** * Removes an event listener. Supports the signature the event was bound * with, but the preferred way to remove listeners is using the handle * that is returned when using Y.on * * @method detach * * @param {String} type the type of event to remove. * @param {Function} fn the method the event invokes. If fn is * undefined, then all event handlers for the type of event are * removed. * @param {String|HTMLElement|Array|NodeList|EventHandle} el An * event handle, an id, an element reference, or a collection * of ids and/or elements to remove the listener from. * @return {boolean} true if the unbind was successful, false otherwise. * @static */ detach: function(type, fn, el, obj) { var args=Y.Array(arguments, 0, true), compat, l, ok, i, id, ce; if (args[args.length-1] === COMPAT_ARG) { compat = true; // args.pop(); } if (type && type.detach) { return type.detach(); } // The el argument can be a string if (typeof el == "string") { // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) { el = Y.DOM.byId(el); } else { el = Y.Selector.query(el); l = el.length; if (l < 1) { el = null; } else if (l == 1) { el = el[0]; } } // return Event.detach.apply(Event, args); } if (!el) { return false; } if (el.detach) { args.splice(2, 1); return el.detach.apply(el, args); // The el argument can be an array of elements or element ids. } else if (shouldIterate(el)) { ok = true; for (i=0, l=el.length; i<l; ++i) { args[2] = el[i]; ok = ( Y.Event.detach.apply(Y.Event, args) && ok ); } return ok; } if (!type || !fn || !fn.call) { return this.purgeElement(el, false, type); } id = 'event:' + Y.stamp(el) + type; ce = _wrappers[id]; if (ce) { return ce.detach(fn); } else { return false; } }, /** * Finds the event in the window object, the caller's arguments, or * in the arguments of another method in the callstack. This is * executed automatically for events registered through the event * manager, so the implementer should not normally need to execute * this function at all. * @method getEvent * @param {Event} e the event parameter from the handler * @param {HTMLElement} el the element the listener was attached to * @return {Event} the event * @static */ getEvent: function(e, el, noFacade) { var ev = e || win.event; return (noFacade) ? ev : new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]); }, /** * Generates an unique ID for the element if it does not already * have one. * @method generateId * @param el the element to create the id for * @return {string} the resulting id of the element * @static */ generateId: function(el) { var id = el.id; if (!id) { id = Y.stamp(el); el.id = id; } return id; }, /** * We want to be able to use getElementsByTagName as a collection * to attach a group of events to. Unfortunately, different * browsers return different types of collections. This function * tests to determine if the object is array-like. It will also * fail if the object is an array, but is empty. * @method _isValidCollection * @param o the object to test * @return {boolean} true if the object is array-like and populated * @deprecated was not meant to be used directly * @static * @private */ _isValidCollection: shouldIterate, /** * hook up any deferred listeners * @method _load * @static * @private */ _load: function(e) { if (!_loadComplete) { // Y.log('Load Complete', 'info', 'event'); _loadComplete = true; // Just in case DOMReady did not go off for some reason // E._ready(); if (Y.fire) { Y.fire(EVENT_READY); } // Available elements may not have been detected before the // window load event fires. Try to find them now so that the // the user is more likely to get the onAvailable notifications // before the window load notification Event._poll(); } }, /** * Polling function that runs before the onload event fires, * attempting to attach to DOM Nodes as soon as they are * available * @method _poll * @static * @private */ _poll: function() { if (this.locked) { return; } if (Y.UA.ie && !YUI.Env.DOMReady) { // Hold off if DOMReady has not fired and check current // readyState to protect against the IE operation aborted // issue. this.startInterval(); return; } this.locked = true; // Y.log.debug("poll"); // keep trying until after the page is loaded. We need to // check the page load state prior to trying to bind the // elements so that we can be certain all elements have been // tested appropriately var i, len, item, el, notAvail, executeItem, tryAgain = !_loadComplete; if (!tryAgain) { tryAgain = (_retryCount > 0); } // onAvailable notAvail = []; executeItem = function (el, item) { var context, ov = item.override; if (item.compat) { if (item.override) { if (ov === true) { context = item.obj; } else { context = ov; } } else { context = el; } item.fn.call(context, item.obj); } else { context = item.obj || Y.one(el); item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []); } }; // onAvailable for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // Y.log('avail: ' + el); executeItem(el, item); _avail[i] = null; } else { // Y.log('NOT avail: ' + el); notAvail.push(item); } } } // onContentReady for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready // @todo should we test parentNode.nextSibling? if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) { executeItem(el, item); _avail[i] = null; } } else { notAvail.push(item); } } } _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1; if (tryAgain) { // we may need to strip the nulled out items here this.startInterval(); } else { clearInterval(this._interval); this._interval = null; } this.locked = false; return; }, /** * Removes all listeners attached to the given element via addListener. * Optionally, the node's children can also be purged. * Optionally, you can specify a specific type of event to remove. * @method purgeElement * @param {HTMLElement} el the element to purge * @param {boolean} recurse recursively purge this element's children * as well. Use with caution. * @param {string} type optional type of listener to purge. If * left out, all listeners will be removed * @static */ purgeElement: function(el, recurse, type) { // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el, var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el, lis = this.getListeners(oEl, type), i, len, props, children, child; if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl); i = 0; len = children.length; for (; i < len; ++i) { child = this.getListeners(children[i], type); if (child) { lis = lis.concat(child); } } } if (lis) { i = 0; len = lis.length; for (; i < len; ++i) { props = lis[i]; props.detachAll(); remove(props.el, props.type, props.fn, props.capture); delete _wrappers[props.key]; delete _el_events[props.domkey][props.key]; } } }, /** * Returns all listeners attached to the given element via addListener. * Optionally, you can specify a specific type of event to return. * @method getListeners * @param el {HTMLElement|string} the element or element id to inspect * @param type {string} optional type of listener to return. If * left out, all listeners will be returned * @return {Y.Custom.Event} the custom event wrapper for the DOM event(s) * @static */ getListeners: function(el, type) { var ek = Y.stamp(el, true), evts = _el_events[ek], results=[] , key = (type) ? 'event:' + ek + type : null, adapters = _eventenv.plugins; if (!evts) { return null; } if (key) { // look for synthetic events if (adapters[type] && adapters[type].eventDef) { key += '_synth'; } if (evts[key]) { results.push(evts[key]); } // get native events as well key += 'native'; if (evts[key]) { results.push(evts[key]); } } else { Y.each(evts, function(v, k) { results.push(v); }); } return (results.length) ? results : null; }, /** * Removes all listeners registered by pe.event. Called * automatically during the unload event. * @method _unload * @static * @private */ _unload: function(e) { Y.each(_wrappers, function(v, k) { v.detachAll(); remove(v.el, v.type, v.fn, v.capture); delete _wrappers[k]; delete _el_events[v.domkey][k]; }); }, /** * Adds a DOM event directly without the caching, cleanup, context adj, etc * * @method nativeAdd * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeAdd: add, /** * Basic remove listener * * @method nativeRemove * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeRemove: remove }; }(); Y.Event = Event; if (config.injected || YUI.Env.windowLoaded) { onLoad(); } else { add(win, "load", onLoad); } // Process onAvailable/onContentReady items when when the DOM is ready in IE if (Y.UA.ie) { Y.on(EVENT_READY, Event._poll, Event, true); } Y.on("unload", onUnload); Event.Custom = Y.CustomEvent; Event.Subscriber = Y.Subscriber; Event.Target = Y.EventTarget; Event.Handle = Y.EventHandle; Event.Facade = Y.EventFacade; Event._poll(); })(); /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * Executes the callback as soon as the specified element * is detected in the DOM. * @event available * @param type {string} 'available' * @param fn {function} the callback function to execute. * @param el {string|HTMLElement|collection} the element(s) to attach * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.available = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : []; return Y.Event.onAvailable.call(Y.Event, id, fn, o, a); } }; /** * Executes the callback as soon as the specified element * is detected in the DOM with a nextSibling property * (indicating that the element's children are available) * @event contentready * @param type {string} 'contentready' * @param fn {function} the callback function to execute. * @param el {string|HTMLElement|collection} the element(s) to attach * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.contentready = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : []; return Y.Event.onContentReady.call(Y.Event, id, fn, o, a); } }; }, '@VERSION@' ,{requires:['event-custom-base']}); YUI.add('event-delegate', function(Y) { /** * Adds event delegation support to the library. * * @module event * @submodule event-delegate */ var toArray = Y.Array, YLang = Y.Lang, isString = YLang.isString, selectorTest = Y.Selector.test, detachCategories = Y.Env.evt.handles; /** * <p>Sets up event delegation on a container element. The delegated event * will use a supplied selector or filtering function to test if the event * references at least one node that should trigger the subscription * callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {String|node} the element that is the delegation container * @param spec {string|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ function delegate(type, fn, el, filter) { var args = toArray(arguments, 0, true), query = isString(el) ? el : null, typeBits = type.split(/\|/), synth, container, categories, cat, handle; if (typeBits.length > 1) { cat = typeBits.shift(); type = typeBits.shift(); } synth = Y.Node.DOM_EVENTS[type]; if (YLang.isObject(synth) && synth.delegate) { handle = synth.delegate.apply(synth, arguments); } if (!handle) { if (!type || !fn || !el || !filter) { Y.log("delegate requires type, callback, parent, & filter", "warn"); return; } container = (query) ? Y.Selector.query(query, null, true) : el; if (!container && isString(el)) { handle = Y.on('available', function () { Y.mix(handle, Y.delegate.apply(Y, args), true); }, el); } if (!handle && container) { args.splice(2, 2, container); // remove the filter if (isString(filter)) { filter = Y.delegate.compileFilter(filter); } handle = Y.on.apply(Y, args); handle.sub.filter = filter; handle.sub._notify = delegate.notifySub; } } if (handle && cat) { categories = detachCategories[cat] || (detachCategories[cat] = {}); categories = categories[type] || (categories[type] = []); categories.push(handle); } return handle; } /** * Overrides the <code>_notify</code> method on the normal DOM subscription to inject the filtering logic and only proceed in the case of a match. * * @method delegate.notifySub * @param thisObj {Object} default 'this' object for the callback * @param args {Array} arguments passed to the event's <code>fire()</code> * @param ce {CustomEvent} the custom event managing the DOM subscriptions for * the subscribed event on the subscribing node. * @return {Boolean} false if the event was stopped * @private * @static * @since 3.2.0 */ delegate.notifySub = function (thisObj, args, ce) { // Preserve args for other subscribers args = args.slice(); if (this.args) { args.push.apply(args, this.args); } // Only notify subs if the event occurred on a targeted element var e = args[0], currentTarget = delegate._applyFilter(this.filter, args), container = e.currentTarget, i, ret, target; if (currentTarget) { // Support multiple matches up the the container subtree currentTarget = toArray(currentTarget); for (i = currentTarget.length - 1; i >= 0; --i) { target = currentTarget[i]; // New facade to avoid corrupting facade sent to direct subs args[0] = new Y.DOMEventFacade(e, target, ce); args[0].container = container; thisObj = this.context || target; ret = this.fn.apply(thisObj, args); if (ret === false) { // stop further notifications break; } } return ret; } }; /** * <p>Compiles a selector string into a filter function to identify whether * Nodes along the parent axis of an event's target should trigger event * notification.</p> * * <p>This function is memoized, so previously compiled filter functions are * returned if the same selector string is provided.</p> * * <p>This function may be useful when defining synthetic events for delegate * handling.</p> * * @method delegate.compileFilter * @param selector {String} the selector string to base the filtration on * @return {Function} * @since 3.2.0 * @static */ delegate.compileFilter = Y.cached(function (selector) { return function (target, e) { return selectorTest(target._node, selector, e.currentTarget._node); }; }); /** * Walks up the parent axis of an event's target, and tests each element * against a supplied filter function. If any Nodes satisfy the filter, the * delegated callback will be triggered for each. * * @method delegate._applyFilter * @param filter {Function} boolean function to test for inclusion in event * notification * @param args {Array} the arguments that would be passed to subscribers * @return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter * @protected */ delegate._applyFilter = function (filter, args) { var e = args[0], container = e.currentTarget, target = e.target, match = []; // passing target as the first arg rather than leaving well enough alone // making 'this' in the filter function refer to the target. This is to // support bound filter functions. args.unshift(target); while (target && target !== container) { // filter(target, e, extra args...) - this === target if (filter.apply(target, args)) { match.push(target); } args[0] = target = target.get('parentNode'); } if (match.length <= 1) { match = match[0]; // single match or undefined } // remove the target args.shift(); return match; }; /** * Sets up event delegation on a container element. The delegated event * will use a supplied filter to test if the callback should be executed. * This filter can be either a selector string or a function that returns * a Node to use as the currentTarget for the event. * * The event object for the delegated event is supplied to the callback * function. It is modified slightly in order to support all properties * that may be needed for event delegation. 'currentTarget' is set to * the element that matched the selector string filter or the Node returned * from the filter function. 'container' is set to the element that the * listener is delegated from (this normally would be the 'currentTarget'). * * Filter functions will be called with the arguments that would be passed to * the callback function, including the event object as the first parameter. * The function should return false (or a falsey value) if the success criteria * aren't met, and the Node to use as the event's currentTarget and 'this' * object if they are. * * @method delegate * @param type {string} the event type to delegate * @param fn {function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {string|node} the element that is the delegation container * @param filter {string|function} a selector that must match the target of the * event or a function that returns a Node or false. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.delegate = Y.Event.delegate = delegate; }, '@VERSION@' ,{requires:['node-base']}); YUI.add('event-synthetic', function(Y) { /** * Define new DOM events that can be subscribed to from Nodes. * * @module event * @submodule event-synthetic */ var DOMMap = Y.Env.evt.dom_map, toArray = Y.Array, YLang = Y.Lang, isObject = YLang.isObject, isString = YLang.isString, query = Y.Selector.query, noop = function () {}; /** * <p>The triggering mechanism used by SyntheticEvents.</p> * * <p>Implementers should not instantiate these directly. Use the Notifier * provided to the event's implemented <code>on(node, sub, notifier)</code> or * <code>delegate(node, sub, notifier, filter)</code> methods.</p> * * @class SyntheticEvent.Notifier * @constructor * @param handle {EventHandle} the detach handle for the subscription to an * internal custom event used to execute the callback passed to * on(..) or delegate(..) * @param emitFacade {Boolean} take steps to ensure the first arg received by * the subscription callback is an event facade * @private * @since 3.2.0 */ function Notifier(handle, emitFacade) { this.handle = handle; this.emitFacade = emitFacade; } /** * <p>Executes the subscription callback, passing the firing arguments as the * first parameters to that callback. For events that are configured with * emitFacade=true, it is common practice to pass the triggering DOMEventFacade * as the first parameter. Barring a proper DOMEventFacade or EventFacade * (from a CustomEvent), a new EventFacade will be generated. In that case, if * fire() is called with a simple object, it will be mixed into the facade. * Otherwise, the facade will be prepended to the callback parameters.</p> * * <p>For notifiers provided to delegate logic, the first argument should be an * object with a &quot;currentTarget&quot; property to identify what object to * default as 'this' in the callback. Typically this is gleaned from the * DOMEventFacade or EventFacade, but if configured with emitFacade=false, an * object must be provided. In that case, the object will be removed from the * callback parameters.</p> * * <p>Additional arguments passed during event subscription will be * automatically added after those passed to fire().</p> * * @method fire * @param e {EventFacade|DOMEventFacade|Object|any} (see description) * @param arg* {any} additional arguments received by all subscriptions * @private */ Notifier.prototype.fire = function (e) { // first arg to delegate notifier should be an object with currentTarget var args = toArray(arguments, 0, true), handle = this.handle, ce = handle.evt, sub = handle.sub, thisObj = sub.context, delegate = sub.filter, event = e || {}; if (this.emitFacade) { if (!e || !e.preventDefault) { event = ce._getFacade(); if (isObject(e) && !e.preventDefault) { Y.mix(event, e, true); args[0] = event; } else { args.unshift(event); } } event.type = ce.type; event.details = args.slice(); if (delegate) { event.container = ce.host; } } else if (delegate && isObject(e) && e.currentTarget) { args.shift(); } sub.context = thisObj || event.currentTarget || ce.host; ce.fire.apply(ce, args); sub.context = thisObj; // reset for future firing }; /** * <p>Wrapper class for the integration of new events into the YUI event * infrastructure. Don't instantiate this object directly, use * <code>Y.Event.define(type, config)</code>. See that method for details.</p> * * <p>Properties that MAY or SHOULD be specified in the configuration are noted * below and in the description of <code>Y.Event.define</code>.</p> * * @class SyntheticEvent * @constructor * @param cfg {Object} Implementation pieces and configuration * @since 3.1.0 * @in event-synthetic */ function SyntheticEvent() { this._init.apply(this, arguments); } Y.mix(SyntheticEvent, { Notifier: Notifier, /** * Returns the array of subscription handles for a node for the given event * type. Passing true as the third argument will create a registry entry * in the event system's DOM map to host the array if one doesn't yet exist. * * @method getRegistry * @param node {Node} the node * @param type {String} the event * @param create {Boolean} create a registration entry to host a new array * if one doesn't exist. * @return {Array} * @static * @protected * @since 3.2.0 */ getRegistry: function (node, type, create) { var el = node._node, yuid = Y.stamp(el), key = 'event:' + yuid + type + '_synth', events = DOMMap[yuid] || (DOMMap[yuid] = {}); if (!events[key] && create) { events[key] = { type : '_synth', fn : noop, capture : false, el : el, key : key, domkey : yuid, notifiers : [], detachAll : function () { var notifiers = this.notifiers, i = notifiers.length; while (--i >= 0) { notifiers[i].detach(); } } }; } return (events[key]) ? events[key].notifiers : null; }, /** * Alternate <code>_delete()</code> method for the CustomEvent object * created to manage SyntheticEvent subscriptions. * * @method _deleteSub * @param sub {Subscription} the subscription to clean up * @private * @since 3.2.0 */ _deleteSub: function (sub) { if (sub && sub.fn) { var synth = this.eventDef, method = (sub.filter) ? 'detachDelegate' : 'detach'; this.subscribers = {}; this.subCount = 0; synth[method](sub.node, sub, this.notifier, sub.filter); synth._unregisterSub(sub); delete sub.fn; delete sub.node; delete sub.context; } }, prototype: { constructor: SyntheticEvent, /** * Construction logic for the event. * * @method _init * @protected */ _init: function () { var config = this.publishConfig || (this.publishConfig = {}); // The notification mechanism handles facade creation this.emitFacade = ('emitFacade' in config) ? config.emitFacade : true; config.emitFacade = false; }, /** * <p>Implementers MAY provide this method definition.</p> * * <p>Implement this function if the event supports a different * subscription signature. This function is used by both * <code>on()</code> and <code>delegate()</code>. The second parameter * indicates that the event is being subscribed via * <code>delegate()</code>.</p> * * <p>Implementations must remove extra arguments from the args list * before returning. The required args for <code>on()</code> * subscriptions are</p> * <pre><code>[type, callback, target, context, argN...]</code></pre> * * <p>The required args for <code>delegate()</code> * subscriptions are</p> * * <pre><code>[type, callback, target, filter, context, argN...]</code></pre> * * <p>The return value from this function will be stored on the * subscription in the '_extra' property for reference elsewhere.</p> * * @method processArgs * @param args {Array} parmeters passed to Y.on(..) or Y.delegate(..) * @param delegate {Boolean} true if the subscription is from Y.delegate * @return {any} */ processArgs: noop, /** * <p>Implementers MAY override this property.</p> * * <p>Whether to prevent multiple subscriptions to this event that are * classified as being the same. By default, this means the subscribed * callback is the same function. See the <code>subMatch</code> * method. Setting this to true will impact performance for high volume * events.</p> * * @property preventDups * @type {Boolean} * @default false */ //preventDups : false, /** * <p>Implementers SHOULD provide this method definition.</p> * * Implementation logic for subscriptions done via <code>node.on(type, * fn)</code> or <code>Y.on(type, fn, target)</code>. This * function should set up the monitor(s) that will eventually fire the * event. Typically this involves subscribing to at least one DOM * event. It is recommended to store detach handles from any DOM * subscriptions to make for easy cleanup in the <code>detach</code> * method. Typically these handles are added to the <code>sub</code> * object. Also for SyntheticEvents that leverage a single DOM * subscription under the hood, it is recommended to pass the DOM event * object to <code>notifier.fire(e)</code>. (The event name on the * object will be updated). * * @method on * @param node {Node} the node the subscription is being applied to * @param sub {Subscription} the object to track this subscription * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to * trigger the execution of the subscribers */ on: noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for detaching subscriptions done via * <code>node.on(type, fn)</code>. This function should clean up any * subscriptions made in the <code>on()</code> phase.</p> * * @method detach * @param node {Node} the node the subscription was applied to * @param sub {Subscription} the object tracking this subscription * @param notifier {SyntheticEvent.Notifier} the Notifier used to * trigger the execution of the subscribers */ detach: noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for subscriptions done via * <code>node.delegate(type, fn, filter)</code> or * <code>Y.delegate(type, fn, container, filter)</code>. Like with * <code>on()</code> above, this function should monitor the environment * for the event being fired, and trigger subscription execution by * calling <code>notifier.fire(e)</code>.</p> * * <p>This function receives a fourth argument, which is the filter * used to identify which Node's are of interest to the subscription. * The filter will be either a boolean function that accepts a target * Node for each hierarchy level as the event bubbles, or a selector * string. To translate selector strings into filter functions, use * <code>Y.delegate.compileFilter(filter)</code>.</p> * * @method delegate * @param node {Node} the node the subscription is being applied to * @param sub {Subscription} the object to track this subscription * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to * trigger the execution of the subscribers * @param filter {String|Function} Selector string or function that * accepts an event object and returns null, a Node, or an * array of Nodes matching the criteria for processing. * @since 3.2.0 */ delegate : noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for detaching subscriptions done via * <code>node.delegate(type, fn, filter)</code> or * <code>Y.delegate(type, fn, container, filter)</code>. This function * should clean up any subscriptions made in the * <code>delegate()</code> phase.</p> * * @method detachDelegate * @param node {Node} the node the subscription was applied to * @param sub {Subscription} the object tracking this subscription * @param notifier {SyntheticEvent.Notifier} the Notifier used to * trigger the execution of the subscribers * @param filter {String|Function} Selector string or function that * accepts an event object and returns null, a Node, or an * array of Nodes matching the criteria for processing. * @since 3.2.0 */ detachDelegate : noop, /** * Sets up the boilerplate for detaching the event and facilitating the * execution of subscriber callbacks. * * @method _on * @param args {Array} array of arguments passed to * <code>Y.on(...)</code> or <code>Y.delegate(...)</code> * @param delegate {Boolean} true if called from * <code>Y.delegate(...)</code> * @return {EventHandle} the detach handle for this subscription * @private * since 3.2.0 */ _on: function (args, delegate) { var handles = [], selector = args[2], method = delegate ? 'delegate' : 'on', nodes, handle; // Can't just use Y.all because it doesn't support window (yet?) nodes = (isString(selector)) ? query(selector) : toArray(selector); if (!nodes.length && isString(selector)) { handle = Y.on('available', function () { Y.mix(handle, Y[method].apply(Y, args), true); }, selector); return handle; } Y.each(nodes, function (node) { var subArgs = args.slice(), extra, filter; node = Y.one(node); if (node) { extra = this.processArgs(subArgs, delegate); if (delegate) { filter = subArgs.splice(3, 1)[0]; } // (type, fn, el, thisObj, ...) => (fn, thisObj, ...) subArgs.splice(0, 4, subArgs[1], subArgs[3]); if (!this.preventDups || !this.getSubs(node, args,null,true)) { handle = this._getNotifier(node, subArgs, extra,filter); this[method](node, handle.sub, handle.notifier, filter); handles.push(handle); } } }, this); return (handles.length === 1) ? handles[0] : new Y.EventHandle(handles); }, /** * Creates a new Notifier object for use by this event's * <code>on(...)</code> or <code>delegate(...)</code> implementation. * * @method _getNotifier * @param node {Node} the Node hosting the event * @param args {Array} the subscription arguments passed to either * <code>Y.on(...)</code> or <code>Y.delegate(...)</code> * after running through <code>processArgs(args)</code> to * normalize the argument signature * @param extra {any} Extra data parsed from * <code>processArgs(args)</code> * @param filter {String|Function} the selector string or function * filter passed to <code>Y.delegate(...)</code> (not * present when called from <code>Y.on(...)</code>) * @return {SyntheticEvent.Notifier} * @private * @since 3.2.0 */ _getNotifier: function (node, args, extra, filter) { var dispatcher = new Y.CustomEvent(this.type, this.publishConfig), handle = dispatcher.on.apply(dispatcher, args), notifier = new Notifier(handle, this.emitFacade), registry = SyntheticEvent.getRegistry(node, this.type, true), sub = handle.sub; handle.notifier = notifier; sub.node = node; sub.filter = filter; sub._extra = extra; Y.mix(dispatcher, { eventDef : this, notifier : notifier, host : node, // I forget what this is for currentTarget: node, // for generating facades target : node, // for generating facades el : node._node, // For category detach _delete : SyntheticEvent._deleteSub }, true); registry.push(handle); return handle; }, /** * Removes the subscription from the Notifier registry. * * @method _unregisterSub * @param sub {Subscription} the subscription * @private * @since 3.2.0 */ _unregisterSub: function (sub) { var notifiers = SyntheticEvent.getRegistry(sub.node, this.type), i; if (notifiers) { for (i = notifiers.length - 1; i >= 0; --i) { if (notifiers[i].sub === sub) { notifiers.splice(i, 1); break; } } } }, /** * Removes the subscription(s) from the internal subscription dispatch * mechanism. See <code>SyntheticEvent._deleteSub</code>. * * @method _detach * @param args {Array} The arguments passed to * <code>node.detach(...)</code> * @private * @since 3.2.0 */ _detach: function (args) { // Can't use Y.all because it doesn't support window (yet?) // TODO: Does Y.all support window now? var target = args[2], els = (isString(target)) ? query(target) : toArray(target), node, i, len, handles, j; // (type, fn, el, context, filter?) => (type, fn, context, filter?) args.splice(2, 1); for (i = 0, len = els.length; i < len; ++i) { node = Y.one(els[i]); if (node) { handles = this.getSubs(node, args); if (handles) { for (j = handles.length - 1; j >= 0; --j) { handles[j].detach(); } } } } }, /** * Returns the detach handles of subscriptions on a node that satisfy a * search/filter function. By default, the filter used is the * <code>subMatch</code> method. * * @method getSubs * @param node {Node} the node hosting the event * @param args {Array} the array of original subscription args passed * to <code>Y.on(...)</code> (before * <code>processArgs</code> * @param filter {Function} function used to identify a subscription * for inclusion in the returned array * @param first {Boolean} stop after the first match (used to check for * duplicate subscriptions) * @return {Array} detach handles for the matching subscriptions */ getSubs: function (node, args, filter, first) { var notifiers = SyntheticEvent.getRegistry(node, this.type), handles = [], i, len, handle; if (notifiers) { if (!filter) { filter = this.subMatch; } for (i = 0, len = notifiers.length; i < len; ++i) { handle = notifiers[i]; if (filter.call(this, handle.sub, args)) { if (first) { return handle; } else { handles.push(notifiers[i]); } } } } return handles.length && handles; }, /** * <p>Implementers MAY override this to define what constitutes a * &quot;same&quot; subscription. Override implementations should * consider the lack of a comparator as a match, so calling * <code>getSubs()</code> with no arguments will return all subs.</p> * * <p>Compares a set of subscription arguments against a Subscription * object to determine if they match. The default implementation * compares the callback function against the second argument passed to * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p> * * @method subMatch * @param sub {Subscription} the existing subscription * @param args {Array} the calling arguments passed to * <code>Y.on(...)</code> etc. * @return {Boolean} true if the sub can be described by the args * present * @since 3.2.0 */ subMatch: function (sub, args) { // Default detach cares only about the callback matching return !args[1] || sub.fn === args[1]; } } }, true); Y.SyntheticEvent = SyntheticEvent; /** * <p>Defines a new event in the DOM event system. Implementers are * responsible for monitoring for a scenario whereby the event is fired. A * notifier object is provided to the functions identified below. When the * criteria defining the event are met, call notifier.fire( [args] ); to * execute event subscribers.</p> * * <p>The first parameter is the name of the event. The second parameter is a * configuration object which define the behavior of the event system when the * new event is subscribed to or detached from. The methods that should be * defined in this configuration object are <code>on</code>, * <code>detach</code>, <code>delegate</code>, and <code>detachDelegate</code>. * You are free to define any other methods or properties needed to define your * event. Be aware, however, that since the object is used to subclass * SyntheticEvent, you should avoid method names used by SyntheticEvent unless * your intention is to override the default behavior.</p> * * <p>This is a list of properties and methods that you can or should specify * in the configuration object:</p> * * <dl> * <dt><code>on</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for subscription. Any special setup you need to * do to create the environment for the event being fired--E.g. native * DOM event subscriptions. Store subscription related objects and * state on the <code>subscription</code> object. When the * criteria have been met to fire the synthetic event, call * <code>notifier.fire(e)</code>. See Notifier's <code>fire()</code> * method for details about what to pass as parameters.</dd> * * <dt><code>detach</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for cleaning up a detached subscription. E.g. * detach any DOM subscriptions added in <code>on</code>.</dd> * * <dt><code>delegate</code></dt> * <dd><code>function (node, subscription, notifier, filter)</code> The * implementation logic for subscription via <code>Y.delegate</code> or * <code>node.delegate</code>. The filter is typically either a selector * string or a function. You can use * <code>Y.delegate.compileFilter(selectorString)</code> to create a * filter function from a selector string if needed. The filter function * expects an event object as input and should output either null, a * matching Node, or an array of matching Nodes. Otherwise, this acts * like <code>on</code> DOM event subscriptions. Store subscription * related objects and information on the <code>subscription</code> * object. When the criteria have been met to fire the synthetic event, * call <code>notifier.fire(e)</code> as noted above.</dd> * * <dt><code>detachDelegate</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for cleaning up a detached delegate subscription. * E.g. detach any DOM delegate subscriptions added in * <code>delegate</code>.</dd> * * <dt><code>publishConfig</code></dt> * <dd>(Object) The configuration object that will be used to instantiate * the underlying CustomEvent. See Notifier's <code>fire</code> method * for details.</dd> * * <dt><code>processArgs</code></dt * <dd> * <p><code>function (argArray, fromDelegate)</code> Optional method * to extract any additional arguments from the subscription * signature. Using this allows <code>on</code> or * <code>delegate</code> signatures like * <code>node.on(&quot;hover&quot;, overCallback, * outCallback)</code>.</p> * <p>When processing an atypical argument signature, make sure the * args array is returned to the normal signature before returning * from the function. For example, in the &quot;hover&quot; example * above, the <code>outCallback</code> needs to be <code>splice</code>d * out of the array. The expected signature of the args array for * <code>on()</code> subscriptions is:</p> * <pre> * <code>[type, callback, target, contextOverride, argN...]</code> * </pre> * <p>And for <code>delegate()</code>:</p> * <pre> * <code>[type, callback, target, filter, contextOverride, argN...]</code> * </pre> * <p>where <code>target</code> is the node the event is being * subscribed for. You can see these signatures documented for * <code>Y.on()</code> and <code>Y.delegate()</code> respectively.</p> * <p>Whatever gets returned from the function will be stored on the * <code>subscription</code> object under * <code>subscription._extra</code>.</p></dd> * <dt><code>subMatch</code></dt> * <dd> * <p><code>function (sub, args)</code> Compares a set of * subscription arguments against a Subscription object to determine * if they match. The default implementation compares the callback * function against the second argument passed to * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p> * </dd> * </dl> * * @method Event.define * @param type {String} the name of the event * @param config {Object} the prototype definition for the new event (see above) * @param force {Boolean} override an existing event (use with caution) * @static * @return {SyntheticEvent} the subclass implementation instance created to * handle event subscriptions of this type * @for Event * @since 3.1.0 * @in event-synthetic */ Y.Event.define = function (type, config, force) { if (!config) { config = {}; } var eventDef = (isObject(type)) ? type : Y.merge({ type: type }, config), Impl, synth; if (force || !Y.Node.DOM_EVENTS[eventDef.type]) { Impl = function () { SyntheticEvent.apply(this, arguments); }; Y.extend(Impl, SyntheticEvent, eventDef); synth = new Impl(); type = synth.type; Y.Node.DOM_EVENTS[type] = Y.Env.evt.plugins[type] = { eventDef: synth, on: function () { return synth._on(toArray(arguments)); }, delegate: function () { return synth._on(toArray(arguments), true); }, detach: function () { return synth._detach(toArray(arguments)); } }; } return synth; }; }, '@VERSION@' ,{requires:['node-base', 'event-custom']}); YUI.add('event-mousewheel', function(Y) { /** * Adds mousewheel event support * @module event * @submodule event-mousewheel */ var DOM_MOUSE_SCROLL = 'DOMMouseScroll', fixArgs = function(args) { var a = Y.Array(args, 0, true), target; if (Y.UA.gecko) { a[0] = DOM_MOUSE_SCROLL; target = Y.config.win; } else { target = Y.config.doc; } if (a.length < 3) { a[2] = target; } else { a.splice(2, 0, target); } return a; }; /** * Mousewheel event. This listener is automatically attached to the * correct target, so one should not be supplied. Mouse wheel * direction and velocity is stored in the 'mouseDelta' field. * @event mousewheel * @param type {string} 'mousewheel' * @param fn {function} the callback to execute * @param context optional context object * @param args 0..n additional arguments to provide to the listener. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.mousewheel = { on: function() { return Y.Event._attach(fixArgs(arguments)); }, detach: function() { return Y.Event.detach.apply(Y.Event, fixArgs(arguments)); } }; }, '@VERSION@' ,{requires:['node-base']}); YUI.add('event-mouseenter', function(Y) { /** * <p>Adds subscription and delegation support for mouseenter and mouseleave * events. Unlike mouseover and mouseout, these events aren't fired from child * elements of a subscribed node.</p> * * <p>This avoids receiving three mouseover notifications from a setup like</p> * * <pre><code>div#container > p > a[href]</code></pre> * * <p>where</p> * * <pre><code>Y.one('#container').on('mouseover', callback)</code></pre> * * <p>When the mouse moves over the link, one mouseover event is fired from * #container, then when the mouse moves over the p, another mouseover event is * fired and bubbles to #container, causing a second notification, and finally * when the mouse moves over the link, a third mouseover event is fired and * bubbles to #container for a third notification.</p> * * <p>By contrast, using mouseenter instead of mouseover, the callback would be * executed only once when the mouse moves over #container.</p> * * @module event * @submodule event-mouseenter */ function notify(e, notifier) { var current = e.currentTarget, related = e.relatedTarget; if (current !== related && !current.contains(related)) { notifier.fire(e); } } var config = { proxyType: "mouseover", on: function (node, sub, notifier) { sub.onHandle = node.on(this.proxyType, notify, null, notifier); }, detach: function (node, sub) { sub.onHandle.detach(); }, delegate: function (node, sub, notifier, filter) { sub.delegateHandle = Y.delegate(this.proxyType, notify, node, filter, null, notifier); }, detachDelegate: function (node, sub) { sub.delegateHandle.detach(); } }; Y.Event.define("mouseenter", config, true); Y.Event.define("mouseleave", Y.merge(config, { proxyType: "mouseout" }), true); }, '@VERSION@' ,{requires:['event-synthetic']}); YUI.add('event-key', function(Y) { /** * Functionality to listen for one or more specific key combinations. * @module event * @submodule event-key */ /** * Add a key listener. The listener will only be notified if the * keystroke detected meets the supplied specification. The * spec consists of the key event type, followed by a colon, * followed by zero or more comma separated key codes, followed * by zero or more modifiers delimited by a plus sign. Ex: * press:12,65+shift+ctrl * @event key * @for YUI * @param type {string} 'key' * @param fn {function} the function to execute * @param id {string|HTMLElement|collection} the element(s) to bind * @param spec {string} the keyCode and modifier specification * @param o optional context object * @param args 0..n additional arguments to provide to the listener. * @return {Event.Handle} the detach handle */ Y.Env.evt.plugins.key = { on: function(type, fn, id, spec, o) { var a = Y.Array(arguments, 0, true), parsed, etype, criteria, ename; parsed = spec && spec.split(':'); if (!spec || spec.indexOf(':') == -1 || !parsed[1]) { Y.log('Illegal key spec, creating a regular keypress listener instead.', 'info', 'event'); a[0] = 'key' + ((parsed && parsed[0]) || 'press'); return Y.on.apply(Y, a); } // key event type: 'down', 'up', or 'press' etype = parsed[0]; // list of key codes optionally followed by modifiers criteria = (parsed[1]) ? parsed[1].split(/,|\+/) : null; // the name of the custom event that will be created for the spec ename = (Y.Lang.isString(id) ? id : Y.stamp(id)) + spec; ename = ename.replace(/,/g, '_'); if (!Y.getEvent(ename)) { // subscribe spec validator to the DOM event Y.on(type + etype, function(e) { // Y.log('keylistener: ' + e.keyCode); var passed = false, failed = false, i, crit, critInt; for (i=0; i<criteria.length; i=i+1) { crit = criteria[i]; critInt = parseInt(crit, 10); // pass this section if any supplied keyCode // is found if (Y.Lang.isNumber(critInt)) { if (e.charCode === critInt) { // Y.log('passed: ' + crit); passed = true; } else { failed = true; // Y.log('failed: ' + crit); } // only check modifier if no keyCode was specified // or the keyCode check was successful. pass only // if every modifier passes } else if (passed || !failed) { passed = (e[crit + 'Key']); failed = !passed; // Y.log(crit + ": " + passed); } } // fire spec custom event if spec if met if (passed) { Y.fire(ename, e); } }, id); } // subscribe supplied listener to custom event for spec validator // remove element and spec. a.splice(2, 2); a[0] = ename; return Y.on.apply(Y, a); } }; }, '@VERSION@' ,{requires:['node-base']}); YUI.add('event-focus', function(Y) { /** * Adds bubbling and delegation support to DOM events focus and blur. * * @module event * @submodule event-focus */ var Event = Y.Event, YLang = Y.Lang, isString = YLang.isString, useActivate = YLang.isFunction( Y.DOM.create('<p onbeforeactivate=";">').onbeforeactivate); function define(type, proxy, directEvent) { var nodeDataKey = '_' + type + 'Notifiers'; Y.Event.define(type, { _attach: function (el, notifier, delegate) { if (Y.DOM.isWindow(el)) { return Event._attach([type, function (e) { notifier.fire(e); }, el]); } else { return Event._attach( [proxy, this._proxy, el, this, notifier, delegate], { capture: true }); } }, _proxy: function (e, notifier, delegate) { var node = e.target, notifiers = node.getData(nodeDataKey), yuid = Y.stamp(e.currentTarget._node), defer = (useActivate || e.target !== e.currentTarget), sub = notifier.handle.sub, filterArgs = [node, e].concat(sub.args || []), directSub; notifier.currentTarget = (delegate) ? node : e.currentTarget; notifier.container = (delegate) ? e.currentTarget : null; if (!sub.filter || sub.filter.apply(node, filterArgs)) { // Maintain a list to handle subscriptions from nested // containers div#a>div#b>input #a.on(focus..) #b.on(focus..), // use one focus or blur subscription that fires notifiers from // #b then #a to emulate bubble sequence. if (!notifiers) { notifiers = {}; node.setData(nodeDataKey, notifiers); // only subscribe to the element's focus if the target is // not the current target ( if (defer) { directSub = Event._attach( [directEvent, this._notify, node._node]).sub; directSub.once = true; } } if (!notifiers[yuid]) { notifiers[yuid] = []; } notifiers[yuid].push(notifier); if (!defer) { this._notify(e); } } }, _notify: function (e, container) { var node = e.currentTarget, notifiers = node.getData(nodeDataKey), // document.get('ownerDocument') returns null doc = node.get('ownerDocument') || node, target = node, nots = [], notifier, i, len; if (notifiers) { // Walk up the parent axis until the origin node, while (target && target !== doc) { nots.push.apply(nots, notifiers[Y.stamp(target)] || []); target = target.get('parentNode'); } nots.push.apply(nots, notifiers[Y.stamp(doc)] || []); for (i = 0, len = nots.length; i < len; ++i) { notifier = nots[i]; e.currentTarget = nots[i].currentTarget; if (notifier.container) { e.container = notifier.container; } else { delete e.container; } notifier.fire(e); } // clear the notifications list (mainly for delegation) node.clearData(nodeDataKey); } }, on: function (node, sub, notifier) { sub.onHandle = this._attach(node._node, notifier); }, detach: function (node, sub) { sub.onHandle.detach(); }, delegate: function (node, sub, notifier, filter) { if (isString(filter)) { sub.filter = Y.delegate.compileFilter(filter); } sub.delegateHandle = this._attach(node._node, notifier, true); }, detachDelegate: function (node, sub) { sub.delegateHandle.detach(); } }, true); } // For IE, we need to defer to focusin rather than focus because // `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate, // el.onfocusin, doSomething, then el.onfocus. All others support capture // phase focus, which executes before doSomething. To guarantee consistent // behavior for this use case, IE's direct subscriptions are made against // focusin so subscribers will be notified before js following el.focus() is // executed. if (useActivate) { // name capture phase direct subscription define("focus", "beforeactivate", "focusin"); define("blur", "beforedeactivate", "focusout"); } else { define("focus", "focus", "focus"); define("blur", "blur", "blur"); } }, '@VERSION@' ,{requires:['event-synthetic']}); YUI.add('event-resize', function(Y) { /** * Adds a window resize event that has its behavior normalized to fire at the * end of the resize rather than constantly during the resize. * @module event * @submodule event-resize */ (function() { var detachHandle, timerHandle, CE_NAME = 'window:resize', handler = function(e) { if (Y.UA.gecko) { Y.fire(CE_NAME, e); } else { if (timerHandle) { timerHandle.cancel(); } timerHandle = Y.later(Y.config.windowResizeDelay || 40, Y, function() { Y.fire(CE_NAME, e); }); } }; /** * Firefox fires the window resize event once when the resize action * finishes, other browsers fire the event periodically during the * resize. This code uses timeout logic to simulate the Firefox * behavior in other browsers. * @event windowresize * @for YUI */ Y.Env.evt.plugins.windowresize = { on: function(type, fn) { // check for single window listener and add if needed if (!detachHandle) { detachHandle = Y.Event._attach(['resize', handler]); } var a = Y.Array(arguments, 0, true); a[0] = CE_NAME; return Y.on.apply(Y, a); } }; })(); }, '@VERSION@' ,{requires:['node-base']}); YUI.add('event', function(Y){}, '@VERSION@' ,{use:['event-base', 'event-delegate', 'event-synthetic', 'event-mousewheel', 'event-mouseenter', 'event-key', 'event-focus', 'event-resize']});
examples/dynamic-segments/app.js
natorojr/react-router
import React from 'react'; import { Router, Route, Link, Redirect } from 'react-router'; var App = React.createClass({ render() { return ( <div> <ul> <li><Link to="/user/123">Bob</Link></li> <li><Link to="/user/abc">Sally</Link></li> </ul> {this.props.children} </div> ); } }); var User = React.createClass({ render() { var { userID } = this.props.params; return ( <div className="User"> <h1>User id: {userID}</h1> <ul> <li><Link to={`/user/${userID}/tasks/foo`}>foo task</Link></li> <li><Link to={`/user/${userID}/tasks/bar`}>bar task</Link></li> </ul> {this.props.children} </div> ); } }); var Task = React.createClass({ render() { var { userID, taskID } = this.props.params; return ( <div className="Task"> <h2>User ID: {userID}</h2> <h3>Task ID: {taskID}</h3> </div> ); } }); React.render(( <Router> <Route path="/" component={App}> <Route path="user/:userID" component={User}> <Route path="tasks/:taskID" component={Task} /> <Redirect from="todos/:taskID" to="/user/:userID/tasks/:taskID" /> </Route> </Route> </Router> ), document.getElementById('example'));
src/views/TabView/index.ios.js
r1cebank/EventCore
import React from 'react'; import { TabBarIOS, Navigator, StatusBar } from 'react-native'; import { Assets, Views, Colors, Icons, Defaults, Actions } from '../../global/globalIncludes'; import { connect } from 'react-redux'; class TabView extends React.Component { static propTypes = { navigation: React.PropTypes.object, tab: React.PropTypes.string, onTabSelect: React.PropTypes.func, navigator: React.PropTypes.instanceOf(Navigator) }; componentDidMount() { StatusBar.setBarStyle('light-content'); } // constructor(props) { // super(props); // } onTabSelect(tab) { if (this.props.tab !== tab) { this.props.onTabSelect(tab); } } render() { let Icon = Icons[this.props.navigation.config.iconsource]; let isLocalIcon = false; // If Icon become undefined, use default if (!Icon) { Icon = Icons.Ionicons; } if (this.props.navigation.config.iconsource === 'Local') { isLocalIcon = true; // If we a using Local icons, overwrite this object to include TabBarIOS Icon = { }; Icon.TabBarItemIOS = TabBarIOS.Item; } const defaultTab = this.props.tab || this.props.navigation.config.defaults.initialPage; return ( <TabBarIOS tintColor={Colors.darkText}> {this.props.navigation.pages.map((navItem, index) => <Icon.TabBarItemIOS selected={defaultTab === navItem.name} title={navItem.title} key={index} onPress={() => { this.onTabSelect(navItem.name); }} icon={isLocalIcon ? Assets[navItem.icon] : undefined} selectedIcon={isLocalIcon ? Assets[navItem.selectedIcon] : undefined} iconName={navItem.icon} selectedIconName={navItem.selectedIcon}> {(() => { let ComponentView = Views[navItem.view]; // If the component is missing, fallback to default with message if (!ComponentView) { const warningText = `View ${navItem.view} not found`; return <Defaults.warningView warningText={warningText} />; } return ( <ComponentView title={navItem.title} navigator={this.props.navigator} /> ); })()} </Icon.TabBarItemIOS> )} </TabBarIOS> ); } } function select(store) { return { navigation: store.data.navigation.data, tab: store.navigation.tab }; } function actions(dispatch) { return { onTabSelect: (tab) => dispatch(Actions.Navigation.switchNavigation(tab)) }; } module.exports = connect(select, actions)(TabView);
src/component/CareerSection/index.js
Goblinlordx/cv-gen
import React from 'react'; import Section from 'component/Section'; import styles from 'styles'; const rangeStyle = { textAlign: 'right', }; const CareerPanel = ({data: {start, end}}) => ( <h3 style={rangeStyle}> {start} - {end} </h3> ); const recordStyle = { paddingLeft: 40, paddingRight: 30, }; const posStyle = { textAlign: 'left', color: styles.color.textSubdued, }; const descStyle = { position: 'relative', left: '-1em', marginRight: '-1em', }; const CareerContent = ( { data: { company = 'Universal Cattery', position = 'Translator', descriptors, }, }, ) => ( <div> <div style={recordStyle}> <h4 style={posStyle}>{company}</h4> {descriptors && descriptors.map((desc, i) => ( <li key={100 + i}><span style={descStyle}>{desc}</span></li> ))} </div> </div> ); const rhStyle = {textAlign: 'left', marginBottom: 0, paddingLeft: 30}; const CareerTitle = () => <h2>Career Experience</h2>; const RecordHeader = ({data: {position}}) => ( <h3 style={rhStyle}>{position}</h3> ); const spacerStyle = { height: 30, }; const CareerSpacer = () => <div style={spacerStyle} />; const CareerSection = ({data}) => { if (!data) return null; const {career} = data; if (career.length === 0) return null; return ( <div> <Section content={CareerTitle} /> {career && career.map((d, i) => ( <div className="SubSection" key={i}> <Section data={d} panel={CareerPanel} content={RecordHeader} /> <Section data={d} content={CareerContent} /> {(i !== career.length - 1 && <CareerSpacer />) || null} </div> ))} <Section.Footer /> </div> ); }; export default CareerSection;
test/integration/basepath/pages/absolute-url.js
flybayer/next.js
import React from 'react' import Link from 'next/link' export default function Page() { return ( <> <Link href="https://vercel.com/"> <a id="absolute-link">https://vercel.com/</a> </Link> <br /> <Link href="mailto:idk@idk.com"> <a id="mailto-link">mailto:idk@idk.com</a> </Link> </> ) }
dotCMS/src/main/webapp/html/js/dojo/custom-build/dojox/widget/FisheyeList.js
dotCMS/core
define("dojox/widget/FisheyeList", ["dojo/_base/declare", "dojo/_base/sniff", "dojo/_base/lang", "dojo/aspect", "dojo/dom", "dojo/dom-attr", "dojo/dom-class", "dojo/dom-geometry", "dojo/dom-style", "dojo/dom-construct", "dojo/on", "dojo/_base/window", "dojo/mouse", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_Container", "./FisheyeListItem"], function(declare, has, lang, aspect, dom, attr, domClass, geometry, style, construct, on, winUtil, mouse, _WidgetBase, _TemplatedMixin, _Container, FisheyeListItem){ return declare("dojox.widget.FisheyeList", [_WidgetBase, _TemplatedMixin, _Container], { // summary: // Menu similar to the fish eye menu on the Mac OS // example: // | <div dojoType="dojo.widget.FisheyeList" // | itemWidth="40" itemHeight="40" // | itemMaxWidth="150" itemMaxHeight="150" // | orientation="horizontal" // | effectUnits="2" // | itemPadding="10" // | attachEdge="center" // | labelEdge="bottom"> // | // | <div dojoType="dojox.widget.FisheyeListItem" // | id="item1" // | onclick="alert('click on' + this.label + '(from widget id ' + this.widgetId + ')!');" // | label="Item 1" // | iconSrc="images/fisheye_1.png"> // | </div> // | ... // | </div> constructor: function(){ // // TODO // fix really long labels in vertical mode // this.pos = {'x': -1, 'y': -1}; // current cursor position, relative to the grid // for conservative trigger mode, when triggered, timerScale is gradually increased from 0 to 1 this.timerScale = 1.0; }, EDGE: { CENTER: 0, LEFT: 1, RIGHT: 2, TOP: 3, BOTTOM: 4 }, templateString: '<div class="dojoxFisheyeListBar" data-dojo-attach-point="containerNode"></div>', snarfChildDomOutput: true, // itemWidth: Integer // width of menu item (in pixels) in it's dormant state (when the mouse is far away) itemWidth: 40, // itemHeight: Integer // height of menu item (in pixels) in it's dormant state (when the mouse is far away) itemHeight: 40, // itemMaxWidth: Integer // width of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it) itemMaxWidth: 150, // itemMaxHeight: Integer // height of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it) itemMaxHeight: 150, imgNode: null, // orientation: String // orientation of the menu, either "horizontal" or "vertical" orientation: 'horizontal', // isFixed: Boolean // toggle to enable additional listener (window scroll) if FisheyeList is in a fixed postion isFixed: false, // conservativeTrigger: Boolean // if true, don't start enlarging menu items until mouse is over an image; // if false, start enlarging menu items as the mouse moves near them. conservativeTrigger: false, // effectUnits: Number // controls how much reaction the menu makes, relative to the distance of the mouse from the menu effectUnits: 2, // itemPadding: Integer // padding (in pixels) between each menu item itemPadding: 10, // attachEdge: String // Controls the border that the menu items don't expand past; // for example, if set to "top", then the menu items will drop downwards as they expand. // Values: "center", "left", "right", "top", "bottom". attachEdge: 'center', // labelEdge: String // Controls were the labels show up in relation to the menu item icons. // Values: "center", "left", "right", "top", "bottom". labelEdge: 'bottom', postCreate: function(){ var e = this.EDGE, isHorizontal = this.isHorizontal = (this.orientation == 'horizontal'); dom.setSelectable(this.domNode, false); this.selectedNode = -1; this.isOver = false; this.hitX1 = -1; this.hitY1 = -1; this.hitX2 = -1; this.hitY2 = -1; // // only some edges make sense... // this.anchorEdge = this._toEdge(this.attachEdge, e.CENTER); this.labelEdge = this._toEdge(this.labelEdge, e.TOP); if(this.labelEdge == e.CENTER){ this.labelEdge = e.TOP; } if(isHorizontal){ if(this.anchorEdge == e.LEFT){ this.anchorEdge = e.CENTER; } if(this.anchorEdge == e.RIGHT){ this.anchorEdge = e.CENTER; } if(this.labelEdge == e.LEFT){ this.labelEdge = e.TOP; } if(this.labelEdge == e.RIGHT){ this.labelEdge = e.TOP; } }else{ if(this.anchorEdge == e.TOP){ this.anchorEdge = e.CENTER; } if(this.anchorEdge == e.BOTTOM){ this.anchorEdge = e.CENTER; } if(this.labelEdge == e.TOP){ this.labelEdge = e.LEFT; } if(this.labelEdge == e.BOTTOM){ this.labelEdge = e.LEFT; } } // // figure out the proximity size // var effectUnits = this.effectUnits; this.proximityLeft = this.itemWidth * (effectUnits - 0.5); this.proximityRight = this.itemWidth * (effectUnits - 0.5); this.proximityTop = this.itemHeight * (effectUnits - 0.5); this.proximityBottom = this.itemHeight * (effectUnits - 0.5); if(this.anchorEdge == e.LEFT){ this.proximityLeft = 0; } if(this.anchorEdge == e.RIGHT){ this.proximityRight = 0; } if(this.anchorEdge == e.TOP){ this.proximityTop = 0; } if(this.anchorEdge == e.BOTTOM){ this.proximityBottom = 0; } if(this.anchorEdge == e.CENTER){ this.proximityLeft /= 2; this.proximityRight /= 2; this.proximityTop /= 2; this.proximityBottom /= 2; } }, startup: function(){ // summary: // create our connections and setup our FisheyeList this.children = this.getChildren(); //original postCreate() --tk this._initializePositioning(); // // in liberal trigger mode, activate menu whenever mouse is close, in conservative mode, pause until needed // this._onMouseMoveHandle = on.pausable(winUtil.doc.documentElement, "mousemove", lang.hitch(this, "_onMouseMove")); if(this.conservativeTrigger){ this._onMouseMoveHandle.pause(); } if(this.isFixed){ this.own(on(winUtil.doc,"scroll", lang.hitch(this, this._onScroll))); } // Deactivate the menu if mouse is moved off screen (doesn't work for FF?) this.own( on(winUtil.doc.documentElement, mouse.leave, lang.hitch(this, "_onBodyOut")), aspect.after(this, "addChild", lang.hitch(this, "_initializePositioning"), true), aspect.after(winUtil.global, "onresize", lang.hitch(this, "_initializePositioning"), true) ); }, _initializePositioning: function(){ this.itemCount = this.children.length; this.barWidth = (this.isHorizontal ? this.itemCount : 1) * this.itemWidth; this.barHeight = (this.isHorizontal ? 1 : this.itemCount) * this.itemHeight; this.totalWidth = this.proximityLeft + this.proximityRight + this.barWidth; this.totalHeight = this.proximityTop + this.proximityBottom + this.barHeight; // // calculate effect ranges for each item // for(var i=0; i<this.children.length; i++){ this.children[i].posX = this.itemWidth * (this.isHorizontal ? i : 0); this.children[i].posY = this.itemHeight * (this.isHorizontal ? 0 : i); this.children[i].cenX = this.children[i].posX + (this.itemWidth / 2); this.children[i].cenY = this.children[i].posY + (this.itemHeight / 2); var isz = this.isHorizontal ? this.itemWidth : this.itemHeight, r = this.effectUnits * isz, c = this.isHorizontal ? this.children[i].cenX : this.children[i].cenY, lhs = this.isHorizontal ? this.proximityLeft : this.proximityTop, rhs = this.isHorizontal ? this.proximityRight : this.proximityBottom, siz = this.isHorizontal ? this.barWidth : this.barHeight, range_lhs = r, range_rhs = r; if(range_lhs > c+lhs){ range_lhs = c+lhs; } if(range_rhs > (siz-c+rhs)){ range_rhs = siz-c+rhs; } this.children[i].effectRangeLeft = range_lhs / isz; this.children[i].effectRangeRght = range_rhs / isz; //dojo.debug('effect range for '+i+' is '+range_lhs+'/'+range_rhs); } // // create the bar // style.set(this.domNode, {width: this.barWidth + 'px', height: this.barHeight + 'px'}); // // position the items // for(i=0; i<this.children.length; i++){ var itm = this.children[i]; var elm = itm.domNode; style.set(elm, {left: itm.posX + 'px', top: itm.posY + 'px', width: this.itemWidth + 'px', height: this.itemHeight + 'px'}); style.set(itm.imgNode, {left: this.itemPadding+'%', top: this.itemPadding+'%', width: (100 - 2 * this.itemPadding) + '%', height: (100 - 2 * this.itemPadding) + '%'}); } // // calc the grid // this._calcHitGrid(); }, _overElement: function(/* DomNode|String */ node, /* Event */ e){ // summary: // Returns whether the mouse is over the passed element. // node: // Must must be display:block (ie, not a `<span>`) node = dom.byId(node); var mouse = {x: e.pageX, y: e.pageY}, absolute = geometry.position(node, true), top = absolute.y, bottom = top + absolute.h, left = absolute.x, right = left + absolute.w; return (mouse.x >= left && mouse.x <= right && mouse.y >= top && mouse.y <= bottom ); // Boolean }, _onBodyOut: function(/*Event*/ e){ // clicking over an object inside of body causes this event to fire; ignore that case if( this._overElement(winUtil.body(), e) ){ return; } this._setDormant(e); }, _setDormant: function(/*Event*/ e){ // summary: // called when mouse moves out of menu's range if(!this.isOver){ return; } // already dormant? this.isOver = false; if(this.conservativeTrigger){ // user can't re-trigger the menu expansion // until he mouses over a icon again this._onMouseMoveHandle.pause(); } this._onGridMouseMove(-1, -1); }, _setActive: function(/*Event*/ e){ // summary: // called when mouse is moved into menu's range if(this.isOver){ return; } // already activated? this.isOver = true; if(this.conservativeTrigger){ // switch event handlers so that we handle mouse events from anywhere near // the menu this._onMouseMoveHandle.resume(); this.timerScale=0.0; // call mouse handler to do some initial necessary calculations/positioning this._onMouseMove(e); // slowly expand the icon size so it isn't jumpy this._expandSlowly(); } }, _onMouseMove: function(/*Event*/ e){ // summary: // called when mouse is moved if( (e.pageX >= this.hitX1) && (e.pageX <= this.hitX2) && (e.pageY >= this.hitY1) && (e.pageY <= this.hitY2) ){ if(!this.isOver){ this._setActive(e); } this._onGridMouseMove(e.pageX-this.hitX1, e.pageY-this.hitY1); }else{ if(this.isOver){ this._setDormant(e); } } }, _onScroll: function(){ this._calcHitGrid(); }, onResized: function(){ this._calcHitGrid(); }, _onGridMouseMove: function(x, y){ // summary: // called when mouse is moved in the vicinity of the menu this.pos = {x:x, y:y}; this._paint(); }, _paint: function(){ var x=this.pos.x; var y=this.pos.y; if(this.itemCount <= 0){ return; } // // figure out our main index // var pos = this.isHorizontal ? x : y, prx = this.isHorizontal ? this.proximityLeft : this.proximityTop, siz = this.isHorizontal ? this.itemWidth : this.itemHeight, sim = this.isHorizontal ? (1.0-this.timerScale)*this.itemWidth + this.timerScale*this.itemMaxWidth : (1.0-this.timerScale)*this.itemHeight + this.timerScale*this.itemMaxHeight, cen = ((pos - prx) / siz) - 0.5, max_off_cen = (sim / siz) - 0.5; if(max_off_cen > this.effectUnits){ max_off_cen = this.effectUnits; } // // figure out our off-axis weighting // var off_weight = 0, cen2; if(this.anchorEdge == this.EDGE.BOTTOM){ cen2 = (y - this.proximityTop) / this.itemHeight; off_weight = (cen2 > 0.5) ? 1 : y / (this.proximityTop + (this.itemHeight / 2)); } if(this.anchorEdge == this.EDGE.TOP){ cen2 = (y - this.proximityTop) / this.itemHeight; off_weight = (cen2 < 0.5) ? 1 : (this.totalHeight - y) / (this.proximityBottom + (this.itemHeight / 2)); } if(this.anchorEdge == this.EDGE.RIGHT){ cen2 = (x - this.proximityLeft) / this.itemWidth; off_weight = (cen2 > 0.5) ? 1 : x / (this.proximityLeft + (this.itemWidth / 2)); } if(this.anchorEdge == this.EDGE.LEFT){ cen2 = (x - this.proximityLeft) / this.itemWidth; off_weight = (cen2 < 0.5) ? 1 : (this.totalWidth - x) / (this.proximityRight + (this.itemWidth / 2)); } if(this.anchorEdge == this.EDGE.CENTER){ if(this.isHorizontal){ off_weight = y / (this.totalHeight); }else{ off_weight = x / (this.totalWidth); } if(off_weight > 0.5){ off_weight = 1 - off_weight; } off_weight *= 2; } // // set the sizes // for(var i=0; i<this.itemCount; i++){ var weight = this._weighAt(cen, i); if(weight < 0){weight = 0;} this._setItemSize(i, weight * off_weight); } // // set the positions // var main_p = Math.round(cen), offset = 0; if(cen < 0){ main_p = 0; }else if(cen > this.itemCount - 1){ main_p = this.itemCount -1; }else{ offset = (cen - main_p) * ((this.isHorizontal ? this.itemWidth : this.itemHeight) - this.children[main_p].sizeMain); } this._positionElementsFrom(main_p, offset); }, _weighAt: function(/*Integer*/ cen, /*Integer*/ i){ var dist = Math.abs(cen - i), limit = ((cen - i) > 0) ? this.children[i].effectRangeRght : this.children[i].effectRangeLeft; return (dist > limit) ? 0 : (1 - dist / limit); // Integer }, _setItemSize: function(p, scale){ if(this.children[p].scale == scale){ return; } this.children[p].scale = scale; scale *= this.timerScale; var w = Math.round(this.itemWidth + ((this.itemMaxWidth - this.itemWidth ) * scale)), h = Math.round(this.itemHeight + ((this.itemMaxHeight - this.itemHeight) * scale)); if(this.isHorizontal){ this.children[p].sizeW = w; this.children[p].sizeH = h; this.children[p].sizeMain = w; this.children[p].sizeOff = h; var y = 0; if(this.anchorEdge == this.EDGE.TOP){ y = (this.children[p].cenY - (this.itemHeight / 2)); }else if(this.anchorEdge == this.EDGE.BOTTOM){ y = (this.children[p].cenY - (h - (this.itemHeight / 2))); }else{ y = (this.children[p].cenY - (h / 2)); } this.children[p].usualX = Math.round(this.children[p].cenX - (w / 2)); style.set(this.children[p].domNode, {top: y + 'px', left: this.children[p].usualX + 'px'}); }else{ this.children[p].sizeW = w; this.children[p].sizeH = h; this.children[p].sizeOff = w; this.children[p].sizeMain = h; var x = 0; if(this.anchorEdge == this.EDGE.LEFT){ x = this.children[p].cenX - (this.itemWidth / 2); }else if(this.anchorEdge == this.EDGE.RIGHT){ x = this.children[p].cenX - (w - (this.itemWidth / 2)); }else{ x = this.children[p].cenX - (w / 2); } this.children[p].usualY = Math.round(this.children[p].cenY - (h / 2)); style.set(this.children[p].domNode, {left: x + 'px', top: this.children[p].usualY + 'px'}); } style.set(this.children[p].domNode, {width: w + 'px', height: h + 'px'}); if(this.children[p].svgNode){ this.children[p].svgNode.setSize(w, h); } }, _positionElementsFrom: function(p, offset){ var pos = 0; var usual, start; if(this.isHorizontal){ usual = "usualX"; start = "left"; }else{ usual = "usualY"; start = "top"; } pos = Math.round(this.children[p][usual] + offset); if(style.get(this.children[p].domNode, start) != (pos + 'px')){ style.set(this.children[p].domNode, start, pos + 'px'); this._positionLabel(this.children[p]); } // position before var bpos = pos; for(var i=p-1; i>=0; i--){ bpos -= this.children[i].sizeMain; if(style.get(this.children[p].domNode, start) != (bpos + 'px')){ style.set(this.children[i].domNode, start, bpos + 'px'); this._positionLabel(this.children[i]); } } // position after var apos = pos; for(i=p+1; i<this.itemCount; i++){ apos += this.children[i-1].sizeMain; if(style.get(this.children[p].domNode, start) != (apos + 'px')){ style.set(this.children[i].domNode, start, apos + 'px'); this._positionLabel(this.children[i]); } } }, _positionLabel: function(itm){ var x = 0; var y = 0; var mb = geometry.getMarginBox(itm.lblNode); if(this.labelEdge == this.EDGE.TOP){ x = Math.round((itm.sizeW / 2) - (mb.w / 2)); y = -mb.h; } if(this.labelEdge == this.EDGE.BOTTOM){ x = Math.round((itm.sizeW / 2) - (mb.w / 2)); y = itm.sizeH; } if(this.labelEdge == this.EDGE.LEFT){ x = -mb.w; y = Math.round((itm.sizeH / 2) - (mb.h / 2)); } if(this.labelEdge == this.EDGE.RIGHT){ x = itm.sizeW; y = Math.round((itm.sizeH / 2) - (mb.h / 2)); } style.set(itm.lblNode, {left: x + 'px', top: y + 'px'}); }, _calcHitGrid: function(){ var pos = geometry.position(this.domNode, true); this.hitX1 = pos.x - this.proximityLeft; this.hitY1 = pos.y - this.proximityTop; this.hitX2 = this.hitX1 + this.totalWidth; this.hitY2 = this.hitY1 + this.totalHeight; }, _toEdge: function(inp, def){ return this.EDGE[inp.toUpperCase()] || def; }, _expandSlowly: function(){ // summary: // slowly expand the image to user specified max size if(!this.isOver){ return; } this.timerScale += 0.2; this._paint(); if(this.timerScale<1.0){ setTimeout(lang.hitch(this, "_expandSlowly"), 10); } } }); });
src/index.js
blowsys/reservo
import React from 'react'; import ReactDOM from 'react-dom'; import App from 'containers/index'; import Tables from 'containers/tables'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); import { createStore, combineReducers, applyMiddleware } from 'redux'; import { Provider } from 'react-redux'; import createHistory from 'history/createBrowserHistory'; import { Router, Route } from 'react-router'; import { routerReducer, routerMiddleware } from 'react-router-redux'; import reducers from 'reducers/index'; const history = createHistory(); const middleware = routerMiddleware(history); const store = createStore( combineReducers({ app: reducers, router: routerReducer }), applyMiddleware(middleware) ); ReactDOM.render(<App />, document.getElementById('root'));
ajax/libs/inferno/1.1.1/inferno-devtools.js
pvnr0082t/cdnjs
/*! * inferno-devtools v1.1.1 * (c) 2017 Dominic Gannaway * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('inferno'), require('inferno-component')) : typeof define === 'function' && define.amd ? define(['inferno', 'inferno-component'], factory) : (factory(global.Inferno,global.Inferno.Component)); }(this, (function (inferno,Component) { 'use strict'; Component = 'default' in Component ? Component['default'] : Component; // this is MUCH faster than .constructor === Array and instanceof Array // in Node 7 and the later versions of V8, slower in older versions though var isArray = Array.isArray; function isStatefulComponent(o) { return !isUndefined(o.prototype) && !isUndefined(o.prototype.render); } function isStringOrNumber(obj) { var type = typeof obj; return type === 'string' || type === 'number'; } function isInvalid(obj) { return isNull(obj) || obj === false || isTrue(obj) || isUndefined(obj); } function isNull(obj) { return obj === null; } function isTrue(obj) { return obj === true; } function isUndefined(obj) { return obj === undefined; } function isObject(o) { return typeof o === 'object'; } function findVNodeFromDom(vNode, dom) { if (!vNode) { var roots = inferno.options.roots; for (var i = 0; i < roots.length; i++) { var root = roots[i]; var result = findVNodeFromDom(root.input, dom); if (result) { return result; } } } else { if (vNode.dom === dom) { return vNode; } var flags = vNode.flags; var children = vNode.children; if (flags & 28 /* Component */) { children = children._lastInput || children; } if (children) { if (isArray(children)) { for (var i$1 = 0; i$1 < children.length; i$1++) { var child = children[i$1]; if (child) { var result$1 = findVNodeFromDom(child, dom); if (result$1) { return result$1; } } } } else if (isObject(children)) { var result$2 = findVNodeFromDom(children, dom); if (result$2) { return result$2; } } } } } var instanceMap = new Map(); function getKeyForVNode(vNode) { var flags = vNode.flags; if (flags & 4 /* ComponentClass */) { return vNode.children; } else { return vNode.dom; } } function getInstanceFromVNode(vNode) { var key = getKeyForVNode(vNode); return instanceMap.get(key); } function createInstanceFromVNode(vNode, instance) { var key = getKeyForVNode(vNode); instanceMap.set(key, instance); } function deleteInstanceForVNode(vNode) { var key = getKeyForVNode(vNode); instanceMap.delete(key); } /** * Create a bridge for exposing Inferno's component tree to React DevTools. * * It creates implementations of the interfaces that ReactDOM passes to * devtools to enable it to query the component tree and hook into component * updates. * * See https://github.com/facebook/react/blob/59ff7749eda0cd858d5ee568315bcba1be75a1ca/src/renderers/dom/ReactDOM.js * for how ReactDOM exports its internals for use by the devtools and * the `attachRenderer()` function in * https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/attachRenderer.js * for how the devtools consumes the resulting objects. */ function createDevToolsBridge() { var ComponentTree = { getNodeFromInstance: function getNodeFromInstance(instance) { return instance.node; }, getClosestInstanceFromNode: function getClosestInstanceFromNode(dom) { var vNode = findVNodeFromDom(null, dom); return vNode ? updateReactComponent(vNode, null) : null; } }; // Map of root ID (the ID is unimportant) to component instance. var roots = {}; findRoots(roots); var Mount = { _instancesByReactRootID: roots, _renderNewRootComponent: function _renderNewRootComponent(instance) { } }; var Reconciler = { mountComponent: function mountComponent(instance) { }, performUpdateIfNecessary: function performUpdateIfNecessary(instance) { }, receiveComponent: function receiveComponent(instance) { }, unmountComponent: function unmountComponent(instance) { } }; var queuedMountComponents = new Map(); var queuedReceiveComponents = new Map(); var queuedUnmountComponents = new Map(); var queueUpdate = function (updater, map, component) { if (!map.has(component)) { map.set(component, true); requestAnimationFrame(function () { updater(component); map.delete(component); }); } }; var queueMountComponent = function (component) { return queueUpdate(Reconciler.mountComponent, queuedMountComponents, component); }; var queueReceiveComponent = function (component) { return queueUpdate(Reconciler.receiveComponent, queuedReceiveComponents, component); }; var queueUnmountComponent = function (component) { return queueUpdate(Reconciler.unmountComponent, queuedUnmountComponents, component); }; /** Notify devtools that a new component instance has been mounted into the DOM. */ var componentAdded = function (vNode) { var instance = updateReactComponent(vNode, null); if (isRootVNode(vNode)) { instance._rootID = nextRootKey(roots); roots[instance._rootID] = instance; Mount._renderNewRootComponent(instance); } visitNonCompositeChildren(instance, function (childInst) { if (childInst) { childInst._inDevTools = true; queueMountComponent(childInst); } }); queueMountComponent(instance); }; /** Notify devtools that a component has been updated with new props/state. */ var componentUpdated = function (vNode) { var prevRenderedChildren = []; visitNonCompositeChildren(getInstanceFromVNode(vNode), function (childInst) { prevRenderedChildren.push(childInst); }); // Notify devtools about updates to this component and any non-composite // children var instance = updateReactComponent(vNode, null); queueReceiveComponent(instance); visitNonCompositeChildren(instance, function (childInst) { if (!childInst._inDevTools) { // New DOM child component childInst._inDevTools = true; queueMountComponent(childInst); } else { // Updated DOM child component queueReceiveComponent(childInst); } }); // For any non-composite children that were removed by the latest render, // remove the corresponding ReactDOMComponent-like instances and notify // the devtools prevRenderedChildren.forEach(function (childInst) { if (!document.body.contains(childInst.node)) { deleteInstanceForVNode(childInst.vNode); queueUnmountComponent(childInst); } }); }; /** Notify devtools that a component has been unmounted from the DOM. */ var componentRemoved = function (vNode) { var instance = updateReactComponent(vNode, null); visitNonCompositeChildren(function (childInst) { deleteInstanceForVNode(childInst.vNode); queueUnmountComponent(childInst); }); queueUnmountComponent(instance); deleteInstanceForVNode(vNode); if (instance._rootID) { delete roots[instance._rootID]; } }; return { componentAdded: componentAdded, componentUpdated: componentUpdated, componentRemoved: componentRemoved, ComponentTree: ComponentTree, Mount: Mount, Reconciler: Reconciler }; } function isRootVNode(vNode) { for (var i = 0; i < inferno.options.roots.length; i++) { var root = inferno.options.roots[i]; if (root.input === vNode) { return true; } } } /** * Update (and create if necessary) the ReactDOMComponent|ReactCompositeComponent-like * instance for a given Inferno component instance or DOM Node. */ function updateReactComponent(vNode, parentDom) { if (!vNode) { return null; } var flags = vNode.flags; var newInstance; if (flags & 28 /* Component */) { newInstance = createReactCompositeComponent(vNode, parentDom); } else { newInstance = createReactDOMComponent(vNode, parentDom); } var oldInstance = getInstanceFromVNode(vNode); if (oldInstance) { Object.assign(oldInstance, newInstance); return oldInstance; } createInstanceFromVNode(vNode, newInstance); return newInstance; } function normalizeChildren(children, dom) { if (isArray(children)) { return children.filter(function (child) { return !isInvalid(child); }).map(function (child) { return updateReactComponent(child, dom); }); } else { return !isInvalid(children) ? [updateReactComponent(children, dom)] : []; } } /** * Create a ReactDOMComponent-compatible object for a given DOM node rendered * by Inferno. * * This implements the subset of the ReactDOMComponent interface that * React DevTools requires in order to display DOM nodes in the inspector with * the correct type and properties. */ function createReactDOMComponent(vNode, parentDom) { var flags = vNode.flags; if (flags & 4096 /* Void */) { return null; } var type = vNode.type; var children = vNode.children; var props = vNode.props; var dom = vNode.dom; var isText = (flags & 1 /* Text */) || isStringOrNumber(vNode); return { _currentElement: isText ? (children || vNode) : { type: type, props: props }, _renderedChildren: !isText && normalizeChildren(children, dom), _stringText: isText ? (children || vNode) : null, _inDevTools: false, node: dom || parentDom, vNode: vNode }; } function normalizeKey(key) { if (key && key[0] === '.') { return null; } } /** * Return a ReactCompositeComponent-compatible object for a given Inferno * component instance. * * This implements the subset of the ReactCompositeComponent interface that * the DevTools requires in order to walk the component tree and inspect the * component's properties. * * See https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/getData.js */ function createReactCompositeComponent(vNode, parentDom) { var type = vNode.type; var instance = vNode.children; var lastInput = instance._lastInput || instance; var dom = vNode.dom; return { getName: function getName() { return typeName(type); }, _currentElement: { type: type, key: normalizeKey(vNode.key), ref: null, props: vNode.props }, props: instance.props, state: instance.state, forceUpdate: instance.forceUpdate.bind(instance), setState: instance.setState.bind(instance), node: dom, _instance: instance, _renderedComponent: updateReactComponent(lastInput, dom), vNode: vNode }; } function nextRootKey(roots) { return '.' + Object.keys(roots).length; } /** * Visit all child instances of a ReactCompositeComponent-like object that are * not composite components (ie. they represent DOM elements or text) */ function visitNonCompositeChildren(component, visitor) { if (component._renderedComponent) { if (!component._renderedComponent._component) { visitor(component._renderedComponent); visitNonCompositeChildren(component._renderedComponent, visitor); } } else if (component._renderedChildren) { component._renderedChildren.forEach(function (child) { if (child) { visitor(child); if (!child._component) { visitNonCompositeChildren(child, visitor); } } }); } } /** * Return the name of a component created by a `ReactElement`-like object. */ function typeName(type) { if (typeof type === 'function') { return type.displayName || type.name; } return type; } /** * Find all root component instances rendered by Inferno in `node`'s children * and add them to the `roots` map. */ function findRoots(roots) { inferno.options.roots.forEach(function (root) { roots[nextRootKey(roots)] = updateReactComponent(root.input, null); }); } var functionalComponentWrappers = new Map(); function wrapFunctionalComponent(vNode) { var originalRender = vNode.type; var name = vNode.type.name || 'Function (anonymous)'; var wrappers = functionalComponentWrappers; if (!wrappers.has(originalRender)) { var wrapper = (function (Component$$1) { function wrapper () { Component$$1.apply(this, arguments); } if ( Component$$1 ) wrapper.__proto__ = Component$$1; wrapper.prototype = Object.create( Component$$1 && Component$$1.prototype ); wrapper.prototype.constructor = wrapper; wrapper.prototype.render = function render (props, state, context) { return originalRender(props, context); }; return wrapper; }(Component)); // Expose the original component name. React Dev Tools will use // this property if it exists or fall back to Function.name // otherwise. /* tslint:disable */ wrapper['displayName'] = name; /* tslint:enable */ wrappers.set(originalRender, wrapper); } vNode.type = wrappers.get(originalRender); vNode.type.defaultProps = originalRender.defaultProps; vNode.ref = null; vNode.flags = 4 /* ComponentClass */; } // Credit: this based on on the great work done with Preact and its devtools // https://github.com/developit/preact/blob/master/devtools/devtools.js function initDevTools() { /* tslint:disable */ if (typeof window['__REACT_DEVTOOLS_GLOBAL_HOOK__'] === 'undefined') { /* tslint:enable */ // React DevTools are not installed return; } var nextVNode = inferno.options.createVNode; inferno.options.createVNode = function (vNode) { var flags = vNode.flags; if ((flags & 28 /* Component */) && !isStatefulComponent(vNode.type)) { wrapFunctionalComponent(vNode); } if (nextVNode) { return nextVNode(vNode); } }; // Notify devtools when preact components are mounted, updated or unmounted var bridge = createDevToolsBridge(); var nextAfterMount = inferno.options.afterMount; inferno.options.afterMount = function (vNode) { bridge.componentAdded(vNode); if (nextAfterMount) { nextAfterMount(vNode); } }; var nextAfterUpdate = inferno.options.afterUpdate; inferno.options.afterUpdate = function (vNode) { bridge.componentUpdated(vNode); if (nextAfterUpdate) { nextAfterUpdate(vNode); } }; var nextBeforeUnmount = inferno.options.beforeUnmount; inferno.options.beforeUnmount = function (vNode) { bridge.componentRemoved(vNode); if (nextBeforeUnmount) { nextBeforeUnmount(vNode); } }; // Notify devtools about this instance of "React" /* tslint:disable */ window['__REACT_DEVTOOLS_GLOBAL_HOOK__'].inject(bridge); /* tslint:enable */ return function () { inferno.options.afterMount = nextAfterMount; inferno.options.afterUpdate = nextAfterUpdate; inferno.options.beforeUnmount = nextBeforeUnmount; }; } initDevTools(); })));
node_modules/react-icons/ti/arrow-repeat.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const TiArrowRepeat = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m27.5 11.7h-3.5l2.2-2.2c0.6-0.6 0.6-1.7 0-2.3s-1.7-0.7-2.4 0l-6.2 6.1 6.2 6.2c0.3 0.3 0.8 0.5 1.2 0.5s0.9-0.2 1.2-0.5c0.6-0.6 0.6-1.7 0-2.3l-2.2-2.2h3.5c2.3 0 4.2 2.2 4.2 5s-2.3 5-5 5c-1 0-1.7 0.7-1.7 1.7s0.7 1.6 1.7 1.6c4.6 0 8.3-3.7 8.3-8.3s-3.4-8.3-7.5-8.3z m-13.7 8.8c-0.6 0.6-0.6 1.7 0 2.3l2.2 2.2h-3.5c-2.3 0-4.2-2.2-4.2-5s2.3-5 5-5c1 0 1.7-0.7 1.7-1.7s-0.7-1.6-1.7-1.6c-4.6 0-8.3 3.7-8.3 8.3s3.4 8.3 7.5 8.3h3.5l-2.2 2.2c-0.6 0.6-0.6 1.7 0 2.3 0.3 0.4 0.8 0.5 1.2 0.5s0.9-0.1 1.2-0.5l6.2-6.1-6.2-6.2c-0.7-0.7-1.7-0.7-2.4 0z"/></g> </Icon> ) export default TiArrowRepeat
src/components/common/svg-icons/social/location-city.js
abzfarah/Pearson.NAPLAN.GnomeH
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let SocialLocationCity = (props) => ( <SvgIcon {...props}> <path d="M15 11V5l-3-3-3 3v2H3v14h18V11h-6zm-8 8H5v-2h2v2zm0-4H5v-2h2v2zm0-4H5V9h2v2zm6 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V9h2v2zm0-4h-2V5h2v2zm6 12h-2v-2h2v2zm0-4h-2v-2h2v2z"/> </SvgIcon> ); SocialLocationCity = pure(SocialLocationCity); SocialLocationCity.displayName = 'SocialLocationCity'; SocialLocationCity.muiName = 'SvgIcon'; export default SocialLocationCity;
app/javascript/mastodon/features/follow_requests/index.js
cybrespace/mastodon
import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; import LoadingIndicator from '../../components/loading_indicator'; import Column from '../ui/components/column'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import AccountAuthorizeContainer from './containers/account_authorize_container'; import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; import ScrollableList from '../../components/scrollable_list'; const messages = defineMessages({ heading: { id: 'column.follow_requests', defaultMessage: 'Follow requests' }, }); const mapStateToProps = state => ({ accountIds: state.getIn(['user_lists', 'follow_requests', 'items']), }); export default @connect(mapStateToProps) @injectIntl class FollowRequests extends ImmutablePureComponent { static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, intl: PropTypes.object.isRequired, }; componentWillMount () { this.props.dispatch(fetchFollowRequests()); } handleLoadMore = debounce(() => { this.props.dispatch(expandFollowRequests()); }, 300, { leading: true }); render () { const { intl, shouldUpdateScroll, accountIds } = this.props; if (!accountIds) { return ( <Column> <LoadingIndicator /> </Column> ); } const emptyMessage = <FormattedMessage id='empty_column.follow_requests' defaultMessage="You don't have any follow requests yet. When you receive one, it will show up here." />; return ( <Column icon='users' heading={intl.formatMessage(messages.heading)}> <ColumnBackButtonSlim /> <ScrollableList scrollKey='follow_requests' onLoadMore={this.handleLoadMore} shouldUpdateScroll={shouldUpdateScroll} emptyMessage={emptyMessage} > {accountIds.map(id => <AccountAuthorizeContainer key={id} id={id} /> )} </ScrollableList> </Column> ); } }
ajax/libs/webshim/1.14.6-RC1/dev/shims/combos/26.js
Timbioz/cdnjs
/** * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill * v1.2.1 * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing * * Date: 2014-05-14 */ /** * Compiled inline version. (Library mode) */ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ /*globals $code */ (function(exports, undefined) { "use strict"; var modules = {}; function require(ids, callback) { var module, defs = []; for (var i = 0; i < ids.length; ++i) { module = modules[ids[i]] || resolve(ids[i]); if (!module) { throw 'module definition dependecy not found: ' + ids[i]; } defs.push(module); } callback.apply(null, defs); } function define(id, dependencies, definition) { if (typeof id !== 'string') { throw 'invalid module definition, module id must be defined and be a string'; } if (dependencies === undefined) { throw 'invalid module definition, dependencies must be specified'; } if (definition === undefined) { throw 'invalid module definition, definition function must be specified'; } require(dependencies, function() { modules[id] = definition.apply(null, arguments); }); } function defined(id) { return !!modules[id]; } function resolve(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length; ++fi) { if (!target[fragments[fi]]) { return; } target = target[fragments[fi]]; } return target; } function expose(ids) { for (var i = 0; i < ids.length; i++) { var target = exports; var id = ids[i]; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length - 1; ++fi) { if (target[fragments[fi]] === undefined) { target[fragments[fi]] = {}; } target = target[fragments[fi]]; } target[fragments[fragments.length - 1]] = modules[id]; } } // Included from: src/javascript/core/utils/Basic.js /** * Basic.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Basic', [], function() { /** Gets the true type of the built-in object (better version of typeof). @author Angus Croll (http://javascriptweblog.wordpress.com/) @method typeOf @for Utils @static @param {Object} o Object to check. @return {String} Object [[Class]] */ var typeOf = function(o) { var undef; if (o === undef) { return 'undefined'; } else if (o === null) { return 'null'; } else if (o.nodeType) { return 'node'; } // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); }; /** Extends the specified object with another object. @method extend @static @param {Object} target Object to extend. @param {Object} [obj]* Multiple objects to extend with. @return {Object} Same as target, the extended object. */ var extend = function(target) { var undef; each(arguments, function(arg, i) { if (i > 0) { each(arg, function(value, key) { if (value !== undef) { if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) { extend(target[key], value); } else { target[key] = value; } } }); } }); return target; }; /** Executes the callback function for each item in array/object. If you return false in the callback it will break the loop. @method each @static @param {Object} obj Object to iterate. @param {function} callback Callback function to execute for each item. */ var each = function(obj, callback) { var length, key, i, undef; if (obj) { try { length = obj.length; } catch(ex) { length = undef; } if (length === undef) { // Loop object items for (key in obj) { if (obj.hasOwnProperty(key)) { if (callback(obj[key], key) === false) { return; } } } } else { // Loop array items for (i = 0; i < length; i++) { if (callback(obj[i], i) === false) { return; } } } } }; /** Checks if object is empty. @method isEmptyObj @static @param {Object} o Object to check. @return {Boolean} */ var isEmptyObj = function(obj) { var prop; if (!obj || typeOf(obj) !== 'object') { return true; } for (prop in obj) { return false; } return true; }; /** Recieve an array of functions (usually async) to call in sequence, each function receives a callback as first argument that it should call, when it completes. Finally, after everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the sequence and invoke main callback immediately. @method inSeries @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ var inSeries = function(queue, cb) { var i = 0, length = queue.length; if (typeOf(cb) !== 'function') { cb = function() {}; } if (!queue || !queue.length) { cb(); } function callNext(i) { if (typeOf(queue[i]) === 'function') { queue[i](function(error) { /*jshint expr:true */ ++i < length && !error ? callNext(i) : cb(error); }); } } callNext(i); }; /** Recieve an array of functions (usually async) to call in parallel, each function receives a callback as first argument that it should call, when it completes. After everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the process and invoke main callback immediately. @method inParallel @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of erro */ var inParallel = function(queue, cb) { var count = 0, num = queue.length, cbArgs = new Array(num); each(queue, function(fn, i) { fn(function(error) { if (error) { return cb(error); } var args = [].slice.call(arguments); args.shift(); // strip error - undefined or not cbArgs[i] = args; count++; if (count === num) { cbArgs.unshift(null); cb.apply(this, cbArgs); } }); }); }; /** Find an element in array and return it's index if present, otherwise return -1. @method inArray @static @param {Mixed} needle Element to find @param {Array} array @return {Int} Index of the element, or -1 if not found */ var inArray = function(needle, array) { if (array) { if (Array.prototype.indexOf) { return Array.prototype.indexOf.call(array, needle); } for (var i = 0, length = array.length; i < length; i++) { if (array[i] === needle) { return i; } } } return -1; }; /** Returns elements of first array if they are not present in second. And false - otherwise. @private @method arrayDiff @param {Array} needles @param {Array} array @return {Array|Boolean} */ var arrayDiff = function(needles, array) { var diff = []; if (typeOf(needles) !== 'array') { needles = [needles]; } if (typeOf(array) !== 'array') { array = [array]; } for (var i in needles) { if (inArray(needles[i], array) === -1) { diff.push(needles[i]); } } return diff.length ? diff : false; }; /** Find intersection of two arrays. @private @method arrayIntersect @param {Array} array1 @param {Array} array2 @return {Array} Intersection of two arrays or null if there is none */ var arrayIntersect = function(array1, array2) { var result = []; each(array1, function(item) { if (inArray(item, array2) !== -1) { result.push(item); } }); return result.length ? result : null; }; /** Forces anything into an array. @method toArray @static @param {Object} obj Object with length field. @return {Array} Array object containing all items. */ var toArray = function(obj) { var i, arr = []; for (i = 0; i < obj.length; i++) { arr[i] = obj[i]; } return arr; }; /** Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. It's more probable for the earth to be hit with an ansteriod. Y @method guid @static @param {String} prefix to prepend (by default 'o' will be prepended). @method guid @return {String} Virtually unique id. */ var guid = (function() { var counter = 0; return function(prefix) { var guid = new Date().getTime().toString(32), i; for (i = 0; i < 5; i++) { guid += Math.floor(Math.random() * 65535).toString(32); } return (prefix || 'o_') + guid + (counter++).toString(32); }; }()); /** Trims white spaces around the string @method trim @static @param {String} str @return {String} */ var trim = function(str) { if (!str) { return str; } return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); }; /** Parses the specified size string into a byte value. For example 10kb becomes 10240. @method parseSizeStr @static @param {String/Number} size String to parse or number to just pass through. @return {Number} Size in bytes. */ var parseSizeStr = function(size) { if (typeof(size) !== 'string') { return size; } var muls = { t: 1099511627776, g: 1073741824, m: 1048576, k: 1024 }, mul; size = /^([0-9]+)([mgk]?)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, '')); mul = size[2]; size = +size[1]; if (muls.hasOwnProperty(mul)) { size *= muls[mul]; } return size; }; return { guid: guid, typeOf: typeOf, extend: extend, each: each, isEmptyObj: isEmptyObj, inSeries: inSeries, inParallel: inParallel, inArray: inArray, arrayDiff: arrayDiff, arrayIntersect: arrayIntersect, toArray: toArray, trim: trim, parseSizeStr: parseSizeStr }; }); // Included from: src/javascript/core/I18n.js /** * I18n.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/I18n", [ "moxie/core/utils/Basic" ], function(Basic) { var i18n = {}; return { /** * Extends the language pack object with new items. * * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ addI18n: function(pack) { return Basic.extend(i18n, pack); }, /** * Translates the specified string by checking for the english string in the language pack lookup. * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ translate: function(str) { return i18n[str] || str; }, /** * Shortcut for translate function * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ _: function(str) { return this.translate(str); }, /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. * * @param {String} str String with tokens * @return {String} String with replaced tokens */ sprintf: function(str) { var args = [].slice.call(arguments, 1); return str.replace(/%[a-z]/g, function() { var value = args.shift(); return Basic.typeOf(value) !== 'undefined' ? value : ''; }); } }; }); // Included from: src/javascript/core/utils/Mime.js /** * Mime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Mime", [ "moxie/core/utils/Basic", "moxie/core/I18n" ], function(Basic, I18n) { var mimeData = "" + "application/msword,doc dot," + "application/pdf,pdf," + "application/pgp-signature,pgp," + "application/postscript,ps ai eps," + "application/rtf,rtf," + "application/vnd.ms-excel,xls xlb," + "application/vnd.ms-powerpoint,ppt pps pot," + "application/zip,zip," + "application/x-shockwave-flash,swf swfl," + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + "application/x-javascript,js," + "application/json,json," + "audio/mpeg,mp3 mpga mpega mp2," + "audio/x-wav,wav," + "audio/x-m4a,m4a," + "audio/ogg,oga ogg," + "audio/aiff,aiff aif," + "audio/flac,flac," + "audio/aac,aac," + "audio/ac3,ac3," + "audio/x-ms-wma,wma," + "image/bmp,bmp," + "image/gif,gif," + "image/jpeg,jpg jpeg jpe," + "image/photoshop,psd," + "image/png,png," + "image/svg+xml,svg svgz," + "image/tiff,tiff tif," + "text/plain,asc txt text diff log," + "text/html,htm html xhtml," + "text/css,css," + "text/csv,csv," + "text/rtf,rtf," + "video/mpeg,mpeg mpg mpe m2v," + "video/quicktime,qt mov," + "video/mp4,mp4," + "video/x-m4v,m4v," + "video/x-flv,flv," + "video/x-ms-wmv,wmv," + "video/avi,avi," + "video/webm,webm," + "video/3gpp,3gpp 3gp," + "video/3gpp2,3g2," + "video/vnd.rn-realvideo,rv," + "video/ogg,ogv," + "video/x-matroska,mkv," + "application/vnd.oasis.opendocument.formula-template,otf," + "application/octet-stream,exe"; var Mime = { mimes: {}, extensions: {}, // Parses the default mime types string into a mimes and extensions lookup maps addMimeType: function (mimeData) { var items = mimeData.split(/,/), i, ii, ext; for (i = 0; i < items.length; i += 2) { ext = items[i + 1].split(/ /); // extension to mime lookup for (ii = 0; ii < ext.length; ii++) { this.mimes[ext[ii]] = items[i]; } // mime to extension lookup this.extensions[items[i]] = ext; } }, extList2mimes: function (filters, addMissingExtensions) { var self = this, ext, i, ii, type, mimes = []; // convert extensions to mime types list for (i = 0; i < filters.length; i++) { ext = filters[i].extensions.split(/\s*,\s*/); for (ii = 0; ii < ext.length; ii++) { // if there's an asterisk in the list, then accept attribute is not required if (ext[ii] === '*') { return []; } type = self.mimes[ext[ii]]; if (!type) { if (addMissingExtensions && /^\w+$/.test(ext[ii])) { mimes.push('.' + ext[ii]); } else { return []; // accept all } } else if (Basic.inArray(type, mimes) === -1) { mimes.push(type); } } } return mimes; }, mimes2exts: function(mimes) { var self = this, exts = []; Basic.each(mimes, function(mime) { if (mime === '*') { exts = []; return false; } // check if this thing looks like mime type var m = mime.match(/^(\w+)\/(\*|\w+)$/); if (m) { if (m[2] === '*') { // wildcard mime type detected Basic.each(self.extensions, function(arr, mime) { if ((new RegExp('^' + m[1] + '/')).test(mime)) { [].push.apply(exts, self.extensions[mime]); } }); } else if (self.extensions[mime]) { [].push.apply(exts, self.extensions[mime]); } } }); return exts; }, mimes2extList: function(mimes) { var accept = [], exts = []; if (Basic.typeOf(mimes) === 'string') { mimes = Basic.trim(mimes).split(/\s*,\s*/); } exts = this.mimes2exts(mimes); accept.push({ title: I18n.translate('Files'), extensions: exts.length ? exts.join(',') : '*' }); // save original mimes string accept.mimes = mimes; return accept; }, getFileExtension: function(fileName) { var matches = fileName && fileName.match(/\.([^.]+)$/); if (matches) { return matches[1].toLowerCase(); } return ''; }, getFileMime: function(fileName) { return this.mimes[this.getFileExtension(fileName)] || ''; } }; Mime.addMimeType(mimeData); return Mime; }); // Included from: src/javascript/core/utils/Env.js /** * Env.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Env", [ "moxie/core/utils/Basic" ], function(Basic) { // UAParser.js v0.6.2 // Lightweight JavaScript-based User-Agent string parser // https://github.com/faisalman/ua-parser-js // // Copyright © 2012-2013 Faisalman <fyzlman@gmail.com> // Dual licensed under GPLv2 & MIT var UAParser = (function (undefined) { ////////////// // Constants ///////////// var EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', UNDEF_TYPE = 'undefined', OBJ_TYPE = 'object', MAJOR = 'major', MODEL = 'model', NAME = 'name', TYPE = 'type', VENDOR = 'vendor', VERSION = 'version', ARCHITECTURE= 'architecture', CONSOLE = 'console', MOBILE = 'mobile', TABLET = 'tablet'; /////////// // Helper ////////// var util = { has : function (str1, str2) { return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; }, lowerize : function (str) { return str.toLowerCase(); } }; /////////////// // Map helper ////////////// var mapper = { rgx : function () { // loop through all regexes maps for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { var regex = args[i], // even sequence (0,2,4,..) props = args[i + 1]; // odd sequence (1,3,5,..) // construct object barebones if (typeof(result) === UNDEF_TYPE) { result = {}; for (p in props) { q = props[p]; if (typeof(q) === OBJ_TYPE) { result[q[0]] = undefined; } else { result[q] = undefined; } } } // try matching uastring with regexes for (j = k = 0; j < regex.length; j++) { matches = regex[j].exec(this.getUA()); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof(q) === OBJ_TYPE && q.length > 0) { if (q.length == 2) { if (typeof(q[1]) == FUNC_TYPE) { // assign modified match result[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match result[q[0]] = q[1]; } } else if (q.length == 3) { // check whether function or regex if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length == 4) { result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { result[q] = match ? match : undefined; } } break; } } if(!!matches) break; // break the loop immediately if match found } return result; }, str : function (str, map) { for (var i in map) { // check if array if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (util.has(map[i][j], str)) { return (i === UNKNOWN) ? undefined : i; } } } else if (util.has(map[i], str)) { return (i === UNKNOWN) ? undefined : i; } } return str; } }; /////////////// // String map ////////////// var maps = { browser : { oldsafari : { major : { '1' : ['/8', '/1', '/3'], '2' : '/4', '?' : '/' }, version : { '1.0' : '/8', '1.2' : '/1', '1.3' : '/3', '2.0' : '/412', '2.0.2' : '/416', '2.0.3' : '/417', '2.0.4' : '/419', '?' : '/' } } }, device : { sprint : { model : { 'Evo Shift 4G' : '7373KT' }, vendor : { 'HTC' : 'APA', 'Sprint' : 'Sprint' } } }, os : { windows : { version : { 'ME' : '4.90', 'NT 3.11' : 'NT3.51', 'NT 4.0' : 'NT4.0', '2000' : 'NT 5.0', 'XP' : ['NT 5.1', 'NT 5.2'], 'Vista' : 'NT 6.0', '7' : 'NT 6.1', '8' : 'NT 6.2', '8.1' : 'NT 6.3', 'RT' : 'ARM' } } } }; ////////////// // Regex map ///////////// var regexes = { browser : [[ // Presto based /(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet /(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80 /(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80 ], [NAME, VERSION, MAJOR], [ /\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit ], [[NAME, 'Opera'], VERSION, MAJOR], [ // Mixed /(kindle)\/((\d+)?[\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer // Trident based /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, // Avant/IEMobile/SlimBrowser/Baidu /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer // Webkit/KHTML based /(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron ], [NAME, VERSION, MAJOR], [ /(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11 ], [[NAME, 'IE'], VERSION, MAJOR], [ /(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex ], [[NAME, 'Yandex'], VERSION, MAJOR], [ /(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION, MAJOR], [ /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION, MAJOR], [ /(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin ], [[NAME, 'Dolphin'], VERSION, MAJOR], [ /((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS ], [[NAME, 'Chrome'], VERSION, MAJOR], [ /((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i // Android Browser ], [[NAME, 'Android Browser'], VERSION, MAJOR], [ /version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari ], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [ /version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile ], [VERSION, MAJOR, NAME], [ /webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0 ], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [ /(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror /(webkit|khtml)\/((\d+)?[\w\.]+)/i ], [NAME, VERSION, MAJOR], [ // Gecko based /(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION, MAJOR], [ /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla // Other /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, // UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser /(links)\s\(((\d+)?[\w\.]+)/i, // Links /(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser /(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic ], [NAME, VERSION, MAJOR] ], engine : [[ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ /rv\:([\w\.]+).*(gecko)/i // Gecko ], [VERSION, NAME] ], os : [[ // Windows based /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ // Mobile/Embedded OS /\((bb)(10);/i // BlackBerry 10 ], [[NAME, 'BlackBerry'], VERSION], [ /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry /(tizen)\/([\w\.]+)/i, // Tizen /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo ], [NAME, VERSION], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian ], [[NAME, 'Symbian'], VERSION],[ /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS ], [[NAME, 'Firefox OS'], VERSION], [ // Console /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation // GNU/Linux based /(mint)[\/\s\(]?(\w+)*/i, // Mint /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux /(gnu)\s?([\w\.]+)*/i // GNU ], [NAME, VERSION], [ /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS ], [[NAME, 'Chromium OS'], VERSION],[ // Solaris /(sunos)\s?([\w\.]+\d)*/i // Solaris ], [[NAME, 'Solaris'], VERSION], [ // BSD based /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly ], [NAME, VERSION],[ /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ /(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS ], [NAME, [VERSION, /_/g, '.']], [ // Other /(haiku)\s(\w+)/i, // Haiku /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS /(unix)\s?([\w\.]+)*/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (uastring) { var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); this.getBrowser = function () { return mapper.rgx.apply(this, regexes.browser); }; this.getEngine = function () { return mapper.rgx.apply(this, regexes.engine); }; this.getOS = function () { return mapper.rgx.apply(this, regexes.os); }; this.getResult = function() { return { ua : this.getUA(), browser : this.getBrowser(), engine : this.getEngine(), os : this.getOS() }; }; this.getUA = function () { return ua; }; this.setUA = function (uastring) { ua = uastring; return this; }; this.setUA(ua); }; return new UAParser().getResult(); })(); function version_compare(v1, v2, operator) { // From: http://phpjs.org/functions // + original by: Philippe Jausions (http://pear.php.net/user/jausions) // + original by: Aidan Lister (http://aidanlister.com/) // + reimplemented by: Kankrelune (http://www.webfaktory.info/) // + improved by: Brett Zamir (http://brett-zamir.me) // + improved by: Scott Baker // + improved by: Theriault // * example 1: version_compare('8.2.5rc', '8.2.5a'); // * returns 1: 1 // * example 2: version_compare('8.2.50', '8.2.52', '<'); // * returns 2: true // * example 3: version_compare('5.3.0-dev', '5.3.0'); // * returns 3: -1 // * example 4: version_compare('4.1.0.52','4.01.0.51'); // * returns 4: 1 // Important: compare must be initialized at 0. var i = 0, x = 0, compare = 0, // vm maps textual PHP versions to negatives so they're less than 0. // PHP currently defines these as CASE-SENSITIVE. It is important to // leave these as negatives so that they can come before numerical versions // and as if no letters were there to begin with. // (1alpha is < 1 and < 1.1 but > 1dev1) // If a non-numerical value can't be mapped to this table, it receives // -7 as its value. vm = { 'dev': -6, 'alpha': -5, 'a': -5, 'beta': -4, 'b': -4, 'RC': -3, 'rc': -3, '#': -2, 'p': 1, 'pl': 1 }, // This function will be called to prepare each version argument. // It replaces every _, -, and + with a dot. // It surrounds any nonsequence of numbers/dots with dots. // It replaces sequences of dots with a single dot. // version_compare('4..0', '4.0') == 0 // Important: A string of 0 length needs to be converted into a value // even less than an unexisting value in vm (-7), hence [-8]. // It's also important to not strip spaces because of this. // version_compare('', ' ') == 1 prepVersion = function (v) { v = ('' + v).replace(/[_\-+]/g, '.'); v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); return (!v.length ? [-8] : v.split('.')); }, // This converts a version component to a number. // Empty component becomes 0. // Non-numerical component becomes a negative number. // Numerical component becomes itself as an integer. numVersion = function (v) { return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); }; v1 = prepVersion(v1); v2 = prepVersion(v2); x = Math.max(v1.length, v2.length); for (i = 0; i < x; i++) { if (v1[i] == v2[i]) { continue; } v1[i] = numVersion(v1[i]); v2[i] = numVersion(v2[i]); if (v1[i] < v2[i]) { compare = -1; break; } else if (v1[i] > v2[i]) { compare = 1; break; } } if (!operator) { return compare; } // Important: operator is CASE-SENSITIVE. // "No operator" seems to be treated as "<." // Any other values seem to make the function return null. switch (operator) { case '>': case 'gt': return (compare > 0); case '>=': case 'ge': return (compare >= 0); case '<=': case 'le': return (compare <= 0); case '==': case '=': case 'eq': return (compare === 0); case '<>': case '!=': case 'ne': return (compare !== 0); case '': case '<': case 'lt': return (compare < 0); default: return null; } } var can = (function() { var caps = { define_property: (function() { /* // currently too much extra code required, not exactly worth it try { // as of IE8, getters/setters are supported only on DOM elements var obj = {}; if (Object.defineProperty) { Object.defineProperty(obj, 'prop', { enumerable: true, configurable: true }); return true; } } catch(ex) {} if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { return true; }*/ return false; }()), create_canvas: (function() { // On the S60 and BB Storm, getContext exists, but always returns undefined // so we actually have to call getContext() to verify // github.com/Modernizr/Modernizr/issues/issue/97/ var el = document.createElement('canvas'); return !!(el.getContext && el.getContext('2d')); }()), return_response_type: function(responseType) { try { if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { return true; } else if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); xhr.open('get', '/'); // otherwise Gecko throws an exception if ('responseType' in xhr) { xhr.responseType = responseType; // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) if (xhr.responseType !== responseType) { return false; } return true; } } } catch (ex) {} return false; }, // ideas for this heavily come from Modernizr (http://modernizr.com/) use_data_uri: (function() { var du = new Image(); du.onload = function() { caps.use_data_uri = (du.width === 1 && du.height === 1); }; setTimeout(function() { du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; }, 1); return false; }()), use_data_uri_over32kb: function() { // IE8 return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); }, use_data_uri_of: function(bytes) { return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); }, use_fileinput: function() { var el = document.createElement('input'); el.setAttribute('type', 'file'); return !el.disabled; } }; return function(cap) { var args = [].slice.call(arguments); args.shift(); // shift of cap return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; }; }()); var Env = { can: can, browser: UAParser.browser.name, version: parseFloat(UAParser.browser.major), os: UAParser.os.name, // everybody intuitively types it in a lowercase for some reason osVersion: UAParser.os.version, verComp: version_compare, swf_url: "../flash/Moxie.swf", xap_url: "../silverlight/Moxie.xap", global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" }; // for backward compatibility // @deprecated Use `Env.os` instead Env.OS = Env.os; return Env; }); // Included from: src/javascript/core/utils/Dom.js /** * Dom.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { /** Get DOM Element by it's id. @method get @for Utils @param {String} id Identifier of the DOM Element @return {DOMElement} */ var get = function(id) { if (typeof id !== 'string') { return id; } return document.getElementById(id); }; /** Checks if specified DOM element has specified class. @method hasClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var hasClass = function(obj, name) { if (!obj.className) { return false; } var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); return regExp.test(obj.className); }; /** Adds specified className to specified DOM element. @method addClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var addClass = function(obj, name) { if (!hasClass(obj, name)) { obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; } }; /** Removes specified className from specified DOM element. @method removeClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var removeClass = function(obj, name) { if (obj.className) { var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); obj.className = obj.className.replace(regExp, function($0, $1, $2) { return $1 === ' ' && $2 === ' ' ? ' ' : ''; }); } }; /** Returns a given computed style of a DOM element. @method getStyle @static @param {Object} obj DOM element like object. @param {String} name Style you want to get from the DOM element */ var getStyle = function(obj, name) { if (obj.currentStyle) { return obj.currentStyle[name]; } else if (window.getComputedStyle) { return window.getComputedStyle(obj, null)[name]; } }; /** Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @method getPos @static @param {Element} node HTML element or element id to get x, y position from. @param {Element} root Optional root element to stop calculations at. @return {object} Absolute position of the specified element object with x, y fields. */ var getPos = function(node, root) { var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; node = node; root = root || doc.body; // Returns the x, y cordinate for an element on IE 6 and IE 7 function getIEPos(node) { var bodyElm, rect, x = 0, y = 0; if (node) { rect = node.getBoundingClientRect(); bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; x = rect.left + bodyElm.scrollLeft; y = rect.top + bodyElm.scrollTop; } return { x : x, y : y }; } // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { nodeRect = getIEPos(node); rootRect = getIEPos(root); return { x : nodeRect.x - rootRect.x, y : nodeRect.y - rootRect.y }; } parent = node; while (parent && parent != root && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } parent = node.parentNode; while (parent && parent != root && parent.nodeType) { x -= parent.scrollLeft || 0; y -= parent.scrollTop || 0; parent = parent.parentNode; } return { x : x, y : y }; }; /** Returns the size of the specified node in pixels. @method getSize @static @param {Node} node Node to get the size of. @return {Object} Object with a w and h property. */ var getSize = function(node) { return { w : node.offsetWidth || node.clientWidth, h : node.offsetHeight || node.clientHeight }; }; return { get: get, hasClass: hasClass, addClass: addClass, removeClass: removeClass, getStyle: getStyle, getPos: getPos, getSize: getSize }; }); // Included from: src/javascript/core/Exceptions.js /** * Exceptions.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/Exceptions', [ 'moxie/core/utils/Basic' ], function(Basic) { function _findKey(obj, value) { var key; for (key in obj) { if (obj[key] === value) { return key; } } return null; } return { RuntimeError: (function() { var namecodes = { NOT_INIT_ERR: 1, NOT_SUPPORTED_ERR: 9, JS_ERR: 4 }; function RuntimeError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": RuntimeError " + this.code; } Basic.extend(RuntimeError, namecodes); RuntimeError.prototype = Error.prototype; return RuntimeError; }()), OperationNotAllowedException: (function() { function OperationNotAllowedException(code) { this.code = code; this.name = 'OperationNotAllowedException'; } Basic.extend(OperationNotAllowedException, { NOT_ALLOWED_ERR: 1 }); OperationNotAllowedException.prototype = Error.prototype; return OperationNotAllowedException; }()), ImageError: (function() { var namecodes = { WRONG_FORMAT: 1, MAX_RESOLUTION_ERR: 2 }; function ImageError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": ImageError " + this.code; } Basic.extend(ImageError, namecodes); ImageError.prototype = Error.prototype; return ImageError; }()), FileException: (function() { var namecodes = { NOT_FOUND_ERR: 1, SECURITY_ERR: 2, ABORT_ERR: 3, NOT_READABLE_ERR: 4, ENCODING_ERR: 5, NO_MODIFICATION_ALLOWED_ERR: 6, INVALID_STATE_ERR: 7, SYNTAX_ERR: 8 }; function FileException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": FileException " + this.code; } Basic.extend(FileException, namecodes); FileException.prototype = Error.prototype; return FileException; }()), DOMException: (function() { var namecodes = { INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, WRONG_DOCUMENT_ERR: 4, INVALID_CHARACTER_ERR: 5, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, INUSE_ATTRIBUTE_ERR: 10, INVALID_STATE_ERR: 11, SYNTAX_ERR: 12, INVALID_MODIFICATION_ERR: 13, NAMESPACE_ERR: 14, INVALID_ACCESS_ERR: 15, VALIDATION_ERR: 16, TYPE_MISMATCH_ERR: 17, SECURITY_ERR: 18, NETWORK_ERR: 19, ABORT_ERR: 20, URL_MISMATCH_ERR: 21, QUOTA_EXCEEDED_ERR: 22, TIMEOUT_ERR: 23, INVALID_NODE_TYPE_ERR: 24, DATA_CLONE_ERR: 25 }; function DOMException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": DOMException " + this.code; } Basic.extend(DOMException, namecodes); DOMException.prototype = Error.prototype; return DOMException; }()), EventException: (function() { function EventException(code) { this.code = code; this.name = 'EventException'; } Basic.extend(EventException, { UNSPECIFIED_EVENT_TYPE_ERR: 0 }); EventException.prototype = Error.prototype; return EventException; }()) }; }); // Included from: src/javascript/core/EventTarget.js /** * EventTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/EventTarget', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic' ], function(x, Basic) { /** Parent object for all event dispatching components and objects @class EventTarget @constructor EventTarget */ function EventTarget() { // hash of event listeners by object uid var eventpool = {}; Basic.extend(this, { /** Unique id of the event dispatcher, usually overriden by children @property uid @type String */ uid: null, /** Can be called from within a child in order to acquire uniqie id in automated manner @method init */ init: function() { if (!this.uid) { this.uid = Basic.guid('uid_'); } }, /** Register a handler to a specific event dispatched by the object @method addEventListener @param {String} type Type or basically a name of the event to subscribe to @param {Function} fn Callback function that will be called when event happens @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first @param {Object} [scope=this] A scope to invoke event handler in */ addEventListener: function(type, fn, priority, scope) { var self = this, list; type = Basic.trim(type); if (/\s/.test(type)) { // multiple event types were passed for one handler Basic.each(type.split(/\s+/), function(type) { self.addEventListener(type, fn, priority, scope); }); return; } type = type.toLowerCase(); priority = parseInt(priority, 10) || 0; list = eventpool[this.uid] && eventpool[this.uid][type] || []; list.push({fn : fn, priority : priority, scope : scope || this}); if (!eventpool[this.uid]) { eventpool[this.uid] = {}; } eventpool[this.uid][type] = list; }, /** Check if any handlers were registered to the specified event @method hasEventListener @param {String} type Type or basically a name of the event to check @return {Mixed} Returns a handler if it was found and false, if - not */ hasEventListener: function(type) { return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid]; }, /** Unregister the handler from the event, or if former was not specified - unregister all handlers @method removeEventListener @param {String} type Type or basically a name of the event @param {Function} [fn] Handler to unregister */ removeEventListener: function(type, fn) { type = type.toLowerCase(); var list = eventpool[this.uid] && eventpool[this.uid][type], i; if (list) { if (fn) { for (i = list.length - 1; i >= 0; i--) { if (list[i].fn === fn) { list.splice(i, 1); break; } } } else { list = []; } // delete event list if it has become empty if (!list.length) { delete eventpool[this.uid][type]; // and object specific entry in a hash if it has no more listeners attached if (Basic.isEmptyObj(eventpool[this.uid])) { delete eventpool[this.uid]; } } } }, /** Remove all event handlers from the object @method removeAllEventListeners */ removeAllEventListeners: function() { if (eventpool[this.uid]) { delete eventpool[this.uid]; } }, /** Dispatch the event @method dispatchEvent @param {String/Object} Type of event or event object to dispatch @param {Mixed} [...] Variable number of arguments to be passed to a handlers @return {Boolean} true by default and false if any handler returned false */ dispatchEvent: function(type) { var uid, list, args, tmpEvt, evt = {}, result = true, undef; if (Basic.typeOf(type) !== 'string') { // we can't use original object directly (because of Silverlight) tmpEvt = type; if (Basic.typeOf(tmpEvt.type) === 'string') { type = tmpEvt.type; if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event evt.total = tmpEvt.total; evt.loaded = tmpEvt.loaded; } evt.async = tmpEvt.async || false; } else { throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); } } // check if event is meant to be dispatched on an object having specific uid if (type.indexOf('::') !== -1) { (function(arr) { uid = arr[0]; type = arr[1]; }(type.split('::'))); } else { uid = this.uid; } type = type.toLowerCase(); list = eventpool[uid] && eventpool[uid][type]; if (list) { // sort event list by prority list.sort(function(a, b) { return b.priority - a.priority; }); args = [].slice.call(arguments); // first argument will be pseudo-event object args.shift(); evt.type = type; args.unshift(evt); // Dispatch event to all listeners var queue = []; Basic.each(list, function(handler) { // explicitly set the target, otherwise events fired from shims do not get it args[0].target = handler.scope; // if event is marked as async, detach the handler if (evt.async) { queue.push(function(cb) { setTimeout(function() { cb(handler.fn.apply(handler.scope, args) === false); }, 1); }); } else { queue.push(function(cb) { cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation }); } }); if (queue.length) { Basic.inSeries(queue, function(err) { result = !err; }); } } return result; }, /** Alias for addEventListener @method bind @protected */ bind: function() { this.addEventListener.apply(this, arguments); }, /** Alias for removeEventListener @method unbind @protected */ unbind: function() { this.removeEventListener.apply(this, arguments); }, /** Alias for removeAllEventListeners @method unbindAll @protected */ unbindAll: function() { this.removeAllEventListeners.apply(this, arguments); }, /** Alias for dispatchEvent @method trigger @protected */ trigger: function() { return this.dispatchEvent.apply(this, arguments); }, /** Converts properties of on[event] type to corresponding event handlers, is used to avoid extra hassle around the process of calling them back @method convertEventPropsToHandlers @private */ convertEventPropsToHandlers: function(handlers) { var h; if (Basic.typeOf(handlers) !== 'array') { handlers = [handlers]; } for (var i = 0; i < handlers.length; i++) { h = 'on' + handlers[i]; if (Basic.typeOf(this[h]) === 'function') { this.addEventListener(handlers[i], this[h]); } else if (Basic.typeOf(this[h]) === 'undefined') { this[h] = null; // object must have defined event properties, even if it doesn't make use of them } } } }); } EventTarget.instance = new EventTarget(); return EventTarget; }); // Included from: src/javascript/core/utils/Encode.js /** * Encode.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Encode', [], function() { /** Encode string with UTF-8 @method utf8_encode @for Utils @static @param {String} str String to encode @return {String} UTF-8 encoded string */ var utf8_encode = function(str) { return unescape(encodeURIComponent(str)); }; /** Decode UTF-8 encoded string @method utf8_decode @static @param {String} str String to decode @return {String} Decoded string */ var utf8_decode = function(str_data) { return decodeURIComponent(escape(str_data)); }; /** Decode Base64 encoded string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js @method atob @static @param {String} data String to decode @return {String} Decoded string */ var atob = function(data, utf8) { if (typeof(window.atob) === 'function') { return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Thunder.m // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Onno Marsman // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); // * returns 1: 'Kevin van Zonneveld' // mozilla has this native // - but breaks in 2.0.0.12! //if (typeof this.window.atob == 'function') { // return atob(data); //} var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = []; if (!data) { return data; } data += ''; do { // unpack four hexets into three octets using index points in b64 h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits >> 16 & 0xff; o2 = bits >> 8 & 0xff; o3 = bits & 0xff; if (h3 == 64) { tmp_arr[ac++] = String.fromCharCode(o1); } else if (h4 == 64) { tmp_arr[ac++] = String.fromCharCode(o1, o2); } else { tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); } } while (i < data.length); dec = tmp_arr.join(''); return utf8 ? utf8_decode(dec) : dec; }; /** Base64 encode string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js @method btoa @static @param {String} data String to encode @return {String} Base64 encoded string */ var btoa = function(data, utf8) { if (utf8) { utf8_encode(data); } if (typeof(window.btoa) === 'function') { return window.btoa(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Bayron Guevara // + improved by: Thunder.m // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Rafał Kukawski (http://kukawski.pl) // * example 1: base64_encode('Kevin van Zonneveld'); // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' // mozilla has this native // - but breaks in 2.0.0.12! var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); var r = data.length % 3; return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); }; return { utf8_encode: utf8_encode, utf8_decode: utf8_decode, atob: atob, btoa: btoa }; }); // Included from: src/javascript/runtime/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/Runtime', [ "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/EventTarget" ], function(Basic, Dom, EventTarget) { var runtimeConstructors = {}, runtimes = {}; /** Common set of methods and properties for every runtime instance @class Runtime @param {Object} options @param {String} type Sanitized name of the runtime @param {Object} [caps] Set of capabilities that differentiate specified runtime @param {Object} [modeCaps] Set of capabilities that do require specific operational mode @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested */ function Runtime(options, type, caps, modeCaps, preferredMode) { /** Dispatched when runtime is initialized and ready. Results in RuntimeInit on a connected component. @event Init */ /** Dispatched when runtime fails to initialize. Results in RuntimeError on a connected component. @event Error */ var self = this , _shim , _uid = Basic.guid(type + '_') , defaultMode = preferredMode || 'browser' ; options = options || {}; // register runtime in private hash runtimes[_uid] = this; /** Default set of capabilities, which can be redifined later by specific runtime @private @property caps @type Object */ caps = Basic.extend({ // Runtime can: // provide access to raw binary data of the file access_binary: false, // provide access to raw binary data of the image (image extension is optional) access_image_binary: false, // display binary data as thumbs for example display_media: false, // make cross-domain requests do_cors: false, // accept files dragged and dropped from the desktop drag_and_drop: false, // filter files in selection dialog by their extensions filter_by_extension: true, // resize image (and manipulate it raw data of any file in general) resize_image: false, // periodically report how many bytes of total in the file were uploaded (loaded) report_upload_progress: false, // provide access to the headers of http response return_response_headers: false, // support response of specific type, which should be passed as an argument // e.g. runtime.can('return_response_type', 'blob') return_response_type: false, // return http status code of the response return_status_code: true, // send custom http header with the request send_custom_headers: false, // pick up the files from a dialog select_file: false, // select whole folder in file browse dialog select_folder: false, // select multiple files at once in file browse dialog select_multiple: true, // send raw binary data, that is generated after image resizing or manipulation of other kind send_binary_string: false, // send cookies with http request and therefore retain session send_browser_cookies: true, // send data formatted as multipart/form-data send_multipart: true, // slice the file or blob to smaller parts slice_blob: false, // upload file without preloading it to memory, stream it out directly from disk stream_upload: false, // programmatically trigger file browse dialog summon_file_dialog: false, // upload file of specific size, size should be passed as argument // e.g. runtime.can('upload_filesize', '500mb') upload_filesize: true, // initiate http request with specific http method, method should be passed as argument // e.g. runtime.can('use_http_method', 'put') use_http_method: true }, caps); // default to the mode that is compatible with preferred caps if (options.preferred_caps) { defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); } // small extension factory here (is meant to be extended with actual extensions constructors) _shim = (function() { var objpool = {}; return { exec: function(uid, comp, fn, args) { if (_shim[comp]) { if (!objpool[uid]) { objpool[uid] = { context: this, instance: new _shim[comp]() }; } if (objpool[uid].instance[fn]) { return objpool[uid].instance[fn].apply(this, args); } } }, removeInstance: function(uid) { delete objpool[uid]; }, removeAllInstances: function() { var self = this; Basic.each(objpool, function(obj, uid) { if (Basic.typeOf(obj.instance.destroy) === 'function') { obj.instance.destroy.call(obj.context); } self.removeInstance(uid); }); } }; }()); // public methods Basic.extend(this, { /** Specifies whether runtime instance was initialized or not @property initialized @type {Boolean} @default false */ initialized: false, // shims require this flag to stop initialization retries /** Unique ID of the runtime @property uid @type {String} */ uid: _uid, /** Runtime type (e.g. flash, html5, etc) @property type @type {String} */ type: type, /** Runtime (not native one) may operate in browser or client mode. @property mode @private @type {String|Boolean} current mode or false, if none possible */ mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), /** id of the DOM container for the runtime (if available) @property shimid @type {String} */ shimid: _uid + '_container', /** Number of connected clients. If equal to zero, runtime can be destroyed @property clients @type {Number} */ clients: 0, /** Runtime initialization options @property options @type {Object} */ options: options, /** Checks if the runtime has specific capability @method can @param {String} cap Name of capability to check @param {Mixed} [value] If passed, capability should somehow correlate to the value @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) @return {Boolean} true if runtime has such capability and false, if - not */ can: function(cap, value) { var refCaps = arguments[2] || caps; // if cap var is a comma-separated list of caps, convert it to object (key/value) if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { cap = Runtime.parseCaps(cap); } if (Basic.typeOf(cap) === 'object') { for (var key in cap) { if (!this.can(key, cap[key], refCaps)) { return false; } } return true; } // check the individual cap if (Basic.typeOf(refCaps[cap]) === 'function') { return refCaps[cap].call(this, value); } else { return (value === refCaps[cap]); } }, /** Returns container for the runtime as DOM element @method getShimContainer @return {DOMElement} */ getShimContainer: function() { var container, shimContainer = Dom.get(this.shimid); // if no container for shim, create one if (!shimContainer) { container = this.options.container ? Dom.get(this.options.container) : document.body; // create shim container and insert it at an absolute position into the outer container shimContainer = document.createElement('div'); shimContainer.id = this.shimid; shimContainer.className = 'moxie-shim moxie-shim-' + this.type; Basic.extend(shimContainer.style, { position: 'absolute', top: '0px', left: '0px', width: '1px', height: '1px', overflow: 'hidden' }); container.appendChild(shimContainer); container = null; } return shimContainer; }, /** Returns runtime as DOM element (if appropriate) @method getShim @return {DOMElement} */ getShim: function() { return _shim; }, /** Invokes a method within the runtime itself (might differ across the runtimes) @method shimExec @param {Mixed} [] @protected @return {Mixed} Depends on the action and component */ shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return self.getShim().exec.call(this, this.uid, component, action, args); }, /** Operaional interface that is used by components to invoke specific actions on the runtime (is invoked in the scope of component) @method exec @param {Mixed} []* @protected @return {Mixed} Depends on the action and component */ exec: function(component, action) { // this is called in the context of component, not runtime var args = [].slice.call(arguments, 2); if (self[component] && self[component][action]) { return self[component][action].apply(this, args); } return self.shimExec.apply(this, arguments); }, /** Destroys the runtime (removes all events and deletes DOM structures) @method destroy */ destroy: function() { if (!self) { return; // obviously already destroyed } var shimContainer = Dom.get(this.shimid); if (shimContainer) { shimContainer.parentNode.removeChild(shimContainer); } if (_shim) { _shim.removeAllInstances(); } this.unbindAll(); delete runtimes[this.uid]; this.uid = null; // mark this runtime as destroyed _uid = self = _shim = shimContainer = null; } }); // once we got the mode, test against all caps if (this.mode && options.required_caps && !this.can(options.required_caps)) { this.mode = false; } } /** Default order to try different runtime types @property order @type String @static */ Runtime.order = 'html5,flash,silverlight,html4'; /** Retrieves runtime from private hash by it's uid @method getRuntime @private @static @param {String} uid Unique identifier of the runtime @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not */ Runtime.getRuntime = function(uid) { return runtimes[uid] ? runtimes[uid] : false; }; /** Register constructor for the Runtime of new (or perhaps modified) type @method addConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {Function} construct Constructor for the Runtime type */ Runtime.addConstructor = function(type, constructor) { constructor.prototype = EventTarget.instance; runtimeConstructors[type] = constructor; }; /** Get the constructor for the specified type. method getConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @return {Function} Constructor for the Runtime type */ Runtime.getConstructor = function(type) { return runtimeConstructors[type] || null; }; /** Get info about the runtime (uid, type, capabilities) @method getInfo @static @param {String} uid Unique identifier of the runtime @return {Mixed} Info object or null if runtime doesn't exist */ Runtime.getInfo = function(uid) { var runtime = Runtime.getRuntime(uid); if (runtime) { return { uid: runtime.uid, type: runtime.type, mode: runtime.mode, can: function() { return runtime.can.apply(runtime, arguments); } }; } return null; }; /** Convert caps represented by a comma-separated string to the object representation. @method parseCaps @static @param {String} capStr Comma-separated list of capabilities @return {Object} */ Runtime.parseCaps = function(capStr) { var capObj = {}; if (Basic.typeOf(capStr) !== 'string') { return capStr || {}; } Basic.each(capStr.split(','), function(key) { capObj[key] = true; // we assume it to be - true }); return capObj; }; /** Test the specified runtime for specific capabilities. @method can @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {String|Object} caps Set of capabilities to check @return {Boolean} Result of the test */ Runtime.can = function(type, caps) { var runtime , constructor = Runtime.getConstructor(type) , mode ; if (constructor) { runtime = new constructor({ required_caps: caps }); mode = runtime.mode; runtime.destroy(); return !!mode; } return false; }; /** Figure out a runtime that supports specified capabilities. @method thatCan @static @param {String|Object} caps Set of capabilities to check @param {String} [runtimeOrder] Comma-separated list of runtimes to check against @return {String} Usable runtime identifier or null */ Runtime.thatCan = function(caps, runtimeOrder) { var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); for (var i in types) { if (Runtime.can(types[i], caps)) { return types[i]; } } return null; }; /** Figure out an operational mode for the specified set of capabilities. @method getMode @static @param {Object} modeCaps Set of capabilities that depend on particular runtime mode @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for @param {String|Boolean} [defaultMode='browser'] Default mode to use @return {String|Boolean} Compatible operational mode */ Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { var mode = null; if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified defaultMode = 'browser'; } if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { // loop over required caps and check if they do require the same mode Basic.each(requiredCaps, function(value, cap) { if (modeCaps.hasOwnProperty(cap)) { var capMode = modeCaps[cap](value); // make sure we always have an array if (typeof(capMode) === 'string') { capMode = [capMode]; } if (!mode) { mode = capMode; } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { // if cap requires conflicting mode - runtime cannot fulfill required caps return (mode = false); } } }); if (mode) { return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; } else if (mode === false) { return false; } } return defaultMode; }; /** Capability check that always returns true @private @static @return {True} */ Runtime.capTrue = function() { return true; }; /** Capability check that always returns false @private @static @return {False} */ Runtime.capFalse = function() { return false; }; /** Evaluate the expression to boolean value and create a function that always returns it. @private @static @param {Mixed} expr Expression to evaluate @return {Function} Function returning the result of evaluation */ Runtime.capTest = function(expr) { return function() { return !!expr; }; }; return Runtime; }); // Included from: src/javascript/runtime/RuntimeClient.js /** * RuntimeClient.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeClient', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic', 'moxie/runtime/Runtime' ], function(x, Basic, Runtime) { /** Set of methods and properties, required by a component to acquire ability to connect to a runtime @class RuntimeClient */ return function RuntimeClient() { var runtime; Basic.extend(this, { /** Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. Increments number of clients connected to the specified runtime. @method connectRuntime @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites */ connectRuntime: function(options) { var comp = this, ruid; function initialize(items) { var type, constructor; // if we ran out of runtimes if (!items.length) { comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); runtime = null; return; } type = items.shift(); constructor = Runtime.getConstructor(type); if (!constructor) { initialize(items); return; } // try initializing the runtime runtime = new constructor(options); runtime.bind('Init', function() { // mark runtime as initialized runtime.initialized = true; // jailbreak ... setTimeout(function() { runtime.clients++; // this will be triggered on component comp.trigger('RuntimeInit', runtime); }, 1); }); runtime.bind('Error', function() { runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here initialize(items); }); /*runtime.bind('Exception', function() { });*/ // check if runtime managed to pick-up operational mode if (!runtime.mode) { runtime.trigger('Error'); return; } runtime.init(); } // check if a particular runtime was requested if (Basic.typeOf(options) === 'string') { ruid = options; } else if (Basic.typeOf(options.ruid) === 'string') { ruid = options.ruid; } if (ruid) { runtime = Runtime.getRuntime(ruid); if (runtime) { runtime.clients++; return runtime; } else { // there should be a runtime and there's none - weird case throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); } } // initialize a fresh one, that fits runtime list and required features best initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); }, /** Returns the runtime to which the client is currently connected. @method getRuntime @return {Runtime} Runtime or null if client is not connected */ getRuntime: function() { if (runtime && runtime.uid) { return runtime; } runtime = null; // make sure we do not leave zombies rambling around return null; }, /** Disconnects from the runtime. Decrements number of clients connected to the specified runtime. @method disconnectRuntime */ disconnectRuntime: function() { if (runtime && --runtime.clients <= 0) { runtime.destroy(); runtime = null; } } }); }; }); // Included from: src/javascript/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/Blob', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/runtime/RuntimeClient' ], function(Basic, Encode, RuntimeClient) { var blobpool = {}; /** @class Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} blob Object "Native" blob object, as it is represented in the runtime */ function Blob(ruid, blob) { function _sliceDetached(start, end, type) { var blob, data = blobpool[this.uid]; if (Basic.typeOf(data) !== 'string' || !data.length) { return null; // or throw exception } blob = new Blob(null, { type: type, size: end - start }); blob.detach(data.substr(start, blob.size)); return blob; } RuntimeClient.call(this); if (ruid) { this.connectRuntime(ruid); } if (!blob) { blob = {}; } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string blob = { data: blob }; } Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: blob.uid || Basic.guid('uid_'), /** Unique id of the connected runtime, if falsy, then runtime will have to be initialized before this Blob can be used, modified or sent @property ruid @type {String} */ ruid: ruid, /** Size of blob @property size @type {Number} @default 0 */ size: blob.size || 0, /** Mime type of blob @property type @type {String} @default '' */ type: blob.type || '', /** @method slice @param {Number} [start=0] */ slice: function(start, end, type) { if (this.isDetached()) { return _sliceDetached.apply(this, arguments); } return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); }, /** Returns "native" blob object (as it is represented in connected runtime) or null if not found @method getSource @return {Blob} Returns "native" blob object or null if not found */ getSource: function() { if (!blobpool[this.uid]) { return null; } return blobpool[this.uid]; }, /** Detaches blob from any runtime that it depends on and initialize with standalone value @method detach @protected @param {DOMString} [data=''] Standalone value */ detach: function(data) { if (this.ruid) { this.getRuntime().exec.call(this, 'Blob', 'destroy'); this.disconnectRuntime(); this.ruid = null; } data = data || ''; // if dataUrl, convert to binary string var matches = data.match(/^data:([^;]*);base64,/); if (matches) { this.type = matches[1]; data = Encode.atob(data.substring(data.indexOf('base64,') + 7)); } this.size = data.length; blobpool[this.uid] = data; }, /** Checks if blob is standalone (detached of any runtime) @method isDetached @protected @return {Boolean} */ isDetached: function() { return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; }, /** Destroy Blob and free any resources it was using @method destroy */ destroy: function() { this.detach(); delete blobpool[this.uid]; } }); if (blob.data) { this.detach(blob.data); // auto-detach if payload has been passed } else { blobpool[this.uid] = blob; } } return Blob; }); // Included from: src/javascript/file/File.js /** * File.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/File', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/file/Blob' ], function(Basic, Mime, Blob) { /** @class File @extends Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} file Object "Native" file object, as it is represented in the runtime */ function File(ruid, file) { var name, type; if (!file) { // avoid extra errors in case we overlooked something file = {}; } // figure out the type if (file.type && file.type !== '') { type = file.type; } else { type = Mime.getFileMime(file.name); } // sanitize file name or generate new one if (file.name) { name = file.name.replace(/\\/g, '/'); name = name.substr(name.lastIndexOf('/') + 1); } else { var prefix = type.split('/')[0]; name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); if (Mime.extensions[type]) { name += '.' + Mime.extensions[type][0]; // append proper extension if possible } } Blob.apply(this, arguments); Basic.extend(this, { /** File mime type @property type @type {String} @default '' */ type: type || '', /** File name @property name @type {String} @default UID */ name: name || Basic.guid('file_'), /** Relative path to the file inside a directory @property relativePath @type {String} @default '' */ relativePath: '', /** Date of last modification @property lastModifiedDate @type {String} @default now */ lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) }); } File.prototype = Blob.prototype; return File; }); // Included from: src/javascript/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileInput', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/core/utils/Dom', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/core/I18n', 'moxie/file/File', 'moxie/runtime/Runtime', 'moxie/runtime/RuntimeClient' ], function(Basic, Mime, Dom, x, EventTarget, I18n, File, Runtime, RuntimeClient) { /** Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through _XMLHttpRequest_. @class FileInput @constructor @extends EventTarget @uses RuntimeClient @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. @param {Array} [options.accept] Array of mime types to accept. By default accepts all. @param {String} [options.file='file'] Name of the file field (not the filename). @param {Boolean} [options.multiple=false] Enable selection of multiple files. @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode for _browse\_button_. @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. @example <div id="container"> <a id="file-picker" href="javascript:;">Browse...</a> </div> <script> var fileInput = new mOxie.FileInput({ browse_button: 'file-picker', // or document.getElementById('file-picker') container: 'container', accept: [ {title: "Image files", extensions: "jpg,gif,png"} // accept only images ], multiple: true // allow multiple file selection }); fileInput.onchange = function(e) { // do something to files array console.info(e.target.files); // or this.files or fileInput.files }; fileInput.init(); // initialize </script> */ var dispatches = [ /** Dispatched when runtime is connected and file-picker is ready to be used. @event ready @param {Object} event */ 'ready', /** Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. Check [corresponding documentation entry](#method_refresh) for more info. @event refresh @param {Object} event */ /** Dispatched when selection of files in the dialog is complete. @event change @param {Object} event */ 'change', 'cancel', // TODO: might be useful /** Dispatched when mouse cursor enters file-picker area. Can be used to style element accordingly. @event mouseenter @param {Object} event */ 'mouseenter', /** Dispatched when mouse cursor leaves file-picker area. Can be used to style element accordingly. @event mouseleave @param {Object} event */ 'mouseleave', /** Dispatched when functional mouse button is pressed on top of file-picker area. @event mousedown @param {Object} event */ 'mousedown', /** Dispatched when functional mouse button is released on top of file-picker area. @event mouseup @param {Object} event */ 'mouseup' ]; function FileInput(options) { var self = this, container, browseButton, defaults; // if flat argument passed it should be browse_button id if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { options = { browse_button : options }; } // this will help us to find proper default container browseButton = Dom.get(options.browse_button); if (!browseButton) { // browse button is required throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } // figure out the options defaults = { accept: [{ title: I18n.translate('All Files'), extensions: '*' }], name: 'file', multiple: false, required_caps: false, container: browseButton.parentNode || document.body }; options = Basic.extend({}, defaults, options); // convert to object representation if (typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } // normalize accept option (could be list of mime types or array of title/extensions pairs) if (typeof(options.accept) === 'string') { options.accept = Mime.mimes2extList(options.accept); } container = Dom.get(options.container); // make sure we have container if (!container) { container = document.body; } // make container relative, if it's not if (Dom.getStyle(container, 'position') === 'static') { container.style.position = 'relative'; } container = browseButton = null; // IE RuntimeClient.call(self); Basic.extend(self, { /** Unique id of the component @property uid @protected @readOnly @type {String} @default UID */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @protected @type {String} */ ruid: null, /** Unique id of the runtime container. Useful to get hold of it for various manipulations. @property shimid @protected @type {String} */ shimid: null, /** Array of selected mOxie.File objects @property files @type {Array} @default null */ files: null, /** Initializes the file-picker, connects it to runtime and dispatches event ready when done. @method init */ init: function() { self.convertEventPropsToHandlers(dispatches); self.bind('RuntimeInit', function(e, runtime) { self.ruid = runtime.uid; self.shimid = runtime.shimid; self.bind("Ready", function() { self.trigger("Refresh"); }, 999); self.bind("Change", function() { var files = runtime.exec.call(self, 'FileInput', 'getFiles'); self.files = []; Basic.each(files, function(file) { // ignore empty files (IE10 for example hangs if you try to send them via XHR) if (file.size === 0) { return true; } self.files.push(new File(self.ruid, file)); }); }, 999); // re-position and resize shim container self.bind('Refresh', function() { var pos, size, browseButton, shimContainer; browseButton = Dom.get(options.browse_button); shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist if (browseButton) { pos = Dom.getPos(browseButton, Dom.get(options.container)); size = Dom.getSize(browseButton); if (shimContainer) { Basic.extend(shimContainer.style, { top : pos.y + 'px', left : pos.x + 'px', width : size.w + 'px', height : size.h + 'px' }); } } shimContainer = browseButton = null; }); runtime.exec.call(self, 'FileInput', 'init', options); }); // runtime needs: options.required_features, options.runtime_order and options.container self.connectRuntime(Basic.extend({}, options, { required_caps: { select_file: true } })); }, /** Disables file-picker element, so that it doesn't react to mouse clicks. @method disable @param {Boolean} [state=true] Disable component if - true, enable if - false */ disable: function(state) { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); } }, /** Reposition and resize dialog trigger to match the position and size of browse_button element. @method refresh */ refresh: function() { self.trigger("Refresh"); }, /** Destroy component. @method destroy */ destroy: function() { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'destroy'); this.disconnectRuntime(); } if (Basic.typeOf(this.files) === 'array') { // no sense in leaving associated files behind Basic.each(this.files, function(file) { file.destroy(); }); } this.files = null; } }); } FileInput.prototype = EventTarget.instance; return FileInput; }); // Included from: src/javascript/runtime/RuntimeTarget.js /** * RuntimeTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeTarget', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', "moxie/core/EventTarget" ], function(Basic, RuntimeClient, EventTarget) { /** Instance of this class can be used as a target for the events dispatched by shims, when allowing them onto components is for either reason inappropriate @class RuntimeTarget @constructor @protected @extends EventTarget */ function RuntimeTarget() { this.uid = Basic.guid('uid_'); RuntimeClient.call(this); this.destroy = function() { this.disconnectRuntime(); this.unbindAll(); }; } RuntimeTarget.prototype = EventTarget.instance; return RuntimeTarget; }); // Included from: src/javascript/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReader', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/file/Blob', 'moxie/file/File', 'moxie/runtime/RuntimeTarget' ], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) { /** Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) interface. Where possible uses native FileReader, where - not falls back to shims. @class FileReader @constructor FileReader @extends EventTarget @uses RuntimeClient */ var dispatches = [ /** Dispatched when the read starts. @event loadstart @param {Object} event */ 'loadstart', /** Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). @event progress @param {Object} event */ 'progress', /** Dispatched when the read has successfully completed. @event load @param {Object} event */ 'load', /** Dispatched when the read has been aborted. For instance, by invoking the abort() method. @event abort @param {Object} event */ 'abort', /** Dispatched when the read has failed. @event error @param {Object} event */ 'error', /** Dispatched when the request has completed (either in success or failure). @event loadend @param {Object} event */ 'loadend' ]; function FileReader() { var self = this, _fr; Basic.extend(this, { /** UID of the component instance. @property uid @type {String} */ uid: Basic.guid('uid_'), /** Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING and FileReader.DONE. @property readyState @type {Number} @default FileReader.EMPTY */ readyState: FileReader.EMPTY, /** Result of the successful read operation. @property result @type {String} */ result: null, /** Stores the error of failed asynchronous read operation. @property error @type {DOMError} */ error: null, /** Initiates reading of File/Blob object contents to binary string. @method readAsBinaryString @param {Blob|File} blob Object to preload */ readAsBinaryString: function(blob) { _read.call(this, 'readAsBinaryString', blob); }, /** Initiates reading of File/Blob object contents to dataURL string. @method readAsDataURL @param {Blob|File} blob Object to preload */ readAsDataURL: function(blob) { _read.call(this, 'readAsDataURL', blob); }, /** Initiates reading of File/Blob object contents to string. @method readAsText @param {Blob|File} blob Object to preload */ readAsText: function(blob) { _read.call(this, 'readAsText', blob); }, /** Aborts preloading process. @method abort */ abort: function() { this.result = null; if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { return; } else if (this.readyState === FileReader.LOADING) { this.readyState = FileReader.DONE; } if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'abort'); } this.trigger('abort'); this.trigger('loadend'); }, /** Destroy component and release resources. @method destroy */ destroy: function() { this.abort(); if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'destroy'); _fr.disconnectRuntime(); } self = _fr = null; } }); function _read(op, blob) { _fr = new RuntimeTarget(); function error(err) { self.readyState = FileReader.DONE; self.error = err; self.trigger('error'); loadEnd(); } function loadEnd() { _fr.destroy(); _fr = null; self.trigger('loadend'); } function exec(runtime) { _fr.bind('Error', function(e, err) { error(err); }); _fr.bind('Progress', function(e) { self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); }); _fr.bind('Load', function(e) { self.readyState = FileReader.DONE; self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); loadEnd(); }); runtime.exec.call(_fr, 'FileReader', 'read', op, blob); } this.convertEventPropsToHandlers(dispatches); if (this.readyState === FileReader.LOADING) { return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR)); } this.readyState = FileReader.LOADING; this.trigger('loadstart'); // if source is o.Blob/o.File if (blob instanceof Blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsText': case 'readAsBinaryString': this.result = src; break; case 'readAsDataURL': this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); break; } this.readyState = FileReader.DONE; this.trigger('load'); loadEnd(); } else { exec(_fr.connectRuntime(blob.ruid)); } } else { error(new x.DOMException(x.DOMException.NOT_FOUND_ERR)); } } } /** Initial FileReader state @property EMPTY @type {Number} @final @static @default 0 */ FileReader.EMPTY = 0; /** FileReader switches to this state when it is preloading the source @property LOADING @type {Number} @final @static @default 1 */ FileReader.LOADING = 1; /** Preloading is complete, this is a final state @property DONE @type {Number} @final @static @default 2 */ FileReader.DONE = 2; FileReader.prototype = EventTarget.instance; return FileReader; }); // Included from: src/javascript/core/utils/Url.js /** * Url.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Url', [], function() { /** Parse url into separate components and fill in absent parts with parts from current url, based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js @method parseUrl @for Utils @static @param {String} url Url to parse (defaults to empty string if undefined) @return {Object} Hash containing extracted uri components */ var parseUrl = function(url, currentUrl) { var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] , i = key.length , ports = { http: 80, https: 443 } , uri = {} , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ , m = regex.exec(url || '') ; while (i--) { if (m[i]) { uri[key[i]] = m[i]; } } // when url is relative, we set the origin and the path ourselves if (!uri.scheme) { // come up with defaults if (!currentUrl || typeof(currentUrl) === 'string') { currentUrl = parseUrl(currentUrl || document.location.href); } uri.scheme = currentUrl.scheme; uri.host = currentUrl.host; uri.port = currentUrl.port; var path = ''; // for urls without trailing slash we need to figure out the path if (/^[^\/]/.test(uri.path)) { path = currentUrl.path; // if path ends with a filename, strip it if (!/(\/|\/[^\.]+)$/.test(path)) { path = path.replace(/\/[^\/]+$/, '/'); } else { path += '/'; } } uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir } if (!uri.port) { uri.port = ports[uri.scheme] || 80; } uri.port = parseInt(uri.port, 10); if (!uri.path) { uri.path = "/"; } delete uri.source; return uri; }; /** Resolve url - among other things will turn relative url to absolute @method resolveUrl @static @param {String} url Either absolute or relative @return {String} Resolved, absolute url */ var resolveUrl = function(url) { var ports = { // we ignore default ports http: 80, https: 443 } , urlp = parseUrl(url) ; return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); }; /** Check if specified url has the same origin as the current document @method hasSameOrigin @param {String|Object} url @return {Boolean} */ var hasSameOrigin = function(url) { function origin(url) { return [url.scheme, url.host, url.port].join('/'); } if (typeof url === 'string') { url = parseUrl(url); } return origin(parseUrl()) === origin(url); }; return { parseUrl: parseUrl, resolveUrl: resolveUrl, hasSameOrigin: hasSameOrigin }; }); // Included from: src/javascript/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReaderSync', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', 'moxie/core/utils/Encode' ], function(Basic, RuntimeClient, Encode) { /** Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, but probably < 1mb). Not meant to be used directly by user. @class FileReaderSync @private @constructor */ return function() { RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), readAsBinaryString: function(blob) { return _read.call(this, 'readAsBinaryString', blob); }, readAsDataURL: function(blob) { return _read.call(this, 'readAsDataURL', blob); }, /*readAsArrayBuffer: function(blob) { return _read.call(this, 'readAsArrayBuffer', blob); },*/ readAsText: function(blob) { return _read.call(this, 'readAsText', blob); } }); function _read(op, blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsBinaryString': return src; case 'readAsDataURL': return 'data:' + blob.type + ';base64,' + Encode.btoa(src); case 'readAsText': var txt = ''; for (var i = 0, length = src.length; i < length; i++) { txt += String.fromCharCode(src[i]); } return txt; } } else { var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); this.disconnectRuntime(); return result; } } }; }); // Included from: src/javascript/xhr/FormData.js /** * FormData.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/FormData", [ "moxie/core/Exceptions", "moxie/core/utils/Basic", "moxie/file/Blob" ], function(x, Basic, Blob) { /** FormData @class FormData @constructor */ function FormData() { var _blob, _fields = []; Basic.extend(this, { /** Append another key-value pair to the FormData object @method append @param {String} name Name for the new field @param {String|Blob|Array|Object} value Value for the field */ append: function(name, value) { var self = this, valueType = Basic.typeOf(value); // according to specs value might be either Blob or String if (value instanceof Blob) { _blob = { name: name, value: value // unfortunately we can only send single Blob in one FormData }; } else if ('array' === valueType) { name += '[]'; Basic.each(value, function(value) { self.append(name, value); }); } else if ('object' === valueType) { Basic.each(value, function(value, key) { self.append(name + '[' + key + ']', value); }); } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { self.append(name, "false"); } else { _fields.push({ name: name, value: value.toString() }); } }, /** Checks if FormData contains Blob. @method hasBlob @return {Boolean} */ hasBlob: function() { return !!this.getBlob(); }, /** Retrieves blob. @method getBlob @return {Object} Either Blob if found or null */ getBlob: function() { return _blob && _blob.value || null; }, /** Retrieves blob field name. @method getBlobName @return {String} Either Blob field name or null */ getBlobName: function() { return _blob && _blob.name || null; }, /** Loop over the fields in FormData and invoke the callback for each of them. @method each @param {Function} cb Callback to call for each field */ each: function(cb) { Basic.each(_fields, function(field) { cb(field.value, field.name); }); if (_blob) { cb(_blob.value, _blob.name); } }, destroy: function() { _blob = null; _fields = []; } }); } return FormData; }); // Included from: src/javascript/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/XMLHttpRequest", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/core/EventTarget", "moxie/core/utils/Encode", "moxie/core/utils/Url", "moxie/runtime/Runtime", "moxie/runtime/RuntimeTarget", "moxie/file/Blob", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/core/utils/Env", "moxie/core/utils/Mime" ], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { var httpCode = { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', 200: 'OK', 201: 'Created', 202: 'Accepted', 203: 'Non-Authoritative Information', 204: 'No Content', 205: 'Reset Content', 206: 'Partial Content', 207: 'Multi-Status', 226: 'IM Used', 300: 'Multiple Choices', 301: 'Moved Permanently', 302: 'Found', 303: 'See Other', 304: 'Not Modified', 305: 'Use Proxy', 306: 'Reserved', 307: 'Temporary Redirect', 400: 'Bad Request', 401: 'Unauthorized', 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable', 407: 'Proxy Authentication Required', 408: 'Request Timeout', 409: 'Conflict', 410: 'Gone', 411: 'Length Required', 412: 'Precondition Failed', 413: 'Request Entity Too Large', 414: 'Request-URI Too Long', 415: 'Unsupported Media Type', 416: 'Requested Range Not Satisfiable', 417: 'Expectation Failed', 422: 'Unprocessable Entity', 423: 'Locked', 424: 'Failed Dependency', 426: 'Upgrade Required', 500: 'Internal Server Error', 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', 506: 'Variant Also Negotiates', 507: 'Insufficient Storage', 510: 'Not Extended' }; function XMLHttpRequestUpload() { this.uid = Basic.guid('uid_'); } XMLHttpRequestUpload.prototype = EventTarget.instance; /** Implementation of XMLHttpRequest @class XMLHttpRequest @constructor @uses RuntimeClient @extends EventTarget */ var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons) var NATIVE = 1, RUNTIME = 2; function XMLHttpRequest() { var self = this, // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible props = { /** The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. @property timeout @type Number @default 0 */ timeout: 0, /** Current state, can take following values: UNSENT (numeric value 0) The object has been constructed. OPENED (numeric value 1) The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. HEADERS_RECEIVED (numeric value 2) All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. LOADING (numeric value 3) The response entity body is being received. DONE (numeric value 4) @property readyState @type Number @default 0 (UNSENT) */ readyState: XMLHttpRequest.UNSENT, /** True when user credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. @property withCredentials @type Boolean @default false */ withCredentials: false, /** Returns the HTTP status code. @property status @type Number @default 0 */ status: 0, /** Returns the HTTP status text. @property statusText @type String */ statusText: "", /** Returns the response type. Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". @property responseType @type String */ responseType: "", /** Returns the document response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "document". @property responseXML @type Document */ responseXML: null, /** Returns the text response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "text". @property responseText @type String */ responseText: null, /** Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). Can become: ArrayBuffer, Blob, Document, JSON, Text @property response @type Mixed */ response: null }, _async = true, _url, _method, _headers = {}, _user, _password, _encoding = null, _mimeType = null, // flags _sync_flag = false, _send_flag = false, _upload_events_flag = false, _upload_complete_flag = false, _error_flag = false, _same_origin_flag = false, // times _start_time, _timeoutset_time, _finalMime = null, _finalCharset = null, _options = {}, _xhr, _responseHeaders = '', _responseHeadersBag ; Basic.extend(this, props, { /** Unique id of the component @property uid @type String */ uid: Basic.guid('uid_'), /** Target for Upload events @property upload @type XMLHttpRequestUpload */ upload: new XMLHttpRequestUpload(), /** Sets the request method, request URL, synchronous flag, request username, and request password. Throws a "SyntaxError" exception if one of the following is true: method is not a valid HTTP method. url cannot be resolved. url contains the "user:password" format in the userinfo production. Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. Throws an "InvalidAccessError" exception if one of the following is true: Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. There is an associated XMLHttpRequest document and either the timeout attribute is not zero, the withCredentials attribute is true, or the responseType attribute is not the empty string. @method open @param {String} method HTTP method to use on request @param {String} url URL to request @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. @param {String} [user] Username to use in HTTP authentication process on server-side @param {String} [password] Password to use in HTTP authentication process on server-side */ open: function(method, url, async, user, password) { var urlp; // first two arguments are required if (!method || !url) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3 if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { _method = method.toUpperCase(); } // 4 - allowing these methods poses a security risk if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { throw new x.DOMException(x.DOMException.SECURITY_ERR); } // 5 url = Encode.utf8_encode(url); // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". urlp = Url.parseUrl(url); _same_origin_flag = Url.hasSameOrigin(urlp); // 7 - manually build up absolute url _url = Url.resolveUrl(url); // 9-10, 12-13 if ((user || password) && !_same_origin_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } _user = user || urlp.user; _password = password || urlp.pass; // 11 _async = async || true; if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 14 - terminate abort() // 15 - terminate send() // 18 _sync_flag = !_async; _send_flag = false; _headers = {}; _reset.call(this); // 19 _p('readyState', XMLHttpRequest.OPENED); // 20 this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers this.dispatchEvent('readystatechange'); }, /** Appends an header to the list of author request headers, or if header is already in the list of author request headers, combines its value with value. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value is not a valid HTTP header field value. @method setRequestHeader @param {String} header @param {String|Number} value */ setRequestHeader: function(header, value) { var uaHeaders = [ // these headers are controlled by the user agent "accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via" ]; // 1-2 if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 4 /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); }*/ header = Basic.trim(header).toLowerCase(); // setting of proxy-* and sec-* headers is prohibited by spec if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { return false; } // camelize // browsers lowercase header names (at least for custom ones) // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); if (!_headers[header]) { _headers[header] = value; } else { // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) _headers[header] += ', ' + value; } return true; }, /** Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. @method getAllResponseHeaders @return {String} reponse headers or empty string */ getAllResponseHeaders: function() { return _responseHeaders || ''; }, /** Returns the header field value from the response of which the field name matches header, unless the field name is Set-Cookie or Set-Cookie2. @method getResponseHeader @param {String} header @return {String} value(s) for the specified header or null */ getResponseHeader: function(header) { header = header.toLowerCase(); if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { return null; } if (_responseHeaders && _responseHeaders !== '') { // if we didn't parse response headers until now, do it and keep for later if (!_responseHeadersBag) { _responseHeadersBag = {}; Basic.each(_responseHeaders.split(/\r\n/), function(line) { var pair = line.split(/:\s+/); if (pair.length === 2) { // last line might be empty, omit pair[0] = Basic.trim(pair[0]); // just in case _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form header: pair[0], value: Basic.trim(pair[1]) }; } }); } if (_responseHeadersBag.hasOwnProperty(header)) { return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; } } return null; }, /** Sets the Content-Type header for the response to mime. Throws an "InvalidStateError" exception if the state is LOADING or DONE. Throws a "SyntaxError" exception if mime is not a valid media type. @method overrideMimeType @param String mime Mime type to set */ overrideMimeType: function(mime) { var matches, charset; // 1 if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 mime = Basic.trim(mime.toLowerCase()); if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { mime = matches[1]; if (matches[2]) { charset = matches[2]; } } if (!Mime.mimes[mime]) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3-4 _finalMime = mime; _finalCharset = charset; }, /** Initiates the request. The optional argument provides the request entity body. The argument is ignored if request method is GET or HEAD. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. @method send @param {Blob|Document|String|FormData} [data] Request entity body @param {Object} [options] Set of requirements and pre-requisities for runtime initialization */ send: function(data, options) { if (Basic.typeOf(options) === 'string') { _options = { ruid: options }; } else if (!options) { _options = {}; } else { _options = options; } this.convertEventPropsToHandlers(dispatches); this.upload.convertEventPropsToHandlers(dispatches); // 1-2 if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 // sending Blob if (data instanceof Blob) { _options.ruid = data.ruid; _mimeType = data.type || 'application/octet-stream'; } // FormData else if (data instanceof FormData) { if (data.hasBlob()) { var blob = data.getBlob(); _options.ruid = blob.ruid; _mimeType = blob.type || 'application/octet-stream'; } } // DOMString else if (typeof data === 'string') { _encoding = 'UTF-8'; _mimeType = 'text/plain;charset=UTF-8'; // data should be converted to Unicode and encoded as UTF-8 data = Encode.utf8_encode(data); } // if withCredentials not set, but requested, set it automatically if (!this.withCredentials) { this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; } // 4 - storage mutex // 5 _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP // 6 _error_flag = false; // 7 _upload_complete_flag = !data; // 8 - Asynchronous steps if (!_sync_flag) { // 8.1 _send_flag = true; // 8.2 // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr // 8.3 //if (!_upload_complete_flag) { // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr //} } // 8.5 - Return the send() method call, but continue running the steps in this algorithm. _doXHR.call(this, data); }, /** Cancels any network activity. @method abort */ abort: function() { _error_flag = true; _sync_flag = false; if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { _p('readyState', XMLHttpRequest.DONE); _send_flag = false; if (_xhr) { _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); } else { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _upload_complete_flag = true; } else { _p('readyState', XMLHttpRequest.UNSENT); } }, destroy: function() { if (_xhr) { if (Basic.typeOf(_xhr.destroy) === 'function') { _xhr.destroy(); } _xhr = null; } this.unbindAll(); if (this.upload) { this.upload.unbindAll(); this.upload = null; } } }); /* this is nice, but maybe too lengthy // if supported by JS version, set getters/setters for specific properties o.defineProperty(this, 'readyState', { configurable: false, get: function() { return _p('readyState'); } }); o.defineProperty(this, 'timeout', { configurable: false, get: function() { return _p('timeout'); }, set: function(value) { if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // timeout still should be measured relative to the start time of request _timeoutset_time = (new Date).getTime(); _p('timeout', value); } }); // the withCredentials attribute has no effect when fetching same-origin resources o.defineProperty(this, 'withCredentials', { configurable: false, get: function() { return _p('withCredentials'); }, set: function(value) { // 1-2 if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3-4 if (_anonymous_flag || _sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 5 _p('withCredentials', value); } }); o.defineProperty(this, 'status', { configurable: false, get: function() { return _p('status'); } }); o.defineProperty(this, 'statusText', { configurable: false, get: function() { return _p('statusText'); } }); o.defineProperty(this, 'responseType', { configurable: false, get: function() { return _p('responseType'); }, set: function(value) { // 1 if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 3 _p('responseType', value.toLowerCase()); } }); o.defineProperty(this, 'responseText', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'text'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseText'); } }); o.defineProperty(this, 'responseXML', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'document'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseXML'); } }); o.defineProperty(this, 'response', { configurable: false, get: function() { if (!!~o.inArray(_p('responseType'), ['', 'text'])) { if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { return ''; } } if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { return null; } return _p('response'); } }); */ function _p(prop, value) { if (!props.hasOwnProperty(prop)) { return; } if (arguments.length === 1) { // get return Env.can('define_property') ? props[prop] : self[prop]; } else { // set if (Env.can('define_property')) { props[prop] = value; } else { self[prop] = value; } } } /* function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 return str.toLowerCase(); } */ function _doXHR(data) { var self = this; _start_time = new Date().getTime(); _xhr = new RuntimeTarget(); function loadEnd() { if (_xhr) { // it could have been destroyed by now _xhr.destroy(); _xhr = null; } self.dispatchEvent('loadend'); self = null; } function exec(runtime) { _xhr.bind('LoadStart', function(e) { _p('readyState', XMLHttpRequest.LOADING); self.dispatchEvent('readystatechange'); self.dispatchEvent(e); if (_upload_events_flag) { self.upload.dispatchEvent(e); } }); _xhr.bind('Progress', function(e) { if (_p('readyState') !== XMLHttpRequest.LOADING) { _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) self.dispatchEvent('readystatechange'); } self.dispatchEvent(e); }); _xhr.bind('UploadProgress', function(e) { if (_upload_events_flag) { self.upload.dispatchEvent({ type: 'progress', lengthComputable: false, total: e.total, loaded: e.loaded }); } }); _xhr.bind('Load', function(e) { _p('readyState', XMLHttpRequest.DONE); _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); _p('statusText', httpCode[_p('status')] || ""); _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { _p('responseText', _p('response')); } else if (_p('responseType') === 'document') { _p('responseXML', _p('response')); } _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); self.dispatchEvent('readystatechange'); if (_p('status') > 0) { // status 0 usually means that server is unreachable if (_upload_events_flag) { self.upload.dispatchEvent(e); } self.dispatchEvent(e); } else { _error_flag = true; self.dispatchEvent('error'); } loadEnd(); }); _xhr.bind('Abort', function(e) { self.dispatchEvent(e); loadEnd(); }); _xhr.bind('Error', function(e) { _error_flag = true; _p('readyState', XMLHttpRequest.DONE); self.dispatchEvent('readystatechange'); _upload_complete_flag = true; self.dispatchEvent(e); loadEnd(); }); runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { url: _url, method: _method, async: _async, user: _user, password: _password, headers: _headers, mimeType: _mimeType, encoding: _encoding, responseType: self.responseType, withCredentials: self.withCredentials, options: _options }, data); } // clarify our requirements if (typeof(_options.required_caps) === 'string') { _options.required_caps = Runtime.parseCaps(_options.required_caps); } _options.required_caps = Basic.extend({}, _options.required_caps, { return_response_type: self.responseType }); if (data instanceof FormData) { _options.required_caps.send_multipart = true; } if (!_same_origin_flag) { _options.required_caps.do_cors = true; } if (_options.ruid) { // we do not need to wait if we can connect directly exec(_xhr.connectRuntime(_options)); } else { _xhr.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); _xhr.bind('RuntimeError', function(e, err) { self.dispatchEvent('RuntimeError', err); }); _xhr.connectRuntime(_options); } } function _reset() { _p('responseText', ""); _p('responseXML', null); _p('response', null); _p('status', 0); _p('statusText', ""); _start_time = _timeoutset_time = null; } } XMLHttpRequest.UNSENT = 0; XMLHttpRequest.OPENED = 1; XMLHttpRequest.HEADERS_RECEIVED = 2; XMLHttpRequest.LOADING = 3; XMLHttpRequest.DONE = 4; XMLHttpRequest.prototype = EventTarget.instance; return XMLHttpRequest; }); // Included from: src/javascript/runtime/flash/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** Defines constructor for Flash runtime. @class moxie/runtime/flash/Runtime @private */ define("moxie/runtime/flash/Runtime", [ "moxie/core/utils/Basic", "moxie/core/utils/Env", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/runtime/Runtime" ], function(Basic, Env, Dom, x, Runtime) { var type = 'flash', extensions = {}; /** Get the version of the Flash Player @method getShimVersion @private @return {Number} Flash Player version */ function getShimVersion() { var version; try { version = navigator.plugins['Shockwave Flash']; version = version.description; } catch (e1) { try { version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); } catch (e2) { version = '0.0'; } } version = version.match(/\d+/g); return parseFloat(version[0] + '.' + version[1]); } /** Constructor for the Flash Runtime @class FlashRuntime @extends Runtime */ function FlashRuntime(options) { var I = this, initTimer; options = Basic.extend({ swf_url: Env.swf_url }, options); Runtime.call(this, options, type, { access_binary: function(value) { return value && I.mode === 'browser'; }, access_image_binary: function(value) { return value && I.mode === 'browser'; }, display_media: Runtime.capTrue, do_cors: Runtime.capTrue, drag_and_drop: false, report_upload_progress: function() { return I.mode === 'client'; }, resize_image: Runtime.capTrue, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; }, return_status_code: function(code) { return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); }, select_file: Runtime.capTrue, select_multiple: Runtime.capTrue, send_binary_string: function(value) { return value && I.mode === 'browser'; }, send_browser_cookies: function(value) { return value && I.mode === 'browser'; }, send_custom_headers: function(value) { return value && I.mode === 'browser'; }, send_multipart: Runtime.capTrue, slice_blob: function(value) { return value && I.mode === 'browser'; }, stream_upload: function(value) { return value && I.mode === 'browser'; }, summon_file_dialog: false, upload_filesize: function(size) { return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; }, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }, { // capabilities that require specific mode access_binary: function(value) { return value ? 'browser' : 'client'; }, access_image_binary: function(value) { return value ? 'browser' : 'client'; }, report_upload_progress: function(value) { return value ? 'browser' : 'client'; }, return_response_type: function(responseType) { return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; }, return_status_code: function(code) { return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; }, send_binary_string: function(value) { return value ? 'browser' : 'client'; }, send_browser_cookies: function(value) { return value ? 'browser' : 'client'; }, send_custom_headers: function(value) { return value ? 'browser' : 'client'; }, stream_upload: function(value) { return value ? 'client' : 'browser'; }, upload_filesize: function(size) { return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; } }, 'client'); // minimal requirement for Flash Player version if (getShimVersion() < 10) { this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before } Basic.extend(this, { getShim: function() { return Dom.get(this.uid); }, shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return I.getShim().exec(this.uid, component, action, args); }, init: function() { var html, el, container; container = this.getShimContainer(); // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) Basic.extend(container.style, { position: 'absolute', top: '-8px', left: '-8px', width: '9px', height: '9px', overflow: 'hidden' }); // insert flash object html = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + options.swf_url + '" '; if (Env.browser === 'IE') { html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '; } html += 'width="100%" height="100%" style="outline:0">' + '<param name="movie" value="' + options.swf_url + '" />' + '<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + Env.global_event_dispatcher + '" />' + '<param name="wmode" value="transparent" />' + '<param name="allowscriptaccess" value="always" />' + '</object>'; if (Env.browser === 'IE') { el = document.createElement('div'); container.appendChild(el); el.outerHTML = html; el = container = null; // just in case } else { container.innerHTML = html; } // Init is dispatched by the shim initTimer = setTimeout(function() { if (I && !I.initialized) { // runtime might be already destroyed by this moment I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); } }, 5000); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); clearTimeout(initTimer); // initialization check might be still onwait options = initTimer = destroy = I = null; }; }(this.destroy)) }, extensions); } Runtime.addConstructor(type, FlashRuntime); return extensions; }); // Included from: src/javascript/runtime/flash/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/Blob @private */ define("moxie/runtime/flash/file/Blob", [ "moxie/runtime/flash/Runtime", "moxie/file/Blob" ], function(extensions, Blob) { var FlashBlob = { slice: function(blob, start, end, type) { var self = this.getRuntime(); if (start < 0) { start = Math.max(blob.size + start, 0); } else if (start > 0) { start = Math.min(start, blob.size); } if (end < 0) { end = Math.max(blob.size + end, 0); } else if (end > 0) { end = Math.min(end, blob.size); } blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); if (blob) { blob = new Blob(self.uid, blob); } return blob; } }; return (extensions.Blob = FlashBlob); }); // Included from: src/javascript/runtime/flash/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileInput @private */ define("moxie/runtime/flash/file/FileInput", [ "moxie/runtime/flash/Runtime" ], function(extensions) { var FileInput = { init: function(options) { this.getRuntime().shimExec.call(this, 'FileInput', 'init', { name: options.name, accept: options.accept, multiple: options.multiple }); this.trigger('ready'); } }; return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/flash/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReader @private */ define("moxie/runtime/flash/file/FileReader", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { var _result = ''; function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReader = { read: function(op, blob) { var target = this, self = target.getRuntime(); // special prefix for DataURL read mode if (op === 'readAsDataURL') { _result = 'data:' + (blob.type || '') + ';base64,'; } target.bind('Progress', function(e, data) { if (data) { _result += _formatData(data, op); } }); return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); }, getResult: function() { return _result; }, destroy: function() { _result = null; } }; return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/flash/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReaderSync @private */ define("moxie/runtime/flash/file/FileReaderSync", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReaderSync = { read: function(op, blob) { var result, self = this.getRuntime(); result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); if (!result) { return null; // or throw ex } // special prefix for DataURL read mode if (op === 'readAsDataURL') { result = 'data:' + (blob.type || '') + ';base64,' + result; } return _formatData(result, op, blob.type); } }; return (extensions.FileReaderSync = FileReaderSync); }); // Included from: src/javascript/runtime/Transporter.js /** * Transporter.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/runtime/Transporter", [ "moxie/core/utils/Basic", "moxie/core/utils/Encode", "moxie/runtime/RuntimeClient", "moxie/core/EventTarget" ], function(Basic, Encode, RuntimeClient, EventTarget) { function Transporter() { var mod, _runtime, _data, _size, _pos, _chunk_size; RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), state: Transporter.IDLE, result: null, transport: function(data, type, options) { var self = this; options = Basic.extend({ chunk_size: 204798 }, options); // should divide by three, base64 requires this if ((mod = options.chunk_size % 3)) { options.chunk_size += 3 - mod; } _chunk_size = options.chunk_size; _reset.call(this); _data = data; _size = data.length; if (Basic.typeOf(options) === 'string' || options.ruid) { _run.call(self, type, this.connectRuntime(options)); } else { // we require this to run only once var cb = function(e, runtime) { self.unbind("RuntimeInit", cb); _run.call(self, type, runtime); }; this.bind("RuntimeInit", cb); this.connectRuntime(options); } }, abort: function() { var self = this; self.state = Transporter.IDLE; if (_runtime) { _runtime.exec.call(self, 'Transporter', 'clear'); self.trigger("TransportingAborted"); } _reset.call(self); }, destroy: function() { this.unbindAll(); _runtime = null; this.disconnectRuntime(); _reset.call(this); } }); function _reset() { _size = _pos = 0; _data = this.result = null; } function _run(type, runtime) { var self = this; _runtime = runtime; //self.unbind("RuntimeInit"); self.bind("TransportingProgress", function(e) { _pos = e.loaded; if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { _transport.call(self); } }, 999); self.bind("TransportingComplete", function() { _pos = _size; self.state = Transporter.DONE; _data = null; // clean a bit self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); }, 999); self.state = Transporter.BUSY; self.trigger("TransportingStarted"); _transport.call(self); } function _transport() { var self = this, chunk, bytesLeft = _size - _pos; if (_chunk_size > bytesLeft) { _chunk_size = bytesLeft; } chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); } } Transporter.IDLE = 0; Transporter.BUSY = 1; Transporter.DONE = 2; Transporter.prototype = EventTarget.instance; return Transporter; }); // Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/xhr/XMLHttpRequest @private */ define("moxie/runtime/flash/xhr/XMLHttpRequest", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Basic", "moxie/file/Blob", "moxie/file/File", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/runtime/Transporter" ], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) { var XMLHttpRequest = { send: function(meta, data) { var target = this, self = target.getRuntime(); function send() { meta.transport = self.mode; self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); } function appendBlob(name, blob) { self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); data = null; send(); } function attachBlob(blob, cb) { var tr = new Transporter(); tr.bind("TransportingComplete", function() { cb(this.result); }); tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); } // copy over the headers if any if (!Basic.isEmptyObj(meta.headers)) { Basic.each(meta.headers, function(value, header) { self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object }); } // transfer over multipart params and blob itself if (data instanceof FormData) { var blobField; data.each(function(value, name) { if (value instanceof Blob) { blobField = name; } else { self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); } }); if (!data.hasBlob()) { data = null; send(); } else { var blob = data.getBlob(); if (blob.isDetached()) { attachBlob(blob, function(attachedBlob) { blob.destroy(); appendBlob(blobField, attachedBlob); }); } else { appendBlob(blobField, blob); } } } else if (data instanceof Blob) { if (data.isDetached()) { attachBlob(data, function(attachedBlob) { data.destroy(); data = attachedBlob.uid; send(); }); } else { data = data.uid; send(); } } else { send(); } }, getResponse: function(responseType) { var frs, blob, self = this.getRuntime(); blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); if (blob) { blob = new File(self.uid, blob); if ('blob' === responseType) { return blob; } try { frs = new FileReaderSync(); if (!!~Basic.inArray(responseType, ["", "text"])) { return frs.readAsText(blob); } else if ('json' === responseType && !!window.JSON) { return JSON.parse(frs.readAsText(blob)); } } finally { blob.destroy(); } } return null; }, abort: function(upload_complete_flag) { var self = this.getRuntime(); self.shimExec.call(this, 'XMLHttpRequest', 'abort'); this.dispatchEvent('readystatechange'); // this.dispatchEvent('progress'); this.dispatchEvent('abort'); //if (!upload_complete_flag) { // this.dispatchEvent('uploadprogress'); //} } }; return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/html4/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML4 runtime. @class moxie/runtime/html4/Runtime @private */ define("moxie/runtime/html4/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = 'html4', extensions = {}; function Html4Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; Runtime.call(this, options, type, { access_binary: Test(window.FileReader || window.File && File.getAsDataURL), access_image_binary: false, display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))), do_cors: false, drag_and_drop: false, filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); }()), resize_image: function() { return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); }, report_upload_progress: false, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !!~Basic.inArray(responseType, ['text', 'document', '']); }, return_status_code: function(code) { return !Basic.arrayDiff(code, [200, 404]); }, select_file: function() { return Env.can('use_fileinput'); }, select_multiple: false, send_binary_string: false, send_custom_headers: false, send_multipart: true, slice_blob: false, stream_upload: function() { return I.can('select_file'); }, summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... return (Env.browser === 'Firefox' && Env.version >= 4) || (Env.browser === 'Opera' && Env.version >= 12) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); }()), upload_filesize: True, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html4Runtime); return extensions; }); // Included from: src/javascript/core/utils/Events.js /** * Events.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Events', [ 'moxie/core/utils/Basic' ], function(Basic) { var eventhash = {}, uid = 'moxie_' + Basic.guid(); // IE W3C like event funcs function preventDefault() { this.returnValue = false; } function stopPropagation() { this.cancelBubble = true; } /** Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry (@see removeEvent). @method addEvent @for Utils @static @param {Object} obj DOM element like object to add handler to. @param {String} name Name to add event listener to. @param {Function} callback Function to call when event occurs. @param {String} [key] that might be used to add specifity to the event record. */ var addEvent = function(obj, name, callback, key) { var func, events; name = name.toLowerCase(); // Add event listener if (obj.addEventListener) { func = callback; obj.addEventListener(name, func, false); } else if (obj.attachEvent) { func = function() { var evt = window.event; if (!evt.target) { evt.target = evt.srcElement; } evt.preventDefault = preventDefault; evt.stopPropagation = stopPropagation; callback(evt); }; obj.attachEvent('on' + name, func); } // Log event handler to objects internal mOxie registry if (!obj[uid]) { obj[uid] = Basic.guid(); } if (!eventhash.hasOwnProperty(obj[uid])) { eventhash[obj[uid]] = {}; } events = eventhash[obj[uid]]; if (!events.hasOwnProperty(name)) { events[name] = []; } events[name].push({ func: func, orig: callback, // store original callback for IE key: key }); }; /** Remove event handler from the specified object. If third argument (callback) is not specified remove all events with the specified name. @method removeEvent @static @param {Object} obj DOM element to remove event listener(s) from. @param {String} name Name of event listener to remove. @param {Function|String} [callback] might be a callback or unique key to match. */ var removeEvent = function(obj, name, callback) { var type, undef; name = name.toLowerCase(); if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { type = eventhash[obj[uid]][name]; } else { return; } for (var i = type.length - 1; i >= 0; i--) { // undefined or not, key should match if (type[i].orig === callback || type[i].key === callback) { if (obj.removeEventListener) { obj.removeEventListener(name, type[i].func, false); } else if (obj.detachEvent) { obj.detachEvent('on'+name, type[i].func); } type[i].orig = null; type[i].func = null; type.splice(i, 1); // If callback was passed we are done here, otherwise proceed if (callback !== undef) { break; } } } // If event array got empty, remove it if (!type.length) { delete eventhash[obj[uid]][name]; } // If mOxie registry has become empty, remove it if (Basic.isEmptyObj(eventhash[obj[uid]])) { delete eventhash[obj[uid]]; // IE doesn't let you remove DOM object property with - delete try { delete obj[uid]; } catch(e) { obj[uid] = undef; } } }; /** Remove all kind of events from the specified object @method removeAllEvents @static @param {Object} obj DOM element to remove event listeners from. @param {String} [key] unique key to match, when removing events. */ var removeAllEvents = function(obj, key) { if (!obj || !obj[uid]) { return; } Basic.each(eventhash[obj[uid]], function(events, name) { removeEvent(obj, name, key); }); }; return { addEvent: addEvent, removeEvent: removeEvent, removeAllEvents: removeAllEvents }; }); // Included from: src/javascript/runtime/html4/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileInput @private */ define("moxie/runtime/html4/file/FileInput", [ "moxie/runtime/html4/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Events", "moxie/core/utils/Mime", "moxie/core/utils/Env" ], function(extensions, Basic, Dom, Events, Mime, Env) { function FileInput() { var _uid, _files = [], _mimes = [], _options; function addInput() { var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; uid = Basic.guid('uid_'); shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE if (_uid) { // move previous form out of the view currForm = Dom.get(_uid + '_form'); if (currForm) { Basic.extend(currForm.style, { top: '100%' }); } } // build form in DOM, since innerHTML version not able to submit file for some reason form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', 'post'); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); Basic.extend(form.style, { overflow: 'hidden', position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); input = document.createElement('input'); input.setAttribute('id', uid); input.setAttribute('type', 'file'); input.setAttribute('name', _options.name || 'Filedata'); input.setAttribute('accept', _mimes.join(',')); Basic.extend(input.style, { fontSize: '999px', opacity: 0 }); form.appendChild(input); shimContainer.appendChild(form); // prepare file input to be placed underneath the browse_button element Basic.extend(input.style, { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); if (Env.browser === 'IE' && Env.version < 10) { Basic.extend(input.style, { filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" }); } input.onchange = function() { // there should be only one handler for this var file; if (!this.value) { return; } if (this.files) { file = this.files[0]; } else { file = { name: this.value }; } _files = [file]; this.onchange = function() {}; // clear event handler addInput.call(comp); // after file is initialized as o.File, we need to update form and input ids comp.bind('change', function onChange() { var input = Dom.get(uid), form = Dom.get(uid + '_form'), file; comp.unbind('change', onChange); if (comp.files.length && input && form) { file = comp.files[0]; input.setAttribute('id', file.uid); form.setAttribute('id', file.uid + '_form'); // set upload target form.setAttribute('target', file.uid + '_iframe'); } input = form = null; }, 998); input = form = null; comp.trigger('change'); }; // route click event to the input if (I.can('summon_file_dialog')) { browseButton = Dom.get(_options.browse_button); Events.removeEvent(browseButton, 'click', comp.uid); Events.addEvent(browseButton, 'click', function(e) { if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] input.click(); } e.preventDefault(); }, comp.uid); } _uid = uid; shimContainer = currForm = browseButton = null; } Basic.extend(this, { init: function(options) { var comp = this, I = comp.getRuntime(), shimContainer; // figure out accept string _options = options; _mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension')); shimContainer = I.getShimContainer(); (function() { var browseButton, zIndex, top; browseButton = Dom.get(options.browse_button); // Route click event to the input[type=file] element for browsers that support such behavior if (I.can('summon_file_dialog')) { if (Dom.getStyle(browseButton, 'position') === 'static') { browseButton.style.position = 'relative'; } zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; browseButton.style.zIndex = zIndex; shimContainer.style.zIndex = zIndex - 1; } /* Since we have to place input[type=file] on top of the browse_button for some browsers, browse_button loses interactivity, so we restore it here */ top = I.can('summon_file_dialog') ? browseButton : shimContainer; Events.addEvent(top, 'mouseover', function() { comp.trigger('mouseenter'); }, comp.uid); Events.addEvent(top, 'mouseout', function() { comp.trigger('mouseleave'); }, comp.uid); Events.addEvent(top, 'mousedown', function() { comp.trigger('mousedown'); }, comp.uid); Events.addEvent(Dom.get(options.container), 'mouseup', function() { comp.trigger('mouseup'); }, comp.uid); browseButton = null; }()); addInput.call(this); shimContainer = null; // trigger ready event asynchronously comp.trigger({ type: 'ready', async: true }); }, getFiles: function() { return _files; }, disable: function(state) { var input; if ((input = Dom.get(_uid))) { input.disabled = !!state; } }, destroy: function() { var I = this.getRuntime() , shim = I.getShim() , shimContainer = I.getShimContainer() ; Events.removeAllEvents(shimContainer, this.uid); Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); if (shimContainer) { shimContainer.innerHTML = ''; } shim.removeInstance(this.uid); _uid = _files = _mimes = _options = shimContainer = shim = null; } }); } return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/html5/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML5 runtime. @class moxie/runtime/html5/Runtime @private */ define("moxie/runtime/html5/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = "html5", extensions = {}; function Html5Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; var caps = Basic.extend({ access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), access_image_binary: function() { return I.can('access_binary') && !!extensions.Image; }, display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')), do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), drag_and_drop: Test(function() { // this comes directly from Modernizr: http://www.modernizr.com/ var div = document.createElement('div'); // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (Env.browser !== 'IE' || Env.version > 9); }()), filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); }()), return_response_headers: True, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported return true; } return Env.can('return_response_type', responseType); }, return_status_code: True, report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), resize_image: function() { return I.can('access_binary') && Env.can('create_canvas'); }, select_file: function() { return Env.can('use_fileinput') && window.File; }, select_folder: function() { return I.can('select_file') && Env.browser === 'Chrome' && Env.version >= 21; }, select_multiple: function() { // it is buggy on Safari Windows and iOS return I.can('select_file') && !(Env.browser === 'Safari' && Env.os === 'Windows') && !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.4", '<')); }, send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), send_custom_headers: Test(window.XMLHttpRequest), send_multipart: function() { return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); }, slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), stream_upload: function(){ return I.can('slice_blob') && I.can('send_multipart'); }, summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... return (Env.browser === 'Firefox' && Env.version >= 4) || (Env.browser === 'Opera' && Env.version >= 12) || (Env.browser === 'IE' && Env.version >= 10) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); }()), upload_filesize: True }, arguments[2] ); Runtime.call(this, options, (arguments[1] || type), caps); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html5Runtime); return extensions; }); // Included from: src/javascript/runtime/html5/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/FileReader @private */ define("moxie/runtime/html5/file/FileReader", [ "moxie/runtime/html5/Runtime", "moxie/core/utils/Encode", "moxie/core/utils/Basic" ], function(extensions, Encode, Basic) { function FileReader() { var _fr, _convertToBinary = false; Basic.extend(this, { read: function(op, blob) { var target = this; _fr = new window.FileReader(); _fr.addEventListener('progress', function(e) { target.trigger(e); }); _fr.addEventListener('load', function(e) { target.trigger(e); }); _fr.addEventListener('error', function(e) { target.trigger(e, _fr.error); }); _fr.addEventListener('loadend', function() { _fr = null; }); if (Basic.typeOf(_fr[op]) === 'function') { _convertToBinary = false; _fr[op](blob.getSource()); } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ _convertToBinary = true; _fr.readAsDataURL(blob.getSource()); } }, getResult: function() { return _fr && _fr.result ? (_convertToBinary ? _toBinary(_fr.result) : _fr.result) : null; }, abort: function() { if (_fr) { _fr.abort(); } }, destroy: function() { _fr = null; } }); function _toBinary(str) { return Encode.atob(str.substring(str.indexOf('base64,') + 7)); } } return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html4/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileReader @private */ define("moxie/runtime/html4/file/FileReader", [ "moxie/runtime/html4/Runtime", "moxie/runtime/html5/file/FileReader" ], function(extensions, FileReader) { return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/xhr/XMLHttpRequest @private */ define("moxie/runtime/html4/xhr/XMLHttpRequest", [ "moxie/runtime/html4/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Url", "moxie/core/Exceptions", "moxie/core/utils/Events", "moxie/file/Blob", "moxie/xhr/FormData" ], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { function XMLHttpRequest() { var _status, _response, _iframe; function cleanup(cb) { var target = this, uid, form, inputs, i, hasFile = false; if (!_iframe) { return; } uid = _iframe.id.replace(/_iframe$/, ''); form = Dom.get(uid + '_form'); if (form) { inputs = form.getElementsByTagName('input'); i = inputs.length; while (i--) { switch (inputs[i].getAttribute('type')) { case 'hidden': inputs[i].parentNode.removeChild(inputs[i]); break; case 'file': hasFile = true; // flag the case for later break; } } inputs = []; if (!hasFile) { // we need to keep the form for sake of possible retries form.parentNode.removeChild(form); } form = null; } // without timeout, request is marked as canceled (in console) setTimeout(function() { Events.removeEvent(_iframe, 'load', target.uid); if (_iframe.parentNode) { // #382 _iframe.parentNode.removeChild(_iframe); } // check if shim container has any other children, if - not, remove it as well var shimContainer = target.getRuntime().getShimContainer(); if (!shimContainer.children.length) { shimContainer.parentNode.removeChild(shimContainer); } shimContainer = _iframe = null; cb(); }, 1); } Basic.extend(this, { send: function(meta, data) { var target = this, I = target.getRuntime(), uid, form, input, blob; _status = _response = null; function createIframe() { var container = I.getShimContainer() || document.body , temp = document.createElement('div') ; // IE 6 won't be able to set the name using setAttribute or iframe.name temp.innerHTML = '<iframe id="' + uid + '_iframe" name="' + uid + '_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>'; _iframe = temp.firstChild; container.appendChild(_iframe); /* _iframe.onreadystatechange = function() { console.info(_iframe.readyState); };*/ Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 var el; try { el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; // try to detect some standard error pages if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error _status = el.title.replace(/^(\d+).*$/, '$1'); } else { _status = 200; // get result _response = Basic.trim(el.body.innerHTML); // we need to fire these at least once target.trigger({ type: 'progress', loaded: _response.length, total: _response.length }); if (blob) { // if we were uploading a file target.trigger({ type: 'uploadprogress', loaded: blob.size || 1025, total: blob.size || 1025 }); } } } catch (ex) { if (Url.hasSameOrigin(meta.url)) { // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm // which obviously results to cross domain error (wtf?) _status = 404; } else { cleanup.call(target, function() { target.trigger('error'); }); return; } } cleanup.call(target, function() { target.trigger('load'); }); }, target.uid); } // end createIframe // prepare data to be sent and convert if required if (data instanceof FormData && data.hasBlob()) { blob = data.getBlob(); uid = blob.uid; input = Dom.get(uid); form = Dom.get(uid + '_form'); if (!form) { throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } } else { uid = Basic.guid('uid_'); form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', meta.method); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); form.setAttribute('target', uid + '_iframe'); I.getShimContainer().appendChild(form); } if (data instanceof FormData) { data.each(function(value, name) { if (value instanceof Blob) { if (input) { input.setAttribute('name', name); } } else { var hidden = document.createElement('input'); Basic.extend(hidden, { type : 'hidden', name : name, value : value }); // make sure that input[type="file"], if it's there, comes last if (input) { form.insertBefore(hidden, input); } else { form.appendChild(hidden); } } }); } // set destination url form.setAttribute("action", meta.url); createIframe(); form.submit(); target.trigger('loadstart'); }, getStatus: function() { return _status; }, getResponse: function(responseType) { if ('json' === responseType) { // strip off <pre>..</pre> tags that might be enclosing the response if (Basic.typeOf(_response) === 'string' && !!window.JSON) { try { return JSON.parse(_response.replace(/^\s*<pre[^>]*>/, '').replace(/<\/pre>\s*$/, '')); } catch (ex) { return null; } } } else if ('document' === responseType) { } return _response; }, abort: function() { var target = this; if (_iframe && _iframe.contentWindow) { if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome _iframe.contentWindow.stop(); } else if (_iframe.contentWindow.document.execCommand) { // IE _iframe.contentWindow.document.execCommand('Stop'); } else { _iframe.src = "about:blank"; } } cleanup.call(this, function() { // target.dispatchEvent('readystatechange'); target.dispatchEvent('abort'); }); } }); } return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/silverlight/Runtime.js /** * RunTime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** Defines constructor for Silverlight runtime. @class moxie/runtime/silverlight/Runtime @private */ define("moxie/runtime/silverlight/Runtime", [ "moxie/core/utils/Basic", "moxie/core/utils/Env", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/runtime/Runtime" ], function(Basic, Env, Dom, x, Runtime) { var type = "silverlight", extensions = {}; function isInstalled(version) { var isVersionSupported = false, control = null, actualVer, actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0; try { try { control = new ActiveXObject('AgControl.AgControl'); if (control.IsVersionSupported(version)) { isVersionSupported = true; } control = null; } catch (e) { var plugin = navigator.plugins["Silverlight Plug-In"]; if (plugin) { actualVer = plugin.description; if (actualVer === "1.0.30226.2") { actualVer = "2.0.30226.2"; } actualVerArray = actualVer.split("."); while (actualVerArray.length > 3) { actualVerArray.pop(); } while ( actualVerArray.length < 4) { actualVerArray.push(0); } reqVerArray = version.split("."); while (reqVerArray.length > 4) { reqVerArray.pop(); } do { requiredVersionPart = parseInt(reqVerArray[index], 10); actualVersionPart = parseInt(actualVerArray[index], 10); index++; } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) { isVersionSupported = true; } } } } catch (e2) { isVersionSupported = false; } return isVersionSupported; } /** Constructor for the Silverlight Runtime @class SilverlightRuntime @extends Runtime */ function SilverlightRuntime(options) { var I = this, initTimer; options = Basic.extend({ xap_url: Env.xap_url }, options); Runtime.call(this, options, type, { access_binary: Runtime.capTrue, access_image_binary: Runtime.capTrue, display_media: Runtime.capTrue, do_cors: Runtime.capTrue, drag_and_drop: false, report_upload_progress: Runtime.capTrue, resize_image: Runtime.capTrue, return_response_headers: function(value) { return value && I.mode === 'client'; }, return_response_type: function(responseType) { if (responseType !== 'json') { return true; } else { return !!window.JSON; } }, return_status_code: function(code) { return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]); }, select_file: Runtime.capTrue, select_multiple: Runtime.capTrue, send_binary_string: Runtime.capTrue, send_browser_cookies: function(value) { return value && I.mode === 'browser'; }, send_custom_headers: function(value) { return value && I.mode === 'client'; }, send_multipart: Runtime.capTrue, slice_blob: Runtime.capTrue, stream_upload: true, summon_file_dialog: false, upload_filesize: Runtime.capTrue, use_http_method: function(methods) { return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']); } }, { // capabilities that require specific mode return_response_headers: function(value) { return value ? 'client' : 'browser'; }, return_status_code: function(code) { return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser']; }, send_browser_cookies: function(value) { return value ? 'browser' : 'client'; }, send_custom_headers: function(value) { return value ? 'client' : 'browser'; }, use_http_method: function(methods) { return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser']; } }); // minimal requirement if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') { this.mode = false; } Basic.extend(this, { getShim: function() { return Dom.get(this.uid).content.Moxie; }, shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return I.getShim().exec(this.uid, component, action, args); }, init : function() { var container; container = this.getShimContainer(); container.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">' + '<param name="source" value="' + options.xap_url + '"/>' + '<param name="background" value="Transparent"/>' + '<param name="windowless" value="true"/>' + '<param name="enablehtmlaccess" value="true"/>' + '<param name="initParams" value="uid=' + this.uid + ',target=' + Env.global_event_dispatcher + '"/>' + '</object>'; // Init is dispatched by the shim initTimer = setTimeout(function() { if (I && !I.initialized) { // runtime might be already destroyed by this moment I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); } }, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac) }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); clearTimeout(initTimer); // initialization check might be still onwait options = initTimer = destroy = I = null; }; }(this.destroy)) }, extensions); } Runtime.addConstructor(type, SilverlightRuntime); return extensions; }); // Included from: src/javascript/runtime/silverlight/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/Blob @private */ define("moxie/runtime/silverlight/file/Blob", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/Blob" ], function(extensions, Basic, Blob) { return (extensions.Blob = Basic.extend({}, Blob)); }); // Included from: src/javascript/runtime/silverlight/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileInput @private */ define("moxie/runtime/silverlight/file/FileInput", [ "moxie/runtime/silverlight/Runtime" ], function(extensions) { var FileInput = { init: function(options) { function toFilters(accept) { var filter = ''; for (var i = 0; i < accept.length; i++) { filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.'); } return filter; } this.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple); this.trigger('ready'); } }; return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/silverlight/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileReader @private */ define("moxie/runtime/silverlight/file/FileReader", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/FileReader" ], function(extensions, Basic, FileReader) { return (extensions.FileReader = Basic.extend({}, FileReader)); }); // Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileReaderSync @private */ define("moxie/runtime/silverlight/file/FileReaderSync", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/FileReaderSync" ], function(extensions, Basic, FileReaderSync) { return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync)); }); // Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/xhr/XMLHttpRequest @private */ define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/xhr/XMLHttpRequest" ], function(extensions, Basic, XMLHttpRequest) { return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest)); }); expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/core/utils/Events"]); })(this);/** * o.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global moxie:true */ /** Globally exposed namespace with the most frequently used public classes and handy methods. @class o @static @private */ (function(exports) { "use strict"; var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; // directly add some public classes // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) (function addAlias(ns) { var name, itemType; for (name in ns) { itemType = typeof(ns[name]); if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { addAlias(ns[name]); } else if (itemType === 'function') { o[name] = ns[name]; } } })(exports.moxie); // add some manually o.Env = exports.moxie.core.utils.Env; o.Mime = exports.moxie.core.utils.Mime; o.Exceptions = exports.moxie.core.Exceptions; // expose globally exports.mOxie = o; if (!exports.o) { exports.o = o; } return o; })(this); ;webshim.register('filereader', function($, webshim, window, document, undefined, featureOptions){ "use strict"; var mOxie, moxie, hasXDomain; var FormData = $.noop; var sel = 'input[type="file"].ws-filereader'; var loadMoxie = function (){ webshim.loader.loadList(['moxie']); }; var _createFilePicker = function(){ var $input, picker, $parent, onReset; var input = this; if(webshim.implement(input, 'filepicker')){ input = this; $input = $(this); $parent = $input.parent(); onReset = function(){ if(!input.value){ $input.prop('value', ''); } }; $input.attr('tabindex', '-1').on('mousedown.filereaderwaiting click.filereaderwaiting', false); $parent.addClass('ws-loading'); picker = new mOxie.FileInput({ browse_button: this, accept: $.prop(this, 'accept'), multiple: $.prop(this, 'multiple') }); $input.jProp('form').on('reset', function(){ setTimeout(onReset); }); picker.onready = function(){ $input.off('.fileraderwaiting'); $parent.removeClass('ws-waiting'); }; picker.onchange = function(e){ webshim.data(input, 'fileList', e.target.files); $input.trigger('change'); }; picker.onmouseenter = function(){ $input.trigger('mouseover'); $parent.addClass('ws-mouseenter'); }; picker.onmouseleave = function(){ $input.trigger('mouseout'); $parent.removeClass('ws-mouseenter'); }; picker.onmousedown = function(){ $input.trigger('mousedown'); $parent.addClass('ws-active'); }; picker.onmouseup = function(){ $input.trigger('mouseup'); $parent.removeClass('ws-active'); }; webshim.data(input, 'filePicker', picker); webshim.ready('WINDOWLOAD', function(){ var lastWidth; $input.onWSOff('updateshadowdom', function(){ var curWitdth = input.offsetWidth; if(curWitdth && lastWidth != curWitdth){ lastWidth = curWitdth; picker.refresh(); } }); }); webshim.addShadowDom(); picker.init(); if(input.disabled){ picker.disable(true); } } }; var getFileNames = function(file){ return file.name; }; var createFilePicker = function(){ var elem = this; loadMoxie(); $(elem) .on('mousedown.filereaderwaiting click.filereaderwaiting', false) .parent() .addClass('ws-loading') ; webshim.ready('moxie', function(){ createFilePicker.call(elem); }); }; var noxhr = /^(?:script|jsonp)$/i; var notReadyYet = function(){ loadMoxie(); webshim.error('filereader/formdata not ready yet. please wait for moxie to load `webshim.ready("moxie", callbackFn);`` or wait for the first change event on input[type="file"].ws-filereader.') }; var inputValueDesc = webshim.defineNodeNameProperty('input', 'value', { prop: { get: function(){ var fileList = webshim.data(this, 'fileList'); if(fileList && fileList.map){ return fileList.map(getFileNames).join(', '); } return inputValueDesc.prop._supget.call(this); } } } ); var shimMoxiePath = webshim.cfg.basePath+'moxie/'; var crossXMLMessage = 'You nedd a crossdomain.xml to get all "filereader" / "XHR2" / "CORS" features to work. Or host moxie.swf/moxie.xap on your server an configure filereader options: "swfpath"/"xappath"'; var testMoxie = function(options){ return (options.wsType == 'moxie' || (options.data && options.data instanceof mOxie.FormData) || (options.crossDomain && $.support.cors !== false && hasXDomain != 'no' && !noxhr.test(options.dataType || ''))); }; var createMoxieTransport = function (options){ if(testMoxie(options)){ var ajax; webshim.info('moxie transfer used for $.ajax'); if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } return { send: function( headers, completeCallback ) { var proressEvent = function(obj, name){ if(options[name]){ var called = false; ajax.addEventListener('load', function(e){ if(!called){ options[name]({type: 'progress', lengthComputable: true, total: 1, loaded: 1}); } else if(called.lengthComputable && called.total > called.loaded){ options[name]({type: 'progress', lengthComputable: true, total: called.total, loaded: called.total}); } }); obj.addEventListener('progress', function(e){ called = e; options[name](e); }); } }; ajax = new moxie.xhr.XMLHttpRequest(); ajax.open(options.type, options.url, options.async, options.username, options.password); proressEvent(ajax.upload, featureOptions.uploadprogress); proressEvent(ajax.upload, featureOptions.progress); ajax.addEventListener('load', function(e){ var responses = { text: ajax.responseText, xml: ajax.responseXML }; completeCallback(ajax.status, ajax.statusText, responses, ajax.getAllResponseHeaders()); }); if(options.xhrFields && options.xhrFields.withCredentials){ ajax.withCredentials = true; } if(options.timeout){ ajax.timeout = options.timeout; } $.each(headers, function(name, value){ ajax.setRequestHeader(name, value); }); ajax.send(options.data); }, abort: function() { if(ajax){ ajax.abort(); } } }; } }; var transports = { //based on script: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest xdomain: (function(){ var httpRegEx = /^https?:\/\//i; var getOrPostRegEx = /^get|post$/i; var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i'); return function(options, userOptions, jqXHR) { // Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page if (!options.crossDomain || options.username || (options.xhrFields && options.xhrFields.withCredentials) || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url) || (options.data && options.data instanceof mOxie.FormData) || noxhr.test(options.dataType || '')) { return; } var xdr = null; webshim.info('xdomain transport used.'); return { send: function(headers, complete) { var postData = ''; var userType = (userOptions.dataType || '').toLowerCase(); xdr = new XDomainRequest(); if (/^\d+$/.test(userOptions.timeout)) { xdr.timeout = userOptions.timeout; } xdr.ontimeout = function() { complete(500, 'timeout'); }; xdr.onload = function() { var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\r\nContent-Type: ' + xdr.contentType; var status = { code: xdr.status || 200, message: xdr.statusText || 'OK' }; var responses = { text: xdr.responseText, xml: xdr.responseXML }; try { if (userType === 'html' || /text\/html/i.test(xdr.contentType)) { responses.html = xdr.responseText; } else if (userType === 'json' || (userType !== 'text' && /\/json/i.test(xdr.contentType))) { try { responses.json = $.parseJSON(xdr.responseText); } catch(e) { } } else if (userType === 'xml' && !xdr.responseXML) { var doc; try { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = false; doc.loadXML(xdr.responseText); } catch(e) { } responses.xml = doc; } } catch(parseMessage) {} complete(status.code, status.message, responses, allResponseHeaders); }; // set an empty handler for 'onprogress' so requests don't get aborted xdr.onprogress = function(){}; xdr.onerror = function() { complete(500, 'error', { text: xdr.responseText }); }; if (userOptions.data) { postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data); } xdr.open(options.type, options.url); xdr.send(postData); }, abort: function() { if (xdr) { xdr.abort(); } } }; }; })(), moxie: function (options, originalOptions, jqXHR){ if(testMoxie(options)){ loadMoxie(options); var ajax; var tmpTransport = { send: function( headers, completeCallback ) { ajax = true; webshim.ready('moxie', function(){ if(ajax){ ajax = createMoxieTransport(options, originalOptions, jqXHR); tmpTransport.send = ajax.send; tmpTransport.abort = ajax.abort; ajax.send(headers, completeCallback); } }); }, abort: function() { ajax = false; } }; return tmpTransport; } } }; if(!featureOptions.progress){ featureOptions.progress = 'onprogress'; } if(!featureOptions.uploadprogress){ featureOptions.uploadprogress = 'onuploadprogress'; } if(!featureOptions.swfpath){ featureOptions.swfpath = shimMoxiePath+'flash/Moxie.min.swf'; } if(!featureOptions.xappath){ featureOptions.xappath = shimMoxiePath+'silverlight/Moxie.min.xap'; } if($.support.cors !== false || !window.XDomainRequest){ delete transports.xdomain; } $.ajaxTransport("+*", function( options, originalOptions, jqXHR ) { var ajax, type; if(options.wsType || transports[transports]){ ajax = transports[transports](options, originalOptions, jqXHR); } if(!ajax){ for(type in transports){ ajax = transports[type](options, originalOptions, jqXHR); if(ajax){break;} } } return ajax; }); webshim.defineNodeNameProperty('input', 'files', { prop: { writeable: false, get: function(){ if(this.type != 'file'){return null;} if(!$(this).hasClass('ws-filereader')){ webshim.info("please add the 'ws-filereader' class to your input[type='file'] to implement files-property"); } return webshim.data(this, 'fileList') || []; } } } ); webshim.reflectProperties(['input'], ['accept']); if($('<input />').prop('multiple') == null){ webshim.defineNodeNamesBooleanProperty(['input'], ['multiple']); } webshim.onNodeNamesPropertyModify('input', 'disabled', function(value, boolVal, type){ var picker = webshim.data(this, 'filePicker'); if(picker){ picker.disable(boolVal); } }); webshim.onNodeNamesPropertyModify('input', 'value', function(value, boolVal, type){ if(value === '' && this.type == 'file' && $(this).hasClass('ws-filereader')){ webshim.data(this, 'fileList', []); } }); window.FileReader = notReadyYet; window.FormData = notReadyYet; webshim.ready('moxie', function(){ var wsMimes = 'application/xml,xml'; moxie = window.moxie; mOxie = window.mOxie; mOxie.Env.swf_url = featureOptions.swfpath; mOxie.Env.xap_url = featureOptions.xappath; window.FileReader = mOxie.FileReader; window.FormData = function(form){ var appendData, i, len, files, fileI, fileLen, inputName; var moxieData = new mOxie.FormData(); if(form && $.nodeName(form, 'form')){ appendData = $(form).serializeArray(); for(i = 0; i < appendData.length; i++){ if(Array.isArray(appendData[i].value)){ appendData[i].value.forEach(function(val){ moxieData.append(appendData[i].name, val); }); } else { moxieData.append(appendData[i].name, appendData[i].value); } } appendData = form.querySelectorAll('input[type="file"][name]'); for(i = 0, len = appendData.length; i < appendData.length; i++){ inputName = appendData[i].name; if(inputName && !$(appendData[i]).is(':disabled')){ files = $.prop(appendData[i], 'files') || []; if(files.length){ if(files.length > 1 || (moxieData.hasBlob && moxieData.hasBlob())){ webshim.error('FormData shim can only handle one file per ajax. Use multiple ajax request. One per file.'); } for(fileI = 0, fileLen = files.length; fileI < fileLen; fileI++){ moxieData.append(inputName, files[fileI]); } } } } } return moxieData; }; FormData = window.FormData; createFilePicker = _createFilePicker; transports.moxie = createMoxieTransport; featureOptions.mimeTypes = (featureOptions.mimeTypes) ? wsMimes+','+featureOptions.mimeTypes : wsMimes; try { mOxie.Mime.addMimeType(featureOptions.mimeTypes); } catch(e){ webshim.warn('mimetype to moxie error: '+e); } }); webshim.addReady(function(context, contextElem){ $(context.querySelectorAll(sel)).add(contextElem.filter(sel)).each(createFilePicker); }); webshim.ready('WINDOWLOAD', loadMoxie); if(webshim.cfg.debug !== false && featureOptions.swfpath.indexOf((location.protocol+'//'+location.hostname)) && featureOptions.swfpath.indexOf(('https://'+location.hostname))){ webshim.ready('WINDOWLOAD', function(){ var printMessage = function(){ if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } }; try { hasXDomain = sessionStorage.getItem('wsXdomain.xml'); } catch(e){} printMessage(); if(hasXDomain == null){ $.ajax({ url: 'crossdomain.xml', type: 'HEAD', dataType: 'xml', success: function(){ hasXDomain = 'yes'; }, error: function(){ hasXDomain = 'no'; }, complete: function(){ try { sessionStorage.setItem('wsXdomain.xml', hasXDomain); } catch(e){} printMessage(); } }); } }); } });
react-native-cli/index.js
browniefed/react-native
#!/usr/bin/env node /** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // /!\ DO NOT MODIFY THIS FILE /!\ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // react-native-cli is installed globally on people's computers. This means // that it is extremely difficult to have them upgrade the version and // because there's only one global version installed, it is very prone to // breaking changes. // // The only job of react-native-cli is to init the repository and then // forward all the commands to the local version of react-native. // // If you need to add a new command, please add it to local-cli/. // // The only reason to modify this file is to add more warnings and // troubleshooting information for the `react-native init` command. // // Do not make breaking changes! We absolutely don't want to have to // tell people to update their global version of react-native-cli. // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // /!\ DO NOT MODIFY THIS FILE /!\ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'use strict'; var fs = require('fs'); var path = require('path'); var exec = require('child_process').exec; var spawn = require('child_process').spawn; var chalk = require('chalk'); var prompt = require('prompt'); var semver = require('semver'); /** * Used arguments: * -v --version - to print current version of react-native-cli and react-native dependency * if you are in a RN app folder * init - to create a new project and npm install it * --verbose - to print logs while init * --version <alternative react-native package> - override default (https://registry.npmjs.org/react-native@latest), * package to install, examples: * - "0.22.0-rc1" - A new app will be created using a specific version of React Native from npm repo * - "https://registry.npmjs.org/react-native/-/react-native-0.20.0.tgz" - a .tgz archive from any npm repo * - "/Users/home/react-native/react-native-0.22.0.tgz" - for package prepared with `npm pack`, useful for e2e tests */ var argv = require('minimist')(process.argv.slice(2)); var CLI_MODULE_PATH = function() { return path.resolve( process.cwd(), 'node_modules', 'react-native', 'cli.js' ); }; var REACT_NATIVE_PACKAGE_JSON_PATH = function() { return path.resolve( process.cwd(), 'node_modules', 'react-native', 'package.json' ); }; checkForVersionArgument(); var cli; var cliPath = CLI_MODULE_PATH(); if (fs.existsSync(cliPath)) { cli = require(cliPath); } // minimist api var commands = argv._; if (cli) { cli.run(); } else { if (commands.length === 0) { console.error( 'You did not pass any commands, did you mean to run `react-native init`?' ); process.exit(1); } switch (commands[0]) { case 'init': if (!commands[1]) { console.error( 'Usage: react-native init <ProjectName> [--verbose]' ); process.exit(1); } else { if (!argv.verbose) console.log('This may take some time...'); init(commands[1], argv.verbose, argv.version); } break; default: console.error( 'Command `%s` unrecognized. ' + 'Make sure that you have run `npm install` and that you are inside a react-native project.', commands[0] ); process.exit(1); break; } } function validatePackageName(name) { if (!name.match(/^[$A-Z_][0-9A-Z_$]*$/i)) { console.error( '"%s" is not a valid name for a project. Please use a valid identifier ' + 'name (alphanumeric).', name ); process.exit(1); } if (name === 'React') { console.error( '"%s" is not a valid name for a project. Please do not use the ' + 'reserved word "React".', name ); process.exit(1); } } function init(name, verbose, rnPackage) { validatePackageName(name); if (fs.existsSync(name)) { createAfterConfirmation(name, verbose, rnPackage); } else { createProject(name, verbose, rnPackage); } } function createAfterConfirmation(name, verbose, rnPackage) { prompt.start(); var property = { name: 'yesno', message: 'Directory ' + name + ' already exists. Continue?', validator: /y[es]*|n[o]?/, warning: 'Must respond yes or no', default: 'no' }; prompt.get(property, function (err, result) { if (result.yesno[0] === 'y') { createProject(name, verbose, rnPackage); } else { console.log('Project initialization canceled'); process.exit(); } }); } function createProject(name, verbose, rnPackage) { var root = path.resolve(name); var projectName = path.basename(root); console.log( 'This will walk you through creating a new React Native project in', root ); if (!fs.existsSync(root)) { fs.mkdirSync(root); } var packageJson = { name: projectName, version: '0.0.1', private: true, scripts: { start: 'node node_modules/react-native/local-cli/cli.js start' } }; fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson)); process.chdir(root); console.log('Installing react-native package from npm...'); if (verbose) { runVerbose(root, projectName, rnPackage); } else { run(root, projectName, rnPackage); } } function getInstallPackage(rnPackage) { var packageToInstall = 'react-native'; var valideSemver = semver.valid(rnPackage); if (valideSemver) { packageToInstall += '@' + valideSemver; } else if (rnPackage) { // for tar.gz or alternative paths packageToInstall = rnPackage; } return packageToInstall; } function run(root, projectName, rnPackage) { exec('npm install --save --save-exact ' + getInstallPackage(rnPackage), function(e, stdout, stderr) { if (e) { console.log(stdout); console.error(stderr); console.error('`npm install --save --save-exact react-native` failed'); process.exit(1); } checkNodeVersion(); cli = require(CLI_MODULE_PATH()); cli.init(root, projectName); }); } function runVerbose(root, projectName, rnPackage) { var proc = spawn('npm', ['install', '--verbose', '--save', '--save-exact', getInstallPackage(rnPackage)], {stdio: 'inherit'}); proc.on('close', function (code) { if (code !== 0) { console.error('`npm install --save --save-exact react-native` failed'); return; } cli = require(CLI_MODULE_PATH()); cli.init(root, projectName); }); } function checkNodeVersion() { var packageJson = require(REACT_NATIVE_PACKAGE_JSON_PATH()); if (!packageJson.engines || !packageJson.engines.node) { return; } if (!semver.satisfies(process.version, packageJson.engines.node)) { console.error(chalk.red( 'You are currently running Node %s but React Native requires %s. ' + 'Please use a supported version of Node.\n' + 'See https://facebook.github.io/react-native/docs/getting-started.html' ), process.version, packageJson.engines.node); } } function checkForVersionArgument() { if (argv._.length === 0 && (argv.v || argv.version)) { console.log('react-native-cli: ' + require('./package.json').version); try { console.log('react-native: ' + require(REACT_NATIVE_PACKAGE_JSON_PATH()).version); } catch (e) { console.log('react-native: n/a - not inside a React Native project directory'); } process.exit(); } }
actor-apps/app-web/src/app/components/modals/invite-user/ContactItem.react.js
guiquanz/actor-platform
import React from 'react'; import ReactMixin from 'react-mixin'; import addons from 'react/addons'; import classnames from 'classnames'; import AvatarItem from 'components/common/AvatarItem.react'; const {addons: { PureRenderMixin }} = addons; @ReactMixin.decorate(PureRenderMixin) class ContactItem extends React.Component { static propTypes = { contact: React.PropTypes.object, onSelect: React.PropTypes.func, member: React.PropTypes.bool }; constructor(props) { super(props); } onSelect = () => { this.props.onSelect(this.props.contact); }; render() { const contact = this.props.contact; const contactClassName = classnames('contacts__list__item row', { 'contacts__list__item--member': this.props.member }); let controls; if (!this.props.member) { controls = <a className="material-icons" onClick={this.onSelect}>person_add</a>; } else { controls = <i className="material-icons">check</i>; } return ( <li className={contactClassName}> <AvatarItem image={contact.avatar} placeholder={contact.placeholder} size="small" title={contact.name}/> <div className="col-xs"> <span className="title"> {contact.name} </span> </div> <div className="controls"> {controls} </div> </li> ); } } export default ContactItem;
src/js/components/Light.js
ngokevin/audioworld
import {Entity} from 'aframe-react'; import React from 'react'; export default props => { // Hack until named entities. const poppedProps = {}; Object.keys(props).forEach(function (propName) { if (propName !== 'position') { poppedProps[propName] = props[propName]; } }); return ( <Entity light={poppedProps} position={props.position || '0 0 0'}/> ); }
packages/mineral-ui-icons/src/IconHdrStrong.js
mineral-ui/mineral-ui
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; import type { IconProps } from 'mineral-ui/Icon/types'; /* eslint-disable prettier/prettier */ export default function IconHdrStrong(props: IconProps) { const iconProps = { rtl: false, ...props }; return ( <Icon {...iconProps}> <g> <path d="M17 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zM5 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/> </g> </Icon> ); } IconHdrStrong.displayName = 'IconHdrStrong'; IconHdrStrong.category = 'image';
wic/src/App.js
opensmc/get-connected-smc
import React from 'react' import { Switch, Route } from 'react-router-dom' import Home from './components/Home' const App = () => ( <div> <main> <Switch> <Route exact path='/' component={Home} /> </Switch> </main> </div> ) export default App
assets/javascripts/kitten/components/form/checkbox/stories.js
KissKissBankBank/kitten
import React from 'react' import { action } from '@storybook/addon-actions' import { Checkbox } from './index' import { DocsPage } from 'storybook/docs-page' export default { component: Checkbox, title: 'Form/Checkbox', parameters: { docs: { page: () => <DocsPage filepath={__filename} importString="Checkbox" />, }, }, decorators: [ story => <div className="story-Container story-Grid">{story()}</div>, ], argTypes: { id: { name: 'id', }, label: { name: 'label', }, children: { name: 'children', }, textProps: { name: 'textProps', control: 'object', }, indeterminate: { name: 'indeterminate', control: 'boolean', }, error: { name: 'error', control: 'boolean', }, disabled: { name: 'disabled', control: 'boolean', }, onLabelClick: { name: 'onLabelClick', }, }, } const args = { id: 'checkbox_id', label: '', children: null, textProps: {}, indeterminate: false, error: false, disabled: false, onLabelClick: () => {}, } export const Default = args => <Checkbox {...args} /> Default.args = { ...args, onLabelClick: action('label-click'), children: 'Checkbox label', } export const WithLinkInContent = args => ( <Checkbox {...args}> This label has a <a href="#link">link</a>. </Checkbox> ) WithLinkInContent.args = args export const WithLabelAndChildren = args => <Checkbox {...args} /> WithLabelAndChildren.args = { ...args, label: 'Checkbox Label', children: 'Checkbox Content', } export const WithLabel = args => <Checkbox {...args} /> WithLabel.args = { ...args, label: 'Checkbox Label', children: null } export const WithBigContent = args => <Checkbox {...args} /> WithBigContent.args = { ...args, label: '', children: ( <> This checkbox doesn't have a `label` prop. <br /> Nullam quis risus eget urna mollis ornare vel eu leo. Cras mattis consectetur purus sit amet fermentum. </> ), } export const WithLabelAndBigContent = args => <Checkbox {...args} /> WithLabelAndBigContent.args = { ...args, label: 'This checkbox has a Label prop and a big content', children: ( <> Nullam quis risus eget urna mollis ornare vel eu leo. Cras mattis consectetur purus sit amet fermentum. <br /> Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Aenean lacinia bibendum nulla sed consectetur. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. </> ), }
src/components/InputField.js
Shashank1706/olep-serverless
import React from 'react'; export default class InputField extends React.Component { handleChange(e) { // var n = e.target.value; // this.props.func(n) != null ? this.props.func(n) : console.log(e.target.value) ; console.log(this.props.func == null) } render() { return ( <div className="row input-field"> <div className="col-lg-3 form-label">{this.props.label}</div> <div className="col-lg-9"> <input type="text" className="form-control" value={this.props.value} onChange={this.handleChange.bind(this)}/> </div> </div> ) } }
test/PageItemSpec.js
mcraiganthony/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import PageItem from '../src/PageItem'; describe('PageItem', function () { it('Should output a "list item" as root element, and an "anchor" as a child item', function () { let instance = ReactTestUtils.renderIntoDocument( <PageItem href="#">Text</PageItem> ); let node = React.findDOMNode(instance); assert.equal(node.nodeName, 'LI'); assert.equal(node.children.length, 1); assert.equal(node.children[0].nodeName, 'A'); }); it('Should output "disabled" attribute as a class', function () { let instance = ReactTestUtils.renderIntoDocument( <PageItem disabled href="#">Text</PageItem> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'disabled')); }); it('Should output "next" attribute as a class', function () { let instance = ReactTestUtils.renderIntoDocument( <PageItem previous href="#">Previous</PageItem> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'previous')); }); it('Should output "previous" attribute as a class', function () { let instance = ReactTestUtils.renderIntoDocument( <PageItem next href="#">Next</PageItem> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'next')); }); it('Should call "onSelect" when item is clicked', function (done) { function handleSelect(key, href) { assert.equal(key, 1); assert.equal(href, '#'); done(); } let instance = ReactTestUtils.renderIntoDocument( <PageItem eventKey={1} onSelect={handleSelect}>Next</PageItem> ); ReactTestUtils.Simulate.click(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a')); }); it('Should not call "onSelect" when item disabled and is clicked', function () { function handleSelect() { throw new Error('onSelect should not be called'); } let instance = ReactTestUtils.renderIntoDocument( <PageItem disabled onSelect={handleSelect}>Next</PageItem> ); ReactTestUtils.Simulate.click(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a')); }); it('Should set target attribute on anchor', function () { let instance = ReactTestUtils.renderIntoDocument( <PageItem next href="#" target="_blank">Next</PageItem> ); let anchor = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a'); assert.equal(React.findDOMNode(anchor).getAttribute('target'), '_blank'); }); it('Should call "onSelect" with target attribute', function (done) { function handleSelect(key, href, target) { assert.equal(target, '_blank'); done(); } let instance = ReactTestUtils.renderIntoDocument( <PageItem eventKey={1} onSelect={handleSelect} target="_blank">Next</PageItem> ); ReactTestUtils.Simulate.click(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'a')); }); });
src/svg-icons/maps/local-see.js
pancho111203/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsLocalSee = (props) => ( <SvgIcon {...props}> <circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/> </SvgIcon> ); MapsLocalSee = pure(MapsLocalSee); MapsLocalSee.displayName = 'MapsLocalSee'; MapsLocalSee.muiName = 'SvgIcon'; export default MapsLocalSee;
ajax/libs/core-js/0.2.2/shim.js
jasonpang/cdnjs
/** * Core.js 0.2.2 * https://github.com/zloirock/core-js * License: http://rock.mit-license.org * © 2014 Denis Pushkarev */ !function(returnThis, framework, undefined){ 'use strict'; /****************************************************************************** * Module : common * ******************************************************************************/ var global = returnThis() // Shortcuts for [[Class]] & property names , OBJECT = 'Object' , FUNCTION = 'Function' , ARRAY = 'Array' , STRING = 'String' , NUMBER = 'Number' , REGEXP = 'RegExp' , DATE = 'Date' , MAP = 'Map' , SET = 'Set' , WEAKMAP = 'WeakMap' , WEAKSET = 'WeakSet' , SYMBOL = 'Symbol' , PROMISE = 'Promise' , MATH = 'Math' , ARGUMENTS = 'Arguments' , PROTOTYPE = 'prototype' , CONSTRUCTOR = 'constructor' , TO_STRING = 'toString' , TO_LOCALE = 'toLocaleString' , HAS_OWN = 'hasOwnProperty' , FOR_EACH = 'forEach' , PROCESS = 'process' , CREATE_ELEMENT = 'createElement' // Aliases global objects and prototypes , Function = global[FUNCTION] , Object = global[OBJECT] , Array = global[ARRAY] , String = global[STRING] , Number = global[NUMBER] , RegExp = global[REGEXP] , Date = global[DATE] , Map = global[MAP] , Set = global[SET] , WeakMap = global[WEAKMAP] , WeakSet = global[WEAKSET] , Symbol = global[SYMBOL] , Math = global[MATH] , TypeError = global.TypeError , RangeError = global.RangeError , setTimeout = global.setTimeout , clearTimeout = global.clearTimeout , setImmediate = global.setImmediate , clearImmediate = global.clearImmediate , process = global[PROCESS] , nextTick = process && process.nextTick , document = global.document , navigator = global.navigator , define = global.define , ArrayProto = Array[PROTOTYPE] , ObjectProto = Object[PROTOTYPE] , FunctionProto = Function[PROTOTYPE] , Infinity = 1 / 0 , core = {} , path = framework ? global : core , DOT = '.'; // http://jsperf.com/core-js-isobject function isObject(it){ return it != null && (typeof it == 'object' || typeof it == 'function'); } function isFunction(it){ return typeof it == 'function'; } // Native function? var isNative = ctx(/./.test, /\[native code\]\s*\}\s*$/, 1); // Object internal [[Class]] or toStringTag // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring var toString = ObjectProto[TO_STRING]; var buildIn = { Undefined: 1, Null: 1, Array: 1, String: 1, Arguments: 1, Function: 1, Error: 1, Boolean: 1, Number: 1, Date: 1, RegExp: 1 } , TO_STRING_TAG = TO_STRING + 'Tag'; function setToStringTag(it, tag, stat){ if(it)has(it = stat ? it : it[PROTOTYPE], SYMBOL_TAG) || hidden(it, SYMBOL_TAG, tag); } function cof(it){ return it == undefined ? it === undefined ? 'Undefined' : 'Null' : toString.call(it).slice(8, -1); } function classof(it){ var klass = cof(it), tag; return klass == OBJECT && (tag = it[SYMBOL_TAG]) ? has(buildIn, tag) ? '~' + tag : tag : klass; } // Function var apply = FunctionProto.apply , call = FunctionProto.call , REFERENCE_GET; // Placeholder core._ = path._ = framework ? path._ || {} : {}; // Partial apply function part(/* ...args */){ var length = arguments.length , args = Array(length) , i = 0 , _ = path._ , holder = false; while(length > i)if((args[i] = arguments[i++]) === _)holder = true; return partial(this, args, length, holder, _, false); } // Internal partial application & context binding function partial(fn, argsPart, lengthPart, holder, _, bind, context){ assertFunction(fn); return function(/* ...args */){ var that = bind ? context : this , length = arguments.length , i = 0, j = 0, args; if(!holder && !length)return invoke(fn, argsPart, that); args = argsPart.slice(); if(holder)for(;lengthPart > i; i++)if(args[i] === _)args[i] = arguments[j++]; while(length > j)args.push(arguments[j++]); return invoke(fn, args, that); } } // Optional / simple context binding function ctx(fn, that, length){ assertFunction(fn); if(~length && that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); } case 2: return function(a, b){ return fn.call(that, a, b); } case 3: return function(a, b, c){ return fn.call(that, a, b, c); } } return function(/* ...args */){ return fn.apply(that, arguments); } } // Fast apply // http://jsperf.lnkit.com/fast-apply/5 function invoke(fn, args, that){ var un = that === undefined; switch(args.length | 0){ case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4]) : fn.call(that, args[0], args[1], args[2], args[3], args[4]); } return fn.apply(that, args); } // Object: var create = Object.create , getPrototypeOf = Object.getPrototypeOf , defineProperty = Object.defineProperty , defineProperties = Object.defineProperties , getOwnDescriptor = Object.getOwnPropertyDescriptor , getKeys = Object.keys , getNames = Object.getOwnPropertyNames , getSymbols = Object.getOwnPropertySymbols , ownKeys = function(it){ return getSymbols ? getNames(it).concat(getSymbols(it)) : getNames(it); } , has = ctx(call, ObjectProto[HAS_OWN], 2) // Dummy, fix for not array-like ES3 string in es5 module , ES5Object = Object; // 19.1.2.1 Object.assign(target, source, ...) var assign = Object.assign || function(target, source){ var T = Object(target) , l = arguments.length , i = 1; while(l > i){ var S = ES5Object(arguments[i++]) , keys = getKeys(S) , length = keys.length , j = 0 , key; while(length > j)T[key = keys[j++]] = S[key]; } return T; } function createObjectToArray(isEntries){ return function(object){ var O = ES5Object(object) , keys = getKeys(object) , length = keys.length , i = 0 , result = Array(length) , key; if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]]; else while(length > i)result[i] = O[keys[i++]]; return result; } } function keyOf(object, el){ var O = ES5Object(object) , keys = getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; } // Array // array('str1,str2,str3') => ['str1', 'str2', 'str3'] function array(it){ return String(it).split(','); } var push = ArrayProto.push , unshift = ArrayProto.unshift , slice = ArrayProto.slice , splice = ArrayProto.splice , indexOf = ArrayProto.indexOf , forEach = ArrayProto[FOR_EACH]; /* * 0 -> forEach * 1 -> map * 2 -> filter * 3 -> some * 4 -> every * 5 -> find * 6 -> findIndex */ function createArrayMethod(type){ var isMap = type == 1 , isFilter = type == 2 , isSome = type == 3 , isEvery = type == 4 , isFindIndex = type == 6 , noholes = type == 5 || isFindIndex; return function(callbackfn, that /* = undefined */){ var f = ctx(callbackfn, that, 3) , O = Object(this) , self = ES5Object(O) , length = toLength(self.length) , index = 0 , result = isMap ? Array(length) : isFilter ? [] : undefined , val, res; for(;length > index; index++)if(noholes || index in self){ val = self[index]; res = f(val, index, O); if(type){ if(isMap)result[index] = res; // map else if(res)switch(type){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(isEvery)return false; // every } } return isFindIndex ? -1 : isSome || isEvery ? isEvery : result; } } function createArrayContains(isContains){ return function(el, fromIndex /* = 0 */){ var O = ES5Object(this) , length = toLength(O.length) , index = toIndex(fromIndex, length); if(isContains && el != el){ for(;length > index; index++)if(sameNaN(O[index]))return isContains || index; } else for(;length > index; index++)if(isContains || index in O){ if(O[index] === el)return isContains || index; } return !isContains && -1; } } // Simple reduce to object function turn(mapfn, target /* = [] */){ assertFunction(mapfn); var memo = target == undefined ? [] : Object(target) , O = ES5Object(this) , length = toLength(O.length) , index = 0; for(;length > index; index++){ if(mapfn(memo, O[index], index, this) === false)break; } return memo; } function generic(A, B){ // strange IE quirks mode bug -> use typeof vs isFunction return typeof A == 'function' ? A : B; } // Math var MAX_SAFE_INTEGER = 0x1fffffffffffff // pow(2, 53) - 1 == 9007199254740991 , ceil = Math.ceil , floor = Math.floor , max = Math.max , min = Math.min , pow = Math.pow , random = Math.random , trunc = Math.trunc || function(it){ return (it > 0 ? floor : ceil)(it); } // 7.2.3 SameValue(x, y) function same(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; } // 20.1.2.4 Number.isNaN(number) function sameNaN(number){ return number != number; } // 7.1.4 ToInteger function toInteger(it){ return isNaN(it) ? 0 : trunc(it); } // 7.1.15 ToLength function toLength(it){ return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0; } function toIndex(index, length){ var index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); } function createReplacer(regExp, replace, isStatic){ var replacer = isObject(replace) ? function(part){ return replace[part]; } : replace; return function(it){ return String(isStatic ? it : this).replace(regExp, replacer); } } function createPointAt(toString){ return function(pos){ var s = String(this) , i = toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return toString ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? toString ? s.charAt(i) : a : toString ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; } } // Assertion & errors var REDUCE_ERROR = 'Reduce of empty object with no initial value'; function assert(condition, msg1, msg2){ if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1); } function assertFunction(it){ assert(isFunction(it), it, ' is not a function!'); return it; } function assertObject(it){ assert(isObject(it), it, ' is not an object!'); return it; } function assertInstance(it, Constructor, name){ assert(it instanceof Constructor, name, ": use the 'new' operator!"); } // Property descriptors & Symbol function descriptor(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value } } function simpleSet(object, key, value){ object[key] = value; return object; } function createDefiner(bitmap){ return DESC ? function(object, key, value){ return defineProperty(object, key, descriptor(bitmap, value)); } : simpleSet; } function uid(key){ return SYMBOL + '(' + key + ')_' + (++sid + random())[TO_STRING](36); } // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty. var DESC = !!function(){try{return defineProperty({}, 0, ObjectProto)}catch(e){}}() , sid = 0 , hidden = createDefiner(1) , symbol = Symbol || uid , set = Symbol ? simpleSet : hidden; // Iterators var ITERATOR = 'iterator' , SYMBOL_ITERATOR = Symbol && ITERATOR in Symbol ? Symbol[ITERATOR] : uid(SYMBOL + DOT + ITERATOR) , SYMBOL_TAG = Symbol && TO_STRING_TAG in Symbol ? Symbol[TO_STRING_TAG] : uid(SYMBOL + DOT + TO_STRING_TAG) , FF_ITERATOR = '@@' + ITERATOR , SUPPORT_FF_ITER = FF_ITERATOR in ArrayProto , ITER = symbol('iter') , SHIM = symbol('shim') , KEY = 1 , VALUE = 2 , Iterators = {} , IteratorPrototype = {} , COLLECTION_KEYS; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() setIterator(IteratorPrototype, returnThis); function setIterator(O, value){ hidden(O, SYMBOL_ITERATOR, value); // Add iterator for FF iterator protocol SUPPORT_FF_ITER && hidden(O, FF_ITERATOR, value); } function createIterator(Constructor, NAME, next, proto){ Constructor[PROTOTYPE] = create(proto || IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); } function defineIterator(Constructor, NAME, value){ var proto = Constructor[PROTOTYPE] , HAS_FF_ITER = has(proto, FF_ITERATOR); var iter = has(proto, SYMBOL_ITERATOR) ? proto[SYMBOL_ITERATOR] : HAS_FF_ITER ? proto[FF_ITERATOR] : value; if(framework){ // Define iterator setIterator(proto, iter); if(iter !== value){ var iterProto = getPrototypeOf(iter.call(new Constructor)); // Set @@toStringTag to native iterators setToStringTag(iterProto, NAME + ' Iterator', true); // FF fix HAS_FF_ITER && setIterator(iterProto, returnThis); } } // Plug for library Iterators[NAME] = iter; // FF & v8 fix Iterators[NAME + ' Iterator'] = returnThis; } function iterResult(done, value){ return {value: value, done: !!done}; } function isIterable(it){ var O = Object(it); return SYMBOL_ITERATOR in O || has(Iterators, classof(O)); } function getIterator(it){ return assertObject((it[SYMBOL_ITERATOR] || Iterators[classof(it)]).call(it)); } function stepCall(fn, value, entries){ return entries ? invoke(fn, value) : fn(value); } function forOf(iterable, entries, fn, that){ var iterator = getIterator(iterable) , f = ctx(fn, that, entries ? 2 : 1) , step; while(!(step = iterator.next()).done)if(stepCall(f, step.value, entries) === false)return; } // DOM var html = document && document.documentElement; // core var NODE = cof(process) == PROCESS , old = global.core // type bitmap , FORCED = 1 , GLOBAL = 2 , STATIC = 4 , PROTO = 8 , BIND = 16 , WRAP = 32; function $define(type, name, source){ var key, own, out, exp , isGlobal = type & GLOBAL , target = isGlobal ? global : (type & STATIC) ? global[name] : (global[name] || ObjectProto)[PROTOTYPE] , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // there is a similar native own = !(type & FORCED) && target && key in target && (!isFunction(target[key]) || isNative(target[key])); // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context if(type & BIND && own)exp = ctx(out, global); // wrap global constructors for prevent change them in library else if(type & WRAP && !framework && target[key] == out){ exp = function(param){ return this instanceof out ? new out(param) : out(param); } exp[PROTOTYPE] = out[PROTOTYPE]; } else exp = type & PROTO && isFunction(out) ? ctx(call, out) : out; // export if(exports[key] != out)exports[key] = exp; // extend global framework && target && !own && (isGlobal || delete target[key]) && hidden(target, key, out); } } // CommonJS export if(NODE)module.exports = core; // RequireJS export if(isFunction(define) && define.amd)define(function(){return core}); // Export to global object if(!NODE || framework){ core.noConflict = function(){ global.core = old; return core; } global.core = core; } /****************************************************************************** * Module : es5 * ******************************************************************************/ // ECMAScript 5 shim !function(IS_ENUMERABLE, Empty, _classof, $PROTO){ if(!DESC){ getOwnDescriptor = function(O, P){ if(has(O, P))return descriptor(!ObjectProto[IS_ENUMERABLE].call(O, P), O[P]); }; defineProperty = function(O, P, Attributes){ if('value' in Attributes)assertObject(O)[P] = Attributes.value; return O; }; defineProperties = function(O, Properties){ assertObject(O); var keys = getKeys(Properties) , length = keys.length , i = 0 , P, Attributes; while(length > i){ P = keys[i++]; Attributes = Properties[P]; if('value' in Attributes)O[P] = Attributes.value; } return O; }; } $define(STATIC + FORCED * !DESC, OBJECT, { // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: getOwnDescriptor, // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) defineProperty: defineProperty, // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) defineProperties: defineProperties }); // IE 8- don't enum bug keys var keys1 = [CONSTRUCTOR, HAS_OWN, 'isPrototypeOf', IS_ENUMERABLE, TO_LOCALE, TO_STRING, 'valueOf'] // Additional keys for getOwnPropertyNames , keys2 = keys1.concat('length', PROTOTYPE) , keysLen1 = keys1.length; // Create object with `null` prototype: use iframe Object with cleared prototype function createDict(){ // Thrash, waste and sodomy: IE GC bug var iframe = document[CREATE_ELEMENT]('iframe') , i = keysLen1 , iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = 'javascript:'; // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write('<script>document.F=Object</script>'); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict[PROTOTYPE][keys1[i]]; return createDict(); } function createGetKeys(names, length, isNames){ return function(object){ var O = ES5Object(object) , i = 0 , result = [] , key; for(key in O)if(key != $PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(length > i)if(has(O, key = names[i++])){ ~indexOf.call(result, key) || result.push(key); } return result; } } $define(STATIC, OBJECT, { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) getPrototypeOf: getPrototypeOf = getPrototypeOf || function(O){ if(has(assertObject(O), $PROTO))return O[$PROTO]; if(isFunction(O[CONSTRUCTOR]) && O instanceof O[CONSTRUCTOR]){ return O[CONSTRUCTOR][PROTOTYPE]; } return O instanceof Object ? ObjectProto : null; }, // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) getOwnPropertyNames: getNames = getNames || createGetKeys(keys2, keys2.length, true), // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) create: create = create || function(O, /*?*/Properties){ var result if(O !== null){ Empty[PROTOTYPE] = assertObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf shim result[CONSTRUCTOR][PROTOTYPE] === O || (result[$PROTO] = O); } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }, // 19.1.2.14 / 15.2.3.14 Object.keys(O) keys: getKeys = getKeys || createGetKeys(keys1, keysLen1, false) }); // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) $define(PROTO, FUNCTION, { bind: function(that /*, args... */){ var fn = assertFunction(this) , partArgs = slice.call(arguments, 1); function bound(/* args... */){ var args = partArgs.concat(slice.call(arguments)); if(this instanceof bound){ var instance = create(fn[PROTOTYPE]) , result = invoke(fn, args, instance); return isObject(result) ? result : instance; } return invoke(fn, args, that); } return bound; } }); // Fix for not array-like ES3 string function arrayMethodFix(fn){ return function(){ return fn.apply(ES5Object(this), arguments); } } if(!(0 in Object(DOT) && DOT[0] == DOT)){ ES5Object = function(it){ return cof(it) == STRING ? it.split('') : Object(it); } slice = arrayMethodFix(slice); } $define(PROTO + FORCED * (ES5Object != Object), ARRAY, { slice: slice, join: arrayMethodFix(ArrayProto.join) }); // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) $define(STATIC, ARRAY, { isArray: function(arg){ return cof(arg) == ARRAY } }); function createArrayReduce(isRight){ return function(callbackfn, memo){ assertFunction(callbackfn); var O = ES5Object(this) , length = toLength(O.length) , index = isRight ? length - 1 : 0 , i = isRight ? -1 : 1; if(2 > arguments.length)for(;;){ if(index in O){ memo = O[index]; index += i; break; } index += i; assert(isRight ? index >= 0 : length > index, REDUCE_ERROR); } for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ memo = callbackfn(memo, O[index], index, this); } return memo; } } $define(PROTO, ARRAY, { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: forEach = forEach || createArrayMethod(0), // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: createArrayMethod(1), // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: createArrayMethod(2), // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: createArrayMethod(3), // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: createArrayMethod(4), // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: createArrayReduce(false), // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: createArrayReduce(true), // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: indexOf = indexOf || createArrayContains(false), // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function(el, fromIndex /* = @[*-1] */){ var O = ES5Object(this) , length = toLength(O.length) , index = length - 1; if(arguments.length > 1)index = min(index, toInteger(fromIndex)); if(index < 0)index = toLength(length + index); for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; return -1; } }); // 21.1.3.25 / 15.5.4.20 String.prototype.trim() $define(PROTO, STRING, {trim: createReplacer(/^\s*([\s\S]*\S)?\s*$/, '$1')}); // 20.3.3.1 / 15.9.4.4 Date.now() $define(STATIC, DATE, {now: function(){ return +new Date; }}); if(_classof(function(){return arguments}()) == OBJECT)classof = function(it){ var cof = _classof(it); return cof == OBJECT && isFunction(it.callee) ? ARGUMENTS : cof; } }('propertyIsEnumerable', Function(), classof, symbol(PROTOTYPE)); /****************************************************************************** * Module : global * ******************************************************************************/ $define(GLOBAL + FORCED, {global: global}); /****************************************************************************** * Module : es6_symbol * ******************************************************************************/ // ECMAScript 6 symbols shim !function(TAG, SymbolRegistry){ // 19.4.1.1 Symbol([description]) if(!isNative(Symbol)){ Symbol = function(description){ assert(!(this instanceof Symbol), SYMBOL + ' is not a ' + CONSTRUCTOR); var tag = uid(description); defineProperty(ObjectProto, tag, { configurable: true, set: function(value){ hidden(this, tag, value); } }); return set(create(Symbol[PROTOTYPE]), TAG, tag); } hidden(Symbol[PROTOTYPE], TO_STRING, function(){ return this[TAG]; }); } $define(GLOBAL + WRAP, {Symbol: Symbol}); $define(STATIC, SYMBOL, { // 19.4.2.2 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = Symbol(key); }, // 19.4.2.6 Symbol.iterator iterator: SYMBOL_ITERATOR, // 19.4.2.7 Symbol.keyFor(sym) keyFor: part.call(keyOf, SymbolRegistry), // 19.4.2.10 Symbol.toStringTag toStringTag: SYMBOL_TAG = TO_STRING_TAG in Symbol ? Symbol[TO_STRING_TAG] : Symbol(SYMBOL + DOT + TO_STRING_TAG), pure: symbol, set: set }); setToStringTag(Symbol, SYMBOL); // 26.1.11 Reflect.ownKeys (target) $define(GLOBAL, {Reflect: {ownKeys: ownKeys}}); }(symbol('tag'), {}); /****************************************************************************** * Module : es6 * ******************************************************************************/ // ECMAScript 6 shim !function(isFinite, tmp){ $define(STATIC, OBJECT, { // 19.1.3.1 Object.assign(target, source) assign: assign, // 19.1.3.10 Object.is(value1, value2) is: same }); // 19.1.3.19 Object.setPrototypeOf(O, proto) // Works with __proto__ only. Old v8 can't works with null proto objects. '__proto__' in ObjectProto && function(buggy, set){ try { set = ctx(call, getOwnDescriptor(ObjectProto, '__proto__').set, 2); set({}, ArrayProto); } catch(e){ buggy = true } $define(STATIC, OBJECT, { setPrototypeOf: function(O, proto){ assertObject(O); assert(proto === null || isObject(proto), proto, ": can't set as prototype!"); if(buggy)O.__proto__ = proto; else set(O, proto); return O; } }); }(); // 20.1.2.3 Number.isInteger(number) var isInteger = Number.isInteger || function(it){ return isFinite(it) && floor(it) === it; } // 20.2.2.28 Math.sign(x) , sign = Math.sign || function sign(it){ return (it = +it) == 0 || it != it ? it : it < 0 ? -1 : 1; } , abs = Math.abs , exp = Math.exp , log = Math.log , sqrt = Math.sqrt , fcc = String.fromCharCode; // 20.2.2.5 Math.asinh(x) function asinh(x){ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1)); } $define(STATIC, NUMBER, { // 20.1.2.1 Number.EPSILON EPSILON: pow(2, -52), // 20.1.2.2 Number.isFinite(number) isFinite: function(it){ return typeof it == 'number' && isFinite(it); }, // 20.1.2.3 Number.isInteger(number) isInteger: isInteger, // 20.1.2.4 Number.isNaN(number) isNaN: sameNaN, // 20.1.2.5 Number.isSafeInteger(number) isSafeInteger: function(number){ return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER; }, // 20.1.2.6 Number.MAX_SAFE_INTEGER MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, // 20.1.2.10 Number.MIN_SAFE_INTEGER MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER, // 20.1.2.12 Number.parseFloat(string) parseFloat: parseFloat, // 20.1.2.13 Number.parseInt(string, radix) parseInt: parseInt }); $define(STATIC, MATH, { // 20.2.2.3 Math.acosh(x) acosh: function(x){ return log(x + sqrt(x * x - 1)); }, // 20.2.2.5 Math.asinh(x) asinh: asinh, // 20.2.2.7 Math.atanh(x) atanh: function(x){ return x == 0 ? +x : log((1 + +x) / (1 - x)) / 2; }, // 20.2.2.9 Math.cbrt(x) cbrt: function(x){ return sign(x) * pow(abs(x), 1 / 3); }, // 20.2.2.11 Math.clz32 (x) clz32: function(x){ return (x >>>= 0) ? 32 - x[TO_STRING](2).length : 32; }, // 20.2.2.12 Math.cosh(x) cosh: function(x){ return (exp(x) + exp(-x)) / 2; }, // 20.2.2.14 Math.expm1(x) expm1: function(x){ return x == 0 ? +x : x > -1e-6 && x < 1e-6 ? +x + x * x / 2 : exp(x) - 1; }, // 20.2.2.16 Math.fround(x) // TODO // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) hypot: function(value1, value2){ var sum = 0 , length = arguments.length , value; while(length--){ value = +arguments[length]; if(value == Infinity || value == -Infinity)return Infinity; sum += value * value; } return sqrt(sum); }, // 20.2.2.18 Math.imul(x, y) imul: function(x, y){ var UInt16 = 0xffff , xl = UInt16 & x , yl = UInt16 & y; return 0 | xl * yl + ((UInt16 & x >>> 16) * yl + xl * (UInt16 & y >>> 16) << 16 >>> 0); }, // 20.2.2.20 Math.log1p(x) log1p: function(x){ return x > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + +x); }, // 20.2.2.21 Math.log10(x) log10: function(x){ return log(x) / Math.LN10; }, // 20.2.2.22 Math.log2(x) log2: function(x){ return log(x) / Math.LN2; }, // 20.2.2.28 Math.sign(x) sign: sign, // 20.2.2.30 Math.sinh(x) sinh: function(x){ return x == 0 ? +x : (exp(x) - exp(-x)) / 2; }, // 20.2.2.33 Math.tanh(x) tanh: function(x){ return isFinite(x) ? x == 0 ? +x : (exp(x) - exp(-x)) / (exp(x) + exp(-x)) : sign(x); }, // 20.2.2.34 Math.trunc(x) trunc: trunc }); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, MATH, true); $define(STATIC, STRING, { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function(){ var res = [] , len = arguments.length , i = 0 , code while(len > i){ code = +arguments[i++]; if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fcc(code) : fcc(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); }, // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function(callSite){ var raw = ES5Object(callSite.raw) , len = toLength(raw.length) , sln = arguments.length , res = [] , i = 0; while(len > i){ res.push(String(raw[i++])); if(i < sln)res.push(String(arguments[i])); } return res.join(''); } }); $define(PROTO, STRING, { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: createPointAt(false), // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) endsWith: function(searchString, endPosition /* = @length */){ var len = this.length , end = endPosition === undefined ? len : min(toLength(endPosition), len); searchString += ''; return String(this).slice(end - searchString.length, end) === searchString; }, // 21.1.3.7 String.prototype.includes(searchString, position = 0) includes: function(searchString, position /* = 0 */){ return !!~String(this).indexOf(searchString, position); }, // 21.1.3.13 String.prototype.repeat(count) repeat: function(count){ var str = String(this) , res = '' , n = toInteger(count); if(0 > n)throw RangeError("Count can't be negative"); for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }, // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) startsWith: function(searchString, position /* = 0 */){ var index = toLength(min(position, this.length)); searchString += ''; return String(this).slice(index, index + searchString.length) === searchString; } }); $define(STATIC, ARRAY, { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function(arrayLike, mapfn /* -> it */, that /* = undefind */){ var O = Object(arrayLike) , result = new (generic(this, Array)) , mapping = mapfn !== undefined , f = mapping ? ctx(mapfn, that, 2) : undefined , index = 0 , length; if(isIterable(O))for(var iter = getIterator(O), step; !(step = iter.next()).done; index++){ result[index] = mapping ? f(step.value, index) : step.value; } else for(length = toLength(O.length); length > index; index++){ result[index] = mapping ? f(O[index], index) : O[index]; } result.length = index; return result; }, // 22.1.2.3 Array.of( ...items) of: function(/* ...args */){ var index = 0 , length = arguments.length , result = new (generic(this, Array))(length); while(length > index)result[index] = arguments[index++]; result.length = length; return result; } }); $define(PROTO, ARRAY, { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) copyWithin: function(target /* = 0 */, start /* = 0 */, end /* = @length */){ var O = Object(this) , len = toLength(O.length) , to = toIndex(target, len) , from = toIndex(start, len) , fin = end === undefined ? len : toIndex(end, len) , count = min(fin - from, len - to), inc = 1; if(from < to && to < from + count){ inc = -1; from = from + count - 1; to = to + count - 1; } while(count-- > 0){ if(from in O)O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }, // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) fill: function(value, start /* = 0 */, end /* = @length */){ var O = Object(this) , length = toLength(O.length) , index = toIndex(start, length) , endPos = end === undefined ? length : toIndex(end, length); while(endPos > index)O[index++] = value; return O; }, // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) find: createArrayMethod(5), // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) findIndex: createArrayMethod(6) }); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); if(framework){ // 19.1.3.6 Object.prototype.toString() tmp[SYMBOL_TAG] = DOT; if(cof(tmp) != DOT)hidden(ObjectProto, TO_STRING, function(){ return '[object ' + classof(this) + ']'; }); // 21.2.5.3 get RegExp.prototype.flags() if(/./g.flags != 'g')defineProperty(RegExp[PROTOTYPE], 'flags', { configurable: true, get: createReplacer(/^.*\/(\w*)$/, '$1') }); } }(isFinite, {}); /****************************************************************************** * Module : immediate * ******************************************************************************/ // setImmediate shim // Node.js 0.9+ & IE10+ has setImmediate, else: isFunction(setImmediate) && isFunction(clearImmediate) || function(ONREADYSTATECHANGE){ var postMessage = global.postMessage , addEventListener = global.addEventListener , MessageChannel = global.MessageChannel , counter = 0 , queue = {} , defer, channel, port; setImmediate = function(fn){ var args = [], i = 1; while(arguments.length > i)args.push(arguments[i++]); queue[++counter] = function(){ invoke(isFunction(fn) ? fn : Function(fn), args); } defer(counter); return counter; } clearImmediate = function(id){ delete queue[id]; } function run(id){ if(has(queue, id)){ var fn = queue[id]; delete queue[id]; fn(); } } function listner(event){ run(event.data); } // Node.js 0.8- if(NODE){ defer = function(id){ nextTick(part.call(run, id)); } // Modern browsers, skip implementation for WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is object } else if(addEventListener && isFunction(postMessage) && !global.importScripts){ defer = function(id){ postMessage(id, '*'); } addEventListener('message', listner, false); // WebWorkers } else if(isFunction(MessageChannel)){ channel = new MessageChannel; port = channel.port2; channel.port1.onmessage = listner; defer = ctx(port.postMessage, port, 1); // IE8- } else if(document && ONREADYSTATECHANGE in document[CREATE_ELEMENT]('script')){ defer = function(id){ html.appendChild(document[CREATE_ELEMENT]('script'))[ONREADYSTATECHANGE] = function(){ html.removeChild(this); run(id); } } // Rest old browsers } else { defer = function(id){ setTimeout(part.call(run, id), 0); } } }('onreadystatechange'); $define(GLOBAL + BIND, { setImmediate: setImmediate, clearImmediate: clearImmediate }); /****************************************************************************** * Module : es6_promise * ******************************************************************************/ // ES6 promises shim // Based on https://github.com/getify/native-promise-only/ !function(Promise, test){ isFunction(Promise) && isFunction(Promise.resolve) && Promise.resolve(test = new Promise(Function())) == test || function(asap, DEF){ function isThenable(o){ var then; if(isObject(o))then = o.then; return isFunction(then) ? then : false; } function notify(def){ var chain = def.chain; chain.length && asap(function(){ var msg = def.msg , ok = def.state == 1 , i = 0; while(chain.length > i)!function(react){ var cb = ok ? react.ok : react.fail , ret, then; try { if(cb){ ret = cb === true ? msg : cb(msg); if(ret === react.P){ react.rej(TypeError(PROMISE + '-chain cycle')); } else if(then = isThenable(ret)){ then.call(ret, react.res, react.rej); } else react.res(ret); } else react.rej(msg); } catch(err){ react.rej(err); } }(chain[i++]); chain.length = 0; }); } function resolve(msg){ var def = this , then, wrapper; if(def.done)return; def.done = true; def = def.def || def; // unwrap try { if(then = isThenable(msg)){ wrapper = {def: def, done: false}; // wrap then.call(msg, ctx(resolve, wrapper, 1), ctx(reject, wrapper, 1)); } else { def.msg = msg; def.state = 1; notify(def); } } catch(err){ reject.call(wrapper || {def: def, done: false}, err); // wrap } } function reject(msg){ var def = this; if(def.done)return; def.done = true; def = def.def || def; // unwrap def.msg = msg; def.state = 2; notify(def); } // 25.4.3.1 Promise(executor) Promise = function(executor){ assertFunction(executor); assertInstance(this, Promise, PROMISE); var def = {chain: [], state: 0, done: false, msg: undefined}; hidden(this, DEF, def); try { executor(ctx(resolve, def, 1), ctx(reject, def, 1)); } catch(err){ reject.call(def, err); } } // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) hidden(Promise[PROTOTYPE], 'then', function(onFulfilled, onRejected){ var react = { ok: isFunction(onFulfilled) ? onFulfilled : true, fail: isFunction(onRejected) ? onRejected : false } , P = react.P = new this[CONSTRUCTOR](function(resolve, reject){ react.res = assertFunction(resolve); react.rej = assertFunction(reject); }), def = this[DEF]; def.chain.push(react); def.state && notify(def); return P; }); // 25.4.5.1 Promise.prototype.catch(onRejected) hidden(Promise[PROTOTYPE], 'catch', function(onRejected){ return this.then(undefined, onRejected); }); // 25.4.4.1 Promise.all(iterable) hidden(Promise, 'all', function(iterable){ var Promise = this , values = []; return new Promise(function(resolve, reject){ forOf(iterable, false, push, values); var remaining = values.length , results = Array(remaining); if(remaining)forEach.call(values, function(promise, index){ Promise.resolve(promise).then(function(value){ results[index] = value; --remaining || resolve(results); }, reject); }); else resolve(results); }); }); // 25.4.4.4 Promise.race(iterable) hidden(Promise, 'race', function(iterable){ var Promise = this; return new Promise(function(resolve, reject){ forOf(iterable, false, function(promise){ Promise.resolve(promise).then(resolve, reject); }); }); }); // 25.4.4.5 Promise.reject(r) hidden(Promise, 'reject', function(r){ return new this(function(resolve, reject){ reject(r); }); }); // 25.4.4.6 Promise.resolve(x) hidden(Promise, 'resolve', function(x){ return isObject(x) && getPrototypeOf(x) === this[PROTOTYPE] ? x : new this(function(resolve, reject){ resolve(x); }); }); }(nextTick || setImmediate, symbol('def')); setToStringTag(Promise, PROMISE); $define(GLOBAL + FORCED * !isNative(Promise), {Promise: Promise}); }(global[PROMISE]); /****************************************************************************** * Module : es6_collections * ******************************************************************************/ // ECMAScript 6 collections shim !function(){ var KEYS = COLLECTION_KEYS = symbol('keys') , VALUES = symbol('values') , STOREID = symbol('storeId') , WEAKDATA = symbol('weakData') , WEAKID = symbol('weakId') , SIZE = DESC ? symbol('size') : 'size' , uid = 0 , wid = 0; function getCollection(C, NAME, methods, commonMethods, isMap, isWeak){ var ADDER_KEY = isMap ? 'set' : 'add' , init = commonMethods.clear , O = {}; function initFromIterable(that, iterable){ if(iterable != undefined)forOf(iterable, isMap, that[ADDER_KEY], that); return that; } if(!(isNative(C) && (isWeak || has(C[PROTOTYPE], FOR_EACH)))){ // create collection constructor C = function(iterable){ assertInstance(this, C, NAME); isWeak ? hidden(this, WEAKID, wid++) : init.call(this); initFromIterable(this, iterable); } set(C, SHIM, true); assign(C[PROTOTYPE], methods, commonMethods); isWeak || defineProperty(C[PROTOTYPE], 'size', {get: function(){ return this[SIZE]; }}); } else { var Native = C , collection = new C , adder = collection[ADDER_KEY] , buggyChaining, buggyZero; // wrap to init collections from iterable if(!(SYMBOL_ITERATOR in ArrayProto && C.length)){ C = function(iterable){ assertInstance(this, C, NAME); return initFromIterable(new Native, iterable); } C[PROTOTYPE] = Native[PROTOTYPE]; } buggyChaining = collection[ADDER_KEY](isWeak ? {} : -0, 1) !== collection; isWeak || collection[FOR_EACH](function(val, key){ if(same(key, -0))buggyZero = true; }); // fix .add & .set for chaining & converting -0 key to +0 if(framework && (buggyChaining || buggyZero)){ hidden(C[PROTOTYPE], ADDER_KEY, function(a, b){ adder.call(this, same(a, -0) ? 0 : a, b); return this; }); } } setToStringTag(C, NAME); O[NAME] = C; $define(GLOBAL + WRAP + FORCED * !isNative(C), O); return C; } function fastKey(it, create){ // return it with 'S' prefix if it's string or with 'P' prefix for over primitives if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it; // if it hasn't object id - add next if(!has(it, STOREID)){ if(create)hidden(it, STOREID, ++uid); else return ''; } // return object id with 'O' prefix return 'O' + it[STOREID]; } function collectionMethods($VALUES){ return { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function(){ hidden(this, SIZE, 0); hidden(this, KEYS, create(null)); if($VALUES == VALUES)hidden(this, VALUES, create(null)); }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function(key){ var index = fastKey(key) , keys = this[KEYS] , contains = index in keys; if(contains){ delete keys[index]; if($VALUES == VALUES)delete this[VALUES][index]; this[SIZE]--; } return contains; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function(callbackfn, that /* = undefined */){ var f = ctx(callbackfn, that, 3) , values = this[$VALUES] , keys = this[KEYS] , done = {} , k, index; do { for(index in keys){ if(index in done)continue; done[index] = true; f(values[index], keys[index], this); } } while(index != undefined && index != (k = getKeys(keys))[k.length - 1]); }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function(key){ return fastKey(key) in this[KEYS]; } } } // 23.1 Map Objects Map = getCollection(Map, MAP, { // 23.1.3.6 Map.prototype.get(key) get: function(key){ return this[VALUES][fastKey(key)]; }, // 23.1.3.9 Map.prototype.set(key, value) set: function(key, value){ var index = fastKey(key, true) , values = this[VALUES]; if(!(index in values)){ this[KEYS][index] = same(key, -0) ? 0 : key; this[SIZE]++; } values[index] = value; return this; } }, collectionMethods(VALUES), true); // 23.2 Set Objects Set = getCollection(Set, SET, { // 23.2.3.1 Set.prototype.add(value) add: function(value){ var index = fastKey(value, true) , values = this[KEYS]; if(!(index in values)){ values[index] = same(value, -0) ? 0 : value; this[SIZE]++; } return this; } }, collectionMethods(KEYS)); function getWeakData(it){ has(it, WEAKDATA) || hidden(it, WEAKDATA, {}); return it[WEAKDATA]; } function weakCollectionHas(key){ return isObject(key) && has(key, WEAKDATA) && has(key[WEAKDATA], this[WEAKID]); } var weakCollectionMethods = { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ return weakCollectionHas.call(this, key) && delete key[WEAKDATA][this[WEAKID]]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: weakCollectionHas }; // 23.3 WeakMap Objects WeakMap = getCollection(WeakMap, WEAKMAP, { // 23.3.3.3 WeakMap.prototype.get(key) get: function(key){ if(isObject(key) && has(key, WEAKDATA))return key[WEAKDATA][this[WEAKID]]; }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function(key, value){ getWeakData(assertObject(key))[this[WEAKID]] = value; return this; } }, weakCollectionMethods, true, true); // 23.4 WeakSet Objects WeakSet = getCollection(WeakSet, WEAKSET, { // 23.4.3.1 WeakSet.prototype.add(value) add: function(value){ getWeakData(assertObject(value))[this[WEAKID]] = true; return this; } }, weakCollectionMethods, false, true); }(); /****************************************************************************** * Module : es7 * ******************************************************************************/ !function(){ $define(PROTO, ARRAY, { // https://github.com/domenic/Array.prototype.includes includes: createArrayContains(true) }); $define(PROTO, STRING, { // https://github.com/mathiasbynens/String.prototype.at at: createPointAt(true) }); $define(STATIC, OBJECT, { // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-04/apr-9.md#51-objectentries-objectvalues values: createObjectToArray(false), entries: createObjectToArray(true) }); $define(STATIC, REGEXP, { // https://gist.github.com/kangax/9698100 escape: createReplacer(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true) }); }(); /****************************************************************************** * Module : es7_refs * ******************************************************************************/ // https://github.com/zenparsing/es-abstract-refs !function(REFERENCE){ REFERENCE_GET = Symbol(SYMBOL+DOT+REFERENCE+'Get'); var REFERENCE_SET = Symbol(SYMBOL+DOT+REFERENCE+SET) , REFERENCE_DELETE = Symbol(SYMBOL+DOT+REFERENCE+'Delete'); $define(STATIC, SYMBOL, { referenceGet: REFERENCE_GET, referenceSet: REFERENCE_SET, referenceDelete: REFERENCE_DELETE }); hidden(FunctionProto, REFERENCE_GET, returnThis); function setMapMethods(Constructor){ if(Constructor){ var MapProto = Constructor[PROTOTYPE]; hidden(MapProto, REFERENCE_GET, MapProto.get); hidden(MapProto, REFERENCE_SET, MapProto.set); hidden(MapProto, REFERENCE_DELETE, MapProto['delete']); } } setMapMethods(Map); setMapMethods(WeakMap); }('reference'); /****************************************************************************** * Module : es6_iterators * ******************************************************************************/ // ECMAScript 6 iterators shim !function(){ var getValues = createObjectToArray(false) // Safari define byggy iterators w/o `next` , buggy = 'keys' in ArrayProto && !('next' in [].keys()) , at = createPointAt(true); function defineStdIterators(Base, NAME, Constructor, next, DEFAULT){ function createIter(kind){ return function(){ return new Constructor(this, kind); } } // 21.1.5.2.2 %StringIteratorPrototype%[@@toStringTag] // 22.1.5.2.3 %ArrayIteratorPrototype%[@@toStringTag] // 23.1.5.2.3 %MapIteratorPrototype%[@@toStringTag] // 23.2.5.2.3 %SetIteratorPrototype%[@@toStringTag] createIterator(Constructor, NAME, next); DEFAULT && $define(PROTO + FORCED * buggy, NAME, { // 22.1.3.4 Array.prototype.entries() // 23.1.3.4 Map.prototype.entries() // 23.2.3.5 Set.prototype.entries() entries: createIter(KEY+VALUE), // 22.1.3.13 Array.prototype.keys() // 23.1.3.8 Map.prototype.keys() // 23.2.3.8 Set.prototype.keys() keys: createIter(KEY), // 22.1.3.29 Array.prototype.values() // 23.1.3.11 Map.prototype.values() // 23.2.3.10 Set.prototype.values() values: createIter(VALUE) }); // 21.1.3.27 String.prototype[@@iterator]() // 22.1.3.30 Array.prototype[@@iterator]() // 23.1.3.12 Map.prototype[@@iterator]() // 23.2.3.11 Set.prototype[@@iterator]() Base && defineIterator(Base, NAME, createIter(DEFAULT)); } // 21.1.5.1 CreateStringIterator Abstract Operation defineStdIterators(String, STRING, function(iterated){ set(this, ITER, {o: String(iterated), i: 0}); // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var iter = this[ITER] , iterated = iter.o , index = iter.i , point; if(index >= iterated.length)return iterResult(1); point = at.call(iterated, index); iter.i += point.length; return iterResult(0, point); }); // 22.1.5.1 CreateArrayIterator Abstract Operation defineStdIterators(Array, ARRAY, function(iterated, kind){ set(this, ITER, {o: ES5Object(iterated), i: 0, k: kind}); // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var iter = this[ITER] , iterated = iter.o , index = iter.i++ , kind = iter.k , value; if(index >= iterated.length)return iterResult(1); if(kind == KEY) value = index; else if(kind == VALUE)value = iterated[index]; else value = [index, iterated[index]]; return iterResult(0, value); }, VALUE); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators[ARGUMENTS] = Iterators[ARRAY]; // 23.1.5.1 CreateMapIterator Abstract Operation defineStdIterators(Map, MAP, function(iterated, kind){ var keys; if(Map[SHIM])keys = getValues(iterated[COLLECTION_KEYS]); else Map[PROTOTYPE][FOR_EACH].call(iterated, function(val, key){ this.push(key); }, keys = []); set(this, ITER, {o: iterated, k: kind, a: keys, i: 0}); // 23.1.5.2.1 %MapIteratorPrototype%.next() }, function(){ var iter = this[ITER] , iterated = iter.o , keys = iter.a , index = iter.i++ , kind = iter.k , key, value; if(index >= keys.length)return iterResult(1); key = keys[index]; if(kind == KEY) value = key; else if(kind == VALUE)value = iterated.get(key); else value = [key, iterated.get(key)]; return iterResult(0, value); }, KEY+VALUE); // 23.2.5.1 CreateSetIterator Abstract Operation defineStdIterators(Set, SET, function(iterated, kind){ var keys; if(Set[SHIM])keys = getValues(iterated[COLLECTION_KEYS]); else Set[PROTOTYPE][FOR_EACH].call(iterated, function(val){ this.push(val); }, keys = []); set(this, ITER, {k: kind, a: keys.reverse(), l: keys.length}); // 23.2.5.2.1 %SetIteratorPrototype%.next() }, function(){ var iter = this[ITER] , keys = iter.a , key; if(!keys.length)return iterResult(1); key = keys.pop(); return iterResult(0, iter.k == KEY+VALUE ? [key, key] : key); }, VALUE); }(); /****************************************************************************** * Module : timers * ******************************************************************************/ // ie9- setTimeout & setInterval additional parameters fix !function(MSIE){ function wrap(set){ return MSIE ? function(fn, time /*, ...args */){ return set(invoke(part, slice.call(arguments, 2), isFunction(fn) ? fn : Function(fn)), time); } : set; } $define(GLOBAL + BIND + FORCED * MSIE, { setTimeout: setTimeout = wrap(setTimeout), setInterval: wrap(setInterval) }); // ie9- dirty check }(!!navigator && /MSIE .\./.test(navigator.userAgent)); /****************************************************************************** * Module : array_statics * ******************************************************************************/ // JavaScript 1.6 / Strawman array statics shim !function(){ function setArrayStatics(keys, length){ $define(STATIC, ARRAY, turn.call( array(keys), function(memo, key){ if(key in ArrayProto)memo[key] = ctx(call, ArrayProto[key], length); }, {} )); } setArrayStatics('pop,reverse,shift,keys,values,entries', 1); setArrayStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); setArrayStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + 'reduce,reduceRight,copyWithin,fill,turn'); }(); /****************************************************************************** * Module : console * ******************************************************************************/ !function(console){ var $console = turn.call( /** * Methods from: * https://github.com/DeveloperToolsWG/console-object/blob/master/api.md * https://developer.mozilla.org/en-US/docs/Web/API/console */ array('assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,' + 'groupEnd,info,isIndependentlyComposed,log,markTimeline,profile,profileEnd,' + 'table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn'), function(memo, key){ var fn = console[key]; memo[key] = function(){ if(enabled && fn)return apply.call(fn, console, arguments); }; }, { enable: function(){ enabled = true; }, disable: function(){ enabled = false; } } ), enabled = true; try { framework && delete global.console; } catch(e){} $define(GLOBAL + FORCED, {console: assign($console.log, $console)}); }(global.console || {}); }(Function('return this'), true);
src/pages/page-2.js
evansantos/evansantos.github.io
import React from 'react' import Link from 'gatsby-link' const SecondPage = () => ( <div> <h1>Hi from the second page</h1> <p>Welcome to page 2</p> <Link to="/">Go back to the homepage</Link> </div> ) export default SecondPage
ajax/libs/datatables/1.10.1/js/jquery.js
steve-ng/cdnjs
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px") },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
ajax/libs/forerunnerdb/1.3.363/fdb-core.min.js
bootcdn/cdnjs
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("../lib/Core");a("../lib/Shim.IE8");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/Core":4,"../lib/Shim.IE8":27}],2:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a,b,c){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c,d){this._store=[],this._keys=[],void 0!==b&&this.index(b),void 0!==c&&this.compareFunc(c),void 0!==d&&this.hashFunc(d),void 0!==a&&this.data(a)},d.addModule("BinaryTree",f),d.mixin(f.prototype,"Mixin.ChainReactor"),d.mixin(f.prototype,"Mixin.Sorting"),d.mixin(f.prototype,"Mixin.Common"),d.synthesize(f.prototype,"compareFunc"),d.synthesize(f.prototype,"hashFunc"),d.synthesize(f.prototype,"indexDir"),d.synthesize(f.prototype,"keys"),d.synthesize(f.prototype,"index",function(a){return void 0!==a&&this.keys(this.extractKeys(a)),this.$super.call(this,a)}),f.prototype.extractKeys=function(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push({key:b,val:a[b]});return c},f.prototype.data=function(a){return void 0!==a?(this._data=a,this._hashFunc&&(this._hash=this._hashFunc(a)),this):this._data},f.prototype.push=function(a){return void 0!==a?(this._store.push(a),this):!1},f.prototype.pull=function(a){if(void 0!==a){var b=this._store.indexOf(a);if(b>-1)return this._store.splice(b,1),!0}return!1},f.prototype._compareFunc=function(a,b){var c,d,e=0;for(c=0;c<this._keys.length;c++)if(d=this._keys[c],1===d.val?e=this.sortAsc(a[d.key],b[d.key]):-1===d.val&&(e=this.sortDesc(a[d.key],b[d.key])),0!==e)return e;return e},f.prototype._hashFunc=function(a){return a[this._keys[0].key]},f.prototype.insert=function(a){var b,c,d,e;if(a instanceof Array){for(c=[],d=[],e=0;e<a.length;e++)this.insert(a[e])?c.push(a[e]):d.push(a[e]);return{inserted:c,failed:d}}return this._data?(b=this._compareFunc(this._data,a),0===b?(this.push(a),this._left?this._left.insert(a):this._left=new f(a,this._index,this._compareFunc,this._hashFunc),!0):-1===b?(this._right?this._right.insert(a):this._right=new f(a,this._index,this._compareFunc,this._hashFunc),!0):1===b?(this._left?this._left.insert(a):this._left=new f(a,this._index,this._compareFunc,this._hashFunc),!0):!1):(this.data(a),!0)},f.prototype.lookup=function(a,b){var c=this._compareFunc(this._data,a);return b=b||[],0===c&&(this._left&&this._left.lookup(a,b),b.push(this._data),this._right&&this._right.lookup(a,b)),-1===c&&this._right&&this._right.lookup(a,b),1===c&&this._left&&this._left.lookup(a,b),b},f.prototype.inOrder=function(a,b){switch(b=b||[],this._left&&this._left.inOrder(a,b),a){case"hash":b.push(this._hash);break;case"data":b.push(this._data);break;default:b.push({key:this._data,arr:this._store})}return this._right&&this._right.inOrder(a,b),b},f.prototype.findRange=function(a,b,c,d,e){e=e||[],this._left&&this._left.findRange(a,b,c,d,e);var f=this.sortAsc(this._data[b],c),g=this.sortAsc(this._data[b],d);if(!(0!==f&&1!==f||0!==g&&-1!==g))switch(a){case"hash":e.push(this._hash);break;case"data":e.push(this._data);break;default:e.push({key:this._data,arr:this._store})}return this._right&&this._right.findRange(a,b,c,d,e),e},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._index),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},d.finishModule("BinaryTree"),b.exports=f},{"./Path":23,"./Shared":26}],3:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m;d=a("./Shared");var n=function(a){this.init.apply(this,arguments)};n.prototype.init=function(a,b){this._primaryKey="_id",this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._name=a,this._data=[],this._metrics=new f,this._options=b||{changeTimestamp:!1},this._metaData={},this._deferQueue={insert:[],update:[],remove:[],upsert:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100},this._deferTime={insert:1,update:1,remove:1,upsert:1},this.subsetOf(this)},d.addModule("Collection",n),d.mixin(n.prototype,"Mixin.Common"),d.mixin(n.prototype,"Mixin.Events"),d.mixin(n.prototype,"Mixin.ChainReactor"),d.mixin(n.prototype,"Mixin.CRUD"),d.mixin(n.prototype,"Mixin.Constants"),d.mixin(n.prototype,"Mixin.Triggers"),d.mixin(n.prototype,"Mixin.Sorting"),d.mixin(n.prototype,"Mixin.Matching"),d.mixin(n.prototype,"Mixin.Updating"),d.mixin(n.prototype,"Mixin.Tags"),f=a("./Metrics"),g=a("./KeyValueStore"),h=a("./Path"),i=a("./IndexHashMap"),j=a("./IndexBinaryTree"),k=a("./Crc"),e=d.modules.Db,l=a("./Overload"),m=a("./ReactorIO"),n.prototype.crc=k,d.synthesize(n.prototype,"state"),d.synthesize(n.prototype,"name"),d.synthesize(n.prototype,"metaData"),n.prototype.data=function(){return this._data},n.prototype.drop=function(a){var b;if(this.isDropped())return a&&a(!1,!0),!0;if(this._db&&this._db._collection&&this._name){if(this.debug()&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this.emit("drop",this),delete this._db._collection[this._name],this._collate)for(b in this._collate)this._collate.hasOwnProperty(b)&&this.collateRemove(b);return delete this._primaryKey,delete this._primaryIndex,delete this._primaryCrc,delete this._crcLookup,delete this._name,delete this._data,delete this._metrics,a&&a(!1,!0),!0}return a&&a(!1,!0),!1},n.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey!==a&&(this._primaryKey=a,this._primaryIndex.primaryKey(a),this.rebuildPrimaryKeyIndex()),this):this._primaryKey},n.prototype._onInsert=function(a,b){this.emit("insert",a,b)},n.prototype._onUpdate=function(a){this.emit("update",a)},n.prototype._onRemove=function(a){this.emit("remove",a)},n.prototype._onChange=function(){this._options.changeTimestamp&&(this._metaData.lastChange=new Date)},d.synthesize(n.prototype,"db",function(a){return a&&"_id"===this.primaryKey()&&(this.primaryKey(a.primaryKey()),this.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(n.prototype,"mongoEmulation"),n.prototype.setData=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var d=this._metrics.create("setData");d.start(),b=this.options(b),this.preSetData(a,b,c),b.$decouple&&(a=this.decouple(a)),a instanceof Array||(a=[a]),d.time("transformIn"),a=this.transformIn(a),d.time("transformIn");var e=[].concat(this._data);this._dataReplace(a),d.time("Rebuild Primary Key Index"),this.rebuildPrimaryKeyIndex(b),d.time("Rebuild Primary Key Index"),d.time("Rebuild All Other Indexes"),this._rebuildIndexes(),d.time("Rebuild All Other Indexes"),d.time("Resolve chains"),this.chainSend("setData",a,{oldData:e}),d.time("Resolve chains"),d.stop(),this._onChange(),this.emit("setData",this._data,e)}return c&&c(!1),this},n.prototype.rebuildPrimaryKeyIndex=function(a){a=a||{$ensureKeys:void 0,$violationCheck:void 0};var b,c,d,e,f=a&&void 0!==a.$ensureKeys?a.$ensureKeys:!0,g=a&&void 0!==a.$violationCheck?a.$violationCheck:!0,h=this._primaryIndex,i=this._primaryCrc,j=this._crcLookup,k=this._primaryKey;for(h.truncate(),i.truncate(),j.truncate(),b=this._data,c=b.length;c--;){if(d=b[c],f&&this.ensurePrimaryKey(d),g){if(!h.uniqueSet(d[k],d))throw this.logIdentifier()+" Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: "+d[this._primaryKey]}else h.set(d[k],d);e=this.jStringify(d),i.set(d[k],e),j.set(e,d)}},n.prototype.ensurePrimaryKey=function(a){void 0===a[this._primaryKey]&&(a[this._primaryKey]=this.objectId())},n.prototype.truncate=function(){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.emit("truncate",this._data),this._data.length=0,this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._onChange(),this.deferEmit("change",{type:"truncate"}),this},n.prototype.upsert=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var c,d,e=this._deferQueue.upsert,f=this._deferThreshold.upsert,g={};if(a instanceof Array){if(a.length>f)return this._deferQueue.upsert=e.concat(a),this.processQueue("upsert",b),{};for(g=[],d=0;d<a.length;d++)g.push(this.upsert(a[d]));return b&&b(),g}switch(a[this._primaryKey]?(c={},c[this._primaryKey]=a[this._primaryKey],this._primaryIndex.lookup(c)[0]?g.op="update":g.op="insert"):g.op="insert",g.op){case"insert":g.result=this.insert(a);break;case"update":g.result=this.update(c,a)}return g}return b&&b(),{}},n.prototype.filter=function(a,b,c){return this.find(a,c).filter(b)},n.prototype.filterUpdate=function(a,b,c){var d,e,f,g,h=this.find(a,c),i=[],j=this.primaryKey();for(g=0;g<h.length;g++)d=h[g],f=b(d),f&&(e={},e[j]=d[j],i.push(this.update(e,f)));return i},n.prototype.update=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";b=this.decouple(b),this.mongoEmulation()&&(this.convertToFdb(a),this.convertToFdb(b)),b=this.transformIn(b),this.debug()&&console.log(this.logIdentifier()+" Updating some data");var d,e,f=this,g=this._metrics.create("update"),h=function(d){var e,h,i,j=f.decouple(d);return f.willTrigger(f.TYPE_UPDATE,f.PHASE_BEFORE)||f.willTrigger(f.TYPE_UPDATE,f.PHASE_AFTER)?(e=f.decouple(d),h={type:"update",query:f.decouple(a),update:f.decouple(b),options:f.decouple(c),op:g},i=f.updateObject(e,h.update,h.query,h.options,""),f.processTrigger(h,f.TYPE_UPDATE,f.PHASE_BEFORE,d,e)!==!1?(i=f.updateObject(d,e,h.query,h.options,""),f.processTrigger(h,f.TYPE_UPDATE,f.PHASE_AFTER,j,e)):i=!1):i=f.updateObject(d,b,a,c,""),f._updateIndexes(j,d),i};return g.start(),g.time("Retrieve documents to update"),d=this.find(a,{$decouple:!1}),g.time("Retrieve documents to update"),d.length&&(g.time("Update documents"),e=d.filter(h),g.time("Update documents"),e.length&&(g.time("Resolve chains"),this.chainSend("update",{query:a,update:b,dataSet:d},c),g.time("Resolve chains"),this._onUpdate(e),this._onChange(),this.deferEmit("change",{type:"update",data:e}))),g.stop(),e||[]},n.prototype._replaceObj=function(a,b){var c;this._removeFromIndexes(a);for(c in a)a.hasOwnProperty(c)&&delete a[c];for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);if(!this._insertIntoIndexes(a))throw this.logIdentifier()+" Primary key violation in update! Key violated: "+a[this._primaryKey];return this},n.prototype.updateById=function(a,b){var c={};return c[this._primaryKey]=a,this.update(c,b)},n.prototype.updateObject=function(a,b,c,d,e,f){b=this.decouple(b),e=e||"","."===e.substr(0,1)&&(e=e.substr(1,e.length-1));var g,i,j,k,l,m,n,o,p,q=!1,r=!1;for(p in b)if(b.hasOwnProperty(p)){if(g=!1,"$"===p.substr(0,1))switch(p){case"$key":case"$index":case"$data":case"$min":case"$max":g=!0;break;case"$each":for(g=!0,k=b.$each.length,j=0;k>j;j++)r=this.updateObject(a,b.$each[j],c,d,e),r&&(q=!0);q=q||r;break;default:g=!0,r=this.updateObject(a,b[p],c,d,e,p),q=q||r}if(this._isPositionalKey(p)&&(g=!0,p=p.substr(0,p.length-2),m=new h(e+"."+p),a[p]&&a[p]instanceof Array&&a[p].length)){for(i=[],j=0;j<a[p].length;j++)this._match(a[p][j],m.value(c)[0],d,"",{})&&i.push(j);for(j=0;j<i.length;j++)r=this.updateObject(a[p][i[j]],b[p+".$"],c,d,e+"."+p,f),q=q||r}if(!g)if(f||"object"!=typeof b[p])switch(f){case"$inc":var s=!0;b[p]>0?b.$max&&a[p]>=b.$max&&(s=!1):b[p]<0&&b.$min&&a[p]<=b.$min&&(s=!1),s&&(this._updateIncrement(a,p,b[p]),q=!0);break;case"$cast":switch(b[p]){case"array":a[p]instanceof Array||(this._updateProperty(a,p,b.$data||[]),q=!0);break;case"object":(!(a[p]instanceof Object)||a[p]instanceof Array)&&(this._updateProperty(a,p,b.$data||{}),q=!0);break;case"number":"number"!=typeof a[p]&&(this._updateProperty(a,p,Number(a[p])),q=!0);break;case"string":"string"!=typeof a[p]&&(this._updateProperty(a,p,String(a[p])),q=!0);break;default:throw this.logIdentifier()+" Cannot update cast to unknown type: "+b[p]}break;case"$push":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot push to a key that is not an array! ("+p+")";if(void 0!==b[p].$position&&b[p].$each instanceof Array)for(l=b[p].$position,k=b[p].$each.length,j=0;k>j;j++)this._updateSplicePush(a[p],l+j,b[p].$each[j]);else if(b[p].$each instanceof Array)for(k=b[p].$each.length,j=0;k>j;j++)this._updatePush(a[p],b[p].$each[j]);else this._updatePush(a[p],b[p]);q=!0;break;case"$pull":if(a[p]instanceof Array){for(i=[],j=0;j<a[p].length;j++)this._match(a[p][j],b[p],d,"",{})&&i.push(j);for(k=i.length;k--;)this._updatePull(a[p],i[k]),q=!0}break;case"$pullAll":if(a[p]instanceof Array){if(!(b[p]instanceof Array))throw this.logIdentifier()+" Cannot pullAll without being given an array of values to pull! ("+p+")";if(i=a[p],k=i.length,k>0)for(;k--;){for(l=0;l<b[p].length;l++)i[k]===b[p][l]&&(this._updatePull(a[p],k),k--,q=!0);if(0>k)break}}break;case"$addToSet":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot addToSet on a key that is not an array! ("+p+")";var t,u,v,w,x=a[p],y=x.length,z=!0,A=d&&d.$addToSet;for(b[p].$key?(v=!1,w=new h(b[p].$key),u=w.value(b[p])[0],delete b[p].$key):A&&A.key?(v=!1,w=new h(A.key),u=w.value(b[p])[0]):(u=this.jStringify(b[p]),v=!0),t=0;y>t;t++)if(v){if(this.jStringify(x[t])===u){z=!1;break}}else if(u===w.value(x[t])[0]){z=!1;break}z&&(this._updatePush(a[p],b[p]),q=!0);break;case"$splicePush":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot splicePush with a key that is not an array! ("+p+")";if(l=b.$index,void 0===l)throw this.logIdentifier()+" Cannot splicePush without a $index integer value!";delete b.$index,l>a[p].length&&(l=a[p].length),this._updateSplicePush(a[p],l,b[p]),q=!0;break;case"$move":if(!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot move on a key that is not an array! ("+p+")";for(j=0;j<a[p].length;j++)if(this._match(a[p][j],b[p],d,"",{})){var B=b.$index;if(void 0===B)throw this.logIdentifier()+" Cannot move without a $index integer value!";delete b.$index,this._updateSpliceMove(a[p],j,B),q=!0;break}break;case"$mul":this._updateMultiply(a,p,b[p]),q=!0;break;case"$rename":this._updateRename(a,p,b[p]),q=!0;break;case"$overwrite":this._updateOverwrite(a,p,b[p]),q=!0;break;case"$unset":this._updateUnset(a,p),q=!0;break;case"$clear":this._updateClear(a,p),q=!0;break;case"$pop":if(!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot pop from a key that is not an array! ("+p+")";this._updatePop(a[p],b[p])&&(q=!0);break;case"$toggle":this._updateProperty(a,p,!a[p]),q=!0;break;default:a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0)}else if(null!==a[p]&&"object"==typeof a[p])if(n=a[p]instanceof Array,o=b[p]instanceof Array,n||o)if(!o&&n)for(j=0;j<a[p].length;j++)r=this.updateObject(a[p][j],b[p],c,d,e+"."+p,f),q=q||r;else a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0);else r=this.updateObject(a[p],b[p],c,d,e+"."+p,f),q=q||r;else a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0)}return q},n.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},n.prototype.remove=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f,g,h,i,j,k,l=this;if("function"==typeof b&&(c=b,b={}),this.mongoEmulation()&&this.convertToFdb(a),a instanceof Array){for(g=[],f=0;f<a.length;f++)g.push(this.remove(a[f],{noEmit:!0}));return(!b||b&&!b.noEmit)&&this._onRemove(g),c&&c(!1,g),g}if(d=this.find(a,{$decouple:!1}),d.length){h=function(a){l._removeFromIndexes(a),e=l._data.indexOf(a),l._dataRemoveAtIndex(e)};for(var m=0;m<d.length;m++)j=d[m],l.willTrigger(l.TYPE_REMOVE,l.PHASE_BEFORE)||l.willTrigger(l.TYPE_REMOVE,l.PHASE_AFTER)?(i={type:"remove"},k=l.decouple(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_BEFORE,k,k)!==!1&&(h(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_AFTER,k,k))):h(j);this.chainSend("remove",{query:a,dataSet:d},b),(!b||b&&!b.noEmit)&&this._onRemove(d),this._onChange(),this.deferEmit("change",{type:"remove",data:d})}return c&&c(!1,d),d},n.prototype.removeById=function(a){var b={};return b[this._primaryKey]=a,this.remove(b)},n.prototype.processQueue=function(a,b,c){var d,e,f=this,g=this._deferQueue[a],h=this._deferThreshold[a],i=this._deferTime[a];if(c=c||{deferred:!0},g.length){if(g.length)switch(d=g.length>h?g.splice(0,h):g.splice(0,g.length),e=f[a](d),a){case"insert":c.inserted=c.inserted||[],c.failed=c.failed||[],c.inserted=c.inserted.concat(e.inserted),c.failed=c.failed.concat(e.failed)}setTimeout(function(){f.processQueue.call(f,a,b,c)},i)}else b&&b(c);this.isProcessingQueue()||this.emit("queuesComplete")},n.prototype.isProcessingQueue=function(){var a;for(a in this._deferQueue)if(this._deferQueue.hasOwnProperty(a)&&this._deferQueue[a].length)return!0;return!1},n.prototype.insert=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return"function"==typeof b?(c=b,b=this._data.length):void 0===b&&(b=this._data.length),a=this.transformIn(a),this._insertHandle(a,b,c)},n.prototype._insertHandle=function(a,b,c){var d,e,f,g=this._deferQueue.insert,h=this._deferThreshold.insert,i=[],j=[];if(a instanceof Array){if(a.length>h)return this._deferQueue.insert=g.concat(a),void this.processQueue("insert",c);for(f=0;f<a.length;f++)d=this._insert(a[f],b+f),d===!0?i.push(a[f]):j.push({doc:a[f],reason:d})}else d=this._insert(a,b),d===!0?i.push(a):j.push({doc:a,reason:d});return this.chainSend("insert",a,{index:b}),e={deferred:!1,inserted:i,failed:j},this._onInsert(i,j),c&&c(e),this._onChange(),this.deferEmit("change",{type:"insert",data:i}),e},n.prototype._insert=function(a,b){if(a){var c,d,e,f,g=this;if(this.ensurePrimaryKey(a),c=this.insertIndexViolation(a),e=function(a){g._insertIntoIndexes(a),b>g._data.length&&(b=g._data.length),g._dataInsertAtIndex(b,a)},c)return"Index violation in index: "+c;if(g.willTrigger(g.TYPE_INSERT,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)){if(d={type:"insert"},g.processTrigger(d,g.TYPE_INSERT,g.PHASE_BEFORE,{},a)===!1)return!1;e(a),g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)&&(f=g.decouple(a),g.processTrigger(d,g.TYPE_INSERT,g.PHASE_AFTER,{},f))}else e(a);return!0}return"No document passed to insert"},n.prototype._dataInsertAtIndex=function(a,b){this._data.splice(a,0,b)},n.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)},n.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)},n.prototype._insertIntoIndexes=function(a){var b,c,d=this._indexByName,e=this.jStringify(a);c=this._primaryIndex.uniqueSet(a[this._primaryKey],a),this._primaryCrc.uniqueSet(a[this._primaryKey],e),this._crcLookup.uniqueSet(e,a);for(b in d)d.hasOwnProperty(b)&&d[b].insert(a);return c},n.prototype._removeFromIndexes=function(a){var b,c=this._indexByName,d=this.jStringify(a);this._primaryIndex.unSet(a[this._primaryKey]),this._primaryCrc.unSet(a[this._primaryKey]),this._crcLookup.unSet(d);for(b in c)c.hasOwnProperty(b)&&c[b].remove(a)},n.prototype._updateIndexes=function(a,b){this._removeFromIndexes(a),this._insertIntoIndexes(b)},n.prototype._rebuildIndexes=function(){var a,b=this._indexByName;for(a in b)b.hasOwnProperty(a)&&b[a].rebuild()},n.prototype.subset=function(a,b){var c=this.find(a,b);return(new n).subsetOf(this).primaryKey(this._primaryKey).setData(c)},d.synthesize(n.prototype,"subsetOf"),n.prototype.isSubsetOf=function(a){return this._subsetOf===a},n.prototype.distinct=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f=this.find(b,c),g=new h(a),i={},j=[];for(e=0;e<f.length;e++)d=g.value(f[e])[0],d&&!i[d]&&(i[d]=!0,j.push(d));return j},n.prototype.findById=function(a,b){var c={};return c[this._primaryKey]=a,this.find(c,b)[0]},n.prototype.peek=function(a,b){var c,d,e=this._data,f=e.length,g=new n,h=typeof a;if("string"===h){for(c=0;f>c;c++)d=this.jStringify(e[c]),d.indexOf(a)>-1&&g.insert(e[c]);return g.find({},b)}return this.find(a,b)},n.prototype.explain=function(a,b){var c=this.find(a,b);return c.__fdbOp._data},n.prototype.options=function(a){return a=a||{},a.$decouple=void 0!==a.$decouple?a.$decouple:!0,a.$explain=void 0!==a.$explain?a.$explain:!1,a},n.prototype.find=function(a,b,c){return this.mongoEmulation()&&this.convertToFdb(a),c?(c("Callbacks for the find() operation are not yet implemented!",[]),[]):this._find.apply(this,arguments)},n.prototype._find=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";a=a||{},b=this.options(b);var c,d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=this._metrics.create("find"),I=this.primaryKey(),J=this,K=!0,L={},M=[],N=[],O=[],P={},Q={},R=function(c){return J._match(c,a,b,"and",P)};if(H.start(),a){if(H.time("analyseQuery"),c=this._analyseQuery(J.decouple(a),b,H),H.time("analyseQuery"),H.data("analysis",c),c.hasJoin&&c.queriesJoin){for(H.time("joinReferences"),g=0;g<c.joinsOn.length;g++)k=c.joinsOn[g],j=new h(c.joinQueries[k]),i=j.value(a)[0],L[c.joinsOn[g]]=this._db.collection(c.joinsOn[g]).subset(i),delete a[c.joinQueries[k]];H.time("joinReferences")}if(c.indexMatch.length&&(!b||b&&!b.$skipIndex)?(H.data("index.potential",c.indexMatch),H.data("index.used",c.indexMatch[0].index),H.time("indexLookup"),e=c.indexMatch[0].lookup||[],H.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(K=!1)):H.flag("usedIndex",!1),K&&(e&&e.length?(d=e.length,H.time("tableScan: "+d),e=e.filter(R)):(d=this._data.length,H.time("tableScan: "+d),e=this._data.filter(R)),H.time("tableScan: "+d)),b.$orderBy&&(H.time("sort"),e=this.sort(b.$orderBy,e),H.time("sort")),void 0!==b.$page&&void 0!==b.$limit&&(Q.page=b.$page,Q.pages=Math.ceil(e.length/b.$limit),Q.records=e.length,b.$page&&b.$limit>0&&(H.data("cursor",Q),e.splice(0,b.$page*b.$limit))),b.$skip&&(Q.skip=b.$skip,e.splice(0,b.$skip),H.data("skip",b.$skip)),b.$limit&&e&&e.length>b.$limit&&(Q.limit=b.$limit,e.length=b.$limit,H.data("limit",b.$limit)),b.$decouple&&(H.time("decouple"),e=this.decouple(e),H.time("decouple"),H.data("flag.decouple",!0)),b.$join){for(f=0;f<b.$join.length;f++)for(k in b.$join[f])if(b.$join[f].hasOwnProperty(k))for(w=k,l=L[k]?L[k]:this._db.collection(k),m=b.$join[f][k],x=0;x<e.length;x++){o={},q=!1,r=!1,v="";for(n in m)if(m.hasOwnProperty(n))if("$"===n.substr(0,1))switch(n){case"$where":m[n].query&&(o=m[n].query),m[n].options&&(p=m[n].options);break;case"$as":w=m[n];break;case"$multi":q=m[n];break;case"$require":r=m[n];break;case"$prefix":v=m[n]}else o[n]=J._resolveDynamicQuery(m[n],e[x]);if(s=l.find(o,p),!r||r&&s[0])if("$root"===w){if(q!==!1)throw this.logIdentifier()+' Cannot combine [$as: "$root"] with [$joinMulti: true] in $join clause!';t=s[0],u=e[x];for(C in t)t.hasOwnProperty(C)&&void 0===u[v+C]&&(u[v+C]=t[C])}else e[x][w]=q===!1?s[0]:s;else M.push(e[x])}H.data("flag.join",!0)}if(M.length){for(H.time("removalQueue"),z=0;z<M.length;z++)y=e.indexOf(M[z]),y>-1&&e.splice(y,1);H.time("removalQueue")}if(b.$transform){for(H.time("transform"),z=0;z<e.length;z++)e.splice(z,1,b.$transform(e[z]));H.time("transform"),H.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(H.time("transformOut"),e=this.transformOut(e),H.time("transformOut")),H.data("results",e.length)}else e=[];H.time("scanFields");for(z in b)b.hasOwnProperty(z)&&0!==z.indexOf("$")&&(1===b[z]?N.push(z):0===b[z]&&O.push(z));if(H.time("scanFields"),N.length||O.length){for(H.data("flag.limitFields",!0),H.data("limitFields.on",N),H.data("limitFields.off",O),H.time("limitFields"),z=0;z<e.length;z++){G=e[z];for(A in G)G.hasOwnProperty(A)&&(N.length&&A!==I&&-1===N.indexOf(A)&&delete G[A],O.length&&O.indexOf(A)>-1&&delete G[A])}H.time("limitFields")}if(b.$elemMatch){H.data("flag.elemMatch",!0),H.time("projection-elemMatch");for(z in b.$elemMatch)if(b.$elemMatch.hasOwnProperty(z))for(D=new h(z),A=0;A<e.length;A++)if(E=D.value(e[A])[0],E&&E.length)for(B=0;B<E.length;B++)if(J._match(E[B],b.$elemMatch[z],b,"",{})){D.set(e[A],z,[E[B]]);break}H.time("projection-elemMatch")}if(b.$elemsMatch){H.data("flag.elemsMatch",!0),H.time("projection-elemsMatch");for(z in b.$elemsMatch)if(b.$elemsMatch.hasOwnProperty(z))for(D=new h(z),A=0;A<e.length;A++)if(E=D.value(e[A])[0],E&&E.length){for(F=[],B=0;B<E.length;B++)J._match(E[B],b.$elemsMatch[z],b,"",{})&&F.push(E[B]);D.set(e[A],z,F)}H.time("projection-elemsMatch")}return H.stop(),e.__fdbOp=H,e.$cursor=Q,e},n.prototype._resolveDynamicQuery=function(a,b){var c,d,e,f,g=this;if("string"==typeof a)return"$$."===a.substr(0,3)?new h(a.substr(3,a.length-3)).value(b)[0]:new h(a).value(b)[0];c={};for(f in a)if(a.hasOwnProperty(f))switch(d=typeof a[f],e=a[f],d){case"string":"$$."===e.substr(0,3)?c[f]=new h(e.substr(3,e.length-3)).value(b)[0]:c[f]=e;break;case"object":c[f]=g._resolveDynamicQuery(e,b);break;default:c[f]=e}return c},n.prototype.findOne=function(){return this.find.apply(this,arguments)[0]},n.prototype.indexOf=function(a,b){var c,d=this.find(a,{$decouple:!1})[0];return d?!b||b&&!b.$orderBy?this._data.indexOf(d):(b.$decouple=!1,c=this.find(a,b),c.indexOf(d)):-1},n.prototype.indexOfDocById=function(a,b){var c,d;return c="object"!=typeof a?this._primaryIndex.get(a):this._primaryIndex.get(a[this._primaryKey]),c?!b||b&&!b.$orderBy?this._data.indexOf(c):(b.$decouple=!1,d=this.find({},b),d.indexOf(c)):-1},n.prototype.removeByIndex=function(a){var b,c;return b=this._data[a],void 0!==b?(b=this.decouple(b),c=b[this.primaryKey()],this.removeById(c)):!1},n.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},n.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof Array){var b,c=[];for(b=0;b<a.length;b++)c[b]=this._transformIn(a[b]);return c}return this._transformIn(a)}return a},n.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var b,c=[];for(b=0;b<a.length;b++)c[b]=this._transformOut(a[b]);return c}return this._transformOut(a)}return a},n.prototype.sort=function(a,b){b=b||[];var c,d,e=[];for(c in a)a.hasOwnProperty(c)&&(d={},d[c]=a[c],d.___fdbKey=String(c),e.push(d));return e.length<2?this._sort(a,b):this._bucketSort(e,b)},n.prototype._bucketSort=function(a,b){var c,d,e,f,g,h,i=a.shift(),j=[];if(a.length>0){for(b=this._sort(i,b),d=this.bucket(i.___fdbKey,b),e=d.order,g=d.buckets,h=0;h<e.length;h++)f=e[h],c=[].concat(a),j=j.concat(this._bucketSort(c,g[f]));return j}return this._sort(i,b)},n.prototype._sort=function(a,b){var c,d=this,e=new h,f=e.parse(a,!0)[0];if(e.path(f.path),1===f.value)c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortAsc(c,f)};else{if(-1!==f.value)throw this.logIdentifier()+" $orderBy clause has invalid direction: "+f.value+", accepted values are 1 or -1 for ascending or descending!";c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortDesc(c,f)}}return b.sort(c)},n.prototype.bucket=function(a,b){var c,d,e,f=[],g={};for(c=0;c<b.length;c++)e=String(b[c][a]),d!==e&&(f.push(e),d=e),g[e]=g[e]||[],g[e].push(b[c]);return{buckets:g,order:f}},n.prototype._analyseQuery=function(a,b,c){var d,e,f,g,i,j,k,l,m,n,o,p={queriesOn:[this._name],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:b},q=[],r=[];if(c.time("checkIndexes"),m=new h,n=m.countKeys(a)){void 0!==a[this._primaryKey]&&(c.time("checkIndexMatch: Primary Key"),p.indexMatch.push({lookup:this._primaryIndex.lookup(a,b),keyData:{matchedKeys:[this._primaryKey],totalKeyCount:n,score:1},index:this._primaryIndex}),c.time("checkIndexMatch: Primary Key"));for(o in this._indexById)if(this._indexById.hasOwnProperty(o)&&(j=this._indexById[o],k=j.name(),c.time("checkIndexMatch: "+k),i=j.match(a,b),i.score>0&&(l=j.lookup(a,b),p.indexMatch.push({lookup:l,keyData:i,index:j})),c.time("checkIndexMatch: "+k),i.score===n))break;c.time("checkIndexes"),p.indexMatch.length>1&&(c.time("findOptimalIndex"),p.indexMatch.sort(function(a,b){return a.keyData.score>b.keyData.score?-1:a.keyData.score<b.keyData.score?1:a.keyData.score===b.keyData.score?a.lookup.length-b.lookup.length:void 0}),c.time("findOptimalIndex"))}if(b.$join){for(p.hasJoin=!0,d=0;d<b.$join.length;d++)for(e in b.$join[d])b.$join[d].hasOwnProperty(e)&&(q.push(e),"$as"in b.$join[d][e]?r.push(b.$join[d][e].$as):r.push(e));for(g=0;g<r.length;g++)f=this._queryReferencesCollection(a,r[g],""),f&&(p.joinQueries[q[g]]=f,p.queriesJoin=!0);p.joinsOn=q,p.queriesOn=p.queriesOn.concat(q)}return p},n.prototype._queryReferencesCollection=function(a,b,c){var d;for(d in a)if(a.hasOwnProperty(d)){if(d===b)return c&&(c+="."),c+d;if("object"==typeof a[d])return c&&(c+="."),c+=d,this._queryReferencesCollection(a[d],b,c)}return!1},n.prototype.count=function(a,b){return a?this.find(a,b).length:this._data.length},n.prototype.findSub=function(a,b,c,d){var e,f,g,i=new h(b),j=this.find(a),k=j.length,l=this._db.collection("__FDB_temp_"+this.objectId()),m={parents:k,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(d=d||{},e=0;k>e;e++)if(f=i.value(j[e])[0]){if(l.setData(f),g=l.find(c,d),d.returnFirst&&g.length)return g[0];d.$split?m.subDocs.push(g):m.subDocs=m.subDocs.concat(g),m.subDocTotal+=g.length,m.pathFound=!0}return l.drop(),d.$stats?m:m.subDocs},n.prototype.insertIndexViolation=function(a){var b,c,d,e=this._indexByName;if(this._primaryIndex.get(a[this._primaryKey]))b=this._primaryIndex;else for(c in e)if(e.hasOwnProperty(c)&&(d=e[c],d.unique()&&d.violation(a))){b=d;break}return b?b.name():!1},n.prototype.ensureIndex=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";this._indexByName=this._indexByName||{},this._indexById=this._indexById||{};var c,d={start:(new Date).getTime()};if(b)switch(b.type){case"hashed":c=new i(a,b,this);break;case"btree":c=new j(a,b,this);break;default:c=new i(a,b,this)}else c=new i(a,b,this);return this._indexByName[c.name()]?{err:"Index with that name already exists"}:this._indexById[c.id()]?{err:"Index with those keys already exists"}:(c.rebuild(),this._indexByName[c.name()]=c,this._indexById[c.id()]=c,d.end=(new Date).getTime(),d.total=d.end-d.start,this._lastOp={type:"ensureIndex",stats:{time:d}},{index:c,id:c.id(),name:c.name(),state:c.state()})},n.prototype.index=function(a){return this._indexByName?this._indexByName[a]:void 0},n.prototype.lastOp=function(){return this._metrics.list()},n.prototype.diff=function(a){var b,c,d,e,f={insert:[],update:[],remove:[]},g=this.primaryKey();if(g!==a.primaryKey())throw this.logIdentifier()+" Diffing requires that both collections have the same primary key!";for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;for(e=b.length,c=0;e>c;c++)d=b[c],this._primaryIndex.get(d[g])?this._primaryCrc.get(d[g])!==a._primaryCrc.get(d[g])&&f.update.push(d):f.insert.push(d);for(b=this._data,e=b.length,c=0;e>c;c++)d=b[c],a._primaryIndex.get(d[g])||f.remove.push(d);return f},n.prototype.collateAdd=new l({"object, string":function(a,b){var c=this;c.collateAdd(a,function(d){var e,f;switch(d.type){case"insert":b?(e={$push:{}},e.$push[b]=c.decouple(d.data),c.update({},e)):c.insert(d.data);break;case"update":b?(e={},f={},e[b]=d.data.query,f[b+".$"]=d.data.update,c.update(e,f)):c.update(d.data.query,d.data.update);break;case"remove":b?(e={$pull:{}},e.$pull[b]={},e.$pull[b][c.primaryKey()]=d.data.dataSet[0][a.primaryKey()], c.update({},e)):c.remove(d.data)}})},"object, function":function(a,b){if("string"==typeof a&&(a=this._db.collection(a,{autoCreate:!1,throwError:!1})),a)return this._collate=this._collate||{},this._collate[a.name()]=new m(a,this,b),this;throw"Cannot collate from a non-existent collection!"}}),n.prototype.collateRemove=function(a){if("object"==typeof a&&(a=a.name()),a)return this._collate[a].drop(),delete this._collate[a],this;throw"No collection name passed to collateRemove() or collection not found!"},e.prototype.collection=new l({"":function(){return this.$main.call(this,{name:this.objectId()})},object:function(a){return a instanceof n?"droppped"!==a.state()?a:this.$main.call(this,{name:a.name()}):this.$main.call(this,a)},string:function(a){return this.$main.call(this,{name:a})},"string, string":function(a,b){return this.$main.call(this,{name:a,primaryKey:b})},"string, object":function(a,b){return b.name=a,this.$main.call(this,b)},"string, string, object":function(a,b,c){return c.name=a,c.primaryKey=b,this.$main.call(this,c)},$main:function(a){var b=a.name;if(b){if(!this._collection[b]){if(a&&a.autoCreate===!1&&a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection "+b+" because it does not exist and auto-create has been disabled!";this.debug()&&console.log(this.logIdentifier()+" Creating collection "+b)}return this._collection[b]=this._collection[b]||new n(b,a).db(this),this._collection[b].mongoEmulation(this.mongoEmulation()),void 0!==a.primaryKey&&this._collection[b].primaryKey(a.primaryKey),this._collection[b]}if(!a||a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection with undefined name!"}}),e.prototype.collectionExists=function(a){return Boolean(this._collection[a])},e.prototype.collections=function(a){var b,c,d=[],e=this._collection;a&&(a instanceof RegExp||(a=new RegExp(a)));for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?a.exec(c)&&d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}):d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}));return d.sort(function(a,b){return a.name.localeCompare(b.name)}),d},d.finishModule("Collection"),b.exports=n},{"./Crc":5,"./IndexBinaryTree":7,"./IndexHashMap":8,"./KeyValueStore":9,"./Metrics":10,"./Overload":22,"./Path":23,"./ReactorIO":24,"./Shared":26}],4:[function(a,b,c){"use strict";var d,e,f,g,h=[];d=a("./Shared"),g=a("./Overload");var i=function(a){this.init.apply(this,arguments)};i.prototype.init=function(a){this._db={},this._debug={},this._name=a||"ForerunnerDB",h.push(this)},i.prototype.instantiatedCount=function(){return h.length},i.prototype.instances=function(a){return void 0!==a?h[a]:h},i.prototype.namedInstances=function(a){var b,c;{if(void 0===a){for(c=[],b=0;b<h.length;b++)c.push(h[b].name);return c}for(b=0;b<h.length;b++)if(h[b].name===a)return h[b]}},i.prototype.moduleLoaded=new g({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b()}},"array, function":function(a,b){var c,e;for(e=0;e<a.length;e++)if(c=a[e],void 0!==c){c=c.replace(/ /g,"");var f,g=c.split(",");for(f=0;f<g.length;f++)if(!d.modules[g[f]])return!1}b()},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),i.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},i.moduleLoaded=i.prototype.moduleLoaded,i.version=i.prototype.version,i.instances=i.prototype.instances,i.instantiatedCount=i.prototype.instantiatedCount,i.shared=d,i.prototype.shared=d,d.addModule("Core",i),d.mixin(i.prototype,"Mixin.Common"),d.mixin(i.prototype,"Mixin.Constants"),e=a("./Db.js"),f=a("./Metrics.js"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"mongoEmulation"),i.prototype._isServer=!1,i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.collection=function(){throw"ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"},b.exports=i},{"./Db.js":6,"./Metrics.js":10,"./Overload":22,"./Shared":26}],5:[function(a,b,c){"use strict";var d=function(){var a,b,c,d=[];for(b=0;256>b;b++){for(a=b,c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;d[b]=a}return d}();b.exports=function(a){var b,c=-1;for(b=0;b<a.length;b++)c=c>>>8^d[255&(c^a.charCodeAt(b))];return(-1^c)>>>0}},{}],6:[function(a,b,c){"use strict";var d,e,f,g,h,i;d=a("./Shared"),i=a("./Overload");var j=function(a,b){this.init.apply(this,arguments)};j.prototype.init=function(a,b){this.core(b),this._primaryKey="_id",this._name=a,this._collection={},this._debug={}},d.addModule("Db",j),j.prototype.moduleLoaded=new i({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b()}},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),j.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},j.moduleLoaded=j.prototype.moduleLoaded,j.version=j.prototype.version,j.shared=d,j.prototype.shared=d,d.addModule("Db",j),d.mixin(j.prototype,"Mixin.Common"),d.mixin(j.prototype,"Mixin.ChainReactor"),d.mixin(j.prototype,"Mixin.Constants"),e=d.modules.Core,f=a("./Collection.js"),g=a("./Metrics.js"),h=a("./Crc.js"),j.prototype._isServer=!1,d.synthesize(j.prototype,"core"),d.synthesize(j.prototype,"primaryKey"),d.synthesize(j.prototype,"state"),d.synthesize(j.prototype,"name"),d.synthesize(j.prototype,"mongoEmulation"),j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.crc=h,j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.arrayToCollection=function(a){return(new f).setData(a)},j.prototype.on=function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(b),this},j.prototype.off=function(a,b){if(a in this._listeners){var c=this._listeners[a],d=c.indexOf(b);d>-1&&c.splice(d,1)}return this},j.prototype.emit=function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d=this._listeners[a],e=d.length;for(c=0;e>c;c++)d[c].apply(this,Array.prototype.slice.call(arguments,1))}return this},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peekCat=function(a){var b,c,d,e={},f=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],"string"===f?(d=c.peek(a),d&&d.length&&(e[c.name()]=d)):(d=c.find(a),d&&d.length&&(e[c.name()]=d)));return e},j.prototype.drop=new i({"":function(){if(!this.isDropped()){var a,b=this.collections(),c=b.length;for(this._state="dropped",a=0;c>a;a++)this.collection(b[a].name).drop(),delete this._collection[b[a].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"function":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length,e=0,f=function(){e++,e===d&&a&&a()};for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(f),delete this._collection[c[b].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"boolean":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length;for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(a),delete this._collection[c[b].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"boolean, function":function(a,b){if(!this.isDropped()){var c,d=this.collections(),e=d.length,f=0,g=function(){f++,f===e&&b&&b()};for(this._state="dropped",c=0;e>c;c++)this.collection(d[c].name).drop(a,g),delete this._collection[d[c].name];this.emit("drop",this),delete this._core._db[this._name]}return!0}}),e.prototype.db=function(a){return a instanceof j?a:(a||(a=this.objectId()),this._db[a]=this._db[a]||new j(a,this),this._db[a].mongoEmulation(this.mongoEmulation()),this._db[a])},e.prototype.databases=function(a){var b,c,d,e=[];a&&(a instanceof RegExp||(a=new RegExp(a)));for(d in this._db)this._db.hasOwnProperty(d)&&(c=!0,a&&(a.exec(d)||(c=!1)),c&&(b={name:d,children:[]},this.shared.moduleExists("Collection")&&b.children.push({module:"collection",moduleName:"Collections",count:this._db[d].collections().length}),this.shared.moduleExists("CollectionGroup")&&b.children.push({module:"collectionGroup",moduleName:"Collection Groups",count:this._db[d].collectionGroups().length}),this.shared.moduleExists("Document")&&b.children.push({module:"document",moduleName:"Documents",count:this._db[d].documents().length}),this.shared.moduleExists("Grid")&&b.children.push({module:"grid",moduleName:"Grids",count:this._db[d].grids().length}),this.shared.moduleExists("Overview")&&b.children.push({module:"overview",moduleName:"Overviews",count:this._db[d].overviews().length}),this.shared.moduleExists("View")&&b.children.push({module:"view",moduleName:"Views",count:this._db[d].views().length}),e.push(b)));return e.sort(function(a,b){return a.name.localeCompare(b.name)}),e},d.finishModule("Db"),b.exports=j},{"./Collection.js":3,"./Crc.js":5,"./Metrics.js":10,"./Overload":22,"./Shared":26}],7:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=new f,h=function(){};g.inOrder("hash");var i=function(){this.init.apply(this,arguments)};i.prototype.init=function(a,b,c){this._btree=new(h.create(2,this.sortAsc)),this._size=0,this._id=this._itemKeyHash(a,a),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexBinaryTree",i),d.mixin(i.prototype,"Mixin.ChainReactor"),d.mixin(i.prototype,"Mixin.Sorting"),i.prototype.id=function(){return this._id},i.prototype.state=function(){return this._state},i.prototype.size=function(){return this._size},d.synthesize(i.prototype,"data"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"collection"),d.synthesize(i.prototype,"type"),d.synthesize(i.prototype,"unique"),i.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},i.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree=new(h.create(2,this.sortAsc)),this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},i.prototype.insert=function(a,b){var c,d,e=this._unique,f=this._itemKeyHash(a,this._keys);e&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._btree.get(f),void 0===d&&(d=[],this._btree.put(f,d)),d.push(a),this._size++},i.prototype.remove=function(a,b){var c,d,e,f=this._unique,g=this._itemKeyHash(a,this._keys);f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._btree.get(g),void 0!==d&&(e=d.indexOf(a),e>-1&&(1===d.length?this._btree.del(g):d.splice(e,1),this._size--))},i.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},i.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},i.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},i.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},i.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},i.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},i.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.finishModule("IndexBinaryTree"),b.exports=i},{"./BinaryTree":2,"./Path":23,"./Shared":26}],8:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c){this._crossRef={},this._size=0,this._id=this._itemKeyHash(a,a),this.data({}),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexHashMap",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.id=function(){return this._id},f.prototype.state=function(){return this._state},f.prototype.size=function(){return this._size},d.synthesize(f.prototype,"data"),d.synthesize(f.prototype,"name"),d.synthesize(f.prototype,"collection"),d.synthesize(f.prototype,"type"),d.synthesize(f.prototype,"unique"),f.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},f.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._data={},this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},f.prototype.insert=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pushToPathValue(d[e],a)},f.prototype.update=function(a,b){},f.prototype.remove=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pullFromPathValue(d[e],a)},f.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},f.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},f.prototype.pushToPathValue=function(a,b){var c=this._data[a]=this._data[a]||[];-1===c.indexOf(b)&&(c.push(b),this._size++,this.pushToCrossRef(b,c))},f.prototype.pullFromPathValue=function(a,b){var c,d=this._data[a];c=d.indexOf(b),c>-1&&(d.splice(c,1),this._size--,this.pullFromCrossRef(b,d)),d.length||delete this._data[a]},f.prototype.pull=function(a){var b,c,d=a[this._collection.primaryKey()],e=this._crossRef[d],f=e.length;for(b=0;f>b;b++)c=e[b],this._pullFromArray(c,a);this._size--,delete this._crossRef[d]},f.prototype._pullFromArray=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)},f.prototype.pushToCrossRef=function(a,b){var c,d=a[this._collection.primaryKey()];this._crossRef[d]=this._crossRef[d]||[],c=this._crossRef[d],-1===c.indexOf(b)&&c.push(b)},f.prototype.pullFromCrossRef=function(a,b){var c=a[this._collection.primaryKey()];delete this._crossRef[c]},f.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},f.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},f.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},f.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.finishModule("IndexHashMap"),b.exports=f},{"./Path":23,"./Shared":26}],9:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){this._name=a,this._data={},this._primaryKey="_id"},d.addModule("KeyValueStore",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"name"),e.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},e.prototype.truncate=function(){return this._data={},this},e.prototype.set=function(a,b){return this._data[a]=b?b:!0,this},e.prototype.get=function(a){return this._data[a]},e.prototype.lookup=function(a){var b,c,d,e,f=a[this._primaryKey];if(f instanceof Array){for(c=f.length,e=[],b=0;c>b;b++)d=this._data[f[b]],d&&e.push(d);return e}if(f instanceof RegExp){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&f.test(b)&&e.push(this._data[b]);return e}if("object"!=typeof f)return d=this._data[f],void 0!==d?[d]:[];if(f.$ne){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&b!==f.$ne&&e.push(this._data[b]);return e}if(f.$in&&f.$in instanceof Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&f.$in.indexOf(b)>-1&&e.push(this._data[b]);return e}if(f.$nin&&f.$nin instanceof Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&-1===f.$nin.indexOf(b)&&e.push(this._data[b]);return e}if(f.$or&&f.$or instanceof Array){for(e=[],b=0;b<f.$or.length;b++)e=e.concat(this.lookup(f.$or[b]));return e}},e.prototype.unSet=function(a){return delete this._data[a],this},e.prototype.uniqueSet=function(a,b){return void 0===this._data[a]?(this._data[a]=b,!0):!1},d.finishModule("KeyValueStore"),b.exports=e},{"./Shared":26}],10:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Operation"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]},d.addModule("Metrics",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.create=function(a){var b=new e(a);return this._enabled&&this._data.push(b),b},f.prototype.start=function(){return this._enabled=!0,this},f.prototype.stop=function(){return this._enabled=!1,this},f.prototype.clear=function(){return this._data=[],this},f.prototype.list=function(){return this._data},d.finishModule("Metrics"),b.exports=f},{"./Operation":21,"./Shared":26}],11:[function(a,b,c){"use strict";var d={preSetData:function(){},postSetData:function(){}};b.exports=d},{}],12:[function(a,b,c){"use strict";var d={chain:function(a){this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Adding target "'+a._reactorOut.instanceIdentifier()+'" to the chain reactor target list'):console.log(this.logIdentifier()+' Adding target "'+a.instanceIdentifier()+'" to the chain reactor target list')),this._chain=this._chain||[];var b=this._chain.indexOf(a);-1===b&&this._chain.push(a)},unChain:function(a){if(this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Removing target "'+a._reactorOut.instanceIdentifier()+'" from the chain reactor target list'):console.log(this.logIdentifier()+' Removing target "'+a.instanceIdentifier()+'" from the chain reactor target list')),this._chain){var b=this._chain.indexOf(a);b>-1&&this._chain.splice(b,1)}},chainSend:function(a,b,c){if(this._chain){var d,e,f=this._chain,g=f.length;for(e=0;g>e;e++){if(d=f[e],d._state&&(!d._state||d.isDropped()))throw console.log("Reactor Data:",a,b,c),console.log("Reactor Node:",d),"Chain reactor attempting to send data to target reactor node that is in a dropped state!";this.debug&&this.debug()&&(d._reactorIn&&d._reactorOut?console.log(d._reactorIn.logIdentifier()+' Sending data down the chain reactor pipe to "'+d._reactorOut.instanceIdentifier()+'"'):console.log(this.logIdentifier()+' Sending data down the chain reactor pipe to "'+d.instanceIdentifier()+'"')),d.chainReceive(this,a,b,c)}}},chainReceive:function(a,b,c,d){var e={sender:a,type:b,data:c,options:d};this.debug&&this.debug()&&console.log(this.logIdentifier()+"Received data from parent reactor node"),(!this._chainHandler||this._chainHandler&&!this._chainHandler(e))&&this.chainSend(e.type,e.data,e.options)}};b.exports=d},{}],13:[function(a,b,c){"use strict";var d,e=0,f=a("./Overload"),g=a("./Serialiser"),h=new g;d={serialiser:h,store:function(a,b){if(void 0!==a){if(void 0!==b)return this._store=this._store||{},this._store[a]=b,this;if(this._store)return this._store[a]}},unStore:function(a){return void 0!==a&&delete this._store[a],this},decouple:function(a,b){if(void 0!==a){if(b){var c,d=this.jStringify(a),e=[];for(c=0;b>c;c++)e.push(this.jParse(d));return e}return this.jParse(this.jStringify(a))}},jParse:function(a){return h.parse(a)},jStringify:function(a){return h.stringify(a)},objectId:function(a){var b,c=Math.pow(10,17);if(a){var d,f=0,g=a.length;for(d=0;g>d;d++)f+=a.charCodeAt(d)*c;b=f.toString(16)}else e++,b=(e+(Math.random()*c+Math.random()*c+Math.random()*c+Math.random()*c)).toString(16);return b},debug:new f([function(){return this._debug&&this._debug.all},function(a){return void 0!==a?"boolean"==typeof a?(this._debug=this._debug||{},this._debug.all=a,this.chainSend("debug",this._debug),this):this._debug&&this._debug[a]||this._db&&this._db._debug&&this._db._debug[a]||this._debug&&this._debug.all:this._debug&&this._debug.all},function(a,b){return void 0!==a?void 0!==b?(this._debug=this._debug||{},this._debug[a]=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[a]:this._debug&&this._debug.all}]),classIdentifier:function(){return"ForerunnerDB."+this.className},instanceIdentifier:function(){return"["+this.className+"]"+this.name()},logIdentifier:function(){return this.classIdentifier()+": "+this.instanceIdentifier()},convertToFdb:function(a){var b,c,d,e;for(e in a)if(a.hasOwnProperty(e)&&(d=a,e.indexOf(".")>-1)){for(e=e.replace(".$","[|$|]"),c=e.split(".");b=c.shift();)b=b.replace("[|$|]",".$"),c.length?d[b]={}:d[b]=a[e],d=d[b];delete a[e]}},isDropped:function(){return"dropped"===this._state}},b.exports=d},{"./Overload":22,"./Serialiser":25}],14:[function(a,b,c){"use strict";var d={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1};b.exports=d},{}],15:[function(a,b,c){"use strict";var d=a("./Overload"),e={on:new d({"string, function":function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a]["*"]=this._listeners[a]["*"]||[],this._listeners[a]["*"].push(b),this},"string, *, function":function(a,b,c){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a][b]=this._listeners[a][b]||[],this._listeners[a][b].push(c),this}}),once:new d({"string, function":function(a,b){var c=this,d=function(){c.off(a,d),b.apply(c,arguments)};return this.on(a,d)},"string, *, function":function(a,b,c){var d=this,e=function(){d.off(a,b,e),c.apply(d,arguments)};return this.on(a,b,e)}}),off:new d({string:function(a){return this._listeners&&this._listeners[a]&&a in this._listeners&&delete this._listeners[a],this},"string, function":function(a,b){var c,d;return"string"==typeof b?this._listeners&&this._listeners[a]&&this._listeners[a][b]&&delete this._listeners[a][b]:this._listeners&&a in this._listeners&&(c=this._listeners[a]["*"],d=c.indexOf(b),d>-1&&c.splice(d,1)),this},"string, *, function":function(a,b,c){if(this._listeners&&a in this._listeners&&b in this.listeners[a]){var d=this._listeners[a][b],e=d.indexOf(c);e>-1&&d.splice(e,1)}},"string, *":function(a,b){this._listeners&&a in this._listeners&&b in this._listeners[a]&&delete this._listeners[a][b]}}),emit:function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d,e,f,g,h,i;if(this._listeners[a]["*"])for(f=this._listeners[a]["*"],d=f.length,c=0;d>c;c++)e=f[c],"function"==typeof e&&e.apply(this,Array.prototype.slice.call(arguments,1));if(b instanceof Array&&b[0]&&b[0][this._primaryKey])for(g=this._listeners[a],d=b.length,c=0;d>c;c++)if(g[b[c][this._primaryKey]])for(h=g[b[c][this._primaryKey]].length,i=0;h>i;i++)e=g[b[c][this._primaryKey]][i],"function"==typeof e&&g[b[c][this._primaryKey]][i].apply(this,Array.prototype.slice.call(arguments,1))}return this},deferEmit:function(a,b){var c,d=this;return this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?this.emit.apply(this,arguments):(c=arguments,this._deferTimeout=this._deferTimeout||{},this._deferTimeout[a]&&clearTimeout(this._deferTimeout[a]),this._deferTimeout[a]=setTimeout(function(){d.debug()&&console.log(d.logIdentifier()+" Emitting "+c[0]),d.emit.apply(d,c)},1)),this}};b.exports=e},{"./Overload":22}],16:[function(a,b,c){"use strict";var d={_match:function(a,b,c,d,e){var f,g,h,i,j,k,l=d,m=typeof a,n=typeof b,o=!0;if(e=e||{},c=c||{},e.$rootQuery||(e.$rootQuery=b),e.$rootData=e.$rootData||{},"string"!==m&&"number"!==m||"string"!==n&&"number"!==n){for(k in b)if(b.hasOwnProperty(k)){if(f=!1,j=k.substr(0,2),"//"===j)continue;if(0===j.indexOf("$")&&(i=this._matchOp(k,a,b[k],c,e),i>-1)){if(i){if("or"===d)return!0}else o=i;f=!0}if(!f&&b[k]instanceof RegExp)if(f=!0,"object"===m&&void 0!==a[k]&&b[k].test(a[k])){if("or"===d)return!0}else o=!1;if(!f)if("object"==typeof b[k])if(void 0!==a[k])if(a[k]instanceof Array&&!(b[k]instanceof Array)){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if(!(a[k]instanceof Array)&&b[k]instanceof Array){for(g=!1,h=0;h<b[k].length&&!(g=this._match(a[k],b[k][h],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if("object"==typeof a)if(g=this._match(a[k],b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(b[k]&&void 0!==b[k].$exists)if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else o=!1;else if(a&&a[k]===b[k]){if("or"===d)return!0}else if(a&&a[k]&&a[k]instanceof Array&&b[k]&&"object"!=typeof b[k]){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else o=!1;if("and"===d&&!o)return!1}}else"number"===m?a!==b&&(o=!1):a.localeCompare(b)&&(o=!1);return o},_matchOp:function(a,b,c,d,e){switch(a){case"$gt":return b>c;case"$gte":return b>=c;case"$lt":return c>b;case"$lte":return c>=b;case"$exists":return void 0===b!==c;case"$ne":return b!=c;case"$nee":return b!==c;case"$or":for(var f=0;f<c.length;f++)if(this._match(b,c[f],d,"and",e))return!0;return!1;case"$and":for(var g=0;g<c.length;g++)if(!this._match(b,c[g],d,"and",e))return!1;return!0;case"$in":if(c instanceof Array){var h,i=c,j=i.length;for(h=0;j>h;h++){if(i[h]instanceof RegExp&&i[h].test(b))return!0;if(i[h]===b)return!0}return!1}throw this.logIdentifier()+" Cannot use an $in operator on a non-array key: "+a;case"$nin":if(c instanceof Array){var k,l=c,m=l.length;for(k=0;m>k;k++)if(l[k]===b)return!1;return!0}throw this.logIdentifier()+" Cannot use a $nin operator on a non-array key: "+a;case"$distinct":e.$rootData["//distinctLookup"]=e.$rootData["//distinctLookup"]||{};for(var n in c)if(c.hasOwnProperty(n))return e.$rootData["//distinctLookup"][n]=e.$rootData["//distinctLookup"][n]||{},e.$rootData["//distinctLookup"][n][b[n]]?!1:(e.$rootData["//distinctLookup"][n][b[n]]=!0,!0);break;case"$count":var o,p,q;for(o in c)if(c.hasOwnProperty(o)&&(p=b[o],q="object"==typeof p&&p instanceof Array?p.length:0,!this._match(q,c[o],d,"and",e)))return!1;return!0}return-1}};b.exports=d},{}],17:[function(a,b,c){"use strict";var d={sortAsc:function(a,b){return"string"==typeof a&&"string"==typeof b?a.localeCompare(b):a>b?1:b>a?-1:0},sortDesc:function(a,b){return"string"==typeof a&&"string"==typeof b?b.localeCompare(a):a>b?-1:b>a?1:0}};b.exports=d},{}],18:[function(a,b,c){"use strict";var d,e={};d={tagAdd:function(a){var b,c=this,d=e[a]=e[a]||[];for(b=0;b<d.length;b++)if(d[b]===c)return!0;return d.push(c),c.on&&c.on("drop",function(){c.tagRemove(c)}),!0},tagRemove:function(a){var b,c=e[a];if(c)for(b=0;b<c.length;b++)if(c[b]===this)return c.splice(b,1),!0;return!1},tagLookup:function(a){return e[a]||[]},tagDrop:function(a,b){var c,d=this.tagLookup(a);if(d.length)for(c=0;c<d.length;c++)d[c]===this&&d.drop(b);return!0}},b.exports=d},{}],19:[function(a,b,c){"use strict";var d=a("./Overload"),e={addTrigger:function(a,b,c,d){var e,f=this;return e=f._triggerIndexOf(a,b,c),-1===e?(f._trigger=f._trigger||{},f._trigger[b]=f._trigger[b]||{},f._trigger[b][c]=f._trigger[b][c]||[],f._trigger[b][c].push({id:a,method:d,enabled:!0}),!0):!1},removeTrigger:function(a,b,c){var d,e=this;return d=e._triggerIndexOf(a,b,c),d>-1&&e._trigger[b][c].splice(d,1),!1},enableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!0,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!0,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!0,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!0,!0):!1}}),disableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!1,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!1,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!1,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!1,!0):!1}}),willTrigger:function(a,b){if(this._trigger&&this._trigger[a]&&this._trigger[a][b]&&this._trigger[a][b].length){var c,d=this._trigger[a][b];for(c=0;c<d.length;c++)if(d[c].enabled)return!0}return!1},processTrigger:function(a,b,c,d,e){var f,g,h,i,j,k=this;if(k._trigger&&k._trigger[b]&&k._trigger[b][c]){for(f=k._trigger[b][c],h=f.length,g=0;h>g;g++)if(i=f[g],i.enabled){if(this.debug()){var l,m;switch(b){case this.TYPE_INSERT:l="insert";break;case this.TYPE_UPDATE:l="update";break;case this.TYPE_REMOVE:l="remove";break;default:l=""}switch(c){case this.PHASE_BEFORE:m="before";break;case this.PHASE_AFTER:m="after";break;default:m=""}}if(j=i.method.call(k,a,d,e),j===!1)return!1;if(void 0!==j&&j!==!0&&j!==!1)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+j}return!0}},_triggerIndexOf:function(a,b,c){var d,e,f,g=this;if(g._trigger&&g._trigger[b]&&g._trigger[b][c])for(d=g._trigger[b][c],e=d.length,f=0;e>f;f++)if(d[f].id===a)return f;return-1}};b.exports=e},{"./Overload":22}],20:[function(a,b,c){"use strict";var d={_updateProperty:function(a,b,c){a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'"'); },_updateIncrement:function(a,b,c){a[b]+=c},_updateSpliceMove:function(a,b,c){a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"')},_updateSplicePush:function(a,b,c){a.length>b?a.splice(b,0,c):a.push(c)},_updatePush:function(a,b){a.push(b)},_updatePull:function(a,b){a.splice(b,1)},_updateMultiply:function(a,b,c){a[b]*=c},_updateRename:function(a,b,c){a[c]=a[b],delete a[b]},_updateOverwrite:function(a,b,c){a[b]=c},_updateUnset:function(a,b){delete a[b]},_updateClear:function(a,b){var c,d=a[b];if(d&&"object"==typeof d)for(c in d)d.hasOwnProperty(c)&&this._updateUnset(d,c)},_updatePop:function(a,b){var c,d=!1;if(a.length>0)if(b>0){for(c=0;b>c;c++)a.pop();d=!0}else if(0>b){for(c=0;c>b;c--)a.shift();d=!0}return d}};b.exports=d},{}],21:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a){this.pathSolver=new e,this.counter=0,this.init.apply(this,arguments)};f.prototype.init=function(a){this._data={operation:a,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}},d.addModule("Operation",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()},f.prototype.log=function(a){if(a){var b=this._log.length>0?this._data.log[this._data.log.length-1].time:0,c={event:a,time:(new Date).getTime(),delta:0};return this._data.log.push(c),b&&(c.delta=c.time-b),this}return this._data.log},f.prototype.time=function(a){if(void 0!==a){var b=this._data.time.process,c=b[a]=b[a]||{};return c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:a},this._data.steps.push(c.stepObj)),this}return this._data.time},f.prototype.flag=function(a,b){return void 0===a||void 0===b?void 0!==a?this._data.flag[a]:this._data.flag:void(this._data.flag[a]=b)},f.prototype.data=function(a,b,c){return void 0!==b?(this.pathSolver.set(this._data,a,b),this):this.pathSolver.get(this._data,a)},f.prototype.pushData=function(a,b,c){this.pathSolver.push(this._data,a,b)},f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime(),this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs},d.finishModule("Operation"),b.exports=f},{"./Path":23,"./Shared":26}],22:[function(a,b,c){"use strict";var d=function(a){if(a){var b,c,d,e,f,g,h=this;if(!(a instanceof Array)){d={};for(b in a)if(a.hasOwnProperty(b))if(e=b.replace(/ /g,""),-1===e.indexOf("*"))d[e]=a[b];else for(g=this.generateSignaturePermutations(e),f=0;f<g.length;f++)d[g[f]]||(d[g[f]]=a[b]);a=d}return function(){var d,e,f,g=[];if(a instanceof Array){for(c=a.length,b=0;c>b;b++)if(a[b].length===arguments.length)return h.callExtend(this,"$main",a,a[b],arguments)}else{for(b=0;b<arguments.length&&(e=typeof arguments[b],"object"===e&&arguments[b]instanceof Array&&(e="array"),1!==arguments.length||"undefined"!==e);b++)g.push(e);if(d=g.join(","),a[d])return h.callExtend(this,"$main",a,a[d],arguments);for(b=g.length;b>=0;b--)if(d=g.slice(0,b).join(","),a[d+",..."])return h.callExtend(this,"$main",a,a[d+",..."],arguments)}throw f="function"==typeof this.name?this.name():"Unknown",'ForerunnerDB.Overload "'+f+'": Overloaded method does not have a matching signature for the passed arguments: '+this.jStringify(g)}}return function(){}};d.prototype.generateSignaturePermutations=function(a){var b,c,d=[],e=["string","object","number","function","undefined"];if(a.indexOf("*")>-1)for(c=0;c<e.length;c++)b=a.replace("*",e[c]),d=d.concat(this.generateSignaturePermutations(b));else d.push(a);return d},d.prototype.callExtend=function(a,b,c,d,e){var f,g;return a&&c[b]?(f=a[b],a[b]=c[b],g=d.apply(a,e),a[b]=f,g):d.apply(a,e)},b.exports=d},{}],23:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){a&&this.path(a)},d.addModule("Path",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),e.prototype.path=function(a){return void 0!==a?(this._path=this.clean(a),this._pathParts=this._path.split("."),this):this._path},e.prototype.hasObjectPaths=function(a,b){var c,d=!0;for(c in a)if(a.hasOwnProperty(c)){if(void 0===b[c])return!1;if("object"==typeof a[c]&&(d=this.hasObjectPaths(a[c],b[c]),!d))return!1}return d},e.prototype.countKeys=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&void 0!==a[b]&&("object"!=typeof a[b]?c++:c+=this.countKeys(a[b]));return c},e.prototype.countObjectPaths=function(a,b){var c,d,e={},f=0,g=0;for(d in b)b.hasOwnProperty(d)&&("object"==typeof b[d]?(c=this.countObjectPaths(a[d],b[d]),e[d]=c.matchedKeys,g+=c.totalKeyCount,f+=c.matchedKeyCount):(g++,a&&a[d]&&"object"!=typeof a[d]?(e[d]=!0,f++):e[d]=!1));return{matchedKeys:e,matchedKeyCount:f,totalKeyCount:g}},e.prototype.parse=function(a,b){var c,d,e,f=[],g="";for(d in a)if(a.hasOwnProperty(d))if(g=d,"object"==typeof a[d])if(b)for(c=this.parse(a[d],b),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path,value:c[e].value});else for(c=this.parse(a[d]),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path});else b?f.push({path:g,value:a[d]}):f.push({path:g});return f},e.prototype.parseArr=function(a,b){return b=b||{},this._parseArr(a,"",[],b)},e.prototype._parseArr=function(a,b,c,d){var e,f="";b=b||"",c=c||[];for(e in a)a.hasOwnProperty(e)&&(!d.ignore||d.ignore&&!d.ignore.test(e))&&(f=b?b+"."+e:e,"object"==typeof a[e]?this._parseArr(a[e],f,c,d):c.push(f));return c},e.prototype.value=function(a,b){if(void 0!==a&&"object"==typeof a){var c,d,e,f,g,h,i,j=[];for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,h=0;e>h;h++){if(f=f[d[h]],g instanceof Array){for(i=0;i<g.length;i++)j=j.concat(this.value(g,i+"."+d[h]));return j}if(!f||"object"!=typeof f)break;g=f}return[f]}return[]},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.get=function(a,b){return this.value(a,b)[0]},e.prototype.push=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;if(b=this.clean(b),d=b.split("."),e=d.shift(),d.length)a[e]=a[e]||{},this.set(a[e],d.join("."),c);else{if(a[e]=a[e]||[],!(a[e]instanceof Array))throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";a[e].push(c)}}return a},e.prototype.keyValue=function(a,b){var c,d,e,f,g,h,i;for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,i=0;e>i;i++){if(f=f[d[i]],!f||"object"!=typeof f){h=d[i]+":"+f;break}g=f}return h},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.clean=function(a){return"."===a.substr(0,1)&&(a=a.substr(1,a.length-1)),a},d.finishModule("Path"),b.exports=e},{"./Shared":26}],24:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){if(!(a&&b&&c))throw"ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!";if(this._reactorIn=a,this._reactorOut=b,this._chainHandler=c,!a.chain||!b.chainReceive)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";a.chain(this),this.chain(b)};d.addModule("ReactorIO",e),e.prototype.drop=function(){return this.isDropped()||(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this)),!0},d.synthesize(e.prototype,"state"),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Events"),d.finishModule("ReactorIO"),b.exports=e},{"./Shared":26}],25:[function(a,b,c){"use strict";var d=function(){this.init.apply(this,arguments)};d.prototype.init=function(){this._encoder=[],this._decoder={},this.registerEncoder("$date",function(a){return a instanceof Date?a.toISOString():void 0}),this.registerDecoder("$date",function(a){return new Date(a)})},d.prototype.registerEncoder=function(a,b){this._encoder.push(function(c){var d,e=b(c);return void 0!==e&&(d={},d[a]=e),d})},d.prototype.registerDecoder=function(a,b){this._decoder[a]=b},d.prototype._encode=function(a){for(var b,c=this._encoder.length;c--&&!b;)b=this._encoder[c](a);return b},d.prototype.parse=function(a){return this._parse(JSON.parse(a))},d.prototype._parse=function(a,b){var c;if("object"==typeof a){b=a instanceof Array?b||[]:b||{};for(c in a)if(a.hasOwnProperty(c)){if("$"===c.substr(0,1)&&this._decoder[c])return this._decoder[c](a[c]);b[c]=this._parse(a[c],b[c])}}else b=a;return b},d.prototype.stringify=function(a){return JSON.stringify(this._stringify(a))},d.prototype._stringify=function(a,b){var c,d;if("object"==typeof a){if(c=this._encode(a))return c;b=a instanceof Array?b||[]:b||{};for(d in a)a.hasOwnProperty(d)&&(b[d]=this._stringify(a[d],b[d]))}else b=a;return b},b.exports=d},{}],26:[function(a,b,c){"use strict";var d=a("./Overload"),e={version:"1.3.363",modules:{},plugins:{},_synth:{},addModule:function(a,b){this.modules[a]=b,this.emit("moduleLoad",[a,b])},finishModule:function(a){if(!this.modules[a])throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+a;this.modules[a]._fdbFinished=!0,this.modules[a].prototype?this.modules[a].prototype.className=a:this.modules[a].className=a,this.emit("moduleFinished",[a,this.modules[a]])},moduleFinished:function(a,b){this.modules[a]&&this.modules[a]._fdbFinished?b&&b(a,this.modules[a]):this.on("moduleFinished",b)},moduleExists:function(a){return Boolean(this.modules[a])},mixin:new d({"object, string":function(a,b){var c;if("string"==typeof b&&(c=this.mixins[b],!c))throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;return this.$main.call(this,a,c)},"object, *":function(a,b){return this.$main.call(this,a,b)},$main:function(a,b){if(b&&"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}),synthesize:function(a,b,c){if(this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]},c){var d=this;a[b]=function(){var a,e=this.$super;return this.$super=d._synth[b],a=c.apply(this,arguments),this.$super=e,a}}else a[b]=this._synth[b]},overload:d,mixins:{"Mixin.Common":a("./Mixin.Common"),"Mixin.Events":a("./Mixin.Events"),"Mixin.ChainReactor":a("./Mixin.ChainReactor"),"Mixin.CRUD":a("./Mixin.CRUD"),"Mixin.Constants":a("./Mixin.Constants"),"Mixin.Triggers":a("./Mixin.Triggers"),"Mixin.Sorting":a("./Mixin.Sorting"),"Mixin.Matching":a("./Mixin.Matching"),"Mixin.Updating":a("./Mixin.Updating"),"Mixin.Tags":a("./Mixin.Tags")}};e.mixin(e,"Mixin.Events"),b.exports=e},{"./Mixin.CRUD":11,"./Mixin.ChainReactor":12,"./Mixin.Common":13,"./Mixin.Constants":14,"./Mixin.Events":15,"./Mixin.Matching":16,"./Mixin.Sorting":17,"./Mixin.Tags":18,"./Mixin.Triggers":19,"./Mixin.Updating":20,"./Overload":22}],27:[function(a,b,c){Array.prototype.filter||(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),"function"!=typeof Object.create&&(Object.create=function(){var a=function(){};return function(b){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;var c=new a;return a.prototype=null,c}}()),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null===this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1}),b.exports={}},{}]},{},[1]);
ajax/libs/yui/3.17.1/event-custom-base/event-custom-base-debug.js
ruiaraujo/cdnjs
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('event-custom-base', function (Y, NAME) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object * replaces the role of this property, but is considered to be private, and * is only mentioned to provide a migration path. * * If you have a use case which warrants migration to the _yuiaop property, * please file a ticket to let us know what it's used for and we can see if * we need to expose hooks for that functionality more formally. */ objs: null, /** * <p>Execute the supplied method before the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt> * <dd>Replace the arguments that the original function will be * called with.</dd> * <dt></code>Y.Do.Prevent(message)</code></dt> * <dd>Don't execute the wrapped function. Other before phase * wrappers will be executed.</dd> * </dl> * * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { // Y.log('Do before: ' + sFn, 'info', 'event'); var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * <p>Execute the supplied method after the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt> * <dd>Return <code>returnValue</code> instead of the wrapped * method's original return value. This can be further altered by * other after phase wrappers.</dd> * </dl> * * <p>The static properties <code>Y.Do.originalRetVal</code> and * <code>Y.Do.currentRetVal</code> will be populated for reference.</p> * * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {EventHandle} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method before or after the specified function. * Used by <code>before</code> and <code>after</code>. * * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {EventHandle} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (!obj._yuiaop) { // create a map entry for the obj if it doesn't exist, to hold overridden methods obj._yuiaop = {}; } o = obj._yuiaop; if (!o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription. * * @method detach * @param handle {EventHandle} the subscription handle * @static */ detach: function(handle) { if (handle.detach) { handle.detach(); } } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property originalRetVal * @static * @since 3.2.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property currentRetVal * @static * @since 3.2.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { // Y.log('Y.Do._delete: ' + sid, 'info', 'Event'); delete this.before[sid]; delete this.after[sid]; }; /** * <p>Execute the wrapped method. All arguments are passed into the wrapping * functions. If any of the before wrappers return an instance of * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped * function nor any after phase subscribers will be executed.</p> * * <p>The return value will be the return value of the wrapped function or one * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or * <code>Y.Do.AlterReturn</code>. * * @method exec * @param arg* {any} Arguments are passed to the wrapping and wrapped functions * @return {any} Return value of wrapped function unless overwritten (see above) */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor === DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor === DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. Useful for Do.before subscribers. An * example would be a service that scrubs out illegal characters prior to * executing the core business logic. * @class Do.AlterArgs * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newArgs {Array} Call parameters to be used for the original method * instead of the arguments originally passed in. */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller. Useful for Do.after subscribers. * @class Do.AlterReturn * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newRetVal {any} Return value passed to code that invoked the wrapped * function. */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. Useful for Do.before subscribers. * @class Do.Halt * @constructor * @param msg {String} (optional) Explanation of why the termination was done * @param retVal {any} Return value passed to code that invoked the wrapped * function. */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute. Useful * for Do.before subscribers. * @class Do.Prevent * @constructor * @param msg {String} (optional) Explanation of why the termination was done */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param retVal {any} Return value passed to code that invoked the wrapped * function. * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var YArray = Y.Array, AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], CONFIGS_HASH = YArray.hash(CONFIGS), nativeSlice = Array.prototype.slice, YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log', mixConfigs = function(r, s, ov) { var p; for (p in s) { if (CONFIGS_HASH[p] && (ov || !(p in r))) { r[p] = s[p]; } } return r; }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} defaults configuration object. * @class CustomEvent * @constructor */ /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ Y.CustomEvent = function(type, defaults) { this._kds = Y.CustomEvent.keepDeprecatedSubs; this.id = Y.guid(); this.type = type; this.silent = this.logSystem = (type === YUI_LOG); if (this._kds) { /** * The subscribers to this event * @property subscribers * @type Subscriber {} * @deprecated */ /** * 'After' subscribers * @property afters * @type Subscriber {} * @deprecated */ this.subscribers = {}; this.afters = {}; } if (defaults) { mixConfigs(this, defaults, true); } }; /** * Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a> * and <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance. * * These properties were changed to private properties (`_subscribers` and `_afters`), and * converted from objects to arrays for performance reasons. * * Setting this property to true will populate the deprecated `subscribers` and `afters` * properties for people who may be using them (which is expected to be rare). There will * be a performance hit, compared to the new array based implementation. * * If you are using these deprecated properties for a use case which the public API * does not support, please file an enhancement request, and we can provide an alternate * public implementation which doesn't have the performance cost required to maintiain the * properties as objects. * * @property keepDeprecatedSubs * @static * @for CustomEvent * @type boolean * @default false * @deprecated */ Y.CustomEvent.keepDeprecatedSubs = false; Y.CustomEvent.mixConfigs = mixConfigs; Y.CustomEvent.prototype = { constructor: Y.CustomEvent, /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ /** * This event has fired if true * * @property fired * @type boolean * @default false; */ /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ /** * Flag for the default function to execute only if the * firing event is the current target. This happens only * when using custom event delegation and setting the * flag to `true` mimics the behavior of event delegation * in the DOM. * * @property defaultTargetOnly * @type Boolean * @default false */ /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ /** * The subscribers to this event * @property _subscribers * @type Subscriber [] * @private */ /** * 'After' subscribers * @property _afters * @type Subscriber [] * @private */ /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ signature : YUI3_SIGNATURE, /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ context : Y, /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ preventable : true, /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ bubbles : true, /** * Returns the number of subscribers for this event as the sum of the on() * subscribers and after() subscribers. * * @method hasSubs * @return Number */ hasSubs: function(when) { var s = 0, a = 0, subs = this._subscribers, afters = this._afters, sib = this.sibling; if (subs) { s = subs.length; } if (afters) { a = afters.length; } if (sib) { subs = sib._subscribers; afters = sib._afters; if (subs) { s += subs.length; } if (afters) { a += afters.length; } } if (when) { return (when === 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = nativeSlice.call(arguments, 0); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var sibling = this.sibling, subs = this._subscribers, afters = this._afters, siblingSubs, siblingAfters; if (sibling) { siblingSubs = sibling._subscribers; siblingAfters = sibling._afters; } if (siblingSubs) { if (subs) { subs = subs.concat(siblingSubs); } else { subs = siblingSubs.concat(); } } else { if (subs) { subs = subs.concat(); } else { subs = []; } } if (siblingAfters) { if (afters) { afters = afters.concat(siblingAfters); } else { afters = siblingAfters.concat(); } } else { if (afters) { afters = afters.concat(); } else { afters = []; } } return [subs, afters]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { mixConfigs(this, o, force); }, /** * Create the Subscription for subscribing function, context, and bound * arguments. If this is a fireOnce event, the subscriber is immediately * notified. * * @method _on * @param fn {Function} Subscription callback * @param [context] {Object} Override `this` in the callback * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire() * @param [when] {String} "after" to slot into after subscribers * @return {EventHandle} * @protected */ _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when), firedWith; if (this.fireOnce && this.fired) { firedWith = this.firedWith; // It's a little ugly for this to know about facades, // but given the current breakup, not much choice without // moving a whole lot of stuff around. if (this.emitFacade && this._addFacadeToArgs) { this._addFacadeToArgs(firedWith); } if (this.async) { setTimeout(Y.bind(this._notify, this, s, firedWith), 0); } else { this._notify(s, firedWith); } } if (when === AFTER) { if (!this._afters) { this._afters = []; } this._afters.push(s); } else { if (!this._subscribers) { this._subscribers = []; } this._subscribers.push(s); } if (this._kds) { if (when === AFTER) { this.afters[s.id] = s; } else { this.subscribers[s.id] = s; } } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { Y.log('ce.subscribe deprecated, use "on"', 'warn', 'deprecated'); var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; if (this.monitored && this.host) { this.host._monitor('attach', this, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {Number} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = this._subscribers, afters = this._afters; if (subs) { for (i = subs.length; i >= 0; i--) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, subs, i); found++; } } } if (afters) { for (i = afters.length; i >= 0; i--) { s = afters[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, afters, i); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @protected */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { Y.log(this.id + ': ' + msg, cat || 'info', 'event'); } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { // push is the fastest way to go from arguments to arrays // for most browsers currently // http://jsperf.com/push-vs-concat-vs-slice/2 var args = []; args.push.apply(args, arguments); return this._fire(args); }, /** * Private internal implementation for `fire`, which is can be used directly by * `EventTarget` and other event module classes which have already converted from * an `arguments` list to an array, to avoid the repeated overhead. * * @method _fire * @private * @param {Array} args The array of arguments passed to be passed to handlers. * @return {boolean} false if one of the subscribers returned false, true otherwise. */ _fire: function(args) { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; if (this.fireOnce) { this.firedWith = args; } if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, /** * Set up for notifying subscribers of non-emitFacade events. * * @method fireSimple * @param args {Array} Arguments passed to fire() * @return Boolean false if a subscriber returned false * @protected */ fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } if (this.broadcast) { this._broadcast(args); } return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { this.log('Missing event-custom-complex needed to emit a facade for: ' + this.type); args[0] = args[0] || {}; return this.fireSimple(args); }, /** * Notifies a list of subscribers. * * @method _procSubs * @param subs {Array} List of subscribers * @param args {Array} Arguments passed to fire() * @param ef {} * @return Boolean false if a subscriber returns false or stops the event * propagation via e.stopPropagation(), * e.stopImmediatePropagation(), or e.halt() * @private */ _procSubs: function(subs, args, ef) { var s, i, l; for (i = 0, l = subs.length; i < l; i++) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped === 2) { return false; } } } return true; }, /** * Notifies the YUI instance if the event is configured with broadcast = 1, * and both the YUI instance and Y.Global if configured with broadcast = 2. * * @method _broadcast * @param args {Array} Arguments sent to fire() * @private */ _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = args.concat(); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast === 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {Number} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {Number} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * Deletes the subscriber from the internal store of on() and after() * subscribers. * * @method _delete * @param s subscriber object. * @param subs (optional) on or after subscriber array * @param index (optional) The index found. * @private */ _delete: function(s, subs, i) { var when = s._when; if (!subs) { subs = (when === AFTER) ? this._afters : this._subscribers; } if (subs) { i = YArray.indexOf(subs, s, 0); if (s && subs[i] === s) { subs.splice(i, 1); } } if (this._kds) { if (when === AFTER) { delete this.afters[s.id]; } else { delete this.subscribers[s.id]; } } if (this.monitored && this.host) { this.host._monitor('detach', this, { ce: this, sub: s }); } if (s) { s.deleted = true; } } }; /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args, when) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.guid(); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; this._when = when; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { constructor: Y.Subscriber, _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config && Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn === fn) && this.context === context); } else { return (this.fn === fn); } }, valueOf : function() { return this.id; } }; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * * @property evt * @type CustomEvent */ this.evt = evt; /** * The subscriber object * * @property sub * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {Number} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { // Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event'); if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {String} the prefix to apply to non-prefixed event names */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', WILD_TYPE_RE = /(.*?)(:)(.*?)/, _wildType = Y.cached(function(type) { return type.replace(WILD_TYPE_RE, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = function(type, pre) { if (!pre || !type || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }, /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t === '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { var etState = this._yuievt, etConfig; if (!etState) { etState = this._yuievt = { events: {}, // PERF: Not much point instantiating lazily. We're bound to have events targets: null, // PERF: Instantiate lazily, if user actually adds target, config: { host: this, context: this }, chain: Y.config.chain }; } etConfig = etState.config; if (opts) { mixConfigs(etConfig, opts, true); if (opts.chain !== undefined) { etState.chain = opts.chain; } if (opts.prefix) { etConfig.prefix = opts.prefix; } } }; ET.prototype = { constructor: ET, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>after</code> except the * listener is immediatelly detached when it is executed. * @method onceAfter * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ onceAfter: function() { var handle = this.after.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {String} type the type * @param {String} [pre] The prefix. Defaults to this._yuievt.config.prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe a callback function to a custom event fired by this object or * from an object that bubbles its events to this object. * * Callback functions for events published with `emitFacade = true` will * receive an `EventFacade` as the first argument (typically named "e"). * These callbacks can then call `e.preventDefault()` to disable the * behavior published to that event's `defaultFn`. See the `EventFacade` * API for all available properties and methods. Subscribers to * non-`emitFacade` events will receive the arguments passed to `fire()` * after the event name. * * To subscribe to multiple events at once, pass an object as the first * argument, where the key:value pairs correspond to the eventName:callback, * or pass an array of event names as the first argument to subscribe to * all listed events with the same callback. * * Returning `false` from a callback is supported as an alternative to * calling `e.preventDefault(); e.stopPropagation();`. However, it is * recommended to use the event methods whenever possible. * * @method on * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ on: function(type, fn, context) { var yuievt = this._yuievt, parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = nativeSlice.call(arguments, 0); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = nativeSlice.call(arguments, 0); args.splice(2, 0, Node.getDOMNode(this)); // Y.log("Node detected, redirecting with these args: " + args); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = nativeSlice.call(arguments, 0); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { Y.log('Using adaptor for ' + shorttype + ', ' + n, 'info', 'event'); handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true); // TODO: More robust regex, accounting for category if (type.indexOf("*:") !== -1) { this._hasSiblings = true; } } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { Y.log('EventTarget subscribe() is deprecated, use on()', 'warn', 'deprecated'); return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = nativeSlice.call(arguments, 0); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = nativeSlice.call(arguments, 0); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { Y.log('EventTarget unsubscribe() is deprecated, use detach()', 'warn', 'deprecated'); return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {String} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {String} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'deprecated'); return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {String} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var ret, etState = this._yuievt, etConfig = etState.config, pre = etConfig.prefix; if (typeof type === "string") { if (pre) { type = _getType(type, pre); } ret = this._publish(type, etConfig, opts); } else { ret = {}; Y.each(type, function(v, k) { if (pre) { k = _getType(k, pre); } ret[k] = this._publish(k, etConfig, v || opts); }, this); } return ret; }, /** * Returns the fully qualified type, given a short type string. * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix. * * NOTE: This method, unlike _getType, does no checking of the value passed in, and * is designed to be used with the low level _publish() method, for critical path * implementations which need to fast-track publish for performance reasons. * * @method _getFullType * @private * @param {String} type The short type to prefix * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in */ _getFullType : function(type) { var pre = this._yuievt.config.prefix; if (pre) { return pre + PREFIX_DELIMITER + type; } else { return type; } }, /** * The low level event publish implementation. It expects all the massaging to have been done * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast * path publish, which can be used by critical code paths to improve performance. * * @method _publish * @private * @param {String} fullType The prefixed type of the event to publish. * @param {Object} etOpts The EventTarget specific configuration to mix into the published event. * @param {Object} ceOpts The publish specific configuration to mix into the published event. * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will * be the default `CustomEvent` instance, and can be configured independently. */ _publish : function(fullType, etOpts, ceOpts) { var ce, etState = this._yuievt, etConfig = etState.config, host = etConfig.host, context = etConfig.context, events = etState.events; ce = events[fullType]; // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight. if ((etConfig.monitored && !ce) || (ce && ce.monitored)) { this._monitor('publish', fullType, { args: arguments }); } if (!ce) { // Publish event ce = events[fullType] = new Y.CustomEvent(fullType, etOpts); if (!etOpts) { ce.host = host; ce.context = context; } } if (ceOpts) { mixConfigs(ce, ceOpts, true); } return ce; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @method _monitor * @param what {String} 'attach', 'detach', 'fire', or 'publish' * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object. * @param o {Object} Information about the event interaction, such as * fire() args, subscription category, publish config * @private */ _monitor: function(what, eventType, o) { var monitorevt, ce, type; if (eventType) { if (typeof eventType === "string") { type = eventType; ce = this.getEvent(eventType, true); } else { ce = eventType; type = eventType.type; } if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {Boolean} True if the whole lifecycle of the event went through, * false if at any point the event propagation was halted. */ fire: function(type) { var typeIncluded = (typeof type === "string"), argCount = arguments.length, t = type, yuievt = this._yuievt, etConfig = yuievt.config, pre = etConfig.prefix, ret, ce, ce2, args; if (typeIncluded && argCount <= 3) { // PERF: Try to avoid slice/iteration for the common signatures // Most common if (argCount === 2) { args = [arguments[1]]; // fire("foo", {}) } else if (argCount === 3) { args = [arguments[1], arguments[2]]; // fire("foo", {}, opts) } else { args = []; // fire("foo") } } else { args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0)); } if (!typeIncluded) { t = (type && type.type); } if (pre) { t = _getType(t, pre); } ce = yuievt.events[t]; if (this._hasSiblings) { ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } } // PERF: trying to avoid function call, since this is a critical path if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { this._monitor('fire', (ce || t), { args: args }); } // this event has not been published or subscribed to if (!ce) { if (yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { if (ce2) { ce.sibling = ce2; } ret = ce._fire(args); } return (yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); ce2 = this.getEvent(type, true); if (ce2) { ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {String} the type, or name of the event * @param prefixed {String} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * * @method after * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ after: function(type, fn) { var a = nativeSlice.call(arguments, 0); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype); ET.call(Y, { bubbles: false }); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** `Y.on()` can do many things: <ul> <li>Subscribe to custom events `publish`ed and `fire`d from Y</li> <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and `fire`d from any object in the YUI instance sandbox</li> <li>Subscribe to DOM events</li> <li>Subscribe to the execution of a method on any object, effectively treating that method as an event</li> </ul> For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument. Y.on('io:complete', function () { Y.MyApp.updateStatus('Transaction complete'); }); To subscribe to DOM events, pass the name of a DOM event as the first argument and a CSS selector string as the third argument after the callback function. Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`, array, or simply omitted (the default is the `window` object). Y.on('click', function (e) { e.preventDefault(); // proceed with ajax form submission var url = this.get('action'); ... }, '#my-form'); The `this` object in DOM event callbacks will be the `Node` targeted by the CSS selector or other identifier. `on()` subscribers for DOM events or custom events `publish`ed with a `defaultFn` can prevent the default behavior with `e.preventDefault()` from the event object passed as the first parameter to the subscription callback. To subscribe to the execution of an object method, pass arguments corresponding to the call signature for <a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>. NOTE: The formal parameter list below is for events, not for function injection. See `Y.Do.before` for that signature. @method on @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @see Do.before @for YUI **/ /** Listen for an event one time. Equivalent to `on()`, except that the listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see on @method once @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Listen for an event one time. Equivalent to `once()`, except, like `after()`, the subscription callback executes after all `on()` subscribers and the event's `defaultFn` (if configured) have executed. Like `after()` if any `on()` phase subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()` subscribers will execute. The listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see once @method onceAfter @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Like `on()`, this method creates a subscription to a custom event or to the execution of a method on an object. For events, `after()` subscribers are executed after the event's `defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber. See the <a href="#methods_on">`on()` method</a> for additional subscription options. NOTE: The subscription signature shown is for events, not for function injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a> for that signature. @see on @see Do.after @method after @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [args*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ }, '3.17.1', {"requires": ["oop"]});
src/js/popup.js
JonathanLigh/RRE
import React from 'react'; import ReactDom from 'react-dom'; // import { Provider } from 'react-redux'; // import configureStore from './store'; // const wrapper = document.getElementById('app'); // ReactDOM.render( // <Provider store={configureStore()}> // </Provider>, wrapper, // ); class Main extends React.Component { render() { return ( <div className={'my-extension'}> <h1>Hello world - My first Extension</h1> </div> ) } }
app/javascript/app/components/profile/stripe-field.js
GiancarlosIO/ecommerce-book-app
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Button, Glyphicon } from 'react-bootstrap'; export class StripeField extends Component { state = { error: null, loading: false } componentDidMount() { // Initialize stripe this.stripe = window.Stripe('pk_test_UdFie3THdgtzUjPnDMQg8MV1'); const elements = this.stripe.elements(); this.card = elements.create('card'); this.card.mount('#card-element'); } handleClick = () => { this.setState({ error: null, loading: true }, () => { console.log('stripe field'); // Create token of card this.stripe.createToken(this.card) .then((result) => { console.log('tokenize token result', result); if (result.error) { this.setState({ error: result.error.message, loading: false }); } else if (result.token) { this.props.addCreditCard(result.token.id) .then(() => { this.setState({ loading: false, error: null }); }); } }); }); } componentWilUnmount() { this.stripe = undefined; this.card = undefined; } render() { const { error, loading } = this.state; return ( <div className="text-center padding-20"> { error && ( <h3 className="margin-none padding-bottom-10 text-red-flat"> {this.state.error} </h3> ) } <label htmlFor="card-element"> <div className="stripe-card" id="card-element" /> </label> <div className="text-center"> <Button bsStyle="success" onClick={this.handleClick} disabled={loading}> <Glyphicon className="margin-right-5" glyph="plus" /> { loading ? 'Loading...' : 'Add' } </Button> </div> </div> ); } } StripeField.propTypes = { addCreditCard: PropTypes.func.isRequired }; export default StripeField;
src/components/Header/Header.js
tinkertrain/qsenseistyleguide
import React, { Component } from 'react'; import { IndexLink } from 'react-router'; import logo from '../../images/logo_white.png'; require('./Header.scss'); export class Header extends Component { render() { return ( <header className="mainHeader"> <IndexLink to="/"> <img src={logo} alt="Q-Sensei"/> </IndexLink> </header> ); } }
ajax/libs/yui/3.6.0/event-custom-base/event-custom-base-debug.js
NamPNQ/cdnjs
YUI.add('event-custom-base', function(Y) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object * replaces the role of this property, but is considered to be private, and * is only mentioned to provide a migration path. * * If you have a use case which warrants migration to the _yuiaop property, * please file a ticket to let us know what it's used for and we can see if * we need to expose hooks for that functionality more formally. */ objs: null, /** * <p>Execute the supplied method before the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt> * <dd>Replace the arguments that the original function will be * called with.</dd> * <dt></code>Y.Do.Prevent(message)</code></dt> * <dd>Don't execute the wrapped function. Other before phase * wrappers will be executed.</dd> * </dl> * * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { // Y.log('Do before: ' + sFn, 'info', 'event'); var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * <p>Execute the supplied method after the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt> * <dd>Return <code>returnValue</code> instead of the wrapped * method's original return value. This can be further altered by * other after phase wrappers.</dd> * </dl> * * <p>The static properties <code>Y.Do.originalRetVal</code> and * <code>Y.Do.currentRetVal</code> will be populated for reference.</p> * * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method before or after the specified function. * Used by <code>before</code> and <code>after</code>. * * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (!obj._yuiaop) { // create a map entry for the obj if it doesn't exist, to hold overridden methods obj._yuiaop = {}; } o = obj._yuiaop; if (!o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription. * * @method detach * @param handle {string} the subscription handle * @static */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property originalRetVal * @static * @since 3.2.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property currentRetVal * @static * @since 3.2.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { // Y.log('Y.Do._delete: ' + sid, 'info', 'Event'); delete this.before[sid]; delete this.after[sid]; }; /** * <p>Execute the wrapped method. All arguments are passed into the wrapping * functions. If any of the before wrappers return an instance of * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped * function nor any after phase subscribers will be executed.</p> * * <p>The return value will be the return value of the wrapped function or one * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or * <code>Y.Do.AlterReturn</code>. * * @method exec * @param arg* {any} Arguments are passed to the wrapping and wrapped functions * @return {any} Return value of wrapped function unless overwritten (see above) */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. Useful for Do.before subscribers. An * example would be a service that scrubs out illegal characters prior to * executing the core business logic. * @class Do.AlterArgs * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newArgs {Array} Call parameters to be used for the original method * instead of the arguments originally passed in. */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller. Useful for Do.after subscribers. * @class Do.AlterReturn * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newRetVal {any} Return value passed to code that invoked the wrapped * function. */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. Useful for Do.before subscribers. * @class Do.Halt * @constructor * @param msg {String} (optional) Explanation of why the termination was done * @param retVal {any} Return value passed to code that invoked the wrapped * function. */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute. Useful * for Do.before subscribers. * @class Do.Prevent * @constructor * @param msg {String} (optional) Explanation of why the termination was done */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param retVal {any} Return value passed to code that invoked the wrapped * function. * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log'; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} o configuration object. * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { // if (arguments.length > 2) { // this.log('CustomEvent context and silent are now in the config', 'warn', 'Event'); // } o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber {} */ this.subscribers = {}; /** * 'After' subscribers * @property afters * @type Subscriber {} */ this.afters = {}; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ //this.async = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; this.subCount = 0; this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; Y.CustomEvent.prototype = { constructor: Y.CustomEvent, /** * Returns the number of subscribers for this event as the sum of the on() * subscribers and after() subscribers. * * @method hasSubs * @return Number */ hasSubs: function(when) { var s = this.subCount, a = this.afterCount, sib = this.sibling; if (sib) { s += sib.subCount; a += sib.afterCount; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = Y.Array(arguments, 0, true); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var s = Y.merge(this.subscribers), a = Y.merge(this.afters), sib = this.sibling; if (sib) { Y.mix(s, sib.subscribers); Y.mix(a, sib.afters); } return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { if (o) { Y.mix(this, o, force, CONFIGS); } }, /** * Create the Subscription for subscribing function, context, and bound * arguments. If this is a fireOnce event, the subscriber is immediately * notified. * * @method _on * @param fn {Function} Subscription callback * @param [context] {Object} Override `this` in the callback * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire() * @param [when] {String} "after" to slot into after subscribers * @return {EventHandle} * @protected */ _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { if (this.async) { setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } else { this._notify(s, this.firedWith); } } if (when == AFTER) { this.afters[s.id] = s; this.afterCount++; } else { this.subscribers[s.id] = s; this.subCount++; } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { Y.log('ce.subscribe deprecated, use "on"', 'warn', 'deprecated'); var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; if (this.host) { this.host._monitor('attach', this.type, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = Y.merge(this.subscribers, this.afters); for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @protected */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { Y.log(this.id + ': ' + msg, cat || 'info', 'event'); } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = Y.Array(arguments, 0, true); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; this.firedWith = args; if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, /** * Set up for notifying subscribers of non-emitFacade events. * * @method fireSimple * @param args {Array} Arguments passed to fire() * @return Boolean false if a subscriber returned false * @protected */ fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { // this._procSubs(Y.merge(this.subscribers, this.afters), args); var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { Y.log('Missing event-custom-complex needed to emit a facade for: ' + this.type); args[0] = args[0] || {}; return this.fireSimple(args); }, /** * Notifies a list of subscribers. * * @method _procSubs * @param subs {Array} List of subscribers * @param args {Array} Arguments passed to fire() * @param ef {} * @return Boolean false if a subscriber returns false or stops the event * propagation via e.stopPropagation(), * e.stopImmediatePropagation(), or e.halt() * @private */ _procSubs: function(subs, args, ef) { var s, i; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } } return true; }, /** * Notifies the YUI instance if the event is configured with broadcast = 1, * and both the YUI instance and Y.Global if configured with broadcast = 2. * * @method _broadcast * @param args {Array} Arguments sent to fire() * @private */ _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = Y.Array(args); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * Deletes the subscriber from the internal store of on() and after() * subscribers. * * @method _delete * @param subscriber object. * @private */ _delete: function(s) { if (s) { if (this.subscribers[s.id]) { delete this.subscribers[s.id]; this.subCount--; } if (this.afters[s.id]) { delete this.afters[s.id]; this.afterCount--; } } if (this.host) { this.host._monitor('detach', this.type, { ce: this, sub: s }); } if (s) { // delete s.fn; // delete s.context; s.deleted = true; } } }; /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { constructor: Y.Subscriber, _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config && Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } } }; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * * @property evt * @type CustomEvent */ this.evt = evt; /** * The subscriber object * * @property sub * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {int} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { // Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event'); if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {String} the prefix to apply to non-prefixed event names */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', YArray = Y.Array, _wildType = Y.cached(function(type) { return type.replace(/(.*)(:)(.*)/, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || !L.isString(type) || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); // Y.log(t); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { // Y.log('EventTarget constructor executed: ' + this._yuid); var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaultTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { constructor: ET, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>after</code> except the * listener is immediatelly detached when it is executed. * @method onceAfter * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ onceAfter: function() { var handle = this.after.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {String} type the type * @param {String} [pre=this._yuievt.config.prefix] the prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe a callback function to a custom event fired by this object or * from an object that bubbles its events to this object. * * Callback functions for events published with `emitFacade = true` will * receive an `EventFacade` as the first argument (typically named "e"). * These callbacks can then call `e.preventDefault()` to disable the * behavior published to that event's `defaultFn`. See the `EventFacade` * API for all available properties and methods. Subscribers to * non-`emitFacade` events will receive the arguments passed to `fire()` * after the event name. * * To subscribe to multiple events at once, pass an object as the first * argument, where the key:value pairs correspond to the eventName:callback, * or pass an array of event names as the first argument to subscribe to * all listed events with the same callback. * * Returning `false` from a callback is supported as an alternative to * calling `e.preventDefault(); e.stopPropagation();`. However, it is * recommended to use the event methods whenever possible. * * @method on * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ on: function(type, fn, context) { var parts = _parseType(type, this._yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = YArray(arguments, 0, true); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (this._yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = YArray(arguments, 0, true); args.splice(2, 0, Node.getDOMNode(this)); // Y.log("Node detected, redirecting with these args: " + args); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = YArray(arguments, 0, true); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { Y.log('Using adaptor for ' + shorttype + ', ' + n, 'info', 'event'); handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = this._yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? YArray(arguments, 3, true) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (this._yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { Y.log('EventTarget subscribe() is deprecated, use on()', 'warn', 'deprecated'); return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = YArray(arguments, 0, true); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = YArray(arguments, 0, true); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { Y.log('EventTarget unsubscribe() is deprecated, use detach()', 'warn', 'deprecated'); return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {String} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {String} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'deprecated'); return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {String} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, defaults, edata = this._yuievt, pre = edata.config.prefix; if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } type = (pre) ? _getType(type, pre) : type; this._monitor('publish', type, { args: arguments }); events = edata.events; ce = events[type]; if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { defaults = edata.defaults; // apply defaults ce = new Y.CustomEvent(type, (opts) ? Y.merge(defaults, opts) : defaults); events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @method _monitor * @param what {String} 'attach', 'detach', 'fire', or 'publish' * @param type {String} Name of the event being monitored * @param o {Object} Information about the event interaction, such as * fire() args, subscription category, publish config * @private */ _monitor: function(what, type, o) { var monitorevt, ce = this.getEvent(type); if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; // Y.log('monitoring: ' + monitorevt); o.monitored = what; this.fire.call(this, monitorevt, o); } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host * */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), ce, ret, pre = this._yuievt.config.prefix, ce2, args = (typeIncluded) ? YArray(arguments, 1, true) : arguments; t = (pre) ? _getType(t, pre) : t; this._monitor('fire', t, { args: args }); ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } // this event has not been published or subscribed to if (!ce) { if (this._yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (this._yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {String} the type, or name of the event * @param prefixed {String} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * * @method after * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ after: function(type, fn) { var a = YArray(arguments, 0, true); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype); ET.call(Y, { bubbles: false }); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** `Y.on()` can do many things: <ul> <li>Subscribe to custom events `publish`ed and `fire`d from Y</li> <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and `fire`d from any object in the YUI instance sandbox</li> <li>Subscribe to DOM events</li> <li>Subscribe to the execution of a method on any object, effectively treating that method as an event</li> </ul> For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument. Y.on('io:complete', function () { Y.MyApp.updateStatus('Transaction complete'); }); To subscribe to DOM events, pass the name of a DOM event as the first argument and a CSS selector string as the third argument after the callback function. Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`, array, or simply omitted (the default is the `window` object). Y.on('click', function (e) { e.preventDefault(); // proceed with ajax form submission var url = this.get('action'); ... }, '#my-form'); The `this` object in DOM event callbacks will be the `Node` targeted by the CSS selector or other identifier. `on()` subscribers for DOM events or custom events `publish`ed with a `defaultFn` can prevent the default behavior with `e.preventDefault()` from the event object passed as the first parameter to the subscription callback. To subscribe to the execution of an object method, pass arguments corresponding to the call signature for <a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>. NOTE: The formal parameter list below is for events, not for function injection. See `Y.Do.before` for that signature. @method on @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @see Do.before @for YUI **/ /** Listen for an event one time. Equivalent to `on()`, except that the listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see on @method once @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Listen for an event one time. Equivalent to `once()`, except, like `after()`, the subscription callback executes after all `on()` subscribers and the event's `defaultFn` (if configured) have executed. Like `after()` if any `on()` phase subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()` subscribers will execute. The listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see once @method onceAfter @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Like `on()`, this method creates a subscription to a custom event or to the execution of a method on an object. For events, `after()` subscribers are executed after the event's `defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber. See the <a href="#methods_on">`on()` method</a> for additional subscription options. NOTE: The subscription signature shown is for events, not for function injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a> for that signature. @see on @see Do.after @method after @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [args*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ }, '@VERSION@' ,{requires:['oop']});
app/containers/EditPostPage/sagas.js
ajanthvofox/react-crud
// import { take, call, put, select } from 'redux-saga/effects'; import { take, takeLatest, call, put, select, cancel } from 'redux-saga/effects'; import { LOCATION_CHANGE } from 'react-router-redux'; import request from 'utils/request'; import { SAVE_POST, LOAD_POST, } from './constants'; import { savePostSuccessAction, savePostErrorAction, loadPostSuccessAction, loadPostErrorAction, } from './actions'; import { selectPostId, selectPost, } from './selectors'; // Saga to load single post data function* savePost() { const pid = yield select(selectPostId()); const pdata = yield select(selectPost()); if (pid) { const url = `https://jsonplaceholder.typicode.com/posts/${pid}`; const params = { method: 'PUT', headers: { 'Content-Type': 'application/json', }, data: pdata, }; try { const data = yield call(request, url, params); yield put(savePostSuccessAction(data)); } catch (err) { yield put(savePostErrorAction(err)); } } else { const url = 'https://jsonplaceholder.typicode.com/posts'; const params = { method: 'POST', headers: { 'Content-Type': 'application/json', }, data: pdata, }; try { const data = yield call(request, url, params); yield put(savePostSuccessAction(data)); } catch (err) { yield put(savePostErrorAction(err)); } } } export function* postsaveSaga() { const savePostWatcher = yield takeLatest(SAVE_POST, savePost); yield take(LOCATION_CHANGE); yield cancel(savePostWatcher); } // Individual exports for testing export function* defaultSaga() { // See example in containers/HomePage/sagas.js } // Saga to load single post data function* loadPost() { const pid = yield select(selectPostId()); const url = `https://jsonplaceholder.typicode.com/posts/${pid}`; const params = { method: 'GET', headers: { 'Content-Type': 'application/json', }, }; try { const data = yield call(request, url, params); yield put(loadPostSuccessAction(data)); } catch (err) { yield put(loadPostErrorAction(err)); } } export function* postloadSaga() { const loadPostWatcher = yield takeLatest(LOAD_POST, loadPost); yield take(LOCATION_CHANGE); yield cancel(loadPostWatcher); } // All sagas to be loaded export default [ defaultSaga, postsaveSaga, postloadSaga, ];
src/components/ShowUser.js
muiradams/plantogo
import React, { Component } from 'react'; import { setUsername } from '../actions'; import Header from './Header'; export default class ShowUser extends Component { render() { return ( <div className="show-user-container"> <Header /> {this.props.children} </div> ); } }
homepage/index.js
pixelass/pixelass-homepage
import React from 'react' import {render} from 'react-dom' import Impressum from '../src/containers/impressum' import Header from '../src/containers/header' import Footer from '../src/containers/footer' import Main from '../src/containers/main' import Art from '../src/containers/art' import Fractals from '../src/containers/fractals' import 'normalize.css' import './styles.css' const App = () => ( <div> <Header/> <Main/> <Fractals/> <Art/> <Impressum/> <Footer/> </div> ) App.displayName = 'App' render(<App/>, document.getElementById('mountPoint'))
fields/types/numberarray/NumberArrayFilter.js
brianjd/keystone
import React from 'react'; import { findDOMNode } from 'react-dom'; import { FormField, FormInput, FormSelect, Grid, } from '../../../admin/client/App/elemental'; const MODE_OPTIONS = [ { label: 'Exactly', value: 'equals' }, { label: 'Greater Than', value: 'gt' }, { label: 'Less Than', value: 'lt' }, { label: 'Between', value: 'between' }, ]; const PRESENCE_OPTIONS = [ { label: 'At least one element', value: 'some' }, { label: 'No element', value: 'none' }, ]; function getDefaultValue () { return { mode: MODE_OPTIONS[0].value, presence: PRESENCE_OPTIONS[0].value, value: '', }; } var NumberArrayFilter = React.createClass({ propTypes: { filter: React.PropTypes.shape({ mode: React.PropTypes.oneOf(MODE_OPTIONS.map(i => i.value)), presence: React.PropTypes.oneOf(PRESENCE_OPTIONS.map(i => i.value)), value: React.PropTypes.oneOfType([ React.PropTypes.number, React.PropTypes.string, React.PropTypes.shape({ min: React.PropTypes.number, max: React.PropTypes.number, }), ]), }), }, statics: { getDefaultValue: getDefaultValue, }, getDefaultProps () { return { filter: getDefaultValue(), }; }, // Returns a function that handles a specific type of onChange events for // either 'minValue', 'maxValue' or simply 'value' handleValueChangeBuilder (type) { var self = this; return function (e) { switch (type) { case 'minValue': self.updateFilter({ value: { min: e.target.value, max: self.props.filter.value.max, }, }); break; case 'maxValue': self.updateFilter({ value: { min: self.props.filter.value.min, max: e.target.value, }, }); break; case 'value': self.updateFilter({ value: e.target.value, }); break; } }; }, // Update the props with this.props.onChange updateFilter (changedProp) { this.props.onChange({ ...this.props.filter, ...changedProp }); }, // Update the filter mode selectMode (e) { const mode = e.target.value; this.updateFilter({ mode }); findDOMNode(this.refs.focusTarget).focus(); }, // Update the presence selection selectPresence (e) { const presence = e.target.value; this.updateFilter({ presence }); findDOMNode(this.refs.focusTarget).focus(); }, // Render the controls, showing two inputs when the mode is "between" renderControls (presence, mode) { let controls; const placeholder = presence.label + ' is ' + mode.label.toLowerCase() + '...'; if (mode.value === 'between') { // Render "min" and "max" input controls = ( <Grid.Row xsmall="one-half" gutter={10}> <Grid.Col> <FormInput onChange={this.handleValueChangeBuilder('minValue')} placeholder="Min." ref="focusTarget" type="number" value={this.props.filter.value.min} /> </Grid.Col> <Grid.Col> <FormInput onChange={this.handleValueChangeBuilder('maxValue')} placeholder="Max." type="number" value={this.props.filter.value.max} /> </Grid.Col> </Grid.Row> ); } else { // Render one number input controls = ( <FormInput onChange={this.handleValueChangeBuilder('value')} placeholder={placeholder} ref="focusTarget" type="number" value={this.props.filter.value} /> ); } return controls; }, render () { const { filter } = this.props; // Get mode and presence based on their values with .filter const mode = MODE_OPTIONS.filter(i => i.value === filter.mode)[0]; const presence = PRESENCE_OPTIONS.filter(i => i.value === filter.presence)[0]; return ( <div> <FormField> <FormSelect onChange={this.selectPresence} options={PRESENCE_OPTIONS} value={presence.value} /> </FormField> <FormField> <FormSelect onChange={this.selectMode} options={MODE_OPTIONS} value={mode.value} /> </FormField> {this.renderControls(presence, mode)} </div> ); }, }); module.exports = NumberArrayFilter;
src/shared/components/MoneyInput/index.js
rvboris/finalytics
import React from 'react'; const getCursorPosition = (element) => { if (element.selectionStart) { return element.selectionStart; } if (document.selection) { element.focus(); const range = document.selection.createRange(); if (!range) { return 0; } const textRange = element.createTextRange(); const dupRange = textRange.duplicate(); textRange.moveToBookmark(range.getBookmark()); dupRange.setEndPoint('EndToStart', textRange); return dupRange.text.length; } return 0; }; const checkValue = (event, currentValue) => { const inputCode = event.which; if (inputCode > 0 && (inputCode < 48 || inputCode > 57)) { if (inputCode === 46) { if ((getCursorPosition(event.target) === 0 && currentValue.charAt(0) === '-') || currentValue.match(/[.]/)) { event.preventDefault(); } } else if (inputCode === 45) { if (currentValue.charAt(0) === '-' || getCursorPosition(event.target) !== 0) { event.preventDefault(); } } else if (inputCode !== 8) { event.preventDefault(); } } else if (inputCode > 0 && (inputCode >= 48 && inputCode <= 57)) { if (currentValue.charAt(0) === '-' && getCursorPosition(event.target) === 0) { event.preventDefault(); } } }; const MoneyInput = ({ input, className }) => { const onKeyPress = (event) => checkValue(event, input.value.toString()); const onChange = (event) => { const parseValue = parseFloat(event.target.value); if (!Number.isFinite(parseValue)) { event.preventDefault(); } if (input.onChange) { input.onChange(event.target.value); } }; return ( <input {...input} type="text" className={className} onKeyPress={onKeyPress} onChange={onChange} /> ); }; MoneyInput.propTypes = { input: React.PropTypes.object.isRequired, className: React.PropTypes.string, }; MoneyInput.defaultProps = { className: null, }; export default MoneyInput; export const toPositive = (txt = '') => txt.toString().replace('-', ''); export const toNegative = (txt = '') => txt ? `-${toPositive(txt)}` : '';
src/components/Page.js
ranneyd/eth-faucet
import React from 'react'; import { Link } from 'react-router' import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import getMuiTheme from 'material-ui/styles/getMuiTheme'; import AppBar from 'material-ui/AppBar'; import Drawer from 'material-ui/Drawer'; import MenuItem from 'material-ui/MenuItem'; import { Container } from 'react-grid-system'; import { HiddenOnlyAuth, VisibleOnlyAuth } from '../util/wrappers.js' class Page extends React.Component { constructor(props) { super(props); this.state = { navOpen: false, } } onHamburgerClick() { this.setState({ navOpen: !this.state.navOpen, }) } render() { const OnlyAuthLinks = VisibleOnlyAuth(() => <span> <Link to='dashboard'><MenuItem>Dashboard</MenuItem></Link> <Link to='profile'><MenuItem>Profile</MenuItem></Link> </span> ) const OnlyGuestLinks = HiddenOnlyAuth(() => <span> <Link to='signup'><MenuItem>Signup</MenuItem></Link> </span> ) return ( <MuiThemeProvider muiTheme={getMuiTheme(darkBaseTheme)}> <div style={{ fontFamily: "'Roboto', sans-serif" }}> <AppBar title="The Austin Ethereum Faucet" iconClassNameRight="muidocs-icon-navigation-expand-more" onLeftIconButtonTouchTap={e => this.onHamburgerClick()} /> <Drawer open={this.state.navOpen} onRequestChange={e => this.onHamburgerClick()} docked={false}> <Link to='/'><MenuItem>Home</MenuItem></Link> <OnlyAuthLinks /> <OnlyGuestLinks /> </Drawer> <br /> <Container> {this.props.children} </Container> </div> </MuiThemeProvider> ); } }; export default Page;
ajax/libs/dc/2.0.0-beta.31/dc.js
dakshshah96/cdnjs
/*! * dc 2.0.0-beta.31 * http://dc-js.github.io/dc.js/ * Copyright 2012-2016 Nick Zhu & the dc.js Developers * https://github.com/dc-js/dc.js/blob/master/AUTHORS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function() { function _dc(d3, crossfilter) { 'use strict'; /** * The entire dc.js library is scoped under the **dc** name space. It does not introduce * anything else into the global name space. * * Most `dc` functions are designed to allow function chaining, meaning they return the current chart * instance whenever it is appropriate. The getter forms of functions do not participate in function * chaining because they return values that are not the chart, although some, * such as {@link dc.baseMixin#svg .svg} and {@link dc.coordinateGridMixin#xAxis .xAxis}, * return values that are themselves chainable d3 objects. * @namespace dc * @version 2.0.0-beta.31 * @example * // Example chaining * chart.width(300) * .height(300) * .filter('sunday'); */ /*jshint -W079*/ var dc = { version: '2.0.0-beta.31', constants: { CHART_CLASS: 'dc-chart', DEBUG_GROUP_CLASS: 'debug', STACK_CLASS: 'stack', DESELECTED_CLASS: 'deselected', SELECTED_CLASS: 'selected', NODE_INDEX_NAME: '__index__', GROUP_INDEX_NAME: '__group_index__', DEFAULT_CHART_GROUP: '__default_chart_group__', EVENT_DELAY: 40, NEGLIGIBLE_NUMBER: 1e-10 }, _renderlet: null }; /*jshint +W079*/ /** * The dc.chartRegistry object maintains sets of all instantiated dc.js charts under named groups * and the default group. * * A chart group often corresponds to a crossfilter instance. It specifies * the set of charts which should be updated when a filter changes on one of the charts or when the * global functions {@link dc.filterAll dc.filterAll}, {@link dc.refocusAll dc.refocusAll}, * {@link dc.renderAll dc.renderAll}, {@link dc.redrawAll dc.redrawAll}, or chart functions * {@link dc.baseMixin#renderGroup baseMixin.renderGroup}, * {@link dc.baseMixin#redrawGroup baseMixin.redrawGroup} are called. * * @namespace chartRegistry * @memberof dc * @type {{has, register, deregister, clear, list}} */ dc.chartRegistry = (function () { // chartGroup:string => charts:array var _chartMap = {}; function initializeChartGroup (group) { if (!group) { group = dc.constants.DEFAULT_CHART_GROUP; } if (!_chartMap[group]) { _chartMap[group] = []; } return group; } return { /** * Determine if a given chart instance resides in any group in the registry. * @method has * @memberof dc.chartRegistry * @param {Object} chart dc.js chart instance * @returns {Boolean} */ has: function (chart) { for (var e in _chartMap) { if (_chartMap[e].indexOf(chart) >= 0) { return true; } } return false; }, /** * Add given chart instance to the given group, creating the group if necessary. * If no group is provided, the default group `dc.constants.DEFAULT_CHART_GROUP` will be used. * @method register * @memberof dc.chartRegistry * @param {Object} chart dc.js chart instance * @param {String} [group] Group name */ register: function (chart, group) { group = initializeChartGroup(group); _chartMap[group].push(chart); }, /** * Remove given chart instance from the given group, creating the group if necessary. * If no group is provided, the default group `dc.constants.DEFAULT_CHART_GROUP` will be used. * @method deregister * @memberof dc.chartRegistry * @param {Object} chart dc.js chart instance * @param {String} [group] Group name */ deregister: function (chart, group) { group = initializeChartGroup(group); for (var i = 0; i < _chartMap[group].length; i++) { if (_chartMap[group][i].anchorName() === chart.anchorName()) { _chartMap[group].splice(i, 1); break; } } }, /** * Clear given group if one is provided, otherwise clears all groups. * @method clear * @memberof dc.chartRegistry * @param {String} group Group name */ clear: function (group) { if (group) { delete _chartMap[group]; } else { _chartMap = {}; } }, /** * Get an array of each chart instance in the given group. * If no group is provided, the charts in the default group are returned. * @method list * @memberof dc.chartRegistry * @param {String} [group] Group name * @returns {Array<Object>} */ list: function (group) { group = initializeChartGroup(group); return _chartMap[group]; } }; })(); /** * Add given chart instance to the given group, creating the group if necessary. * If no group is provided, the default group `dc.constants.DEFAULT_CHART_GROUP` will be used. * @memberof dc * @method registerChart * @param {Object} chart dc.js chart instance * @param {String} [group] Group name */ dc.registerChart = function (chart, group) { dc.chartRegistry.register(chart, group); }; /** * Remove given chart instance from the given group, creating the group if necessary. * If no group is provided, the default group `dc.constants.DEFAULT_CHART_GROUP` will be used. * @memberof dc * @method deregisterChart * @param {Object} chart dc.js chart instance * @param {String} [group] Group name */ dc.deregisterChart = function (chart, group) { dc.chartRegistry.deregister(chart, group); }; /** * Determine if a given chart instance resides in any group in the registry. * @memberof dc * @method hasChart * @param {Object} chart dc.js chart instance * @returns {Boolean} */ dc.hasChart = function (chart) { return dc.chartRegistry.has(chart); }; /** * Clear given group if one is provided, otherwise clears all groups. * @memberof dc * @method deregisterAllCharts * @param {String} group Group name */ dc.deregisterAllCharts = function (group) { dc.chartRegistry.clear(group); }; /** * Clear all filters on all charts within the given chart group. If the chart group is not given then * only charts that belong to the default chart group will be reset. * @memberof dc * @method filterAll * @param {String} [group] */ dc.filterAll = function (group) { var charts = dc.chartRegistry.list(group); for (var i = 0; i < charts.length; ++i) { charts[i].filterAll(); } }; /** * Reset zoom level / focus on all charts that belong to the given chart group. If the chart group is * not given then only charts that belong to the default chart group will be reset. * @memberof dc * @method refocusAll * @param {String} [group] */ dc.refocusAll = function (group) { var charts = dc.chartRegistry.list(group); for (var i = 0; i < charts.length; ++i) { if (charts[i].focus) { charts[i].focus(); } } }; /** * Re-render all charts belong to the given chart group. If the chart group is not given then only * charts that belong to the default chart group will be re-rendered. * @memberof dc * @method renderAll * @param {String} [group] */ dc.renderAll = function (group) { var charts = dc.chartRegistry.list(group); for (var i = 0; i < charts.length; ++i) { charts[i].render(); } if (dc._renderlet !== null) { dc._renderlet(group); } }; /** * Redraw all charts belong to the given chart group. If the chart group is not given then only charts * that belong to the default chart group will be re-drawn. Redraw is different from re-render since * when redrawing dc tries to update the graphic incrementally, using transitions, instead of starting * from scratch. * @memberof dc * @method redrawAll * @param {String} [group] */ dc.redrawAll = function (group) { var charts = dc.chartRegistry.list(group); for (var i = 0; i < charts.length; ++i) { charts[i].redraw(); } if (dc._renderlet !== null) { dc._renderlet(group); } }; /** * If this boolean is set truthy, all transitions will be disabled, and changes to the charts will happen * immediately * @memberof dc * @method disableTransitions * @type {Boolean} * @default false */ dc.disableTransitions = false; dc.transition = function (selections, duration, callback, name) { if (duration <= 0 || duration === undefined || dc.disableTransitions) { return selections; } var s = selections .transition(name) .duration(duration); if (typeof(callback) === 'function') { callback(s); } return s; }; /* somewhat silly, but to avoid duplicating logic */ dc.optionalTransition = function (enable, duration, callback, name) { if (enable) { return function (selection) { return dc.transition(selection, duration, callback, name); }; } else { return function (selection) { return selection; }; } }; // See http://stackoverflow.com/a/20773846 dc.afterTransition = function (transition, callback) { if (transition.empty() || !transition.duration) { callback.call(transition); } else { var n = 0; transition .each(function () { ++n; }) .each('end', function () { if (!--n) { callback.call(transition); } }); } }; /** * @namespace units * @memberof dc * @type {{}} */ dc.units = {}; /** * The default value for {@link dc.coordinateGridMixin#xUnits .xUnits} for the * {@link dc.coordinateGridMixin Coordinate Grid Chart} and should * be used when the x values are a sequence of integers. * It is a function that counts the number of integers in the range supplied in its start and end parameters. * @method integers * @memberof dc.units * @see {@link dc.coordinateGridMixin#xUnits coordinateGridMixin.xUnits} * @example * chart.xUnits(dc.units.integers) // already the default * @param {Number} start * @param {Number} end * @return {Number} */ dc.units.integers = function (start, end) { return Math.abs(end - start); }; /** * This argument can be passed to the {@link dc.coordinateGridMixin#xUnits .xUnits} function of the to * specify ordinal units for the x axis. Usually this parameter is used in combination with passing * {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales d3.scale.ordinal} to * {@link dc.coordinateGridMixin#x .x}. * It just returns the domain passed to it, which for ordinal charts is an array of all values. * @method ordinal * @memberof dc.units * @see {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales d3.scale.ordinal} * @see {@link dc.coordinateGridMixin#xUnits coordinateGridMixin.xUnits} * @see {@link dc.coordinateGridMixin#x coordinateGridMixin.x} * @example * chart.xUnits(dc.units.ordinal) * .x(d3.scale.ordinal()) * @param {*} start * @param {*} end * @param {Array<String>} domain * @return {Array<String>} */ dc.units.ordinal = function (start, end, domain) { return domain; }; /** * @namespace fp * @memberof dc.units * @type {{}} */ dc.units.fp = {}; /** * This function generates an argument for the {@link dc.coordinateGridMixin Coordinate Grid Chart} * {@link dc.coordinateGridMixin#xUnits .xUnits} function specifying that the x values are floating-point * numbers with the given precision. * The returned function determines how many values at the given precision will fit into the range * supplied in its start and end parameters. * @method precision * @memberof dc.units.fp * @see {@link dc.coordinateGridMixin#xUnits coordinateGridMixin.xUnits} * @example * // specify values (and ticks) every 0.1 units * chart.xUnits(dc.units.fp.precision(0.1) * // there are 500 units between 0.5 and 1 if the precision is 0.001 * var thousandths = dc.units.fp.precision(0.001); * thousandths(0.5, 1.0) // returns 500 * @param {Number} precision * @return {Function} start-end unit function */ dc.units.fp.precision = function (precision) { var _f = function (s, e) { var d = Math.abs((e - s) / _f.resolution); if (dc.utils.isNegligible(d - Math.floor(d))) { return Math.floor(d); } else { return Math.ceil(d); } }; _f.resolution = precision; return _f; }; dc.round = {}; dc.round.floor = function (n) { return Math.floor(n); }; dc.round.ceil = function (n) { return Math.ceil(n); }; dc.round.round = function (n) { return Math.round(n); }; dc.override = function (obj, functionName, newFunction) { var existingFunction = obj[functionName]; obj['_' + functionName] = existingFunction; obj[functionName] = newFunction; }; dc.renderlet = function (_) { if (!arguments.length) { return dc._renderlet; } dc._renderlet = _; return dc; }; dc.instanceOfChart = function (o) { return o instanceof Object && o.__dcFlag__ && true; }; dc.errors = {}; dc.errors.Exception = function (msg) { var _msg = msg || 'Unexpected internal error'; this.message = _msg; this.toString = function () { return _msg; }; this.stack = (new Error()).stack; }; dc.errors.Exception.prototype = Object.create(Error.prototype); dc.errors.Exception.prototype.constructor = dc.errors.Exception; dc.errors.InvalidStateException = function () { dc.errors.Exception.apply(this, arguments); }; dc.errors.InvalidStateException.prototype = Object.create(dc.errors.Exception.prototype); dc.errors.InvalidStateException.prototype.constructor = dc.errors.InvalidStateException; dc.errors.BadArgumentException = function () { dc.errors.Exception.apply(this, arguments); }; dc.errors.BadArgumentException.prototype = Object.create(dc.errors.Exception.prototype); dc.errors.BadArgumentException.prototype.constructor = dc.errors.BadArgumentException; /** * The default date format for dc.js * @name dateFormat * @memberof dc * @type {Function} * @default d3.time.format('%m/%d/%Y') */ dc.dateFormat = d3.time.format('%m/%d/%Y'); /** * @namespace printers * @memberof dc * @type {{}} */ dc.printers = {}; /** * Converts a list of filters into a readable string * @method filters * @memberof dc.printers * @param {Array<dc.filters|any>} filters * @returns {String} */ dc.printers.filters = function (filters) { var s = ''; for (var i = 0; i < filters.length; ++i) { if (i > 0) { s += ', '; } s += dc.printers.filter(filters[i]); } return s; }; /** * Converts a filter into a readable string * @method filter * @memberof dc.printers * @param {dc.filters|any|Array<any>} filter * @returns {String} */ dc.printers.filter = function (filter) { var s = ''; if (typeof filter !== 'undefined' && filter !== null) { if (filter instanceof Array) { if (filter.length >= 2) { s = '[' + dc.utils.printSingleValue(filter[0]) + ' -> ' + dc.utils.printSingleValue(filter[1]) + ']'; } else if (filter.length >= 1) { s = dc.utils.printSingleValue(filter[0]); } } else { s = dc.utils.printSingleValue(filter); } } return s; }; /** * Returns a function that given a string property name, can be used to pluck the property off an object. A function * can be passed as the second argument to also alter the data being returned. This can be a useful shorthand method to create * accessor functions. * @method pluck * @memberof dc * @example * var xPluck = dc.pluck('x'); * var objA = {x: 1}; * xPluck(objA) // 1 * @example * var xPosition = dc.pluck('x', function (x, i) { * // `this` is the original datum, * // `x` is the x property of the datum, * // `i` is the position in the array * return this.radius + x; * }); * dc.selectAll('.circle').data(...).x(xPosition); * @param {String} n * @param {Function} [f] * @returns {Function} */ dc.pluck = function (n, f) { if (!f) { return function (d) { return d[n]; }; } return function (d, i) { return f.call(d, d[n], i); }; }; /** * @namespace utils * @memberof dc * @type {{}} */ dc.utils = {}; /** * Print a single value filter * @method printSingleValue * @memberof dc.utils * @param {any} filter * @returns {String} */ dc.utils.printSingleValue = function (filter) { var s = '' + filter; if (filter instanceof Date) { s = dc.dateFormat(filter); } else if (typeof(filter) === 'string') { s = filter; } else if (dc.utils.isFloat(filter)) { s = dc.utils.printSingleValue.fformat(filter); } else if (dc.utils.isInteger(filter)) { s = Math.round(filter); } return s; }; dc.utils.printSingleValue.fformat = d3.format('.2f'); /** * Arbitrary add one value to another. * @method add * @memberof dc.utils * @todo * These assume than any string r is a percentage (whether or not it includes %). * They also generate strange results if l is a string. * @param {String|Date|Number} l * @param {Number} r * @returns {String|Date|Number} */ dc.utils.add = function (l, r) { if (typeof r === 'string') { r = r.replace('%', ''); } if (l instanceof Date) { if (typeof r === 'string') { r = +r; } var d = new Date(); d.setTime(l.getTime()); d.setDate(l.getDate() + r); return d; } else if (typeof r === 'string') { var percentage = (+r / 100); return l > 0 ? l * (1 + percentage) : l * (1 - percentage); } else { return l + r; } }; /** * Arbitrary subtract one value from another. * @method subtract * @memberof dc.utils * @todo * These assume than any string r is a percentage (whether or not it includes %). * They also generate strange results if l is a string. * @param {String|Date|Number} l * @param {Number} r * @returns {String|Date|Number} */ dc.utils.subtract = function (l, r) { if (typeof r === 'string') { r = r.replace('%', ''); } if (l instanceof Date) { if (typeof r === 'string') { r = +r; } var d = new Date(); d.setTime(l.getTime()); d.setDate(l.getDate() - r); return d; } else if (typeof r === 'string') { var percentage = (+r / 100); return l < 0 ? l * (1 + percentage) : l * (1 - percentage); } else { return l - r; } }; /** * Is the value a number? * @method isNumber * @memberof dc.utils * @param {any} n * @returns {Boolean} */ dc.utils.isNumber = function (n) { return n === +n; }; /** * Is the value a float? * @method isFloat * @memberof dc.utils * @param {any} n * @returns {Boolean} */ dc.utils.isFloat = function (n) { return n === +n && n !== (n | 0); }; /** * Is the value an integer? * @method isInteger * @memberof dc.utils * @param {any} n * @returns {Boolean} */ dc.utils.isInteger = function (n) { return n === +n && n === (n | 0); }; /** * Is the value very close to zero? * @method isNegligible * @memberof dc.utils * @param {any} n * @returns {Boolean} */ dc.utils.isNegligible = function (n) { return !dc.utils.isNumber(n) || (n < dc.constants.NEGLIGIBLE_NUMBER && n > -dc.constants.NEGLIGIBLE_NUMBER); }; /** * Ensure the value is no greater or less than the min/max values. If it is return the boundary value. * @method clamp * @memberof dc.utils * @param {any} val * @param {any} min * @param {any} max * @returns {any} */ dc.utils.clamp = function (val, min, max) { return val < min ? min : (val > max ? max : val); }; /** * Using a simple static counter, provide a unique integer id. * @method uniqueId * @memberof dc.utils * @returns {Number} */ var _idCounter = 0; dc.utils.uniqueId = function () { return ++_idCounter; }; /** * Convert a name to an ID. * @method nameToId * @memberof dc.utils * @param {String} name * @returns {String} */ dc.utils.nameToId = function (name) { return name.toLowerCase().replace(/[\s]/g, '_').replace(/[\.']/g, ''); }; /** * Append or select an item on a parent element * @method appendOrSelect * @memberof dc.utils * @param {d3.selection} parent * @param {String} selector * @param {String} tag * @returns {d3.selection} */ dc.utils.appendOrSelect = function (parent, selector, tag) { tag = tag || selector; var element = parent.select(selector); if (element.empty()) { element = parent.append(tag); } return element; }; /** * Return the number if the value is a number; else 0. * @method safeNumber * @memberof dc.utils * @param {Number|any} n * @returns {Number} */ dc.utils.safeNumber = function (n) { return dc.utils.isNumber(+n) ? +n : 0;}; dc.logger = {}; dc.logger.enableDebugLog = false; dc.logger.warn = function (msg) { if (console) { if (console.warn) { console.warn(msg); } else if (console.log) { console.log(msg); } } return dc.logger; }; dc.logger.debug = function (msg) { if (dc.logger.enableDebugLog && console) { if (console.debug) { console.debug(msg); } else if (console.log) { console.log(msg); } } return dc.logger; }; dc.logger.deprecate = function (fn, msg) { // Allow logging of deprecation var warned = false; function deprecated () { if (!warned) { dc.logger.warn(msg); warned = true; } return fn.apply(this, arguments); } return deprecated; }; dc.events = { current: null }; /** * This function triggers a throttled event function with a specified delay (in milli-seconds). Events * that are triggered repetitively due to user interaction such brush dragging might flood the library * and invoke more renders than can be executed in time. Using this function to wrap your event * function allows the library to smooth out the rendering by throttling events and only responding to * the most recent event. * @name events.trigger * @memberof dc * @example * chart.on('renderlet', function(chart) { * // smooth the rendering through event throttling * dc.events.trigger(function(){ * // focus some other chart to the range selected by user on this chart * someOtherChart.focus(chart.filter()); * }); * }) * @param {Function} closure * @param {Number} [delay] */ dc.events.trigger = function (closure, delay) { if (!delay) { closure(); return; } dc.events.current = closure; setTimeout(function () { if (closure === dc.events.current) { closure(); } }, delay); }; /** * The dc.js filters are functions which are passed into crossfilter to chose which records will be * accumulated to produce values for the charts. In the crossfilter model, any filters applied on one * dimension will affect all the other dimensions but not that one. dc always applies a filter * function to the dimension; the function combines multiple filters and if any of them accept a * record, it is filtered in. * * These filter constructors are used as appropriate by the various charts to implement brushing. We * mention below which chart uses which filter. In some cases, many instances of a filter will be added. * * Each of the dc.js filters is an object with the following properties: * * `isFiltered` - a function that returns true if a value is within the filter * * `filterType` - a string identifying the filter, here the name of the constructor * * Currently these filter objects are also arrays, but this is not a requirement. Custom filters * can be used as long as they have the properties above. * @namespace filters * @memberof dc * @type {{}} */ dc.filters = {}; /** * RangedFilter is a filter which accepts keys between `low` and `high`. It is used to implement X * axis brushing for the {@link dc.coordinateGridMixin coordinate grid charts}. * * Its `filterType` is 'RangedFilter' * @name RangedFilter * @memberof dc.filters * @param {Number} low * @param {Number} high * @return {Array<Number>} * @constructor */ dc.filters.RangedFilter = function (low, high) { var range = new Array(low, high); range.isFiltered = function (value) { return value >= this[0] && value < this[1]; }; range.filterType = 'RangedFilter'; return range; }; /** * TwoDimensionalFilter is a filter which accepts a single two-dimensional value. It is used by the * {@link dc.heatMap heat map chart} to include particular cells as they are clicked. (Rows and columns are * filtered by filtering all the cells in the row or column.) * * Its `filterType` is 'TwoDimensionalFilter' * @name TwoDimensionalFilter * @memberof dc.filters * @param {Array<Number>} filter * @return {Array<Number>} * @constructor */ dc.filters.TwoDimensionalFilter = function (filter) { if (filter === null) { return null; } var f = filter; f.isFiltered = function (value) { return value.length && value.length === f.length && value[0] === f[0] && value[1] === f[1]; }; f.filterType = 'TwoDimensionalFilter'; return f; }; /** * The RangedTwoDimensionalFilter allows filtering all values which fit within a rectangular * region. It is used by the {@link dc.scatterPlot scatter plot} to implement rectangular brushing. * * It takes two two-dimensional points in the form `[[x1,y1],[x2,y2]]`, and normalizes them so that * `x1 <= x2` and `y1 <= y2`. It then returns a filter which accepts any points which are in the * rectangular range including the lower values but excluding the higher values. * * If an array of two values are given to the RangedTwoDimensionalFilter, it interprets the values as * two x coordinates `x1` and `x2` and returns a filter which accepts any points for which `x1 <= x < * x2`. * * Its `filterType` is 'RangedTwoDimensionalFilter' * @name RangedTwoDimensionalFilter * @memberof dc.filters * @param {Array<Array<Number>>} filter * @return {Array<Array<Number>>} * @constructor */ dc.filters.RangedTwoDimensionalFilter = function (filter) { if (filter === null) { return null; } var f = filter; var fromBottomLeft; if (f[0] instanceof Array) { fromBottomLeft = [ [Math.min(filter[0][0], filter[1][0]), Math.min(filter[0][1], filter[1][1])], [Math.max(filter[0][0], filter[1][0]), Math.max(filter[0][1], filter[1][1])] ]; } else { fromBottomLeft = [[filter[0], -Infinity], [filter[1], Infinity]]; } f.isFiltered = function (value) { var x, y; if (value instanceof Array) { if (value.length !== 2) { return false; } x = value[0]; y = value[1]; } else { x = value; y = fromBottomLeft[0][1]; } return x >= fromBottomLeft[0][0] && x < fromBottomLeft[1][0] && y >= fromBottomLeft[0][1] && y < fromBottomLeft[1][1]; }; f.filterType = 'RangedTwoDimensionalFilter'; return f; }; /** * `dc.baseMixin` is an abstract functional object representing a basic `dc` chart object * for all chart and widget implementations. Methods from the {@link #dc.baseMixin dc.baseMixin} are inherited * and available on all chart implementations in the `dc` library. * @name baseMixin * @memberof dc * @mixin * @param {Object} _chart * @return {dc.baseMixin} */ dc.baseMixin = function (_chart) { _chart.__dcFlag__ = dc.utils.uniqueId(); var _dimension; var _group; var _anchor; var _root; var _svg; var _isChild; var _minWidth = 200; var _defaultWidthCalc = function (element) { var width = element && element.getBoundingClientRect && element.getBoundingClientRect().width; return (width && width > _minWidth) ? width : _minWidth; }; var _widthCalc = _defaultWidthCalc; var _minHeight = 200; var _defaultHeightCalc = function (element) { var height = element && element.getBoundingClientRect && element.getBoundingClientRect().height; return (height && height > _minHeight) ? height : _minHeight; }; var _heightCalc = _defaultHeightCalc; var _width, _height; var _keyAccessor = dc.pluck('key'); var _valueAccessor = dc.pluck('value'); var _label = dc.pluck('key'); var _ordering = dc.pluck('key'); var _orderSort; var _renderLabel = false; var _title = function (d) { return _chart.keyAccessor()(d) + ': ' + _chart.valueAccessor()(d); }; var _renderTitle = true; var _controlsUseVisibility = false; var _transitionDuration = 750; var _filterPrinter = dc.printers.filters; var _mandatoryAttributes = ['dimension', 'group']; var _chartGroup = dc.constants.DEFAULT_CHART_GROUP; var _listeners = d3.dispatch( 'preRender', 'postRender', 'preRedraw', 'postRedraw', 'filtered', 'zoomed', 'renderlet', 'pretransition'); var _legend; var _commitHandler; var _filters = []; var _filterHandler = function (dimension, filters) { if (filters.length === 0) { dimension.filter(null); } else if (filters.length === 1 && !filters[0].isFiltered) { // single value and not a function-based filter dimension.filterExact(filters[0]); } else if (filters.length === 1 && filters[0].filterType === 'RangedFilter') { // single range-based filter dimension.filterRange(filters[0]); } else { dimension.filterFunction(function (d) { for (var i = 0; i < filters.length; i++) { var filter = filters[i]; if (filter.isFiltered && filter.isFiltered(d)) { return true; } else if (filter <= d && filter >= d) { return true; } } return false; }); } return filters; }; var _data = function (group) { return group.all(); }; /** * Set or get the height attribute of a chart. The height is applied to the SVGElement generated by * the chart when rendered (or re-rendered). If a value is given, then it will be used to calculate * the new height and the chart returned for method chaining. The value can either be a numeric, a * function, or falsy. If no value is specified then the value of the current height attribute will * be returned. * * By default, without an explicit height being given, the chart will select the width of its * anchor element. If that isn't possible it defaults to 200 (provided by the * {@link dc.baseMixin#minHeight minHeight} property). Setting the value falsy will return * the chart to the default behavior. * @method height * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#minHeight minHeight} * @example * // Default height * chart.height(function (element) { * var height = element && element.getBoundingClientRect && element.getBoundingClientRect().height; * return (height && height > chart.minHeight()) ? height : chart.minHeight(); * }); * * chart.height(250); // Set the chart's height to 250px; * chart.height(function(anchor) { return doSomethingWith(anchor); }); // set the chart's height with a function * chart.height(null); // reset the height to the default auto calculation * @param {Number|Function} [height] * @return {Number} * @return {dc.baseMixin} */ _chart.height = function (height) { if (!arguments.length) { if (!dc.utils.isNumber(_height)) { // only calculate once _height = _heightCalc(_root.node()); } return _height; } _heightCalc = d3.functor(height || _defaultHeightCalc); _height = undefined; return _chart; }; /** * Set or get the width attribute of a chart. * @method width * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#height height} * @see {@link dc.baseMixin#minWidth minWidth} * @example * // Default width * chart.width(function (element) { * var width = element && element.getBoundingClientRect && element.getBoundingClientRect().width; * return (width && width > chart.minWidth()) ? width : chart.minWidth(); * }); * @param {Number|Function} [width] * @return {Number} * @return {dc.baseMixin} */ _chart.width = function (width) { if (!arguments.length) { if (!dc.utils.isNumber(_width)) { // only calculate once _width = _widthCalc(_root.node()); } return _width; } _widthCalc = d3.functor(width || _defaultWidthCalc); _width = undefined; return _chart; }; /** * Set or get the minimum width attribute of a chart. This only has effect when used with the default * {@link dc.baseMixin#width width} function. * @method minWidth * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#width width} * @param {Number} [minWidth=200] * @return {Number} * @return {dc.baseMixin} */ _chart.minWidth = function (minWidth) { if (!arguments.length) { return _minWidth; } _minWidth = minWidth; return _chart; }; /** * Set or get the minimum height attribute of a chart. This only has effect when used with the default * {@link dc.baseMixin#height height} function. * @method minHeight * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#height height} * @param {Number} [minHeight=200] * @return {Number} * @return {dc.baseMixin} */ _chart.minHeight = function (minHeight) { if (!arguments.length) { return _minHeight; } _minHeight = minHeight; return _chart; }; /** * **mandatory** * * Set or get the dimension attribute of a chart. In `dc`, a dimension can be any valid [crossfilter * dimension](https://github.com/square/crossfilter/wiki/API-Reference#wiki-dimension). * * If a value is given, then it will be used as the new dimension. If no value is specified then * the current dimension will be returned. * @method dimension * @memberof dc.baseMixin * @instance * @see {@link https://github.com/square/crossfilter/wiki/API-Reference#dimension crossfilter.dimension} * @example * var index = crossfilter([]); * var dimension = index.dimension(dc.pluck('key')); * chart.dimension(dimension); * @param {crossfilter.dimension} [dimension] * @return {crossfilter.dimension} * @return {dc.baseMixin} */ _chart.dimension = function (dimension) { if (!arguments.length) { return _dimension; } _dimension = dimension; _chart.expireCache(); return _chart; }; /** * Set the data callback or retrieve the chart's data set. The data callback is passed the chart's * group and by default will return * {@link https://github.com/square/crossfilter/wiki/API-Reference#group_all group.all}. * This behavior may be modified to, for instance, return only the top 5 groups. * @method data * @memberof dc.baseMixin * @instance * @example * // Default data function * chart.data(function (group) { return group.all(); }); * * chart.data(function (group) { return group.top(5); }); * @param {Function} [callback] * @return {*} * @return {dc.baseMixin} */ _chart.data = function (callback) { if (!arguments.length) { return _data.call(_chart, _group); } _data = d3.functor(callback); _chart.expireCache(); return _chart; }; /** * **mandatory** * * Set or get the group attribute of a chart. In `dc` a group is a * {@link https://github.com/square/crossfilter/wiki/API-Reference#group-map-reduce crossfilter group}. * Usually the group should be created from the particular dimension associated with the same chart. If a value is * given, then it will be used as the new group. * * If no value specified then the current group will be returned. * If `name` is specified then it will be used to generate legend label. * @method group * @memberof dc.baseMixin * @instance * @see {@link https://github.com/square/crossfilter/wiki/API-Reference#group-map-reduce crossfilter.group} * @example * var index = crossfilter([]); * var dimension = index.dimension(dc.pluck('key')); * chart.dimension(dimension); * chart.group(dimension.group(crossfilter.reduceSum())); * @param {crossfilter.group} [group] * @param {String} [name] * @return {crossfilter.group} * @return {dc.baseMixin} */ _chart.group = function (group, name) { if (!arguments.length) { return _group; } _group = group; _chart._groupName = name; _chart.expireCache(); return _chart; }; /** * Get or set an accessor to order ordinal dimensions. The chart uses * {@link https://github.com/square/crossfilter/wiki/API-Reference#quicksort_by crossfilter.quicksort.by} * to sort elements; this accessor returns the value to order on. * @method ordering * @memberof dc.baseMixin * @instance * @see {@link https://github.com/square/crossfilter/wiki/API-Reference#quicksort_by crossfilter.quicksort.by} * @example * // Default ordering accessor * _chart.ordering(dc.pluck('key')); * @param {Function} [orderFunction] * @return {Function} * @return {dc.baseMixin} */ _chart.ordering = function (orderFunction) { if (!arguments.length) { return _ordering; } _ordering = orderFunction; _orderSort = crossfilter.quicksort.by(_ordering); _chart.expireCache(); return _chart; }; _chart._computeOrderedGroups = function (data) { var dataCopy = data.slice(0); if (dataCopy.length <= 1) { return dataCopy; } if (!_orderSort) { _orderSort = crossfilter.quicksort.by(_ordering); } return _orderSort(dataCopy, 0, dataCopy.length); }; /** * Clear all filters associated with this chart * * The same can be achieved by calling {@link dc.baseMixin#filter chart.filter(null)}. * @method filterAll * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.filterAll = function () { return _chart.filter(null); }; /** * Execute d3 single selection in the chart's scope using the given selector and return the d3 * selection. * * This function is **not chainable** since it does not return a chart instance; however the d3 * selection result can be chained to d3 function calls. * @method select * @memberof dc.baseMixin * @instance * @see {@link https://github.com/mbostock/d3/wiki/Selections d3.selection} * @example * // Similar to: * d3.select('#chart-id').select(selector); * @return {d3.selection} */ _chart.select = function (s) { return _root.select(s); }; /** * Execute in scope d3 selectAll using the given selector and return d3 selection result. * * This function is **not chainable** since it does not return a chart instance; however the d3 * selection result can be chained to d3 function calls. * @method selectAll * @memberof dc.baseMixin * @instance * @see {@link https://github.com/mbostock/d3/wiki/Selections d3.selection} * @example * // Similar to: * d3.select('#chart-id').selectAll(selector); * @return {d3.selection} */ _chart.selectAll = function (s) { return _root ? _root.selectAll(s) : null; }; /** * Set the root SVGElement to either be an existing chart's root; or any valid [d3 single * selector](https://github.com/mbostock/d3/wiki/Selections#selecting-elements) specifying a dom * block element such as a div; or a dom element or d3 selection. Optionally registers the chart * within the chartGroup. This class is called internally on chart initialization, but be called * again to relocate the chart. However, it will orphan any previously created SVGElements. * @method anchor * @memberof dc.baseMixin * @instance * @param {anchorChart|anchorSelector|anchorNode} [parent] * @param {String} [chartGroup] * @return {String|node|d3.selection} * @return {dc.baseMixin} */ _chart.anchor = function (parent, chartGroup) { if (!arguments.length) { return _anchor; } if (dc.instanceOfChart(parent)) { _anchor = parent.anchor(); _root = parent.root(); _isChild = true; } else if (parent) { if (parent.select && parent.classed) { // detect d3 selection _anchor = parent.node(); } else { _anchor = parent; } _root = d3.select(_anchor); _root.classed(dc.constants.CHART_CLASS, true); dc.registerChart(_chart, chartGroup); _isChild = false; } else { throw new dc.errors.BadArgumentException('parent must be defined'); } _chartGroup = chartGroup; return _chart; }; /** * Returns the DOM id for the chart's anchored location. * @method anchorName * @memberof dc.baseMixin * @instance * @return {String} */ _chart.anchorName = function () { var a = _chart.anchor(); if (a && a.id) { return a.id; } if (a && a.replace) { return a.replace('#', ''); } return 'dc-chart' + _chart.chartID(); }; /** * Returns the root element where a chart resides. Usually it will be the parent div element where * the SVGElement was created. You can also pass in a new root element however this is usually handled by * dc internally. Resetting the root element on a chart outside of dc internals may have * unexpected consequences. * @method root * @memberof dc.baseMixin * @instance * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement HTMLElement} * @param {HTMLElement} [rootElement] * @return {HTMLElement} * @return {dc.baseMixin} */ _chart.root = function (rootElement) { if (!arguments.length) { return _root; } _root = rootElement; return _chart; }; /** * Returns the top SVGElement for this specific chart. You can also pass in a new SVGElement, * however this is usually handled by dc internally. Resetting the SVGElement on a chart outside * of dc internals may have unexpected consequences. * @method svg * @memberof dc.baseMixin * @instance * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/SVGElement SVGElement} * @param {SVGElement|d3.selection} [svgElement] * @return {SVGElement|d3.selection} * @return {dc.baseMixin} */ _chart.svg = function (svgElement) { if (!arguments.length) { return _svg; } _svg = svgElement; return _chart; }; /** * Remove the chart's SVGElements from the dom and recreate the container SVGElement. * @method resetSvg * @memberof dc.baseMixin * @instance * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/SVGElement SVGElement} * @return {SVGElement} */ _chart.resetSvg = function () { _chart.select('svg').remove(); return generateSvg(); }; function sizeSvg () { if (_svg) { _svg .attr('width', _chart.width()) .attr('height', _chart.height()); } } function generateSvg () { _svg = _chart.root().append('svg'); sizeSvg(); return _svg; } /** * Set or get the filter printer function. The filter printer function is used to generate human * friendly text for filter value(s) associated with the chart instance. By default dc charts use a * default filter printer `dc.printers.filter` that provides simple printing support for both * single value and ranged filters. * @method filterPrinter * @memberof dc.baseMixin * @instance * @param {Function} [filterPrinterFunction=dc.printers.filter] * @return {Function} * @return {dc.baseMixin} */ _chart.filterPrinter = function (filterPrinterFunction) { if (!arguments.length) { return _filterPrinter; } _filterPrinter = filterPrinterFunction; return _chart; }; /** * If set, use the `visibility` attribute instead of the `display` attribute for showing/hiding * chart reset and filter controls, for less disruption to the layout. * @method controlsUseVisibility * @memberof dc.baseMixin * @instance * @param {Boolean} [controlsUseVisibility=false] * @return {Boolean} * @return {dc.baseMixin} **/ _chart.controlsUseVisibility = function (_) { if (!arguments.length) { return _controlsUseVisibility; } _controlsUseVisibility = _; return _chart; }; /** * Turn on optional control elements within the root element. dc currently supports the * following html control elements. * * root.selectAll('.reset') - elements are turned on if the chart has an active filter. This type * of control element is usually used to store a reset link to allow user to reset filter on a * certain chart. This element will be turned off automatically if the filter is cleared. * * root.selectAll('.filter') elements are turned on if the chart has an active filter. The text * content of this element is then replaced with the current filter value using the filter printer * function. This type of element will be turned off automatically if the filter is cleared. * @method turnOnControls * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.turnOnControls = function () { if (_root) { var attribute = _chart.controlsUseVisibility() ? 'visibility' : 'display'; _chart.selectAll('.reset').style(attribute, null); _chart.selectAll('.filter').text(_filterPrinter(_chart.filters())).style(attribute, null); } return _chart; }; /** * Turn off optional control elements within the root element. * @method turnOffControls * @memberof dc.baseMixin * @see {@link dc.baseMixin#turnOnControls turnOnControls} * @instance * @return {dc.baseMixin} */ _chart.turnOffControls = function () { if (_root) { var attribute = _chart.controlsUseVisibility() ? 'visibility' : 'display'; var value = _chart.controlsUseVisibility() ? 'hidden' : 'none'; _chart.selectAll('.reset').style(attribute, value); _chart.selectAll('.filter').style(attribute, value).text(_chart.filter()); } return _chart; }; /** * Set or get the animation transition duration (in milliseconds) for this chart instance. * @method transitionDuration * @memberof dc.baseMixin * @instance * @param {Number} [duration=750] * @return {Number} * @return {dc.baseMixin} */ _chart.transitionDuration = function (duration) { if (!arguments.length) { return _transitionDuration; } _transitionDuration = duration; return _chart; }; _chart._mandatoryAttributes = function (_) { if (!arguments.length) { return _mandatoryAttributes; } _mandatoryAttributes = _; return _chart; }; function checkForMandatoryAttributes (a) { if (!_chart[a] || !_chart[a]()) { throw new dc.errors.InvalidStateException('Mandatory attribute chart.' + a + ' is missing on chart[#' + _chart.anchorName() + ']'); } } /** * Invoking this method will force the chart to re-render everything from scratch. Generally it * should only be used to render the chart for the first time on the page or if you want to make * sure everything is redrawn from scratch instead of relying on the default incremental redrawing * behaviour. * @method render * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.render = function () { _height = _width = undefined; // force recalculate _listeners.preRender(_chart); if (_mandatoryAttributes) { _mandatoryAttributes.forEach(checkForMandatoryAttributes); } var result = _chart._doRender(); if (_legend) { _legend.render(); } _chart._activateRenderlets('postRender'); return result; }; _chart._activateRenderlets = function (event) { _listeners.pretransition(_chart); if (_chart.transitionDuration() > 0 && _svg) { _svg.transition().duration(_chart.transitionDuration()) .each('end', function () { _listeners.renderlet(_chart); if (event) { _listeners[event](_chart); } }); } else { _listeners.renderlet(_chart); if (event) { _listeners[event](_chart); } } }; /** * Calling redraw will cause the chart to re-render data changes incrementally. If there is no * change in the underlying data dimension then calling this method will have no effect on the * chart. Most chart interaction in dc will automatically trigger this method through internal * events (in particular {@link dc.redrawAll dc.redrawAll}); therefore, you only need to * manually invoke this function if data is manipulated outside of dc's control (for example if * data is loaded in the background using * {@link https://github.com/square/crossfilter/wiki/API-Reference#crossfilter_add crossfilter.add}. * @method redraw * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.redraw = function () { sizeSvg(); _listeners.preRedraw(_chart); var result = _chart._doRedraw(); if (_legend) { _legend.render(); } _chart._activateRenderlets('postRedraw'); return result; }; /** * Gets/sets the commit handler. If the chart has a commit handler, the handler will be called when * the chart's filters have changed, in order to send the filter data asynchronously to a server. * * Unlike other functions in dc.js, the commit handler is asynchronous. It takes two arguments: * a flag indicating whether this is a render (true) or a redraw (false), and a callback to be * triggered once the commit is filtered. The callback has the standard node.js continuation signature * with error first and result second. * @method commitHandler * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.commitHandler = function (commitHandler) { if (!arguments.length) { return _commitHandler; } _commitHandler = commitHandler; return _chart; }; /** * Redraws all charts in the same group as this chart, typically in reaction to a filter * change. If the chart has a {@link dc.baseMixin.commitFilter commitHandler}, it will * be executed and waited for. * @method redrawGroup * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.redrawGroup = function () { if (_commitHandler) { _commitHandler(false, function (error, result) { if (error) { console.log(error); } else { dc.redrawAll(_chart.chartGroup()); } }); } else { dc.redrawAll(_chart.chartGroup()); } return _chart; }; /** * Renders all charts in the same group as this chart. If the chart has a * {@link dc.baseMixin.commitFilter commitHandler}, it will be executed and waited for * @method renderGroup * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.renderGroup = function () { if (_commitHandler) { _commitHandler(false, function (error, result) { if (error) { console.log(error); } else { dc.renderAll(_chart.chartGroup()); } }); } else { dc.renderAll(_chart.chartGroup()); } return _chart; }; _chart._invokeFilteredListener = function (f) { if (f !== undefined) { _listeners.filtered(_chart, f); } }; _chart._invokeZoomedListener = function () { _listeners.zoomed(_chart); }; var _hasFilterHandler = function (filters, filter) { if (filter === null || typeof(filter) === 'undefined') { return filters.length > 0; } return filters.some(function (f) { return filter <= f && filter >= f; }); }; /** * Set or get the has filter handler. The has filter handler is a function that checks to see if * the chart's current filters include a specific filter. Using a custom has filter handler allows * you to change the way filters are checked for and replaced. * @method hasFilterHandler * @memberof dc.baseMixin * @instance * @example * // default has filter handler * chart.hasFilterHandler(function (filters, filter) { * if (filter === null || typeof(filter) === 'undefined') { * return filters.length > 0; * } * return filters.some(function (f) { * return filter <= f && filter >= f; * }); * }); * * // custom filter handler (no-op) * chart.hasFilterHandler(function(filters, filter) { * return false; * }); * @param {Function} [hasFilterHandler] * @return {Function} * @return {dc.baseMixin} */ _chart.hasFilterHandler = function (hasFilterHandler) { if (!arguments.length) { return _hasFilterHandler; } _hasFilterHandler = hasFilterHandler; return _chart; }; /** * Check whether any active filter or a specific filter is associated with particular chart instance. * This function is **not chainable**. * @method hasFilter * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#hasFilterHandler hasFilterHandler} * @param {*} [filter] * @return {Boolean} */ _chart.hasFilter = function (filter) { return _hasFilterHandler(_filters, filter); }; var _removeFilterHandler = function (filters, filter) { for (var i = 0; i < filters.length; i++) { if (filters[i] <= filter && filters[i] >= filter) { filters.splice(i, 1); break; } } return filters; }; /** * Set or get the remove filter handler. The remove filter handler is a function that removes a * filter from the chart's current filters. Using a custom remove filter handler allows you to * change how filters are removed or perform additional work when removing a filter, e.g. when * using a filter server other than crossfilter. * * Any changes should modify the `filters` array argument and return that array. * @method removeFilterHandler * @memberof dc.baseMixin * @instance * @example * // default remove filter handler * chart.removeFilterHandler(function (filters, filter) { * for (var i = 0; i < filters.length; i++) { * if (filters[i] <= filter && filters[i] >= filter) { * filters.splice(i, 1); * break; * } * } * return filters; * }); * * // custom filter handler (no-op) * chart.removeFilterHandler(function(filters, filter) { * return filters; * }); * @param {Function} [removeFilterHandler] * @return {Function} * @return {dc.baseMixin} */ _chart.removeFilterHandler = function (removeFilterHandler) { if (!arguments.length) { return _removeFilterHandler; } _removeFilterHandler = removeFilterHandler; return _chart; }; var _addFilterHandler = function (filters, filter) { filters.push(filter); return filters; }; /** * Set or get the add filter handler. The add filter handler is a function that adds a filter to * the chart's filter list. Using a custom add filter handler allows you to change the way filters * are added or perform additional work when adding a filter, e.g. when using a filter server other * than crossfilter. * * Any changes should modify the `filters` array argument and return that array. * @method addFilterHandler * @memberof dc.baseMixin * @instance * @example * // default add filter handler * chart.addFilterHandler(function (filters, filter) { * filters.push(filter); * return filters; * }); * * // custom filter handler (no-op) * chart.addFilterHandler(function(filters, filter) { * return filters; * }); * @param {Function} [addFilterHandler] * @return {Function} * @return {dc.baseMixin} */ _chart.addFilterHandler = function (addFilterHandler) { if (!arguments.length) { return _addFilterHandler; } _addFilterHandler = addFilterHandler; return _chart; }; var _resetFilterHandler = function (filters) { return []; }; /** * Set or get the reset filter handler. The reset filter handler is a function that resets the * chart's filter list by returning a new list. Using a custom reset filter handler allows you to * change the way filters are reset, or perform additional work when resetting the filters, * e.g. when using a filter server other than crossfilter. * * This function should return an array. * @method resetFilterHandler * @memberof dc.baseMixin * @instance * @example * // default remove filter handler * function (filters) { * return []; * } * * // custom filter handler (no-op) * chart.resetFilterHandler(function(filters) { * return filters; * }); * @param {Function} [resetFilterHandler] * @return {dc.baseMixin} */ _chart.resetFilterHandler = function (resetFilterHandler) { if (!arguments.length) { return _resetFilterHandler; } _resetFilterHandler = resetFilterHandler; return _chart; }; function applyFilters () { if (_chart.dimension() && _chart.dimension().filter) { var fs = _filterHandler(_chart.dimension(), _filters); _filters = fs ? fs : _filters; } } /** * Replace the chart filter. This is equivalent to calling `chart.filter(null).filter(filter)` * * @method replaceFilter * @memberof dc.baseMixin * @instance * @param {*} [filter] * @return {dc.baseMixin} **/ _chart.replaceFilter = function (filter) { _filters = _resetFilterHandler(_filters); _chart.filter(filter); }; /** * Filter the chart by the given parameter, or return the current filter if no input parameter * is given. * * The filter parameter can take one of these forms: * * A single value: the value will be toggled (added if it is not present in the current * filters, removed if it is present) * * An array containing a single array of values (`[[value,value,value]]`): each value is * toggled * * When appropriate for the chart, a {@link dc.filters dc filter object} such as * * {@link dc.filters.RangedFilter `dc.filters.RangedFilter`} for the * {@link dc.coordinateGridMixin dc.coordinateGridMixin} charts * * {@link dc.filters.TwoDimensionalFilter `dc.filters.TwoDimensionalFilter`} for the * {@link dc.heatMap heat map} * * {@link dc.filters.RangedTwoDimensionalFilter `dc.filters.RangedTwoDimensionalFilter`} * for the {@link dc.scatterPlot scatter plot} * * `null`: the filter will be reset using the * {@link dc.baseMixin#resetFilterHandler resetFilterHandler} * * Note that this is always a toggle (even when it doesn't make sense for the filter type). If * you wish to replace the current filter, either call `chart.filter(null)` first, or * equivalently, call {@link dc.baseMixin#replaceFilter `chart.replaceFilter(filter)`} instead. * * Each toggle is executed by checking if the value is already present using the * {@link dc.baseMixin#hasFilterHandler hasFilterHandler}; if it is not present, it is added * using the {@link dc.baseMixin#addFilterHandler addFilterHandler}; if it is already present, * it is removed using the {@link dc.baseMixin#removeFilterHandler removeFilterHandler}. * * Once the filters array has been updated, the filters are applied to the * crossfilter dimension, using the {@link dc.baseMixin#filterHandler filterHandler}. * * Once you have set the filters, call {@link dc.baseMixin#redrawGroup `chart.redrawGroup()`} * (or {@link dc.redrawAll `dc.redrawAll()`}) to redraw the chart's group. * @method filter * @memberof dc.baseMixin * @instance * @see {@link dc.baseMixin#addFilterHandler addFilterHandler} * @see {@link dc.baseMixin#removeFilterHandler removeFilterHandler} * @see {@link dc.baseMixin#resetFilterHandler resetFilterHandler} * @see {@link dc.baseMixin#filterHandler filterHandler} * @example * // filter by a single string * chart.filter('Sunday'); * // filter by a single age * chart.filter(18); * // filter by a set of states * chart.filter([['MA', 'TX', 'ND', 'WA']]); * // filter by range -- note the use of dc.filters.RangedFilter, which is different * // from the syntax for filtering a crossfilter dimension directly, dimension.filter([15,20]) * chart.filter(dc.filters.RangedFilter(15,20)); * @param {*} [filter] * @return {dc.baseMixin} */ _chart.filter = function (filter) { if (!arguments.length) { return _filters.length > 0 ? _filters[0] : null; } if (filter instanceof Array && filter[0] instanceof Array && !filter.isFiltered) { filter[0].forEach(function (d) { if (_chart.hasFilter(d)) { _removeFilterHandler(_filters, d); } else { _addFilterHandler(_filters, d); } }); } else if (filter === null) { _filters = _resetFilterHandler(_filters); } else { if (_chart.hasFilter(filter)) { _removeFilterHandler(_filters, filter); } else { _addFilterHandler(_filters, filter); } } applyFilters(); _chart._invokeFilteredListener(filter); if (_root !== null && _chart.hasFilter()) { _chart.turnOnControls(); } else { _chart.turnOffControls(); } return _chart; }; /** * Returns all current filters. This method does not perform defensive cloning of the internal * filter array before returning, therefore any modification of the returned array will effect the * chart's internal filter storage. * @method filters * @memberof dc.baseMixin * @instance * @return {Array<*>} */ _chart.filters = function () { return _filters; }; _chart.highlightSelected = function (e) { d3.select(e).classed(dc.constants.SELECTED_CLASS, true); d3.select(e).classed(dc.constants.DESELECTED_CLASS, false); }; _chart.fadeDeselected = function (e) { d3.select(e).classed(dc.constants.SELECTED_CLASS, false); d3.select(e).classed(dc.constants.DESELECTED_CLASS, true); }; _chart.resetHighlight = function (e) { d3.select(e).classed(dc.constants.SELECTED_CLASS, false); d3.select(e).classed(dc.constants.DESELECTED_CLASS, false); }; /** * This function is passed to d3 as the onClick handler for each chart. The default behavior is to * filter on the clicked datum (passed to the callback) and redraw the chart group. * @method onClick * @memberof dc.baseMixin * @instance * @param {*} datum */ _chart.onClick = function (datum) { var filter = _chart.keyAccessor()(datum); dc.events.trigger(function () { _chart.filter(filter); _chart.redrawGroup(); }); }; /** * Set or get the filter handler. The filter handler is a function that performs the filter action * on a specific dimension. Using a custom filter handler allows you to perform additional logic * before or after filtering. * @method filterHandler * @memberof dc.baseMixin * @instance * @see {@link https://github.com/square/crossfilter/wiki/API-Reference#dimension_filter crossfilter.dimension.filter} * @example * // default filter handler * chart.filterHandler(function (dimension, filters) { * dimension.filter(null); * if (filters.length === 0) { * dimension.filter(null); * } else { * dimension.filterFunction(function (d) { * for (var i = 0; i < filters.length; i++) { * var filter = filters[i]; * if (filter.isFiltered && filter.isFiltered(d)) { * return true; * } else if (filter <= d && filter >= d) { * return true; * } * } * return false; * }); * } * return filters; * }); * * // custom filter handler * chart.filterHandler(function(dimension, filter){ * var newFilter = filter + 10; * dimension.filter(newFilter); * return newFilter; // set the actual filter value to the new value * }); * @param {Function} [filterHandler] * @return {Function} * @return {dc.baseMixin} */ _chart.filterHandler = function (filterHandler) { if (!arguments.length) { return _filterHandler; } _filterHandler = filterHandler; return _chart; }; // abstract function stub _chart._doRender = function () { // do nothing in base, should be overridden by sub-function return _chart; }; _chart._doRedraw = function () { // do nothing in base, should be overridden by sub-function return _chart; }; _chart.legendables = function () { // do nothing in base, should be overridden by sub-function return []; }; _chart.legendHighlight = function () { // do nothing in base, should be overridden by sub-function }; _chart.legendReset = function () { // do nothing in base, should be overridden by sub-function }; _chart.legendToggle = function () { // do nothing in base, should be overriden by sub-function }; _chart.isLegendableHidden = function () { // do nothing in base, should be overridden by sub-function return false; }; /** * Set or get the key accessor function. The key accessor function is used to retrieve the key * value from the crossfilter group. Key values are used differently in different charts, for * example keys correspond to slices in a pie chart and x axis positions in a grid coordinate chart. * @method keyAccessor * @memberof dc.baseMixin * @instance * @example * // default key accessor * chart.keyAccessor(function(d) { return d.key; }); * // custom key accessor for a multi-value crossfilter reduction * chart.keyAccessor(function(p) { return p.value.absGain; }); * @param {Function} [keyAccessor] * @return {Function} * @return {dc.baseMixin} */ _chart.keyAccessor = function (keyAccessor) { if (!arguments.length) { return _keyAccessor; } _keyAccessor = keyAccessor; return _chart; }; /** * Set or get the value accessor function. The value accessor function is used to retrieve the * value from the crossfilter group. Group values are used differently in different charts, for * example values correspond to slice sizes in a pie chart and y axis positions in a grid * coordinate chart. * @method valueAccessor * @memberof dc.baseMixin * @instance * @example * // default value accessor * chart.valueAccessor(function(d) { return d.value; }); * // custom value accessor for a multi-value crossfilter reduction * chart.valueAccessor(function(p) { return p.value.percentageGain; }); * @param {Function} [valueAccessor] * @return {Function} * @return {dc.baseMixin} */ _chart.valueAccessor = function (valueAccessor) { if (!arguments.length) { return _valueAccessor; } _valueAccessor = valueAccessor; return _chart; }; /** * Set or get the label function. The chart class will use this function to render labels for each * child element in the chart, e.g. slices in a pie chart or bubbles in a bubble chart. Not every * chart supports the label function, for example line chart does not use this function * at all. By default, enables labels; pass false for the second parameter if this is not desired. * @method label * @memberof dc.baseMixin * @instance * @example * // default label function just return the key * chart.label(function(d) { return d.key; }); * // label function has access to the standard d3 data binding and can get quite complicated * chart.label(function(d) { return d.data.key + '(' + Math.floor(d.data.value / all.value() * 100) + '%)'; }); * @param {Function} [labelFunction] * @param {Boolean} [enableLabels=true] * @return {Function} * @return {dc.baseMixin} */ _chart.label = function (labelFunction, enableLabels) { if (!arguments.length) { return _label; } _label = labelFunction; if ((enableLabels === undefined) || enableLabels) { _renderLabel = true; } return _chart; }; /** * Turn on/off label rendering * @method renderLabel * @memberof dc.baseMixin * @instance * @param {Boolean} [renderLabel=false] * @return {Boolean} * @return {dc.baseMixin} */ _chart.renderLabel = function (renderLabel) { if (!arguments.length) { return _renderLabel; } _renderLabel = renderLabel; return _chart; }; /** * Set or get the title function. The chart class will use this function to render the SVGElement title * (usually interpreted by browser as tooltips) for each child element in the chart, e.g. a slice * in a pie chart or a bubble in a bubble chart. Almost every chart supports the title function; * however in grid coordinate charts you need to turn off the brush in order to see titles, because * otherwise the brush layer will block tooltip triggering. * @method title * @memberof dc.baseMixin * @instance * @example * // default title function shows "key: value" * chart.title(function(d) { return d.key + ': ' + d.value; }); * // title function has access to the standard d3 data binding and can get quite complicated * chart.title(function(p) { * return p.key.getFullYear() * + '\n' * + 'Index Gain: ' + numberFormat(p.value.absGain) + '\n' * + 'Index Gain in Percentage: ' + numberFormat(p.value.percentageGain) + '%\n' * + 'Fluctuation / Index Ratio: ' + numberFormat(p.value.fluctuationPercentage) + '%'; * }); * @param {Function} [titleFunction] * @return {Function} * @return {dc.baseMixin} */ _chart.title = function (titleFunction) { if (!arguments.length) { return _title; } _title = titleFunction; return _chart; }; /** * Turn on/off title rendering, or return the state of the render title flag if no arguments are * given. * @method renderTitle * @memberof dc.baseMixin * @instance * @param {Boolean} [renderTitle=true] * @return {Boolean} * @return {dc.baseMixin} */ _chart.renderTitle = function (renderTitle) { if (!arguments.length) { return _renderTitle; } _renderTitle = renderTitle; return _chart; }; /** * A renderlet is similar to an event listener on rendering event. Multiple renderlets can be added * to an individual chart. Each time a chart is rerendered or redrawn the renderlets are invoked * right after the chart finishes its transitions, giving you a way to modify the SVGElements. * Renderlet functions take the chart instance as the only input parameter and you can * use the dc API or use raw d3 to achieve pretty much any effect. * * Use {@link dc.baseMixin#on on} with a 'renderlet' prefix. * Generates a random key for the renderlet, which makes it hard to remove. * @method renderlet * @memberof dc.baseMixin * @instance * @deprecated * @example * // do this instead of .renderlet(function(chart) { ... }) * chart.on("renderlet", function(chart){ * // mix of dc API and d3 manipulation * chart.select('g.y').style('display', 'none'); * // its a closure so you can also access other chart variable available in the closure scope * moveChart.filter(chart.filter()); * }); * @param {Function} renderletFunction * @return {dc.baseMixin} */ _chart.renderlet = dc.logger.deprecate(function (renderletFunction) { _chart.on('renderlet.' + dc.utils.uniqueId(), renderletFunction); return _chart; }, 'chart.renderlet has been deprecated. Please use chart.on("renderlet.<renderletKey>", renderletFunction)'); /** * Get or set the chart group to which this chart belongs. Chart groups are rendered or redrawn * together since it is expected they share the same underlying crossfilter data set. * @method chartGroup * @memberof dc.baseMixin * @instance * @param {String} [chartGroup] * @return {String} * @return {dc.baseMixin} */ _chart.chartGroup = function (chartGroup) { if (!arguments.length) { return _chartGroup; } if (!_isChild) { dc.deregisterChart(_chart, _chartGroup); } _chartGroup = chartGroup; if (!_isChild) { dc.registerChart(_chart, _chartGroup); } return _chart; }; /** * Expire the internal chart cache. dc charts cache some data internally on a per chart basis to * speed up rendering and avoid unnecessary calculation; however it might be useful to clear the * cache if you have changed state which will affect rendering. For example if you invoke the * {@link https://github.com/square/crossfilter/wiki/API-Reference#crossfilter_add crossfilter.add} * function or reset group or dimension after rendering it is a good idea to * clear the cache to make sure charts are rendered properly. * @method expireCache * @memberof dc.baseMixin * @instance * @return {dc.baseMixin} */ _chart.expireCache = function () { // do nothing in base, should be overridden by sub-function return _chart; }; /** * Attach a dc.legend widget to this chart. The legend widget will automatically draw legend labels * based on the color setting and names associated with each group. * @method legend * @memberof dc.baseMixin * @instance * @example * chart.legend(dc.legend().x(400).y(10).itemHeight(13).gap(5)) * @param {dc.legend} [legend] * @return {dc.legend} * @return {dc.baseMixin} */ _chart.legend = function (legend) { if (!arguments.length) { return _legend; } _legend = legend; _legend.parent(_chart); return _chart; }; /** * Returns the internal numeric ID of the chart. * @method chartID * @memberof dc.baseMixin * @instance * @return {String} */ _chart.chartID = function () { return _chart.__dcFlag__; }; /** * Set chart options using a configuration object. Each key in the object will cause the method of * the same name to be called with the value to set that attribute for the chart. * @method options * @memberof dc.baseMixin * @instance * @example * chart.options({dimension: myDimension, group: myGroup}); * @param {{}} opts * @return {dc.baseMixin} */ _chart.options = function (opts) { var applyOptions = [ 'anchor', 'group', 'xAxisLabel', 'yAxisLabel', 'stack', 'title', 'point', 'getColor', 'overlayGeoJson' ]; for (var o in opts) { if (typeof(_chart[o]) === 'function') { if (opts[o] instanceof Array && applyOptions.indexOf(o) !== -1) { _chart[o].apply(_chart, opts[o]); } else { _chart[o].call(_chart, opts[o]); } } else { dc.logger.debug('Not a valid option setter name: ' + o); } } return _chart; }; /** * All dc chart instance supports the following listeners. * Supports the following events: * * `renderlet` - This listener function will be invoked after transitions after redraw and render. Replaces the * deprecated {@link dc.baseMixin#renderlet renderlet} method. * * `pretransition` - Like `.on('renderlet', ...)` but the event is fired before transitions start. * * `preRender` - This listener function will be invoked before chart rendering. * * `postRender` - This listener function will be invoked after chart finish rendering including * all renderlets' logic. * * `preRedraw` - This listener function will be invoked before chart redrawing. * * `postRedraw` - This listener function will be invoked after chart finish redrawing * including all renderlets' logic. * * `filtered` - This listener function will be invoked after a filter is applied, added or removed. * * `zoomed` - This listener function will be invoked after a zoom is triggered. * @method on * @memberof dc.baseMixin * @instance * @see {@link https://github.com/mbostock/d3/wiki/Internals#dispatch_on d3.dispatch.on} * @example * .on('renderlet', function(chart, filter){...}) * .on('pretransition', function(chart, filter){...}) * .on('preRender', function(chart){...}) * .on('postRender', function(chart){...}) * .on('preRedraw', function(chart){...}) * .on('postRedraw', function(chart){...}) * .on('filtered', function(chart, filter){...}) * .on('zoomed', function(chart, filter){...}) * @param {String} event * @param {Function} listener * @return {dc.baseMixin} */ _chart.on = function (event, listener) { _listeners.on(event, listener); return _chart; }; return _chart; }; /** * Margin is a mixin that provides margin utility functions for both the Row Chart and Coordinate Grid * Charts. * @name marginMixin * @memberof dc * @mixin * @param {Object} _chart * @return {dc.marginMixin} */ dc.marginMixin = function (_chart) { var _margin = {top: 10, right: 50, bottom: 30, left: 30}; /** * Get or set the margins for a particular coordinate grid chart instance. The margins is stored as * an associative Javascript array. * @method margins * @memberof dc.marginMixin * @instance * @example * var leftMargin = chart.margins().left; // 30 by default * chart.margins().left = 50; * leftMargin = chart.margins().left; // now 50 * @param {{top: Number, right: Number, left: Number, bottom: Number}} [margins={top: 10, right: 50, bottom: 30, left: 30}] * @return {{top: Number, right: Number, left: Number, bottom: Number}} * @return {dc.marginMixin} */ _chart.margins = function (margins) { if (!arguments.length) { return _margin; } _margin = margins; return _chart; }; _chart.effectiveWidth = function () { return _chart.width() - _chart.margins().left - _chart.margins().right; }; _chart.effectiveHeight = function () { return _chart.height() - _chart.margins().top - _chart.margins().bottom; }; return _chart; }; /** * The Color Mixin is an abstract chart functional class providing universal coloring support * as a mix-in for any concrete chart implementation. * @name colorMixin * @memberof dc * @mixin * @param {Object} _chart * @return {dc.colorMixin} */ dc.colorMixin = function (_chart) { var _colors = d3.scale.category20c(); var _defaultAccessor = true; var _colorAccessor = function (d) { return _chart.keyAccessor()(d); }; /** * Retrieve current color scale or set a new color scale. This methods accepts any function that * operates like a d3 scale. * @method colors * @memberof dc.colorMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/Scales d3.scale} * @example * // alternate categorical scale * chart.colors(d3.scale.category20b()); * // ordinal scale * chart.colors(d3.scale.ordinal().range(['red','green','blue'])); * // convenience method, the same as above * chart.ordinalColors(['red','green','blue']); * // set a linear scale * chart.linearColors(["#4575b4", "#ffffbf", "#a50026"]); * @param {d3.scale} [colorScale=d3.scale.category20c()] * @return {d3.scale} * @return {dc.colorMixin} */ _chart.colors = function (colorScale) { if (!arguments.length) { return _colors; } if (colorScale instanceof Array) { _colors = d3.scale.quantize().range(colorScale); // deprecated legacy support, note: this fails for ordinal domains } else { _colors = d3.functor(colorScale); } return _chart; }; /** * Convenience method to set the color scale to * {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales#ordinal d3.scale.ordinal} with * range `r`. * @method ordinalColors * @memberof dc.colorMixin * @instance * @param {Array<String>} r * @return {dc.colorMixin} */ _chart.ordinalColors = function (r) { return _chart.colors(d3.scale.ordinal().range(r)); }; /** * Convenience method to set the color scale to an Hcl interpolated linear scale with range `r`. * @method linearColors * @memberof dc.colorMixin * @instance * @param {Array<Number>} r * @return {dc.colorMixin} */ _chart.linearColors = function (r) { return _chart.colors(d3.scale.linear() .range(r) .interpolate(d3.interpolateHcl)); }; /** * Set or the get color accessor function. This function will be used to map a data point in a * crossfilter group to a color value on the color scale. The default function uses the key * accessor. * @method colorAccessor * @memberof dc.colorMixin * @instance * @example * // default index based color accessor * .colorAccessor(function (d, i){return i;}) * // color accessor for a multi-value crossfilter reduction * .colorAccessor(function (d){return d.value.absGain;}) * @param {Function} [colorAccessor] * @return {Function} * @return {dc.colorMixin} */ _chart.colorAccessor = function (colorAccessor) { if (!arguments.length) { return _colorAccessor; } _colorAccessor = colorAccessor; _defaultAccessor = false; return _chart; }; // what is this? _chart.defaultColorAccessor = function () { return _defaultAccessor; }; /** * Set or get the current domain for the color mapping function. The domain must be supplied as an * array. * * Note: previously this method accepted a callback function. Instead you may use a custom scale * set by {@link dc.colorMixin#colors .colors}. * @method colorDomain * @memberof dc.colorMixin * @instance * @param {Array<String>} [domain] * @return {Array<String>} * @return {dc.colorMixin} */ _chart.colorDomain = function (domain) { if (!arguments.length) { return _colors.domain(); } _colors.domain(domain); return _chart; }; /** * Set the domain by determining the min and max values as retrieved by * {@link dc.colorMixin#colorAccessor .colorAccessor} over the chart's dataset. * @method calculateColorDomain * @memberof dc.colorMixin * @instance * @return {dc.colorMixin} */ _chart.calculateColorDomain = function () { var newDomain = [d3.min(_chart.data(), _chart.colorAccessor()), d3.max(_chart.data(), _chart.colorAccessor())]; _colors.domain(newDomain); return _chart; }; /** * Get the color for the datum d and counter i. This is used internally by charts to retrieve a color. * @method getColor * @memberof dc.colorMixin * @instance * @param {*} d * @param {Number} [i] * @return {String} */ _chart.getColor = function (d, i) { return _colors(_colorAccessor.call(this, d, i)); }; /** * Get the color for the datum d and counter i. This is used internally by charts to retrieve a color. * @method colorCalculator * @memberof dc.colorMixin * @instance * @param {*} [colorCalculator] * @return {*} */ _chart.colorCalculator = function (colorCalculator) { if (!arguments.length) { return _chart.getColor; } _chart.getColor = colorCalculator; return _chart; }; return _chart; }; /** * Coordinate Grid is an abstract base chart designed to support a number of coordinate grid based * concrete chart types, e.g. bar chart, line chart, and bubble chart. * @name coordinateGridMixin * @memberof dc * @mixin * @mixes dc.colorMixin * @mixes dc.marginMixin * @mixes dc.baseMixin * @param {Object} _chart * @return {dc.coordinateGridMixin} */ dc.coordinateGridMixin = function (_chart) { var GRID_LINE_CLASS = 'grid-line'; var HORIZONTAL_CLASS = 'horizontal'; var VERTICAL_CLASS = 'vertical'; var Y_AXIS_LABEL_CLASS = 'y-axis-label'; var X_AXIS_LABEL_CLASS = 'x-axis-label'; var DEFAULT_AXIS_LABEL_PADDING = 12; _chart = dc.colorMixin(dc.marginMixin(dc.baseMixin(_chart))); _chart.colors(d3.scale.category10()); _chart._mandatoryAttributes().push('x'); function zoomHandler () { _refocused = true; if (_zoomOutRestrict) { _chart.x().domain(constrainRange(_chart.x().domain(), _xOriginalDomain)); if (_rangeChart) { _chart.x().domain(constrainRange(_chart.x().domain(), _rangeChart.x().domain())); } } var domain = _chart.x().domain(); var domFilter = dc.filters.RangedFilter(domain[0], domain[1]); _chart.replaceFilter(domFilter); _chart.rescale(); _chart.redraw(); if (_rangeChart && !rangesEqual(_chart.filter(), _rangeChart.filter())) { dc.events.trigger(function () { _rangeChart.replaceFilter(domFilter); _rangeChart.redraw(); }); } _chart._invokeZoomedListener(); dc.events.trigger(function () { _chart.redrawGroup(); }, dc.constants.EVENT_DELAY); _refocused = !rangesEqual(domain, _xOriginalDomain); } var _parent; var _g; var _chartBodyG; var _x; var _xOriginalDomain; var _xAxis = d3.svg.axis().orient('bottom'); var _xUnits = dc.units.integers; var _xAxisPadding = 0; var _xElasticity = false; var _xAxisLabel; var _xAxisLabelPadding = 0; var _lastXDomain; var _y; var _yAxis = d3.svg.axis().orient('left'); var _yAxisPadding = 0; var _yElasticity = false; var _yAxisLabel; var _yAxisLabelPadding = 0; var _brush = d3.svg.brush(); var _brushOn = true; var _round; var _renderHorizontalGridLine = false; var _renderVerticalGridLine = false; var _refocused = false, _resizing = false; var _unitCount; var _zoomScale = [1, Infinity]; var _zoomOutRestrict = true; var _zoom = d3.behavior.zoom().on('zoom', zoomHandler); var _nullZoom = d3.behavior.zoom().on('zoom', null); var _hasBeenMouseZoomable = false; var _rangeChart; var _focusChart; var _mouseZoomable = false; var _clipPadding = 0; var _outerRangeBandPadding = 0.5; var _rangeBandPadding = 0; var _useRightYAxis = false; /** * When changing the domain of the x or y scale, it is necessary to tell the chart to recalculate * and redraw the axes. (`.rescale()` is called automatically when the x or y scale is replaced * with {@link dc.coordinateGridMixin+x .x()} or {@link dc.coordinateGridMixin#y .y()}, and has * no effect on elastic scales.) * @method rescale * @memberof dc.coordinateGridMixin * @instance * @return {dc.coordinateGridMixin} */ _chart.rescale = function () { _unitCount = undefined; _resizing = true; return _chart; }; _chart.resizing = function () { return _resizing; }; /** * Get or set the range selection chart associated with this instance. Setting the range selection * chart using this function will automatically update its selection brush when the current chart * zooms in. In return the given range chart will also automatically attach this chart as its focus * chart hence zoom in when range brush updates. * * Usually the range and focus charts will share a dimension. The range chart will set the zoom * boundaries for the focus chart, so its dimension values must be compatible with the domain of * the focus chart. * * See the [Nasdaq 100 Index](http://dc-js.github.com/dc.js/) example for this effect in action. * @method rangeChart * @memberof dc.coordinateGridMixin * @instance * @param {dc.coordinateGridMixin} [rangeChart] * @return {dc.coordinateGridMixin} */ _chart.rangeChart = function (rangeChart) { if (!arguments.length) { return _rangeChart; } _rangeChart = rangeChart; _rangeChart.focusChart(_chart); return _chart; }; /** * Get or set the scale extent for mouse zooms. * @method zoomScale * @memberof dc.coordinateGridMixin * @instance * @param {Array<Number|Date>} [extent=[1, Infinity]] * @return {Array<Number|Date>} * @return {dc.coordinateGridMixin} */ _chart.zoomScale = function (extent) { if (!arguments.length) { return _zoomScale; } _zoomScale = extent; return _chart; }; /** * Get or set the zoom restriction for the chart. If true limits the zoom to origional domain of the chart. * @method zoomOutRestrict * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [zoomOutRestrict=true] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.zoomOutRestrict = function (zoomOutRestrict) { if (!arguments.length) { return _zoomOutRestrict; } _zoomScale[0] = zoomOutRestrict ? 1 : 0; _zoomOutRestrict = zoomOutRestrict; return _chart; }; _chart._generateG = function (parent) { if (parent === undefined) { _parent = _chart.svg(); } else { _parent = parent; } var href = window.location.href.split('#')[0]; _g = _parent.append('g'); _chartBodyG = _g.append('g').attr('class', 'chart-body') .attr('transform', 'translate(' + _chart.margins().left + ', ' + _chart.margins().top + ')') .attr('clip-path', 'url(' + href + '#' + getClipPathId() + ')'); return _g; }; /** * Get or set the root g element. This method is usually used to retrieve the g element in order to * overlay custom svg drawing programatically. **Caution**: The root g element is usually generated * by dc.js internals, and resetting it might produce unpredictable result. * @method g * @memberof dc.coordinateGridMixin * @instance * @param {SVGElement} [gElement] * @return {SVGElement} * @return {dc.coordinateGridMixin} */ _chart.g = function (gElement) { if (!arguments.length) { return _g; } _g = gElement; return _chart; }; /** * Set or get mouse zoom capability flag (default: false). When turned on the chart will be * zoomable using the mouse wheel. If the range selector chart is attached zooming will also update * the range selection brush on the associated range selector chart. * @method mouseZoomable * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [mouseZoomable=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.mouseZoomable = function (mouseZoomable) { if (!arguments.length) { return _mouseZoomable; } _mouseZoomable = mouseZoomable; return _chart; }; /** * Retrieve the svg group for the chart body. * @method chartBodyG * @memberof dc.coordinateGridMixin * @instance * @param {SVGElement} [chartBodyG] * @return {SVGElement} */ _chart.chartBodyG = function (chartBodyG) { if (!arguments.length) { return _chartBodyG; } _chartBodyG = chartBodyG; return _chart; }; /** * **mandatory** * * Get or set the x scale. The x scale can be any d3 * {@link https://github.com/mbostock/d3/wiki/Quantitative-Scales quantitive scale} or * {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales ordinal scale}. * @method x * @memberof dc.coordinateGridMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/Scales d3.scale} * @example * // set x to a linear scale * chart.x(d3.scale.linear().domain([-2500, 2500])) * // set x to a time scale to generate histogram * chart.x(d3.time.scale().domain([new Date(1985, 0, 1), new Date(2012, 11, 31)])) * @param {d3.scale} [xScale] * @return {d3.scale} * @return {dc.coordinateGridMixin} */ _chart.x = function (xScale) { if (!arguments.length) { return _x; } _x = xScale; _xOriginalDomain = _x.domain(); _chart.rescale(); return _chart; }; _chart.xOriginalDomain = function () { return _xOriginalDomain; }; /** * Set or get the xUnits function. The coordinate grid chart uses the xUnits function to calculate * the number of data projections on x axis such as the number of bars for a bar chart or the * number of dots for a line chart. This function is expected to return a Javascript array of all * data points on x axis, or the number of points on the axis. [d3 time range functions * d3.time.days, d3.time.months, and * d3.time.years](https://github.com/mbostock/d3/wiki/Time-Intervals#aliases) are all valid xUnits * function. dc.js also provides a few units function, see the {@link dc.utils Utilities} section for * a list of built-in units functions. The default xUnits function is dc.units.integers. * @method xUnits * @memberof dc.coordinateGridMixin * @instance * @todo Add docs for utilities * @example * // set x units to count days * chart.xUnits(d3.time.days); * // set x units to count months * chart.xUnits(d3.time.months); * * // A custom xUnits function can be used as long as it follows the following interface: * // units in integer * function(start, end, xDomain) { * // simply calculates how many integers in the domain * return Math.abs(end - start); * }; * * // fixed units * function(start, end, xDomain) { * // be aware using fixed units will disable the focus/zoom ability on the chart * return 1000; * @param {Function} [xUnits] * @return {Function} * @return {dc.coordinateGridMixin} */ _chart.xUnits = function (xUnits) { if (!arguments.length) { return _xUnits; } _xUnits = xUnits; return _chart; }; /** * Set or get the x axis used by a particular coordinate grid chart instance. This function is most * useful when x axis customization is required. The x axis in dc.js is an instance of a [d3 * axis object](https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-axis); therefore it supports any * valid d3 axis manipulation. **Caution**: The x axis is usually generated internally by dc; * resetting it may cause unexpected results. * @method xAxis * @memberof dc.coordinateGridMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/SVG-Axes d3.svg.axis} * @example * // customize x axis tick format * chart.xAxis().tickFormat(function(v) {return v + '%';}); * // customize x axis tick values * chart.xAxis().tickValues([0, 100, 200, 300]); * @param {d3.svg.axis} [xAxis=d3.svg.axis().orient('bottom')] * @return {d3.svg.axis} * @return {dc.coordinateGridMixin} */ _chart.xAxis = function (xAxis) { if (!arguments.length) { return _xAxis; } _xAxis = xAxis; return _chart; }; /** * Turn on/off elastic x axis behavior. If x axis elasticity is turned on, then the grid chart will * attempt to recalculate the x axis range whenever a redraw event is triggered. * @method elasticX * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [elasticX=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.elasticX = function (elasticX) { if (!arguments.length) { return _xElasticity; } _xElasticity = elasticX; return _chart; }; /** * Set or get x axis padding for the elastic x axis. The padding will be added to both end of the x * axis if elasticX is turned on; otherwise it is ignored. * * padding can be an integer or percentage in string (e.g. '10%'). Padding can be applied to * number or date x axes. When padding a date axis, an integer represents number of days being padded * and a percentage string will be treated the same as an integer. * @method xAxisPadding * @memberof dc.coordinateGridMixin * @instance * @param {Number|String} [padding=0] * @return {Number|String} * @return {dc.coordinateGridMixin} */ _chart.xAxisPadding = function (padding) { if (!arguments.length) { return _xAxisPadding; } _xAxisPadding = padding; return _chart; }; /** * Returns the number of units displayed on the x axis using the unit measure configured by * .xUnits. * @method xUnitCount * @memberof dc.coordinateGridMixin * @instance * @return {Number} */ _chart.xUnitCount = function () { if (_unitCount === undefined) { var units = _chart.xUnits()(_chart.x().domain()[0], _chart.x().domain()[1], _chart.x().domain()); if (units instanceof Array) { _unitCount = units.length; } else { _unitCount = units; } } return _unitCount; }; /** * Gets or sets whether the chart should be drawn with a right axis instead of a left axis. When * used with a chart in a composite chart, allows both left and right Y axes to be shown on a * chart. * @method useRightYAxis * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [useRightYAxis=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.useRightYAxis = function (useRightYAxis) { if (!arguments.length) { return _useRightYAxis; } _useRightYAxis = useRightYAxis; return _chart; }; /** * Returns true if the chart is using ordinal xUnits ({@link dc.units.ordinal dc.units.ordinal}, or false * otherwise. Most charts behave differently with ordinal data and use the result of this method to * trigger the appropriate logic. * @method isOrdinal * @memberof dc.coordinateGridMixin * @instance * @return {Boolean} */ _chart.isOrdinal = function () { return _chart.xUnits() === dc.units.ordinal; }; _chart._useOuterPadding = function () { return true; }; _chart._ordinalXDomain = function () { var groups = _chart._computeOrderedGroups(_chart.data()); return groups.map(_chart.keyAccessor()); }; function compareDomains (d1, d2) { return !d1 || !d2 || d1.length !== d2.length || d1.some(function (elem, i) { return (elem && d2[i]) ? elem.toString() !== d2[i].toString() : elem === d2[i]; }); } function prepareXAxis (g, render) { if (!_chart.isOrdinal()) { if (_chart.elasticX()) { _x.domain([_chart.xAxisMin(), _chart.xAxisMax()]); } } else { // _chart.isOrdinal() if (_chart.elasticX() || _x.domain().length === 0) { _x.domain(_chart._ordinalXDomain()); } } // has the domain changed? var xdom = _x.domain(); if (render || compareDomains(_lastXDomain, xdom)) { _chart.rescale(); } _lastXDomain = xdom; // please can't we always use rangeBands for bar charts? if (_chart.isOrdinal()) { _x.rangeBands([0, _chart.xAxisLength()], _rangeBandPadding, _chart._useOuterPadding() ? _outerRangeBandPadding : 0); } else { _x.range([0, _chart.xAxisLength()]); } _xAxis = _xAxis.scale(_chart.x()); renderVerticalGridLines(g); } _chart.renderXAxis = function (g) { var axisXG = g.selectAll('g.x'); if (axisXG.empty()) { axisXG = g.append('g') .attr('class', 'axis x') .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart._xAxisY() + ')'); } var axisXLab = g.selectAll('text.' + X_AXIS_LABEL_CLASS); if (axisXLab.empty() && _chart.xAxisLabel()) { axisXLab = g.append('text') .attr('class', X_AXIS_LABEL_CLASS) .attr('transform', 'translate(' + (_chart.margins().left + _chart.xAxisLength() / 2) + ',' + (_chart.height() - _xAxisLabelPadding) + ')') .attr('text-anchor', 'middle'); } if (_chart.xAxisLabel() && axisXLab.text() !== _chart.xAxisLabel()) { axisXLab.text(_chart.xAxisLabel()); } dc.transition(axisXG, _chart.transitionDuration()) .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart._xAxisY() + ')') .call(_xAxis); dc.transition(axisXLab, _chart.transitionDuration()) .attr('transform', 'translate(' + (_chart.margins().left + _chart.xAxisLength() / 2) + ',' + (_chart.height() - _xAxisLabelPadding) + ')'); }; function renderVerticalGridLines (g) { var gridLineG = g.selectAll('g.' + VERTICAL_CLASS); if (_renderVerticalGridLine) { if (gridLineG.empty()) { gridLineG = g.insert('g', ':first-child') .attr('class', GRID_LINE_CLASS + ' ' + VERTICAL_CLASS) .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart.margins().top + ')'); } var ticks = _xAxis.tickValues() ? _xAxis.tickValues() : (typeof _x.ticks === 'function' ? _x.ticks(_xAxis.ticks()[0]) : _x.domain()); var lines = gridLineG.selectAll('line') .data(ticks); // enter var linesGEnter = lines.enter() .append('line') .attr('x1', function (d) { return _x(d); }) .attr('y1', _chart._xAxisY() - _chart.margins().top) .attr('x2', function (d) { return _x(d); }) .attr('y2', 0) .attr('opacity', 0); dc.transition(linesGEnter, _chart.transitionDuration()) .attr('opacity', 1); // update dc.transition(lines, _chart.transitionDuration()) .attr('x1', function (d) { return _x(d); }) .attr('y1', _chart._xAxisY() - _chart.margins().top) .attr('x2', function (d) { return _x(d); }) .attr('y2', 0); // exit lines.exit().remove(); } else { gridLineG.selectAll('line').remove(); } } _chart._xAxisY = function () { return (_chart.height() - _chart.margins().bottom); }; _chart.xAxisLength = function () { return _chart.effectiveWidth(); }; /** * Set or get the x axis label. If setting the label, you may optionally include additional padding to * the margin to make room for the label. By default the padded is set to 12 to accomodate the text height. * @method xAxisLabel * @memberof dc.coordinateGridMixin * @instance * @param {String} [labelText] * @param {Number} [padding=12] * @return {String} */ _chart.xAxisLabel = function (labelText, padding) { if (!arguments.length) { return _xAxisLabel; } _xAxisLabel = labelText; _chart.margins().bottom -= _xAxisLabelPadding; _xAxisLabelPadding = (padding === undefined) ? DEFAULT_AXIS_LABEL_PADDING : padding; _chart.margins().bottom += _xAxisLabelPadding; return _chart; }; _chart._prepareYAxis = function (g) { if (_y === undefined || _chart.elasticY()) { if (_y === undefined) { _y = d3.scale.linear(); } var min = _chart.yAxisMin() || 0, max = _chart.yAxisMax() || 0; _y.domain([min, max]).rangeRound([_chart.yAxisHeight(), 0]); } _y.range([_chart.yAxisHeight(), 0]); _yAxis = _yAxis.scale(_y); if (_useRightYAxis) { _yAxis.orient('right'); } _chart._renderHorizontalGridLinesForAxis(g, _y, _yAxis); }; _chart.renderYAxisLabel = function (axisClass, text, rotation, labelXPosition) { labelXPosition = labelXPosition || _yAxisLabelPadding; var axisYLab = _chart.g().selectAll('text.' + Y_AXIS_LABEL_CLASS + '.' + axisClass + '-label'); var labelYPosition = (_chart.margins().top + _chart.yAxisHeight() / 2); if (axisYLab.empty() && text) { axisYLab = _chart.g().append('text') .attr('transform', 'translate(' + labelXPosition + ',' + labelYPosition + '),rotate(' + rotation + ')') .attr('class', Y_AXIS_LABEL_CLASS + ' ' + axisClass + '-label') .attr('text-anchor', 'middle') .text(text); } if (text && axisYLab.text() !== text) { axisYLab.text(text); } dc.transition(axisYLab, _chart.transitionDuration()) .attr('transform', 'translate(' + labelXPosition + ',' + labelYPosition + '),rotate(' + rotation + ')'); }; _chart.renderYAxisAt = function (axisClass, axis, position) { var axisYG = _chart.g().selectAll('g.' + axisClass); if (axisYG.empty()) { axisYG = _chart.g().append('g') .attr('class', 'axis ' + axisClass) .attr('transform', 'translate(' + position + ',' + _chart.margins().top + ')'); } dc.transition(axisYG, _chart.transitionDuration()) .attr('transform', 'translate(' + position + ',' + _chart.margins().top + ')') .call(axis); }; _chart.renderYAxis = function () { var axisPosition = _useRightYAxis ? (_chart.width() - _chart.margins().right) : _chart._yAxisX(); _chart.renderYAxisAt('y', _yAxis, axisPosition); var labelPosition = _useRightYAxis ? (_chart.width() - _yAxisLabelPadding) : _yAxisLabelPadding; var rotation = _useRightYAxis ? 90 : -90; _chart.renderYAxisLabel('y', _chart.yAxisLabel(), rotation, labelPosition); }; _chart._renderHorizontalGridLinesForAxis = function (g, scale, axis) { var gridLineG = g.selectAll('g.' + HORIZONTAL_CLASS); if (_renderHorizontalGridLine) { var ticks = axis.tickValues() ? axis.tickValues() : scale.ticks(axis.ticks()[0]); if (gridLineG.empty()) { gridLineG = g.insert('g', ':first-child') .attr('class', GRID_LINE_CLASS + ' ' + HORIZONTAL_CLASS) .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart.margins().top + ')'); } var lines = gridLineG.selectAll('line') .data(ticks); // enter var linesGEnter = lines.enter() .append('line') .attr('x1', 1) .attr('y1', function (d) { return scale(d); }) .attr('x2', _chart.xAxisLength()) .attr('y2', function (d) { return scale(d); }) .attr('opacity', 0); dc.transition(linesGEnter, _chart.transitionDuration()) .attr('opacity', 1); // update dc.transition(lines, _chart.transitionDuration()) .attr('x1', 1) .attr('y1', function (d) { return scale(d); }) .attr('x2', _chart.xAxisLength()) .attr('y2', function (d) { return scale(d); }); // exit lines.exit().remove(); } else { gridLineG.selectAll('line').remove(); } }; _chart._yAxisX = function () { return _chart.useRightYAxis() ? _chart.width() - _chart.margins().right : _chart.margins().left; }; /** * Set or get the y axis label. If setting the label, you may optionally include additional padding * to the margin to make room for the label. By default the padded is set to 12 to accomodate the * text height. * @method yAxisLabel * @memberof dc.coordinateGridMixin * @instance * @param {String} [labelText] * @param {Number} [padding=12] * @return {String} * @return {dc.coordinateGridMixin} */ _chart.yAxisLabel = function (labelText, padding) { if (!arguments.length) { return _yAxisLabel; } _yAxisLabel = labelText; _chart.margins().left -= _yAxisLabelPadding; _yAxisLabelPadding = (padding === undefined) ? DEFAULT_AXIS_LABEL_PADDING : padding; _chart.margins().left += _yAxisLabelPadding; return _chart; }; /** * Get or set the y scale. The y scale is typically automatically determined by the chart implementation. * @method y * @memberof dc.coordinateGridMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/Scales d3.scale} * @param {d3.scale} [yScale] * @return {d3.scale} * @return {dc.coordinateGridMixin} */ _chart.y = function (yScale) { if (!arguments.length) { return _y; } _y = yScale; _chart.rescale(); return _chart; }; /** * Set or get the y axis used by the coordinate grid chart instance. This function is most useful * when y axis customization is required. The y axis in dc.js is simply an instance of a [d3 axis * object](https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-_axis); therefore it supports any * valid d3 axis manipulation. **Caution**: The y axis is usually generated internally by dc; * resetting it may cause unexpected results. * @method yAxis * @memberof dc.coordinateGridMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/SVG-Axes d3.svg.axis} * @example * // customize y axis tick format * chart.yAxis().tickFormat(function(v) {return v + '%';}); * // customize y axis tick values * chart.yAxis().tickValues([0, 100, 200, 300]); * @param {d3.svg.axis} [yAxis=d3.svg.axis().orient('left')] * @return {d3.svg.axis} * @return {dc.coordinateGridMixin} */ _chart.yAxis = function (yAxis) { if (!arguments.length) { return _yAxis; } _yAxis = yAxis; return _chart; }; /** * Turn on/off elastic y axis behavior. If y axis elasticity is turned on, then the grid chart will * attempt to recalculate the y axis range whenever a redraw event is triggered. * @method elasticY * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [elasticY=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.elasticY = function (elasticY) { if (!arguments.length) { return _yElasticity; } _yElasticity = elasticY; return _chart; }; /** * Turn on/off horizontal grid lines. * @method renderHorizontalGridLines * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [renderHorizontalGridLines=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.renderHorizontalGridLines = function (renderHorizontalGridLines) { if (!arguments.length) { return _renderHorizontalGridLine; } _renderHorizontalGridLine = renderHorizontalGridLines; return _chart; }; /** * Turn on/off vertical grid lines. * @method renderVerticalGridLines * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [renderVerticalGridLines=false] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.renderVerticalGridLines = function (renderVerticalGridLines) { if (!arguments.length) { return _renderVerticalGridLine; } _renderVerticalGridLine = renderVerticalGridLines; return _chart; }; /** * Calculates the minimum x value to display in the chart. Includes xAxisPadding if set. * @method xAxisMin * @memberof dc.coordinateGridMixin * @instance * @return {*} */ _chart.xAxisMin = function () { var min = d3.min(_chart.data(), function (e) { return _chart.keyAccessor()(e); }); return dc.utils.subtract(min, _xAxisPadding); }; /** * Calculates the maximum x value to display in the chart. Includes xAxisPadding if set. * @method xAxisMax * @memberof dc.coordinateGridMixin * @instance * @return {*} */ _chart.xAxisMax = function () { var max = d3.max(_chart.data(), function (e) { return _chart.keyAccessor()(e); }); return dc.utils.add(max, _xAxisPadding); }; /** * Calculates the minimum y value to display in the chart. Includes yAxisPadding if set. * @method yAxisMin * @memberof dc.coordinateGridMixin * @instance * @return {*} */ _chart.yAxisMin = function () { var min = d3.min(_chart.data(), function (e) { return _chart.valueAccessor()(e); }); return dc.utils.subtract(min, _yAxisPadding); }; /** * Calculates the maximum y value to display in the chart. Includes yAxisPadding if set. * @method yAxisMax * @memberof dc.coordinateGridMixin * @instance * @return {*} */ _chart.yAxisMax = function () { var max = d3.max(_chart.data(), function (e) { return _chart.valueAccessor()(e); }); return dc.utils.add(max, _yAxisPadding); }; /** * Set or get y axis padding for the elastic y axis. The padding will be added to the top of the y * axis if elasticY is turned on; otherwise it is ignored. * * padding can be an integer or percentage in string (e.g. '10%'). Padding can be applied to * number or date axes. When padding a date axis, an integer represents number of days being padded * and a percentage string will be treated the same as an integer. * @method yAxisPadding * @memberof dc.coordinateGridMixin * @instance * @param {Number|String} [padding=0] * @return {Number} * @return {dc.coordinateGridMixin} */ _chart.yAxisPadding = function (padding) { if (!arguments.length) { return _yAxisPadding; } _yAxisPadding = padding; return _chart; }; _chart.yAxisHeight = function () { return _chart.effectiveHeight(); }; /** * Set or get the rounding function used to quantize the selection when brushing is enabled. * @method round * @memberof dc.coordinateGridMixin * @instance * @example * // set x unit round to by month, this will make sure range selection brush will * // select whole months * chart.round(d3.time.month.round); * @param {Function} [round] * @return {Function} * @return {dc.coordinateGridMixin} */ _chart.round = function (round) { if (!arguments.length) { return _round; } _round = round; return _chart; }; _chart._rangeBandPadding = function (_) { if (!arguments.length) { return _rangeBandPadding; } _rangeBandPadding = _; return _chart; }; _chart._outerRangeBandPadding = function (_) { if (!arguments.length) { return _outerRangeBandPadding; } _outerRangeBandPadding = _; return _chart; }; dc.override(_chart, 'filter', function (_) { if (!arguments.length) { return _chart._filter(); } _chart._filter(_); if (_) { _chart.brush().extent(_); } else { _chart.brush().clear(); } return _chart; }); _chart.brush = function (_) { if (!arguments.length) { return _brush; } _brush = _; return _chart; }; function brushHeight () { return _chart._xAxisY() - _chart.margins().top; } _chart.renderBrush = function (g) { if (_brushOn) { _brush.on('brush', _chart._brushing); _brush.on('brushstart', _chart._disableMouseZoom); _brush.on('brushend', configureMouseZoom); var gBrush = g.append('g') .attr('class', 'brush') .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart.margins().top + ')') .call(_brush.x(_chart.x())); _chart.setBrushY(gBrush, false); _chart.setHandlePaths(gBrush); if (_chart.hasFilter()) { _chart.redrawBrush(g, false); } } }; _chart.setHandlePaths = function (gBrush) { gBrush.selectAll('.resize').append('path').attr('d', _chart.resizeHandlePath); }; _chart.setBrushY = function (gBrush) { gBrush.selectAll('rect') .attr('height', brushHeight()); gBrush.selectAll('.resize path') .attr('d', _chart.resizeHandlePath); }; _chart.extendBrush = function () { var extent = _brush.extent(); if (_chart.round()) { extent[0] = extent.map(_chart.round())[0]; extent[1] = extent.map(_chart.round())[1]; _g.select('.brush') .call(_brush.extent(extent)); } return extent; }; _chart.brushIsEmpty = function (extent) { return _brush.empty() || !extent || extent[1] <= extent[0]; }; _chart._brushing = function () { var extent = _chart.extendBrush(); _chart.redrawBrush(_g, false); if (_chart.brushIsEmpty(extent)) { dc.events.trigger(function () { _chart.filter(null); _chart.redrawGroup(); }, dc.constants.EVENT_DELAY); } else { var rangedFilter = dc.filters.RangedFilter(extent[0], extent[1]); dc.events.trigger(function () { _chart.replaceFilter(rangedFilter); _chart.redrawGroup(); }, dc.constants.EVENT_DELAY); } }; _chart.redrawBrush = function (g, doTransition) { if (_brushOn) { if (_chart.filter() && _chart.brush().empty()) { _chart.brush().extent(_chart.filter()); } var gBrush = dc.optionalTransition(doTransition, _chart.transitionDuration())(g.select('g.brush')); _chart.setBrushY(gBrush); gBrush.call(_chart.brush() .x(_chart.x()) .extent(_chart.brush().extent())); } _chart.fadeDeselectedArea(); }; _chart.fadeDeselectedArea = function () { // do nothing, sub-chart should override this function }; // borrowed from Crossfilter example _chart.resizeHandlePath = function (d) { var e = +(d === 'e'), x = e ? 1 : -1, y = brushHeight() / 3; return 'M' + (0.5 * x) + ',' + y + 'A6,6 0 0 ' + e + ' ' + (6.5 * x) + ',' + (y + 6) + 'V' + (2 * y - 6) + 'A6,6 0 0 ' + e + ' ' + (0.5 * x) + ',' + (2 * y) + 'Z' + 'M' + (2.5 * x) + ',' + (y + 8) + 'V' + (2 * y - 8) + 'M' + (4.5 * x) + ',' + (y + 8) + 'V' + (2 * y - 8); }; function getClipPathId () { return _chart.anchorName().replace(/[ .#=\[\]]/g, '-') + '-clip'; } /** * Get or set the padding in pixels for the clip path. Once set padding will be applied evenly to * the top, left, right, and bottom when the clip path is generated. If set to zero, the clip area * will be exactly the chart body area minus the margins. * @method clipPadding * @memberof dc.coordinateGridMixin * @instance * @param {Number} [padding=5] * @return {Number} * @return {dc.coordinateGridMixin} */ _chart.clipPadding = function (padding) { if (!arguments.length) { return _clipPadding; } _clipPadding = padding; return _chart; }; function generateClipPath () { var defs = dc.utils.appendOrSelect(_parent, 'defs'); // cannot select <clippath> elements; bug in WebKit, must select by id // https://groups.google.com/forum/#!topic/d3-js/6EpAzQ2gU9I var id = getClipPathId(); var chartBodyClip = dc.utils.appendOrSelect(defs, '#' + id, 'clipPath').attr('id', id); var padding = _clipPadding * 2; dc.utils.appendOrSelect(chartBodyClip, 'rect') .attr('width', _chart.xAxisLength() + padding) .attr('height', _chart.yAxisHeight() + padding) .attr('transform', 'translate(-' + _clipPadding + ', -' + _clipPadding + ')'); } _chart._preprocessData = function () {}; _chart._doRender = function () { _chart.resetSvg(); _chart._preprocessData(); _chart._generateG(); generateClipPath(); drawChart(true); configureMouseZoom(); return _chart; }; _chart._doRedraw = function () { _chart._preprocessData(); drawChart(false); generateClipPath(); return _chart; }; function drawChart (render) { if (_chart.isOrdinal()) { _brushOn = false; } prepareXAxis(_chart.g(), render); _chart._prepareYAxis(_chart.g()); _chart.plotData(); if (_chart.elasticX() || _resizing || render) { _chart.renderXAxis(_chart.g()); } if (_chart.elasticY() || _resizing || render) { _chart.renderYAxis(_chart.g()); } if (render) { _chart.renderBrush(_chart.g(), false); } else { _chart.redrawBrush(_chart.g(), _resizing); } _chart.fadeDeselectedArea(); _resizing = false; } function configureMouseZoom () { if (_mouseZoomable) { _chart._enableMouseZoom(); } else if (_hasBeenMouseZoomable) { _chart._disableMouseZoom(); } } _chart._enableMouseZoom = function () { _hasBeenMouseZoomable = true; _zoom.x(_chart.x()) .scaleExtent(_zoomScale) .size([_chart.width(), _chart.height()]) .duration(_chart.transitionDuration()); _chart.root().call(_zoom); }; _chart._disableMouseZoom = function () { _chart.root().call(_nullZoom); }; function constrainRange (range, constraint) { var constrainedRange = []; constrainedRange[0] = d3.max([range[0], constraint[0]]); constrainedRange[1] = d3.min([range[1], constraint[1]]); return constrainedRange; } /** * Zoom this chart to focus on the given range. The given range should be an array containing only * 2 elements (`[start, end]`) defining a range in the x domain. If the range is not given or set * to null, then the zoom will be reset. _For focus to work elasticX has to be turned off; * otherwise focus will be ignored. * @method focus * @memberof dc.coordinateGridMixin * @instance * @example * chart.on('renderlet', function(chart) { * // smooth the rendering through event throttling * dc.events.trigger(function(){ * // focus some other chart to the range selected by user on this chart * someOtherChart.focus(chart.filter()); * }); * }) * @param {Array<Number>} [range] */ _chart.focus = function (range) { if (hasRangeSelected(range)) { _chart.x().domain(range); } else { _chart.x().domain(_xOriginalDomain); } _zoom.x(_chart.x()); zoomHandler(); }; _chart.refocused = function () { return _refocused; }; _chart.focusChart = function (c) { if (!arguments.length) { return _focusChart; } _focusChart = c; _chart.on('filtered', function (chart) { if (!chart.filter()) { dc.events.trigger(function () { _focusChart.x().domain(_focusChart.xOriginalDomain()); }); } else if (!rangesEqual(chart.filter(), _focusChart.filter())) { dc.events.trigger(function () { _focusChart.focus(chart.filter()); }); } }); return _chart; }; function rangesEqual (range1, range2) { if (!range1 && !range2) { return true; } else if (!range1 || !range2) { return false; } else if (range1.length === 0 && range2.length === 0) { return true; } else if (range1[0].valueOf() === range2[0].valueOf() && range1[1].valueOf() === range2[1].valueOf()) { return true; } return false; } /** * Turn on/off the brush-based range filter. When brushing is on then user can drag the mouse * across a chart with a quantitative scale to perform range filtering based on the extent of the * brush, or click on the bars of an ordinal bar chart or slices of a pie chart to filter and * un-filter them. However turning on the brush filter will disable other interactive elements on * the chart such as highlighting, tool tips, and reference lines. Zooming will still be possible * if enabled, but only via scrolling (panning will be disabled.) * @method brushOn * @memberof dc.coordinateGridMixin * @instance * @param {Boolean} [brushOn=true] * @return {Boolean} * @return {dc.coordinateGridMixin} */ _chart.brushOn = function (brushOn) { if (!arguments.length) { return _brushOn; } _brushOn = brushOn; return _chart; }; function hasRangeSelected (range) { return range instanceof Array && range.length > 1; } return _chart; }; /** * Stack Mixin is an mixin that provides cross-chart support of stackability using d3.layout.stack. * @name stackMixin * @memberof dc * @mixin * @param {Object} _chart * @return {dc.stackMixin} */ dc.stackMixin = function (_chart) { function prepareValues (layer, layerIdx) { var valAccessor = layer.accessor || _chart.valueAccessor(); layer.name = String(layer.name || layerIdx); layer.values = layer.group.all().map(function (d, i) { return { x: _chart.keyAccessor()(d, i), y: layer.hidden ? null : valAccessor(d, i), data: d, layer: layer.name, hidden: layer.hidden }; }); layer.values = layer.values.filter(domainFilter()); return layer.values; } var _stackLayout = d3.layout.stack() .values(prepareValues); var _stack = []; var _titles = {}; var _hidableStacks = false; function domainFilter () { if (!_chart.x()) { return d3.functor(true); } var xDomain = _chart.x().domain(); if (_chart.isOrdinal()) { // TODO #416 //var domainSet = d3.set(xDomain); return function () { return true; //domainSet.has(p.x); }; } if (_chart.elasticX()) { return function () { return true; }; } return function (p) { //return true; return p.x >= xDomain[0] && p.x <= xDomain[xDomain.length - 1]; }; } /** * Stack a new crossfilter group onto this chart with an optional custom value accessor. All stacks * in the same chart will share the same key accessor and therefore the same set of keys. * * For example, in a stacked bar chart, the bars of each stack will be positioned using the same set * of keys on the x axis, while stacked vertically. If name is specified then it will be used to * generate the legend label. * @method stack * @memberof dc.stackMixin * @instance * @see {@link https://github.com/square/crossfilter/wiki/API-Reference#group-map-reduce crossfilter.group} * @example * // stack group using default accessor * chart.stack(valueSumGroup) * // stack group using custom accessor * .stack(avgByDayGroup, function(d){return d.value.avgByDay;}); * @param {crossfilter.group} group * @param {String} [name] * @param {Function} [accessor] * @return {Array<{group: crossfilter.group, name: String, accessor: Function}>} * @return {dc.stackMixin} */ _chart.stack = function (group, name, accessor) { if (!arguments.length) { return _stack; } if (arguments.length <= 2) { accessor = name; } var layer = {group: group}; if (typeof name === 'string') { layer.name = name; } if (typeof accessor === 'function') { layer.accessor = accessor; } _stack.push(layer); return _chart; }; dc.override(_chart, 'group', function (g, n, f) { if (!arguments.length) { return _chart._group(); } _stack = []; _titles = {}; _chart.stack(g, n); if (f) { _chart.valueAccessor(f); } return _chart._group(g, n); }); /** * Allow named stacks to be hidden or shown by clicking on legend items. * This does not affect the behavior of hideStack or showStack. * @method hidableStacks * @memberof dc.stackMixin * @instance * @param {Boolean} [hidableStacks=false] * @return {Boolean} * @return {dc.stackMixin} */ _chart.hidableStacks = function (hidableStacks) { if (!arguments.length) { return _hidableStacks; } _hidableStacks = hidableStacks; return _chart; }; function findLayerByName (n) { var i = _stack.map(dc.pluck('name')).indexOf(n); return _stack[i]; } /** * Hide all stacks on the chart with the given name. * The chart must be re-rendered for this change to appear. * @method hideStack * @memberof dc.stackMixin * @instance * @param {String} stackName * @return {dc.stackMixin} */ _chart.hideStack = function (stackName) { var layer = findLayerByName(stackName); if (layer) { layer.hidden = true; } return _chart; }; /** * Show all stacks on the chart with the given name. * The chart must be re-rendered for this change to appear. * @method showStack * @memberof dc.stackMixin * @instance * @param {String} stackName * @return {dc.stackMixin} */ _chart.showStack = function (stackName) { var layer = findLayerByName(stackName); if (layer) { layer.hidden = false; } return _chart; }; _chart.getValueAccessorByIndex = function (index) { return _stack[index].accessor || _chart.valueAccessor(); }; _chart.yAxisMin = function () { var min = d3.min(flattenStack(), function (p) { return (p.y + p.y0 < p.y0) ? (p.y + p.y0) : p.y0; }); return dc.utils.subtract(min, _chart.yAxisPadding()); }; _chart.yAxisMax = function () { var max = d3.max(flattenStack(), function (p) { return p.y + p.y0; }); return dc.utils.add(max, _chart.yAxisPadding()); }; function flattenStack () { var valueses = _chart.data().map(function (layer) { return layer.values; }); return Array.prototype.concat.apply([], valueses); } _chart.xAxisMin = function () { var min = d3.min(flattenStack(), dc.pluck('x')); return dc.utils.subtract(min, _chart.xAxisPadding()); }; _chart.xAxisMax = function () { var max = d3.max(flattenStack(), dc.pluck('x')); return dc.utils.add(max, _chart.xAxisPadding()); }; /** * Set or get the title function. Chart class will use this function to render svg title (usually interpreted by * browser as tooltips) for each child element in the chart, i.e. a slice in a pie chart or a bubble in a bubble chart. * Almost every chart supports title function however in grid coordinate chart you need to turn off brush in order to * use title otherwise the brush layer will block tooltip trigger. * * If the first argument is a stack name, the title function will get or set the title for that stack. If stackName * is not provided, the first stack is implied. * @method title * @memberof dc.stackMixin * @instance * @example * // set a title function on 'first stack' * chart.title('first stack', function(d) { return d.key + ': ' + d.value; }); * // get a title function from 'second stack' * var secondTitleFunction = chart.title('second stack'); * @param {String} [stackName] * @param {Function} [titleAccessor] * @return {String} * @return {dc.stackMixin} */ dc.override(_chart, 'title', function (stackName, titleAccessor) { if (!stackName) { return _chart._title(); } if (typeof stackName === 'function') { return _chart._title(stackName); } if (stackName === _chart._groupName && typeof titleAccessor === 'function') { return _chart._title(titleAccessor); } if (typeof titleAccessor !== 'function') { return _titles[stackName] || _chart._title(); } _titles[stackName] = titleAccessor; return _chart; }); /** * Gets or sets the stack layout algorithm, which computes a baseline for each stack and * propagates it to the next * @method stackLayout * @memberof dc.stackMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/Stack-Layout d3.layout.stack} * @param {Function} [stack=d3.layout.stack] * @return {Function} * @return {dc.stackMixin} */ _chart.stackLayout = function (stack) { if (!arguments.length) { return _stackLayout; } _stackLayout = stack; if (_stackLayout.values() === d3.layout.stack().values()) { _stackLayout.values(prepareValues); } return _chart; }; function visability (l) { return !l.hidden; } _chart.data(function () { var layers = _stack.filter(visability); return layers.length ? _chart.stackLayout()(layers) : []; }); _chart._ordinalXDomain = function () { var flat = flattenStack().map(dc.pluck('data')); var ordered = _chart._computeOrderedGroups(flat); return ordered.map(_chart.keyAccessor()); }; _chart.colorAccessor(function (d) { var layer = this.layer || this.name || d.name || d.layer; return layer; }); _chart.legendables = function () { return _stack.map(function (layer, i) { return { chart: _chart, name: layer.name, hidden: layer.hidden || false, color: _chart.getColor.call(layer, layer.values, i) }; }); }; _chart.isLegendableHidden = function (d) { var layer = findLayerByName(d.name); return layer ? layer.hidden : false; }; _chart.legendToggle = function (d) { if (_hidableStacks) { if (_chart.isLegendableHidden(d)) { _chart.showStack(d.name); } else { _chart.hideStack(d.name); } //_chart.redraw(); _chart.renderGroup(); } }; return _chart; }; /** * Cap is a mixin that groups small data elements below a _cap_ into an *others* grouping for both the * Row and Pie Charts. * * The top ordered elements in the group up to the cap amount will be kept in the chart, and the rest * will be replaced with an *others* element, with value equal to the sum of the replaced values. The * keys of the elements below the cap limit are recorded in order to filter by those keys when the * others* element is clicked. * @name capMixin * @memberof dc * @mixin * @param {Object} _chart * @return {dc.capMixin} */ dc.capMixin = function (_chart) { var _cap = Infinity; var _othersLabel = 'Others'; var _othersGrouper = function (topRows) { var topRowsSum = d3.sum(topRows, _chart.valueAccessor()), allRows = _chart.group().all(), allRowsSum = d3.sum(allRows, _chart.valueAccessor()), topKeys = topRows.map(_chart.keyAccessor()), allKeys = allRows.map(_chart.keyAccessor()), topSet = d3.set(topKeys), others = allKeys.filter(function (d) {return !topSet.has(d);}); if (allRowsSum > topRowsSum) { return topRows.concat([{'others': others, 'key': _othersLabel, 'value': allRowsSum - topRowsSum}]); } return topRows; }; _chart.cappedKeyAccessor = function (d, i) { if (d.others) { return d.key; } return _chart.keyAccessor()(d, i); }; _chart.cappedValueAccessor = function (d, i) { if (d.others) { return d.value; } return _chart.valueAccessor()(d, i); }; _chart.data(function (group) { if (_cap === Infinity) { return _chart._computeOrderedGroups(group.all()); } else { var topRows = group.top(_cap); // ordered by crossfilter group order (default value) topRows = _chart._computeOrderedGroups(topRows); // re-order using ordering (default key) if (_othersGrouper) { return _othersGrouper(topRows); } return topRows; } }); /** * Get or set the count of elements to that will be included in the cap. * @method cap * @memberof dc.capMixin * @instance * @param {Number} [count=Infinity] * @return {Number} * @return {dc.capMixin} */ _chart.cap = function (count) { if (!arguments.length) { return _cap; } _cap = count; return _chart; }; /** * Get or set the label for *Others* slice when slices cap is specified * @method othersLabel * @memberof dc.capMixin * @instance * @param {String} [label="Others"] * @return {String} * @return {dc.capMixin} */ _chart.othersLabel = function (label) { if (!arguments.length) { return _othersLabel; } _othersLabel = label; return _chart; }; /** * Get or set the grouper function that will perform the insertion of data for the *Others* slice * if the slices cap is specified. If set to a falsy value, no others will be added. By default the * grouper function computes the sum of all values below the cap. * @method othersGrouper * @memberof dc.capMixin * @instance * @example * // Default others grouper * chart.othersGrouper(function (topRows) { * var topRowsSum = d3.sum(topRows, _chart.valueAccessor()), * allRows = _chart.group().all(), * allRowsSum = d3.sum(allRows, _chart.valueAccessor()), * topKeys = topRows.map(_chart.keyAccessor()), * allKeys = allRows.map(_chart.keyAccessor()), * topSet = d3.set(topKeys), * others = allKeys.filter(function (d) {return !topSet.has(d);}); * if (allRowsSum > topRowsSum) { * return topRows.concat([{'others': others, 'key': _othersLabel, 'value': allRowsSum - topRowsSum}]); * } * return topRows; * }); * // Custom others grouper * chart.othersGrouper(function (data) { * // compute the value for others, presumably the sum of all values below the cap * var othersSum = yourComputeOthersValueLogic(data) * * // the keys are needed to properly filter when the others element is clicked * var othersKeys = yourComputeOthersKeysArrayLogic(data); * * // add the others row to the dataset * data.push({'key': 'Others', 'value': othersSum, 'others': othersKeys }); * * return data; * }); * @param {Function} [grouperFunction] * @return {Function} * @return {dc.capMixin} */ _chart.othersGrouper = function (grouperFunction) { if (!arguments.length) { return _othersGrouper; } _othersGrouper = grouperFunction; return _chart; }; dc.override(_chart, 'onClick', function (d) { if (d.others) { _chart.filter([d.others]); } _chart._onClick(d); }); return _chart; }; /** * This Mixin provides reusable functionalities for any chart that needs to visualize data using bubbles. * @name bubbleMixin * @memberof dc * @mixin * @mixes dc.colorMixin * @param {Object} _chart * @return {dc.bubbleMixin} */ dc.bubbleMixin = function (_chart) { var _maxBubbleRelativeSize = 0.3; var _minRadiusWithLabel = 10; _chart.BUBBLE_NODE_CLASS = 'node'; _chart.BUBBLE_CLASS = 'bubble'; _chart.MIN_RADIUS = 10; _chart = dc.colorMixin(_chart); _chart.renderLabel(true); _chart.data(function (group) { return group.top(Infinity); }); var _r = d3.scale.linear().domain([0, 100]); var _rValueAccessor = function (d) { return d.r; }; /** * Get or set the bubble radius scale. By default the bubble chart uses * {@link https://github.com/mbostock/d3/wiki/Quantitative-Scales#linear d3.scale.linear().domain([0, 100])} * as its radius scale. * @method r * @memberof dc.bubbleMixin * @instance * @see {@link http://github.com/mbostock/d3/wiki/Scales d3.scale} * @param {d3.scale} [bubbleRadiusScale=d3.scale.linear().domain([0, 100])] * @return {d3.scale} * @return {dc.bubbleMixin} */ _chart.r = function (bubbleRadiusScale) { if (!arguments.length) { return _r; } _r = bubbleRadiusScale; return _chart; }; /** * Get or set the radius value accessor function. If set, the radius value accessor function will * be used to retrieve a data value for each bubble. The data retrieved then will be mapped using * the r scale to the actual bubble radius. This allows you to encode a data dimension using bubble * size. * @method radiusValueAccessor * @memberof dc.bubbleMixin * @instance * @param {Function} [radiusValueAccessor] * @return {Function} * @return {dc.bubbleMixin} */ _chart.radiusValueAccessor = function (radiusValueAccessor) { if (!arguments.length) { return _rValueAccessor; } _rValueAccessor = radiusValueAccessor; return _chart; }; _chart.rMin = function () { var min = d3.min(_chart.data(), function (e) { return _chart.radiusValueAccessor()(e); }); return min; }; _chart.rMax = function () { var max = d3.max(_chart.data(), function (e) { return _chart.radiusValueAccessor()(e); }); return max; }; _chart.bubbleR = function (d) { var value = _chart.radiusValueAccessor()(d); var r = _chart.r()(value); if (isNaN(r) || value <= 0) { r = 0; } return r; }; var labelFunction = function (d) { return _chart.label()(d); }; var shouldLabel = function (d) { return (_chart.bubbleR(d) > _minRadiusWithLabel); }; var labelOpacity = function (d) { return shouldLabel(d) ? 1 : 0; }; var labelPointerEvent = function (d) { return shouldLabel(d) ? 'all' : 'none'; }; _chart._doRenderLabel = function (bubbleGEnter) { if (_chart.renderLabel()) { var label = bubbleGEnter.select('text'); if (label.empty()) { label = bubbleGEnter.append('text') .attr('text-anchor', 'middle') .attr('dy', '.3em') .on('click', _chart.onClick); } label .attr('opacity', 0) .attr('pointer-events', labelPointerEvent) .text(labelFunction); dc.transition(label, _chart.transitionDuration()) .attr('opacity', labelOpacity); } }; _chart.doUpdateLabels = function (bubbleGEnter) { if (_chart.renderLabel()) { var labels = bubbleGEnter.selectAll('text') .attr('pointer-events', labelPointerEvent) .text(labelFunction); dc.transition(labels, _chart.transitionDuration()) .attr('opacity', labelOpacity); } }; var titleFunction = function (d) { return _chart.title()(d); }; _chart._doRenderTitles = function (g) { if (_chart.renderTitle()) { var title = g.select('title'); if (title.empty()) { g.append('title').text(titleFunction); } } }; _chart.doUpdateTitles = function (g) { if (_chart.renderTitle()) { g.selectAll('title').text(titleFunction); } }; /** * Get or set the minimum radius. This will be used to initialize the radius scale's range. * @method minRadius * @memberof dc.bubbleMixin * @instance * @param {Number} [radius=10] * @return {Number} * @return {dc.bubbleMixin} */ _chart.minRadius = function (radius) { if (!arguments.length) { return _chart.MIN_RADIUS; } _chart.MIN_RADIUS = radius; return _chart; }; /** * Get or set the minimum radius for label rendering. If a bubble's radius is less than this value * then no label will be rendered. * @method minRadiusWithLabel * @memberof dc.bubbleMixin * @instance * @param {Number} [radius=10] * @return {Number} * @return {dc.bubbleMixin} */ _chart.minRadiusWithLabel = function (radius) { if (!arguments.length) { return _minRadiusWithLabel; } _minRadiusWithLabel = radius; return _chart; }; /** * Get or set the maximum relative size of a bubble to the length of x axis. This value is useful * when the difference in radius between bubbles is too great. * @method maxBubbleRelativeSize * @memberof dc.bubbleMixin * @instance * @param {Number} [relativeSize=0.3] * @return {Number} * @return {dc.bubbleMixin} */ _chart.maxBubbleRelativeSize = function (relativeSize) { if (!arguments.length) { return _maxBubbleRelativeSize; } _maxBubbleRelativeSize = relativeSize; return _chart; }; _chart.fadeDeselectedArea = function () { if (_chart.hasFilter()) { _chart.selectAll('g.' + _chart.BUBBLE_NODE_CLASS).each(function (d) { if (_chart.isSelectedNode(d)) { _chart.highlightSelected(this); } else { _chart.fadeDeselected(this); } }); } else { _chart.selectAll('g.' + _chart.BUBBLE_NODE_CLASS).each(function () { _chart.resetHighlight(this); }); } }; _chart.isSelectedNode = function (d) { return _chart.hasFilter(d.key); }; _chart.onClick = function (d) { var filter = d.key; dc.events.trigger(function () { _chart.filter(filter); _chart.redrawGroup(); }); }; return _chart; }; /** * The pie chart implementation is usually used to visualize a small categorical distribution. The pie * chart uses keyAccessor to determine the slices, and valueAccessor to calculate the size of each * slice relative to the sum of all values. Slices are ordered by {@link dc.baseMixin#ordering ordering} * which defaults to sorting by key. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * @class pieChart * @memberof dc * @mixes dc.capMixin * @mixes dc.colorMixin * @mixes dc.baseMixin * @example * // create a pie chart under #chart-container1 element using the default global chart group * var chart1 = dc.pieChart('#chart-container1'); * // create a pie chart under #chart-container2 element using chart group A * var chart2 = dc.pieChart('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.pieChart} */ dc.pieChart = function (parent, chartGroup) { var DEFAULT_MIN_ANGLE_FOR_LABEL = 0.5; var _sliceCssClass = 'pie-slice'; var _emptyCssClass = 'empty-chart'; var _emptyTitle = 'empty'; var _radius, _givenRadius, // specified radius, if any _innerRadius = 0, _externalRadiusPadding = 0; var _g; var _cx; var _cy; var _minAngleForLabel = DEFAULT_MIN_ANGLE_FOR_LABEL; var _externalLabelRadius; var _drawPaths = false; var _chart = dc.capMixin(dc.colorMixin(dc.baseMixin({}))); _chart.colorAccessor(_chart.cappedKeyAccessor); _chart.title(function (d) { return _chart.cappedKeyAccessor(d) + ': ' + _chart.cappedValueAccessor(d); }); /** * Get or set the maximum number of slices the pie chart will generate. The top slices are determined by * value from high to low. Other slices exeeding the cap will be rolled up into one single *Others* slice. * @method slicesCap * @memberof dc.pieChart * @instance * @param {Number} [cap] * @return {Number} * @return {dc.pieChart} */ _chart.slicesCap = _chart.cap; _chart.label(_chart.cappedKeyAccessor); _chart.renderLabel(true); _chart.transitionDuration(350); _chart._doRender = function () { _chart.resetSvg(); _g = _chart.svg() .append('g') .attr('transform', 'translate(' + _chart.cx() + ',' + _chart.cy() + ')'); drawChart(); return _chart; }; function drawChart () { // set radius on basis of chart dimension if missing _radius = _givenRadius ? _givenRadius : d3.min([_chart.width(), _chart.height()]) / 2; var arc = buildArcs(); var pie = pieLayout(); var pieData; // if we have data... if (d3.sum(_chart.data(), _chart.valueAccessor())) { pieData = pie(_chart.data()); _g.classed(_emptyCssClass, false); } else { // otherwise we'd be getting NaNs, so override // note: abuse others for its ignoring the value accessor pieData = pie([{key: _emptyTitle, value: 1, others: [_emptyTitle]}]); _g.classed(_emptyCssClass, true); } if (_g) { var slices = _g.selectAll('g.' + _sliceCssClass) .data(pieData); createElements(slices, arc, pieData); updateElements(pieData, arc); removeElements(slices); highlightFilter(); dc.transition(_g, _chart.transitionDuration()) .attr('transform', 'translate(' + _chart.cx() + ',' + _chart.cy() + ')'); } } function createElements (slices, arc, pieData) { var slicesEnter = createSliceNodes(slices); createSlicePath(slicesEnter, arc); createTitles(slicesEnter); createLabels(pieData, arc); } function createSliceNodes (slices) { var slicesEnter = slices .enter() .append('g') .attr('class', function (d, i) { return _sliceCssClass + ' _' + i; }); return slicesEnter; } function createSlicePath (slicesEnter, arc) { var slicePath = slicesEnter.append('path') .attr('fill', fill) .on('click', onClick) .attr('d', function (d, i) { return safeArc(d, i, arc); }); dc.transition(slicePath, _chart.transitionDuration(), function (s) { s.attrTween('d', tweenPie); }); } function createTitles (slicesEnter) { if (_chart.renderTitle()) { slicesEnter.append('title').text(function (d) { return _chart.title()(d.data); }); } } _chart._applyLabelText = function (labels) { labels .text(function (d) { var data = d.data; if ((sliceHasNoData(data) || sliceTooSmall(d)) && !isSelectedSlice(d)) { return ''; } return _chart.label()(d.data); }); }; function positionLabels (labels, arc) { _chart._applyLabelText(labels); dc.transition(labels, _chart.transitionDuration()) .attr('transform', function (d) { return labelPosition(d, arc); }) .attr('text-anchor', 'middle'); } function createLabels (pieData, arc) { if (_chart.renderLabel()) { var labels = _g.selectAll('text.' + _sliceCssClass) .data(pieData); labels.exit().remove(); var labelsEnter = labels .enter() .append('text') .attr('class', function (d, i) { var classes = _sliceCssClass + ' _' + i; if (_externalLabelRadius) { classes += ' external'; } return classes; }) .on('click', onClick); positionLabels(labelsEnter, arc); if (_externalLabelRadius && _drawPaths) { updateLabelPaths(pieData, arc); } } } function updateLabelPaths (pieData, arc) { var polyline = _g.selectAll('polyline.' + _sliceCssClass) .data(pieData); polyline .enter() .append('polyline') .attr('class', function (d, i) { return 'pie-path _' + i + ' ' + _sliceCssClass; }); polyline.exit().remove(); dc.transition(polyline, _chart.transitionDuration()) .attrTween('points', function (d) { this._current = this._current || d; var interpolate = d3.interpolate(this._current, d); this._current = interpolate(0); return function (t) { var arc2 = d3.svg.arc() .outerRadius(_radius - _externalRadiusPadding + _externalLabelRadius) .innerRadius(_radius - _externalRadiusPadding); var d2 = interpolate(t); return [arc.centroid(d2), arc2.centroid(d2)]; }; }) .style('visibility', function (d) { return d.endAngle - d.startAngle < 0.0001 ? 'hidden' : 'visible'; }); } function updateElements (pieData, arc) { updateSlicePaths(pieData, arc); updateLabels(pieData, arc); updateTitles(pieData); } function updateSlicePaths (pieData, arc) { var slicePaths = _g.selectAll('g.' + _sliceCssClass) .data(pieData) .select('path') .attr('d', function (d, i) { return safeArc(d, i, arc); }); dc.transition(slicePaths, _chart.transitionDuration(), function (s) { s.attrTween('d', tweenPie); }).attr('fill', fill); } function updateLabels (pieData, arc) { if (_chart.renderLabel()) { var labels = _g.selectAll('text.' + _sliceCssClass) .data(pieData); positionLabels(labels, arc); if (_externalLabelRadius && _drawPaths) { updateLabelPaths(pieData, arc); } } } function updateTitles (pieData) { if (_chart.renderTitle()) { _g.selectAll('g.' + _sliceCssClass) .data(pieData) .select('title') .text(function (d) { return _chart.title()(d.data); }); } } function removeElements (slices) { slices.exit().remove(); } function highlightFilter () { if (_chart.hasFilter()) { _chart.selectAll('g.' + _sliceCssClass).each(function (d) { if (isSelectedSlice(d)) { _chart.highlightSelected(this); } else { _chart.fadeDeselected(this); } }); } else { _chart.selectAll('g.' + _sliceCssClass).each(function () { _chart.resetHighlight(this); }); } } /** * Get or set the external radius padding of the pie chart. This will force the radius of the * pie chart to become smaller or larger depending on the value. * @method externalRadiusPadding * @memberof dc.pieChart * @instance * @param {Number} [externalRadiusPadding=0] * @return {Number} * @return {dc.pieChart} */ _chart.externalRadiusPadding = function (externalRadiusPadding) { if (!arguments.length) { return _externalRadiusPadding; } _externalRadiusPadding = externalRadiusPadding; return _chart; }; /** * Get or set the inner radius of the pie chart. If the inner radius is greater than 0px then the * pie chart will be rendered as a doughnut chart. * @method innerRadius * @memberof dc.pieChart * @instance * @param {Number} [innerRadius=0] * @return {Number} * @return {dc.pieChart} */ _chart.innerRadius = function (innerRadius) { if (!arguments.length) { return _innerRadius; } _innerRadius = innerRadius; return _chart; }; /** * Get or set the outer radius. If the radius is not set, it will be half of the minimum of the * chart width and height. * @method radius * @memberof dc.pieChart * @instance * @param {Number} [radius] * @return {Number} * @return {dc.pieChart} */ _chart.radius = function (radius) { if (!arguments.length) { return _givenRadius; } _givenRadius = radius; return _chart; }; /** * Get or set center x coordinate position. Default is center of svg. * @method cx * @memberof dc.pieChart * @instance * @param {Number} [cx] * @return {Number} * @return {dc.pieChart} */ _chart.cx = function (cx) { if (!arguments.length) { return (_cx || _chart.width() / 2); } _cx = cx; return _chart; }; /** * Get or set center y coordinate position. Default is center of svg. * @method cy * @memberof dc.pieChart * @instance * @param {Number} [cy] * @return {Number} * @return {dc.pieChart} */ _chart.cy = function (cy) { if (!arguments.length) { return (_cy || _chart.height() / 2); } _cy = cy; return _chart; }; function buildArcs () { return d3.svg.arc() .outerRadius(_radius - _externalRadiusPadding) .innerRadius(_innerRadius); } function isSelectedSlice (d) { return _chart.hasFilter(_chart.cappedKeyAccessor(d.data)); } _chart._doRedraw = function () { drawChart(); return _chart; }; /** * Get or set the minimal slice angle for label rendering. Any slice with a smaller angle will not * display a slice label. * @method minAngleForLabel * @memberof dc.pieChart * @instance * @param {Number} [minAngleForLabel=0.5] * @return {Number} * @return {dc.pieChart} */ _chart.minAngleForLabel = function (minAngleForLabel) { if (!arguments.length) { return _minAngleForLabel; } _minAngleForLabel = minAngleForLabel; return _chart; }; function pieLayout () { return d3.layout.pie().sort(null).value(_chart.cappedValueAccessor); } function sliceTooSmall (d) { var angle = (d.endAngle - d.startAngle); return isNaN(angle) || angle < _minAngleForLabel; } function sliceHasNoData (d) { return _chart.cappedValueAccessor(d) === 0; } function tweenPie (b) { b.innerRadius = _innerRadius; var current = this._current; if (isOffCanvas(current)) { current = {startAngle: 0, endAngle: 0}; } else { // only interpolate startAngle & endAngle, not the whole data object current = {startAngle: current.startAngle, endAngle: current.endAngle}; } var i = d3.interpolate(current, b); this._current = i(0); return function (t) { return safeArc(i(t), 0, buildArcs()); }; } function isOffCanvas (current) { return !current || isNaN(current.startAngle) || isNaN(current.endAngle); } function fill (d, i) { return _chart.getColor(d.data, i); } function onClick (d, i) { if (_g.attr('class') !== _emptyCssClass) { _chart.onClick(d.data, i); } } function safeArc (d, i, arc) { var path = arc(d, i); if (path.indexOf('NaN') >= 0) { path = 'M0,0'; } return path; } /** * Title to use for the only slice when there is no data. * @method emptyTitle * @memberof dc.pieChart * @instance * @param {String} [title] * @return {String} * @return {dc.pieChart} */ _chart.emptyTitle = function (title) { if (arguments.length === 0) { return _emptyTitle; } _emptyTitle = title; return _chart; }; /** * Position slice labels offset from the outer edge of the chart * * The given argument sets the radial offset. * @method externalLabels * @memberof dc.pieChart * @instance * @param {Number} [externalLabelRadius] * @return {Number} * @return {dc.pieChart} */ _chart.externalLabels = function (externalLabelRadius) { if (arguments.length === 0) { return _externalLabelRadius; } else if (externalLabelRadius) { _externalLabelRadius = externalLabelRadius; } else { _externalLabelRadius = undefined; } return _chart; }; /** * Get or set whether to draw lines from pie slices to their labels. * * @method drawPaths * @memberof dc.pieChart * @instance * @param {Boolean} [drawPaths] * @return {Boolean} * @return {dc.pieChart} */ _chart.drawPaths = function (drawPaths) { if (arguments.length === 0) { return _drawPaths; } _drawPaths = drawPaths; return _chart; }; function labelPosition (d, arc) { var centroid; if (_externalLabelRadius) { centroid = d3.svg.arc() .outerRadius(_radius - _externalRadiusPadding + _externalLabelRadius) .innerRadius(_radius - _externalRadiusPadding + _externalLabelRadius) .centroid(d); } else { centroid = arc.centroid(d); } if (isNaN(centroid[0]) || isNaN(centroid[1])) { return 'translate(0,0)'; } else { return 'translate(' + centroid + ')'; } } _chart.legendables = function () { return _chart.data().map(function (d, i) { var legendable = {name: d.key, data: d.value, others: d.others, chart: _chart}; legendable.color = _chart.getColor(d, i); return legendable; }); }; _chart.legendHighlight = function (d) { highlightSliceFromLegendable(d, true); }; _chart.legendReset = function (d) { highlightSliceFromLegendable(d, false); }; _chart.legendToggle = function (d) { _chart.onClick({key: d.name, others: d.others}); }; function highlightSliceFromLegendable (legendable, highlighted) { _chart.selectAll('g.pie-slice').each(function (d) { if (legendable.name === d.data.key) { d3.select(this).classed('highlight', highlighted); } }); } return _chart.anchor(parent, chartGroup); }; /** * Concrete bar chart/histogram implementation. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * - {@link http://dc-js.github.com/dc.js/crime/index.html Canadian City Crime Stats} * @class barChart * @memberof dc * @mixes dc.stackMixin * @mixes dc.coordinateGridMixin * @example * // create a bar chart under #chart-container1 element using the default global chart group * var chart1 = dc.barChart('#chart-container1'); * // create a bar chart under #chart-container2 element using chart group A * var chart2 = dc.barChart('#chart-container2', 'chartGroupA'); * // create a sub-chart under a composite parent chart * var chart3 = dc.barChart(compositeChart); * @param {String|node|d3.selection|dc.compositeChart} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} * specifying a dom block element such as a div; or a dom element or d3 selection. If the bar * chart is a sub-chart in a {@link dc.compositeChart Composite Chart} then pass in the parent * composite chart instance instead. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.barChart} */ dc.barChart = function (parent, chartGroup) { var MIN_BAR_WIDTH = 1; var DEFAULT_GAP_BETWEEN_BARS = 2; var LABEL_PADDING = 3; var _chart = dc.stackMixin(dc.coordinateGridMixin({})); var _gap = DEFAULT_GAP_BETWEEN_BARS; var _centerBar = false; var _alwaysUseRounding = false; var _barWidth; dc.override(_chart, 'rescale', function () { _chart._rescale(); _barWidth = undefined; return _chart; }); dc.override(_chart, 'render', function () { if (_chart.round() && _centerBar && !_alwaysUseRounding) { dc.logger.warn('By default, brush rounding is disabled if bars are centered. ' + 'See dc.js bar chart API documentation for details.'); } return _chart._render(); }); _chart.label(function (d) { return dc.utils.printSingleValue(d.y0 + d.y); }, false); _chart.plotData = function () { var layers = _chart.chartBodyG().selectAll('g.stack') .data(_chart.data()); calculateBarWidth(); layers .enter() .append('g') .attr('class', function (d, i) { return 'stack ' + '_' + i; }); var last = layers.size() - 1; layers.each(function (d, i) { var layer = d3.select(this); renderBars(layer, i, d); if (_chart.renderLabel() && last === i) { renderLabels(layer, i, d); } }); }; function barHeight (d) { return dc.utils.safeNumber(Math.abs(_chart.y()(d.y + d.y0) - _chart.y()(d.y0))); } function renderLabels (layer, layerIndex, d) { var labels = layer.selectAll('text.barLabel') .data(d.values, dc.pluck('x')); labels.enter() .append('text') .attr('class', 'barLabel') .attr('text-anchor', 'middle'); if (_chart.isOrdinal()) { labels.on('click', _chart.onClick); labels.attr('cursor', 'pointer'); } dc.transition(labels, _chart.transitionDuration()) .attr('x', function (d) { var x = _chart.x()(d.x); if (!_centerBar) { x += _barWidth / 2; } return dc.utils.safeNumber(x); }) .attr('y', function (d) { var y = _chart.y()(d.y + d.y0); if (d.y < 0) { y -= barHeight(d); } return dc.utils.safeNumber(y - LABEL_PADDING); }) .text(function (d) { return _chart.label()(d); }); dc.transition(labels.exit(), _chart.transitionDuration()) .attr('height', 0) .remove(); } function renderBars (layer, layerIndex, d) { var bars = layer.selectAll('rect.bar') .data(d.values, dc.pluck('x')); var enter = bars.enter() .append('rect') .attr('class', 'bar') .attr('fill', dc.pluck('data', _chart.getColor)) .attr('y', _chart.yAxisHeight()) .attr('height', 0); if (_chart.renderTitle()) { enter.append('title').text(dc.pluck('data', _chart.title(d.name))); } if (_chart.isOrdinal()) { bars.on('click', _chart.onClick); } dc.transition(bars, _chart.transitionDuration()) .attr('x', function (d) { var x = _chart.x()(d.x); if (_centerBar) { x -= _barWidth / 2; } if (_chart.isOrdinal() && _gap !== undefined) { x += _gap / 2; } return dc.utils.safeNumber(x); }) .attr('y', function (d) { var y = _chart.y()(d.y + d.y0); if (d.y < 0) { y -= barHeight(d); } return dc.utils.safeNumber(y); }) .attr('width', _barWidth) .attr('height', function (d) { return barHeight(d); }) .attr('fill', dc.pluck('data', _chart.getColor)) .select('title').text(dc.pluck('data', _chart.title(d.name))); dc.transition(bars.exit(), _chart.transitionDuration()) .attr('height', 0) .remove(); } function calculateBarWidth () { if (_barWidth === undefined) { var numberOfBars = _chart.xUnitCount(); // please can't we always use rangeBands for bar charts? if (_chart.isOrdinal() && _gap === undefined) { _barWidth = Math.floor(_chart.x().rangeBand()); } else if (_gap) { _barWidth = Math.floor((_chart.xAxisLength() - (numberOfBars - 1) * _gap) / numberOfBars); } else { _barWidth = Math.floor(_chart.xAxisLength() / (1 + _chart.barPadding()) / numberOfBars); } if (_barWidth === Infinity || isNaN(_barWidth) || _barWidth < MIN_BAR_WIDTH) { _barWidth = MIN_BAR_WIDTH; } } } _chart.fadeDeselectedArea = function () { var bars = _chart.chartBodyG().selectAll('rect.bar'); var extent = _chart.brush().extent(); if (_chart.isOrdinal()) { if (_chart.hasFilter()) { bars.classed(dc.constants.SELECTED_CLASS, function (d) { return _chart.hasFilter(d.x); }); bars.classed(dc.constants.DESELECTED_CLASS, function (d) { return !_chart.hasFilter(d.x); }); } else { bars.classed(dc.constants.SELECTED_CLASS, false); bars.classed(dc.constants.DESELECTED_CLASS, false); } } else { if (!_chart.brushIsEmpty(extent)) { var start = extent[0]; var end = extent[1]; bars.classed(dc.constants.DESELECTED_CLASS, function (d) { return d.x < start || d.x >= end; }); } else { bars.classed(dc.constants.DESELECTED_CLASS, false); } } }; /** * Whether the bar chart will render each bar centered around the data position on the x-axis. * @method centerBar * @memberof dc.barChart * @instance * @param {Boolean} [centerBar=false] * @return {Boolean} * @return {dc.barChart} */ _chart.centerBar = function (centerBar) { if (!arguments.length) { return _centerBar; } _centerBar = centerBar; return _chart; }; dc.override(_chart, 'onClick', function (d) { _chart._onClick(d.data); }); /** * Get or set the spacing between bars as a fraction of bar size. Valid values are between 0-1. * Setting this value will also remove any previously set {@link dc.barChart#gap gap}. See the * {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales#wiki-ordinal_rangeBands d3 docs} * for a visual description of how the padding is applied. * @method barPadding * @memberof dc.barChart * @instance * @param {Number} [barPadding=0] * @return {Number} * @return {dc.barChart} */ _chart.barPadding = function (barPadding) { if (!arguments.length) { return _chart._rangeBandPadding(); } _chart._rangeBandPadding(barPadding); _gap = undefined; return _chart; }; _chart._useOuterPadding = function () { return _gap === undefined; }; /** * Get or set the outer padding on an ordinal bar chart. This setting has no effect on non-ordinal charts. * Will pad the width by `padding * barWidth` on each side of the chart. * @method outerPadding * @memberof dc.barChart * @instance * @param {Number} [padding=0.5] * @return {Number} * @return {dc.barChart} */ _chart.outerPadding = _chart._outerRangeBandPadding; /** * Manually set fixed gap (in px) between bars instead of relying on the default auto-generated * gap. By default the bar chart implementation will calculate and set the gap automatically * based on the number of data points and the length of the x axis. * @method gap * @memberof dc.barChart * @instance * @param {Number} [gap=2] * @return {Number} * @return {dc.barChart} */ _chart.gap = function (gap) { if (!arguments.length) { return _gap; } _gap = gap; return _chart; }; _chart.extendBrush = function () { var extent = _chart.brush().extent(); if (_chart.round() && (!_centerBar || _alwaysUseRounding)) { extent[0] = extent.map(_chart.round())[0]; extent[1] = extent.map(_chart.round())[1]; _chart.chartBodyG().select('.brush') .call(_chart.brush().extent(extent)); } return extent; }; /** * Set or get whether rounding is enabled when bars are centered. If false, using * rounding with centered bars will result in a warning and rounding will be ignored. This flag * has no effect if bars are not {@link dc.barChart#centerBar centered}. * When using standard d3.js rounding methods, the brush often doesn't align correctly with * centered bars since the bars are offset. The rounding function must add an offset to * compensate, such as in the following example. * @method alwaysUseRounding * @memberof dc.barChart * @instance * @example * chart.round(function(n) { return Math.floor(n) + 0.5; }); * @param {Boolean} [alwaysUseRounding=false] * @return {Boolean} * @return {dc.barChart} */ _chart.alwaysUseRounding = function (alwaysUseRounding) { if (!arguments.length) { return _alwaysUseRounding; } _alwaysUseRounding = alwaysUseRounding; return _chart; }; function colorFilter (color, inv) { return function () { var item = d3.select(this); var match = item.attr('fill') === color; return inv ? !match : match; }; } _chart.legendHighlight = function (d) { if (!_chart.isLegendableHidden(d)) { _chart.g().selectAll('rect.bar') .classed('highlight', colorFilter(d.color)) .classed('fadeout', colorFilter(d.color, true)); } }; _chart.legendReset = function () { _chart.g().selectAll('rect.bar') .classed('highlight', false) .classed('fadeout', false); }; dc.override(_chart, 'xAxisMax', function () { var max = this._xAxisMax(); if ('resolution' in _chart.xUnits()) { var res = _chart.xUnits().resolution; max += res; } return max; }); return _chart.anchor(parent, chartGroup); }; /** * Concrete line/area chart implementation. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * - {@link http://dc-js.github.com/dc.js/crime/index.html Canadian City Crime Stats} * @class lineChart * @memberof dc * @mixes dc.stackMixin * @mixes dc.coordinateGridMixin * @example * // create a line chart under #chart-container1 element using the default global chart group * var chart1 = dc.lineChart('#chart-container1'); * // create a line chart under #chart-container2 element using chart group A * var chart2 = dc.lineChart('#chart-container2', 'chartGroupA'); * // create a sub-chart under a composite parent chart * var chart3 = dc.lineChart(compositeChart); * @param {String|node|d3.selection|dc.compositeChart} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} * specifying a dom block element such as a div; or a dom element or d3 selection. If the line * chart is a sub-chart in a {@link dc.compositeChart Composite Chart} then pass in the parent * composite chart instance instead. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.lineChart} */ dc.lineChart = function (parent, chartGroup) { var DEFAULT_DOT_RADIUS = 5; var TOOLTIP_G_CLASS = 'dc-tooltip'; var DOT_CIRCLE_CLASS = 'dot'; var Y_AXIS_REF_LINE_CLASS = 'yRef'; var X_AXIS_REF_LINE_CLASS = 'xRef'; var DEFAULT_DOT_OPACITY = 1e-6; var LABEL_PADDING = 3; var _chart = dc.stackMixin(dc.coordinateGridMixin({})); var _renderArea = false; var _dotRadius = DEFAULT_DOT_RADIUS; var _dataPointRadius = null; var _dataPointFillOpacity = DEFAULT_DOT_OPACITY; var _dataPointStrokeOpacity = DEFAULT_DOT_OPACITY; var _interpolate = 'linear'; var _tension = 0.7; var _defined; var _dashStyle; var _xyTipsOn = true; _chart.transitionDuration(500); _chart._rangeBandPadding(1); _chart.plotData = function () { var chartBody = _chart.chartBodyG(); var layersList = chartBody.selectAll('g.stack-list'); if (layersList.empty()) { layersList = chartBody.append('g').attr('class', 'stack-list'); } var layers = layersList.selectAll('g.stack').data(_chart.data()); var layersEnter = layers .enter() .append('g') .attr('class', function (d, i) { return 'stack ' + '_' + i; }); drawLine(layersEnter, layers); drawArea(layersEnter, layers); drawDots(chartBody, layers); if (_chart.renderLabel()) { drawLabels(layers); } }; /** * Gets or sets the interpolator to use for lines drawn, by string name, allowing e.g. step * functions, splines, and cubic interpolation. This is passed to * {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_interpolate d3.svg.line.interpolate} and * {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#area_interpolate d3.svg.area.interpolate}, * where you can find a complete list of valid arguments * @method interpolate * @memberof dc.lineChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_interpolate d3.svg.line.interpolate} * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#area_interpolate d3.svg.area.interpolate} * @param {String} [interpolate='linear'] * @return {String} * @return {dc.lineChart} */ _chart.interpolate = function (interpolate) { if (!arguments.length) { return _interpolate; } _interpolate = interpolate; return _chart; }; /** * Gets or sets the tension to use for lines drawn, in the range 0 to 1. * This parameter further customizes the interpolation behavior. It is passed to * {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_tension d3.svg.line.tension} and * {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#area_tension d3.svg.area.tension}. * @method tension * @memberof dc.lineChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_interpolate d3.svg.line.interpolate} * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#area_interpolate d3.svg.area.interpolate} * @param {Number} [tension=0.7] * @return {Number} * @return {dc.lineChart} */ _chart.tension = function (tension) { if (!arguments.length) { return _tension; } _tension = tension; return _chart; }; /** * Gets or sets a function that will determine discontinuities in the line which should be * skipped: the path will be broken into separate subpaths if some points are undefined. * This function is passed to * {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_defined d3.svg.line.defined} * * Note: crossfilter will sometimes coerce nulls to 0, so you may need to carefully write * custom reduce functions to get this to work, depending on your data. See * https://github.com/dc-js/dc.js/issues/615#issuecomment-49089248 * @method defined * @memberof dc.lineChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#line_defined d3.svg.line.defined} * @param {Function} [defined] * @return {Function} * @return {dc.lineChart} */ _chart.defined = function (defined) { if (!arguments.length) { return _defined; } _defined = defined; return _chart; }; /** * Set the line's d3 dashstyle. This value becomes the 'stroke-dasharray' of line. Defaults to empty * array (solid line). * @method dashStyle * @memberof dc.lineChart * @instance * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray stroke-dasharray} * @example * // create a Dash Dot Dot Dot * chart.dashStyle([3,1,1,1]); * @param {Array<Number>} [dashStyle=[]] * @return {Array<Number>} * @return {dc.lineChart} */ _chart.dashStyle = function (dashStyle) { if (!arguments.length) { return _dashStyle; } _dashStyle = dashStyle; return _chart; }; /** * Get or set render area flag. If the flag is set to true then the chart will render the area * beneath each line and the line chart effectively becomes an area chart. * @method renderArea * @memberof dc.lineChart * @instance * @param {Boolean} [renderArea=false] * @return {Boolean} * @return {dc.lineChart} */ _chart.renderArea = function (renderArea) { if (!arguments.length) { return _renderArea; } _renderArea = renderArea; return _chart; }; function colors (d, i) { return _chart.getColor.call(d, d.values, i); } function drawLine (layersEnter, layers) { var line = d3.svg.line() .x(function (d) { return _chart.x()(d.x); }) .y(function (d) { return _chart.y()(d.y + d.y0); }) .interpolate(_interpolate) .tension(_tension); if (_defined) { line.defined(_defined); } var path = layersEnter.append('path') .attr('class', 'line') .attr('stroke', colors); if (_dashStyle) { path.attr('stroke-dasharray', _dashStyle); } dc.transition(layers.select('path.line'), _chart.transitionDuration()) //.ease('linear') .attr('stroke', colors) .attr('d', function (d) { return safeD(line(d.values)); }); } function drawArea (layersEnter, layers) { if (_renderArea) { var area = d3.svg.area() .x(function (d) { return _chart.x()(d.x); }) .y(function (d) { return _chart.y()(d.y + d.y0); }) .y0(function (d) { return _chart.y()(d.y0); }) .interpolate(_interpolate) .tension(_tension); if (_defined) { area.defined(_defined); } layersEnter.append('path') .attr('class', 'area') .attr('fill', colors) .attr('d', function (d) { return safeD(area(d.values)); }); dc.transition(layers.select('path.area'), _chart.transitionDuration()) //.ease('linear') .attr('fill', colors) .attr('d', function (d) { return safeD(area(d.values)); }); } } function safeD (d) { return (!d || d.indexOf('NaN') >= 0) ? 'M0,0' : d; } function drawDots (chartBody, layers) { if (!_chart.brushOn() && _chart.xyTipsOn()) { var tooltipListClass = TOOLTIP_G_CLASS + '-list'; var tooltips = chartBody.select('g.' + tooltipListClass); if (tooltips.empty()) { tooltips = chartBody.append('g').attr('class', tooltipListClass); } layers.each(function (d, layerIndex) { var points = d.values; if (_defined) { points = points.filter(_defined); } var g = tooltips.select('g.' + TOOLTIP_G_CLASS + '._' + layerIndex); if (g.empty()) { g = tooltips.append('g').attr('class', TOOLTIP_G_CLASS + ' _' + layerIndex); } createRefLines(g); var dots = g.selectAll('circle.' + DOT_CIRCLE_CLASS) .data(points, dc.pluck('x')); dots.enter() .append('circle') .attr('class', DOT_CIRCLE_CLASS) .attr('r', getDotRadius()) .style('fill-opacity', _dataPointFillOpacity) .style('stroke-opacity', _dataPointStrokeOpacity) .on('mousemove', function () { var dot = d3.select(this); showDot(dot); showRefLines(dot, g); }) .on('mouseout', function () { var dot = d3.select(this); hideDot(dot); hideRefLines(g); }); dots .attr('cx', function (d) { return dc.utils.safeNumber(_chart.x()(d.x)); }) .attr('cy', function (d) { return dc.utils.safeNumber(_chart.y()(d.y + d.y0)); }) .attr('fill', _chart.getColor) .call(renderTitle, d); dots.exit().remove(); }); } } _chart.label(function (d) { return dc.utils.printSingleValue(d.y0 + d.y); }, false); function drawLabels (layers) { layers.each(function (d, layerIndex) { var layer = d3.select(this); var labels = layer.selectAll('text.lineLabel') .data(d.values, dc.pluck('x')); labels.enter() .append('text') .attr('class', 'lineLabel') .attr('text-anchor', 'middle'); dc.transition(labels, _chart.transitionDuration()) .attr('x', function (d) { return dc.utils.safeNumber(_chart.x()(d.x)); }) .attr('y', function (d) { var y = _chart.y()(d.y + d.y0) - LABEL_PADDING; return dc.utils.safeNumber(y); }) .text(function (d) { return _chart.label()(d); }); dc.transition(labels.exit(), _chart.transitionDuration()) .attr('height', 0) .remove(); }); } function createRefLines (g) { var yRefLine = g.select('path.' + Y_AXIS_REF_LINE_CLASS).empty() ? g.append('path').attr('class', Y_AXIS_REF_LINE_CLASS) : g.select('path.' + Y_AXIS_REF_LINE_CLASS); yRefLine.style('display', 'none').attr('stroke-dasharray', '5,5'); var xRefLine = g.select('path.' + X_AXIS_REF_LINE_CLASS).empty() ? g.append('path').attr('class', X_AXIS_REF_LINE_CLASS) : g.select('path.' + X_AXIS_REF_LINE_CLASS); xRefLine.style('display', 'none').attr('stroke-dasharray', '5,5'); } function showDot (dot) { dot.style('fill-opacity', 0.8); dot.style('stroke-opacity', 0.8); dot.attr('r', _dotRadius); return dot; } function showRefLines (dot, g) { var x = dot.attr('cx'); var y = dot.attr('cy'); var yAxisX = (_chart._yAxisX() - _chart.margins().left); var yAxisRefPathD = 'M' + yAxisX + ' ' + y + 'L' + (x) + ' ' + (y); var xAxisRefPathD = 'M' + x + ' ' + _chart.yAxisHeight() + 'L' + x + ' ' + y; g.select('path.' + Y_AXIS_REF_LINE_CLASS).style('display', '').attr('d', yAxisRefPathD); g.select('path.' + X_AXIS_REF_LINE_CLASS).style('display', '').attr('d', xAxisRefPathD); } function getDotRadius () { return _dataPointRadius || _dotRadius; } function hideDot (dot) { dot.style('fill-opacity', _dataPointFillOpacity) .style('stroke-opacity', _dataPointStrokeOpacity) .attr('r', getDotRadius()); } function hideRefLines (g) { g.select('path.' + Y_AXIS_REF_LINE_CLASS).style('display', 'none'); g.select('path.' + X_AXIS_REF_LINE_CLASS).style('display', 'none'); } function renderTitle (dot, d) { if (_chart.renderTitle()) { dot.selectAll('title').remove(); dot.append('title').text(dc.pluck('data', _chart.title(d.name))); } } /** * Turn on/off the mouseover behavior of an individual data point which renders a circle and x/y axis * dashed lines back to each respective axis. This is ignored if the chart * {@link dc.coordinateGridMixin#brushOn brush} is on * @method xyTipsOn * @memberof dc.lineChart * @instance * @param {Boolean} [xyTipsOn=false] * @return {Boolean} * @return {dc.lineChart} */ _chart.xyTipsOn = function (xyTipsOn) { if (!arguments.length) { return _xyTipsOn; } _xyTipsOn = xyTipsOn; return _chart; }; /** * Get or set the radius (in px) for dots displayed on the data points. * @method dotRadius * @memberof dc.lineChart * @instance * @param {Number} [dotRadius=5] * @return {Number} * @return {dc.lineChart} */ _chart.dotRadius = function (dotRadius) { if (!arguments.length) { return _dotRadius; } _dotRadius = dotRadius; return _chart; }; /** * Always show individual dots for each datapoint. * If `options` is falsy, it disables data point rendering. * * If no `options` are provided, the current `options` values are instead returned. * @method renderDataPoints * @memberof dc.lineChart * @instance * @example * chart.renderDataPoints({radius: 2, fillOpacity: 0.8, strokeOpacity: 0.8}) * @param {{fillOpacity: Number, strokeOpacity: Number, radius: Number}} [options={fillOpacity: 0.8, strokeOpacity: 0.8, radius: 2}] * @return {{fillOpacity: Number, strokeOpacity: Number, radius: Number}} * @return {dc.lineChart} */ _chart.renderDataPoints = function (options) { if (!arguments.length) { return { fillOpacity: _dataPointFillOpacity, strokeOpacity: _dataPointStrokeOpacity, radius: _dataPointRadius }; } else if (!options) { _dataPointFillOpacity = DEFAULT_DOT_OPACITY; _dataPointStrokeOpacity = DEFAULT_DOT_OPACITY; _dataPointRadius = null; } else { _dataPointFillOpacity = options.fillOpacity || 0.8; _dataPointStrokeOpacity = options.strokeOpacity || 0.8; _dataPointRadius = options.radius || 2; } return _chart; }; function colorFilter (color, dashstyle, inv) { return function () { var item = d3.select(this); var match = (item.attr('stroke') === color && item.attr('stroke-dasharray') === ((dashstyle instanceof Array) ? dashstyle.join(',') : null)) || item.attr('fill') === color; return inv ? !match : match; }; } _chart.legendHighlight = function (d) { if (!_chart.isLegendableHidden(d)) { _chart.g().selectAll('path.line, path.area') .classed('highlight', colorFilter(d.color, d.dashstyle)) .classed('fadeout', colorFilter(d.color, d.dashstyle, true)); } }; _chart.legendReset = function () { _chart.g().selectAll('path.line, path.area') .classed('highlight', false) .classed('fadeout', false); }; dc.override(_chart, 'legendables', function () { var legendables = _chart._legendables(); if (!_dashStyle) { return legendables; } return legendables.map(function (l) { l.dashstyle = _dashStyle; return l; }); }); return _chart.anchor(parent, chartGroup); }; /** * The data count widget is a simple widget designed to display the number of records selected by the * current filters out of the total number of records in the data set. Once created the data count widget * will automatically update the text content of the following elements under the parent element. * * Note: this widget works best for the specific case of showing the number of records out of a * total. If you want a more general-purpose numeric display, please use the * {@link dc.numberDisplay} widget instead. * * '.total-count' - total number of records * '.filter-count' - number of records matched by the current filters * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * @class dataCount * @memberof dc * @mixes dc.baseMixin * @example * var ndx = crossfilter(data); * var all = ndx.groupAll(); * * dc.dataCount('.dc-data-count') * .dimension(ndx) * .group(all); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.dataCount} */ dc.dataCount = function (parent, chartGroup) { var _formatNumber = d3.format(',d'); var _chart = dc.baseMixin({}); var _html = {some: '', all: ''}; /** * Gets or sets an optional object specifying HTML templates to use depending how many items are * selected. The text `%total-count` will replaced with the total number of records, and the text * `%filter-count` will be replaced with the number of selected records. * - all: HTML template to use if all items are selected * - some: HTML template to use if not all items are selected * @method html * @memberof dc.dataCount * @instance * @example * counter.html({ * some: '%filter-count out of %total-count records selected', * all: 'All records selected. Click on charts to apply filters' * }) * @param {{some:String, all: String}} [options] * @return {{some:String, all: String}} * @return {dc.dataCount} */ _chart.html = function (options) { if (!arguments.length) { return _html; } if (options.all) { _html.all = options.all; } if (options.some) { _html.some = options.some; } return _chart; }; /** * Gets or sets an optional function to format the filter count and total count. * @method formatNumber * @memberof dc.dataCount * @instance * @see {@link https://github.com/mbostock/d3/wiki/Formatting d3.format} * @example * counter.formatNumber(d3.format('.2g')) * @param {Function} [formatter=d3.format('.2g')] * @return {Function} * @return {dc.dataCount} */ _chart.formatNumber = function (formatter) { if (!arguments.length) { return _formatNumber; } _formatNumber = formatter; return _chart; }; _chart._doRender = function () { var tot = _chart.dimension().size(), val = _chart.group().value(); var all = _formatNumber(tot); var selected = _formatNumber(val); if ((tot === val) && (_html.all !== '')) { _chart.root().html(_html.all.replace('%total-count', all).replace('%filter-count', selected)); } else if (_html.some !== '') { _chart.root().html(_html.some.replace('%total-count', all).replace('%filter-count', selected)); } else { _chart.selectAll('.total-count').text(all); _chart.selectAll('.filter-count').text(selected); } return _chart; }; _chart._doRedraw = function () { return _chart._doRender(); }; return _chart.anchor(parent, chartGroup); }; /** * The data table is a simple widget designed to list crossfilter focused data set (rows being * filtered) in a good old tabular fashion. * * Note: Unlike other charts, the data table (and data grid chart) use the group attribute as a * keying function for {@link https://github.com/mbostock/d3/wiki/Arrays#-nest nesting} the data * together in groups. Do not pass in a crossfilter group as this will not work. * * Another interesting feature of the data table is that you can pass a crossfilter group to the `dimension`, as * long as you specify the {@link dc.dataTable#order order} as `d3.descending`, since the data * table will use `dimension.top()` to fetch the data in that case, and the method is equally * supported on the crossfilter group as the crossfilter dimension. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * - {@link http://dc-js.github.io/dc.js/examples/table-on-aggregated-data.html dataTable on a crossfilter group} * ({@link https://github.com/dc-js/dc.js/blob/develop/web/examples/table-on-aggregated-data.html source}) * @class dataTable * @memberof dc * @mixes dc.baseMixin * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.dataTable} */ dc.dataTable = function (parent, chartGroup) { var LABEL_CSS_CLASS = 'dc-table-label'; var ROW_CSS_CLASS = 'dc-table-row'; var COLUMN_CSS_CLASS = 'dc-table-column'; var GROUP_CSS_CLASS = 'dc-table-group'; var HEAD_CSS_CLASS = 'dc-table-head'; var _chart = dc.baseMixin({}); var _size = 25; var _columns = []; var _sortBy = function (d) { return d; }; var _order = d3.ascending; var _beginSlice = 0; var _endSlice; var _showGroups = true; _chart._doRender = function () { _chart.selectAll('tbody').remove(); renderRows(renderGroups()); return _chart; }; _chart._doColumnValueFormat = function (v, d) { return ((typeof v === 'function') ? v(d) : // v as function ((typeof v === 'string') ? d[v] : // v is field name string v.format(d) // v is Object, use fn (element 2) ) ); }; _chart._doColumnHeaderFormat = function (d) { // if 'function', convert to string representation // show a string capitalized // if an object then display its label string as-is. return (typeof d === 'function') ? _chart._doColumnHeaderFnToString(d) : ((typeof d === 'string') ? _chart._doColumnHeaderCapitalize(d) : String(d.label)); }; _chart._doColumnHeaderCapitalize = function (s) { // capitalize return s.charAt(0).toUpperCase() + s.slice(1); }; _chart._doColumnHeaderFnToString = function (f) { // columnString(f) { var s = String(f); var i1 = s.indexOf('return '); if (i1 >= 0) { var i2 = s.lastIndexOf(';'); if (i2 >= 0) { s = s.substring(i1 + 7, i2); var i3 = s.indexOf('numberFormat'); if (i3 >= 0) { s = s.replace('numberFormat', ''); } } } return s; }; function renderGroups () { // The 'original' example uses all 'functions'. // If all 'functions' are used, then don't remove/add a header, and leave // the html alone. This preserves the functionality of earlier releases. // A 2nd option is a string representing a field in the data. // A third option is to supply an Object such as an array of 'information', and // supply your own _doColumnHeaderFormat and _doColumnValueFormat functions to // create what you need. var bAllFunctions = true; _columns.forEach(function (f) { bAllFunctions = bAllFunctions & (typeof f === 'function'); }); if (!bAllFunctions) { // ensure one thead var thead = _chart.selectAll('thead').data([0]); thead.enter().append('thead'); thead.exit().remove(); // with one tr var headrow = thead.selectAll('tr').data([0]); headrow.enter().append('tr'); headrow.exit().remove(); // with a th for each column var headcols = headrow.selectAll('th') .data(_columns); headcols.enter().append('th'); headcols.exit().remove(); headcols .attr('class', HEAD_CSS_CLASS) .html(function (d) { return (_chart._doColumnHeaderFormat(d)); }); } var groups = _chart.root().selectAll('tbody') .data(nestEntries(), function (d) { return _chart.keyAccessor()(d); }); var rowGroup = groups .enter() .append('tbody'); if (_showGroups === true) { rowGroup .append('tr') .attr('class', GROUP_CSS_CLASS) .append('td') .attr('class', LABEL_CSS_CLASS) .attr('colspan', _columns.length) .html(function (d) { return _chart.keyAccessor()(d); }); } groups.exit().remove(); return rowGroup; } function nestEntries () { var entries; if (_order === d3.ascending) { entries = _chart.dimension().bottom(_size); } else { entries = _chart.dimension().top(_size); } return d3.nest() .key(_chart.group()) .sortKeys(_order) .entries(entries.sort(function (a, b) { return _order(_sortBy(a), _sortBy(b)); }).slice(_beginSlice, _endSlice)); } function renderRows (groups) { var rows = groups.order() .selectAll('tr.' + ROW_CSS_CLASS) .data(function (d) { return d.values; }); var rowEnter = rows.enter() .append('tr') .attr('class', ROW_CSS_CLASS); _columns.forEach(function (v, i) { rowEnter.append('td') .attr('class', COLUMN_CSS_CLASS + ' _' + i) .html(function (d) { return _chart._doColumnValueFormat(v, d); }); }); rows.exit().remove(); return rows; } _chart._doRedraw = function () { return _chart._doRender(); }; /** * Get or set the table size which determines the number of rows displayed by the widget. * @method size * @memberof dc.dataTable * @instance * @param {Number} [size=25] * @return {Number} * @return {dc.dataTable} */ _chart.size = function (size) { if (!arguments.length) { return _size; } _size = size; return _chart; }; /** * Get or set the index of the beginning slice which determines which entries get displayed * by the widget. Useful when implementing pagination. * * Note: the sortBy function will determine how the rows are ordered for pagination purposes. * See the {@link http://dc-js.github.io/dc.js/examples/table-pagination.html table pagination example} * to see how to implement the pagination user interface using `beginSlice` and `endSlice`. * @method beginSlice * @memberof dc.dataTable * @instance * @param {Number} [beginSlice=0] * @return {Number} * @return {dc.dataTable} */ _chart.beginSlice = function (beginSlice) { if (!arguments.length) { return _beginSlice; } _beginSlice = beginSlice; return _chart; }; /** * Get or set the index of the end slice which determines which entries get displayed by the * widget. Useful when implementing pagination. See {@link dc.dataTable#beginSlice `beginSlice`} for more information. * @method endSlice * @memberof dc.dataTable * @instance * @param {Number|undefined} [endSlice=undefined] * @return {Number} * @return {dc.dataTable} */ _chart.endSlice = function (endSlice) { if (!arguments.length) { return _endSlice; } _endSlice = endSlice; return _chart; }; /** * Get or set column functions. The data table widget supports several methods of specifying the * columns to display. * * The original method uses an array of functions to generate dynamic columns. Column functions * are simple javascript functions with only one input argument `d` which represents a row in * the data set. The return value of these functions will be used to generate the content for * each cell. However, this method requires the HTML for the table to have a fixed set of column * headers. * * <pre><code>chart.columns([ * function(d) { return d.date; }, * function(d) { return d.open; }, * function(d) { return d.close; }, * function(d) { return numberFormat(d.close - d.open); }, * function(d) { return d.volume; } * ]); * </code></pre> * * In the second method, you can list the columns to read from the data without specifying it as * a function, except where necessary (ie, computed columns). Note the data element name is * capitalized when displayed in the table header. You can also mix in functions as necessary, * using the third `{label, format}` form, as shown below. * * <pre><code>chart.columns([ * "date", // d["date"], ie, a field accessor; capitalized automatically * "open", // ... * "close", // ... * { * label: "Change", * format: function (d) { * return numberFormat(d.close - d.open); * } * }, * "volume" // d["volume"], ie, a field accessor; capitalized automatically * ]); * </code></pre> * * In the third example, we specify all fields using the `{label, format}` method: * <pre><code>chart.columns([ * { * label: "Date", * format: function (d) { return d.date; } * }, * { * label: "Open", * format: function (d) { return numberFormat(d.open); } * }, * { * label: "Close", * format: function (d) { return numberFormat(d.close); } * }, * { * label: "Change", * format: function (d) { return numberFormat(d.close - d.open); } * }, * { * label: "Volume", * format: function (d) { return d.volume; } * } * ]); * </code></pre> * * You may wish to override the dataTable functions `_doColumnHeaderCapitalize` and * `_doColumnHeaderFnToString`, which are used internally to translate the column information or * function into a displayed header. The first one is used on the "string" column specifier; the * second is used to transform a stringified function into something displayable. For the Stock * example, the function for Change becomes the table header **d.close - d.open**. * * Finally, you can even specify a completely different form of column definition. To do this, * override `_chart._doColumnHeaderFormat` and `_chart._doColumnValueFormat` Be aware that * fields without numberFormat specification will be displayed just as they are stored in the * data, unformatted. * @method columns * @memberof dc.dataTable * @instance * @param {Array<Function>} [columns=[]] * @return {Array<Function>}} * @return {dc.dataTable} */ _chart.columns = function (columns) { if (!arguments.length) { return _columns; } _columns = columns; return _chart; }; /** * Get or set sort-by function. This function works as a value accessor at row level and returns a * particular field to be sorted by. Default value: identity function * @method sortBy * @memberof dc.dataTable * @instance * @example * chart.sortBy(function(d) { * return d.date; * }); * @param {Function} [sortBy] * @return {Function} * @return {dc.dataTable} */ _chart.sortBy = function (sortBy) { if (!arguments.length) { return _sortBy; } _sortBy = sortBy; return _chart; }; /** * Get or set sort order. If the order is `d3.ascending`, the data table will use * `dimension().bottom()` to fetch the data; otherwise it will use `dimension().top()` * @method order * @memberof dc.dataTable * @instance * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_ascending d3.ascending} * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_descending d3.descending} * @example * chart.order(d3.descending); * @param {Function} [order=d3.ascending] * @return {Function} * @return {dc.dataTable} */ _chart.order = function (order) { if (!arguments.length) { return _order; } _order = order; return _chart; }; /** * Get or set if group rows will be shown. * * The .group() getter-setter must be provided in either case. * @method showGroups * @memberof dc.dataTable * @instance * @example * chart * .group([value], [name]) * .showGroups(true|false); * @param {Boolean} [showGroups=true] * @return {Boolean} * @return {dc.dataTable} */ _chart.showGroups = function (showGroups) { if (!arguments.length) { return _showGroups; } _showGroups = showGroups; return _chart; }; return _chart.anchor(parent, chartGroup); }; /** * Data grid is a simple widget designed to list the filtered records, providing * a simple way to define how the items are displayed. * * Note: Unlike other charts, the data grid chart (and data table) use the group attribute as a keying function * for {@link https://github.com/mbostock/d3/wiki/Arrays#-nest nesting} the data together in groups. * Do not pass in a crossfilter group as this will not work. * * Examples: * - {@link http://europarl.me/dc.js/web/ep/index.html List of members of the european parliament} * @class dataGrid * @memberof dc * @mixes dc.baseMixin * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.dataGrid} */ dc.dataGrid = function (parent, chartGroup) { var LABEL_CSS_CLASS = 'dc-grid-label'; var ITEM_CSS_CLASS = 'dc-grid-item'; var GROUP_CSS_CLASS = 'dc-grid-group'; var GRID_CSS_CLASS = 'dc-grid-top'; var _chart = dc.baseMixin({}); var _size = 999; // shouldn't be needed, but you might var _html = function (d) { return 'you need to provide an html() handling param: ' + JSON.stringify(d); }; var _sortBy = function (d) { return d; }; var _order = d3.ascending; var _beginSlice = 0, _endSlice; var _htmlGroup = function (d) { return '<div class=\'' + GROUP_CSS_CLASS + '\'><h1 class=\'' + LABEL_CSS_CLASS + '\'>' + _chart.keyAccessor()(d) + '</h1></div>'; }; _chart._doRender = function () { _chart.selectAll('div.' + GRID_CSS_CLASS).remove(); renderItems(renderGroups()); return _chart; }; function renderGroups () { var groups = _chart.root().selectAll('div.' + GRID_CSS_CLASS) .data(nestEntries(), function (d) { return _chart.keyAccessor()(d); }); var itemGroup = groups .enter() .append('div') .attr('class', GRID_CSS_CLASS); if (_htmlGroup) { itemGroup .html(function (d) { return _htmlGroup(d); }); } groups.exit().remove(); return itemGroup; } function nestEntries () { var entries = _chart.dimension().top(_size); return d3.nest() .key(_chart.group()) .sortKeys(_order) .entries(entries.sort(function (a, b) { return _order(_sortBy(a), _sortBy(b)); }).slice(_beginSlice, _endSlice)); } function renderItems (groups) { var items = groups.order() .selectAll('div.' + ITEM_CSS_CLASS) .data(function (d) { return d.values; }); items.enter() .append('div') .attr('class', ITEM_CSS_CLASS) .html(function (d) { return _html(d); }); items.exit().remove(); return items; } _chart._doRedraw = function () { return _chart._doRender(); }; /** * Get or set the index of the beginning slice which determines which entries get displayed by the widget. * Useful when implementing pagination. * @method beginSlice * @memberof dc.dataGrid * @instance * @param {Number} [beginSlice=0] * @return {Number} * @return {dc.dataGrid} */ _chart.beginSlice = function (beginSlice) { if (!arguments.length) { return _beginSlice; } _beginSlice = beginSlice; return _chart; }; /** * Get or set the index of the end slice which determines which entries get displayed by the widget * Useful when implementing pagination. * @method endSlice * @memberof dc.dataGrid * @instance * @param {Number} [endSlice] * @return {Number} * @return {dc.dataGrid} */ _chart.endSlice = function (endSlice) { if (!arguments.length) { return _endSlice; } _endSlice = endSlice; return _chart; }; /** * Get or set the grid size which determines the number of items displayed by the widget. * @method size * @memberof dc.dataGrid * @instance * @param {Number} [size=999] * @return {Number} * @return {dc.dataGrid} */ _chart.size = function (size) { if (!arguments.length) { return _size; } _size = size; return _chart; }; /** * Get or set the function that formats an item. The data grid widget uses a * function to generate dynamic html. Use your favourite templating engine or * generate the string directly. * @method html * @memberof dc.dataGrid * @instance * @example * chart.html(function (d) { return '<div class='item '+data.exampleCategory+''>'+data.exampleString+'</div>';}); * @param {Function} [html] * @return {Function} * @return {dc.dataGrid} */ _chart.html = function (html) { if (!arguments.length) { return _html; } _html = html; return _chart; }; /** * Get or set the function that formats a group label. * @method htmlGroup * @memberof dc.dataGrid * @instance * @example * chart.htmlGroup (function (d) { return '<h2>'.d.key . 'with ' . d.values.length .' items</h2>'}); * @param {Function} [htmlGroup] * @return {Function} * @return {dc.dataGrid} */ _chart.htmlGroup = function (htmlGroup) { if (!arguments.length) { return _htmlGroup; } _htmlGroup = htmlGroup; return _chart; }; /** * Get or set sort-by function. This function works as a value accessor at the item * level and returns a particular field to be sorted. * @method sortBy * @memberof dc.dataGrid * @instance * @example * chart.sortBy(function(d) { * return d.date; * }); * @param {Function} [sortByFunction] * @return {Function} * @return {dc.dataGrid} */ _chart.sortBy = function (sortByFunction) { if (!arguments.length) { return _sortBy; } _sortBy = sortByFunction; return _chart; }; /** * Get or set sort order function. * @method order * @memberof dc.dataGrid * @instance * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_ascending d3.ascending} * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_descending d3.descending} * @example * chart.order(d3.descending); * @param {Function} [order=d3.ascending] * @return {Function} * @return {dc.dataGrid} */ _chart.order = function (order) { if (!arguments.length) { return _order; } _order = order; return _chart; }; return _chart.anchor(parent, chartGroup); }; /** * A concrete implementation of a general purpose bubble chart that allows data visualization using the * following dimensions: * - x axis position * - y axis position * - bubble radius * - color * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * - {@link http://dc-js.github.com/dc.js/vc/index.html US Venture Capital Landscape 2011} * @class bubbleChart * @memberof dc * @mixes dc.bubbleMixin * @mixes dc.coordinateGridMixin * @example * // create a bubble chart under #chart-container1 element using the default global chart group * var bubbleChart1 = dc.bubbleChart('#chart-container1'); * // create a bubble chart under #chart-container2 element using chart group A * var bubbleChart2 = dc.bubbleChart('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.bubbleChart} */ dc.bubbleChart = function (parent, chartGroup) { var _chart = dc.bubbleMixin(dc.coordinateGridMixin({})); var _elasticRadius = false; var _sortBubbleSize = false; _chart.transitionDuration(750); var bubbleLocator = function (d) { return 'translate(' + (bubbleX(d)) + ',' + (bubbleY(d)) + ')'; }; /** * Turn on or off the elastic bubble radius feature, or return the value of the flag. If this * feature is turned on, then bubble radii will be automatically rescaled to fit the chart better. * @method elasticRadius * @memberof dc.bubbleChart * @instance * @param {Boolean} [elasticRadius=false] * @return {Boolean} * @return {dc.bubbleChart} */ _chart.elasticRadius = function (elasticRadius) { if (!arguments.length) { return _elasticRadius; } _elasticRadius = elasticRadius; return _chart; }; /** * Turn on or off the bubble sorting feature, or return the value of the flag. If enabled, * bubbles will be sorted by their radius, with smaller bubbles in front. * @method sortBubbleSize * @memberof dc.bubbleChart * @instance * @param {Boolean} [sortBubbleSize=false] * @return {Boolean} * @return {dc.bubbleChart} */ _chart.sortBubbleSize = function (sortBubbleSize) { if (!arguments.length) { return _sortBubbleSize; } _sortBubbleSize = sortBubbleSize; return _chart; }; _chart.plotData = function () { if (_elasticRadius) { _chart.r().domain([_chart.rMin(), _chart.rMax()]); } _chart.r().range([_chart.MIN_RADIUS, _chart.xAxisLength() * _chart.maxBubbleRelativeSize()]); var data = _chart.data(); if (_sortBubbleSize) { // sort descending so smaller bubbles are on top var radiusAccessor = _chart.radiusValueAccessor(); data.sort(function (a, b) { return d3.descending(radiusAccessor(a), radiusAccessor(b)); }); } var bubbleG = _chart.chartBodyG().selectAll('g.' + _chart.BUBBLE_NODE_CLASS) .data(data, function (d) { return d.key; }); if (_sortBubbleSize) { // Call order here to update dom order based on sort bubbleG.order(); } renderNodes(bubbleG); updateNodes(bubbleG); removeNodes(bubbleG); _chart.fadeDeselectedArea(); }; function renderNodes (bubbleG) { var bubbleGEnter = bubbleG.enter().append('g'); bubbleGEnter .attr('class', _chart.BUBBLE_NODE_CLASS) .attr('transform', bubbleLocator) .append('circle').attr('class', function (d, i) { return _chart.BUBBLE_CLASS + ' _' + i; }) .on('click', _chart.onClick) .attr('fill', _chart.getColor) .attr('r', 0); dc.transition(bubbleG, _chart.transitionDuration()) .selectAll('circle.' + _chart.BUBBLE_CLASS) .attr('r', function (d) { return _chart.bubbleR(d); }) .attr('opacity', function (d) { return (_chart.bubbleR(d) > 0) ? 1 : 0; }); _chart._doRenderLabel(bubbleGEnter); _chart._doRenderTitles(bubbleGEnter); } function updateNodes (bubbleG) { dc.transition(bubbleG, _chart.transitionDuration()) .attr('transform', bubbleLocator) .selectAll('circle.' + _chart.BUBBLE_CLASS) .attr('fill', _chart.getColor) .attr('r', function (d) { return _chart.bubbleR(d); }) .attr('opacity', function (d) { return (_chart.bubbleR(d) > 0) ? 1 : 0; }); _chart.doUpdateLabels(bubbleG); _chart.doUpdateTitles(bubbleG); } function removeNodes (bubbleG) { bubbleG.exit().remove(); } function bubbleX (d) { var x = _chart.x()(_chart.keyAccessor()(d)); if (isNaN(x)) { x = 0; } return x; } function bubbleY (d) { var y = _chart.y()(_chart.valueAccessor()(d)); if (isNaN(y)) { y = 0; } return y; } _chart.renderBrush = function () { // override default x axis brush from parent chart }; _chart.redrawBrush = function () { // override default x axis brush from parent chart _chart.fadeDeselectedArea(); }; return _chart.anchor(parent, chartGroup); }; /** * Composite charts are a special kind of chart that render multiple charts on the same Coordinate * Grid. You can overlay (compose) different bar/line/area charts in a single composite chart to * achieve some quite flexible charting effects. * @class compositeChart * @memberof dc * @mixes dc.coordinateGridMixin * @example * // create a composite chart under #chart-container1 element using the default global chart group * var compositeChart1 = dc.compositeChart('#chart-container1'); * // create a composite chart under #chart-container2 element using chart group A * var compositeChart2 = dc.compositeChart('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.compositeChart} */ dc.compositeChart = function (parent, chartGroup) { var SUB_CHART_CLASS = 'sub'; var DEFAULT_RIGHT_Y_AXIS_LABEL_PADDING = 12; var _chart = dc.coordinateGridMixin({}); var _children = []; var _childOptions = {}; var _shareColors = false, _shareTitle = true, _alignYAxes = false; var _rightYAxis = d3.svg.axis(), _rightYAxisLabel = 0, _rightYAxisLabelPadding = DEFAULT_RIGHT_Y_AXIS_LABEL_PADDING, _rightY, _rightAxisGridLines = false; _chart._mandatoryAttributes([]); _chart.transitionDuration(500); dc.override(_chart, '_generateG', function () { var g = this.__generateG(); for (var i = 0; i < _children.length; ++i) { var child = _children[i]; generateChildG(child, i); if (!child.dimension()) { child.dimension(_chart.dimension()); } if (!child.group()) { child.group(_chart.group()); } child.chartGroup(_chart.chartGroup()); child.svg(_chart.svg()); child.xUnits(_chart.xUnits()); child.transitionDuration(_chart.transitionDuration()); child.brushOn(_chart.brushOn()); child.renderTitle(_chart.renderTitle()); child.elasticX(_chart.elasticX()); } return g; }); _chart._brushing = function () { var extent = _chart.extendBrush(); var brushIsEmpty = _chart.brushIsEmpty(extent); for (var i = 0; i < _children.length; ++i) { _children[i].replaceFilter(brushIsEmpty ? null : extent); } }; _chart._prepareYAxis = function () { var left = (leftYAxisChildren().length !== 0); var right = (rightYAxisChildren().length !== 0); var ranges = calculateYAxisRanges(left, right); if (left) { prepareLeftYAxis(ranges); } if (right) { prepareRightYAxis(ranges); } if (leftYAxisChildren().length > 0 && !_rightAxisGridLines) { _chart._renderHorizontalGridLinesForAxis(_chart.g(), _chart.y(), _chart.yAxis()); } else if (rightYAxisChildren().length > 0) { _chart._renderHorizontalGridLinesForAxis(_chart.g(), _rightY, _rightYAxis); } }; _chart.renderYAxis = function () { if (leftYAxisChildren().length !== 0) { _chart.renderYAxisAt('y', _chart.yAxis(), _chart.margins().left); _chart.renderYAxisLabel('y', _chart.yAxisLabel(), -90); } if (rightYAxisChildren().length !== 0) { _chart.renderYAxisAt('yr', _chart.rightYAxis(), _chart.width() - _chart.margins().right); _chart.renderYAxisLabel('yr', _chart.rightYAxisLabel(), 90, _chart.width() - _rightYAxisLabelPadding); } }; function calculateYAxisRanges (left, right) { var lyAxisMin, lyAxisMax, ryAxisMin, ryAxisMax; if (left) { lyAxisMin = yAxisMin(); lyAxisMax = yAxisMax(); } if (right) { ryAxisMin = rightYAxisMin(); ryAxisMax = rightYAxisMax(); } if (_chart.alignYAxes() && left && right && (lyAxisMin < 0 || ryAxisMin < 0)) { // both y axis are linear and at least one doesn't start at zero var leftYRatio, rightYRatio; if (lyAxisMin < 0) { leftYRatio = lyAxisMax / lyAxisMin; } if (ryAxisMin < 0) { rightYRatio = ryAxisMax / ryAxisMin; } if (lyAxisMin < 0 && ryAxisMin < 0) { if (leftYRatio < rightYRatio) { ryAxisMax = ryAxisMin * leftYRatio; } else { lyAxisMax = lyAxisMin * rightYRatio; } } else if (lyAxisMin < 0) { ryAxisMin = ryAxisMax / leftYRatio; } else { lyAxisMin = lyAxisMax / (ryAxisMax / ryAxisMin); } } return { lyAxisMin: lyAxisMin, lyAxisMax: lyAxisMax, ryAxisMin: ryAxisMin, ryAxisMax: ryAxisMax }; } function prepareRightYAxis (ranges) { var needDomain = _chart.rightY() === undefined || _chart.elasticY(), needRange = needDomain || _chart.resizing(); if (_chart.rightY() === undefined) { _chart.rightY(d3.scale.linear()); } if (needDomain) { _chart.rightY().domain([ranges.ryAxisMin, ranges.ryAxisMax]); } if (needRange) { _chart.rightY().rangeRound([_chart.yAxisHeight(), 0]); } _chart.rightY().range([_chart.yAxisHeight(), 0]); _chart.rightYAxis(_chart.rightYAxis().scale(_chart.rightY())); _chart.rightYAxis().orient('right'); } function prepareLeftYAxis (ranges) { var needDomain = _chart.y() === undefined || _chart.elasticY(), needRange = needDomain || _chart.resizing(); if (_chart.y() === undefined) { _chart.y(d3.scale.linear()); } if (needDomain) { _chart.y().domain([ranges.lyAxisMin, ranges.lyAxisMax]); } if (needRange) { _chart.y().rangeRound([_chart.yAxisHeight(), 0]); } _chart.y().range([_chart.yAxisHeight(), 0]); _chart.yAxis(_chart.yAxis().scale(_chart.y())); _chart.yAxis().orient('left'); } function generateChildG (child, i) { child._generateG(_chart.g()); child.g().attr('class', SUB_CHART_CLASS + ' _' + i); } _chart.plotData = function () { for (var i = 0; i < _children.length; ++i) { var child = _children[i]; if (!child.g()) { generateChildG(child, i); } if (_shareColors) { child.colors(_chart.colors()); } child.x(_chart.x()); child.xAxis(_chart.xAxis()); if (child.useRightYAxis()) { child.y(_chart.rightY()); child.yAxis(_chart.rightYAxis()); } else { child.y(_chart.y()); child.yAxis(_chart.yAxis()); } child.plotData(); child._activateRenderlets(); } }; /** * Get or set whether to draw gridlines from the right y axis. Drawing from the left y axis is the * default behavior. This option is only respected when subcharts with both left and right y-axes * are present. * @method useRightAxisGridLines * @memberof dc.compositeChart * @instance * @param {Boolean} [useRightAxisGridLines=false] * @return {Boolean} * @return {dc.compositeChart} */ _chart.useRightAxisGridLines = function (useRightAxisGridLines) { if (!arguments) { return _rightAxisGridLines; } _rightAxisGridLines = useRightAxisGridLines; return _chart; }; /** * Get or set chart-specific options for all child charts. This is equivalent to calling * {@link dc.baseMixin#options .options} on each child chart. * @method childOptions * @memberof dc.compositeChart * @instance * @param {Object} [childOptions] * @return {Object} * @return {dc.compositeChart} */ _chart.childOptions = function (childOptions) { if (!arguments.length) { return _childOptions; } _childOptions = childOptions; _children.forEach(function (child) { child.options(_childOptions); }); return _chart; }; _chart.fadeDeselectedArea = function () { for (var i = 0; i < _children.length; ++i) { var child = _children[i]; child.brush(_chart.brush()); child.fadeDeselectedArea(); } }; /** * Set or get the right y axis label. * @method rightYAxisLabel * @memberof dc.compositeChart * @instance * @param {String} [rightYAxisLabel] * @param {Number} [padding] * @return {String} * @return {dc.compositeChart} */ _chart.rightYAxisLabel = function (rightYAxisLabel, padding) { if (!arguments.length) { return _rightYAxisLabel; } _rightYAxisLabel = rightYAxisLabel; _chart.margins().right -= _rightYAxisLabelPadding; _rightYAxisLabelPadding = (padding === undefined) ? DEFAULT_RIGHT_Y_AXIS_LABEL_PADDING : padding; _chart.margins().right += _rightYAxisLabelPadding; return _chart; }; /** * Combine the given charts into one single composite coordinate grid chart. * @method compose * @memberof dc.compositeChart * @instance * @example * moveChart.compose([ * // when creating sub-chart you need to pass in the parent chart * dc.lineChart(moveChart) * .group(indexAvgByMonthGroup) // if group is missing then parent's group will be used * .valueAccessor(function (d){return d.value.avg;}) * // most of the normal functions will continue to work in a composed chart * .renderArea(true) * .stack(monthlyMoveGroup, function (d){return d.value;}) * .title(function (d){ * var value = d.value.avg?d.value.avg:d.value; * if(isNaN(value)) value = 0; * return dateFormat(d.key) + '\n' + numberFormat(value); * }), * dc.barChart(moveChart) * .group(volumeByMonthGroup) * .centerBar(true) * ]); * @param {Array<Chart>} [subChartArray] * @return {dc.compositeChart} */ _chart.compose = function (subChartArray) { _children = subChartArray; _children.forEach(function (child) { child.height(_chart.height()); child.width(_chart.width()); child.margins(_chart.margins()); if (_shareTitle) { child.title(_chart.title()); } child.options(_childOptions); }); return _chart; }; /** * Returns the child charts which are composed into the composite chart. * @method children * @memberof dc.compositeChart * @instance * @return {Array<dc.baseMixin>} */ _chart.children = function () { return _children; }; /** * Get or set color sharing for the chart. If set, the {@link dc.colorMixin#colors .colors()} value from this chart * will be shared with composed children. Additionally if the child chart implements * Stackable and has not set a custom .colorAccessor, then it will generate a color * specific to its order in the composition. * @method shareColors * @memberof dc.compositeChart * @instance * @param {Boolean} [shareColors=false] * @return {Boolean} * @return {dc.compositeChart} */ _chart.shareColors = function (shareColors) { if (!arguments.length) { return _shareColors; } _shareColors = shareColors; return _chart; }; /** * Get or set title sharing for the chart. If set, the {@link dc.baseMixin#title .title()} value from * this chart will be shared with composed children. * @method shareTitle * @memberof dc.compositeChart * @instance * @param {Boolean} [shareTitle=true] * @return {Boolean} * @return {dc.compositeChart} */ _chart.shareTitle = function (shareTitle) { if (!arguments.length) { return _shareTitle; } _shareTitle = shareTitle; return _chart; }; /** * Get or set the y scale for the right axis. The right y scale is typically automatically * generated by the chart implementation. * @method rightY * @memberof dc.compositeChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Scales d3.scale} * @param {d3.scale} [yScale] * @return {d3.scale} * @return {dc.compositeChart} */ _chart.rightY = function (yScale) { if (!arguments.length) { return _rightY; } _rightY = yScale; _chart.rescale(); return _chart; }; /** * Get or set alignment between left and right y axes. A line connecting '0' on both y axis * will be parallel to x axis. * @method alignYAxes * @memberof dc.compositeChart * @instance * @param {Boolean} [alignYAxes=false] * @return {Chart} */ _chart.alignYAxes = function (alignYAxes) { if (!arguments.length) { return _alignYAxes; } _alignYAxes = alignYAxes; _chart.rescale(); return _chart; }; function leftYAxisChildren () { return _children.filter(function (child) { return !child.useRightYAxis(); }); } function rightYAxisChildren () { return _children.filter(function (child) { return child.useRightYAxis(); }); } function getYAxisMin (charts) { return charts.map(function (c) { return c.yAxisMin(); }); } delete _chart.yAxisMin; function yAxisMin () { return d3.min(getYAxisMin(leftYAxisChildren())); } function rightYAxisMin () { return d3.min(getYAxisMin(rightYAxisChildren())); } function getYAxisMax (charts) { return charts.map(function (c) { return c.yAxisMax(); }); } delete _chart.yAxisMax; function yAxisMax () { return dc.utils.add(d3.max(getYAxisMax(leftYAxisChildren())), _chart.yAxisPadding()); } function rightYAxisMax () { return dc.utils.add(d3.max(getYAxisMax(rightYAxisChildren())), _chart.yAxisPadding()); } function getAllXAxisMinFromChildCharts () { return _children.map(function (c) { return c.xAxisMin(); }); } dc.override(_chart, 'xAxisMin', function () { return dc.utils.subtract(d3.min(getAllXAxisMinFromChildCharts()), _chart.xAxisPadding()); }); function getAllXAxisMaxFromChildCharts () { return _children.map(function (c) { return c.xAxisMax(); }); } dc.override(_chart, 'xAxisMax', function () { return dc.utils.add(d3.max(getAllXAxisMaxFromChildCharts()), _chart.xAxisPadding()); }); _chart.legendables = function () { return _children.reduce(function (items, child) { if (_shareColors) { child.colors(_chart.colors()); } items.push.apply(items, child.legendables()); return items; }, []); }; _chart.legendHighlight = function (d) { for (var j = 0; j < _children.length; ++j) { var child = _children[j]; child.legendHighlight(d); } }; _chart.legendReset = function (d) { for (var j = 0; j < _children.length; ++j) { var child = _children[j]; child.legendReset(d); } }; _chart.legendToggle = function () { console.log('composite should not be getting legendToggle itself'); }; /** * Set or get the right y axis used by the composite chart. This function is most useful when y * axis customization is required. The y axis in dc.js is an instance of a [d3 axis * object](https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-_axis) therefore it supports any valid * d3 axis manipulation. **Caution**: The y axis is usually generated internally by dc; * resetting it may cause unexpected results. * @method rightYAxis * @memberof dc.compositeChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Axes d3.svg.axis} * @example * // customize y axis tick format * chart.rightYAxis().tickFormat(function (v) {return v + '%';}); * // customize y axis tick values * chart.rightYAxis().tickValues([0, 100, 200, 300]); * @param {d3.svg.axis} [rightYAxis] * @return {d3.svg.axis} * @return {dc.compositeChart} */ _chart.rightYAxis = function (rightYAxis) { if (!arguments.length) { return _rightYAxis; } _rightYAxis = rightYAxis; return _chart; }; return _chart.anchor(parent, chartGroup); }; /** * A series chart is a chart that shows multiple series of data overlaid on one chart, where the * series is specified in the data. It is a specialization of Composite Chart and inherits all * composite features other than recomposing the chart. * * Examples: * - {@link http://dc-js.github.io/dc.js/examples/series.html Series Chart} * @class seriesChart * @memberof dc * @mixes dc.compositeChart * @example * // create a series chart under #chart-container1 element using the default global chart group * var seriesChart1 = dc.seriesChart("#chart-container1"); * // create a series chart under #chart-container2 element using chart group A * var seriesChart2 = dc.seriesChart("#chart-container2", "chartGroupA"); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.seriesChart} */ dc.seriesChart = function (parent, chartGroup) { var _chart = dc.compositeChart(parent, chartGroup); function keySort (a, b) { return d3.ascending(_chart.keyAccessor()(a), _chart.keyAccessor()(b)); } var _charts = {}; var _chartFunction = dc.lineChart; var _seriesAccessor; var _seriesSort = d3.ascending; var _valueSort = keySort; _chart._mandatoryAttributes().push('seriesAccessor', 'chart'); _chart.shareColors(true); _chart._preprocessData = function () { var keep = []; var childrenChanged; var nester = d3.nest().key(_seriesAccessor); if (_seriesSort) { nester.sortKeys(_seriesSort); } if (_valueSort) { nester.sortValues(_valueSort); } var nesting = nester.entries(_chart.data()); var children = nesting.map(function (sub, i) { var subChart = _charts[sub.key] || _chartFunction.call(_chart, _chart, chartGroup, sub.key, i); if (!_charts[sub.key]) { childrenChanged = true; } _charts[sub.key] = subChart; keep.push(sub.key); return subChart .dimension(_chart.dimension()) .group({all: d3.functor(sub.values)}, sub.key) .keyAccessor(_chart.keyAccessor()) .valueAccessor(_chart.valueAccessor()) .brushOn(_chart.brushOn()); }); // this works around the fact compositeChart doesn't really // have a removal interface Object.keys(_charts) .filter(function (c) {return keep.indexOf(c) === -1;}) .forEach(function (c) { clearChart(c); childrenChanged = true; }); _chart._compose(children); if (childrenChanged && _chart.legend()) { _chart.legend().render(); } }; function clearChart (c) { if (_charts[c].g()) { _charts[c].g().remove(); } delete _charts[c]; } function resetChildren () { Object.keys(_charts).map(clearChart); _charts = {}; } /** * Get or set the chart function, which generates the child charts. * @method chart * @memberof dc.seriesChart * @instance * @example * // put interpolation on the line charts used for the series * chart.chart(function(c) { return dc.lineChart(c).interpolate('basis'); }) * // do a scatter series chart * chart.chart(dc.scatterPlot) * @param {Function} [chartFunction=dc.lineChart] * @return {Function} * @return {dc.seriesChart} */ _chart.chart = function (chartFunction) { if (!arguments.length) { return _chartFunction; } _chartFunction = chartFunction; resetChildren(); return _chart; }; /** * **mandatory** * * Get or set accessor function for the displayed series. Given a datum, this function * should return the series that datum belongs to. * @method seriesAccessor * @memberof dc.seriesChart * @instance * @example * // simple series accessor * chart.seriesAccessor(function(d) { return "Expt: " + d.key[0]; }) * @param {Function} [accessor] * @return {Function} * @return {dc.seriesChart} */ _chart.seriesAccessor = function (accessor) { if (!arguments.length) { return _seriesAccessor; } _seriesAccessor = accessor; resetChildren(); return _chart; }; /** * Get or set a function to sort the list of series by, given series values. * @method seriesSort * @memberof dc.seriesChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_ascending d3.ascending} * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_descending d3.descending} * @example * chart.seriesSort(d3.descending); * @param {Function} [sortFunction=d3.ascending] * @return {Function} * @return {dc.seriesChart} */ _chart.seriesSort = function (sortFunction) { if (!arguments.length) { return _seriesSort; } _seriesSort = sortFunction; resetChildren(); return _chart; }; /** * Get or set a function to sort each series values by. By default this is the key accessor which, * for example, will ensure a lineChart series connects its points in increasing key/x order, * rather than haphazardly. * @method valueSort * @memberof dc.seriesChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_ascending d3.ascending} * @see {@link https://github.com/mbostock/d3/wiki/Arrays#d3_descending d3.descending} * @example * // Default value sort * _chart.valueSort(function keySort (a, b) { * return d3.ascending(_chart.keyAccessor()(a), _chart.keyAccessor()(b)); * }); * @param {Function} [sortFunction] * @return {Function} * @return {dc.seriesChart} */ _chart.valueSort = function (sortFunction) { if (!arguments.length) { return _valueSort; } _valueSort = sortFunction; resetChildren(); return _chart; }; // make compose private _chart._compose = _chart.compose; delete _chart.compose; return _chart; }; /** * The geo choropleth chart is designed as an easy way to create a crossfilter driven choropleth map * from GeoJson data. This chart implementation was inspired by * {@link http://bl.ocks.org/4060606 the great d3 choropleth example}. * * Examples: * - {@link http://dc-js.github.com/dc.js/vc/index.html US Venture Capital Landscape 2011} * @class geoChoroplethChart * @memberof dc * @mixes dc.colorMixin * @mixes dc.baseMixin * @example * // create a choropleth chart under '#us-chart' element using the default global chart group * var chart1 = dc.geoChoroplethChart('#us-chart'); * // create a choropleth chart under '#us-chart2' element using chart group A * var chart2 = dc.compositeChart('#us-chart2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.geoChoroplethChart} */ dc.geoChoroplethChart = function (parent, chartGroup) { var _chart = dc.colorMixin(dc.baseMixin({})); _chart.colorAccessor(function (d) { return d || 0; }); var _geoPath = d3.geo.path(); var _projectionFlag; var _geoJsons = []; _chart._doRender = function () { _chart.resetSvg(); for (var layerIndex = 0; layerIndex < _geoJsons.length; ++layerIndex) { var states = _chart.svg().append('g') .attr('class', 'layer' + layerIndex); var regionG = states.selectAll('g.' + geoJson(layerIndex).name) .data(geoJson(layerIndex).data) .enter() .append('g') .attr('class', geoJson(layerIndex).name); regionG .append('path') .attr('fill', 'white') .attr('d', _geoPath); regionG.append('title'); plotData(layerIndex); } _projectionFlag = false; }; function plotData (layerIndex) { var data = generateLayeredData(); if (isDataLayer(layerIndex)) { var regionG = renderRegionG(layerIndex); renderPaths(regionG, layerIndex, data); renderTitle(regionG, layerIndex, data); } } function generateLayeredData () { var data = {}; var groupAll = _chart.data(); for (var i = 0; i < groupAll.length; ++i) { data[_chart.keyAccessor()(groupAll[i])] = _chart.valueAccessor()(groupAll[i]); } return data; } function isDataLayer (layerIndex) { return geoJson(layerIndex).keyAccessor; } function renderRegionG (layerIndex) { var regionG = _chart.svg() .selectAll(layerSelector(layerIndex)) .classed('selected', function (d) { return isSelected(layerIndex, d); }) .classed('deselected', function (d) { return isDeselected(layerIndex, d); }) .attr('class', function (d) { var layerNameClass = geoJson(layerIndex).name; var regionClass = dc.utils.nameToId(geoJson(layerIndex).keyAccessor(d)); var baseClasses = layerNameClass + ' ' + regionClass; if (isSelected(layerIndex, d)) { baseClasses += ' selected'; } if (isDeselected(layerIndex, d)) { baseClasses += ' deselected'; } return baseClasses; }); return regionG; } function layerSelector (layerIndex) { return 'g.layer' + layerIndex + ' g.' + geoJson(layerIndex).name; } function isSelected (layerIndex, d) { return _chart.hasFilter() && _chart.hasFilter(getKey(layerIndex, d)); } function isDeselected (layerIndex, d) { return _chart.hasFilter() && !_chart.hasFilter(getKey(layerIndex, d)); } function getKey (layerIndex, d) { return geoJson(layerIndex).keyAccessor(d); } function geoJson (index) { return _geoJsons[index]; } function renderPaths (regionG, layerIndex, data) { var paths = regionG .select('path') .attr('fill', function () { var currentFill = d3.select(this).attr('fill'); if (currentFill) { return currentFill; } return 'none'; }) .on('click', function (d) { return _chart.onClick(d, layerIndex); }); dc.transition(paths, _chart.transitionDuration()).attr('fill', function (d, i) { return _chart.getColor(data[geoJson(layerIndex).keyAccessor(d)], i); }); } _chart.onClick = function (d, layerIndex) { var selectedRegion = geoJson(layerIndex).keyAccessor(d); dc.events.trigger(function () { _chart.filter(selectedRegion); _chart.redrawGroup(); }); }; function renderTitle (regionG, layerIndex, data) { if (_chart.renderTitle()) { regionG.selectAll('title').text(function (d) { var key = getKey(layerIndex, d); var value = data[key]; return _chart.title()({key: key, value: value}); }); } } _chart._doRedraw = function () { for (var layerIndex = 0; layerIndex < _geoJsons.length; ++layerIndex) { plotData(layerIndex); if (_projectionFlag) { _chart.svg().selectAll('g.' + geoJson(layerIndex).name + ' path').attr('d', _geoPath); } } _projectionFlag = false; }; /** * **mandatory** * * Use this function to insert a new GeoJson map layer. This function can be invoked multiple times * if you have multiple GeoJson data layers to render on top of each other. If you overlay multiple * layers with the same name the new overlay will override the existing one. * @method overlayGeoJson * @memberof dc.geoChoroplethChart * @instance * @see {@link http://geojson.org/ GeoJSON} * @see {@link https://github.com/mbostock/topojson/wiki TopoJSON} * @see {@link https://github.com/mbostock/topojson/wiki/API-Reference#feature topojson.feature} * @example * // insert a layer for rendering US states * chart.overlayGeoJson(statesJson.features, 'state', function(d) { * return d.properties.name; * }); * @param {geoJson} json - a geojson feed * @param {String} name - name of the layer * @param {Function} keyAccessor - accessor function used to extract 'key' from the GeoJson data. The key extracted by * this function should match the keys returned by the crossfilter groups. * @return {dc.geoChoroplethChart} */ _chart.overlayGeoJson = function (json, name, keyAccessor) { for (var i = 0; i < _geoJsons.length; ++i) { if (_geoJsons[i].name === name) { _geoJsons[i].data = json; _geoJsons[i].keyAccessor = keyAccessor; return _chart; } } _geoJsons.push({name: name, data: json, keyAccessor: keyAccessor}); return _chart; }; /** * Set custom geo projection function. See the available [d3 geo projection * functions](https://github.com/mbostock/d3/wiki/Geo-Projections). * @method projection * @memberof dc.geoChoroplethChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Geo-Projections d3.geo.projection} * @see {@link https://github.com/d3/d3-geo-projection Extended d3.geo.projection} * @param {d3.projection} [projection=d3.geo.albersUsa()] * @return {dc.geoChoroplethChart} */ _chart.projection = function (projection) { _geoPath.projection(projection); _projectionFlag = true; return _chart; }; /** * Returns all GeoJson layers currently registered with this chart. The returned array is a * reference to this chart's internal data structure, so any modification to this array will also * modify this chart's internal registration. * @method geoJsons * @memberof dc.geoChoroplethChart * @instance * @return {Array<{name:String, data: Object, accessor: Function}>} */ _chart.geoJsons = function () { return _geoJsons; }; /** * Returns the {@link https://github.com/mbostock/d3/wiki/Geo-Paths#path d3.geo.path} object used to * render the projection and features. Can be useful for figuring out the bounding box of the * feature set and thus a way to calculate scale and translation for the projection. * @method geoPath * @memberof dc.geoChoroplethChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Geo-Paths#path d3.geo.path} * @return {d3.geo.path} */ _chart.geoPath = function () { return _geoPath; }; /** * Remove a GeoJson layer from this chart by name * @method removeGeoJson * @memberof dc.geoChoroplethChart * @instance * @param {String} name * @return {dc.geoChoroplethChart} */ _chart.removeGeoJson = function (name) { var geoJsons = []; for (var i = 0; i < _geoJsons.length; ++i) { var layer = _geoJsons[i]; if (layer.name !== name) { geoJsons.push(layer); } } _geoJsons = geoJsons; return _chart; }; return _chart.anchor(parent, chartGroup); }; /** * The bubble overlay chart is quite different from the typical bubble chart. With the bubble overlay * chart you can arbitrarily place bubbles on an existing svg or bitmap image, thus changing the * typical x and y positioning while retaining the capability to visualize data using bubble radius * and coloring. * * Examples: * - {@link http://dc-js.github.com/dc.js/crime/index.html Canadian City Crime Stats} * @class bubbleOverlay * @memberof dc * @mixes dc.bubbleMixin * @mixes dc.baseMixin * @example * // create a bubble overlay chart on top of the '#chart-container1 svg' element using the default global chart group * var bubbleChart1 = dc.bubbleOverlayChart('#chart-container1').svg(d3.select('#chart-container1 svg')); * // create a bubble overlay chart on top of the '#chart-container2 svg' element using chart group A * var bubbleChart2 = dc.compositeChart('#chart-container2', 'chartGroupA').svg(d3.select('#chart-container2 svg')); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.bubbleOverlay} */ dc.bubbleOverlay = function (parent, chartGroup) { var BUBBLE_OVERLAY_CLASS = 'bubble-overlay'; var BUBBLE_NODE_CLASS = 'node'; var BUBBLE_CLASS = 'bubble'; /** * **mandatory** * * Set the underlying svg image element. Unlike other dc charts this chart will not generate a svg * element; therefore the bubble overlay chart will not work if this function is not invoked. If the * underlying image is a bitmap, then an empty svg will need to be created on top of the image. * @method svg * @memberof dc.bubbleOverlay * @instance * @example * // set up underlying svg element * chart.svg(d3.select('#chart svg')); * @param {SVGElement|d3.selection} [imageElement] * @return {dc.bubbleOverlay} */ var _chart = dc.bubbleMixin(dc.baseMixin({})); var _g; var _points = []; _chart.transitionDuration(750); _chart.radiusValueAccessor(function (d) { return d.value; }); /** * **mandatory** * * Set up a data point on the overlay. The name of a data point should match a specific 'key' among * data groups generated using keyAccessor. If a match is found (point name <-> data group key) * then a bubble will be generated at the position specified by the function. x and y * value specified here are relative to the underlying svg. * @method point * @memberof dc.bubbleOverlay * @instance * @param {String} name * @param {Number} x * @param {Number} y * @return {dc.bubbleOverlay} */ _chart.point = function (name, x, y) { _points.push({name: name, x: x, y: y}); return _chart; }; _chart._doRender = function () { _g = initOverlayG(); _chart.r().range([_chart.MIN_RADIUS, _chart.width() * _chart.maxBubbleRelativeSize()]); initializeBubbles(); _chart.fadeDeselectedArea(); return _chart; }; function initOverlayG () { _g = _chart.select('g.' + BUBBLE_OVERLAY_CLASS); if (_g.empty()) { _g = _chart.svg().append('g').attr('class', BUBBLE_OVERLAY_CLASS); } return _g; } function initializeBubbles () { var data = mapData(); _points.forEach(function (point) { var nodeG = getNodeG(point, data); var circle = nodeG.select('circle.' + BUBBLE_CLASS); if (circle.empty()) { circle = nodeG.append('circle') .attr('class', BUBBLE_CLASS) .attr('r', 0) .attr('fill', _chart.getColor) .on('click', _chart.onClick); } dc.transition(circle, _chart.transitionDuration()) .attr('r', function (d) { return _chart.bubbleR(d); }); _chart._doRenderLabel(nodeG); _chart._doRenderTitles(nodeG); }); } function mapData () { var data = {}; _chart.data().forEach(function (datum) { data[_chart.keyAccessor()(datum)] = datum; }); return data; } function getNodeG (point, data) { var bubbleNodeClass = BUBBLE_NODE_CLASS + ' ' + dc.utils.nameToId(point.name); var nodeG = _g.select('g.' + dc.utils.nameToId(point.name)); if (nodeG.empty()) { nodeG = _g.append('g') .attr('class', bubbleNodeClass) .attr('transform', 'translate(' + point.x + ',' + point.y + ')'); } nodeG.datum(data[point.name]); return nodeG; } _chart._doRedraw = function () { updateBubbles(); _chart.fadeDeselectedArea(); return _chart; }; function updateBubbles () { var data = mapData(); _points.forEach(function (point) { var nodeG = getNodeG(point, data); var circle = nodeG.select('circle.' + BUBBLE_CLASS); dc.transition(circle, _chart.transitionDuration()) .attr('r', function (d) { return _chart.bubbleR(d); }) .attr('fill', _chart.getColor); _chart.doUpdateLabels(nodeG); _chart.doUpdateTitles(nodeG); }); } _chart.debug = function (flag) { if (flag) { var debugG = _chart.select('g.' + dc.constants.DEBUG_GROUP_CLASS); if (debugG.empty()) { debugG = _chart.svg() .append('g') .attr('class', dc.constants.DEBUG_GROUP_CLASS); } var debugText = debugG.append('text') .attr('x', 10) .attr('y', 20); debugG .append('rect') .attr('width', _chart.width()) .attr('height', _chart.height()) .on('mousemove', function () { var position = d3.mouse(debugG.node()); var msg = position[0] + ', ' + position[1]; debugText.text(msg); }); } else { _chart.selectAll('.debug').remove(); } return _chart; }; _chart.anchor(parent, chartGroup); return _chart; }; /** * Concrete row chart implementation. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * @class rowChart * @memberof dc * @mixes dc.capMixin * @mixes dc.marginMixin * @mixes dc.colorMixin * @mixes dc.baseMixin * @example * // create a row chart under #chart-container1 element using the default global chart group * var chart1 = dc.rowChart('#chart-container1'); * // create a row chart under #chart-container2 element using chart group A * var chart2 = dc.rowChart('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.rowChart} */ dc.rowChart = function (parent, chartGroup) { var _g; var _labelOffsetX = 10; var _labelOffsetY = 15; var _hasLabelOffsetY = false; var _dyOffset = '0.35em'; // this helps center labels https://github.com/mbostock/d3/wiki/SVG-Shapes#svg_text var _titleLabelOffsetX = 2; var _gap = 5; var _fixedBarHeight = false; var _rowCssClass = 'row'; var _titleRowCssClass = 'titlerow'; var _renderTitleLabel = false; var _chart = dc.capMixin(dc.marginMixin(dc.colorMixin(dc.baseMixin({})))); var _x; var _elasticX; var _xAxis = d3.svg.axis().orient('bottom'); var _rowData; _chart.rowsCap = _chart.cap; function calculateAxisScale () { if (!_x || _elasticX) { var extent = d3.extent(_rowData, _chart.cappedValueAccessor); if (extent[0] > 0) { extent[0] = 0; } _x = d3.scale.linear().domain(extent) .range([0, _chart.effectiveWidth()]); } _xAxis.scale(_x); } function drawAxis () { var axisG = _g.select('g.axis'); calculateAxisScale(); if (axisG.empty()) { axisG = _g.append('g').attr('class', 'axis'); } axisG.attr('transform', 'translate(0, ' + _chart.effectiveHeight() + ')'); dc.transition(axisG, _chart.transitionDuration()) .call(_xAxis); } _chart._doRender = function () { _chart.resetSvg(); _g = _chart.svg() .append('g') .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart.margins().top + ')'); drawChart(); return _chart; }; _chart.title(function (d) { return _chart.cappedKeyAccessor(d) + ': ' + _chart.cappedValueAccessor(d); }); _chart.label(_chart.cappedKeyAccessor); /** * Gets or sets the x scale. The x scale can be any d3 * {@link https://github.com/mbostock/d3/wiki/Quantitative-Scales quantitive scale} * @method x * @memberof dc.rowChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/Quantitative-Scales quantitive scale} * @param {d3.scale} [scale] * @return {d3.scale} * @return {dc.rowChart} */ _chart.x = function (scale) { if (!arguments.length) { return _x; } _x = scale; return _chart; }; function drawGridLines () { _g.selectAll('g.tick') .select('line.grid-line') .remove(); _g.selectAll('g.tick') .append('line') .attr('class', 'grid-line') .attr('x1', 0) .attr('y1', 0) .attr('x2', 0) .attr('y2', function () { return -_chart.effectiveHeight(); }); } function drawChart () { _rowData = _chart.data(); drawAxis(); drawGridLines(); var rows = _g.selectAll('g.' + _rowCssClass) .data(_rowData); createElements(rows); removeElements(rows); updateElements(rows); } function createElements (rows) { var rowEnter = rows.enter() .append('g') .attr('class', function (d, i) { return _rowCssClass + ' _' + i; }); rowEnter.append('rect').attr('width', 0); createLabels(rowEnter); updateLabels(rows); } function removeElements (rows) { rows.exit().remove(); } function rootValue () { var root = _x(0); return (root === -Infinity || root !== root) ? _x(1) : root; } function updateElements (rows) { var n = _rowData.length; var height; if (!_fixedBarHeight) { height = (_chart.effectiveHeight() - (n + 1) * _gap) / n; } else { height = _fixedBarHeight; } // vertically align label in center unless they override the value via property setter if (!_hasLabelOffsetY) { _labelOffsetY = height / 2; } var rect = rows.attr('transform', function (d, i) { return 'translate(0,' + ((i + 1) * _gap + i * height) + ')'; }).select('rect') .attr('height', height) .attr('fill', _chart.getColor) .on('click', onClick) .classed('deselected', function (d) { return (_chart.hasFilter()) ? !isSelectedRow(d) : false; }) .classed('selected', function (d) { return (_chart.hasFilter()) ? isSelectedRow(d) : false; }); dc.transition(rect, _chart.transitionDuration()) .attr('width', function (d) { return Math.abs(rootValue() - _x(_chart.valueAccessor()(d))); }) .attr('transform', translateX); createTitles(rows); updateLabels(rows); } function createTitles (rows) { if (_chart.renderTitle()) { rows.selectAll('title').remove(); rows.append('title').text(_chart.title()); } } function createLabels (rowEnter) { if (_chart.renderLabel()) { rowEnter.append('text') .on('click', onClick); } if (_chart.renderTitleLabel()) { rowEnter.append('text') .attr('class', _titleRowCssClass) .on('click', onClick); } } function updateLabels (rows) { if (_chart.renderLabel()) { var lab = rows.select('text') .attr('x', _labelOffsetX) .attr('y', _labelOffsetY) .attr('dy', _dyOffset) .on('click', onClick) .attr('class', function (d, i) { return _rowCssClass + ' _' + i; }) .text(function (d) { return _chart.label()(d); }); dc.transition(lab, _chart.transitionDuration()) .attr('transform', translateX); } if (_chart.renderTitleLabel()) { var titlelab = rows.select('.' + _titleRowCssClass) .attr('x', _chart.effectiveWidth() - _titleLabelOffsetX) .attr('y', _labelOffsetY) .attr('dy', _dyOffset) .attr('text-anchor', 'end') .on('click', onClick) .attr('class', function (d, i) { return _titleRowCssClass + ' _' + i ; }) .text(function (d) { return _chart.title()(d); }); dc.transition(titlelab, _chart.transitionDuration()) .attr('transform', translateX); } } /** * Turn on/off Title label rendering (values) using SVG style of text-anchor 'end' * @method renderTitleLabel * @memberof dc.rowChart * @instance * @param {Boolean} [renderTitleLabel=false] * @return {Boolean} * @return {dc.rowChart} */ _chart.renderTitleLabel = function (renderTitleLabel) { if (!arguments.length) { return _renderTitleLabel; } _renderTitleLabel = renderTitleLabel; return _chart; }; function onClick (d) { _chart.onClick(d); } function translateX (d) { var x = _x(_chart.cappedValueAccessor(d)), x0 = rootValue(), s = x > x0 ? x0 : x; return 'translate(' + s + ',0)'; } _chart._doRedraw = function () { drawChart(); return _chart; }; /** * Get the x axis for the row chart instance. Note: not settable for row charts. * See the {@link https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-axis d3 axis object} * documention for more information. * @method xAxis * @memberof dc.rowChart * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-axis d3.svg.axis} * @example * // customize x axis tick format * chart.xAxis().tickFormat(function (v) {return v + '%';}); * // customize x axis tick values * chart.xAxis().tickValues([0, 100, 200, 300]); * @return {d3.svg.axis} */ _chart.xAxis = function () { return _xAxis; }; /** * Get or set the fixed bar height. Default is [false] which will auto-scale bars. * For example, if you want to fix the height for a specific number of bars (useful in TopN charts) * you could fix height as follows (where count = total number of bars in your TopN and gap is * your vertical gap space). * @method fixedBarHeight * @memberof dc.rowChart * @instance * @example * chart.fixedBarHeight( chartheight - (count + 1) * gap / count); * @param {Boolean|Number} [fixedBarHeight=false] * @return {Boolean|Number} * @return {dc.rowChart} */ _chart.fixedBarHeight = function (fixedBarHeight) { if (!arguments.length) { return _fixedBarHeight; } _fixedBarHeight = fixedBarHeight; return _chart; }; /** * Get or set the vertical gap space between rows on a particular row chart instance * @method gap * @memberof dc.rowChart * @instance * @param {Number} [gap=5] * @return {Number} * @return {dc.rowChart} */ _chart.gap = function (gap) { if (!arguments.length) { return _gap; } _gap = gap; return _chart; }; /** * Get or set the elasticity on x axis. If this attribute is set to true, then the x axis will rescle to auto-fit the * data range when filtered. * @method elasticX * @memberof dc.rowChart * @instance * @param {Boolean} [elasticX] * @return {Boolean} * @return {dc.rowChart} */ _chart.elasticX = function (elasticX) { if (!arguments.length) { return _elasticX; } _elasticX = elasticX; return _chart; }; /** * Get or set the x offset (horizontal space to the top left corner of a row) for labels on a particular row chart. * @method labelOffsetX * @memberof dc.rowChart * @instance * @param {Number} [labelOffsetX=10] * @return {Number} * @return {dc.rowChart} */ _chart.labelOffsetX = function (labelOffsetX) { if (!arguments.length) { return _labelOffsetX; } _labelOffsetX = labelOffsetX; return _chart; }; /** * Get or set the y offset (vertical space to the top left corner of a row) for labels on a particular row chart. * @method labelOffsetY * @memberof dc.rowChart * @instance * @param {Number} [labelOffsety=15] * @return {Number} * @return {dc.rowChart} */ _chart.labelOffsetY = function (labelOffsety) { if (!arguments.length) { return _labelOffsetY; } _labelOffsetY = labelOffsety; _hasLabelOffsetY = true; return _chart; }; /** * Get of set the x offset (horizontal space between right edge of row and right edge or text. * @method titleLabelOffsetX * @memberof dc.rowChart * @instance * @param {Number} [titleLabelOffsetX=2] * @return {Number} * @return {dc.rowChart} */ _chart.titleLabelOffsetX = function (titleLabelOffsetX) { if (!arguments.length) { return _titleLabelOffsetX; } _titleLabelOffsetX = titleLabelOffsetX; return _chart; }; function isSelectedRow (d) { return _chart.hasFilter(_chart.cappedKeyAccessor(d)); } return _chart.anchor(parent, chartGroup); }; /** * Legend is a attachable widget that can be added to other dc charts to render horizontal legend * labels. * * Examples: * - {@link http://dc-js.github.com/dc.js/ Nasdaq 100 Index} * - {@link http://dc-js.github.com/dc.js/crime/index.html Canadian City Crime Stats} * @class legend * @memberof dc * @example * chart.legend(dc.legend().x(400).y(10).itemHeight(13).gap(5)) * @return {dc.legend} */ dc.legend = function () { var LABEL_GAP = 2; var _legend = {}, _parent, _x = 0, _y = 0, _itemHeight = 12, _gap = 5, _horizontal = false, _legendWidth = 560, _itemWidth = 70, _autoItemWidth = false, _legendText = dc.pluck('name'); var _g; _legend.parent = function (p) { if (!arguments.length) { return _parent; } _parent = p; return _legend; }; _legend.render = function () { _parent.svg().select('g.dc-legend').remove(); _g = _parent.svg().append('g') .attr('class', 'dc-legend') .attr('transform', 'translate(' + _x + ',' + _y + ')'); var legendables = _parent.legendables(); var itemEnter = _g.selectAll('g.dc-legend-item') .data(legendables) .enter() .append('g') .attr('class', 'dc-legend-item') .on('mouseover', function (d) { _parent.legendHighlight(d); }) .on('mouseout', function (d) { _parent.legendReset(d); }) .on('click', function (d) { d.chart.legendToggle(d); }); _g.selectAll('g.dc-legend-item') .classed('fadeout', function (d) { return d.chart.isLegendableHidden(d); }); if (legendables.some(dc.pluck('dashstyle'))) { itemEnter .append('line') .attr('x1', 0) .attr('y1', _itemHeight / 2) .attr('x2', _itemHeight) .attr('y2', _itemHeight / 2) .attr('stroke-width', 2) .attr('stroke-dasharray', dc.pluck('dashstyle')) .attr('stroke', dc.pluck('color')); } else { itemEnter .append('rect') .attr('width', _itemHeight) .attr('height', _itemHeight) .attr('fill', function (d) {return d ? d.color : 'blue';}); } itemEnter.append('text') .text(_legendText) .attr('x', _itemHeight + LABEL_GAP) .attr('y', function () { return _itemHeight / 2 + (this.clientHeight ? this.clientHeight : 13) / 2 - 2; }); var _cumulativeLegendTextWidth = 0; var row = 0; itemEnter.attr('transform', function (d, i) { if (_horizontal) { var translateBy = 'translate(' + _cumulativeLegendTextWidth + ',' + row * legendItemHeight() + ')'; var itemWidth = _autoItemWidth === true ? this.getBBox().width + _gap : _itemWidth; if ((_cumulativeLegendTextWidth + itemWidth) >= _legendWidth) { ++row ; _cumulativeLegendTextWidth = 0 ; } else { _cumulativeLegendTextWidth += itemWidth; } return translateBy; } else { return 'translate(0,' + i * legendItemHeight() + ')'; } }); }; function legendItemHeight () { return _gap + _itemHeight; } /** * Set or get x coordinate for legend widget. * @method x * @memberof dc.legend * @instance * @param {Number} [x=0] * @return {Number} * @return {dc.legend} */ _legend.x = function (x) { if (!arguments.length) { return _x; } _x = x; return _legend; }; /** * Set or get y coordinate for legend widget. * @method y * @memberof dc.legend * @instance * @param {Number} [y=0] * @return {Number} * @return {dc.legend} */ _legend.y = function (y) { if (!arguments.length) { return _y; } _y = y; return _legend; }; /** * Set or get gap between legend items. * @method gap * @memberof dc.legend * @instance * @param {Number} [gap=5] * @return {Number} * @return {dc.legend} */ _legend.gap = function (gap) { if (!arguments.length) { return _gap; } _gap = gap; return _legend; }; /** * Set or get legend item height. * @method itemHeight * @memberof dc.legend * @instance * @param {Number} [itemHeight=12] * @return {Number} * @return {dc.legend} */ _legend.itemHeight = function (itemHeight) { if (!arguments.length) { return _itemHeight; } _itemHeight = itemHeight; return _legend; }; /** * Position legend horizontally instead of vertically. * @method horizontal * @memberof dc.legend * @instance * @param {Boolean} [horizontal=false] * @return {Boolean} * @return {dc.legend} */ _legend.horizontal = function (horizontal) { if (!arguments.length) { return _horizontal; } _horizontal = horizontal; return _legend; }; /** * Maximum width for horizontal legend. * @method legendWidth * @memberof dc.legend * @instance * @param {Number} [legendWidth=500] * @return {Number} * @return {dc.legend} */ _legend.legendWidth = function (legendWidth) { if (!arguments.length) { return _legendWidth; } _legendWidth = legendWidth; return _legend; }; /** * legendItem width for horizontal legend. * @method itemWidth * @memberof dc.legend * @instance * @param {Number} [itemWidth=70] * @return {Number} * @return {dc.legend} */ _legend.itemWidth = function (itemWidth) { if (!arguments.length) { return _itemWidth; } _itemWidth = itemWidth; return _legend; }; /** * Turn automatic width for legend items on or off. If true, {@link dc.legend#itemWidth itemWidth} is ignored. * This setting takes into account {@link dc.legend#gap gap}. * @method autoItemWidth * @memberof dc.legend * @instance * @param {Boolean} [autoItemWidth=false] * @return {Boolean} * @return {dc.legend} */ _legend.autoItemWidth = function (autoItemWidth) { if (!arguments.length) { return _autoItemWidth; } _autoItemWidth = autoItemWidth; return _legend; }; /** #### .legendText([legendTextFunction]) Set or get the legend text function. The legend widget uses this function to render the legend text on each item. If no function is specified the legend widget will display the names associated with each group. Default: dc.pluck('name') ```js // create numbered legend items chart.legend(dc.legend().legendText(function(d, i) { return i + '. ' + d.name; })) // create legend displaying group counts chart.legend(dc.legend().legendText(function(d) { return d.name + ': ' d.data; })) ``` **/ _legend.legendText = function (_) { if (!arguments.length) { return _legendText; } _legendText = _; return _legend; }; return _legend; }; /** * A scatter plot chart * * Examples: * - {@link http://dc-js.github.io/dc.js/examples/scatter.html Scatter Chart} * - {@link http://dc-js.github.io/dc.js/examples/multi-scatter.html Multi-Scatter Chart} * @class scatterPlot * @memberof dc * @mixes dc.coordinateGridMixin * @example * // create a scatter plot under #chart-container1 element using the default global chart group * var chart1 = dc.scatterPlot('#chart-container1'); * // create a scatter plot under #chart-container2 element using chart group A * var chart2 = dc.scatterPlot('#chart-container2', 'chartGroupA'); * // create a sub-chart under a composite parent chart * var chart3 = dc.scatterPlot(compositeChart); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.scatterPlot} */ dc.scatterPlot = function (parent, chartGroup) { var _chart = dc.coordinateGridMixin({}); var _symbol = d3.svg.symbol(); var _existenceAccessor = function (d) { return d.value; }; var originalKeyAccessor = _chart.keyAccessor(); _chart.keyAccessor(function (d) { return originalKeyAccessor(d)[0]; }); _chart.valueAccessor(function (d) { return originalKeyAccessor(d)[1]; }); _chart.colorAccessor(function () { return _chart._groupName; }); var _locator = function (d) { return 'translate(' + _chart.x()(_chart.keyAccessor()(d)) + ',' + _chart.y()(_chart.valueAccessor()(d)) + ')'; }; var _highlightedSize = 7; var _symbolSize = 5; var _excludedSize = 3; var _excludedColor = null; var _excludedOpacity = 1.0; var _emptySize = 0; var _filtered = []; _symbol.size(function (d, i) { if (!_existenceAccessor(d)) { return _emptySize; } else if (_filtered[i]) { return Math.pow(_symbolSize, 2); } else { return Math.pow(_excludedSize, 2); } }); dc.override(_chart, '_filter', function (filter) { if (!arguments.length) { return _chart.__filter(); } return _chart.__filter(dc.filters.RangedTwoDimensionalFilter(filter)); }); _chart.plotData = function () { var symbols = _chart.chartBodyG().selectAll('path.symbol') .data(_chart.data()); symbols .enter() .append('path') .attr('class', 'symbol') .attr('opacity', 0) .attr('fill', _chart.getColor) .attr('transform', _locator); symbols.each(function (d, i) { _filtered[i] = !_chart.filter() || _chart.filter().isFiltered([d.key[0], d.key[1]]); }); dc.transition(symbols, _chart.transitionDuration()) .attr('opacity', function (d, i) { return !_existenceAccessor(d) ? 0 : _filtered[i] ? 1 : _chart.excludedOpacity(); }) .attr('fill', function (d, i) { return _chart.excludedColor() && !_filtered[i] ? _chart.excludedColor() : _chart.getColor(d); }) .attr('transform', _locator) .attr('d', _symbol); dc.transition(symbols.exit(), _chart.transitionDuration()) .attr('opacity', 0).remove(); }; /** * Get or set the existence accessor. If a point exists, it is drawn with * {@link dc.scatterPlot#symbolSize symbolSize} radius and * opacity 1; if it does not exist, it is drawn with * {@link dc.scatterPlot#emptySize emptySize} radius and opacity 0. By default, * the existence accessor checks if the reduced value is truthy. * @method existenceAccessor * @memberof dc.scatterPlot * @instance * @see {@link dc.scatterPlot#symbolSize symbolSize} * @see {@link dc.scatterPlot#emptySize emptySize} * @example * // default accessor * chart.existenceAccessor(function (d) { return d.value; }); * @param {Function} [accessor] * @return {Function} * @return {dc.scatterPlot} */ _chart.existenceAccessor = function (accessor) { if (!arguments.length) { return _existenceAccessor; } _existenceAccessor = accessor; return this; }; /** * Get or set the symbol type used for each point. By default the symbol is a circle. * Type can be a constant or an accessor. * @method symbol * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_type d3.svg.symbol().type()} * @example * // Circle type * chart.symbol('circle'); * // Square type * chart.symbol('square'); * @param {String|Function} [type='circle'] * @return {String|Function} * @return {dc.scatterPlot} */ _chart.symbol = function (type) { if (!arguments.length) { return _symbol.type(); } _symbol.type(type); return _chart; }; /** * Set or get radius for symbols. * @method symbolSize * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [symbolSize=3] * @return {Number} * @return {dc.scatterPlot} */ _chart.symbolSize = function (symbolSize) { if (!arguments.length) { return _symbolSize; } _symbolSize = symbolSize; return _chart; }; /** * Set or get radius for highlighted symbols. * @method highlightedSize * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [highlightedSize=5] * @return {Number} * @return {dc.scatterPlot} */ _chart.highlightedSize = function (highlightedSize) { if (!arguments.length) { return _highlightedSize; } _highlightedSize = highlightedSize; return _chart; }; /** * Set or get size for symbols excluded from this chart's filter. If null, no * special size is applied for symbols based on their filter status * @method excludedSize * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [excludedSize=null] * @return {Number} * @return {dc.scatterPlot} */ _chart.excludedSize = function (excludedSize) { if (!arguments.length) { return _excludedSize; } _excludedSize = excludedSize; return _chart; }; /** * Set or get color for symbols excluded from this chart's filter. If null, no * special color is applied for symbols based on their filter status * @method excludedColor * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [excludedColor=null] * @return {Number} * @return {dc.scatterPlot} */ _chart.excludedColor = function (excludedColor) { if (!arguments.length) { return _excludedColor; } _excludedColor = excludedColor; return _chart; }; /** * Set or get opacity for symbols excluded from this chart's filter. * @method excludedOpacity * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [excludedOpacity=1.0] * @return {Number} * @return {dc.scatterPlot} */ _chart.excludedOpacity = function (excludedOpacity) { if (!arguments.length) { return _excludedOpacity; } _excludedOpacity = excludedOpacity; return _chart; }; /** * Set or get radius for symbols when the group is empty. * @method emptySize * @memberof dc.scatterPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/SVG-Shapes#symbol_size d3.svg.symbol().size()} * @param {Number} [emptySize=0] * @return {Number} * @return {dc.scatterPlot} */ _chart.hiddenSize = _chart.emptySize = function (emptySize) { if (!arguments.length) { return _emptySize; } _emptySize = emptySize; return _chart; }; _chart.legendables = function () { return [{chart: _chart, name: _chart._groupName, color: _chart.getColor()}]; }; _chart.legendHighlight = function (d) { resizeSymbolsWhere(function (symbol) { return symbol.attr('fill') === d.color; }, _highlightedSize); _chart.selectAll('.chart-body path.symbol').filter(function () { return d3.select(this).attr('fill') !== d.color; }).classed('fadeout', true); }; _chart.legendReset = function (d) { resizeSymbolsWhere(function (symbol) { return symbol.attr('fill') === d.color; }, _symbolSize); _chart.selectAll('.chart-body path.symbol').filter(function () { return d3.select(this).attr('fill') !== d.color; }).classed('fadeout', false); }; function resizeSymbolsWhere (condition, size) { var symbols = _chart.selectAll('.chart-body path.symbol').filter(function () { return condition(d3.select(this)); }); var oldSize = _symbol.size(); _symbol.size(Math.pow(size, 2)); dc.transition(symbols, _chart.transitionDuration()).attr('d', _symbol); _symbol.size(oldSize); } _chart.setHandlePaths = function () { // no handle paths for poly-brushes }; _chart.extendBrush = function () { var extent = _chart.brush().extent(); if (_chart.round()) { extent[0] = extent[0].map(_chart.round()); extent[1] = extent[1].map(_chart.round()); _chart.g().select('.brush') .call(_chart.brush().extent(extent)); } return extent; }; _chart.brushIsEmpty = function (extent) { return _chart.brush().empty() || !extent || extent[0][0] >= extent[1][0] || extent[0][1] >= extent[1][1]; }; _chart._brushing = function () { var extent = _chart.extendBrush(); _chart.redrawBrush(_chart.g()); if (_chart.brushIsEmpty(extent)) { dc.events.trigger(function () { _chart.filter(null); _chart.redrawGroup(); }); } else { var ranged2DFilter = dc.filters.RangedTwoDimensionalFilter(extent); dc.events.trigger(function () { _chart.filter(null); _chart.filter(ranged2DFilter); _chart.redrawGroup(); }, dc.constants.EVENT_DELAY); } }; _chart.setBrushY = function (gBrush) { gBrush.call(_chart.brush().y(_chart.y())); }; return _chart.anchor(parent, chartGroup); }; /** * A display of a single numeric value. * Unlike other charts, you do not need to set a dimension. Instead a group object must be provided and * a valueAccessor that returns a single value. * @class numberDisplay * @memberof dc * @mixes dc.baseMixin * @example * // create a number display under #chart-container1 element using the default global chart group * var display1 = dc.numberDisplay('#chart-container1'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.numberDisplay} */ dc.numberDisplay = function (parent, chartGroup) { var SPAN_CLASS = 'number-display'; var _formatNumber = d3.format('.2s'); var _chart = dc.baseMixin({}); var _html = {one: '', some: '', none: ''}; // dimension not required _chart._mandatoryAttributes(['group']); /** * Gets or sets an optional object specifying HTML templates to use depending on the number * displayed. The text `%number` will be replaced with the current value. * - one: HTML template to use if the number is 1 * - zero: HTML template to use if the number is 0 * - some: HTML template to use otherwise * @method html * @memberof dc.numberDisplay * @instance * @example * numberWidget.html({ * one:'%number record', * some:'%number records', * none:'no records'}) * @param {{one:String, some:String, none:String}} [html={one: '', some: '', none: ''}] * @return {{one:String, some:String, none:String}} * @return {dc.numberDisplay} */ _chart.html = function (html) { if (!arguments.length) { return _html; } if (html.none) { _html.none = html.none;//if none available } else if (html.one) { _html.none = html.one;//if none not available use one } else if (html.some) { _html.none = html.some;//if none and one not available use some } if (html.one) { _html.one = html.one;//if one available } else if (html.some) { _html.one = html.some;//if one not available use some } if (html.some) { _html.some = html.some;//if some available } else if (html.one) { _html.some = html.one;//if some not available use one } return _chart; }; /** * Calculate and return the underlying value of the display * @method value * @memberof dc.numberDisplay * @instance * @return {Number} */ _chart.value = function () { return _chart.data(); }; _chart.data(function (group) { var valObj = group.value ? group.value() : group.top(1)[0]; return _chart.valueAccessor()(valObj); }); _chart.transitionDuration(250); // good default _chart._doRender = function () { var newValue = _chart.value(), span = _chart.selectAll('.' + SPAN_CLASS); if (span.empty()) { span = span.data([0]) .enter() .append('span') .attr('class', SPAN_CLASS); } span.transition() .duration(_chart.transitionDuration()) .ease('quad-out-in') .tween('text', function () { var interp = d3.interpolateNumber(this.lastValue || 0, newValue); this.lastValue = newValue; return function (t) { var html = null, num = _chart.formatNumber()(interp(t)); if (newValue === 0 && (_html.none !== '')) { html = _html.none; } else if (newValue === 1 && (_html.one !== '')) { html = _html.one; } else if (_html.some !== '') { html = _html.some; } this.innerHTML = html ? html.replace('%number', num) : num; }; }); }; _chart._doRedraw = function () { return _chart._doRender(); }; /** * Get or set a function to format the value for the display. * @method formatNumber * @memberof dc.numberDisplay * @instance * @see {@link https://github.com/mbostock/d3/wiki/Formatting d3.format} * @param {Function} [formatter=d3.format('.2s')] * @return {Function} * @return {dc.numberDisplay} */ _chart.formatNumber = function (formatter) { if (!arguments.length) { return _formatNumber; } _formatNumber = formatter; return _chart; }; return _chart.anchor(parent, chartGroup); }; /** * A heat map is matrix that represents the values of two dimensions of data using colors. * @class heatMap * @memberof dc * @mixes dc.colorMixin * @mixes dc.marginMixin * @mixes dc.baseMixin * @example * // create a heat map under #chart-container1 element using the default global chart group * var heatMap1 = dc.heatMap('#chart-container1'); * // create a heat map under #chart-container2 element using chart group A * var heatMap2 = dc.heatMap('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.heatMap} */ dc.heatMap = function (parent, chartGroup) { var DEFAULT_BORDER_RADIUS = 6.75; var _chartBody; var _cols; var _rows; var _xBorderRadius = DEFAULT_BORDER_RADIUS; var _yBorderRadius = DEFAULT_BORDER_RADIUS; var _chart = dc.colorMixin(dc.marginMixin(dc.baseMixin({}))); _chart._mandatoryAttributes(['group']); _chart.title(_chart.colorAccessor()); var _colsLabel = function (d) { return d; }; var _rowsLabel = function (d) { return d; }; /** * Set or get the column label function. The chart class uses this function to render * column labels on the X axis. It is passed the column name. * @method colsLabel * @memberof dc.heatMap * @instance * @example * // the default label function just returns the name * chart.colsLabel(function(d) { return d; }); * @param {Function} [labelFunction=function(d) { return d; }] * @return {Function} * @return {dc.heatMap} */ _chart.colsLabel = function (labelFunction) { if (!arguments.length) { return _colsLabel; } _colsLabel = labelFunction; return _chart; }; /** * Set or get the row label function. The chart class uses this function to render * row labels on the Y axis. It is passed the row name. * @method rowsLabel * @memberof dc.heatMap * @instance * @example * // the default label function just returns the name * chart.rowsLabel(function(d) { return d; }); * @param {Function} [labelFunction=function(d) { return d; }] * @return {Function} * @return {dc.heatMap} */ _chart.rowsLabel = function (labelFunction) { if (!arguments.length) { return _rowsLabel; } _rowsLabel = labelFunction; return _chart; }; var _xAxisOnClick = function (d) { filterAxis(0, d); }; var _yAxisOnClick = function (d) { filterAxis(1, d); }; var _boxOnClick = function (d) { var filter = d.key; dc.events.trigger(function () { _chart.filter(filter); _chart.redrawGroup(); }); }; function filterAxis (axis, value) { var cellsOnAxis = _chart.selectAll('.box-group').filter(function (d) { return d.key[axis] === value; }); var unfilteredCellsOnAxis = cellsOnAxis.filter(function (d) { return !_chart.hasFilter(d.key); }); dc.events.trigger(function () { if (unfilteredCellsOnAxis.empty()) { cellsOnAxis.each(function (d) { _chart.filter(d.key); }); } else { unfilteredCellsOnAxis.each(function (d) { _chart.filter(d.key); }); } _chart.redrawGroup(); }); } dc.override(_chart, 'filter', function (filter) { if (!arguments.length) { return _chart._filter(); } return _chart._filter(dc.filters.TwoDimensionalFilter(filter)); }); function uniq (d, i, a) { return !i || a[i - 1] !== d; } /** * Gets or sets the values used to create the rows of the heatmap, as an array. By default, all * the values will be fetched from the data using the value accessor, and they will be sorted in * ascending order. * @method rows * @memberof dc.heatMap * @instance * @param {Array<String|Number>} [rows] * @return {Array<String|Number>} * @return {dc.heatMap} */ _chart.rows = function (rows) { if (arguments.length) { _rows = rows; return _chart; } if (_rows) { return _rows; } var rowValues = _chart.data().map(_chart.valueAccessor()); rowValues.sort(d3.ascending); return d3.scale.ordinal().domain(rowValues.filter(uniq)); }; /** * Gets or sets the keys used to create the columns of the heatmap, as an array. By default, all * the values will be fetched from the data using the key accessor, and they will be sorted in * ascending order. * @method cols * @memberof dc.heatMap * @instance * @param {Array<String|Number>} [cols] * @return {Array<String|Number>} * @return {dc.heatMap} */ _chart.cols = function (cols) { if (arguments.length) { _cols = cols; return _chart; } if (_cols) { return _cols; } var colValues = _chart.data().map(_chart.keyAccessor()); colValues.sort(d3.ascending); return d3.scale.ordinal().domain(colValues.filter(uniq)); }; _chart._doRender = function () { _chart.resetSvg(); _chartBody = _chart.svg() .append('g') .attr('class', 'heatmap') .attr('transform', 'translate(' + _chart.margins().left + ',' + _chart.margins().top + ')'); return _chart._doRedraw(); }; _chart._doRedraw = function () { var rows = _chart.rows(), cols = _chart.cols(), rowCount = rows.domain().length, colCount = cols.domain().length, boxWidth = Math.floor(_chart.effectiveWidth() / colCount), boxHeight = Math.floor(_chart.effectiveHeight() / rowCount); cols.rangeRoundBands([0, _chart.effectiveWidth()]); rows.rangeRoundBands([_chart.effectiveHeight(), 0]); var boxes = _chartBody.selectAll('g.box-group').data(_chart.data(), function (d, i) { return _chart.keyAccessor()(d, i) + '\0' + _chart.valueAccessor()(d, i); }); var gEnter = boxes.enter().append('g') .attr('class', 'box-group'); gEnter.append('rect') .attr('class', 'heat-box') .attr('fill', 'white') .on('click', _chart.boxOnClick()); if (_chart.renderTitle()) { gEnter.append('title'); boxes.selectAll('title').text(_chart.title()); } dc.transition(boxes.selectAll('rect'), _chart.transitionDuration()) .attr('x', function (d, i) { return cols(_chart.keyAccessor()(d, i)); }) .attr('y', function (d, i) { return rows(_chart.valueAccessor()(d, i)); }) .attr('rx', _xBorderRadius) .attr('ry', _yBorderRadius) .attr('fill', _chart.getColor) .attr('width', boxWidth) .attr('height', boxHeight); boxes.exit().remove(); var gCols = _chartBody.selectAll('g.cols'); if (gCols.empty()) { gCols = _chartBody.append('g').attr('class', 'cols axis'); } var gColsText = gCols.selectAll('text').data(cols.domain()); gColsText.enter().append('text') .attr('x', function (d) { return cols(d) + boxWidth / 2; }) .style('text-anchor', 'middle') .attr('y', _chart.effectiveHeight()) .attr('dy', 12) .on('click', _chart.xAxisOnClick()) .text(_chart.colsLabel()); dc.transition(gColsText, _chart.transitionDuration()) .text(_chart.colsLabel()) .attr('x', function (d) { return cols(d) + boxWidth / 2; }) .attr('y', _chart.effectiveHeight()); gColsText.exit().remove(); var gRows = _chartBody.selectAll('g.rows'); if (gRows.empty()) { gRows = _chartBody.append('g').attr('class', 'rows axis'); } var gRowsText = gRows.selectAll('text').data(rows.domain()); gRowsText.enter().append('text') .attr('dy', 6) .style('text-anchor', 'end') .attr('x', 0) .attr('dx', -2) .on('click', _chart.yAxisOnClick()) .text(_chart.rowsLabel()); dc.transition(gRowsText, _chart.transitionDuration()) .text(_chart.rowsLabel()) .attr('y', function (d) { return rows(d) + boxHeight / 2; }); gRowsText.exit().remove(); if (_chart.hasFilter()) { _chart.selectAll('g.box-group').each(function (d) { if (_chart.isSelectedNode(d)) { _chart.highlightSelected(this); } else { _chart.fadeDeselected(this); } }); } else { _chart.selectAll('g.box-group').each(function () { _chart.resetHighlight(this); }); } return _chart; }; /** * Gets or sets the handler that fires when an individual cell is clicked in the heatmap. * By default, filtering of the cell will be toggled. * @method boxOnClick * @memberof dc.heatMap * @instance * @example * // default box on click handler * chart.boxOnClick(function (d) { * var filter = d.key; * dc.events.trigger(function () { * _chart.filter(filter); * _chart.redrawGroup(); * }); * }); * @param {Function} [handler] * @return {Function} * @return {dc.heatMap} */ _chart.boxOnClick = function (handler) { if (!arguments.length) { return _boxOnClick; } _boxOnClick = handler; return _chart; }; /** * Gets or sets the handler that fires when a column tick is clicked in the x axis. * By default, if any cells in the column are unselected, the whole column will be selected, * otherwise the whole column will be unselected. * @method xAxisOnClick * @memberof dc.heatMap * @instance * @param {Function} [handler] * @return {Function} * @return {dc.heatMap} */ _chart.xAxisOnClick = function (handler) { if (!arguments.length) { return _xAxisOnClick; } _xAxisOnClick = handler; return _chart; }; /** * Gets or sets the handler that fires when a row tick is clicked in the y axis. * By default, if any cells in the row are unselected, the whole row will be selected, * otherwise the whole row will be unselected. * @method yAxisOnClick * @memberof dc.heatMap * @instance * @param {Function} [handler] * @return {Function} * @return {dc.heatMap} */ _chart.yAxisOnClick = function (handler) { if (!arguments.length) { return _yAxisOnClick; } _yAxisOnClick = handler; return _chart; }; /** * Gets or sets the X border radius. Set to 0 to get full rectangles. * @method xBorderRadius * @memberof dc.heatMap * @instance * @param {Number} [xBorderRadius=6.75] * @return {Number} * @return {dc.heatMap} */ _chart.xBorderRadius = function (xBorderRadius) { if (!arguments.length) { return _xBorderRadius; } _xBorderRadius = xBorderRadius; return _chart; }; /** * Gets or sets the Y border radius. Set to 0 to get full rectangles. * @method yBorderRadius * @memberof dc.heatMap * @instance * @param {Number} [yBorderRadius=6.75] * @return {Number} * @return {dc.heatMap} */ _chart.yBorderRadius = function (yBorderRadius) { if (!arguments.length) { return _yBorderRadius; } _yBorderRadius = yBorderRadius; return _chart; }; _chart.isSelectedNode = function (d) { return _chart.hasFilter(d.key); }; return _chart.anchor(parent, chartGroup); }; // https://github.com/d3/d3-plugins/blob/master/box/box.js (function () { // Inspired by http://informationandvisualization.de/blog/box-plot d3.box = function () { var width = 1, height = 1, duration = 0, domain = null, value = Number, whiskers = boxWhiskers, quartiles = boxQuartiles, tickFormat = null; // For each small multiple… function box (g) { g.each(function (d, i) { d = d.map(value).sort(d3.ascending); var g = d3.select(this), n = d.length, min = d[0], max = d[n - 1]; // Compute quartiles. Must return exactly 3 elements. var quartileData = d.quartiles = quartiles(d); // Compute whiskers. Must return exactly 2 elements, or null. var whiskerIndices = whiskers && whiskers.call(this, d, i), whiskerData = whiskerIndices && whiskerIndices.map(function (i) { return d[i]; }); // Compute outliers. If no whiskers are specified, all data are 'outliers'. // We compute the outliers as indices, so that we can join across transitions! var outlierIndices = whiskerIndices ? d3.range(0, whiskerIndices[0]).concat(d3.range(whiskerIndices[1] + 1, n)) : d3.range(n); // Compute the new x-scale. var x1 = d3.scale.linear() .domain(domain && domain.call(this, d, i) || [min, max]) .range([height, 0]); // Retrieve the old x-scale, if this is an update. var x0 = this.__chart__ || d3.scale.linear() .domain([0, Infinity]) .range(x1.range()); // Stash the new scale. this.__chart__ = x1; // Note: the box, median, and box tick elements are fixed in number, // so we only have to handle enter and update. In contrast, the outliers // and other elements are variable, so we need to exit them! Variable // elements also fade in and out. // Update center line: the vertical line spanning the whiskers. var center = g.selectAll('line.center') .data(whiskerData ? [whiskerData] : []); center.enter().insert('line', 'rect') .attr('class', 'center') .attr('x1', width / 2) .attr('y1', function (d) { return x0(d[0]); }) .attr('x2', width / 2) .attr('y2', function (d) { return x0(d[1]); }) .style('opacity', 1e-6) .transition() .duration(duration) .style('opacity', 1) .attr('y1', function (d) { return x1(d[0]); }) .attr('y2', function (d) { return x1(d[1]); }); center.transition() .duration(duration) .style('opacity', 1) .attr('y1', function (d) { return x1(d[0]); }) .attr('y2', function (d) { return x1(d[1]); }); center.exit().transition() .duration(duration) .style('opacity', 1e-6) .attr('y1', function (d) { return x1(d[0]); }) .attr('y2', function (d) { return x1(d[1]); }) .remove(); // Update innerquartile box. var box = g.selectAll('rect.box') .data([quartileData]); box.enter().append('rect') .attr('class', 'box') .attr('x', 0) .attr('y', function (d) { return x0(d[2]); }) .attr('width', width) .attr('height', function (d) { return x0(d[0]) - x0(d[2]); }) .transition() .duration(duration) .attr('y', function (d) { return x1(d[2]); }) .attr('height', function (d) { return x1(d[0]) - x1(d[2]); }); box.transition() .duration(duration) .attr('y', function (d) { return x1(d[2]); }) .attr('height', function (d) { return x1(d[0]) - x1(d[2]); }); // Update median line. var medianLine = g.selectAll('line.median') .data([quartileData[1]]); medianLine.enter().append('line') .attr('class', 'median') .attr('x1', 0) .attr('y1', x0) .attr('x2', width) .attr('y2', x0) .transition() .duration(duration) .attr('y1', x1) .attr('y2', x1); medianLine.transition() .duration(duration) .attr('y1', x1) .attr('y2', x1); // Update whiskers. var whisker = g.selectAll('line.whisker') .data(whiskerData || []); whisker.enter().insert('line', 'circle, text') .attr('class', 'whisker') .attr('x1', 0) .attr('y1', x0) .attr('x2', width) .attr('y2', x0) .style('opacity', 1e-6) .transition() .duration(duration) .attr('y1', x1) .attr('y2', x1) .style('opacity', 1); whisker.transition() .duration(duration) .attr('y1', x1) .attr('y2', x1) .style('opacity', 1); whisker.exit().transition() .duration(duration) .attr('y1', x1) .attr('y2', x1) .style('opacity', 1e-6) .remove(); // Update outliers. var outlier = g.selectAll('circle.outlier') .data(outlierIndices, Number); outlier.enter().insert('circle', 'text') .attr('class', 'outlier') .attr('r', 5) .attr('cx', width / 2) .attr('cy', function (i) { return x0(d[i]); }) .style('opacity', 1e-6) .transition() .duration(duration) .attr('cy', function (i) { return x1(d[i]); }) .style('opacity', 1); outlier.transition() .duration(duration) .attr('cy', function (i) { return x1(d[i]); }) .style('opacity', 1); outlier.exit().transition() .duration(duration) .attr('cy', function (i) { return x1(d[i]); }) .style('opacity', 1e-6) .remove(); // Compute the tick format. var format = tickFormat || x1.tickFormat(8); // Update box ticks. var boxTick = g.selectAll('text.box') .data(quartileData); boxTick.enter().append('text') .attr('class', 'box') .attr('dy', '.3em') .attr('dx', function (d, i) { return i & 1 ? 6 : -6; }) .attr('x', function (d, i) { return i & 1 ? width : 0; }) .attr('y', x0) .attr('text-anchor', function (d, i) { return i & 1 ? 'start' : 'end'; }) .text(format) .transition() .duration(duration) .attr('y', x1); boxTick.transition() .duration(duration) .text(format) .attr('y', x1); // Update whisker ticks. These are handled separately from the box // ticks because they may or may not exist, and we want don't want // to join box ticks pre-transition with whisker ticks post-. var whiskerTick = g.selectAll('text.whisker') .data(whiskerData || []); whiskerTick.enter().append('text') .attr('class', 'whisker') .attr('dy', '.3em') .attr('dx', 6) .attr('x', width) .attr('y', x0) .text(format) .style('opacity', 1e-6) .transition() .duration(duration) .attr('y', x1) .style('opacity', 1); whiskerTick.transition() .duration(duration) .text(format) .attr('y', x1) .style('opacity', 1); whiskerTick.exit().transition() .duration(duration) .attr('y', x1) .style('opacity', 1e-6) .remove(); }); d3.timer.flush(); } box.width = function (x) { if (!arguments.length) { return width; } width = x; return box; }; box.height = function (x) { if (!arguments.length) { return height; } height = x; return box; }; box.tickFormat = function (x) { if (!arguments.length) { return tickFormat; } tickFormat = x; return box; }; box.duration = function (x) { if (!arguments.length) { return duration; } duration = x; return box; }; box.domain = function (x) { if (!arguments.length) { return domain; } domain = x === null ? x : d3.functor(x); return box; }; box.value = function (x) { if (!arguments.length) { return value; } value = x; return box; }; box.whiskers = function (x) { if (!arguments.length) { return whiskers; } whiskers = x; return box; }; box.quartiles = function (x) { if (!arguments.length) { return quartiles; } quartiles = x; return box; }; return box; }; function boxWhiskers (d) { return [0, d.length - 1]; } function boxQuartiles (d) { return [ d3.quantile(d, 0.25), d3.quantile(d, 0.5), d3.quantile(d, 0.75) ]; } })(); /** * A box plot is a chart that depicts numerical data via their quartile ranges. * * Examples: * - {@link http://dc-js.github.io/dc.js/examples/box-plot-time.html Box plot time example} * - {@link http://dc-js.github.io/dc.js/examples/box-plot.html Box plot example} * @class boxPlot * @memberof dc * @mixes dc.coordinateGridMixin * @example * // create a box plot under #chart-container1 element using the default global chart group * var boxPlot1 = dc.boxPlot('#chart-container1'); * // create a box plot under #chart-container2 element using chart group A * var boxPlot2 = dc.boxPlot('#chart-container2', 'chartGroupA'); * @param {String|node|d3.selection} parent - Any valid * {@link https://github.com/mbostock/d3/wiki/Selections#selecting-elements d3 single selector} specifying * a dom block element such as a div; or a dom element or d3 selection. * @param {String} [chartGroup] - The name of the chart group this chart instance should be placed in. * Interaction with a chart will only trigger events and redraws within the chart's group. * @return {dc.boxPlot} */ dc.boxPlot = function (parent, chartGroup) { var _chart = dc.coordinateGridMixin({}); // Returns a function to compute the interquartile range. function DEFAULT_WHISKERS_IQR (k) { return function (d) { var q1 = d.quartiles[0], q3 = d.quartiles[2], iqr = (q3 - q1) * k, i = -1, j = d.length; do { ++i; } while (d[i] < q1 - iqr); do { --j; } while (d[j] > q3 + iqr); return [i, j]; }; } var _whiskerIqrFactor = 1.5; var _whiskersIqr = DEFAULT_WHISKERS_IQR; var _whiskers = _whiskersIqr(_whiskerIqrFactor); var _box = d3.box(); var _tickFormat = null; var _boxWidth = function (innerChartWidth, xUnits) { if (_chart.isOrdinal()) { return _chart.x().rangeBand(); } else { return innerChartWidth / (1 + _chart.boxPadding()) / xUnits; } }; // default padding to handle min/max whisker text _chart.yAxisPadding(12); // default to ordinal _chart.x(d3.scale.ordinal()); _chart.xUnits(dc.units.ordinal); // valueAccessor should return an array of values that can be coerced into numbers // or if data is overloaded for a static array of arrays, it should be `Number`. // Empty arrays are not included. _chart.data(function (group) { return group.all().map(function (d) { d.map = function (accessor) { return accessor.call(d, d); }; return d; }).filter(function (d) { var values = _chart.valueAccessor()(d); return values.length !== 0; }); }); /** * Get or set the spacing between boxes as a fraction of box size. Valid values are within 0-1. * See the {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales#wiki-ordinal_rangeBands d3 docs} * for a visual description of how the padding is applied. * @method boxPadding * @memberof dc.boxPlot * @instance * @see {@link https://github.com/mbostock/d3/wiki/Ordinal-Scales#wiki-ordinal_rangeBands d3.scale.ordinal.rangeBands} * @param {Number} [padding=0.8] * @return {Number} * @return {dc.boxPlot} */ _chart.boxPadding = _chart._rangeBandPadding; _chart.boxPadding(0.8); /** * Get or set the outer padding on an ordinal box chart. This setting has no effect on non-ordinal charts * or on charts with a custom {@link dc.boxPlot#boxWidth .boxWidth}. Will pad the width by * `padding * barWidth` on each side of the chart. * @method outerPadding * @memberof dc.boxPlot * @instance * @param {Number} [padding=0.5] * @return {Number} * @return {dc.boxPlot} */ _chart.outerPadding = _chart._outerRangeBandPadding; _chart.outerPadding(0.5); /** * Get or set the numerical width of the boxplot box. The width may also be a function taking as * parameters the chart width excluding the right and left margins, as well as the number of x * units. * @example * // Using numerical parameter * chart.boxWidth(10); * // Using function * chart.boxWidth((innerChartWidth, xUnits) { ... }); * @method boxWidth * @memberof dc.boxPlot * @instance * @param {Number|Function} [boxWidth=0.5] * @return {Number|Function} * @return {dc.boxPlot} */ _chart.boxWidth = function (boxWidth) { if (!arguments.length) { return _boxWidth; } _boxWidth = d3.functor(boxWidth); return _chart; }; var boxTransform = function (d, i) { var xOffset = _chart.x()(_chart.keyAccessor()(d, i)); return 'translate(' + xOffset + ', 0)'; }; _chart._preprocessData = function () { if (_chart.elasticX()) { _chart.x().domain([]); } }; _chart.plotData = function () { var _calculatedBoxWidth = _boxWidth(_chart.effectiveWidth(), _chart.xUnitCount()); _box.whiskers(_whiskers) .width(_calculatedBoxWidth) .height(_chart.effectiveHeight()) .value(_chart.valueAccessor()) .domain(_chart.y().domain()) .duration(_chart.transitionDuration()) .tickFormat(_tickFormat); var boxesG = _chart.chartBodyG().selectAll('g.box').data(_chart.data(), function (d) { return d.key; }); renderBoxes(boxesG); updateBoxes(boxesG); removeBoxes(boxesG); _chart.fadeDeselectedArea(); }; function renderBoxes (boxesG) { var boxesGEnter = boxesG.enter().append('g'); boxesGEnter .attr('class', 'box') .attr('transform', boxTransform) .call(_box) .on('click', function (d) { _chart.filter(d.key); _chart.redrawGroup(); }); } function updateBoxes (boxesG) { dc.transition(boxesG, _chart.transitionDuration()) .attr('transform', boxTransform) .call(_box) .each(function () { d3.select(this).select('rect.box').attr('fill', _chart.getColor); }); } function removeBoxes (boxesG) { boxesG.exit().remove().call(_box); } _chart.fadeDeselectedArea = function () { if (_chart.hasFilter()) { _chart.g().selectAll('g.box').each(function (d) { if (_chart.isSelectedNode(d)) { _chart.highlightSelected(this); } else { _chart.fadeDeselected(this); } }); } else { _chart.g().selectAll('g.box').each(function () { _chart.resetHighlight(this); }); } }; _chart.isSelectedNode = function (d) { return _chart.hasFilter(d.key); }; _chart.yAxisMin = function () { var min = d3.min(_chart.data(), function (e) { return d3.min(_chart.valueAccessor()(e)); }); return dc.utils.subtract(min, _chart.yAxisPadding()); }; _chart.yAxisMax = function () { var max = d3.max(_chart.data(), function (e) { return d3.max(_chart.valueAccessor()(e)); }); return dc.utils.add(max, _chart.yAxisPadding()); }; /** * Set the numerical format of the boxplot median, whiskers and quartile labels. Defaults to * integer formatting. * @example * // format ticks to 2 decimal places * chart.tickFormat(d3.format('.2f')); * @method tickFormat * @memberof dc.boxPlot * @instance * @param {Function} [tickFormat] * @return {Number|Function} * @return {dc.boxPlot} */ _chart.tickFormat = function (tickFormat) { if (!arguments.length) { return _tickFormat; } _tickFormat = tickFormat; return _chart; }; return _chart.anchor(parent, chartGroup); }; // Renamed functions dc.abstractBubbleChart = dc.bubbleMixin; dc.baseChart = dc.baseMixin; dc.capped = dc.capMixin; dc.colorChart = dc.colorMixin; dc.coordinateGridChart = dc.coordinateGridMixin; dc.marginable = dc.marginMixin; dc.stackableChart = dc.stackMixin; // Expose d3 and crossfilter, so that clients in browserify // case can obtain them if they need them. dc.d3 = d3; dc.crossfilter = crossfilter; return dc;} if(typeof define === "function" && define.amd) { define(["d3", "crossfilter"], _dc); } else if(typeof module === "object" && module.exports) { var _d3 = require('d3'); var _crossfilter = require('crossfilter2'); // When using npm + browserify, 'crossfilter' is a function, // since package.json specifies index.js as main function, and it // does special handling. When using bower + browserify, // there's no main in bower.json (in fact, there's no bower.json), // so we need to fix it. if (typeof _crossfilter !== "function") { _crossfilter = _crossfilter.crossfilter; } module.exports = _dc(_d3, _crossfilter); } else { this.dc = _dc(d3, crossfilter); } } )(); //# sourceMappingURL=dc.js.map
packages/@lyra/base/src/components/IntlWrapper.js
VegaPublish/vega-studio
import PropTypes from 'prop-types' import React from 'react' import {intlShape} from 'part:@lyra/base/locale/intl' let intl = null export class IntlWrapper extends React.Component { static contextTypes = { intl: intlShape } static propTypes = { children: PropTypes.node.isRequired } componentWillMount() { intl = this.context.intl } componentWillUpdate() { intl = this.context.intl } render() { return <div>{this.props.children}</div> } } const proxies = [ 'formatDate', 'formatTime', 'formatRelative', 'formatNumber', 'formatPlural', 'formatMessage', 'formatHTMLMessage' ].reduce((target, fnName) => { target[fnName] = (...args) => { if (!intl) { throw new Error( 'IntlWrapper must be mounted before using format* functions' ) } return intl[fnName](...args) } return target }, {}) export const formatDate = proxies.formatDate export const formatTime = proxies.formatTime export const formatNumber = proxies.formatNumber export const formatPlural = proxies.formatPlural export const formatRelative = proxies.formatRelative export const formatHTMLMessage = (desc, values) => { return typeof desc === 'string' ? proxies.formatHTMLMessage({id: desc}, values) : proxies.formatHTMLMessage(desc, values) } export const formatMessage = (desc, values) => { return typeof desc === 'string' ? proxies.formatMessage({id: desc}, values) : proxies.formatMessage(desc, values) }
src/scenes/home/branding/logos/logos.js
tskuse/operationcode_frontend
import React from 'react'; import Section from 'shared/components/section/section'; import smallBlueAccentLogo from 'images/logos/small-blue-logo.png'; import smallRedAccentLogo from 'images/logos/small-red-logo.png'; import smallNoAccentLogo from 'images/logos/small-logo.png'; import smallWhiteAccentLogo from 'images/logos/small-white-logo.png'; import smallWhiteStarLogo from 'images/logos/small-white-logo-blue-star.png'; import smallRedStarLogo from 'images/logos/small-white-logo-red-star.png'; import smallWhiteSlateStarLogo from 'images/logos/small-white-logo-slate-star.png'; import smallStackedBlueLogo from 'images/logos/small-stacked-logo-blue.png'; import smallStackedRedLogo from 'images/logos/small-stacked-logo-red.png'; import smallStackedSlateLogo from 'images/logos/small-stacked-logo.png'; import blueMedalLogo from 'images/logos/small-blue-medal.png'; import redMedalLogo from 'images/logos/small-red-medal.png'; import slateMedalLogo from 'images/logos/small-slate-medal.png'; import blueAccentLogo from 'images/logos/large-blue-logo.png'; import redAccentLogo from 'images/logos/large-red-logo.png'; import noAccentLogo from 'images/logos/large-logo.png'; import whiteAccentLogo from 'images/logos/large-white-logo.png'; import whiteBlueStarLogo from 'images/logos/large-white-logo-blue-star.png'; import whiteRedStarLogo from 'images/logos/large-white-logo-red-star.png'; import whiteSlateStarLogo from 'images/logos/large-white-logo-slate-star.png'; import largeBlueLogo from 'images/logos/large-stacked-logo-blue.png'; import largeRedLogo from 'images/logos/large-stacked-logo-red.png'; import largeSlateLogo from 'images/logos/large-stacked-logo.png'; import styles from './logos.css'; const LogosSection = () => ( <Section title="Logo"> <p className={styles.logosInfo}> The size ratio between the star and the medallion changes depending on the size of reproduction. Please make use of the appropriate sized logo when creating collateral. </p> <p className={styles.logosInfo}> In most cases, use the blue-accent version of the logo. The red-accent is delivered for special uses only. </p> <p className={styles.logosInfo}> <a href="https://s3.us-east-2.amazonaws.com/operationcode-web/Operation-Code-Logo.eps"> Download master EPS file </a> </p> <p className={styles.logosInfo}> The files below are transparent PNGs. Click-and-drag (or for mobile, press-and-hold) them directly from your browser to download the file. </p> <div className={styles.logoImages}> <section className={styles.sectionPadding}> <h5>SMALL</h5> <p>For use when the medal is between 0 and 1-inch tall.</p> <div className={styles.marginSpace}> <h6>LOGO</h6> <div className={styles.smallLogos}> <div className={styles.stackLogos}> <img src={smallBlueAccentLogo} alt="Blue Accent Logo" /> <p>Blue Accent</p> </div> <div className={styles.stackLogos}> <img src={smallRedAccentLogo} alt="Red Accent Logo" /> <p>Red Accent</p> </div> </div> <div className={styles.smallLogos}> <div className={styles.stackLogos}> <img src={smallNoAccentLogo} alt="No Accent Logo" /> <p>No Accent</p> </div> <div className={styles.stackLogos}> <img src={smallWhiteAccentLogo} alt="White Accent Logo" /> <p>White Accent</p> </div> </div> <div className={styles.smallLogos}> <div className={styles.starLogos}> <img src={smallWhiteStarLogo} alt="White Blue Star Logo" /> </div> <div className={styles.starLogos}> <img src={smallRedStarLogo} alt="White Red Star Logo" /> </div> <div className={styles.starLogos}> <img src={smallWhiteSlateStarLogo} alt="White Slate Star Logo" /> </div> </div> <p>Star Accents</p> </div> <div className={styles.marginSpace}> <h6>LOGO, STACKED</h6> <div className={styles.smallLogos}> <div className={styles.stackedLogos}> <img src={smallStackedBlueLogo} alt="Stacked Small Blue Logo" /> <p>Blue Accent</p> </div> <div className={styles.stackedLogos}> <img src={smallStackedRedLogo} alt="Stacked Small Red Logo" /> <p>Red Accent</p> </div> <div className={styles.stackedLogos}> <img src={smallStackedSlateLogo} alt="Stacked Small Slate Logo" /> <p>Slate Accent</p> </div> </div> </div> <div className={styles.marginSpace}> <h6>MEDALS</h6> <div className={styles.smallMedalLogos}> <div className={styles.medalLogos}> <img src={blueMedalLogo} alt="Blue Medal" /> <p>Blue</p> </div> <div className={styles.medalLogos}> <img src={redMedalLogo} alt="Red Medal" /> <p>Red</p> </div> <div className={styles.medalLogos}> <img src={slateMedalLogo} alt="Slate Medal" /> <p>Slate</p> </div> </div> </div> </section> <section className={styles.sectionPadding}> <h5>LARGE</h5> <p>For use when the medal is above 1-inch tall.</p> <div className={styles.marginSpace}> <h6>LOGO</h6> <div className={styles.largeLogos}> <div className={styles.stackLogos}> <img src={blueAccentLogo} alt="Blue Accent Logo" /> <p>Blue Accent</p> </div> <div className={styles.stackLogos}> <img src={redAccentLogo} alt="Red Accent Logo" /> <p>Red Accent</p> </div> <div className={styles.stackLogos}> <img src={noAccentLogo} alt="No Accent Logo" /> <p>No Accent</p> </div> <div className={styles.stackLogos}> <img src={whiteAccentLogo} alt="White Accent Logo" /> <p>White Accent</p> </div> </div> <div className={styles.largeLogos}> <div className={styles.starLogos}> <img src={whiteBlueStarLogo} alt="White Blue Star Logo" /> </div> <div className={styles.starLogos}> <img src={whiteRedStarLogo} alt="White Red Star Logo" /> </div> <div className={styles.starLogos}> <img src={whiteSlateStarLogo} alt="White Slate Star Logo" /> </div> </div> <p>Star Accents</p> </div> <div className={styles.marginSpace}> <h6>LOGO, STACKED</h6> <div className={styles.largeLogos}> <div className={styles.stackedLogos}> <img src={largeBlueLogo} alt="Stacked LARGE Blue Logo" /> <p>Blue Accent</p> </div> <div className={styles.stackedLogos}> <img src={largeRedLogo} alt="Stacked Large Red Logo" /> <p>Red Accent</p> </div> <div className={styles.stackedLogos}> <img src={largeSlateLogo} alt="Stacked Large Slate Logo" /> <p>Slate Accent</p> </div> </div> </div> </section> </div> </Section> ); export default LogosSection;
ajax/libs/jointjs/0.8.0/joint.min.js
vetruvet/cdnjs
/*! JointJS v0.8.0 - JavaScript diagramming library 2014-01-22 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ if(function(a,b){function c(a){var b=a.length,c=ib.type(a);return ib.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||"function"!==c&&(0===b||"number"==typeof b&&b>0&&b-1 in a)}function d(a){var b=xb[a]={};return ib.each(a.match(kb)||[],function(a,c){b[c]=!0}),b}function e(a,c,d,e){if(ib.acceptData(a)){var f,g,h=ib.expando,i="string"==typeof c,j=a.nodeType,k=j?ib.cache:a,l=j?a[h]:a[h]&&h;if(l&&k[l]&&(e||k[l].data)||!i||d!==b)return l||(j?a[h]=l=_.pop()||ib.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=ib.noop)),("object"==typeof c||"function"==typeof c)&&(e?k[l]=ib.extend(k[l],c):k[l].data=ib.extend(k[l].data,c)),f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[ib.camelCase(c)]=d),i?(g=f[c],null==g&&(g=f[ib.camelCase(c)])):g=f,g}}function f(a,b,c){if(ib.acceptData(a)){var d,e,f,g=a.nodeType,i=g?ib.cache:a,j=g?a[ib.expando]:ib.expando;if(i[j]){if(b&&(f=c?i[j]:i[j].data)){ib.isArray(b)?b=b.concat(ib.map(b,ib.camelCase)):b in f?b=[b]:(b=ib.camelCase(b),b=b in f?[b]:b.split(" "));for(d=0,e=b.length;e>d;d++)delete f[b[d]];if(!(c?h:ib.isEmptyObject)(f))return}(c||(delete i[j].data,h(i[j])))&&(g?ib.cleanData([a],!0):ib.support.deleteExpando||i!=i.window?delete i[j]:i[j]=null)}}}function g(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(zb,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:yb.test(d)?ib.parseJSON(d):d}catch(f){}ib.data(a,c,d)}else d=b}return d}function h(a){var b;for(b in a)if(("data"!==b||!ib.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function i(){return!0}function j(){return!1}function k(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function l(a,b,c){if(b=b||0,ib.isFunction(b))return ib.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return ib.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=ib.grep(a,function(a){return 1===a.nodeType});if(Rb.test(b))return ib.filter(b,d,!c);b=ib.filter(b,d)}return ib.grep(a,function(a){return ib.inArray(a,b)>=0===c})}function m(a){var b=Ub.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function n(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function o(a){var b=a.getAttributeNode("type");return a.type=(b&&b.specified)+"/"+a.type,a}function p(a){var b=ec.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function q(a,b){for(var c,d=0;null!=(c=a[d]);d++)ib._data(c,"globalEval",!b||ib._data(b[d],"globalEval"))}function r(a,b){if(1===b.nodeType&&ib.hasData(a)){var c,d,e,f=ib._data(a),g=ib._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)ib.event.add(b,c,h[c][d])}g.data&&(g.data=ib.extend({},g.data))}}function s(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!ib.support.noCloneEvent&&b[ib.expando]){e=ib._data(b);for(d in e.events)ib.removeEvent(b,d,e.handle);b.removeAttribute(ib.expando)}"script"===c&&b.text!==a.text?(o(b).text=a.text,p(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),ib.support.html5Clone&&a.innerHTML&&!ib.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&bc.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function t(a,c){var d,e,f=0,g=typeof a.getElementsByTagName!==V?a.getElementsByTagName(c||"*"):typeof a.querySelectorAll!==V?a.querySelectorAll(c||"*"):b;if(!g)for(g=[],d=a.childNodes||a;null!=(e=d[f]);f++)!c||ib.nodeName(e,c)?g.push(e):ib.merge(g,t(e,c));return c===b||c&&ib.nodeName(a,c)?ib.merge([a],g):g}function u(a){bc.test(a.type)&&(a.defaultChecked=a.checked)}function v(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=yc.length;e--;)if(b=yc[e]+c,b in a)return b;return d}function w(a,b){return a=b||a,"none"===ib.css(a,"display")||!ib.contains(a.ownerDocument,a)}function x(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=ib._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&w(d)&&(f[g]=ib._data(d,"olddisplay",B(d.nodeName)))):f[g]||(e=w(d),(c&&"none"!==c||!e)&&ib._data(d,"olddisplay",e?c:ib.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function y(a,b,c){var d=rc.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function z(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=ib.css(a,c+xc[f],!0,e)),d?("content"===c&&(g-=ib.css(a,"padding"+xc[f],!0,e)),"margin"!==c&&(g-=ib.css(a,"border"+xc[f]+"Width",!0,e))):(g+=ib.css(a,"padding"+xc[f],!0,e),"padding"!==c&&(g+=ib.css(a,"border"+xc[f]+"Width",!0,e)));return g}function A(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=kc(a),g=ib.support.boxSizing&&"border-box"===ib.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=lc(a,b,f),(0>e||null==e)&&(e=a.style[b]),sc.test(e))return e;d=g&&(ib.support.boxSizingReliable||e===a.style[b]),e=parseFloat(e)||0}return e+z(a,b,c||(g?"border":"content"),d,f)+"px"}function B(a){var b=W,c=uc[a];return c||(c=C(a,b),"none"!==c&&c||(jc=(jc||ib("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(b.documentElement),b=(jc[0].contentWindow||jc[0].contentDocument).document,b.write("<!doctype html><html><body>"),b.close(),c=C(a,b),jc.detach()),uc[a]=c),c}function C(a,b){var c=ib(b.createElement(a)).appendTo(b.body),d=ib.css(c[0],"display");return c.remove(),d}function D(a,b,c,d){var e;if(ib.isArray(b))ib.each(b,function(b,e){c||Ac.test(a)?d(a,e):D(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==ib.type(b))d(a,b);else for(e in b)D(a+"["+e+"]",b[e],c,d)}function E(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(kb)||[];if(ib.isFunction(c))for(;d=f[e++];)"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function F(a,b,c,d){function e(h){var i;return f[h]=!0,ib.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===Rc;return e(b.dataTypes[0])||!f["*"]&&e("*")}function G(a,c){var d,e,f=ib.ajaxSettings.flatOptions||{};for(e in c)c[e]!==b&&((f[e]?a:d||(d={}))[e]=c[e]);return d&&ib.extend(!0,a,d),a}function H(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(h in k)h in d&&(c[k[h]]=d[h]);for(;"*"===j[0];)j.shift(),f===b&&(f=a.mimeType||c.getResponseHeader("Content-Type"));if(f)for(h in i)if(i[h]&&i[h].test(f)){j.unshift(h);break}if(j[0]in d)g=j[0];else{for(h in d){if(!j[0]||a.converters[h+" "+j[0]]){g=h;break}e||(e=h)}g=g||e}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function I(a,b){var c,d,e,f,g={},h=0,i=a.dataTypes.slice(),j=i[0];if(a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i[1])for(e in a.converters)g[e.toLowerCase()]=a.converters[e];for(;d=i[++h];)if("*"!==d){if("*"!==j&&j!==d){if(e=g[j+" "+d]||g["* "+d],!e)for(c in g)if(f=c.split(" "),f[1]===d&&(e=g[j+" "+f[0]]||g["* "+f[0]])){e===!0?e=g[c]:g[c]!==!0&&(d=f[0],i.splice(h--,0,d));break}if(e!==!0)if(e&&a["throws"])b=e(b);else try{b=e(b)}catch(k){return{state:"parsererror",error:e?k:"No conversion from "+j+" to "+d}}}j=d}return{state:"success",data:b}}function J(){try{return new a.XMLHttpRequest}catch(b){}}function K(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function L(){return setTimeout(function(){$c=b}),$c=ib.now()}function M(a,b){ib.each(b,function(b,c){for(var d=(ed[b]||[]).concat(ed["*"]),e=0,f=d.length;f>e;e++)if(d[e].call(a,b,c))return})}function N(a,b,c){var d,e,f=0,g=dd.length,h=ib.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$c||L(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:ib.extend({},b),opts:ib.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$c||L(),duration:c.duration,tweens:[],createTween:function(b,c){var d=ib.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(O(k,j.opts.specialEasing);g>f;f++)if(d=dd[f].call(j,a,k,j.opts))return d;return M(j,k),ib.isFunction(j.opts.start)&&j.opts.start.call(a,j),ib.fx.timer(ib.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function O(a,b){var c,d,e,f,g;for(e in a)if(d=ib.camelCase(e),f=b[d],c=a[e],ib.isArray(c)&&(f=c[1],c=a[e]=c[0]),e!==d&&(a[d]=c,delete a[e]),g=ib.cssHooks[d],g&&"expand"in g){c=g.expand(c),delete a[d];for(e in c)e in a||(a[e]=c[e],b[e]=f)}else b[d]=f}function P(a,b,c){var d,e,f,g,h,i,j,k,l,m=this,n=a.style,o={},p=[],q=a.nodeType&&w(a);c.queue||(k=ib._queueHooks(a,"fx"),null==k.unqueued&&(k.unqueued=0,l=k.empty.fire,k.empty.fire=function(){k.unqueued||l()}),k.unqueued++,m.always(function(){m.always(function(){k.unqueued--,ib.queue(a,"fx").length||k.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[n.overflow,n.overflowX,n.overflowY],"inline"===ib.css(a,"display")&&"none"===ib.css(a,"float")&&(ib.support.inlineBlockNeedsLayout&&"inline"!==B(a.nodeName)?n.zoom=1:n.display="inline-block")),c.overflow&&(n.overflow="hidden",ib.support.shrinkWrapBlocks||m.always(function(){n.overflow=c.overflow[0],n.overflowX=c.overflow[1],n.overflowY=c.overflow[2]}));for(e in b)if(g=b[e],ad.exec(g)){if(delete b[e],i=i||"toggle"===g,g===(q?"hide":"show"))continue;p.push(e)}if(f=p.length){h=ib._data(a,"fxshow")||ib._data(a,"fxshow",{}),"hidden"in h&&(q=h.hidden),i&&(h.hidden=!q),q?ib(a).show():m.done(function(){ib(a).hide()}),m.done(function(){var b;ib._removeData(a,"fxshow");for(b in o)ib.style(a,b,o[b])});for(e=0;f>e;e++)d=p[e],j=m.createTween(d,q?h[d]:0),o[d]=h[d]||ib.style(a,d),d in h||(h[d]=j.start,q&&(j.end=j.start,j.start="width"===d||"height"===d?1:0))}}function Q(a,b,c,d,e){return new Q.prototype.init(a,b,c,d,e)}function R(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=xc[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function S(a){return ib.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var T,U,V=typeof b,W=a.document,X=a.location,Y=a.jQuery,Z=a.$,$={},_=[],ab="1.9.1",bb=_.concat,cb=_.push,db=_.slice,eb=_.indexOf,fb=$.toString,gb=$.hasOwnProperty,hb=ab.trim,ib=function(a,b){return new ib.fn.init(a,b,U)},jb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,kb=/\S+/g,lb=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,mb=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,nb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ob=/^[\],:{}\s]*$/,pb=/(?:^|:|,)(?:\s*\[)+/g,qb=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rb=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,sb=/^-ms-/,tb=/-([\da-z])/gi,ub=function(a,b){return b.toUpperCase()},vb=function(a){(W.addEventListener||"load"===a.type||"complete"===W.readyState)&&(wb(),ib.ready())},wb=function(){W.addEventListener?(W.removeEventListener("DOMContentLoaded",vb,!1),a.removeEventListener("load",vb,!1)):(W.detachEvent("onreadystatechange",vb),a.detachEvent("onload",vb))};ib.fn=ib.prototype={jquery:ab,constructor:ib,init:function(a,c,d){var e,f;if(!a)return this;if("string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:mb.exec(a),!e||!e[1]&&c)return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a);if(e[1]){if(c=c instanceof ib?c[0]:c,ib.merge(this,ib.parseHTML(e[1],c&&c.nodeType?c.ownerDocument||c:W,!0)),nb.test(e[1])&&ib.isPlainObject(c))for(e in c)ib.isFunction(this[e])?this[e](c[e]):this.attr(e,c[e]);return this}if(f=W.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return d.find(a);this.length=1,this[0]=f}return this.context=W,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):ib.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),ib.makeArray(a,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return db.call(this)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a){var b=ib.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return ib.each(this,a,b)},ready:function(a){return ib.ready.promise().done(a),this},slice:function(){return this.pushStack(db.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},map:function(a){return this.pushStack(ib.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:cb,sort:[].sort,splice:[].splice},ib.fn.init.prototype=ib.fn,ib.extend=ib.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),"object"==typeof h||ib.isFunction(h)||(h={}),j===i&&(h=this,--i);j>i;i++)if(null!=(f=arguments[i]))for(e in f)a=h[e],d=f[e],h!==d&&(k&&d&&(ib.isPlainObject(d)||(c=ib.isArray(d)))?(c?(c=!1,g=a&&ib.isArray(a)?a:[]):g=a&&ib.isPlainObject(a)?a:{},h[e]=ib.extend(k,g,d)):d!==b&&(h[e]=d));return h},ib.extend({noConflict:function(b){return a.$===ib&&(a.$=Z),b&&a.jQuery===ib&&(a.jQuery=Y),ib},isReady:!1,readyWait:1,holdReady:function(a){a?ib.readyWait++:ib.ready(!0)},ready:function(a){if(a===!0?!--ib.readyWait:!ib.isReady){if(!W.body)return setTimeout(ib.ready);ib.isReady=!0,a!==!0&&--ib.readyWait>0||(T.resolveWith(W,[ib]),ib.fn.trigger&&ib(W).trigger("ready").off("ready"))}},isFunction:function(a){return"function"===ib.type(a)},isArray:Array.isArray||function(a){return"array"===ib.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):"object"==typeof a||"function"==typeof a?$[fb.call(a)]||"object":typeof a},isPlainObject:function(a){if(!a||"object"!==ib.type(a)||a.nodeType||ib.isWindow(a))return!1;try{if(a.constructor&&!gb.call(a,"constructor")&&!gb.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||gb.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||W;var d=nb.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=ib.buildFragment([a],b,e),e&&ib(e).remove(),ib.merge([],d.childNodes))},parseJSON:function(b){return a.JSON&&a.JSON.parse?a.JSON.parse(b):null===b?b:"string"==typeof b&&(b=ib.trim(b),b&&ob.test(b.replace(qb,"@").replace(rb,"]").replace(pb,"")))?new Function("return "+b)():(ib.error("Invalid JSON: "+b),void 0)},parseXML:function(c){var d,e;if(!c||"string"!=typeof c)return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return d&&d.documentElement&&!d.getElementsByTagName("parsererror").length||ib.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&ib.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(sb,"ms-").replace(tb,ub)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e,f=0,g=a.length,h=c(a);if(d){if(h)for(;g>f&&(e=b.apply(a[f],d),e!==!1);f++);else for(f in a)if(e=b.apply(a[f],d),e===!1)break}else if(h)for(;g>f&&(e=b.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(e=b.call(a[f],f,a[f]),e===!1)break;return a},trim:hb&&!hb.call(" ")?function(a){return null==a?"":hb.call(a)}:function(a){return null==a?"":(a+"").replace(lb,"")},makeArray:function(a,b){var d=b||[];return null!=a&&(c(Object(a))?ib.merge(d,"string"==typeof a?[a]:a):cb.call(d,a)),d},inArray:function(a,b,c){var d;if(b){if(eb)return eb.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if("number"==typeof d)for(;d>f;f++)a[e++]=c[f];else for(;c[f]!==b;)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;for(c=!!c;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,b,d){var e,f=0,g=a.length,h=c(a),i=[];if(h)for(;g>f;f++)e=b(a[f],f,d),null!=e&&(i[i.length]=e);else for(f in a)e=b(a[f],f,d),null!=e&&(i[i.length]=e);return bb.apply([],i)},guid:1,proxy:function(a,c){var d,e,f;return"string"==typeof c&&(f=a[c],c=a,a=f),ib.isFunction(a)?(d=db.call(arguments,2),e=function(){return a.apply(c||this,d.concat(db.call(arguments)))},e.guid=a.guid=a.guid||ib.guid++,e):b},access:function(a,c,d,e,f,g,h){var i=0,j=a.length,k=null==d;if("object"===ib.type(d)){f=!0;for(i in d)ib.access(a,c,i,d[i],!0,g,h)}else if(e!==b&&(f=!0,ib.isFunction(e)||(h=!0),k&&(h?(c.call(a,e),c=null):(k=c,c=function(a,b,c){return k.call(ib(a),c)})),c))for(;j>i;i++)c(a[i],d,h?e:e.call(a[i],i,c(a[i],d)));return f?a:k?c.call(a):j?c(a[0],d):g},now:function(){return(new Date).getTime()}}),ib.ready.promise=function(b){if(!T)if(T=ib.Deferred(),"complete"===W.readyState)setTimeout(ib.ready);else if(W.addEventListener)W.addEventListener("DOMContentLoaded",vb,!1),a.addEventListener("load",vb,!1);else{W.attachEvent("onreadystatechange",vb),a.attachEvent("onload",vb);var c=!1;try{c=null==a.frameElement&&W.documentElement}catch(d){}c&&c.doScroll&&function e(){if(!ib.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}wb(),ib.ready()}}()}return T.promise(b)},ib.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){$["[object "+b+"]"]=b.toLowerCase()}),U=ib(W);var xb={};ib.Callbacks=function(a){a="string"==typeof a?xb[a]||d(a):ib.extend({},a);var c,e,f,g,h,i,j=[],k=!a.once&&[],l=function(b){for(e=a.memory&&b,f=!0,h=i||0,i=0,g=j.length,c=!0;j&&g>h;h++)if(j[h].apply(b[0],b[1])===!1&&a.stopOnFalse){e=!1;break}c=!1,j&&(k?k.length&&l(k.shift()):e?j=[]:m.disable())},m={add:function(){if(j){var b=j.length;!function d(b){ib.each(b,function(b,c){var e=ib.type(c);"function"===e?a.unique&&m.has(c)||j.push(c):c&&c.length&&"string"!==e&&d(c)})}(arguments),c?g=j.length:e&&(i=b,l(e))}return this},remove:function(){return j&&ib.each(arguments,function(a,b){for(var d;(d=ib.inArray(b,j,d))>-1;)j.splice(d,1),c&&(g>=d&&g--,h>=d&&h--)}),this},has:function(a){return a?ib.inArray(a,j)>-1:!(!j||!j.length)},empty:function(){return j=[],this},disable:function(){return j=k=e=b,this},disabled:function(){return!j},lock:function(){return k=b,e||m.disable(),this},locked:function(){return!k},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],!j||f&&!k||(c?k.push(b):l(b)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!f}};return m},ib.extend({Deferred:function(a){var b=[["resolve","done",ib.Callbacks("once memory"),"resolved"],["reject","fail",ib.Callbacks("once memory"),"rejected"],["notify","progress",ib.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return ib.Deferred(function(c){ib.each(b,function(b,f){var g=f[0],h=ib.isFunction(a[b])&&a[b];e[f[1]](function(){var a=h&&h.apply(this,arguments);a&&ib.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[g+"With"](this===d?c.promise():this,h?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?ib.extend(a,d):d}},e={};return d.pipe=d.then,ib.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=db.call(arguments),g=f.length,h=1!==g||a&&ib.isFunction(a.promise)?g:0,i=1===h?a:ib.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?db.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&ib.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}}),ib.support=function(){var b,c,d,e,f,g,h,i,j,k,l=W.createElement("div");if(l.setAttribute("className","t"),l.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=l.getElementsByTagName("*"),d=l.getElementsByTagName("a")[0],!c||!d||!c.length)return{};f=W.createElement("select"),h=f.appendChild(W.createElement("option")),e=l.getElementsByTagName("input")[0],d.style.cssText="top:1px;float:left;opacity:.5",b={getSetAttribute:"t"!==l.className,leadingWhitespace:3===l.firstChild.nodeType,tbody:!l.getElementsByTagName("tbody").length,htmlSerialize:!!l.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:!!e.value,optSelected:h.selected,enctype:!!W.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==W.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===W.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},e.checked=!0,b.noCloneChecked=e.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!h.disabled;try{delete l.test}catch(m){b.deleteExpando=!1}e=W.createElement("input"),e.setAttribute("value",""),b.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),b.radioValue="t"===e.value,e.setAttribute("checked","t"),e.setAttribute("name","t"),g=W.createDocumentFragment(),g.appendChild(e),b.appendChecked=e.checked,b.checkClone=g.cloneNode(!0).cloneNode(!0).lastChild.checked,l.attachEvent&&(l.attachEvent("onclick",function(){b.noCloneEvent=!1}),l.cloneNode(!0).click());for(k in{submit:!0,change:!0,focusin:!0})l.setAttribute(i="on"+k,"t"),b[k+"Bubbles"]=i in a||l.attributes[i].expando===!1;return l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",b.clearCloneStyle="content-box"===l.style.backgroundClip,ib(function(){var c,d,e,f="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",g=W.getElementsByTagName("body")[0];g&&(c=W.createElement("div"),c.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",g.appendChild(c).appendChild(l),l.innerHTML="<table><tr><td></td><td>t</td></tr></table>",e=l.getElementsByTagName("td"),e[0].style.cssText="padding:0;margin:0;border:0;display:none",j=0===e[0].offsetHeight,e[0].style.display="",e[1].style.display="none",b.reliableHiddenOffsets=j&&0===e[0].offsetHeight,l.innerHTML="",l.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=4===l.offsetWidth,b.doesNotIncludeMarginInBodyOffset=1!==g.offsetTop,a.getComputedStyle&&(b.pixelPosition="1%"!==(a.getComputedStyle(l,null)||{}).top,b.boxSizingReliable="4px"===(a.getComputedStyle(l,null)||{width:"4px"}).width,d=l.appendChild(W.createElement("div")),d.style.cssText=l.style.cssText=f,d.style.marginRight=d.style.width="0",l.style.width="1px",b.reliableMarginRight=!parseFloat((a.getComputedStyle(d,null)||{}).marginRight)),typeof l.style.zoom!==V&&(l.innerHTML="",l.style.cssText=f+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=3===l.offsetWidth,l.style.display="block",l.innerHTML="<div></div>",l.firstChild.style.width="5px",b.shrinkWrapBlocks=3!==l.offsetWidth,b.inlineBlockNeedsLayout&&(g.style.zoom=1)),g.removeChild(c),c=l=e=d=null)}),c=f=g=h=d=e=null,b}();var yb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,zb=/([A-Z])/g;ib.extend({cache:{},expando:"jQuery"+(ab+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?ib.cache[a[ib.expando]]:a[ib.expando],!!a&&!h(a)},data:function(a,b,c){return e(a,b,c)},removeData:function(a,b){return f(a,b)},_data:function(a,b,c){return e(a,b,c,!0)},_removeData:function(a,b){return f(a,b,!0)},acceptData:function(a){if(a.nodeType&&1!==a.nodeType&&9!==a.nodeType)return!1;var b=a.nodeName&&ib.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),ib.fn.extend({data:function(a,c){var d,e,f=this[0],h=0,i=null;if(a===b){if(this.length&&(i=ib.data(f),1===f.nodeType&&!ib._data(f,"parsedAttrs"))){for(d=f.attributes;h<d.length;h++)e=d[h].name,e.indexOf("data-")||(e=ib.camelCase(e.slice(5)),g(f,e,i[e]));ib._data(f,"parsedAttrs",!0)}return i}return"object"==typeof a?this.each(function(){ib.data(this,a)}):ib.access(this,function(c){return c===b?f?g(f,a,ib.data(f,a)):null:(this.each(function(){ib.data(this,a,c)}),void 0)},null,c,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){ib.removeData(this,a)})}}),ib.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=ib._data(a,b),c&&(!d||ib.isArray(c)?d=ib._data(a,b,ib.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=ib.queue(a,b),d=c.length,e=c.shift(),f=ib._queueHooks(a,b),g=function(){ib.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),f.cur=e,e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return ib._data(a,c)||ib._data(a,c,{empty:ib.Callbacks("once memory").add(function(){ib._removeData(a,b+"queue"),ib._removeData(a,c)})})}}),ib.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length<d?ib.queue(this[0],a):c===b?this:this.each(function(){var b=ib.queue(this,a,c);ib._queueHooks(this,a),"fx"===a&&"inprogress"!==b[0]&&ib.dequeue(this,a)})},dequeue:function(a){return this.each(function(){ib.dequeue(this,a)})},delay:function(a,b){return a=ib.fx?ib.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=ib.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};for("string"!=typeof a&&(c=a,a=b),a=a||"fx";h--;)d=ib._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var Ab,Bb,Cb=/[\t\r\n]/g,Db=/\r/g,Eb=/^(?:input|select|textarea|button|object)$/i,Fb=/^(?:a|area)$/i,Gb=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Hb=/^(?:checked|selected)$/i,Ib=ib.support.getSetAttribute,Jb=ib.support.input;ib.fn.extend({attr:function(a,b){return ib.access(this,ib.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){ib.removeAttr(this,a)})},prop:function(a,b){return ib.access(this,ib.prop,a,b,arguments.length>1)},removeProp:function(a){return a=ib.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g=0,h=this.length,i="string"==typeof a&&a;if(ib.isFunction(a))return this.each(function(b){ib(this).addClass(a.call(this,b,this.className))});if(i)for(b=(a||"").match(kb)||[];h>g;g++)if(c=this[g],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(Cb," "):" ")){for(f=0;e=b[f++];)d.indexOf(" "+e+" ")<0&&(d+=e+" ");c.className=ib.trim(d)}return this},removeClass:function(a){var b,c,d,e,f,g=0,h=this.length,i=0===arguments.length||"string"==typeof a&&a;if(ib.isFunction(a))return this.each(function(b){ib(this).removeClass(a.call(this,b,this.className))});if(i)for(b=(a||"").match(kb)||[];h>g;g++)if(c=this[g],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(Cb," "):"")){for(f=0;e=b[f++];)for(;d.indexOf(" "+e+" ")>=0;)d=d.replace(" "+e+" "," ");c.className=a?ib.trim(d):""}return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return ib.isFunction(a)?this.each(function(c){ib(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=ib(this),h=b,i=a.match(kb)||[];e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else(c===V||"boolean"===c)&&(this.className&&ib._data(this,"__className__",this.className),this.className=this.className||a===!1?"":ib._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(Cb," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];{if(arguments.length)return e=ib.isFunction(a),this.each(function(c){var f,g=ib(this);1===this.nodeType&&(f=e?a.call(this,c,g.val()):a,null==f?f="":"number"==typeof f?f+="":ib.isArray(f)&&(f=ib.map(f,function(a){return null==a?"":a+""})),d=ib.valHooks[this.type]||ib.valHooks[this.nodeName.toLowerCase()],d&&"set"in d&&d.set(this,f,"value")!==b||(this.value=f))});if(f)return d=ib.valHooks[f.type]||ib.valHooks[f.nodeName.toLowerCase()],d&&"get"in d&&(c=d.get(f,"value"))!==b?c:(c=f.value,"string"==typeof c?c.replace(Db,""):null==c?"":c)}}}),ib.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(ib.support.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&ib.nodeName(c.parentNode,"optgroup"))){if(b=ib(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c=ib.makeArray(b);return ib(a).find("option").each(function(){this.selected=ib.inArray(ib(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attr:function(a,c,d){var e,f,g,h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h)return typeof a.getAttribute===V?ib.prop(a,c,d):(f=1!==h||!ib.isXMLDoc(a),f&&(c=c.toLowerCase(),e=ib.attrHooks[c]||(Gb.test(c)?Bb:Ab)),d===b?e&&f&&"get"in e&&null!==(g=e.get(a,c))?g:(typeof a.getAttribute!==V&&(g=a.getAttribute(c)),null==g?b:g):null!==d?e&&f&&"set"in e&&(g=e.set(a,d,c))!==b?g:(a.setAttribute(c,d+""),d):(ib.removeAttr(a,c),void 0))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(kb);if(f&&1===a.nodeType)for(;c=f[e++];)d=ib.propFix[c]||c,Gb.test(c)?!Ib&&Hb.test(c)?a[ib.camelCase("default-"+c)]=a[d]=!1:a[d]=!1:ib.attr(a,c,""),a.removeAttribute(Ib?c:d)},attrHooks:{type:{set:function(a,b){if(!ib.support.radioValue&&"radio"===b&&ib.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h)return g=1!==h||!ib.isXMLDoc(a),g&&(c=ib.propFix[c]||c,f=ib.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):Eb.test(a.nodeName)||Fb.test(a.nodeName)&&a.href?0:b}}}}),Bb={get:function(a,c){var d=ib.prop(a,c),e="boolean"==typeof d&&a.getAttribute(c),f="boolean"==typeof d?Jb&&Ib?null!=e:Hb.test(c)?a[ib.camelCase("default-"+c)]:!!e:a.getAttributeNode(c); return f&&f.value!==!1?c.toLowerCase():b},set:function(a,b,c){return b===!1?ib.removeAttr(a,c):Jb&&Ib||!Hb.test(c)?a.setAttribute(!Ib&&ib.propFix[c]||c,c):a[ib.camelCase("default-"+c)]=a[c]=!0,c}},Jb&&Ib||(ib.attrHooks.value={get:function(a,c){var d=a.getAttributeNode(c);return ib.nodeName(a,"input")?a.defaultValue:d&&d.specified?d.value:b},set:function(a,b,c){return ib.nodeName(a,"input")?(a.defaultValue=b,void 0):Ab&&Ab.set(a,b,c)}}),Ib||(Ab=ib.valHooks.button={get:function(a,c){var d=a.getAttributeNode(c);return d&&("id"===c||"name"===c||"coords"===c?""!==d.value:d.specified)?d.value:b},set:function(a,c,d){var e=a.getAttributeNode(d);return e||a.setAttributeNode(e=a.ownerDocument.createAttribute(d)),e.value=c+="","value"===d||c===a.getAttribute(d)?c:b}},ib.attrHooks.contenteditable={get:Ab.get,set:function(a,b,c){Ab.set(a,""===b?!1:b,c)}},ib.each(["width","height"],function(a,b){ib.attrHooks[b]=ib.extend(ib.attrHooks[b],{set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}})})),ib.support.hrefNormalized||(ib.each(["href","src","width","height"],function(a,c){ib.attrHooks[c]=ib.extend(ib.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return null==d?b:d}})}),ib.each(["href","src"],function(a,b){ib.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}})),ib.support.style||(ib.attrHooks.style={get:function(a){return a.style.cssText||b},set:function(a,b){return a.style.cssText=b+""}}),ib.support.optSelected||(ib.propHooks.selected=ib.extend(ib.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),ib.support.enctype||(ib.propFix.enctype="encoding"),ib.support.checkOn||ib.each(["radio","checkbox"],function(){ib.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}}),ib.each(["radio","checkbox"],function(){ib.valHooks[this]=ib.extend(ib.valHooks[this],{set:function(a,b){return ib.isArray(b)?a.checked=ib.inArray(ib(a).val(),b)>=0:void 0}})});var Kb=/^(?:input|select|textarea)$/i,Lb=/^key/,Mb=/^(?:mouse|contextmenu)|click/,Nb=/^(?:focusinfocus|focusoutblur)$/,Ob=/^([^.]*)(?:\.(.+)|)$/;ib.event={global:{},add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=ib._data(a);if(r){for(d.handler&&(j=d,d=j.handler,f=j.selector),d.guid||(d.guid=ib.guid++),(h=r.events)||(h=r.events={}),(l=r.handle)||(l=r.handle=function(a){return typeof ib===V||a&&ib.event.triggered===a.type?b:ib.event.dispatch.apply(l.elem,arguments)},l.elem=a),c=(c||"").match(kb)||[""],i=c.length;i--;)g=Ob.exec(c[i])||[],o=q=g[1],p=(g[2]||"").split(".").sort(),k=ib.event.special[o]||{},o=(f?k.delegateType:k.bindType)||o,k=ib.event.special[o]||{},m=ib.extend({type:o,origType:q,data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&ib.expr.match.needsContext.test(f),namespace:p.join(".")},j),(n=h[o])||(n=h[o]=[],n.delegateCount=0,k.setup&&k.setup.call(a,e,p,l)!==!1||(a.addEventListener?a.addEventListener(o,l,!1):a.attachEvent&&a.attachEvent("on"+o,l))),k.add&&(k.add.call(a,m),m.handler.guid||(m.handler.guid=d.guid)),f?n.splice(n.delegateCount++,0,m):n.push(m),ib.event.global[o]=!0;a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=ib.hasData(a)&&ib._data(a);if(q&&(k=q.events)){for(b=(b||"").match(kb)||[""],j=b.length;j--;)if(h=Ob.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=ib.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=k[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;f--;)g=m[f],!e&&p!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||ib.removeEvent(a,n,q.handle),delete k[n])}else for(n in k)ib.event.remove(a,n+b[j],c,d,!0);ib.isEmptyObject(k)&&(delete q.handle,ib._removeData(a,"events"))}},trigger:function(c,d,e,f){var g,h,i,j,k,l,m,n=[e||W],o=gb.call(c,"type")?c.type:c,p=gb.call(c,"namespace")?c.namespace.split("."):[];if(i=l=e=e||W,3!==e.nodeType&&8!==e.nodeType&&!Nb.test(o+ib.event.triggered)&&(o.indexOf(".")>=0&&(p=o.split("."),o=p.shift(),p.sort()),h=o.indexOf(":")<0&&"on"+o,c=c[ib.expando]?c:new ib.Event(o,"object"==typeof c&&c),c.isTrigger=!0,c.namespace=p.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=b,c.target||(c.target=e),d=null==d?[c]:ib.makeArray(d,[c]),k=ib.event.special[o]||{},f||!k.trigger||k.trigger.apply(e,d)!==!1)){if(!f&&!k.noBubble&&!ib.isWindow(e)){for(j=k.delegateType||o,Nb.test(j+o)||(i=i.parentNode);i;i=i.parentNode)n.push(i),l=i;l===(e.ownerDocument||W)&&n.push(l.defaultView||l.parentWindow||a)}for(m=0;(i=n[m++])&&!c.isPropagationStopped();)c.type=m>1?j:k.bindType||o,g=(ib._data(i,"events")||{})[c.type]&&ib._data(i,"handle"),g&&g.apply(i,d),g=h&&i[h],g&&ib.acceptData(i)&&g.apply&&g.apply(i,d)===!1&&c.preventDefault();if(c.type=o,!(f||c.isDefaultPrevented()||k._default&&k._default.apply(e.ownerDocument,d)!==!1||"click"===o&&ib.nodeName(e,"a")||!ib.acceptData(e)||!h||!e[o]||ib.isWindow(e))){l=e[h],l&&(e[h]=null),ib.event.triggered=o;try{e[o]()}catch(q){}ib.event.triggered=b,l&&(e[h]=l)}return c.result}},dispatch:function(a){a=ib.event.fix(a);var c,d,e,f,g,h=[],i=db.call(arguments),j=(ib._data(this,"events")||{})[a.type]||[],k=ib.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){for(h=ib.event.handlers.call(this,a,j),c=0;(f=h[c++])&&!a.isPropagationStopped();)for(a.currentTarget=f.elem,g=0;(e=f.handlers[g++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,d=((ib.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),d!==b&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,c){var d,e,f,g,h=[],i=c.delegateCount,j=a.target;if(i&&j.nodeType&&(!a.button||"click"!==a.type))for(;j!=this;j=j.parentNode||this)if(1===j.nodeType&&(j.disabled!==!0||"click"!==a.type)){for(f=[],g=0;i>g;g++)e=c[g],d=e.selector+" ",f[d]===b&&(f[d]=e.needsContext?ib(d,this).index(j)>=0:ib.find(d,this,null,[j]).length),f[d]&&f.push(e);f.length&&h.push({elem:j,handlers:f})}return i<c.length&&h.push({elem:this,handlers:c.slice(i)}),h},fix:function(a){if(a[ib.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];for(g||(this.fixHooks[e]=g=Mb.test(e)?this.mouseHooks:Lb.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new ib.Event(f),b=d.length;b--;)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||W),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,f,g=c.button,h=c.fromElement;return null==a.pageX&&null!=c.clientX&&(e=a.target.ownerDocument||W,f=e.documentElement,d=e.body,a.pageX=c.clientX+(f&&f.scrollLeft||d&&d.scrollLeft||0)-(f&&f.clientLeft||d&&d.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||d&&d.scrollTop||0)-(f&&f.clientTop||d&&d.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?c.toElement:h),a.which||g===b||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},click:{trigger:function(){return ib.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0}},focus:{trigger:function(){if(this!==W.activeElement&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===W.activeElement&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},beforeunload:{postDispatch:function(a){a.result!==b&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=ib.extend(new ib.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?ib.event.trigger(e,null,b):ib.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},ib.removeEvent=W.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===V&&(a[d]=null),a.detachEvent(d,c))},ib.Event=function(a,b){return this instanceof ib.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?i:j):this.type=a,b&&ib.extend(this,b),this.timeStamp=a&&a.timeStamp||ib.now(),this[ib.expando]=!0,void 0):new ib.Event(a,b)},ib.Event.prototype={isDefaultPrevented:j,isPropagationStopped:j,isImmediatePropagationStopped:j,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=i,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=i,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i,this.stopPropagation()}},ib.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){ib.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!ib.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),ib.support.submitBubbles||(ib.event.special.submit={setup:function(){return ib.nodeName(this,"form")?!1:(ib.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=ib.nodeName(c,"input")||ib.nodeName(c,"button")?c.form:b;d&&!ib._data(d,"submitBubbles")&&(ib.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),ib._data(d,"submitBubbles",!0))}),void 0)},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&ib.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return ib.nodeName(this,"form")?!1:(ib.event.remove(this,"._submit"),void 0)}}),ib.support.changeBubbles||(ib.event.special.change={setup:function(){return Kb.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(ib.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),ib.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),ib.event.simulate("change",this,a,!0)})),!1):(ib.event.add(this,"beforeactivate._change",function(a){var b=a.target;Kb.test(b.nodeName)&&!ib._data(b,"changeBubbles")&&(ib.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||ib.event.simulate("change",this.parentNode,a,!0)}),ib._data(b,"changeBubbles",!0))}),void 0)},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return ib.event.remove(this,"._change"),!Kb.test(this.nodeName)}}),ib.support.focusinBubbles||ib.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){ib.event.simulate(b,a.target,ib.event.fix(a),!0)};ib.event.special[b]={setup:function(){0===c++&&W.addEventListener(a,d,!0)},teardown:function(){0===--c&&W.removeEventListener(a,d,!0)}}}),ib.fn.extend({on:function(a,c,d,e,f){var g,h;if("object"==typeof a){"string"!=typeof c&&(d=d||c,c=b);for(g in a)this.on(g,c,d,a[g],f);return this}if(null==d&&null==e?(e=c,d=c=b):null==e&&("string"==typeof c?(e=d,d=b):(e=d,d=c,c=b)),e===!1)e=j;else if(!e)return this;return 1===f&&(h=e,e=function(a){return ib().off(a),h.apply(this,arguments)},e.guid=h.guid||(h.guid=ib.guid++)),this.each(function(){ib.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,ib(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if("object"==typeof a){for(f in a)this.off(f,c,a[f]);return this}return(c===!1||"function"==typeof c)&&(d=c,c=b),d===!1&&(d=j),this.each(function(){ib.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){ib.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?ib.event.trigger(a,b,c,!0):void 0}}),function(a,b){function c(a){return ob.test(a+"")}function d(){var a,b=[];return a=function(c,d){return b.push(c+=" ")>y.cacheLength&&delete a[b.shift()],a[c]=d}}function e(a){return a[N]=!0,a}function f(a){var b=F.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}}function g(a,b,c,d){var e,f,g,h,i,j,k,n,o,p;if((b?b.ownerDocument||b:O)!==F&&E(b),b=b||F,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(!H&&!d){if(e=pb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&L(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return Z.apply(c,$.call(b.getElementsByTagName(a),0)),c;if((g=e[3])&&P.getByClassName&&b.getElementsByClassName)return Z.apply(c,$.call(b.getElementsByClassName(g),0)),c}if(P.qsa&&!I.test(a)){if(k=!0,n=N,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=l(a),(k=b.getAttribute("id"))?n=k.replace(sb,"\\$&"):b.setAttribute("id",n),n="[id='"+n+"'] ",i=j.length;i--;)j[i]=n+m(j[i]);o=nb.test(a)&&b.parentNode||b,p=j.join(",")}if(p)try{return Z.apply(c,$.call(o.querySelectorAll(p),0)),c}catch(q){}finally{k||b.removeAttribute("id")}}}return u(a.replace(gb,"$1"),b,c,d)}function h(a,b){var c=b&&a,d=c&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function i(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function j(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function k(a){return e(function(b){return b=+b,e(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function l(a,b){var c,d,e,f,h,i,j,k=T[a+" "];if(k)return b?0:k.slice(0);for(h=a,i=[],j=y.preFilter;h;){(!c||(d=hb.exec(h)))&&(d&&(h=h.slice(d[0].length)||h),i.push(e=[])),c=!1,(d=jb.exec(h))&&(c=d.shift(),e.push({value:c,type:d[0].replace(gb," ")}),h=h.slice(c.length));for(f in y.filter)!(d=mb[f].exec(h))||j[f]&&!(d=j[f](d))||(c=d.shift(),e.push({value:c,type:f,matches:d}),h=h.slice(c.length));if(!c)break}return b?h.length:h?g.error(a):T(a,i).slice(0)}function m(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function n(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=R++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=Q+" "+f;if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e)if(j=b[N]||(b[N]={}),(i=j[d])&&i[0]===k){if((h=i[1])===!0||h===x)return h===!0}else if(i=j[d]=[k],i[1]=a(b,c,g)||x,i[1]===!0)return!0}}function o(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function q(a,b,c,d,f,g){return d&&!d[N]&&(d=q(d)),f&&!f[N]&&(f=q(f,g)),e(function(e,g,h,i){var j,k,l,m=[],n=[],o=g.length,q=e||t(b||"*",h.nodeType?[h]:h,[]),r=!a||!e&&b?q:p(q,m,a,h,i),s=c?f||(e?a:o||d)?[]:g:r;if(c&&c(r,s,h,i),d)for(j=p(s,n),d(j,[],h,i),k=j.length;k--;)(l=j[k])&&(s[n[k]]=!(r[n[k]]=l));if(e){if(f||a){if(f){for(j=[],k=s.length;k--;)(l=s[k])&&j.push(r[k]=l);f(null,s=[],j,i)}for(k=s.length;k--;)(l=s[k])&&(j=f?_.call(e,l):m[k])>-1&&(e[j]=!(g[j]=l))}}else s=p(s===g?s.splice(o,s.length):s),f?f(null,g,s,i):Z.apply(g,s)})}function r(a){for(var b,c,d,e=a.length,f=y.relative[a[0].type],g=f||y.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return _.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==D)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=y.relative[a[h].type])k=[n(o(k),c)];else{if(c=y.filter[a[h].type].apply(null,a[h].matches),c[N]){for(d=++h;e>d&&!y.relative[a[d].type];d++);return q(h>1&&o(k),h>1&&m(a.slice(0,h-1)).replace(gb,"$1"),c,d>h&&r(a.slice(h,d)),e>d&&r(a=a.slice(d)),e>d&&m(a))}k.push(c)}return o(k)}function s(a,b){var c=0,d=b.length>0,f=a.length>0,h=function(e,h,i,j,k){var l,m,n,o=[],q=0,r="0",s=e&&[],t=null!=k,u=D,v=e||f&&y.find.TAG("*",k&&h.parentNode||h),w=Q+=null==u?1:Math.random()||.1;for(t&&(D=h!==F&&h,x=c);null!=(l=v[r]);r++){if(f&&l){for(m=0;n=a[m++];)if(n(l,h,i)){j.push(l);break}t&&(Q=w,x=++c)}d&&((l=!n&&l)&&q--,e&&s.push(l))}if(q+=r,d&&r!==q){for(m=0;n=b[m++];)n(s,o,h,i);if(e){if(q>0)for(;r--;)s[r]||o[r]||(o[r]=Y.call(j));o=p(o)}Z.apply(j,o),t&&!e&&o.length>0&&q+b.length>1&&g.uniqueSort(j)}return t&&(Q=w,D=u),s};return d?e(h):h}function t(a,b,c){for(var d=0,e=b.length;e>d;d++)g(a,b[d],c);return c}function u(a,b,c,d){var e,f,g,h,i,j=l(a);if(!d&&1===j.length){if(f=j[0]=j[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&9===b.nodeType&&!H&&y.relative[f[1].type]){if(b=y.find.ID(g.matches[0].replace(ub,vb),b)[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=mb.needsContext.test(a)?0:f.length;e--&&(g=f[e],!y.relative[h=g.type]);)if((i=y.find[h])&&(d=i(g.matches[0].replace(ub,vb),nb.test(f[0].type)&&b.parentNode||b))){if(f.splice(e,1),a=d.length&&m(f),!a)return Z.apply(c,$.call(d,0)),c;break}}return B(a,j)(d,b,H,c,nb.test(a)),c}function v(){}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P={},Q=0,R=0,S=d(),T=d(),U=d(),V=typeof b,W=1<<31,X=[],Y=X.pop,Z=X.push,$=X.slice,_=X.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},ab="[\\x20\\t\\r\\n\\f]",bb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",cb=bb.replace("w","w#"),db="([*^$|!~]?=)",eb="\\["+ab+"*("+bb+")"+ab+"*(?:"+db+ab+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+cb+")|)|)"+ab+"*\\]",fb=":("+bb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+eb.replace(3,8)+")*)|.*)\\)|)",gb=new RegExp("^"+ab+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ab+"+$","g"),hb=new RegExp("^"+ab+"*,"+ab+"*"),jb=new RegExp("^"+ab+"*([\\x20\\t\\r\\n\\f>+~])"+ab+"*"),kb=new RegExp(fb),lb=new RegExp("^"+cb+"$"),mb={ID:new RegExp("^#("+bb+")"),CLASS:new RegExp("^\\.("+bb+")"),NAME:new RegExp("^\\[name=['\"]?("+bb+")['\"]?\\]"),TAG:new RegExp("^("+bb.replace("w","w*")+")"),ATTR:new RegExp("^"+eb),PSEUDO:new RegExp("^"+fb),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ab+"*(even|odd|(([+-]|)(\\d*)n|)"+ab+"*(?:([+-]|)"+ab+"*(\\d+)|))"+ab+"*\\)|)","i"),needsContext:new RegExp("^"+ab+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ab+"*((?:-\\d)?\\d*)"+ab+"*\\)|)(?=[^-]|$)","i")},nb=/[\x20\t\r\n\f]*[+~]/,ob=/^[^{]+\{\s*\[native code/,pb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,qb=/^(?:input|select|textarea|button)$/i,rb=/^h\d$/i,sb=/'|\\/g,tb=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,ub=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,vb=function(a,b){var c="0x"+b-65536;return c!==c?b:0>c?String.fromCharCode(c+65536):String.fromCharCode(55296|c>>10,56320|1023&c)};try{$.call(O.documentElement.childNodes,0)[0].nodeType}catch(wb){$=function(a){for(var b,c=[];b=this[a++];)c.push(b);return c}}A=g.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},E=g.setDocument=function(a){var d=a?a.ownerDocument||a:O;return d!==F&&9===d.nodeType&&d.documentElement?(F=d,G=d.documentElement,H=A(d),P.tagNameNoComments=f(function(a){return a.appendChild(d.createComment("")),!a.getElementsByTagName("*").length}),P.attributes=f(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return"boolean"!==b&&"string"!==b}),P.getByClassName=f(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",a.getElementsByClassName&&a.getElementsByClassName("e").length?(a.lastChild.className="e",2===a.getElementsByClassName("e").length):!1}),P.getByName=f(function(a){a.id=N+0,a.innerHTML="<a name='"+N+"'></a><div name='"+N+"'></div>",G.insertBefore(a,G.firstChild);var b=d.getElementsByName&&d.getElementsByName(N).length===2+d.getElementsByName(N+0).length;return P.getIdNotName=!d.getElementById(N),G.removeChild(a),b}),y.attrHandle=f(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==V&&"#"===a.firstChild.getAttribute("href")})?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},P.getIdNotName?(y.find.ID=function(a,b){if(typeof b.getElementById!==V&&!H){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},y.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){return a.getAttribute("id")===b}}):(y.find.ID=function(a,c){if(typeof c.getElementById!==V&&!H){var d=c.getElementById(a);return d?d.id===a||typeof d.getAttributeNode!==V&&d.getAttributeNode("id").value===a?[d]:b:[]}},y.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),y.find.TAG=P.tagNameNoComments?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},y.find.NAME=P.getByName&&function(a,b){return typeof b.getElementsByName!==V?b.getElementsByName(name):void 0},y.find.CLASS=P.getByClassName&&function(a,b){return typeof b.getElementsByClassName===V||H?void 0:b.getElementsByClassName(a)},J=[],I=[":focus"],(P.qsa=c(d.querySelectorAll))&&(f(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||I.push("\\["+ab+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||I.push(":checked")}),f(function(a){a.innerHTML="<input type='hidden' i=''/>",a.querySelectorAll("[i^='']").length&&I.push("[*^$]="+ab+"*(?:\"\"|'')"),a.querySelectorAll(":enabled").length||I.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),I.push(",.*:")})),(P.matchesSelector=c(K=G.matchesSelector||G.mozMatchesSelector||G.webkitMatchesSelector||G.oMatchesSelector||G.msMatchesSelector))&&f(function(a){P.disconnectedMatch=K.call(a,"div"),K.call(a,"[s!='']:x"),J.push("!=",fb)}),I=new RegExp(I.join("|")),J=new RegExp(J.join("|")),L=c(G.contains)||G.compareDocumentPosition?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},M=G.compareDocumentPosition?function(a,b){var c;return a===b?(C=!0,0):(c=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b))?1&c||a.parentNode&&11===a.parentNode.nodeType?a===d||L(O,a)?-1:b===d||L(O,b)?1:0:4&c?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var c,e=0,f=a.parentNode,g=b.parentNode,i=[a],j=[b];if(a===b)return C=!0,0;if(!f||!g)return a===d?-1:b===d?1:f?-1:g?1:0;if(f===g)return h(a,b);for(c=a;c=c.parentNode;)i.unshift(c);for(c=b;c=c.parentNode;)j.unshift(c);for(;i[e]===j[e];)e++;return e?h(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},C=!1,[0,0].sort(M),P.detectDuplicates=C,F):F},g.matches=function(a,b){return g(a,null,null,b)},g.matchesSelector=function(a,b){if((a.ownerDocument||a)!==F&&E(a),b=b.replace(tb,"='$1']"),!(!P.matchesSelector||H||J&&J.test(b)||I.test(b)))try{var c=K.call(a,b);if(c||P.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(d){}return g(b,F,null,[a]).length>0},g.contains=function(a,b){return(a.ownerDocument||a)!==F&&E(a),L(a,b)},g.attr=function(a,b){var c;return(a.ownerDocument||a)!==F&&E(a),H||(b=b.toLowerCase()),(c=y.attrHandle[b])?c(a):H||P.attributes?a.getAttribute(b):((c=a.getAttributeNode(b))||a.getAttribute(b))&&a[b]===!0?b:c&&c.specified?c.value:null},g.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},g.uniqueSort=function(a){var b,c=[],d=1,e=0;if(C=!P.detectDuplicates,a.sort(M),C){for(;b=a[d];d++)b===a[d-1]&&(e=c.push(d));for(;e--;)a.splice(c[e],1)}return a},z=g.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=z(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=z(b);return c},y=g.selectors={cacheLength:50,createPseudo:e,match:mb,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ub,vb),a[3]=(a[4]||a[5]||"").replace(ub,vb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||g.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&g.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return mb.CHILD.test(a[0])?null:(a[4]?a[2]=a[4]:c&&kb.test(c)&&(b=l(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){return"*"===a?function(){return!0}:(a=a.replace(ub,vb).toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=S[a+" "];return b||(b=new RegExp("(^|"+ab+")"+a+"("+ab+"|$)"))&&S(a,function(a){return b.test(a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=g.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===Q&&j[1],m=j[0]===Q&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[Q,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===Q)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[Q,m]),l!==b)););return m-=e,m===d||0===m%d&&m/d>=0}}},PSEUDO:function(a,b){var c,d=y.pseudos[a]||y.setFilters[a.toLowerCase()]||g.error("unsupported pseudo: "+a);return d[N]?d(b):d.length>1?(c=[a,a,"",b],y.setFilters.hasOwnProperty(a.toLowerCase())?e(function(a,c){for(var e,f=d(a,b),g=f.length;g--;)e=_.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:e(function(a){var b=[],c=[],d=B(a.replace(gb,"$1"));return d[N]?e(function(a,b,c,e){for(var f,g=d(a,null,e,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:e(function(a){return function(b){return g(a,b).length>0}}),contains:e(function(a){return function(b){return(b.textContent||b.innerText||z(b)).indexOf(a)>-1}}),lang:e(function(a){return lb.test(a||"")||g.error("unsupported lang: "+a),a=a.replace(ub,vb).toLowerCase(),function(b){var c;do if(c=H?b.getAttribute("xml:lang")||b.getAttribute("lang"):b.lang)return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===G},focus:function(a){return a===F.activeElement&&(!F.hasFocus||F.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeName>"@"||3===a.nodeType||4===a.nodeType)return!1;return!0},parent:function(a){return!y.pseudos.empty(a)},header:function(a){return rb.test(a.nodeName)},input:function(a){return qb.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||b.toLowerCase()===a.type)},first:k(function(){return[0]}),last:k(function(a,b){return[b-1]}),eq:k(function(a,b,c){return[0>c?c+b:c]}),even:k(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:k(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:k(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:k(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})y.pseudos[w]=i(w);for(w in{submit:!0,reset:!0})y.pseudos[w]=j(w);B=g.compile=function(a,b){var c,d=[],e=[],f=U[a+" "];if(!f){for(b||(b=l(a)),c=b.length;c--;)f=r(b[c]),f[N]?d.push(f):e.push(f);f=U(a,s(e,d))}return f},y.pseudos.nth=y.pseudos.eq,y.filters=v.prototype=y.pseudos,y.setFilters=new v,E(),g.attr=ib.attr,ib.find=g,ib.expr=g.selectors,ib.expr[":"]=ib.expr.pseudos,ib.unique=g.uniqueSort,ib.text=g.getText,ib.isXMLDoc=g.isXML,ib.contains=g.contains}(a);var Pb=/Until$/,Qb=/^(?:parents|prev(?:Until|All))/,Rb=/^.[^:#\[\.,]*$/,Sb=ib.expr.match.needsContext,Tb={children:!0,contents:!0,next:!0,prev:!0};ib.fn.extend({find:function(a){var b,c,d,e=this.length;if("string"!=typeof a)return d=this,this.pushStack(ib(a).filter(function(){for(b=0;e>b;b++)if(ib.contains(d[b],this))return!0}));for(c=[],b=0;e>b;b++)ib.find(a,this[b],c);return c=this.pushStack(e>1?ib.unique(c):c),c.selector=(this.selector?this.selector+" ":"")+a,c},has:function(a){var b,c=ib(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(ib.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(l(this,a,!1))},filter:function(a){return this.pushStack(l(this,a,!0))},is:function(a){return!!a&&("string"==typeof a?Sb.test(a)?ib(a,this.context).index(this[0])>=0:ib.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=Sb.test(a)||"string"!=typeof a?ib(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c.ownerDocument&&c!==b&&11!==c.nodeType;){if(g?g.index(c)>-1:ib.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}return this.pushStack(f.length>1?ib.unique(f):f)},index:function(a){return a?"string"==typeof a?ib.inArray(this[0],ib(a)):ib.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){var c="string"==typeof a?ib(a,b):ib.makeArray(a&&a.nodeType?[a]:a),d=ib.merge(this.get(),c);return this.pushStack(ib.unique(d))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),ib.fn.andSelf=ib.fn.addBack,ib.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return ib.dir(a,"parentNode")},parentsUntil:function(a,b,c){return ib.dir(a,"parentNode",c) },next:function(a){return k(a,"nextSibling")},prev:function(a){return k(a,"previousSibling")},nextAll:function(a){return ib.dir(a,"nextSibling")},prevAll:function(a){return ib.dir(a,"previousSibling")},nextUntil:function(a,b,c){return ib.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return ib.dir(a,"previousSibling",c)},siblings:function(a){return ib.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return ib.sibling(a.firstChild)},contents:function(a){return ib.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:ib.merge([],a.childNodes)}},function(a,b){ib.fn[a]=function(c,d){var e=ib.map(this,b,c);return Pb.test(a)||(d=c),d&&"string"==typeof d&&(e=ib.filter(d,e)),e=this.length>1&&!Tb[a]?ib.unique(e):e,this.length>1&&Qb.test(a)&&(e=e.reverse()),this.pushStack(e)}}),ib.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?ib.find.matchesSelector(b[0],a)?[b[0]]:[]:ib.find.matches(a,b)},dir:function(a,c,d){for(var e=[],f=a[c];f&&9!==f.nodeType&&(d===b||1!==f.nodeType||!ib(f).is(d));)1===f.nodeType&&e.push(f),f=f[c];return e},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var Ub="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Vb=/ jQuery\d+="(?:null|\d+)"/g,Wb=new RegExp("<(?:"+Ub+")[\\s/>]","i"),Xb=/^\s+/,Yb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Zb=/<([\w:]+)/,$b=/<tbody/i,_b=/<|&#?\w+;/,ac=/<(?:script|style|link)/i,bc=/^(?:checkbox|radio)$/i,cc=/checked\s*(?:[^=]|=\s*.checked.)/i,dc=/^$|\/(?:java|ecma)script/i,ec=/^true\/(.*)/,fc=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,gc={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:ib.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},hc=m(W),ic=hc.appendChild(W.createElement("div"));gc.optgroup=gc.option,gc.tbody=gc.tfoot=gc.colgroup=gc.caption=gc.thead,gc.th=gc.td,ib.fn.extend({text:function(a){return ib.access(this,function(a){return a===b?ib.text(this):this.empty().append((this[0]&&this[0].ownerDocument||W).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(ib.isFunction(a))return this.each(function(b){ib(this).wrapAll(a.call(this,b))});if(this[0]){var b=ib(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return ib.isFunction(a)?this.each(function(b){ib(this).wrapInner(a.call(this,b))}):this.each(function(){var b=ib(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=ib.isFunction(a);return this.each(function(c){ib(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){ib.nodeName(this,"body")||ib(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(a,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,!1,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=0;null!=(c=this[d]);d++)(!a||ib.filter(a,[c]).length>0)&&(b||1!==c.nodeType||ib.cleanData(t(c)),c.parentNode&&(b&&ib.contains(c.ownerDocument,c)&&q(t(c,"script")),c.parentNode.removeChild(c)));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){for(1===a.nodeType&&ib.cleanData(t(a,!1));a.firstChild;)a.removeChild(a.firstChild);a.options&&ib.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return ib.clone(this,a,b)})},html:function(a){return ib.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(Vb,""):b;if(!("string"!=typeof a||ac.test(a)||!ib.support.htmlSerialize&&Wb.test(a)||!ib.support.leadingWhitespace&&Xb.test(a)||gc[(Zb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Yb,"<$1></$2>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&(ib.cleanData(t(c,!1)),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){var b=ib.isFunction(a);return b||"string"==typeof a||(a=ib(a).not(this).detach()),this.domManip([a],!0,function(a){var b=this.nextSibling,c=this.parentNode;c&&(ib(this).remove(),c.insertBefore(a,b))})},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=bb.apply([],a);var e,f,g,h,i,j,k=0,l=this.length,m=this,q=l-1,r=a[0],s=ib.isFunction(r);if(s||!(1>=l||"string"!=typeof r||ib.support.checkClone)&&cc.test(r))return this.each(function(e){var f=m.eq(e);s&&(a[0]=r.call(this,e,c?f.html():b)),f.domManip(a,c,d)});if(l&&(j=ib.buildFragment(a,this[0].ownerDocument,!1,this),e=j.firstChild,1===j.childNodes.length&&(j=e),e)){for(c=c&&ib.nodeName(e,"tr"),h=ib.map(t(j,"script"),o),g=h.length;l>k;k++)f=j,k!==q&&(f=ib.clone(f,!0,!0),g&&ib.merge(h,t(f,"script"))),d.call(c&&ib.nodeName(this[k],"table")?n(this[k],"tbody"):this[k],f,k);if(g)for(i=h[h.length-1].ownerDocument,ib.map(h,p),k=0;g>k;k++)f=h[k],dc.test(f.type||"")&&!ib._data(f,"globalEval")&&ib.contains(i,f)&&(f.src?ib.ajax({url:f.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):ib.globalEval((f.text||f.textContent||f.innerHTML||"").replace(fc,"")));j=e=null}return this}}),ib.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){ib.fn[a]=function(a){for(var c,d=0,e=[],f=ib(a),g=f.length-1;g>=d;d++)c=d===g?this:this.clone(!0),ib(f[d])[b](c),cb.apply(e,c.get());return this.pushStack(e)}}),ib.extend({clone:function(a,b,c){var d,e,f,g,h,i=ib.contains(a.ownerDocument,a);if(ib.support.html5Clone||ib.isXMLDoc(a)||!Wb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ic.innerHTML=a.outerHTML,ic.removeChild(f=ic.firstChild)),!(ib.support.noCloneEvent&&ib.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||ib.isXMLDoc(a)))for(d=t(f),h=t(a),g=0;null!=(e=h[g]);++g)d[g]&&s(e,d[g]);if(b)if(c)for(h=h||t(a),d=d||t(f),g=0;null!=(e=h[g]);g++)r(e,d[g]);else r(a,f);return d=t(f,"script"),d.length>0&&q(d,!i&&t(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,l=a.length,n=m(b),o=[],p=0;l>p;p++)if(f=a[p],f||0===f)if("object"===ib.type(f))ib.merge(o,f.nodeType?[f]:f);else if(_b.test(f)){for(h=h||n.appendChild(b.createElement("div")),i=(Zb.exec(f)||["",""])[1].toLowerCase(),k=gc[i]||gc._default,h.innerHTML=k[1]+f.replace(Yb,"<$1></$2>")+k[2],e=k[0];e--;)h=h.lastChild;if(!ib.support.leadingWhitespace&&Xb.test(f)&&o.push(b.createTextNode(Xb.exec(f)[0])),!ib.support.tbody)for(f="table"!==i||$b.test(f)?"<table>"!==k[1]||$b.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;e--;)ib.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j);for(ib.merge(o,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=n.lastChild}else o.push(b.createTextNode(f));for(h&&n.removeChild(h),ib.support.appendChecked||ib.grep(t(o,"input"),u),p=0;f=o[p++];)if((!d||-1===ib.inArray(f,d))&&(g=ib.contains(f.ownerDocument,f),h=t(n.appendChild(f),"script"),g&&q(h),c))for(e=0;f=h[e++];)dc.test(f.type||"")&&c.push(f);return h=null,n},cleanData:function(a,b){for(var c,d,e,f,g=0,h=ib.expando,i=ib.cache,j=ib.support.deleteExpando,k=ib.event.special;null!=(c=a[g]);g++)if((b||ib.acceptData(c))&&(e=c[h],f=e&&i[e])){if(f.events)for(d in f.events)k[d]?ib.event.remove(c,d):ib.removeEvent(c,d,f.handle);i[e]&&(delete i[e],j?delete c[h]:typeof c.removeAttribute!==V?c.removeAttribute(h):c[h]=null,_.push(e))}}});var jc,kc,lc,mc=/alpha\([^)]*\)/i,nc=/opacity\s*=\s*([^)]*)/,oc=/^(top|right|bottom|left)$/,pc=/^(none|table(?!-c[ea]).+)/,qc=/^margin/,rc=new RegExp("^("+jb+")(.*)$","i"),sc=new RegExp("^("+jb+")(?!px)[a-z%]+$","i"),tc=new RegExp("^([+-])=("+jb+")","i"),uc={BODY:"block"},vc={position:"absolute",visibility:"hidden",display:"block"},wc={letterSpacing:0,fontWeight:400},xc=["Top","Right","Bottom","Left"],yc=["Webkit","O","Moz","ms"];ib.fn.extend({css:function(a,c){return ib.access(this,function(a,c,d){var e,f,g={},h=0;if(ib.isArray(c)){for(f=kc(a),e=c.length;e>h;h++)g[c[h]]=ib.css(a,c[h],!1,f);return g}return d!==b?ib.style(a,c,d):ib.css(a,c)},a,c,arguments.length>1)},show:function(){return x(this,!0)},hide:function(){return x(this)},toggle:function(a){var b="boolean"==typeof a;return this.each(function(){(b?a:w(this))?ib(this).show():ib(this).hide()})}}),ib.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=lc(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":ib.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=ib.camelCase(c),j=a.style;if(c=ib.cssProps[i]||(ib.cssProps[i]=v(j,i)),h=ib.cssHooks[c]||ib.cssHooks[i],d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];if(g=typeof d,"string"===g&&(f=tc.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(ib.css(a,c)),g="number"),!(null==d||"number"===g&&isNaN(d)||("number"!==g||ib.cssNumber[i]||(d+="px"),ib.support.clearCloneStyle||""!==d||0!==c.indexOf("background")||(j[c]="inherit"),h&&"set"in h&&(d=h.set(a,d,e))===b)))try{j[c]=d}catch(k){}}},css:function(a,c,d,e){var f,g,h,i=ib.camelCase(c);return c=ib.cssProps[i]||(ib.cssProps[i]=v(a.style,i)),h=ib.cssHooks[c]||ib.cssHooks[i],h&&"get"in h&&(g=h.get(a,!0,d)),g===b&&(g=lc(a,c,e)),"normal"===g&&c in wc&&(g=wc[c]),""===d||d?(f=parseFloat(g),d===!0||ib.isNumeric(f)?f||0:g):g},swap:function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e}}),a.getComputedStyle?(kc=function(b){return a.getComputedStyle(b,null)},lc=function(a,c,d){var e,f,g,h=d||kc(a),i=h?h.getPropertyValue(c)||h[c]:b,j=a.style;return h&&(""!==i||ib.contains(a.ownerDocument,a)||(i=ib.style(a,c)),sc.test(i)&&qc.test(c)&&(e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=i,i=h.width,j.width=e,j.minWidth=f,j.maxWidth=g)),i}):W.documentElement.currentStyle&&(kc=function(a){return a.currentStyle},lc=function(a,c,d){var e,f,g,h=d||kc(a),i=h?h[c]:b,j=a.style;return null==i&&j&&j[c]&&(i=j[c]),sc.test(i)&&!oc.test(c)&&(e=j.left,f=a.runtimeStyle,g=f&&f.left,g&&(f.left=a.currentStyle.left),j.left="fontSize"===c?"1em":i,i=j.pixelLeft+"px",j.left=e,g&&(f.left=g)),""===i?"auto":i}),ib.each(["height","width"],function(a,b){ib.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&pc.test(ib.css(a,"display"))?ib.swap(a,vc,function(){return A(a,b,d)}):A(a,b,d):void 0},set:function(a,c,d){var e=d&&kc(a);return y(a,c,d?z(a,b,d,ib.support.boxSizing&&"border-box"===ib.css(a,"boxSizing",!1,e),e):0)}}}),ib.support.opacity||(ib.cssHooks.opacity={get:function(a,b){return nc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=ib.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===ib.trim(f.replace(mc,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=mc.test(f)?f.replace(mc,e):f+" "+e)}}),ib(function(){ib.support.reliableMarginRight||(ib.cssHooks.marginRight={get:function(a,b){return b?ib.swap(a,{display:"inline-block"},lc,[a,"marginRight"]):void 0}}),!ib.support.pixelPosition&&ib.fn.position&&ib.each(["top","left"],function(a,b){ib.cssHooks[b]={get:function(a,c){return c?(c=lc(a,b),sc.test(c)?ib(a).position()[b]+"px":c):void 0}}})}),ib.expr&&ib.expr.filters&&(ib.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!ib.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||ib.css(a,"display"))},ib.expr.filters.visible=function(a){return!ib.expr.filters.hidden(a)}),ib.each({margin:"",padding:"",border:"Width"},function(a,b){ib.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+xc[d]+b]=f[d]||f[d-2]||f[0];return e}},qc.test(a)||(ib.cssHooks[a+b].set=y)});var zc=/%20/g,Ac=/\[\]$/,Bc=/\r?\n/g,Cc=/^(?:submit|button|image|reset|file)$/i,Dc=/^(?:input|select|textarea|keygen)/i;ib.fn.extend({serialize:function(){return ib.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=ib.prop(this,"elements");return a?ib.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!ib(this).is(":disabled")&&Dc.test(this.nodeName)&&!Cc.test(a)&&(this.checked||!bc.test(a))}).map(function(a,b){var c=ib(this).val();return null==c?null:ib.isArray(c)?ib.map(c,function(a){return{name:b.name,value:a.replace(Bc,"\r\n")}}):{name:b.name,value:c.replace(Bc,"\r\n")}}).get()}}),ib.param=function(a,c){var d,e=[],f=function(a,b){b=ib.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=ib.ajaxSettings&&ib.ajaxSettings.traditional),ib.isArray(a)||a.jquery&&!ib.isPlainObject(a))ib.each(a,function(){f(this.name,this.value)});else for(d in a)D(d,a[d],c,f);return e.join("&").replace(zc,"+")},ib.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){ib.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),ib.fn.hover=function(a,b){return this.mouseenter(a).mouseleave(b||a)};var Ec,Fc,Gc=ib.now(),Hc=/\?/,Ic=/#.*$/,Jc=/([?&])_=[^&]*/,Kc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Lc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mc=/^(?:GET|HEAD)$/,Nc=/^\/\//,Oc=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Pc=ib.fn.load,Qc={},Rc={},Sc="*/".concat("*");try{Fc=X.href}catch(Tc){Fc=W.createElement("a"),Fc.href="",Fc=Fc.href}Ec=Oc.exec(Fc.toLowerCase())||[],ib.fn.load=function(a,c,d){if("string"!=typeof a&&Pc)return Pc.apply(this,arguments);var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),ib.isFunction(c)?(d=c,c=b):c&&"object"==typeof c&&(g="POST"),h.length>0&&ib.ajax({url:a,type:g,dataType:"html",data:c}).done(function(a){f=arguments,h.html(e?ib("<div>").append(ib.parseHTML(a)).find(e):a)}).complete(d&&function(a,b){h.each(d,f||[a.responseText,b,a])}),this},ib.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){ib.fn[b]=function(a){return this.on(b,a)}}),ib.each(["get","post"],function(a,c){ib[c]=function(a,d,e,f){return ib.isFunction(d)&&(f=f||e,e=d,d=b),ib.ajax({url:a,type:c,dataType:f,data:d,success:e})}}),ib.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Fc,type:"GET",isLocal:Lc.test(Ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Sc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":ib.parseJSON,"text xml":ib.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?G(G(a,ib.ajaxSettings),b):G(ib.ajaxSettings,a)},ajaxPrefilter:E(Qc),ajaxTransport:E(Rc),ajax:function(a,c){function d(a,c,d,e){var f,l,s,t,v,x=c;2!==u&&(u=2,i&&clearTimeout(i),k=b,h=e||"",w.readyState=a>0?4:0,d&&(t=H(m,w,d)),a>=200&&300>a||304===a?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&(ib.lastModified[g]=v),v=w.getResponseHeader("etag"),v&&(ib.etag[g]=v)),204===a?(f=!0,x="nocontent"):304===a?(f=!0,x="notmodified"):(f=I(m,t),x=f.state,l=f.data,s=f.error,f=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),w.status=a,w.statusText=(c||x)+"",f?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=b,j&&o.trigger(f?"ajaxSuccess":"ajaxError",[w,m,f?l:s]),q.fireWith(n,[w,x]),j&&(o.trigger("ajaxComplete",[w,m]),--ib.active||ib.event.trigger("ajaxStop")))}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,j,k,l,m=ib.ajaxSetup({},c),n=m.context||m,o=m.context&&(n.nodeType||n.jquery)?ib(n):ib.event,p=ib.Deferred(),q=ib.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!l)for(l={};b=Kc.exec(h);)l[b[1].toLowerCase()]=b[2];b=l[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?h:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return k&&k.abort(b),d(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,m.url=((a||m.url||Fc)+"").replace(Ic,"").replace(Nc,Ec[1]+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=ib.trim(m.dataType||"*").toLowerCase().match(kb)||[""],null==m.crossDomain&&(e=Oc.exec(m.url.toLowerCase()),m.crossDomain=!(!e||e[1]===Ec[1]&&e[2]===Ec[2]&&(e[3]||("http:"===e[1]?80:443))==(Ec[3]||("http:"===Ec[1]?80:443)))),m.data&&m.processData&&"string"!=typeof m.data&&(m.data=ib.param(m.data,m.traditional)),F(Qc,m,c,w),2===u)return w;j=m.global,j&&0===ib.active++&&ib.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Mc.test(m.type),g=m.url,m.hasContent||(m.data&&(g=m.url+=(Hc.test(g)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=Jc.test(g)?g.replace(Jc,"$1_="+Gc++):g+(Hc.test(g)?"&":"?")+"_="+Gc++)),m.ifModified&&(ib.lastModified[g]&&w.setRequestHeader("If-Modified-Since",ib.lastModified[g]),ib.etag[g]&&w.setRequestHeader("If-None-Match",ib.etag[g])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Sc+"; q=0.01":""):m.accepts["*"]);for(f in m.headers)w.setRequestHeader(f,m.headers[f]);if(m.beforeSend&&(m.beforeSend.call(n,w,m)===!1||2===u))return w.abort();v="abort";for(f in{success:1,error:1,complete:1})w[f](m[f]);if(k=F(Rc,m,c,w)){w.readyState=1,j&&o.trigger("ajaxSend",[w,m]),m.async&&m.timeout>0&&(i=setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,k.send(s,d)}catch(x){if(!(2>u))throw x;d(-1,x)}}else d(-1,"No Transport");return w},getScript:function(a,c){return ib.get(a,b,c,"script")},getJSON:function(a,b,c){return ib.get(a,b,c,"json")}}),ib.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return ib.globalEval(a),a}}}),ib.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),ib.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=W.head||ib("head")[0]||W.documentElement;return{send:function(b,e){c=W.createElement("script"),c.async=!0,a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,b){(b||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,c.parentNode&&c.parentNode.removeChild(c),c=null,b||e(200,"success"))},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(b,!0)}}}});var Uc=[],Vc=/(=)\?(?=&|$)|\?\?/;ib.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Uc.pop()||ib.expando+"_"+Gc++;return this[a]=!0,a}}),ib.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.jsonp!==!1&&(Vc.test(c.url)?"url":"string"==typeof c.data&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vc.test(c.data)&&"data");return i||"jsonp"===c.dataTypes[0]?(f=c.jsonpCallback=ib.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,i?c[i]=c[i].replace(Vc,"$1"+f):c.jsonp!==!1&&(c.url+=(Hc.test(c.url)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||ib.error(f+" was not called"),h[0]},c.dataTypes[0]="json",g=a[f],a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,Uc.push(f)),h&&ib.isFunction(g)&&g(h[0]),h=g=b}),"script"):void 0});var Wc,Xc,Yc=0,Zc=a.ActiveXObject&&function(){var a;for(a in Wc)Wc[a](b,!0)};ib.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&J()||K()}:J,Xc=ib.ajaxSettings.xhr(),ib.support.cors=!!Xc&&"withCredentials"in Xc,Xc=ib.support.ajax=!!Xc,Xc&&ib.ajaxTransport(function(c){if(!c.crossDomain||ib.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();if(c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async),c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l;try{if(d&&(e||4===i.readyState))if(d=b,g&&(i.onreadystatechange=ib.noop,Zc&&delete Wc[g]),e)4!==i.readyState&&i.abort();else{l={},h=i.status,j=i.getAllResponseHeaders(),"string"==typeof i.responseText&&(l.text=i.responseText);try{k=i.statusText}catch(m){k=""}h||!c.isLocal||c.crossDomain?1223===h&&(h=204):h=l.text?200:404}}catch(n){e||f(-1,n)}l&&f(h,k,l,j)},c.async?4===i.readyState?setTimeout(d):(g=++Yc,Zc&&(Wc||(Wc={},ib(a).unload(Zc)),Wc[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(b,!0)}}}});var $c,_c,ad=/^(?:toggle|show|hide)$/,bd=new RegExp("^(?:([+-])=|)("+jb+")([a-z%]*)$","i"),cd=/queueHooks$/,dd=[P],ed={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=bd.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){if(c=+f[2],d=f[3]||(ib.cssNumber[a]?"":"px"),"px"!==d&&h){h=ib.css(e.elem,a,!0)||c||1;do i=i||".5",h/=i,ib.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&1!==i&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};ib.Animation=ib.extend(N,{tweener:function(a,b){ib.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ed[c]=ed[c]||[],ed[c].unshift(b)},prefilter:function(a,b){b?dd.unshift(a):dd.push(a)}}),ib.Tween=Q,Q.prototype={constructor:Q,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(ib.cssNumber[c]?"":"px")},cur:function(){var a=Q.propHooks[this.prop];return a&&a.get?a.get(this):Q.propHooks._default.get(this)},run:function(a){var b,c=Q.propHooks[this.prop];return this.pos=b=this.options.duration?ib.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Q.propHooks._default.set(this),this}},Q.prototype.init.prototype=Q.prototype,Q.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=ib.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){ib.fx.step[a.prop]?ib.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[ib.cssProps[a.prop]]||ib.cssHooks[a.prop])?ib.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Q.propHooks.scrollTop=Q.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},ib.each(["toggle","show","hide"],function(a,b){var c=ib.fn[b];ib.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(R(b,!0),a,d,e)}}),ib.fn.extend({fadeTo:function(a,b,c,d){return this.filter(w).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=ib.isEmptyObject(a),f=ib.speed(b,c,d),g=function(){var b=N(this,ib.extend({},a),f);g.finish=function(){b.stop(!0)},(e||ib._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=null!=a&&a+"queueHooks",f=ib.timers,g=ib._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cd.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem!==this||null!=a&&f[c].queue!==a||(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&ib.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=ib._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=ib.timers,g=d?d.length:0;for(c.finish=!0,ib.queue(this,a,[]),e&&e.cur&&e.cur.finish&&e.cur.finish.call(this),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),ib.each({slideDown:R("show"),slideUp:R("hide"),slideToggle:R("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){ib.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),ib.speed=function(a,b,c){var d=a&&"object"==typeof a?ib.extend({},a):{complete:c||!c&&b||ib.isFunction(a)&&a,duration:a,easing:c&&b||b&&!ib.isFunction(b)&&b};return d.duration=ib.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in ib.fx.speeds?ib.fx.speeds[d.duration]:ib.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){ib.isFunction(d.old)&&d.old.call(this),d.queue&&ib.dequeue(this,d.queue)},d},ib.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},ib.timers=[],ib.fx=Q.prototype.init,ib.fx.tick=function(){var a,c=ib.timers,d=0;for($c=ib.now();d<c.length;d++)a=c[d],a()||c[d]!==a||c.splice(d--,1);c.length||ib.fx.stop(),$c=b},ib.fx.timer=function(a){a()&&ib.timers.push(a)&&ib.fx.start()},ib.fx.interval=13,ib.fx.start=function(){_c||(_c=setInterval(ib.fx.tick,ib.fx.interval))},ib.fx.stop=function(){clearInterval(_c),_c=null},ib.fx.speeds={slow:600,fast:200,_default:400},ib.fx.step={},ib.expr&&ib.expr.filters&&(ib.expr.filters.animated=function(a){return ib.grep(ib.timers,function(b){return a===b.elem}).length}),ib.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){ib.offset.setOffset(this,a,b)});var c,d,e={top:0,left:0},f=this[0],g=f&&f.ownerDocument;if(g)return c=g.documentElement,ib.contains(c,f)?(typeof f.getBoundingClientRect!==V&&(e=f.getBoundingClientRect()),d=S(g),{top:e.top+(d.pageYOffset||c.scrollTop)-(c.clientTop||0),left:e.left+(d.pageXOffset||c.scrollLeft)-(c.clientLeft||0)}):e},ib.offset={setOffset:function(a,b,c){var d=ib.css(a,"position");"static"===d&&(a.style.position="relative");var e,f,g=ib(a),h=g.offset(),i=ib.css(a,"top"),j=ib.css(a,"left"),k=("absolute"===d||"fixed"===d)&&ib.inArray("auto",[i,j])>-1,l={},m={};k?(m=g.position(),e=m.top,f=m.left):(e=parseFloat(i)||0,f=parseFloat(j)||0),ib.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(l.top=b.top-h.top+e),null!=b.left&&(l.left=b.left-h.left+f),"using"in b?b.using.call(a,l):g.css(l)}},ib.fn.extend({position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===ib.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),ib.nodeName(a[0],"html")||(c=a.offset()),c.top+=ib.css(a[0],"borderTopWidth",!0),c.left+=ib.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-ib.css(d,"marginTop",!0),left:b.left-c.left-ib.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||W.documentElement;a&&!ib.nodeName(a,"html")&&"static"===ib.css(a,"position");)a=a.offsetParent;return a||W.documentElement})}}),ib.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);ib.fn[a]=function(e){return ib.access(this,function(a,e,f){var g=S(a);return f===b?g?c in g?g[c]:g.document.documentElement[e]:a[e]:(g?g.scrollTo(d?ib(g).scrollLeft():f,d?f:ib(g).scrollTop()):a[e]=f,void 0)},a,e,arguments.length,null)}}),ib.each({Height:"height",Width:"width"},function(a,c){ib.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){ib.fn[e]=function(e,f){var g=arguments.length&&(d||"boolean"!=typeof e),h=d||(e===!0||f===!0?"margin":"border");return ib.access(this,function(c,d,e){var f;return ib.isWindow(c)?c.document.documentElement["client"+a]:9===c.nodeType?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?ib.css(c,d,h):ib.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=ib,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return ib})}(window),function(){function a(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d<e;)if(a[d]===b)return d;return-1}function b(b,c){var d=typeof c;if(b=b.cache,"boolean"==d||null==c)return b[c]?0:-1;"number"!=d&&"string"!=d&&(d="object");var e="number"==d?c:s+c;return b=(b=b[d])&&b[e],"object"==d?b&&a(b,c)>-1?0:-1:b?0:-1}function c(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:s+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function d(a){return a.charCodeAt(0)}function e(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||"undefined"==typeof c)return 1;if(d>c||"undefined"==typeof d)return-1}return a.index-b.index}function f(a){var b=-1,d=a.length,e=a[0],f=a[0|d/2],g=a[d-1];if(e&&"object"==typeof e&&f&&"object"==typeof f&&g&&"object"==typeof g)return!1;var h=i();h["false"]=h["null"]=h["true"]=h.undefined=!1;var j=i();for(j.array=a,j.cache=h,j.push=c;++b<d;)j.push(a[b]);return j}function g(a){return"\\"+W[a]}function h(){return p.pop()||[]}function i(){return q.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function j(){}function k(a){a.length=0,p.length<u&&p.push(a)}function l(a){var b=a.cache;b&&l(b),a.array=a.cache=a.criteria=a.object=a.number=a.string=a.value=null,q.length<u&&q.push(a)}function m(a,b,c){b||(b=0),"undefined"==typeof c&&(c=a?a.length:0);for(var d=-1,e=c-b||0,f=Array(0>e?0:e);++d<e;)f[d]=a[b+d];return f}function n(c){function p(a){return a&&"object"==typeof a&&!Xd(a)&&yd.call(a,"__wrapped__")?a:new q(a)}function q(a,b){this.__chain__=!!b,this.__wrapped__=a}function u(a,b,c,d,e){if(c){var f=c(a);if("undefined"!=typeof f)return f}var g=Ab(a);if(!g)return a;var i=Ed.call(a);if(!S[i])return a;var j=Ud[i];switch(i){case L:case M:return new j(+a);case O:case R:return new j(a);case Q:return f=j(a.source,A.exec(a)),f.lastIndex=a.lastIndex,f}var l=Xd(a);if(b){var n=!d;d||(d=h()),e||(e=h());for(var o=d.length;o--;)if(d[o]==a)return e[o];f=l?j(a.length):{}}else f=l?m(a):ce({},a);return l&&(yd.call(a,"index")&&(f.index=a.index),yd.call(a,"input")&&(f.input=a.input)),b?(d.push(a),e.push(f),(l?Tb:fe)(a,function(a,g){f[g]=u(a,b,c,d,e)}),n&&(k(d),k(e)),f):f}function W(a,b,c){if("function"!=typeof a)return Tc;if("undefined"==typeof b)return a;var d=a.__bindData__||Vd.funcNames&&!a.name;if("undefined"==typeof d){var e=F&&wd.call(a);Vd.funcNames||!e||B.test(e)||(d=!0),(Vd.funcNames||!d)&&(d=!Vd.funcDecomp||F.test(e),Wd(a,d))}if(d!==!0&&d&&1&d[1])return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d) };case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return Dc(a,b)}function Y(a,b,c,d){for(var e=(d||0)-1,f=a?a.length:0,g=[];++e<f;){var h=a[e];if(h&&"object"==typeof h&&"number"==typeof h.length&&(Xd(h)||jb(h))){b||(h=Y(h,b,c));var i=-1,j=h.length,k=g.length;for(g.length+=j;++i<j;)g[k++]=h[i]}else c||g.push(h)}return g}function Z(a,b,c,d,e,f){if(c){var g=c(a,b);if("undefined"!=typeof g)return!!g}if(a===b)return 0!==a||1/a==1/b;var i=typeof a,j=typeof b;if(!(a!==a||a&&V[i]||b&&V[j]))return!1;if(null==a||null==b)return a===b;var l=Ed.call(a),m=Ed.call(b);if(l==J&&(l=P),m==J&&(m=P),l!=m)return!1;switch(l){case L:case M:return+a==+b;case O:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Q:case R:return a==nd(b)}var n=l==K;if(!n){if(yd.call(a,"__wrapped__ ")||yd.call(b,"__wrapped__"))return Z(a.__wrapped__||a,b.__wrapped__||b,c,d,e,f);if(l!=P)return!1;var o=a.constructor,p=b.constructor;if(o!=p&&!(zb(o)&&o instanceof o&&zb(p)&&p instanceof p))return!1}var q=!e;e||(e=h()),f||(f=h());for(var r=e.length;r--;)if(e[r]==a)return f[r]==b;var s=0;if(g=!0,e.push(a),f.push(b),n){if(r=a.length,s=b.length,g=s==a.length,!g&&!d)return g;for(;s--;){var t=r,u=b[s];if(d)for(;t--&&!(g=Z(a[t],u,c,d,e,f)););else if(!(g=Z(a[s],u,c,d,e,f)))break}return g}return ee(b,function(b,h,i){return yd.call(i,h)?(s++,g=yd.call(a,h)&&Z(a[h],b,c,d,e,f)):void 0}),g&&!d&&ee(a,function(a,b,c){return yd.call(c,b)?g=--s>-1:void 0}),q&&(k(e),k(f)),g}function _(a,b,c,d,e){(Xd(b)?Tb:fe)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Xd(b))||ge(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Xd(j)?j:[]:ge(j)?j:{}),d.push(b),e.push(j),l||_(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function bb(c,d,e){var g=-1,i=gb(),j=c?c.length:0,m=[],n=!d&&j>=t&&i===a,o=e||n?h():m;if(n){var p=f(o);p?(i=b,o=p):(n=!1,o=e?o:(k(o),m))}for(;++g<j;){var q=c[g],r=e?e(q,g,c):q;(d?!g||o[o.length-1]!==r:i(o,r)<0)&&((e||n)&&o.push(r),m.push(q))}return n?(k(o.array),l(o)):e&&k(o),m}function cb(a){return function(b,c,d){var e={};c=p.createCallback(c,d,3);var f=-1,g=b?b.length:0;if("number"==typeof g)for(;++f<g;){var h=b[f];a(e,h,c(h,f,b),b)}else fe(b,function(b,d,f){a(e,b,c(b,d,f),f)});return e}}function db(a,b,c,d,e,f){var g=1&b,h=2&b,i=4&b,j=8&b,k=16&b,l=32&b,m=a;if(!h&&!zb(a))throw new od;k&&!c.length&&(b&=-17,k=c=!1),l&&!d.length&&(b&=-33,l=d=!1);var n=a&&a.__bindData__;if(n)return!g||1&n[1]||(n[4]=e),!g&&1&n[1]&&(b|=8),!i||4&n[1]||(n[5]=f),k&&Ad.apply(n[2]||(n[2]=[]),c),l&&Ad.apply(n[3]||(n[3]=[]),d),n[1]|=b,db.apply(null,n);if(!g||h||i||l||!(Vd.fastBind||Hd&&k))p=function(){var n=arguments,o=g?e:this;if((i||k||l)&&(n=Rd.call(n),k&&Fd.apply(n,c),l&&Ad.apply(n,d),i&&n.length<f))return b|=16,db(a,j?b:-4&b,n,null,e,f);if(h&&(a=o[m]),this instanceof p){o=eb(a.prototype);var q=a.apply(o,n);return Ab(q)?q:o}return a.apply(o,n)};else{if(k){var o=[e];Ad.apply(o,c)}var p=k?Hd.apply(a,o):Hd.call(a,e)}return Wd(p,Rd.call(arguments)),p}function eb(a){return Ab(a)?Id(a):{}}function fb(a){return $d[a]}function gb(){var b=(b=p.indexOf)===nc?a:b;return b}function hb(a){var b,c;return a&&Ed.call(a)==P&&(b=a.constructor,!zb(b)||b instanceof b)?(ee(a,function(a,b){c=b}),"undefined"==typeof c||yd.call(a,c)):!1}function ib(a){return _d[a]}function jb(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ed.call(a)==J||!1}function kb(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=b,b=!1),u(a,b,"function"==typeof c&&W(c,d,1))}function lb(a,b,c){return u(a,!0,"function"==typeof b&&W(b,c,1))}function mb(a,b,c){var d;return b=p.createCallback(b,c,3),fe(a,function(a,c,e){return b(a,c,e)?(d=c,!1):void 0}),d}function nb(a,b,c){var d;return b=p.createCallback(b,c,3),pb(a,function(a,c,e){return b(a,c,e)?(d=c,!1):void 0}),d}function ob(a,b,c){var d=[];ee(a,function(a,b){d.push(b,a)});var e=d.length;for(b=W(b,c,3);e--&&b(d[e--],d[e],a)!==!1;);return a}function pb(a,b,c){var d=Zd(a),e=d.length;for(b=W(b,c,3);e--;){var f=d[e];if(b(a[f],f,a)===!1)break}return a}function qb(a){var b=[];return ee(a,function(a,c){zb(a)&&b.push(c)}),b.sort()}function rb(a,b){return a?yd.call(a,b):!1}function sb(a){for(var b=-1,c=Zd(a),d=c.length,e={};++b<d;){var f=c[b];e[a[f]]=f}return e}function tb(a){return a===!0||a===!1||Ed.call(a)==L}function ub(a){return a?"object"==typeof a&&Ed.call(a)==M:!1}function vb(a){return a?1===a.nodeType:!1}function wb(a){var b=!0;if(!a)return b;var c=Ed.call(a),d=a.length;return c==K||c==R||c==J||c==P&&"number"==typeof d&&zb(a.splice)?!d:(fe(a,function(){return b=!1}),b)}function xb(a,b,c,d){return Z(a,b,"function"==typeof c&&W(c,d,2))}function yb(a){return Kd(a)&&!Ld(parseFloat(a))}function zb(a){return"function"==typeof a}function Ab(a){return!(!a||!V[typeof a])}function Bb(a){return Db(a)&&a!=+a}function Cb(a){return null===a}function Db(a){return"number"==typeof a||Ed.call(a)==O}function Eb(a){return a?"object"==typeof a&&Ed.call(a)==Q:!1}function Fb(a){return"string"==typeof a||Ed.call(a)==R}function Gb(a){return"undefined"==typeof a}function Hb(a){var b=arguments,c=2;if(!Ab(a))return a;if("number"!=typeof b[2]&&(c=b.length),c>3&&"function"==typeof b[c-2])var d=W(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=Rd.call(arguments,1,c),f=-1,g=h(),i=h();++f<c;)_(a,e[f],d,g,i);return k(g),k(i),a}function Ib(a,b,c){var d=gb(),e="function"==typeof b,f={};if(e)b=p.createCallback(b,c,3);else var g=Y(arguments,!0,!1,1);return ee(a,function(a,c,h){(e?!b(a,c,h):d(g,c)<0)&&(f[c]=a)}),f}function Jb(a){for(var b=-1,c=Zd(a),d=c.length,e=fd(d);++b<d;){var f=c[b];e[b]=[f,a[f]]}return e}function Kb(a,b,c){var d={};if("function"!=typeof b)for(var e=-1,f=Y(arguments,!0,!1,1),g=Ab(a)?f.length:0;++e<g;){var h=f[e];h in a&&(d[h]=a[h])}else b=p.createCallback(b,c,3),ee(a,function(a,c,e){b(a,c,e)&&(d[c]=a)});return d}function Lb(a,b,c,d){var e=Xd(a);if(b=W(b,d,4),null==c)if(e)c=[];else{var f=a&&a.constructor,g=f&&f.prototype;c=eb(g)}return(e?Tb:fe)(a,function(a,d,e){return b(c,a,d,e)}),c}function Mb(a){for(var b=-1,c=Zd(a),d=c.length,e=fd(d);++b<d;)e[b]=a[c[b]];return e}function Nb(a){for(var b=arguments,c=-1,d=Y(b,!0,!1,1),e=b[2]&&b[2][b[1]]===a?1:d.length,f=fd(e);++c<e;)f[c]=a[d[c]];return f}function Ob(a,b,c){var d=-1,e=gb(),f=a?a.length:0,g=!1;return c=(0>c?Nd(0,f+c):c)||0,Xd(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Fb(a)?a.indexOf(b,c):e(a,b,c))>-1:fe(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Pb(a,b,c){var d=!0;b=p.createCallback(b,c,3);var e=-1,f=a?a.length:0;if("number"==typeof f)for(;++e<f&&(d=!!b(a[e],e,a)););else fe(a,function(a,c,e){return d=!!b(a,c,e)});return d}function Qb(a,b,c){var d=[];b=p.createCallback(b,c,3);var e=-1,f=a?a.length:0;if("number"==typeof f)for(;++e<f;){var g=a[e];b(g,e,a)&&d.push(g)}else fe(a,function(a,c,e){b(a,c,e)&&d.push(a)});return d}function Rb(a,b,c){b=p.createCallback(b,c,3);var d=-1,e=a?a.length:0;if("number"!=typeof e){var f;return fe(a,function(a,c,d){return b(a,c,d)?(f=a,!1):void 0}),f}for(;++d<e;){var g=a[d];if(b(g,d,a))return g}}function Sb(a,b,c){var d;return b=p.createCallback(b,c,3),Ub(a,function(a,c,e){return b(a,c,e)?(d=a,!1):void 0}),d}function Tb(a,b,c){var d=-1,e=a?a.length:0;if(b=b&&"undefined"==typeof c?b:W(b,c,3),"number"==typeof e)for(;++d<e&&b(a[d],d,a)!==!1;);else fe(a,b);return a}function Ub(a,b,c){var d=a?a.length:0;if(b=b&&"undefined"==typeof c?b:W(b,c,3),"number"==typeof d)for(;d--&&b(a[d],d,a)!==!1;);else{var e=Zd(a);d=e.length,fe(a,function(a,c,f){return c=e?e[--d]:--d,b(f[c],c,f)})}return a}function Vb(a,b){var c=Rd.call(arguments,2),d=-1,e="function"==typeof b,f=a?a.length:0,g=fd("number"==typeof f?f:0);return Tb(a,function(a){g[++d]=(e?b:a[b]).apply(a,c)}),g}function Wb(a,b,c){var d=-1,e=a?a.length:0;if(b=p.createCallback(b,c,3),"number"==typeof e)for(var f=fd(e);++d<e;)f[d]=b(a[d],d,a);else f=[],fe(a,function(a,c,e){f[++d]=b(a,c,e)});return f}function Xb(a,b,c){var e=-1/0,f=e;if(!b&&Xd(a))for(var g=-1,h=a.length;++g<h;){var i=a[g];i>f&&(f=i)}else b=!b&&Fb(a)?d:p.createCallback(b,c,3),Tb(a,function(a,c,d){var g=b(a,c,d);g>e&&(e=g,f=a)});return f}function Yb(a,b,c){var e=1/0,f=e;if(!b&&Xd(a))for(var g=-1,h=a.length;++g<h;){var i=a[g];f>i&&(f=i)}else b=!b&&Fb(a)?d:p.createCallback(b,c,3),Tb(a,function(a,c,d){var g=b(a,c,d);e>g&&(e=g,f=a)});return f}function Zb(a,b){var c=-1,d=a?a.length:0;if("number"==typeof d)for(var e=fd(d);++c<d;)e[c]=a[c][b];return e||Wb(a,b)}function $b(a,b,c,d){if(!a)return c;var e=arguments.length<3;b=W(b,d,4);var f=-1,g=a.length;if("number"==typeof g)for(e&&(c=a[++f]);++f<g;)c=b(c,a[f],f,a);else fe(a,function(a,d,f){c=e?(e=!1,a):b(c,a,d,f)});return c}function _b(a,b,c,d){var e=arguments.length<3;return b=W(b,d,4),Ub(a,function(a,d,f){c=e?(e=!1,a):b(c,a,d,f)}),c}function ac(a,b,c){return b=p.createCallback(b,c,3),Qb(a,function(a,c,d){return!b(a,c,d)})}function bc(a,b,c){var d=a?a.length:0;if("number"!=typeof d&&(a=Mb(a)),null==b||c)return a?a[Wc(d-1)]:o;var e=cc(a);return e.length=Od(Nd(0,b),e.length),e}function cc(a){var b=-1,c=a?a.length:0,d=fd("number"==typeof c?c:0);return Tb(a,function(a){var c=Wc(++b);d[b]=d[c],d[c]=a}),d}function dc(a){var b=a?a.length:0;return"number"==typeof b?b:Zd(a).length}function ec(a,b,c){var d;b=p.createCallback(b,c,3);var e=-1,f=a?a.length:0;if("number"==typeof f)for(;++e<f&&!(d=b(a[e],e,a)););else fe(a,function(a,c,e){return!(d=b(a,c,e))});return!!d}function fc(a,b,c){var d=-1,f=a?a.length:0,g=fd("number"==typeof f?f:0);for(b=p.createCallback(b,c,3),Tb(a,function(a,c,e){var f=g[++d]=i();f.criteria=b(a,c,e),f.index=d,f.value=a}),f=g.length,g.sort(e);f--;){var h=g[f];g[f]=h.value,l(h)}return g}function gc(a){return a&&"number"==typeof a.length?m(a):Mb(a)}function hc(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function ic(c){var d=-1,e=gb(),g=c?c.length:0,h=Y(arguments,!0,!0,1),i=[],j=g>=t&&e===a;if(j){var k=f(h);k?(e=b,h=k):j=!1}for(;++d<g;){var m=c[d];e(h,m)<0&&i.push(m)}return j&&l(h),i}function jc(a,b,c){var d=-1,e=a?a.length:0;for(b=p.createCallback(b,c,3);++d<e;)if(b(a[d],d,a))return d;return-1}function kc(a,b,c){var d=a?a.length:0;for(b=p.createCallback(b,c,3);d--;)if(b(a[d],d,a))return d;return-1}function lc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=-1;for(b=p.createCallback(b,c,3);++f<e&&b(a[f],f,a);)d++}else if(d=b,null==d||c)return a?a[0]:o;return m(a,0,Od(Nd(0,d),e))}function mc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=d&&d[b]===a?null:b,b=!1),null!=c&&(a=Wb(a,c,d)),Y(a,b)}function nc(b,c,d){if("number"==typeof d){var e=b?b.length:0;d=0>d?Nd(0,e+d):d||0}else if(d){var f=wc(b,c);return b[f]===c?f:-1}return a(b,c,d)}function oc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=e;for(b=p.createCallback(b,c,3);f--&&b(a[f],f,a);)d++}else d=null==b||c?1:b||d;return m(a,0,Od(Nd(0,e-d),e))}function pc(c){for(var d=arguments,e=d.length,g=-1,i=h(),j=-1,m=gb(),n=c?c.length:0,o=[],p=h();++g<e;){var q=d[g];i[g]=m===a&&(q?q.length:0)>=t&&f(g?d[g]:p)}a:for(;++j<n;){var r=i[0];if(q=c[j],(r?b(r,q):m(p,q))<0){for(g=e,(r||p).push(q);--g;)if(r=i[g],(r?b(r,q):m(d[g],q))<0)continue a;o.push(q)}}for(;e--;)r=i[e],r&&l(r);return k(i),k(p),o}function qc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=e;for(b=p.createCallback(b,c,3);f--&&b(a[f],f,a);)d++}else if(d=b,null==d||c)return a?a[e-1]:o;return m(a,Nd(0,e-d))}function rc(a,b,c){var d=a?a.length:0;for("number"==typeof c&&(d=(0>c?Nd(0,d+c):Od(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function sc(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++c<d;)for(var f=-1,g=b[c];++f<e;)a[f]===g&&(Dd.call(a,f--,1),e--);return a}function tc(a,b,c){a=+a||0,c="number"==typeof c?c:+c||1,null==b&&(b=a,a=0);for(var d=-1,e=Nd(0,td((b-a)/(c||1))),f=fd(e);++d<e;)f[d]=a,a+=c;return f}function uc(a,b,c){var d=-1,e=a?a.length:0,f=[];for(b=p.createCallback(b,c,3);++d<e;){var g=a[d];b(g,d,a)&&(f.push(g),Dd.call(a,d--,1),e--)}return f}function vc(a,b,c){if("number"!=typeof b&&null!=b){var d=0,e=-1,f=a?a.length:0;for(b=p.createCallback(b,c,3);++e<f&&b(a[e],e,a);)d++}else d=null==b||c?1:Nd(0,b);return m(a,d)}function wc(a,b,c,d){var e=0,f=a?a.length:e;for(c=c?p.createCallback(c,d,1):Tc,b=c(b);f>e;){var g=e+f>>>1;c(a[g])<b?e=g+1:f=g}return e}function xc(){return bb(Y(arguments,!0,!0))}function yc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=d&&d[b]===a?null:b,b=!1),null!=c&&(c=p.createCallback(c,d,3)),bb(a,b,c)}function zc(a){return ic(a,Rd.call(arguments,1))}function Ac(){for(var a=arguments.length>1?arguments:arguments[0],b=-1,c=a?Xb(Zb(a,"length")):0,d=fd(0>c?0:c);++b<c;)d[b]=Zb(a,b);return d}function Bc(a,b){for(var c=-1,d=a?a.length:0,e={};++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Cc(a,b){if(!zb(b))throw new od;return function(){return--a<1?b.apply(this,arguments):void 0}}function Dc(a,b){return arguments.length>2?db(a,17,Rd.call(arguments,2),null,b):db(a,1,null,null,b)}function Ec(a){for(var b=arguments.length>1?Y(arguments,!0,!1,1):qb(a),c=-1,d=b.length;++c<d;){var e=b[c];a[e]=db(a[e],1,null,null,a)}return a}function Fc(a,b){return arguments.length>2?db(b,19,Rd.call(arguments,2),null,a):db(b,3,null,null,a)}function Gc(){for(var a=arguments,b=a.length;b--;)if(!zb(a[b]))throw new od;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Hc(a,b,c){var d=typeof a;if(null==a||"function"==d)return W(a,b,c);if("object"!=d)return function(b){return b[a]};var e=Zd(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ab(g)?function(b){for(var c=e.length,d=!1;c--&&(d=Z(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Ic(a,b){return b="number"==typeof b?b:+b||a.length,db(a,4,null,null,null,b)}function Jc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!zb(a))throw new od;if(b=Nd(0,b)||0,c===!0){var n=!0;m=!1}else Ab(c)&&(n=c.leading,l="maxWait"in c&&(Nd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(zd()-g);if(0>=c){e&&ud(e);var l=j;e=i=j=o,l&&(k=zd(),f=a.apply(h,d))}else i=Cd(p,c)},q=function(){i&&ud(i),e=i=j=o,(m||l!==b)&&(k=zd(),f=a.apply(h,d))};return function(){if(d=arguments,g=zd(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var o=l-(g-k);0>=o?(e&&(e=ud(e)),k=g,f=a.apply(h,d)):e||(e=Cd(q,o))}return i||b===l||(i=Cd(p,b)),c&&(f=a.apply(h,d)),f}}function Kc(a){if(!zb(a))throw new od;var b=Rd.call(arguments,1);return Cd(function(){a.apply(o,b)},1)}function Lc(a,b){if(!zb(a))throw new od;var c=Rd.call(arguments,2);return Cd(function(){a.apply(o,c)},b)}function Mc(a,b){if(!zb(a))throw new od;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):s+arguments[0];return yd.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Nc(a){var b,c;if(!zb(a))throw new od;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Oc(a){return db(a,16,Rd.call(arguments,1))}function Pc(a){return db(a,32,null,Rd.call(arguments,1))}function Qc(a,b,c){var d=!0,e=!0;if(!zb(a))throw new od;c===!1?d=!1:Ab(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),T.leading=d,T.maxWait=b,T.trailing=e;var f=Jc(a,b,T);return f}function Rc(a,b){if(!zb(b))throw new od;return function(){var c=[a];return Ad.apply(c,arguments),b.apply(this,c)}}function Sc(a){return null==a?"":nd(a).replace(be,fb)}function Tc(a){return a}function Uc(a,b){var c=a,d=!b||zb(c);b||(c=q,b=a,a=p),Tb(qb(b),function(e){var f=a[e]=b[e];d&&(c.prototype[e]=function(){var b=this.__wrapped__,d=[b];Ad.apply(d,arguments);var e=f.apply(a,d);return b&&"object"==typeof b&&b===e?this:(e=new c(e),e.__chain__=this.__chain__,e)})})}function Vc(){return c._=rd,this}function Wc(a,b,c){var d=null==a,e=null==b;null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0;var f=Qd();return c||a%1||b%1?Od(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b):a+vd(f*(b-a+1))}function Xc(a,b){if(a){var c=a[b];return zb(c)?a[b]():c}}function Yc(a,b,c){var d=p.templateSettings;a||(a=""),c=de({},c,d);var e,f=de({},c.imports,d.imports),h=Zd(f),i=Mb(f),j=0,k=c.interpolate||E,l="__p += '",m=md((c.escape||E).source+"|"+k.source+"|"+(k===C?z:E).source+"|"+(c.evaluate||E).source+"|$","g");a.replace(m,function(b,c,d,f,h,i){return d||(d=f),l+=a.slice(j,i).replace(G,g),c&&(l+="' +\n__e("+c+") +\n'"),h&&(e=!0,l+="';\n"+h+";\n__p += '"),d&&(l+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),j=i+b.length,b}),l+="';\n";var n=c.variable,q=n;q||(n="obj",l="with ("+n+") {\n"+l+"\n}\n"),l=(e?l.replace(w,""):l).replace(x,"$1").replace(y,"$1;"),l="function("+n+") {\n"+(q?"":n+" || ("+n+" = {});\n")+"var __t, __p = '', __e = _.escape"+(e?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var r="\n/*\n//# sourceURL="+(c.sourceURL||"/lodash/template/source["+I++ +"]")+"\n*/";try{var s=id(h,"return "+l+r).apply(o,i)}catch(t){throw t.source=l,t}return b?s(b):(s.source=l,s)}function Zc(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=fd(a);for(b=W(b,c,1);++d<a;)e[d]=b(d);return e}function $c(a){return null==a?"":nd(a).replace(ae,ib)}function _c(a){var b=++r;return nd(null==a?"":a)+b}function ad(a){return a=new q(a),a.__chain__=!0,a}function bd(a,b){return b(a),a}function cd(){return this.__chain__=!0,this}function dd(){return nd(this.__wrapped__)}function ed(){return this.__wrapped__}c=c?ab.defaults(X.Object(),c,ab.pick(X,H)):X;var fd=c.Array,gd=c.Boolean,hd=c.Date,id=c.Function,jd=c.Math,kd=c.Number,ld=c.Object,md=c.RegExp,nd=c.String,od=c.TypeError,pd=[],qd=ld.prototype,rd=c._,sd=md("^"+nd(qd.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),td=jd.ceil,ud=c.clearTimeout,vd=jd.floor,wd=id.prototype.toString,xd=sd.test(xd=ld.getPrototypeOf)&&xd,yd=qd.hasOwnProperty,zd=sd.test(zd=hd.now)&&zd||function(){return+new hd},Ad=pd.push,Bd=c.setImmediate,Cd=c.setTimeout,Dd=pd.splice,Ed=qd.toString,Fd=pd.unshift,Gd=function(){try{var a={},b=sd.test(b=ld.defineProperty)&&b,c=b(a,a,a)&&b}catch(d){}return c}(),Hd=sd.test(Hd=Ed.bind)&&Hd,Id=sd.test(Id=ld.create)&&Id,Jd=sd.test(Jd=fd.isArray)&&Jd,Kd=c.isFinite,Ld=c.isNaN,Md=sd.test(Md=ld.keys)&&Md,Nd=jd.max,Od=jd.min,Pd=c.parseInt,Qd=jd.random,Rd=pd.slice,Sd=sd.test(c.attachEvent),Td=Hd&&!/\n|true/.test(Hd+Sd),Ud={};Ud[K]=fd,Ud[L]=gd,Ud[M]=hd,Ud[N]=id,Ud[P]=ld,Ud[O]=kd,Ud[Q]=md,Ud[R]=nd,q.prototype=p.prototype;var Vd=p.support={};Vd.fastBind=Hd&&!Td,Vd.funcDecomp=!sd.test(c.WinRTError)&&F.test(n),Vd.funcNames="string"==typeof id.name,p.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:C,variable:"",imports:{_:p}},Id||(eb=function(a){if(Ab(a)){j.prototype=a;var b=new j;j.prototype=null}return b||{}});var Wd=Gd?function(a,b){U.value=b,Gd(a,"__bindData__",U)}:j,Xd=Jd||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ed.call(a)==K||!1},Yd=function(a){var b,c=a,d=[];if(!c)return d;if(!V[typeof a])return d;for(b in c)yd.call(c,b)&&d.push(b);return d},Zd=Md?function(a){return Ab(a)?Md(a):[]}:Yd,$d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_d=sb($d),ae=md("("+Zd(_d).join("|")+")","g"),be=md("["+Zd($d).join("")+"]","g"),ce=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=W(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h<i;)if(e=g[h],e&&V[typeof e])for(var k=-1,l=V[typeof e]&&Zd(e),m=l?l.length:0;++k<m;)d=l[k],f[d]=j?j(f[d],e[d]):e[d];return f},de=function(a,b,c){var d,e=a,f=e;if(!e)return f;for(var g=arguments,h=0,i="number"==typeof c?2:g.length;++h<i;)if(e=g[h],e&&V[typeof e])for(var j=-1,k=V[typeof e]&&Zd(e),l=k?k.length:0;++j<l;)d=k[j],"undefined"==typeof f[d]&&(f[d]=e[d]);return f},ee=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!V[typeof e])return f;b=b&&"undefined"==typeof c?b:W(b,c,3);for(d in e)if(b(e[d],d,a)===!1)return f;return f},fe=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!V[typeof e])return f;b=b&&"undefined"==typeof c?b:W(b,c,3);for(var g=-1,h=V[typeof e]&&Zd(e),i=h?h.length:0;++g<i;)if(d=h[g],b(e[d],d,a)===!1)return f;return f},ge=function(a){if(!a||Ed.call(a)!=P)return!1;var b=a.valueOf,c="function"==typeof b&&(c=xd(b))&&xd(c);return c?a==c||xd(a)==c:hb(a)},he=cb(function(a,b,c){yd.call(a,c)?a[c]++:a[c]=1}),ie=cb(function(a,b,c){(yd.call(a,c)?a[c]:a[c]=[]).push(b)}),je=cb(function(a,b,c){a[c]=b}),ke=Qb;Td&&$&&"function"==typeof Bd&&(Kc=function(a){if(!zb(a))throw new od;return Bd.apply(c,arguments)});var le=8==Pd(v+"08")?Pd:function(a,b){return Pd(Fb(a)?a.replace(D,""):a,b||0)};return p.after=Cc,p.assign=ce,p.at=Nb,p.bind=Dc,p.bindAll=Ec,p.bindKey=Fc,p.chain=ad,p.compact=hc,p.compose=Gc,p.countBy=he,p.createCallback=Hc,p.curry=Ic,p.debounce=Jc,p.defaults=de,p.defer=Kc,p.delay=Lc,p.difference=ic,p.filter=Qb,p.flatten=mc,p.forEach=Tb,p.forEachRight=Ub,p.forIn=ee,p.forInRight=ob,p.forOwn=fe,p.forOwnRight=pb,p.functions=qb,p.groupBy=ie,p.indexBy=je,p.initial=oc,p.intersection=pc,p.invert=sb,p.invoke=Vb,p.keys=Zd,p.map=Wb,p.max=Xb,p.memoize=Mc,p.merge=Hb,p.min=Yb,p.omit=Ib,p.once=Nc,p.pairs=Jb,p.partial=Oc,p.partialRight=Pc,p.pick=Kb,p.pluck=Zb,p.pull=sc,p.range=tc,p.reject=ac,p.remove=uc,p.rest=vc,p.shuffle=cc,p.sortBy=fc,p.tap=bd,p.throttle=Qc,p.times=Zc,p.toArray=gc,p.transform=Lb,p.union=xc,p.uniq=yc,p.values=Mb,p.where=ke,p.without=zc,p.wrap=Rc,p.zip=Ac,p.zipObject=Bc,p.collect=Wb,p.drop=vc,p.each=Tb,p.eachRight=Ub,p.extend=ce,p.methods=qb,p.object=Bc,p.select=Qb,p.tail=vc,p.unique=yc,p.unzip=Ac,Uc(p),p.clone=kb,p.cloneDeep=lb,p.contains=Ob,p.escape=Sc,p.every=Pb,p.find=Rb,p.findIndex=jc,p.findKey=mb,p.findLast=Sb,p.findLastIndex=kc,p.findLastKey=nb,p.has=rb,p.identity=Tc,p.indexOf=nc,p.isArguments=jb,p.isArray=Xd,p.isBoolean=tb,p.isDate=ub,p.isElement=vb,p.isEmpty=wb,p.isEqual=xb,p.isFinite=yb,p.isFunction=zb,p.isNaN=Bb,p.isNull=Cb,p.isNumber=Db,p.isObject=Ab,p.isPlainObject=ge,p.isRegExp=Eb,p.isString=Fb,p.isUndefined=Gb,p.lastIndexOf=rc,p.mixin=Uc,p.noConflict=Vc,p.parseInt=le,p.random=Wc,p.reduce=$b,p.reduceRight=_b,p.result=Xc,p.runInContext=n,p.size=dc,p.some=ec,p.sortedIndex=wc,p.template=Yc,p.unescape=$c,p.uniqueId=_c,p.all=Pb,p.any=ec,p.detect=Rb,p.findWhere=Rb,p.foldl=$b,p.foldr=_b,p.include=Ob,p.inject=$b,fe(p,function(a,b){p.prototype[b]||(p.prototype[b]=function(){var b=[this.__wrapped__],c=this.__chain__;Ad.apply(b,arguments);var d=a.apply(p,b);return c?new q(d,c):d})}),p.first=lc,p.last=qc,p.sample=bc,p.take=lc,p.head=lc,fe(p,function(a,b){var c="sample"!==b;p.prototype[b]||(p.prototype[b]=function(b,d){var e=this.__chain__,f=a(this.__wrapped__,b,d);return e||null!=b&&(!d||c&&"function"==typeof b)?new q(f,e):f})}),p.VERSION="2.2.1",p.prototype.chain=cd,p.prototype.toString=dd,p.prototype.value=ed,p.prototype.valueOf=ed,Tb(["join","pop","shift"],function(a){var b=pd[a];p.prototype[a]=function(){var a=this.__chain__,c=b.apply(this.__wrapped__,arguments);return a?new q(c,a):c}}),Tb(["push","reverse","sort","unshift"],function(a){var b=pd[a];p.prototype[a]=function(){return b.apply(this.__wrapped__,arguments),this}}),Tb(["concat","slice","splice"],function(a){var b=pd[a];p.prototype[a]=function(){return new q(b.apply(this.__wrapped__,arguments),this.__chain__)}}),p}var o,p=[],q=[],r=0,s=+new Date+"",t=75,u=40,v=" \f \n\r\u2028\u2029 ᠎              ",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,B=/^function[ \n\r\t]+\w/,C=/<%=([\s\S]+?)%>/g,D=RegExp("^["+v+"]*0+(?=.$)"),E=/($^)/,F=/\bthis\b/,G=/['\n\r\t\u2028\u2029\\]/g,H=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],I=0,J="[object Arguments]",K="[object Array]",L="[object Boolean]",M="[object Date]",N="[object Function]",O="[object Number]",P="[object Object]",Q="[object RegExp]",R="[object String]",S={};S[N]=!1,S[J]=S[K]=S[L]=S[M]=S[O]=S[P]=S[Q]=S[R]=!0;var T={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},W={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=V[typeof window]&&window||this,Y=V[typeof exports]&&exports&&!exports.nodeType&&exports,Z=V[typeof module]&&module&&!module.nodeType&&module,$=Z&&Z.exports===Y&&Y,_=V[typeof global]&&global;!_||_.global!==_&&_.window!==_||(X=_);var ab=n();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=ab,define(function(){return ab})):Y&&Z?$?(Z.exports=ab)._=ab:Y._=ab:X._=ab}.call(this),function(){var a,b=this,c=b.Backbone,d=[],e=d.push,f=d.slice,g=d.splice;a="undefined"!=typeof exports?exports:b.Backbone={},a.VERSION="1.0.0";var h=b._;h||"undefined"==typeof require||(h=require("underscore")),a.$=b.jQuery||b.Zepto||b.ender||b.$,a.noConflict=function(){return b.Backbone=c,this},a.emulateHTTP=!1,a.emulateJSON=!1;var i=a.Events={on:function(a,b,c){if(!k(this,"on",a,[b,c])||!b)return this;this._events||(this._events={});var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(a,b,c){if(!k(this,"once",a,[b,c])||!b)return this;var d=this,e=h.once(function(){d.off(a,e),b.apply(this,arguments)});return e._callback=b,this.on(a,e,c)},off:function(a,b,c){var d,e,f,g,i,j,l,m;if(!this._events||!k(this,"off",a,[b,c]))return this;if(!a&&!b&&!c)return this._events={},this;for(g=a?[a]:h.keys(this._events),i=0,j=g.length;j>i;i++)if(a=g[i],f=this._events[a]){if(this._events[a]=d=[],b||c)for(l=0,m=f.length;m>l;l++)e=f[l],(b&&b!==e.callback&&b!==e.callback._callback||c&&c!==e.context)&&d.push(e);d.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=f.call(arguments,1);if(!k(this,"trigger",a,b))return this;var c=this._events[a],d=this._events.all;return c&&l(c,b),d&&l(d,arguments),this},stopListening:function(a,b,c){var d=this._listeners;if(!d)return this;var e=!b&&!c;"object"==typeof b&&(c=this),a&&((d={})[a._listenerId]=a);for(var f in d)d[f].off(b,c,this),e&&delete this._listeners[f];return this}},j=/\s+/,k=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(j.test(c)){for(var f=c.split(j),g=0,h=f.length;h>g;g++)a[b].apply(a,[f[g]].concat(d));return!1}return!0},l=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++d<e;)(c=a[d]).callback.call(c.ctx);return;case 1:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f);return;case 2:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g);return;case 3:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g,h);return;default:for(;++d<e;)(c=a[d]).callback.apply(c.ctx,b)}},m={listenTo:"on",listenToOnce:"once"};h.each(m,function(a,b){i[b]=function(b,c,d){var e=this._listeners||(this._listeners={}),f=b._listenerId||(b._listenerId=h.uniqueId("l"));return e[f]=b,"object"==typeof c&&(d=this),b[a](c,d,this),this}}),i.bind=i.on,i.unbind=i.off,h.extend(a,i);var n=a.Model=function(a,b){var c,d=a||{};b||(b={}),this.cid=h.uniqueId("c"),this.attributes={},h.extend(this,h.pick(b,o)),b.parse&&(d=this.parse(d,b)||{}),(c=h.result(this,"defaults"))&&(d=h.defaults({},d,c)),this.set(d,b),this.changed={},this.initialize.apply(this,arguments)},o=["url","urlRoot","collection"];h.extend(n.prototype,i,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(a){return this.attributes[a]},escape:function(a){return h.escape(this.get(a))},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e,f,g,i,j,k,l;if(null==a)return this;if("object"==typeof a?(e=a,c=b):(e={})[a]=b,c||(c={}),!this._validate(e,c))return!1;f=c.unset,i=c.silent,g=[],j=this._changing,this._changing=!0,j||(this._previousAttributes=h.clone(this.attributes),this.changed={}),l=this.attributes,k=this._previousAttributes,this.idAttribute in e&&(this.id=e[this.idAttribute]);for(d in e)b=e[d],h.isEqual(l[d],b)||g.push(d),h.isEqual(k[d],b)?delete this.changed[d]:this.changed[d]=b,f?delete l[d]:l[d]=b;if(!i){g.length&&(this._pending=!0);for(var m=0,n=g.length;n>m;m++)this.trigger("change:"+g[m],this,l[g[m]],c)}if(j)return this;if(!i)for(;this._pending;)this._pending=!1,this.trigger("change",this,c);return this._pending=!1,this._changing=!1,this},unset:function(a,b){return this.set(a,void 0,h.extend({},b,{unset:!0}))},clear:function(a){var b={};for(var c in this.attributes)b[c]=void 0;return this.set(b,h.extend({},a,{unset:!0}))},hasChanged:function(a){return null==a?!h.isEmpty(this.changed):h.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?h.clone(this.changed):!1;var b,c=!1,d=this._changing?this._previousAttributes:this.attributes;for(var e in a)h.isEqual(d[e],b=a[e])||((c||(c={}))[e]=b);return c},previous:function(a){return null!=a&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(a){a=a?h.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;return a.success=function(d){return b.set(b.parse(d,a),a)?(c&&c(b,d,a),b.trigger("sync",b,d,a),void 0):!1},L(this,a),this.sync("read",this,a)},save:function(a,b,c){var d,e,f,g=this.attributes;if(null==a||"object"==typeof a?(d=a,c=b):(d={})[a]=b,!(!d||c&&c.wait||this.set(d,c)))return!1;if(c=h.extend({validate:!0},c),!this._validate(d,c))return!1;d&&c.wait&&(this.attributes=h.extend({},g,d)),void 0===c.parse&&(c.parse=!0);var i=this,j=c.success;return c.success=function(a){i.attributes=g;var b=i.parse(a,c);return c.wait&&(b=h.extend(d||{},b)),h.isObject(b)&&!i.set(b,c)?!1:(j&&j(i,a,c),i.trigger("sync",i,a,c),void 0)},L(this,c),e=this.isNew()?"create":c.patch?"patch":"update","patch"===e&&(c.attrs=d),f=this.sync(e,this,c),d&&c.wait&&(this.attributes=g),f},destroy:function(a){a=a?h.clone(a):{};var b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(a.success=function(e){(a.wait||b.isNew())&&d(),c&&c(b,e,a),b.isNew()||b.trigger("sync",b,e,a)},this.isNew())return a.success(),!1;L(this,a);var e=this.sync("delete",this,a);return a.wait||d(),e},url:function(){var a=h.result(this,"urlRoot")||h.result(this.collection,"url")||K();return this.isNew()?a:a+("/"===a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(a){return this._validate({},h.extend(a||{},{validate:!0}))},_validate:function(a,b){if(!b.validate||!this.validate)return!0;a=h.extend({},this.attributes,a);var c=this.validationError=this.validate(a,b)||null;return c?(this.trigger("invalid",this,c,h.extend(b||{},{validationError:c})),!1):!0}});var p=["keys","values","pairs","invert","pick","omit"];h.each(p,function(a){n.prototype[a]=function(){var b=f.call(arguments);return b.unshift(this.attributes),h[a].apply(h,b)}});var q=a.Collection=function(a,b){b||(b={}),b.url&&(this.url=b.url),b.model&&(this.model=b.model),void 0!==b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,h.extend({silent:!0},b))},r={add:!0,remove:!0,merge:!0},s={add:!0,merge:!1,remove:!1};h.extend(q.prototype,i,{model:n,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},sync:function(){return a.sync.apply(this,arguments)},add:function(a,b){return this.set(a,h.defaults(b||{},s))},remove:function(a,b){a=h.isArray(a)?a.slice():[a],b||(b={});var c,d,e,f;for(c=0,d=a.length;d>c;c++)f=this.get(a[c]),f&&(delete this._byId[f.id],delete this._byId[f.cid],e=this.indexOf(f),this.models.splice(e,1),this.length--,b.silent||(b.index=e,f.trigger("remove",f,this,b)),this._removeReference(f)); return this},set:function(a,b){b=h.defaults(b||{},r),b.parse&&(a=this.parse(a,b)),h.isArray(a)||(a=a?[a]:[]);var c,d,f,i,j,k=b.at,l=this.comparator&&null==k&&b.sort!==!1,m=h.isString(this.comparator)?this.comparator:null,n=[],o=[],p={};for(c=0,d=a.length;d>c;c++)(f=this._prepareModel(a[c],b))&&((i=this.get(f))?(b.remove&&(p[i.cid]=!0),b.merge&&(i.set(f.attributes,b),l&&!j&&i.hasChanged(m)&&(j=!0))):b.add&&(n.push(f),f.on("all",this._onModelEvent,this),this._byId[f.cid]=f,null!=f.id&&(this._byId[f.id]=f)));if(b.remove){for(c=0,d=this.length;d>c;++c)p[(f=this.models[c]).cid]||o.push(f);o.length&&this.remove(o,b)}if(n.length&&(l&&(j=!0),this.length+=n.length,null!=k?g.apply(this.models,[k,0].concat(n)):e.apply(this.models,n)),j&&this.sort({silent:!0}),b.silent)return this;for(c=0,d=n.length;d>c;c++)(f=n[c]).trigger("add",f,this,b);return j&&this.trigger("sort",this,b),this},reset:function(a,b){b||(b={});for(var c=0,d=this.models.length;d>c;c++)this._removeReference(this.models[c]);return b.previousModels=this.models,this._reset(),this.add(a,h.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),this},push:function(a,b){return a=this._prepareModel(a,b),this.add(a,h.extend({at:this.length},b)),a},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return a=this._prepareModel(a,b),this.add(a,h.extend({at:0},b)),a},shift:function(a){var b=this.at(0);return this.remove(b,a),b},slice:function(a,b){return this.models.slice(a,b)},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a.cid||a]},at:function(a){return this.models[a]},where:function(a,b){return h.isEmpty(a)?b?void 0:[]:this[b?"find":"filter"](function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},findWhere:function(a){return this.where(a,!0)},sort:function(a){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return a||(a={}),h.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(h.bind(this.comparator,this)),a.silent||this.trigger("sort",this,a),this},sortedIndex:function(a,b,c){b||(b=this.comparator);var d=h.isFunction(b)?b:function(a){return a.get(b)};return h.sortedIndex(this.models,a,d,c)},pluck:function(a){return h.invoke(this.models,"get",a)},fetch:function(a){a=a?h.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=a.success,c=this;return a.success=function(d){var e=a.reset?"reset":"set";c[e](d,a),b&&b(c,d,a),c.trigger("sync",c,d,a)},L(this,a),this.sync("read",this,a)},create:function(a,b){if(b=b?h.clone(b):{},!(a=this._prepareModel(a,b)))return!1;b.wait||this.add(a,b);var c=this,d=b.success;return b.success=function(e){b.wait&&c.add(a,b),d&&d(a,e,b)},a.save(null,b),a},parse:function(a){return a},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(a instanceof n)return a.collection||(a.collection=this),a;b||(b={}),b.collection=this;var c=new this.model(a,b);return c._validate(a,b)?c:(this.trigger("invalid",this,a,b),!1)},_removeReference:function(a){this===a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!==a&&"remove"!==a||c===this)&&("destroy"===a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],null!=b.id&&(this._byId[b.id]=b)),this.trigger.apply(this,arguments))}});var t=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(t,function(a){q.prototype[a]=function(){var b=f.call(arguments);return b.unshift(this.models),h[a].apply(h,b)}});var u=["groupBy","countBy","sortBy"];h.each(u,function(a){q.prototype[a]=function(b,c){var d=h.isFunction(b)?b:function(a){return a.get(b)};return h[a](this.models,d,c)}});var v=a.View=function(a){this.cid=h.uniqueId("view"),this._configure(a||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];h.extend(v.prototype,i,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(b,c){return this.$el&&this.undelegateEvents(),this.$el=b instanceof a.$?b:a.$(b),this.el=this.$el[0],c!==!1&&this.delegateEvents(),this},delegateEvents:function(a){if(!a&&!(a=h.result(this,"events")))return this;this.undelegateEvents();for(var b in a){var c=a[b];if(h.isFunction(c)||(c=this[a[b]]),c){var d=b.match(w),e=d[1],f=d[2];c=h.bind(c,this),e+=".delegateEvents"+this.cid,""===f?this.$el.on(e,c):this.$el.on(e,f,c)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_configure:function(a){this.options&&(a=h.extend({},h.result(this,"options"),a)),h.extend(this,h.pick(a,x)),this.options=a},_ensureElement:function(){if(this.el)this.setElement(h.result(this,"el"),!1);else{var b=h.extend({},h.result(this,"attributes"));this.id&&(b.id=h.result(this,"id")),this.className&&(b["class"]=h.result(this,"className"));var c=a.$("<"+h.result(this,"tagName")+">").attr(b);this.setElement(c,!1)}}}),a.sync=function(b,c,d){var e=y[b];h.defaults(d||(d={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var f={type:e,dataType:"json"};if(d.url||(f.url=h.result(c,"url")||K()),null!=d.data||!c||"create"!==b&&"update"!==b&&"patch"!==b||(f.contentType="application/json",f.data=JSON.stringify(d.attrs||c.toJSON(d))),d.emulateJSON&&(f.contentType="application/x-www-form-urlencoded",f.data=f.data?{model:f.data}:{}),d.emulateHTTP&&("PUT"===e||"DELETE"===e||"PATCH"===e)){f.type="POST",d.emulateJSON&&(f.data._method=e);var g=d.beforeSend;d.beforeSend=function(a){return a.setRequestHeader("X-HTTP-Method-Override",e),g?g.apply(this,arguments):void 0}}"GET"===f.type||d.emulateJSON||(f.processData=!1),"PATCH"!==f.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(f.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var i=d.xhr=a.ajax(h.extend(f,d));return c.trigger("request",c,i,d),i};var y={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var z=a.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},A=/\((.*?)\)/g,B=/(\(\?)?:\w+/g,C=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(z.prototype,i,{initialize:function(){},route:function(b,c,d){h.isRegExp(b)||(b=this._routeToRegExp(b)),h.isFunction(c)&&(d=c,c=""),d||(d=this[c]);var e=this;return a.history.route(b,function(f){var g=e._extractParameters(b,f);d&&d.apply(e,g),e.trigger.apply(e,["route:"+c].concat(g)),e.trigger("route",c,g),a.history.trigger("route",e,c,g)}),this},navigate:function(b,c){return a.history.navigate(b,c),this},_bindRoutes:function(){if(this.routes){this.routes=h.result(this,"routes");for(var a,b=h.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])}},_routeToRegExp:function(a){return a=a.replace(D,"\\$&").replace(A,"(?:$1)?").replace(B,function(a,b){return b?a:"([^/]+)"}).replace(C,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){var c=a.exec(b).slice(1);return h.map(c,function(a){return a?decodeURIComponent(a):null})}});var E=a.History=function(){this.handlers=[],h.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,G=/^\/+|\/+$/g,H=/msie [\w.]+/,I=/\/$/;E.started=!1,h.extend(E.prototype,i,{interval:50,getHash:function(a){var b=(a||this).location.href.match(/#(.*)$/);return b?b[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=this.location.pathname;var c=this.root.replace(I,"");a.indexOf(c)||(a=a.substr(c.length))}else a=this.getHash();return a.replace(F,"")},start:function(b){if(E.started)throw new Error("Backbone.history has already been started");E.started=!0,this.options=h.extend({},{root:"/"},this.options,b),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var c=this.getFragment(),d=document.documentMode,e=H.exec(navigator.userAgent.toLowerCase())&&(!d||7>=d);this.root=("/"+this.root+"/").replace(G,"/"),e&&this._wantsHashChange&&(this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(c)),this._hasPushState?a.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!e?a.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=c;var f=this.location,g=f.pathname.replace(/[^\/]$/,"$&/")===this.root;return this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!g?(this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&g&&f.hash&&(this.fragment=this.getHash().replace(F,""),this.history.replaceState({},document.title,this.root+this.fragment+f.search)),this.options.silent?void 0:this.loadUrl())},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),E.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();return a===this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe))),a===this.fragment?!1:(this.iframe&&this.navigate(a),this.loadUrl()||this.loadUrl(this.getHash()),void 0)},loadUrl:function(a){var b=this.fragment=this.getFragment(a),c=h.any(this.handlers,function(a){return a.route.test(b)?(a.callback(b),!0):void 0});return c},navigate:function(a,b){if(!E.started)return!1;if(b&&b!==!0||(b={trigger:b}),a=this.getFragment(a||""),this.fragment!==a){this.fragment=a;var c=this.root+a;if(this._hasPushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,c);else{if(!this._wantsHashChange)return this.location.assign(c);this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getFragment(this.getHash(this.iframe))&&(b.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,a,b.replace))}b.trigger&&this.loadUrl(a)}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),a.history=new E;var J=function(a,b){var c,d=this;c=a&&h.has(a,"constructor")?a.constructor:function(){return d.apply(this,arguments)},h.extend(c,d,b);var e=function(){this.constructor=c};return e.prototype=d.prototype,c.prototype=new e,a&&h.extend(c.prototype,a),c.__super__=d.prototype,c};n.extend=q.extend=z.extend=v.extend=E.extend=J;var K=function(){throw new Error('A "url" property or function must be specified')},L=function(a,b){var c=b.error;b.error=function(d){c&&c(a,d,b),a.trigger("error",a,d,b)}}}.call(this),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}(),"object"==typeof exports)var _=require("lodash");var joint={dia:{},ui:{},layout:{},shapes:{},format:{},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);b=(b<<5)-b+d,b&=b}return b},getByPath:function(a,b,c){c=c||".";for(var d,e=b.split(c);e.length;){if(d=e.shift(),!(d in a))return void 0;a=a[d]}return a},setByPath:function(a,b,c,d){d=d||".";var e=b.split(d),f=a,g=0;if(b.indexOf(d)>-1){for(var h=e.length;h-1>g;g++)f=f[e[g]]||(f[e[g]]={});f[e[h-1]]=c}else a[b]=c;return a},flattenObject:function(a,b,c){b=b||".";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},mixin:function(){for(var a=arguments[0],b=1,c=arguments.length;c>b;b++){var d=arguments[b];(Object(d)===d||_.isFunction(d)||null!==d&&void 0!==d)&&_.each(d,function(b,c){return this.mixin.deep&&Object(b)===b?(a[c]||(a[c]=_.isArray(b)?[]:{}),this.mixin(a[c],b),void 0):(a[c]!==b&&(this.mixin.supplement&&a.hasOwnProperty(c)||(a[c]=b)),void 0)},this)}return a},supplement:function(){this.mixin.supplement=!0;var a=this.mixin.apply(this,arguments);return this.mixin.supplement=!1,a},deepMixin:function(){this.mixin.deep=!0;var a=this.mixin.apply(this,arguments);return this.mixin.deep=!1,a},deepSupplement:function(){this.mixin.deep=this.mixin.supplement=!0;var a=this.mixin.apply(this,arguments);return this.mixin.deep=this.mixin.supplement=!1,a},normalizeEvent:function(a){return a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches.length?a.originalEvent.changedTouches[0]:a},nextFrame:function(){var a,b="undefined"!=typeof window;if(b&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var c=0;a=function(a){var b=(new Date).getTime(),d=Math.max(0,16-(b-c)),e=setTimeout(function(){a(b+d)},d);return c=b+d,e}}return b?_.bind(a,window):a}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?_.bind(a,window):a}(),timing:{linear:function(a){return a},quad:function(a){return a*a},cubic:function(a){return a*a*a},inout:function(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return b>e?b:e>c?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=_.keys(a);return function(d){var e,f,g={};for(e=c.length-1;-1!=e;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){return"#"+(1<<24|e+f*a|g+h*a|i+j*a).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0,a=+d[1],h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{blur:function(a){var b=_.isFinite(a.x)?a.x:2;return _.template('<filter><feGaussianBlur stdDeviation="${stdDeviation}"/></filter>',{stdDeviation:_.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){return _.template('<filter><feGaussianBlur in="SourceAlpha" stdDeviation="${blur}"/><feOffset dx="${dx}" dy="${dy}" result="offsetblur"/><feFlood flood-color="${color}"/><feComposite in2="offsetblur" operator="in"/><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',{dx:a.dx||0,dy:a.dy||0,color:a.color||"black",blur:_.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=_.isFinite(a.amount)?a.amount:1;return _.template('<filter><feColorMatrix type="matrix" values="${a} ${b} ${c} 0 0 ${d} ${e} ${f} 0 0 ${g} ${b} ${h} 0 0 0 0 0 1 0"/></filter>',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=_.isFinite(a.amount)?a.amount:1;return _.template('<filter><feColorMatrix type="matrix" values="${a} ${b} ${c} 0 0 ${d} ${e} ${f} 0 0 ${g} ${h} ${i} 0 0 0 0 0 1 0"/></filter>',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=_.isFinite(a.amount)?a.amount:1;return _.template('<filter><feColorMatrix type="saturate" values="${amount}"/></filter>',{amount:1-b})},hueRotate:function(a){return _.template('<filter><feColorMatrix type="hueRotate" values="${angle}"/></filter>',{angle:a.angle||0})},invert:function(a){var b=_.isFinite(a.amount)?a.amount:1;return _.template('<filter><feComponentTransfer><feFuncR type="table" tableValues="${amount} ${amount2}"/><feFuncG type="table" tableValues="${amount} ${amount2}"/><feFuncB type="table" tableValues="${amount} ${amount2}"/></feComponentTransfer></filter>',{amount:b,amount2:1-b})},brightness:function(a){return _.template('<filter><feComponentTransfer><feFuncR type="linear" slope="${amount}"/><feFuncG type="linear" slope="${amount}"/><feFuncB type="linear" slope="${amount}"/></feComponentTransfer></filter>',{amount:_.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=_.isFinite(a.amount)?a.amount:1;return _.template('<filter><feComponentTransfer><feFuncR type="linear" slope="${amount}" intercept="${amount2}"/><feFuncG type="linear" slope="${amount}" intercept="${amount2}"/><feFuncB type="linear" slope="${amount}" intercept="${amount2}"/></feComponentTransfer></filter>',{amount:b,amount2:.5-b/2})}}}};if("object"==typeof exports&&(module.exports=joint),function(a,b){"function"==typeof define&&define.amd?define(["lodash"],b):a.Vectorizer=a.V=b(a._)}(this,function(a){function b(b,d,e){if(!b)return void 0;if("object"==typeof b)return new h(b);if(d=d||{},"svg"===b.toLowerCase())d.xmlns=i.xmlns,d["xmlns:xlink"]=i.xlink,d.version=j;else if("<"===b[0]){var f='<svg xmlns="'+i.xmlns+'" xmlns:xlink="'+i.xlink+'" version="'+j+'">'+b+"</svg>",g=new DOMParser;g.async=!1;var k=g.parseFromString(f,"text/xml").documentElement;return k.childNodes.length>1?a.map(k.childNodes,function(a){return new h(document.importNode(a,!0))}):new h(document.importNode(k.firstChild,!0))}b=document.createElementNS(i.xmlns,b);for(var l in d)c(b,l,d[l]);"[object Array]"!=Object.prototype.toString.call(e)&&(e=[e]);for(var m,n=0,o=e[0]&&e.length||0;o>n;n++)m=e[n],b.appendChild(m instanceof h?m.node:m);return new h(b)}function c(a,b,c){if(b.indexOf(":")>-1){var d=b.split(":");a.setAttributeNS(i[d[0]],d[1],c)}else"id"===b?a.id=c:a.setAttribute(b,c)}function d(a){var b,c,d;if(a){var e=a.match(/translate\((.*)\)/);e&&(b=e[1].split(","));var f=a.match(/rotate\((.*)\)/);f&&(c=f[1].split(","));var g=a.match(/scale\((.*)\)/);g&&(d=g[1].split(","))}var h=d&&d[0]?parseFloat(d[0]):1;return{translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:h,sy:d&&d[1]?parseFloat(d[1]):h}}}function e(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}}function f(a){var b=e(a,{x:0,y:1}),c=e(a,{x:1,y:0}),d=180/Math.PI*Math.atan2(b.y,b.x)-90,f=180/Math.PI*Math.atan2(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:Math.sqrt(a.a*a.a+a.b*a.b),scaleY:Math.sqrt(a.c*a.c+a.d*a.d),skewX:d,skewY:f,rotation:d}}function h(b){this.node=b,this.node.id||(this.node.id=a.uniqueId("v_"))}!(!window.SVGAngle&&!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));var i={xmlns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"},j="1.1";h.prototype={translate:function(a,b){b=b||0;var c=this.attr("transform")||"",e=d(c);if("undefined"==typeof a)return e.translate;c=c.replace(/translate\([^\)]*\)/g,"").trim();var f=e.translate.tx+a,g=e.translate.ty+b;return this.attr("transform","translate("+f+","+g+") "+c),this},rotate:function(a,b,c){var e=this.attr("transform")||"",f=d(e);if("undefined"==typeof a)return f.rotate;e=e.replace(/rotate\([^\)]*\)/g,"").trim();var g=f.rotate.angle+a%360,h=void 0!==b&&void 0!==c?","+b+","+c:"";return this.attr("transform",e+" rotate("+g+h+")"),this},scale:function(a,b){b="undefined"==typeof b?a:b;var c=this.attr("transform")||"",e=d(c);return"undefined"==typeof a?e.scale:(c=c.replace(/scale\([^\)]*\)/g,"").trim(),this.attr("transform",c+" scale("+a+","+b+")"),this)},bbox:function(a,b){if(!this.node.ownerSVGElement)return{x:0,y:0,width:0,height:0};var c;try{c=this.node.getBBox(),c={x:0|c.x,y:0|c.y,width:0|c.width,height:0|c.height}}catch(d){c={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}if(a)return c;var e=this.node.getTransformToElement(b||this.node.ownerSVGElement),f=[],g=this.node.ownerSVGElement.createSVGPoint();g.x=c.x,g.y=c.y,f.push(g.matrixTransform(e)),g.x=c.x+c.width,g.y=c.y,f.push(g.matrixTransform(e)),g.x=c.x+c.width,g.y=c.y+c.height,f.push(g.matrixTransform(e)),g.x=c.x,g.y=c.y+c.height,f.push(g.matrixTransform(e));for(var h=f[0].x,i=h,j=f[0].y,k=j,l=1,m=f.length;m>l;l++){var n=f[l].x,o=f[l].y;h>n?h=n:n>i&&(i=n),j>o?j=o:o>k&&(k=o)}return{x:h,y:j,width:i-h,height:k-j}},text:function(a){var b,c=a.split("\n"),d=0;if(this.attr("y","0.8em"),1===c.length)return this.node.textContent=a,this;for(this.node.textContent="";d<c.length;d++)b=k("tspan",{dy:0==d?"0em":"1em",x:this.attr("x")||0}),b.node.textContent=c[d],this.append(b);return this},attr:function(b,d){return"string"==typeof b&&"undefined"==typeof d?this.node.getAttribute(b):("object"==typeof b?a.each(b,function(a,b){c(this.node,b,a)},this):c(this.node,b,d),this)},remove:function(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)},append:function(b){var c=b;return a.isArray(b)||(c=[b]),a.each(c,function(a){this.node.appendChild(a instanceof h?a.node:a)},this),this},prepend:function(a){this.node.insertBefore(a instanceof h?a.node:a,this.node.firstChild)},svg:function(){return this.node instanceof window.SVGSVGElement?this:k(this.node.ownerSVGElement)},defs:function(){var a=this.svg().node.getElementsByTagName("defs");return a&&a.length?k(a[0]):void 0},clone:function(){var b=k(this.node.cloneNode(!0));return b.node.id=a.uniqueId("v-"),b},toLocalPoint:function(a,b){var c=this.svg().node,d=c.createSVGPoint();d.x=a,d.y=b;try{var e=d.matrixTransform(c.getScreenCTM().inverse()),f=this.node.getTransformToElement(c).inverse()}catch(g){return d}return e.matrixTransform(f)},translateCenterToPoint:function(a){var b=this.bbox(),c=g.rect(b).center();this.translate(a.x-c.x,a.y-c.y)},translateAndAutoOrient:function(a,b,c){var d=this.scale();this.attr("transform",""),this.scale(d.sx,d.sy);var e=this.svg().node,h=this.bbox(!1,c),i=e.createSVGTransform();i.setTranslate(-h.x-h.width/2,-h.y-h.height/2);var j=e.createSVGTransform(),k=g.point(a).changeInAngle(a.x-b.x,a.y-b.y,b);j.setRotate(k,0,0);var l=e.createSVGTransform(),m=g.point(a).move(b,h.width/2);l.setTranslate(a.x+(a.x-m.x),a.y+(a.y-m.y));var n=this.node.getTransformToElement(c),o=e.createSVGTransform();o.setMatrix(l.matrix.multiply(j.matrix.multiply(i.matrix.multiply(n))));var p=f(o.matrix);return this.translate(p.translateX,p.translateY),this.rotate(p.rotation),this},animateAlongPath:function(b,c){var d=k("animateMotion",b),e=k("mpath",{"xlink:href":"#"+k(c).node.id});d.append(e),this.append(d);try{d.node.beginElement()}catch(f){if("fake"===document.documentElement.getAttribute("smiling")){var g=d.node;g.animators=new Array;var h=g.getAttribute("id");h&&(id2anim[h]=g),a.each(getTargets(g),function(a,b){var c=new Animator(g,a,b);animators.push(c),g.animators[b]=c}),a.invoke(g.animators,"register")}}}};var k=b;k.decomposeMatrix=f;var l=k("svg").node;return k.createSVGMatrix=function(b){return a.extend(l.createSVGMatrix(),b)},k.createSVGTransform=function(){return l.createSVGTransform()},k.createSVGPoint=function(a,b){var c=l.createSVGPoint();return c.x=a,c.y=b,c},k}),function(a,b){"function"==typeof define&&define.amd?define([],b):a.g=b()}(this,function(){function a(b,c){if(!(this instanceof a))return new a(b,c);var d;void 0===c&&Object(b)!==b?(d=b.split(-1===_.indexOf(b,"@")?" ":"@"),this.x=parseInt(d[0],10),this.y=parseInt(d[1],10)):Object(b)===b?(this.x=b.x,this.y=b.y):(this.x=b,this.y=c)}function b(c,d){return this instanceof b?(this.start=a(c),this.end=a(d),void 0):new b(c,d)}function c(a,b,d,e){return this instanceof c?(void 0===b&&(b=a.y,d=a.width,e=a.height,a=a.x),this.x=a,this.y=b,this.width=d,this.height=e,void 0):new c(a,b,d,e)}function d(b,c,e){return this instanceof d?(b=a(b),this.x=b.x,this.y=b.y,this.a=c,this.b=e,void 0):new d(b,c,e)}var e=Math,f=e.abs,g=e.cos,h=e.sin,i=e.sqrt,j=e.min,k=e.max;e.atan;var l=e.atan2;e.acos;var m=e.round,n=e.floor,o=e.PI,p=e.random,q=function(a){return 180*a/o%360},r=function(a){return a%360*o/180},s=function(a,b){return b*Math.round(a/b)},t=function(a){return a%360+(0>a?360:0)};a.prototype={toString:function(){return this.x+"@"+this.y},adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=j(k(this.x,a.x),a.x+a.width),this.y=j(k(this.y,a.y),a.y+a.height),this)},theta:function(b){b=a(b);var c=-(b.y-this.y),d=b.x-this.x,e=10,f=0==c.toFixed(e)&&0==d.toFixed(e)?0:l(c,d);return 0>f&&(f=2*o+f),180*f/o},distance:function(a){return b(this,a).length()},manhattanDistance:function(a){return f(a.x-this.x)+f(a.y-this.y)},offset:function(a,b){return this.x+=a||0,this.y+=b||0,this},magnitude:function(){return i(this.x*this.x+this.y*this.y)||.01},update:function(a,b){return this.x=a||0,this.y=b||0,this},round:function(a){return this.x=a?this.x.toFixed(a):m(this.x),this.y=a?this.y.toFixed(a):m(this.y),this},normalize:function(a){var b=(a||1)/this.magnitude();return this.x=b*this.x,this.y=b*this.y,this},difference:function(b){return a(this.x-b.x,this.y-b.y)},toPolar:function(b){b=b&&a(b)||a(0,0);var c=this.x,d=this.y;return this.x=i((c-b.x)*(c-b.x)+(d-b.y)*(d-b.y)),this.y=r(b.theta(a(c,d))),this},rotate:function(b,c){c=(c+360)%360,this.toPolar(b),this.y+=r(c);var d=a.fromPolar(this.x,this.y,b);return this.x=d.x,this.y=d.y,this},move:function(b,c){var d=r(a(b).theta(this));return this.offset(g(d)*c,-h(d)*c)},changeInAngle:function(b,c,d){return a(this).offset(-b,-c).theta(d)-this.theta(d)},equals:function(a){return this.x===a.x&&this.y===a.y}},a.fromPolar=function(b,c,d){d=d&&a(d)||a(0,0);var e=f(b*g(c)),i=f(b*h(c)),j=t(q(c));return 90>j?i=-i:180>j?(e=-e,i=-i):270>j&&(e=-e),a(d.x+e,d.y+i)},a.random=function(b,c,d,e){return a(n(p()*(c-b+1)+b),n(p()*(e-d+1)+d))},b.prototype={toString:function(){return this.start.toString()+" "+this.end.toString()},length:function(){return i(this.squaredLength())},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},midpoint:function(){return a((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)},intersection:function(b){var c=a(this.end.x-this.start.x,this.end.y-this.start.y),d=a(b.end.x-b.start.x,b.end.y-b.start.y),e=c.x*d.y-c.y*d.x,f=a(b.start.x-this.start.x,b.start.y-this.start.y),g=f.x*d.y-f.y*d.x,h=f.x*c.y-f.y*c.x;if(0===e||0>g*e||0>h*e)return null;if(e>0){if(g>e||h>e)return null}else if(e>g||e>h)return null;return a(this.start.x+g*c.x/e,this.start.y+g*c.y/e)}},c.prototype={toString:function(){return this.origin().toString()+" "+this.corner().toString()},origin:function(){return a(this.x,this.y)},corner:function(){return a(this.x+this.width,this.y+this.height)},topRight:function(){return a(this.x+this.width,this.y)},bottomLeft:function(){return a(this.x,this.y+this.height)},center:function(){return a(this.x+this.width/2,this.y+this.height/2)},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();return e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y?!1:!0},sideNearestToPoint:function(b){b=a(b);var c=b.x-this.x,d=this.x+this.width-b.x,e=b.y-this.y,f=this.y+this.height-b.y,g=c,h="left";return g>d&&(g=d,h="right"),g>e&&(g=e,h="top"),g>f&&(g=f,h="bottom"),h},containsPoint:function(b){return b=a(b),b.x>this.x&&b.x<this.x+this.width&&b.y>this.y&&b.y<this.y+this.height?!0:!1},pointNearestToPoint:function(b){if(b=a(b),this.containsPoint(b)){var c=this.sideNearestToPoint(b);switch(c){case"right":return a(this.x+this.width,b.y);case"left":return a(this.x,b.y);case"bottom":return a(b.x,this.y+this.height);case"top":return a(b.x,this.y)}}return b.adhereToRect(this)},intersectionWithLineFromCenterToPoint:function(c,d){c=a(c);var e,f=a(this.x+this.width/2,this.y+this.height/2);d&&c.rotate(f,d);for(var g=[b(this.origin(),this.topRight()),b(this.topRight(),this.corner()),b(this.corner(),this.bottomLeft()),b(this.bottomLeft(),this.origin())],h=b(f,c),i=g.length-1;i>=0;--i){var j=g[i].intersection(h);if(null!==j){e=j;break}}return e&&d&&e.rotate(f,-d),e},moveAndExpand:function(a){return this.x+=a.x,this.y+=a.y,this.width+=a.width,this.height+=a.height,this},round:function(a){return this.x=a?this.x.toFixed(a):m(this.x),this.y=a?this.y.toFixed(a):m(this.y),this.width=a?this.width.toFixed(a):m(this.width),this.height=a?this.height.toFixed(a):m(this.height),this}},d.prototype={toString:function(){return a(this.x,this.y).toString()+" "+this.a+" "+this.b},bbox:function(){return c(this.x-this.a,this.y-this.b,2*this.a,2*this.b)},intersectionWithLineFromCenterToPoint:function(b,c){b=a(b),c&&b.rotate(a(this.x,this.y),c);var d,e=b.x-this.x,f=b.y-this.y;if(0===e)return d=this.bbox().pointNearestToPoint(b),c?d.rotate(a(this.x,this.y),-c):d;var g=f/e,h=g*g,j=this.a*this.a,k=this.b*this.b,l=i(1/(1/j+h/k));l=0>e?-l:l;var m=g*l;return d=a(this.x+l,this.y+m),c?d.rotate(a(this.x,this.y),-c):d}};var u={curveThroughPoints:function(a){for(var b=this.getCurveControlPoints(a),c=["M",a[0].x,a[0].y],d=0;d<b[0].length;d++)c.push("C",b[0][d].x,b[0][d].y,b[1][d].x,b[1][d].y,a[d+1].x,a[d+1].y);return c},getCurveControlPoints:function(b){var c,d=[],e=[],f=b.length-1;if(1==f)return d[0]=a((2*b[0].x+b[1].x)/3,(2*b[0].y+b[1].y)/3),e[0]=a(2*d[0].x-b[0].x,2*d[0].y-b[0].y),[d,e];var g=[];for(c=1;f-1>c;c++)g[c]=4*b[c].x+2*b[c+1].x;g[0]=b[0].x+2*b[1].x,g[f-1]=(8*b[f-1].x+b[f].x)/2;var h=this.getFirstControlPoints(g);for(c=1;f-1>c;++c)g[c]=4*b[c].y+2*b[c+1].y;g[0]=b[0].y+2*b[1].y,g[f-1]=(8*b[f-1].y+b[f].y)/2;var i=this.getFirstControlPoints(g);for(c=0;f>c;c++)d.push(a(h[c],i[c])),f-1>c?e.push(a(2*b[c+1].x-h[c+1],2*b[c+1].y-i[c+1])):e.push(a((b[f].x+h[f-1])/2,(b[f].y+i[f-1])/2));return[d,e]},getFirstControlPoints:function(a){var b=a.length,c=[],d=[],e=2;c[0]=a[0]/e;for(var f=1;b>f;f++)d[f]=1/e,e=(b-1>f?4:3.5)-d[f],c[f]=(a[f]-c[f-1])/e;for(f=1;b>f;f++)c[b-f-1]-=d[b-f]*c[b-f];return c}};return{toDeg:q,toRad:r,snapToGrid:s,normalizeAngle:t,point:a,line:b,rect:c,ellipse:d,bezier:u}}),"object"==typeof exports)var joint={dia:{Link:require("./joint.dia.link").Link,Element:require("./joint.dia.element").Element},shapes:require("../plugins/shapes")},Backbone=require("backbone"),_=require("lodash"),g=require("./geometry").g; if(joint.dia.GraphCells=Backbone.Collection.extend({initialize:function(){this.on("change:z",this.sort,this)},model:function(a,b){if("link"===a.type)return new joint.dia.Link(a,b);var c=a.type.split(".")[0],d=a.type.split(".")[1];return joint.shapes[c]&&joint.shapes[c][d]?new joint.shapes[c][d](a,b):new joint.dia.Element(a,b)},comparator:function(a){return a.get("z")||0},getConnectedLinks:function(a,b){b=b||{},_.isUndefined(b.inbound)&&_.isUndefined(b.outbound)&&(b.inbound=b.outbound=!0);var c=[];return this.each(function(d){var e=d.get("source"),f=d.get("target");e&&e.id===a.id&&b.outbound&&c.push(d),f&&f.id===a.id&&b.inbound&&c.push(d)}),c}}),joint.dia.Graph=Backbone.Model.extend({initialize:function(){this.set("cells",new joint.dia.GraphCells),this.get("cells").on("all",this.trigger,this),this.get("cells").on("remove",this.removeCell,this)},toJSON:function(){var a=Backbone.Model.prototype.toJSON.apply(this,arguments);return a.cells=this.get("cells").toJSON(),a},fromJSON:function(a){if(!a.cells)throw new Error("Graph JSON must contain cells array.");var b=a,c=a.cells;delete b.cells,this.set(b),this.resetCells(c)},clear:function(){this.get("cells").remove(this.get("cells").models)},_prepareCell:function(a){return a instanceof Backbone.Model&&_.isUndefined(a.get("z"))?a.set("z",this.get("cells").length,{silent:!0}):_.isUndefined(a.z)&&(a.z=this.get("cells").length),a},addCell:function(a,b){return _.isArray(a)?this.addCells(a,b):(this.get("cells").add(this._prepareCell(a),b||{}),this)},addCells:function(a,b){return _.each(a,function(a){this.addCell(a,b)},this),this},resetCells:function(a){return this.get("cells").reset(_.map(a,this._prepareCell,this)),this},removeCell:function(a,b,c){c&&c.disconnectLinks?this.disconnectLinks(a):this.removeLinks(a),this.get("cells").remove(a,{silent:!0})},getCell:function(a){return this.get("cells").get(a)},getElements:function(){return this.get("cells").filter(function(a){return a instanceof joint.dia.Element})},getLinks:function(){return this.get("cells").filter(function(a){return a instanceof joint.dia.Link})},getConnectedLinks:function(a,b){return this.get("cells").getConnectedLinks(a,b)},getNeighbors:function(a){var b=this.getConnectedLinks(a),c=[],d=this.get("cells");return _.each(b,function(b){var e=b.get("source"),f=b.get("target");if(!e.x){var g=d.get(e.id);g!==a&&c.push(g)}if(!f.x){var h=d.get(f.id);h!==a&&c.push(h)}}),c},disconnectLinks:function(a){_.each(this.getConnectedLinks(a),function(b){b.set(b.get("source").id===a.id?"source":"target",g.point(0,0))})},removeLinks:function(a){_.invoke(this.getConnectedLinks(a),"remove")},findModelsFromPoint:function(a){return _.filter(this.getElements(),function(b){return b.getBBox().containsPoint(a)})},findModelsInArea:function(a){return _.filter(this.getElements(),function(b){return b.getBBox().intersect(a)})}}),"object"==typeof exports&&(module.exports.Graph=joint.dia.Graph),"object"==typeof exports)var joint={util:require("./core").util,dia:{Link:require("./joint.dia.link").Link}},Backbone=require("backbone"),_=require("lodash");if(joint.dia.Cell=Backbone.Model.extend({constructor:function(a,b){var c,d=a||{};this.cid=_.uniqueId("c"),this.attributes={},b&&b.collection&&(this.collection=b.collection),b&&b.parse&&(d=this.parse(d,b)||{}),(c=_.result(this,"defaults"))&&(d=_.merge({},c,d)),this.set(d,b),this.changed={},this.initialize.apply(this,arguments)},toJSON:function(){var a=this.constructor.prototype.defaults.attrs||{},b=this.attributes.attrs,c={};_.each(b,function(b,d){var e=a[d];_.each(b,function(a,b){_.isObject(a)&&!_.isArray(a)?_.each(a,function(a,f){e&&e[b]&&_.isEqual(e[b][f],a)||(c[d]=c[d]||{},(c[d][b]||(c[d][b]={}))[f]=a)}):e&&_.isEqual(e[b],a)||(c[d]=c[d]||{},c[d][b]=a)})});var d=_.cloneDeep(_.omit(this.attributes,"attrs"));return d.attrs=c,d},initialize:function(a){a&&a.id||this.set("id",joint.util.uuid(),{silent:!0}),this._transitionIds={},this.processPorts(),this.on("change:attrs",this.processPorts,this)},processPorts:function(){var a=this.ports,b={};_.each(this.get("attrs"),function(a){a.port&&(_.isUndefined(a.port.id)?b[a.port]={id:a.port}:b[a.port.id]=a.port)});var c={};if(_.each(a,function(a,d){b[d]||(c[d]=!0)}),this.collection&&!_.isEmpty(c)){var d=this.collection.getConnectedLinks(this,{inbound:!0});_.each(d,function(a){c[a.get("target").port]&&a.remove()});var e=this.collection.getConnectedLinks(this,{outbound:!0});_.each(e,function(a){c[a.get("source").port]&&a.remove()})}this.ports=b},remove:function(a){var b=this.collection;b&&b.trigger("batch:start");var c=this.get("parent");if(c){var d=this.collection&&this.collection.get(c);d.unembed(this)}_.invoke(this.getEmbeddedCells(),"remove",a),this.trigger("remove",this,this.collection,a),b&&b.trigger("batch:stop")},toFront:function(){this.collection&&this.set("z",(this.collection.last().get("z")||0)+1)},toBack:function(){this.collection&&this.set("z",(this.collection.first().get("z")||0)-1)},embed:function(a){if(this.get("parent")==a.id)throw new Error("Recursive embedding not allowed.");this.trigger("batch:start"),a.set("parent",this.id),this.set("embeds",_.uniq((this.get("embeds")||[]).concat([a.id]))),this.trigger("batch:stop")},unembed:function(a){this.trigger("batch:start");var b=a.id;a.unset("parent"),this.set("embeds",_.without(this.get("embeds"),b)),this.trigger("batch:stop")},getEmbeddedCells:function(){return this.collection?_.map(this.get("embeds")||[],function(a){return this.collection.get(a)},this):[]},clone:function(a){a=a||{};var b=Backbone.Model.prototype.clone.apply(this,arguments);if(b.set("id",joint.util.uuid(),{silent:!0}),b.set("embeds",""),!a.deep)return b;var c=this.getEmbeddedCells(),d=[b],e={};return _.each(c,function(a){var c=a.clone({deep:!0});b.embed(c[0]),_.each(c,function(b){if(d.push(b),!(b instanceof joint.dia.Link)){var c=this.collection.getConnectedLinks(a,{inbound:!0});_.each(c,function(a){var c=e[a.id]||a.clone();e[a.id]=c;var d=_.clone(c.get("target"));d.id=b.id,c.set("target",d)});var f=this.collection.getConnectedLinks(a,{outbound:!0});_.each(f,function(a){var c=e[a.id]||a.clone();e[a.id]=c;var d=_.clone(c.get("source"));d.id=b.id,c.set("source",d)})}},this)},this),d=d.concat(_.values(e))},attr:function(a,b,c){var d=this.get("attrs"),e="/";if(_.isString(a)){if(b){var f={};return joint.util.setByPath(f,a,b,e),this.set("attrs",_.merge({},d,f),c)}return joint.util.getByPath(d,a,e)}return this.set("attrs",_.merge({},d,a),b)},transition:function(a,b,c,d){d=d||"/";var e={duration:100,delay:10,timingFunction:joint.util.timing.linear,valueFunction:joint.util.interpolate.number};c=_.extend(e,c);var f,g=a.split(d),h=g[0],i=g.length>1,j=0,k=_.bind(function(b){var e,g,l;if(j=j||b,b-=j,g=b/c.duration,1>g?this._transitionIds[a]=e=joint.util.nextFrame(k):(g=1,delete this._transitionIds[a]),l=f(c.timingFunction(g)),i){var m=joint.util.setByPath({},a,l,d)[h];l=_.merge({},this.get(h),m)}c.transitionId=e,this.set(h,l,c),e||this.trigger("transition:end",this,a)},this),l=_.bind(function(e){this.stopTransitions(a),f=c.valueFunction(joint.util.getByPath(this.attributes,a,d),b),this._transitionIds[a]=joint.util.nextFrame(e),this.trigger("transition:start",this,a)},this);return _.delay(l,c.delay,k)},getTransitions:function(){return _.keys(this._transitionIds)},stopTransitions:function(a,b){b=b||"/";var c=a&&a.split(b);_(this._transitionIds).keys().filter(c&&function(a){return _.isEqual(c,a.split(b).slice(0,c.length))}).each(function(a){joint.util.cancelFrame(this._transitionIds[a]),delete this._transitionIds[a],this.trigger("transition:end",this,a)},this)}}),joint.dia.CellView=Backbone.View.extend({tagName:"g",attributes:function(){return{"model-id":this.model.id}},initialize:function(){_.bindAll(this,"remove","update"),this.$el.data("view",this),this.listenTo(this.model,"remove",this.remove),this.listenTo(this.model,"change:attrs",this.update)},_configure:function(a){a.id=a.id||joint.util.guid(this),Backbone.View.prototype._configure.apply(this,arguments)},_ensureElement:function(){var a;if(this.el)a=_.result(this,"el");else{var b=_.extend({id:this.id},_.result(this,"attributes"));this.className&&(b["class"]=_.result(this,"className")),a=V(_.result(this,"tagName"),b).node}this.setElement(a,!1)},findBySelector:function(a){var b="."===a?this.$el:this.$el.find(a);return b},notify:function(a){if(this.paper){var b=Array.prototype.slice.call(arguments,1);this.trigger.apply(this,[a].concat(b)),this.paper.trigger.apply(this.paper,[a,this].concat(b))}},getStrokeBBox:function(a){var b=!!a;a=a||this.el;var c,d=V(a).bbox(!1,this.paper.viewport);return c=b?V(a).attr("stroke-width"):this.model.attr("rect/stroke-width")||this.model.attr("circle/stroke-width")||this.model.attr("ellipse/stroke-width")||this.model.attr("path/stroke-width"),c=parseFloat(c)||0,g.rect(d).moveAndExpand({x:-c/2,y:-c/2,width:c,height:c})},getBBox:function(){return V(this.el).bbox()},highlight:function(a){a=a?this.$(a)[0]||this.el:this.el;var b=V(a).attr("class")||"";/\bhighlighted\b/.exec(b)||V(a).attr("class",b.trim()+" highlighted")},unhighlight:function(a){a=a?this.$(a)[0]||this.el:this.el,V(a).attr("class",(V(a).attr("class")||"").replace(/\bhighlighted\b/,"").trim())},findMagnet:function(a){var b=this.$(a);if(0===b.length||b[0]===this.el){var c=this.model.get("attrs")||{};return c["."]&&c["."].magnet===!1?void 0:this.el}return b.attr("magnet")?b[0]:this.findMagnet(b.parent())},applyFilter:function(a,b){var c=this.findBySelector(a),d=b.name+this.paper.svg.id+joint.util.hashCode(JSON.stringify(b));if(!this.paper.svg.getElementById(d)){var e=joint.util.filter[b.name]&&joint.util.filter[b.name](b.args||{});if(!e)throw new Error("Non-existing filter "+b.name);var f=V(e);f.attr("filterUnits","userSpaceOnUse"),f.node.id=d,V(this.paper.svg).defs().append(f)}c.each(function(){V(this).attr("filter","url(#"+d+")")})},applyGradient:function(a,b,c){var d=this.findBySelector(a),e=c.type+this.paper.svg.id+joint.util.hashCode(JSON.stringify(c));if(!this.paper.svg.getElementById(e)){var f=["<"+c.type+">",_.map(c.stops,function(a){return'<stop offset="'+a.offset+'" stop-color="'+a.color+'" stop-opacity="'+(_.isFinite(a.opacity)?a.opacity:1)+'" />'}).join(""),"</"+c.type+">"].join(""),g=V(f);c.attrs&&g.attr(c.attrs),g.node.id=e,V(this.paper.svg).defs().append(g)}d.each(function(){V(this).attr(b,"url(#"+e+")")})},getSelector:function(a,b){if(a===this.el)return b;var c=$(a).index();return b=a.tagName+":nth-child("+(c+1)+")"+" "+(b||""),this.getSelector($(a).parent()[0],b+" ")},pointerdblclick:function(a,b,c){this.notify("cell:pointerdblclick",a,b,c)},pointerdown:function(a,b,c){this.model.collection&&(this.model.trigger("batch:start"),this._collection=this.model.collection),this.notify("cell:pointerdown",a,b,c)},pointermove:function(a,b,c){this.notify("cell:pointermove",a,b,c)},pointerup:function(a,b,c){this.notify("cell:pointerup",a,b,c),this._collection&&(this._collection.trigger("batch:stop"),delete this._collection)}}),"object"==typeof exports&&(module.exports.Cell=joint.dia.Cell,module.exports.CellView=joint.dia.CellView),"object"==typeof exports)var joint={util:require("./core").util,dia:{Cell:require("./joint.dia.cell").Cell,CellView:require("./joint.dia.cell").CellView}},Backbone=require("backbone"),_=require("lodash");if(joint.dia.Element=joint.dia.Cell.extend({defaults:{position:{x:0,y:0},size:{width:1,height:1},angle:0},position:function(a,b){this.set("position",{x:a,y:b})},translate:function(a,b,c){if(b=b||0,0===a&&0===b)return this;var d=this.get("position")||{x:0,y:0},e={x:d.x+a||0,y:d.y+b||0};return c&&c.transition?(_.isObject(c.transition)||(c.transition={}),this.transition("position",e,_.extend({},c.transition,{valueFunction:joint.util.interpolate.object}))):(this.set("position",e,c),_.invoke(this.getEmbeddedCells(),"translate",a,b,c)),this},resize:function(a,b){return this.trigger("batch:start"),this.set("size",{width:a,height:b}),this.trigger("batch:stop"),this},rotate:function(a,b){return this.set("angle",b?a:((this.get("angle")||0)+a)%360)},getBBox:function(){var a=this.get("position"),b=this.get("size");return g.rect(a.x,a.y,b.width,b.height)}}),joint.dia.ElementView=joint.dia.CellView.extend({className:function(){return"element "+this.model.get("type").split(".").join(" ")},initialize:function(){_.bindAll(this,"translate","resize","rotate"),joint.dia.CellView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:position",this.translate),this.listenTo(this.model,"change:size",this.resize),this.listenTo(this.model,"change:angle",this.rotate)},update:function(a,b){var c=this.model.get("attrs"),d=V(this.$(".rotatable")[0]);if(d){var e=d.attr("transform");d.attr("transform","")}var f=[];_.each(b||c,function(a,b){var c=this.findBySelector(b);if(0!==c.length){var d=["style","text","html","ref-x","ref-y","ref-dx","ref-dy","ref","x-alignment","y-alignment","port"];_.isObject(a.filter)&&(d.push("filter"),this.applyFilter(b,a.filter)),_.isObject(a.fill)&&(d.push("fill"),this.applyGradient(b,"fill",a.fill)),_.isObject(a.stroke)&&(d.push("stroke"),this.applyGradient(b,"stroke",a.stroke));var e=_.omit(a,d);c.each(function(){V(this).attr(e)}),a.port&&c.attr("port",_.isUndefined(a.port.id)?a.port:a.port.id),a.style&&c.css(a.style),_.isUndefined(a.text)||c.each(function(){V(this).text(a.text+"")}),_.isUndefined(a.html)||c.each(function(){$(this).html(a.html+"")}),_.isUndefined(a["ref-x"])&&_.isUndefined(a["ref-y"])&&_.isUndefined(a["ref-dx"])&&_.isUndefined(a["ref-dy"])&&_.isUndefined(a["x-alignment"])&&_.isUndefined(a["y-alignment"])||f.push(c)}},this);var g=this.el.getBBox();b=b||{},_.each(f,function(a){var d=b[a.selector],e=d?_.merge({},c[a.selector],d):c[a.selector];this.positionRelative(a,g,e)},this),d&&d.attr("transform",e||"")},positionRelative:function(a,b,c){function d(a){return _.isNumber(a)&&!_.isNaN(a)}var e=c.ref,f=parseFloat(c["ref-x"]),g=parseFloat(c["ref-y"]),h=parseFloat(c["ref-dx"]),i=parseFloat(c["ref-dy"]),j=c["y-alignment"],k=c["x-alignment"],l=_.contains(_.pluck(_.pluck(a.parents("g"),"className"),"baseVal"),"scalable");e&&(b=V(this.findBySelector(e)[0]).bbox(!1,this.el));var m=V(a[0]);m.attr("transform")&&m.attr("transform",m.attr("transform").replace(/translate\([^)]*\)/g,"")||"");var n=0,o=0;if(d(h))if(l){var p=V(this.$(".scalable")[0]).scale();n=b.x+b.width+h/p.sx}else n=b.x+b.width+h;if(d(i))if(l){var p=V(this.$(".scalable")[0]).scale();o=b.y+b.height+i/p.sy}else o=b.y+b.height+i;if(d(f))if(f>0&&1>f)n=b.x+b.width*f;else if(l){var p=V(this.$(".scalable")[0]).scale();n=b.x+f/p.sx}else n=b.x+f;if(d(g))if(g>0&&1>g)o=b.y+b.height*g;else if(l){var p=V(this.$(".scalable")[0]).scale();o=b.y+g/p.sy}else o=b.y+g;var q=m.bbox(!1,this.paper.viewport);"middle"===j?o-=q.height/2:d(j)&&(o+=j>0&&1>j?q.height*j:j),"middle"===k?n-=q.width/2:d(k)&&(n+=k>0&&1>k?q.width*k:k),m.translate(n,o)},render:function(){var a=this.model.markup||this.model.get("markup");if(!a)throw new Error("properties.markup is missing while the default render() implementation is used.");var b=V(a);return V(this.el).append(b),this.update(),this.resize(),this.rotate(),this.translate(),this},scale:function(a,b){V(this.el).scale(a,b)},resize:function(){var a=this.model.get("size")||{width:1,height:1},b=this.model.get("angle")||0,c=V(this.$(".scalable")[0]);if(c){var d=c.bbox(!0);c.attr("transform","scale("+a.width/d.width+","+a.height/d.height+")");var e=V(this.$(".rotatable")[0]),f=e&&e.attr("transform");if(f&&"null"!==f){e.attr("transform",f+" rotate("+-b+","+a.width/2+","+a.height/2+")");var g=c.bbox(!1,this.paper.viewport);this.model.set("position",{x:g.x,y:g.y}),this.rotate()}this.update()}},translate:function(){var a=this.model.get("position")||{x:0,y:0};V(this.el).attr("transform","translate("+a.x+","+a.y+")")},rotate:function(){var a=V(this.$(".rotatable")[0]);if(a){var b=this.model.get("angle")||0,c=this.model.get("size")||{width:1,height:1},d=c.width/2,e=c.height/2;a.attr("transform","rotate("+b+","+d+","+e+")")}},pointerdown:function(a,b,c){if(a.target.getAttribute("magnet")&&this.paper.options.validateMagnet.call(this.paper,this,a.target)){this.model.trigger("batch:start");var d=this.paper.getDefaultLink(this,a.target);d.set({source:{id:this.model.id,selector:this.getSelector(a.target),port:$(a.target).attr("port")},target:{x:b,y:c}}),this.paper.model.addCell(d),this._linkView=this.paper.findViewByModel(d),this._linkView.startArrowheadMove("target")}else this._dx=b,this._dy=c,joint.dia.CellView.prototype.pointerdown.apply(this,arguments)},pointermove:function(a,b,c){if(this._linkView)this._linkView.pointermove(a,b,c);else{var d=this.paper.options.gridSize;if(this.options.interactive!==!1){var e=this.model.get("position");this.model.translate(g.snapToGrid(e.x,d)-e.x+g.snapToGrid(b-this._dx,d),g.snapToGrid(e.y,d)-e.y+g.snapToGrid(c-this._dy,d))}this._dx=g.snapToGrid(b,d),this._dy=g.snapToGrid(c,d),joint.dia.CellView.prototype.pointermove.apply(this,arguments)}},pointerup:function(a,b,c){this._linkView?(this._linkView.pointerup(a,b,c),delete this._linkView,this.model.trigger("batch:stop")):joint.dia.CellView.prototype.pointerup.apply(this,arguments)}}),"object"==typeof exports&&(module.exports.Element=joint.dia.Element,module.exports.ElementView=joint.dia.ElementView),"object"==typeof exports)var joint={dia:{Cell:require("./joint.dia.cell").Cell,CellView:require("./joint.dia.cell").CellView}},Backbone=require("backbone"),_=require("lodash"),g=require("./geometry").g;if(joint.dia.Link=joint.dia.Cell.extend({markup:['<path class="connection" stroke="black"/>','<path class="marker-source" fill="black" stroke="black" />','<path class="marker-target" fill="black" stroke="black" />','<path class="connection-wrap"/>','<g class="labels"/>','<g class="marker-vertices"/>','<g class="marker-arrowheads"/>','<g class="link-tools"/>'].join(""),labelMarkup:['<g class="label">',"<rect />","<text />","</g>"].join(""),toolMarkup:['<g class="link-tool">','<g class="tool-remove" event="remove">','<circle r="11" />','<path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z"/>',"<title>Remove link.</title>","</g>",'<g class="tool-options" event="link:options">','<circle r="11" transform="translate(25)"/>','<path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>',"<title>Link options.</title>","</g>","</g>"].join(""),vertexMarkup:['<g class="marker-vertex-group" transform="translate(<%= x %>, <%= y %>)">','<circle class="marker-vertex" idx="<%= idx %>" r="10" />','<path class="marker-vertex-remove-area" idx="<%= idx %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>','<path class="marker-vertex-remove" idx="<%= idx %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">',"<title>Remove vertex.</title>","</path>","</g>"].join(""),arrowheadMarkup:['<g class="marker-arrowhead-group marker-arrowhead-group-<%= end %>">','<path class="marker-arrowhead" end="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />',"</g>"].join(""),defaults:{type:"link"},disconnect:function(){return this.set({source:g.point(0,0),target:g.point(0,0)})},label:function(a,b){a=a||0;var c=this.get("labels");if(0===arguments.length||1===arguments.length)return c&&c[a];var d=_.merge({},c[a],b),e=c.slice();return e[a]=d,this.set({labels:e})}}),joint.dia.LinkView=joint.dia.CellView.extend({className:"link",options:{shortLinkLength:100},initialize:function(){joint.dia.CellView.prototype.initialize.apply(this,arguments),this.watchSource=this._createWatcher("source"),this.watchTarget=this._createWatcher("target"),this._labelCache={},this.startListening()},startListening:function(){this.listenTo(this.model,"change:markup",this.render),this.listenTo(this.model,"change:smooth change:manhattan",this.update),this.listenTo(this.model,"change:toolMarkup",function(){this.renderTools().updateToolsPosition()}),this.listenTo(this.model,"change:labels change:labelMarkup",function(){this.renderLabels().updateLabelPositions()}),this.listenTo(this.model,"change:vertices change:vertexMarkup",function(){this.renderVertexMarkers().update()}),this.listenTo(this.model,"change:source",function(a,b){this.watchSource(a,b).update()}),this.listenTo(this.model,"change:target",function(a,b){this.watchTarget(a,b).update()})},render:function(){this.$el.empty();var a=V(this.model.get("markup")||this.model.markup);if(_.isArray(a)||(a=[a]),this._V={},_.each(a,function(a){var b=a.attr("class");b&&(this._V[$.camelCase(b)]=a)},this),!this._V.connection)throw new Error("link: no connection path in the markup");return this.renderLabels(),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),V(this.el).append(a),this.watchSource(this.model,this.model.get("source")).watchTarget(this.model,this.model.get("target")).update(),this},renderLabels:function(){if(!this._V.labels)return this;this._labelCache={};var a=$(this._V.labels.node).empty(),b=this.model.get("labels")||[];if(!b.length)return this;var c=_.template(this.model.get("labelMarkup")||this.model.labelMarkup),d=V(c());return _.each(b,function(b,c){var e=d.clone().node;this._labelCache[c]=V(e);var f=$(e).find("text"),g=$(e).find("rect"),h=_.extend({"text-anchor":"middle"},joint.util.getByPath(b,"attrs/text","/"));f.attr(_.omit(h,"text")),_.isUndefined(h.text)||V(f[0]).text(h.text+""),a.append(e);var i=V(f[0]).bbox(!0,a[0]);V(f[0]).translate(0,-i.height/2);var j=_.extend({fill:"white",rx:3,ry:3},joint.util.getByPath(b,"attrs/rect","/"));g.attr(_.extend(j,{x:i.x,y:i.y-i.height/2,width:i.width,height:i.height}))},this),this},renderTools:function(){if(!this._V.linkTools)return this;var a=$(this._V.linkTools.node).empty(),b=_.template(this.model.get("toolMarkup")||this.model.toolMarkup),c=V(b());return a.append(c.node),this._toolCache=c,this},renderVertexMarkers:function(){if(!this._V.markerVertices)return this;var a=$(this._V.markerVertices.node).empty(),b=_.template(this.model.get("vertexMarkup")||this.model.vertexMarkup);return _.each(this.model.get("vertices"),function(c,d){a.append(V(b(_.extend({idx:d},c))).node)}),this},renderArrowheadMarkers:function(){if(!this._V.markerArrowheads)return this;var a=$(this._V.markerArrowheads.node);a.empty();var b=_.template(this.model.get("arrowheadMarkup")||this.model.arrowheadMarkup);return this._sourceArrowhead=V(b({end:"source"})),this._targetArrowhead=V(b({end:"target"})),a.append(this._sourceArrowhead.node,this._targetArrowhead.node),this},update:function(){_.each(this.model.get("attrs"),function(a,b){_.isObject(a.filter)?(this.findBySelector(b).attr(_.omit(a,"filter")),this.applyFilter(b,a.filter)):this.findBySelector(b).attr(a)},this);var a=this.model.get("vertices");this.model.get("manhattan")&&(a=this.findManhattanRoute(a)),this._firstVertex=_.first(a),this._sourcePoint=this.getConnectionPoint("source",this.model.get("source"),this._firstVertex||this.model.get("target")).round(),this._lastVertex=_.last(a),this._targetPoint=this.getConnectionPoint("target",this.model.get("target"),this._lastVertex||this._sourcePoint),this._V.markerSource&&this._V.markerSource.translateAndAutoOrient(this._sourcePoint,this._firstVertex||this._targetPoint,this.paper.viewport),this._V.markerTarget&&this._V.markerTarget.translateAndAutoOrient(this._targetPoint,this._lastVertex||this._sourcePoint,this.paper.viewport);var b=this.getPathData(a);return this._V.connection.attr("d",b),this._V.connectionWrap&&this._V.connectionWrap.attr("d",b),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),this},updateLabelPositions:function(){if(!this._V.labels)return this;var a=this.model.get("labels")||[];if(!a.length)return this;var b=this._V.connection.node,c=b.getTotalLength();return _.each(a,function(a,d){var e=a.position;e=e>c?c:e,e=0>e?c+e:e,e=e>1?e:c*e;var f=b.getPointAtLength(e);this._labelCache[d].attr("transform","translate("+f.x+", "+f.y+")")},this),this},updateToolsPosition:function(){if(!this._V.linkTools)return this;var a="",b=40;this.getConnectionLength()<this.options.shortLinkLength&&(a="scale(.5)",b/=2);var c=this.getPointAtLength(b);return this._toolCache.attr("transform","translate("+c.x+", "+c.y+") "+a),this},updateArrowheadMarkers:function(){if(!this._V.markerArrowheads)return this;if("none"===$.css(this._V.markerArrowheads.node,"display"))return this;var a=this.getConnectionLength()<this.options.shortLinkLength?.5:1;return this._sourceArrowhead.scale(a),this._targetArrowhead.scale(a),this._sourceArrowhead.translateAndAutoOrient(this._sourcePoint,this._firstVertex||this._targetPoint,this.paper.viewport),this._targetArrowhead.translateAndAutoOrient(this._targetPoint,this._lastVertex||this._sourcePoint,this.paper.viewport),this},_createWatcher:function(a){function b(b,c){c=c||{};var d=b.previous(a)||{};return this._isModel(d)&&this.stopListening(this.paper.getModelById(d.id),"change"),this._isModel(c)&&this.listenTo(this.paper.getModelById(c.id),"change",function(){this._cacheEndBbox(a,c).update()}),this._cacheEndBbox(a,c)}return b},_cacheEndBbox:function(a,b){var c="_"+a+"Bbox";if(this._isModel(b)){var d=this._makeSelector(b),e=this.paper.findViewByModel(b.id),f=this.paper.viewport.querySelector(d);this[c]=e.getStrokeBBox(f)}else this[c]={width:1,height:1,x:b.x,y:b.y};return this},removeVertex:function(a){var b=_.clone(this.model.get("vertices"));return b&&b.length&&(b.splice(a,1),this.model.set("vertices",b)),this},addVertex:function(a){this.model.set("attrs",this.model.get("attrs")||{}),this.model.get("attrs");for(var b,c=(this.model.get("vertices")||[]).slice(),d=c.slice(),e=this._V.connection.node.cloneNode(!1),f=e.getTotalLength(),g=20,h=c.length+1;h--&&(c.splice(h,0,a),V(e).attr("d",this.getPathData(c)),b=e.getTotalLength(),b-f>g);)c=d.slice();return this.model.set("vertices",c),Math.max(h,0)},getPathData:function(a){var b=g.point(this._sourcePoint),c=g.point(this._targetPoint);this._V.markerSource&&(this._markerSourceBbox=this._markerSourceBbox||this._V.markerSource.bbox(!0),b.move(this._firstVertex||c,this._markerSourceBbox.width*-this._V.markerSource.scale().sx)),this._V.markerTarget&&(this._markerTargetBbox=this._markerTargetBbox||this._V.markerTarget.bbox(!0),c.move(this._lastVertex||b,this._markerTargetBbox.width*-this._V.markerTarget.scale().sx));var d;if(this.model.get("smooth"))if(a&&a.length)d=g.bezier.curveThroughPoints([b].concat(a||[]).concat([c]));else{var e=b.x<c.x?c.x-(c.x-b.x)/2:b.x-(b.x-c.x)/2;d=["M",b.x,b.y,"C",e,b.y,e,c.y,c.x,c.y]}else d=["M",b.x,b.y],_.each(a,function(a){d.push(a.x,a.y)}),d.push(c.x,c.y);return d.join(" ")},getConnectionPoint:function(a,b,c){var d;if(this._isPoint(b))d=g.point(b);else{var e,f="source"===a?this._sourceBbox:this._targetBbox;if(this._isPoint(c))e=g.point(c);else{var h="source"===a?this._targetBbox:this._sourceBbox;e=g.rect(h).intersectionWithLineFromCenterToPoint(g.rect(f).center()),e=e||g.rect(h).center()}if(this.paper.options.perpendicularLinks){var i,j=g.rect(0,e.y,this.paper.options.width,1),k=g.rect(e.x,0,1,this.paper.options.height);if(j.intersect(g.rect(f)))switch(i=g.rect(f).sideNearestToPoint(e)){case"left":d=g.point(f.x,e.y);break;case"right":d=g.point(f.x+f.width,e.y);break;default:d=g.rect(f).center()}else if(k.intersect(g.rect(f)))switch(i=g.rect(f).sideNearestToPoint(e)){case"top":d=g.point(e.x,f.y);break;case"bottom":d=g.point(e.x,f.y+f.height);break;default:d=g.rect(f).center()}else d=g.rect(f).intersectionWithLineFromCenterToPoint(e),d=d||g.rect(f).center()}else d=g.rect(f).intersectionWithLineFromCenterToPoint(e),d=d||g.rect(f).center()}return d},_isModel:function(a){return a&&a.id},_isPoint:function(a){return!this._isModel(a)},_makeSelector:function(a){var b='[model-id="'+a.id+'"]';return a.port?b+=' [port="'+a.port+'"]':a.selector&&(b+=" "+a.selector),b},findManhattanRoute:function(a){function b(a,b){return a.y<b.y&&a.x===b.x?"down":a.y>b.y&&a.x===b.x?"up":a.x<b.x&&a.y===b.y?"right":"left"}function c(a,b,c){var d;if(d=a.x<b.x?a.y>b.y?["up","right"]:a.y<b.y?["down","right"]:["right"]:a.x>b.x?a.y>b.y?["up","left"]:a.y<b.y?["down","left"]:["left"]:a.y>b.y?["up"]:["down"],_.contains(d,c))return c;var e=_.first(d);switch(c){case"down":if("up"===e)return _.last(d);break;case"up":if("down"===e)return _.last(d);break;case"left":if("right"===e)return _.last(d);break;case"right":if("left"===e)return _.last(d)}return e}function d(a,b,d){var e=c(a,b,d);return"down"===e||"up"===e?{x:a.x,y:b.y,d:e}:{x:b.x,y:a.y,d:e}}a=(a||[]).slice();var e=[],f=g.rect(this._sourceBbox).center(),h=g.rect(this._targetBbox).center();a.unshift(f),a.push(h);for(var i,j,k,l,m=0;m<a.length-1;m++){k=a[m],l=a[m+1],j=_.last(e),m>0&&(i=k,i.d=j?b(j,k):"top",e.push(i),j=i);var n=j&&j.d;i=d(k,l,n),g.point(i).equals(g.point(k))||g.point(i).equals(g.point(l))||e.push(i)}return e},getConnectionLength:function(){return this._V.connection.node.getTotalLength()},getPointAtLength:function(a){return this._V.connection.node.getPointAtLength(a)},_beforeArrowheadMove:function(){this.model.trigger("batch:start"),this._z=this.model.get("z"),this.model.set("z",Number.MAX_VALUE),this.el.style.pointerEvents="none"},_afterArrowheadMove:function(){this._z&&(this.model.set("z",this._z),delete this._z),this.el.style.pointerEvents="visiblePainted",this.model.trigger("batch:stop")},_createValidateConnectionArgs:function(a){function b(a,b){return c[f]=a,c[f+1]=a.el===b?void 0:b,c}var c=[];c[4]=a,c[5]=this;var d,e=0,f=0;"source"===a?(e=2,d="target"):(f=2,d="source");var g=this.model.get(d);return g.id&&(c[e]=this.paper.findViewByModel(g.id),c[e+1]=g.selector&&c[e].el.querySelector(g.selector)),b},startArrowheadMove:function(a){this._action="arrowhead-move",this._arrowhead=a,this._beforeArrowheadMove(),this._validateConnectionArgs=this._createValidateConnectionArgs(this._arrowhead)},pointerdown:function(a,b,c){if(joint.dia.CellView.prototype.pointerdown.apply(this,arguments),this._dx=b,this._dy=c,this.options.interactive!==!1){var d=a.target.getAttribute("class");switch(d){case"marker-vertex":this._action="vertex-move",this._vertexIdx=a.target.getAttribute("idx");break;case"marker-vertex-remove":case"marker-vertex-remove-area":this.removeVertex(a.target.getAttribute("idx"));break;case"marker-arrowhead":this.startArrowheadMove(a.target.getAttribute("end"));break;default:var e=a.target.parentNode.getAttribute("event");e?"remove"===e?this.model.remove():this.paper.trigger(e,a,this,b,c):(this._vertexIdx=this.addVertex({x:b,y:c}),this._action="vertex-move")}}},pointermove:function(a,b,c){switch(joint.dia.CellView.prototype.pointermove.apply(this,arguments),this._action){case"vertex-move":var d=_.clone(this.model.get("vertices")); d[this._vertexIdx]={x:b,y:c},this.model.set("vertices",d);break;case"arrowhead-move":var e="mousemove"===a.type?a.target:document.elementFromPoint(a.clientX,a.clientY);this._targetEvent!==e&&(this._magnetUnderPointer&&this._viewUnderPointer.unhighlight(this._magnetUnderPointer),this._viewUnderPointer=this.paper.findView(e),this._viewUnderPointer?(this._magnetUnderPointer=this._viewUnderPointer.findMagnet(e),this._magnetUnderPointer&&this.paper.options.validateConnection.apply(this.paper,this._validateConnectionArgs(this._viewUnderPointer,this._magnetUnderPointer))?this._magnetUnderPointer&&this._viewUnderPointer.highlight(this._magnetUnderPointer):this._magnetUnderPointer=null):this._magnetUnderPointer=null),this._targetEvent=e,this.model.set(this._arrowhead,{x:b,y:c})}this._dx=b,this._dy=c},pointerup:function(){joint.dia.CellView.prototype.pointerup.apply(this,arguments),"arrowhead-move"===this._action&&(this._magnetUnderPointer&&(this._viewUnderPointer.unhighlight(this._magnetUnderPointer),this.model.set(this._arrowhead,{id:this._viewUnderPointer.model.id,selector:this._viewUnderPointer.getSelector(this._magnetUnderPointer),port:$(this._magnetUnderPointer).attr("port")})),delete this._viewUnderPointer,delete this._magnetUnderPointer,delete this._staticView,delete this._staticMagnet,this._afterArrowheadMove()),delete this._action}}),"object"==typeof exports&&(module.exports.Link=joint.dia.Link,module.exports.LinkView=joint.dia.LinkView),joint.dia.Paper=Backbone.View.extend({options:{width:800,height:600,gridSize:50,perpendicularLinks:!1,elementView:joint.dia.ElementView,linkView:joint.dia.LinkView,defaultLink:new joint.dia.Link,validateMagnet:function(a,b){return"passive"!==b.getAttribute("magnet")},validateConnection:function(a,b,c,d,e){return("target"===e?c:a)instanceof joint.dia.ElementView}},events:{mousedown:"pointerdown",dblclick:"mousedblclick",touchstart:"pointerdown",mousemove:"pointermove",touchmove:"pointermove"},initialize:function(){_.bindAll(this,"addCell","sortCells","resetCells","pointerup"),this.svg=V("svg").node,this.viewport=V("g").node,V(this.svg).append(V("defs").node),V(this.viewport).attr({"class":"viewport"}),V(this.svg).append(this.viewport),this.$el.append(this.svg),this.setDimensions(),this.listenTo(this.model,"add",this.addCell),this.listenTo(this.model,"reset",this.resetCells),this.listenTo(this.model,"sort",this.sortCells),$(document).on("mouseup touchend",this.pointerup)},remove:function(){$(document).off("mouseup touchend",this.pointerup),Backbone.View.prototype.remove.call(this)},setDimensions:function(a,b){a&&(this.options.width=a),b&&(this.options.height=b),V(this.svg).attr("width",this.options.width),V(this.svg).attr("height",this.options.height),this.trigger("resize")},fitToContent:function(a,b,c){a=a||1,b=b||1,c=c||0;var d=V(this.viewport).bbox(!0,this.svg),e=Math.ceil((d.width+d.x)/a)*a,f=Math.ceil((d.height+d.y)/b)*b;e+=c,f+=c,(e!=this.options.width||f!=this.options.height)&&this.setDimensions(e||this.options.width,f||this.options.height)},createViewForModel:function(a){var b,c=a.get("type"),d=c.split(".")[0],e=c.split(".")[1];return b=joint.shapes[d]&&joint.shapes[d][e+"View"]?new joint.shapes[d][e+"View"]({model:a,interactive:this.options.interactive}):a instanceof joint.dia.Element?new this.options.elementView({model:a,interactive:this.options.interactive}):new this.options.linkView({model:a,interactive:this.options.interactive})},addCell:function(a){var b=this.createViewForModel(a);V(this.viewport).append(b.el),b.paper=this,b.render(),$(b.el).find("image").on("dragstart",function(){return!1})},resetCells:function(a){$(this.viewport).empty();var b=a.models.slice();b.sort(function(a){return a instanceof joint.dia.Link?1:-1}),_.each(b,this.addCell,this),this.sortCells()},sortCells:function(){var a=$(this.viewport).children("[model-id]"),b=this.model.get("cells");a.sortElements(function(a,c){var d=b.get($(a).attr("model-id")),e=b.get($(c).attr("model-id"));return(d.get("z")||0)>(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){return c||(c=0,d=0),V(this.viewport).attr("transform",""),(c||d)&&V(this.viewport).translate(-c*(a-1),-d*(b-1)),V(this.viewport).scale(a,b),this.trigger("scale",c,d),this},rotate:function(a,b,c){if(_.isUndefined(b)){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}V(this.viewport).rotate(a,b,c)},zoom:function(a){a=a||1,V(this.svg).attr("width",this.options.width*a),V(this.svg).attr("height",this.options.height*a)},findView:function(a){var b=this.$(a);return 0===b.length||b[0]===this.el?void 0:b.data("view")?b.data("view"):this.findView(b.parent())},findViewByModel:function(a){var b=_.isString(a)?a:a.id,c=this.$('[model-id="'+b+'"]');return c.length?c.data("view"):void 0},findViewsFromPoint:function(a){a=g.point(a);var b=_.map(this.model.getElements(),this.findViewByModel);return _.filter(b,function(b){return g.rect(b.getBBox()).containsPoint(a)})},findViewsInArea:function(a){a=g.rect(a);var b=_.map(this.model.getElements(),this.findViewByModel);return _.filter(b,function(b){return a.intersect(g.rect(b.getBBox()))})},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a){var b=V(this.viewport).toLocalPoint(a.x,a.y);return{x:g.snapToGrid(b.x,this.options.gridSize),y:g.snapToGrid(b.y,this.options.gridSize)}},getDefaultLink:function(a,b){return _.isFunction(this.options.defaultLink)?this.options.defultLink.call(this,a,b):this.options.defaultLink.clone()},mousedblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target),c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)},pointerdown:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target),c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(this.sourceView=b,b.pointerdown(a,c.x,c.y)):this.trigger("blank:pointerdown",a,c.x,c.y)},pointermove:function(a){if(a.preventDefault(),a=joint.util.normalizeEvent(a),this.sourceView){var b=this.snapToGrid({x:a.clientX,y:a.clientY});this.sourceView.pointermove(a,b.x,b.y)}},pointerup:function(a){a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY});this.sourceView?(this.sourceView.pointerup(a,b.x,b.y),this.sourceView=null):this.trigger("blank:pointerup",a,b.x,b.y)}}),"object"==typeof exports)var joint={util:require("../src/core").util,shapes:{},dia:{Element:require("../src/joint.dia.element").Element}},_=require("lodash");joint.shapes.basic={},joint.shapes.basic.Generic=joint.dia.Element.extend({defaults:joint.util.deepSupplement({type:"basic.Generic",attrs:{".":{fill:"#FFFFFF",stroke:"none"}}},joint.dia.Element.prototype.defaults)}),joint.shapes.basic.Rect=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><rect/></g><text/></g>',defaults:joint.util.deepSupplement({type:"basic.Rect",attrs:{rect:{fill:"#FFFFFF",stroke:"black",width:100,height:60},text:{"font-size":14,text:"","ref-x":.5,"ref-y":.5,ref:"rect","y-alignment":"middle","x-alignment":"middle",fill:"black","font-family":"Arial, helvetica, sans-serif"}}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.basic.Text=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><text/></g></g>',defaults:joint.util.deepSupplement({type:"basic.Text",attrs:{text:{"font-size":18,fill:"black"}}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.basic.Circle=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><circle/></g><text/></g>',defaults:joint.util.deepSupplement({type:"basic.Circle",size:{width:60,height:60},attrs:{circle:{fill:"#FFFFFF",stroke:"black",r:30,transform:"translate(30, 30)"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,ref:"circle","y-alignment":"middle",fill:"black","font-family":"Arial, helvetica, sans-serif"}}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.basic.Image=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><image/></g><text/></g>',defaults:joint.util.deepSupplement({type:"basic.Image",attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,ref:"image","y-alignment":"middle",fill:"black","font-family":"Arial, helvetica, sans-serif"}}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.basic.Path=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><path/></g><text/></g>',defaults:joint.util.deepSupplement({type:"basic.Path",size:{width:60,height:60},attrs:{path:{fill:"#FFFFFF",stroke:"black"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,ref:"path","y-alignment":"middle",fill:"black","font-family":"Arial, helvetica, sans-serif"}}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(){var a=this.get("attrs");_.each(this._portSelectors,function(b){a[b]&&delete a[b]}),this._portSelectors=[];var b={};_.each(this.get("inPorts"),function(a,c,d){var e=this.getPortAttrs(a,c,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(_.keys(e)),_.extend(b,e)},this),_.each(this.get("outPorts"),function(a,c,d){var e=this.getPortAttrs(a,c,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(_.keys(e)),_.extend(b,e)},this),this.attr(b,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(0>c&&(b=".outPorts",c=this.get("outPorts").indexOf(a),0>c))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>circle"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=_.template(this.model.portMarkup);_.each(_.filter(this.model.ports,function(a){return"in"===a.type}),function(b,d){a.append(V(c({id:d,port:b})).node)}),_.each(_.filter(this.model.ports,function(a){return"out"===a.type}),function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.TextBlock=joint.shapes.basic.Rect.extend({markup:['<g class="rotatable"><g class="scalable"><rect/></g><switch>','<foreignObject requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" class="fobj">','<body xmlns="http://www.w3.org/1999/xhtml"><div/></body>',"</foreignObject>",'<svg overflow="hidden"><text/></svg>',"</switch></g>"].join(""),defaults:joint.util.deepSupplement({type:"basic.TextBlock",content:""},joint.shapes.basic.Rect.prototype.defaults),initialize:function(){"undefined"!=typeof SVGForeignObjectElement?(this.setForeignObjectSize(this,this.get("size")),this.setDivContent(this,this.get("content")),this.listenTo(this,"change:size",this.setForeignObjectSize),this.listenTo(this,"change:content",this.setDivContent)):(this.setSvgSize(this,this.get("size")),this.setTextContent(this,this.get("content")),this.listenTo(this,"change:size",this.setSvgSize),this.listenTo(this,"change:content",this.setTextContent)),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},setForeignObjectSize:function(a,b){a.attr({".fobj":_.clone(b),div:{style:_.clone(b)}})},setSvgSize:function(a,b){a.attr({svg:_.clone(b)})},setDivContent:function(a,b){a.attr({div:{html:b}})},setTextContent:function(a,b){a.attr({text:{text:b}})}}),"object"==typeof exports&&(module.exports=joint.shapes.basic);
app/containers/HomePage.js
bryanveloso/shiver-electron
import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import Twitch from 'twitch-sdk/twitch'; import { ActionCreators as UserActions } from '../actions/user' import Greeter from '../components/greeter'; import LoginButton from '../components/login-button'; import LogoutButton from '../components/logout-button'; import FollowingList from '../components/following-list'; function stateToProps(state) { return { user: state.user }; } function dispatchToProps(dispatch) { return { actions: bindActionCreators(UserActions, dispatch) }; } const HomePage = React.createClass({ getLoggedOutContent() { return (<LoginButton/>); }, getLoggedInContent() { return ( <div> <LogoutButton/> <Greeter {...this.props.user}/> <FollowingList/> </div>) }, render() { const content = this.props.user ? this.getLoggedInContent() : this.getLoggedOutContent(); return ( <div> <h1>Hello from Shiver!</h1> {content} </div> ); } }); export default connect(stateToProps, dispatchToProps)(HomePage);
src/ui/no-contributions-grid.js
jrm2k6/contwidgetor-ui
import React from 'react'; var NoContributionsGrid = React.createClass({ render: function() { let _styles = this.getStyles(); return ( <div style={_styles.container}> No Contributions Found! </div> ); }, getStyles: function() { return { container: { 'display': 'flex', 'width': '100%', 'color': '#aaa', 'fontSize': '20px', 'font': '13px/1.4 Helvetica', 'justifyContent': 'center', 'alignItems': 'center' }, }; } }); module.exports = NoContributionsGrid;
src/components/NumberComponent/test.js
ProteinsWebTeam/interpro7-client
// @flow import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; import { NumberComponent } from '.'; const renderer = new ShallowRenderer(); describe('<NumberComponent />', () => { test('should render', () => { renderer.render( <NumberComponent abbr={true} label={true} lowGraphics={false} loading={false} dispatch={() => {}} > 36872 </NumberComponent>, ); expect(renderer.getRenderOutput()).toMatchSnapshot(); }); });
DISTR/php5.2/admin/res/mon/js/jquery-latest.js
hakerillo66/mikbill_distr
/*! * jQuery JavaScript Library v1.11.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-05-01T17:42Z */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper window is present, // execute the factory and get jQuery // For environments that do not inherently posses a window with a document // (such as Node.js), expose a jQuery-making factory as module.exports // This accentuates the need for the creation of a real window // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ // var deletedIds = []; var slice = deletedIds.slice; var concat = deletedIds.concat; var push = deletedIds.push; var indexOf = deletedIds.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "1.11.1", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1, IE<9 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: deletedIds.sort, splice: deletedIds.splice }; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( support.ownLast ) { for ( key in obj ) { return hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, type: function( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call(obj) ] || "object" : typeof obj; }, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Support: Android<4.1, IE<9 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( indexOf ) { return indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; while ( j < len ) { first[ i++ ] = second[ j++ ]; } // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: function() { return +( new Date() ); }, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v1.10.19 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-04-18 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document (jQuery #6963) if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== strundefined && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent !== parent.top ) { // IE11 does not have attachEvent, so all must suffer if ( parent.addEventListener ) { parent.addEventListener( "unload", function() { setDocument(); }, false ); } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", function() { setDocument(); }); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select msallowclip=''><option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowclip^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (oldCache = outerCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements outerCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context !== document && context; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is no seed and only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } }); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // Use the correct document accordingly with window argument (sandbox) document = window.document, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.extend({ dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); jQuery.fn.extend({ has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); var rnotwhite = (/\S+/g); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !(--remaining) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend({ // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } }); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } } /** * The ready event handler and self cleanup method */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; var strundefined = typeof undefined; // Support: IE<9 // Iteration over object's inherited properties before its own var i; for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom jQuery(function() { // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); }); (function() { var div = document.createElement( "div" ); // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } // Null elements to avoid leaks in IE. div = null; })(); /** * Determines whether an object can have data */ jQuery.acceptData = function( elem ) { var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 && nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true && elem.getAttribute("classid") === noData; }; var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) // throw uncatchable exceptions if you attempt to set expando properties noData: { "applet ": true, "embed ": true, // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } }); jQuery.fn.extend({ data: function( key, value ) { var i, name, data, elem = this[0], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }; var rcheckableType = (/^(?:checkbox|radio)$/i); (function() { // Minified: var a,b,c var input = document.createElement( "input" ), div = document.createElement( "div" ), fragment = document.createDocumentFragment(); // Setup div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName( "tbody" ).length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) input.type = "checkbox"; input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE6-IE11+ div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() support.noCloneEvent = true; if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } })(); (function() { var i, eventName, div = document.createElement( "div" ); // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) for ( i in { submit: true, change: true, focusin: true }) { eventName = "on" + i; if ( !(support[ i + "Bubbles" ] = eventName in window) ) { // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; })(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && jQuery.acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); jQuery._removeData( doc, fix ); } else { jQuery._data( doc, fix, attaches ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!support.noCloneEvent || !support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } deletedIds.push( id ); } } } } } }); jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, remove: function( selector, keepData /* Internal Use Only */ ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var arg = arguments[ 0 ]; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { arg = this.parentNode; jQuery.cleanData( getAll( this ) ); if ( arg ) { arg.replaceChild( elem, this ); } }); // Force removal if there was no new content (e.g., from empty arguments) return arg && (arg.length || arg.nodeType) ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback ) { // Flatten any nested arrays args = concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); var iframe, elemdisplay = {}; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var style, elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // Use of this method is a temporary fix (more like optmization) until something better comes along, // since it was removed from specification and supported only in FF style.display : jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; // Support: IE doc.write(); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } (function() { var shrinkWrapBlocksVal; support.shrinkWrapBlocks = function() { if ( shrinkWrapBlocksVal != null ) { return shrinkWrapBlocksVal; } // Will be changed later if needed. shrinkWrapBlocksVal = false; // Minified: var b,c,d var div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); // Support: IE6 // Check if elements with layout shrink-wrap their children if ( typeof div.style.zoom !== strundefined ) { // Reset CSS: box-sizing; display; margin; border div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;" + "padding:1px;width:1px;zoom:1"; div.appendChild( document.createElement( "div" ) ).style.width = "5px"; shrinkWrapBlocksVal = div.offsetWidth !== 3; } body.removeChild( container ); return shrinkWrapBlocksVal; }; })(); var rmargin = (/^margin/); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var getStyles, curCSS, rposition = /^(top|right|bottom|left)$/; if ( window.getComputedStyle ) { getStyles = function( elem ) { return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); }; curCSS = function( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + ""; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, computed ) { var left, rs, rsLeft, ret, style = elem.style; computed = computed || getStyles( elem ); ret = computed ? computed[ name ] : undefined; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + "" || "auto"; }; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { var condition = conditionFn(); if ( condition == null ) { // The test was not ready at this point; screw the hook this time // but check again when needed next time. return; } if ( condition ) { // Hook not needed (or it's not possible to use it due to missing dependency), // remove it. // Since there are no other hooks for marginRight, remove the whole object. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return (this.get = hookFn).apply( this, arguments ); } }; } (function() { // Minified: var b,c,d,e,f,g, h,i var div, style, a, pixelPositionVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal; // Setup div = document.createElement( "div" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; style = a && a.style; // Finish early in limited (non-browser) environments if ( !style ) { return; } style.cssText = "float:left;opacity:.5"; // Support: IE<9 // Make sure that element opacity exists (as opposed to filter) support.opacity = style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || style.WebkitBoxSizing === ""; jQuery.extend(support, { reliableHiddenOffsets: function() { if ( reliableHiddenOffsetsVal == null ) { computeStyleTests(); } return reliableHiddenOffsetsVal; }, boxSizingReliable: function() { if ( boxSizingReliableVal == null ) { computeStyleTests(); } return boxSizingReliableVal; }, pixelPosition: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelPositionVal; }, // Support: Android 2.3 reliableMarginRight: function() { if ( reliableMarginRightVal == null ) { computeStyleTests(); } return reliableMarginRightVal; } }); function computeStyleTests() { // Minified: var b,c,d,j var div, body, container, contents; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute"; // Support: IE<9 // Assume reasonable values in the absence of getComputedStyle pixelPositionVal = boxSizingReliableVal = false; reliableMarginRightVal = true; // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; boxSizingReliableVal = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Support: Android 2.3 // Div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container (#3333) // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right contents = div.appendChild( document.createElement( "div" ) ); // Reset CSS: box-sizing; display; margin; border; padding contents.style.cssText = div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; contents.style.marginRight = contents.style.width = "0"; div.style.width = "1px"; reliableMarginRightVal = !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); } // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; contents = div.getElementsByTagName( "td" ); contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; if ( reliableHiddenOffsetsVal ) { contents[ 0 ].style.display = ""; contents[ 1 ].style.display = "none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; } body.removeChild( container ); } })(); // A method for quickly swapping in/out CSS properties to get correct calculations. jQuery.swap = function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } else { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set. See: #7116 if ( value == null || value !== value ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Support: IE // Swallow errors from 'invalid' CSS values (#5509) try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } ); // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); jQuery.fn.extend({ css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; } }; jQuery.fx = Tween.prototype.init; // Back Compat <1.8 extension point jQuery.fx.step = {}; var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; } ] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); // Test default display if display is currently "none" checkDisplay = display === "none" ? jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !support.shrinkWrapBlocks() ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); // Any non-fx value stops us from restoring the original display value } else { display = undefined; } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } // If this is a noop like .hide().hide(), restore an overwritten display value } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { style.display = display; } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.timers = []; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); if ( timer() ) { jQuery.fx.start(); } else { jQuery.timers.pop(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }; (function() { // Minified: var a,b,c,d,e var input, div, select, a, opt; // Setup div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName("a")[ 0 ]; // First batch of tests. select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE8 only // Check if we can trust getAttribute("value") input = document.createElement( "input" ); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; })(); var rreturn = /\r/g; jQuery.fn.extend({ val: function( value ) { var hooks, ret, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE10-11+ // option.text throws exceptions (#14686, #14858) jQuery.trim( jQuery.text( elem ) ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) { // Support: IE6 // When new option element is added to select box we need to // force reflow of newly added node in order to workaround delay // of initialization properties try { option.selected = optionSet = true; } catch ( _ ) { // Will be executed only in IE6 option.scrollHeight; } } else { option.selected = false; } } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return options; } } } }); // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = support.getSetAttribute, getSetInput = support.input; jQuery.fn.extend({ attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); } }); jQuery.extend({ attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } } }); // Hook for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // Retrieve booleans specially jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var ret, handle; if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ]; attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ? name.toLowerCase() : null; attrHandle[ name ] = handle; } return ret; } : function( elem, name, isXML ) { if ( !isXML ) { return elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; } }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) if ( name === "value" || value === elem.getAttribute( name ) ) { return value; } } }; // Some attributes are constructed with empty-string values when not defined attrHandle.id = attrHandle.name = attrHandle.coords = function( elem, name, isXML ) { var ret; if ( !isXML ) { return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; } }; // Fixing value retrieval on a button requires this module jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); if ( ret && ret.specified ) { return ret.value; } }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } if ( !support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } var rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend({ prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); } }); jQuery.extend({ propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } // Support: Safari, IE9+ // mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !support.enctype ) { jQuery.propFix.enctype = "encoding"; } var rclass = /[\t\r\n\f]/g; jQuery.fn.extend({ addClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // only assign if different to avoid unneeded rendering. finalValue = value ? jQuery.trim( cur ) : ""; if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; } }); // Return jQuery for attributes-only inclusion jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var nonce = jQuery.now(); var rquery = (/\?/); var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; jQuery.parseJSON = function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { // Support: Android 2.3 // Workaround failure to string-cast null input return window.JSON.parse( data + "" ); } var requireNonComma, depth = null, str = jQuery.trim( data + "" ); // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains // after removing valid tokens return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { // Force termination if we see a misplaced comma if ( requireNonComma && comma ) { depth = 0; } // Perform no more replacements after returning to outermost depth if ( depth === 0 ) { return token; } // Commas must not follow "[", "{", or "," requireNonComma = open || comma; // Determine new depth // array/object open ("[" or "{"): depth += true - false (increment) // array/object close ("]" or "}"): depth += false - true (decrement) // other cases ("," or primitive): depth += true - true (numeric cast) depth += !close - !open; // Remove this token return ""; }) ) ? ( Function( "return " + str ) )() : jQuery.error( "Invalid JSON: " + data ); }; // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data, "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var // Document location ajaxLocParts, ajaxLocation, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType.charAt( 0 ) === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + nonce++ ) : // Otherwise add one to the end cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; }); jQuery._evalUrl = function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); }; jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!support.reliableHiddenOffsets() && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function() { var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); }) .map(function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // Support: IE6+ function() { // XHR cannot access local files, always use ActiveX for that case return !this.isLocal && // Support: IE7-8 // oldIE XHR does not support non-RFC2616 methods (#13240) // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // Although this check for six methods instead of eight // since IE also does not support "trace" and "connect" /^(get|post|head|put|delete|options)$/i.test( this.type ) && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; var xhrId = 0, xhrCallbacks = {}, xhrSupported = jQuery.ajaxSettings.xhr(); // Support: IE<10 // Open requests must be manually aborted on unload (#5280) if ( window.ActiveXObject ) { jQuery( window ).on( "unload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }); } // Determine support properties support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( options ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !options.crossDomain || support.cors ) { var callback; return { send: function( headers, complete ) { var i, xhr = options.xhr(), id = ++xhrId; // Open the socket xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { // Support: IE<9 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting // request header to a null-value. // // To keep consistent with other XHR implementations, cast the value // to string and ignore `undefined`. if ( headers[ i ] !== undefined ) { xhr.setRequestHeader( i, headers[ i ] + "" ); } } // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( options.hasContent && options.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responses; // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Clean up delete xhrCallbacks[ id ]; callback = undefined; xhr.onreadystatechange = jQuery.noop; // Abort manually if needed if ( isAbort ) { if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; // Support: IE<10 // Accessing binary-data responseText throws an exception // (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && options.isLocal && !options.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, xhr.getAllResponseHeaders() ); } }; if ( !options.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { // Add to the list of active xhr callbacks xhr.onreadystatechange = xhrCallbacks[ id ] = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; // Keep a copy of the old load method var _load = jQuery.fn.load; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = jQuery.trim( url.slice( off, url.length ) ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; var docElem = window.document.documentElement; /** * Gets a window from an element */ function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ offset: function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }, position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); }); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; }); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( typeof noGlobal === strundefined ) { window.jQuery = window.$ = jQuery; } return jQuery; }));
bots/question-bookmarklet.js
ehd/react-native
javascript:(function(){$('#new_comment_field')[0].value='Hey and thanks for reporting this!\n\nThere\'s an awesome place to ask question like this one: [StackOverflow](http://stackoverflow.com/questions/tagged/react-native). It\'s the best system for Q&A. Many people from the community hang out there and will be able to see your question, you can vote on answers and mark question as answered etc. This lets us keep a list of bug reports and feature requests on github and especially [Product Pains](https://productpains.com/product/react-native/?tab=top) (again, with voting which is really nice).\n\nIf you think StackOverflow works for you please consider posting there instead and closing this issue.\n\nI\'m posting this here because github issues haven\'t been working very well for us and because StackOverflow is so much better. Thanks for reading! :)';$('button.btn-primary:contains("Comment")').click()})()
app/components/SuperCenter.js
Toreant/monster_admin
/** * Created by apache on 16-4-5. */ import React from 'react'; import {Link} from 'react-router'; import SuperCenterActions from '../actions/SuperUserControlActions'; import SuperCenterStore from '../stores/SuperCenterStore'; class SuperCenter extends React.Component { constructor(props) { super(props); this.state = SuperCenterStore.getState(); this.onChange = this.onChange.bind(this); } componentDidMount() { SuperCenterStore.listen(this.onChange); } componentWillUnmount() { SuperCenterStore.unlisten(this.onChange); } render() { return ( <div> </div> ); } } export default SuperCenter;
src/List.js
jeffszusz/wiff-mobile
import React from 'react'; import './List.css'; import Film from './Film.js'; import filmListFormatter from './film_list_formatter.jsx'; class List extends React.Component { constructor (props) { super(); this.state = { filmList: filmListFormatter(props.filmList), }; } render () { var films = this.state.filmList.map((data, index) => { return <Film key={index} data={data} /> }); return ( <div className="film-list"> {films} </div> ); } } export default List;
src/pages/info.js
computer-lab/salon94design.com
import React from 'react' import Helmet from '../components/helmet' import Link from 'gatsby-link' import { css } from 'emotion' import styled from 'emotion/react' import { sansfont, baseUl, childLink, Header2, breakpoint2, breakpoint3, } from '../layouts/emotion-base' import Press from '../components/Press' import SimpleImageList from '../components/SimpleImageList' import { imageInfo, imageFilepath } from '../util' const Container = styled.div` composes: ${sansfont}; font-weight: 300; box-sizing: border-box; & * { box-sizing: inherit; } & a { color: inherit; } ` const LogoImage = styled.img` display: block; margin: 0 auto 30px auto; width: 600px; user-select: none; @media (${breakpoint2}) { margin-bottom: 20px; width: calc(100vw - 48px); } ` const SectionWrapper = styled.div` display: flex; display: -webkit-flex; flex-wrap: wrap; -webkit-flex-wrap: wrap; justify-content: center; -webkit-justify-content: center; padding-bottom: 24px; ` const Section = styled.section` margin: 40px 0 0 60px; max-width: 400px; @media (${breakpoint2}) { max-width: none; width: 100%; } @media (${breakpoint3}) { margin: 20px 0; } ` const SubSection = styled.div` margin-bottom: 40px; @media (${breakpoint3}) { margin-bottom: 20px; } ` const sectionContent = css` margin: 0; padding: 0; font-size: 16px; line-height: 1.4; ` const SectionText = styled.p` composes: ${sectionContent}; & a { text-decoration: none; border-bottom: 2px solid #000; } ` const SectionList = styled.ul` composes: ${baseUl}, ${sectionContent}; font-weight: 400; ` const SectionListItem = styled.li` composes: ${childLink}; margin: 0 0 16px 0; ` const SectionListItemLabel = styled.span` &::after { content: ' – '; } ` const StaffLabel = styled.div` font-weight: 400; line-height: 1.4; ` const MailingListSignup = styled.div` margin-top: 24px; font-weight: 500; font-size: 24px; & a { color: #000; text-decoration: none; border-bottom: 2px solid #000; } ` const Images = styled.div` margin-top: 40px; ` const Info = ({ data }) => { const { allInfoYaml } = data const { hero, aboutHtml, emails, phones, social, staff, mailingList, press, hydratedImages, } = allInfoYaml.edges[0].node const formatTel = n => { return `+1${n.replace(/[\(\)\-\s]/g, '')}` } const images = (hydratedImages || []) .filter(item => item && item.file && item.file.length > 0) .map(image => Object.assign({}, image, imageInfo(image))) const renderListItems = items => items.map(item => ( <SectionListItem key={item.title + item.link}> <SectionListItemLabel>{item.title.trim()}</SectionListItemLabel> <a href={item.link} target="_blank"> {item.label} </a> </SectionListItem> )) const socialLinks = renderListItems(social) const emailLinks = renderListItems( emails.map(item => ({ title: item.title, label: item.email, link: `mailto:${item.email}`, })) ) const phoneLinks = renderListItems( phones.map(item => ({ title: item.title, label: item.number, link: `tel:${formatTel(item.number)}`, })) ) const staffLinks = staff.map(item => ( <SectionListItem key={item.title + item.name}> <StaffLabel>{(item.name || '').trim()}</StaffLabel> <StaffLabel>{item.title.trim()}</StaffLabel> <StaffLabel> <a href={`mailto:${item.email}`} target="_blank"> {item.email} </a> </StaffLabel> </SectionListItem> )) return ( <Container> <Helmet title={`Salon 94 Design - Info`} /> <Link to={'/'}> <LogoImage src={hero} /> </Link> <SectionWrapper> <Section> <SubSection> <Header2>About</Header2> <SectionText dangerouslySetInnerHTML={{ __html: aboutHtml }} /> </SubSection> <Press press={press} /> </Section> <Section> <SubSection> <Header2>Contact</Header2> <SectionList> {socialLinks} {phoneLinks} {emailLinks} </SectionList> </SubSection> <SubSection> <Header2>Staff</Header2> <SectionList>{staffLinks}</SectionList> </SubSection> <MailingListSignup> <a href={mailingList} target="_blank"> Sign Up For Mailing List </a> </MailingListSignup> {images.length > 0 && ( <Images> <SimpleImageList images={images} /> </Images> )} </Section> </SectionWrapper> </Container> ) } export default Info export const pageQuery = graphql` query InfoQuery { allInfoYaml { edges { node { hero aboutHtml staff { name title email } emails { title email } phones { title number } social { title label link } mailingList press { title link } hydratedImages { file title width height resized { file width height } } } } } } `
backend/modules/content/src/main/browser/views/Event/Item/View.js
savantly-net/sprout-platform
import React from 'react'; import { Component } from 'react'; import { connect } from 'react-redux' import {selectRoot, resetSubmissions, saveSubmission, Form, selectError, Errors} from 'react-formio'; import {push} from 'connected-react-router'; import Loading from '../../../containers/Loading' const View = class extends Component { render() { const { hideComponents, onSubmit, options, errors, form: {form, isActive: isFormActive}, submission: {submission, isActive: isSubActive, url} } = this.props; if (isFormActive || isSubActive) { return <Loading />; } return ( <div> <h3>View Event</h3> <Errors errors={errors} /> <Form form={form} submission={submission} url={url} hideComponents={hideComponents} onSubmit={onSubmit} options={options} /> </div> ); } } const mapStateToProps = (state) => { return { form: selectRoot('form', selectRoot('event', state)), submission: selectRoot('submission', selectRoot('event', state)), options: { readOnly: true, }, errors: [ selectError('submission', selectRoot('event', state)), selectError('form', selectRoot('event', state)) ], } } const mapDispatchToProps = (dispatch, ownProps) => { return { onSubmit: (submission) => { dispatch(saveSubmission('event', submission, ownProps.match.params.formId, (err, submission) => { if (!err) { dispatch(resetSubmissions('event')); dispatch(push(`/event/${submission._id}`)) } })); } } } export default connect( mapStateToProps, mapDispatchToProps )(View)
yycomponent/calendar/Calendar.js
77ircloud/yycomponent
import React from 'react'; import { Calendar as _Calendar } from 'antd'; class Calendar extends React.Component{ constructor(props){ super(props); } render(){ return (<_Calendar {...this.props}/>); } } export default Calendar
docs/app/Examples/elements/Image/Variations/ImageFluidExample.js
jamiehill/stardust
import React from 'react' import { Image } from 'stardust' const src = 'http://semantic-ui.com/images/wireframe/image.png' const ImageFluidExample = () => ( <Image src={src} fluid /> ) export default ImageFluidExample
source/examples/TextBase.js
thomaswright/bayst
import React from 'react' import { TextBase, Paragraph, Box } from '../collator' const exampleText = "Merengue" const paragraphText = `Merengue (/məˈrɛŋɡeɪ/, Spanish: [meˈɾeŋɡe]) is a style of Dominican music and dance. Partners hold each other in a closed position. The leader holds the follower's waist with the leader's right hand, while holding the follower's right hand with the leader's left hand at the follower's eye level. Partners bend their knees slightly left and right, thus making the hips move left and right. The hips of the leader and follower move in the same direction throughout the song. Partners may walk sideways or circle each other, in small steps. They can switch to an open position and do separate turns without letting go each other's hands or releasing one hand. During these turns they may twist and tie their handhold into intricate pretzels. Other choreographies are possible.` /**___________________________________________________________________________*/ /** Font props are pretty straight forward. fontSizeRank or fs: 0,1,2,3,4,5,6 fontWeightType or fw: "light", "regular", "bold", "heavy" lineHeightType or lh: "equal", "small", "medium", "large" color, backgroundColor, paddingRank, marginRank, borderType also apply */ const example_TextBase = { header: `TextBase`, examples: ( <Box> <Box paddingRank={2}> <TextBase fontSizeRank={0} text={exampleText}/> <TextBase fontSizeRank={1} text={exampleText}/> <TextBase fontSizeRank={2} text={exampleText}/> <TextBase fontSizeRank={3} text={exampleText}/> <TextBase fontSizeRank={4} text={exampleText}/> <TextBase fontSizeRank={5} text={exampleText}/> <TextBase fontSizeRank={6} text={exampleText}/> </Box> <Box paddingRank={2}> <TextBase fontSizeRank={2} fontWeightType={"light"} text={exampleText}/> <TextBase fontSizeRank={2} fontWeightType={"regular"} text={exampleText}/> <TextBase fontSizeRank={2} fontWeightType={"bold"} text={exampleText}/> <TextBase fontSizeRank={2} fontWeightType={"heavy"} text={exampleText}/> </Box> <Box paddingRank={2}> <TextBase paddingVerticalRank={2} lineHeightType={"equal"} text={paragraphText}/> <TextBase paddingVerticalRank={2} lineHeightType={"small"} text={paragraphText}/> <TextBase paddingVerticalRank={2} lineHeightType={"medium"} text={paragraphText}/> <TextBase paddingVerticalRank={2} lineHeightType={"large"} text={paragraphText}/> </Box> </Box> ) } /**___________________________________________________________________________*/ export default example_TextBase
src/containers/App.js
yatsu/react-tornado-graphql-example
import React, { Component } from 'react'; import Header from './Header'; import Footer from './Footer'; import './App.css'; class App extends Component { render() { const { children } = this.props; return ( <div className="app"> <Header/> {children} <Footer/> </div> ); } } export default App;
src/components/select.js
garth/material-components
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import Input from './input'; import Menu from './menu'; class Select extends Component { static displayName = 'Select'; static propTypes = { className: PropTypes.string, isError: PropTypes.bool, isOpen: PropTypes.bool, isSuccess: PropTypes.bool, label: PropTypes.string, message: PropTypes.node, onChange: PropTypes.func, onClose: PropTypes.func, onOpen: PropTypes.func, options: PropTypes.array, readOnly: PropTypes.bool, selected: PropTypes.object, style: PropTypes.object, value: PropTypes.any }; static defaultProps = { className: '', isError: false, isOpen: false, isSuccess: false, label: '', message: '', options: [], readOnly: false, selected: null, style: {}, value: null }; render() { const { className, isError, isOpen, isSuccess, label, message, onChange, onClose, onOpen, options, readOnly, selected, style, value } = this.props; let selectedIndex = 0; let displayValue = ''; let menuItems = options.map((option, index) => { let isSelected = (selected && option.label === selected.label) || (value !== null && option.value === value); if (!selectedIndex && isSelected) { selectedIndex = index; displayValue = option.label; } return ( <Menu.Item className={classNames({ selected: isSelected })} key={option.key || option.label} onClick={() => onChange({ target: option })}> {option.label} </Menu.Item> ); }); const top = 10 - selectedIndex * 32; return ( <div className={className} style={Object.assign( { position: 'relative' }, style )}> <Menu style={{ position: 'relative', top: `${top}px`, width: '100%' }} isOpen={isOpen && !readOnly && !!menuItems} onClose={onClose}> {menuItems} </Menu> <svg style={{ position: 'absolute', right: '0px', top: '28px' }} fill="#aaa" height="24" viewBox="0 0 24 24" width="24"> <path d="M7 10l5 5 5-5z" /> <path d="M0 0h24v24H0z" fill="none" /> </svg> <Input inputStyle={{ cursor: 'pointer' }} isError={isError} isSuccess={isSuccess} label={label} message={message} onClick={onOpen} readOnly value={`${displayValue}`} /> </div> ); } } export default Select;
src/components/App/App.js
jongha/stock-ai
import React from 'react'; import axios from 'axios'; import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import { SearchBox, AnalyticsBox, Header, Footer } from '../index'; let style = require('./App.less'); let FontAwesome = require('react-fontawesome'); class App extends React.Component { constructor(props) { super(props); this.onSearchBox = this.onSearchBox.bind(this); this.onChangeSearchBox = this.onChangeSearchBox.bind(this); this.state = { analytics: {}, }; } onSearchBox(e) { console.log(e); axios.get('/analytics.json?code=005930').then(response => { console.log(response); this.setState({ analytics: response.data }); }); } onChangeSearchBox(e) { this.setState({ search: e.target.value }); } componentDidMount() { console.log('componentDidMount'); } componentDidUpdate() { console.log('componentDidUpdate'); } render() { return ( <div className='row'> <SearchBox value={ this.state.search } onClick={ this.onSearchBox } onChange={ this.onChangeSearchBox } /> <AnalyticsBox value={ this.state.analytics } /> </div> ); } } export default App;
docs/src/IntroductionPage.js
pivotal-cf/react-bootstrap
import React from 'react'; import CodeExample from './CodeExample'; import NavMain from './NavMain'; import PageHeader from './PageHeader'; import PageFooter from './PageFooter'; const IntroductionPage = React.createClass({ render() { return ( <div> <NavMain activePage="introduction" /> <PageHeader title="Introduction" subTitle="The most popular front-end framework, rebuilt for React."/> <div className="container bs-docs-container"> <div className="row"> <div className="col-md-9" role="main"> <div className="bs-docs-section"> <p className="lead"> React-Bootstrap is a library of reuseable front-end components. You'll get the look-and-feel of Twitter Bootstrap, but with much cleaner code, via Facebook's React.js framework. </p> <p> Let's say you want a small button that says "Something", to trigger the function someCallback. If you were writing a native application, you might write something like: </p> <div className="highlight"> <CodeExample mode="javascript" codeText={ `button(size=SMALL, color=GREEN, text="Something", onClick=someCallback)` } /> </div> <p> With the most popular web front-end framework, Twitter Bootstrap, you'd write this in your HTML: </p> <div className="highlight"> <CodeExample mode="htmlmixed" codeText={ `<button id="something-btn" type="button" class="btn btn-success btn-sm"> Something </button>` } /> </div> <p> And something like <code className="js"> $('#something-btn').click(someCallback); </code> in your Javascript. </p> <p> By web standards this is quite nice, but it's still quite nasty. React-Bootstrap lets you write this: </p> <div className="highlight"> <CodeExample mode="javascript" codeText={ `<Button bsStyle="success" bsSize="small" onClick={someCallback}> Something </Button>` } /> </div> <p> The HTML/CSS implementation details are abstracted away, leaving you with an interface that more closely resembles what you would expect to write in other programming languages. </p> <h2>A better Bootstrap API using React.js</h2> <p> The Bootstrap code is so repetitive because HTML and CSS do not support the abstractions necessary for a nice library of components. That's why we have to write <code>btn</code> three times, within an element called <code>button</code>. </p> <p> <strong> The React.js solution is to write directly in Javascript. </strong> React takes over the page-rendering entirely. You just give it a tree of Javascript objects, and tell it how state is transmitted between them. </p> <p> For instance, we might tell React to render a page displaying a single button, styled using the handy Bootstrap CSS: </p> <div className="highlight"> <CodeExample mode="javascript" codeText={ `var button = React.DOM.button({ className: "btn btn-lg btn-success", children: "Register" }); React.render(button, mountNode);` } /> </div> <p> But now that we're in Javascript, we can wrap the HTML/CSS, and provide a much better API: </p> <div className="highlight"> <CodeExample mode="javascript" codeText={ `var button = ReactBootstrap.Button({ bsStyle: "success", bsSize: "large", children: "Register" }); React.render(button, mountNode);` } /> </div> <p> React-Bootstrap is a library of such components, which you can also easily extend and enhance with your own functionality. </p> <h3>JSX Syntax</h3> <p> While each React component is really just a Javascript object, writing tree-structures that way gets tedious. React encourages the use of a syntactic-sugar called JSX, which lets you write the tree in an HTML-like syntax: </p> <div className="highlight"> <CodeExample mode="javascript" codeText={ `var buttonGroupInstance = ( <ButtonGroup> <DropdownButton bsStyle="success" title="Dropdown"> <MenuItem key="1">Dropdown link</MenuItem> <MenuItem key="2">Dropdown link</MenuItem> </DropdownButton> <Button bsStyle="info">Middle</Button> <Button bsStyle="info">Right</Button> </ButtonGroup> ); React.render(buttonGroupInstance, mountNode);` } /> </div> <p> Some people's first impression of React.js is that it seems messy to mix Javascript and HTML in this way. However, compare the code required to add a dropdown button in the example above to the <a href="http://getbootstrap.com/javascript/#dropdowns"> Bootstrap Javascript</a> and <a href="http://getbootstrap.com/components/#btn-dropdowns"> Components</a> documentation for creating a dropdown button. The documentation is split in two because you have to implement the component in two places in your code: first you must add the HTML/CSS elements, and then you must call some Javascript setup code to wire the component together. </p> <p> The React-Bootstrap component library tries to follow the React.js philosophy that a single piece of functionality should be defined in a single place. View the current React-Bootstrap library on the <a href="/components.html">components page</a>. </p> </div> </div> </div> </div> <PageFooter /> </div> ); } }); export default IntroductionPage;
generators/advanced-base/templates/src/Scenes.js
bamlab/generator-rn-toolbox
// @flow import React from 'react'; import { createStackNavigator, createTabNavigator, HeaderBackButton, } from 'react-navigation'; import * as Pages from './pages'; import theme from 'theme'; import I18n from 'lib/i18n'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; const TabIcon = props => <Icon color={props.tintColor} size={30} {...props} />; const LandingStack = createStackNavigator( { landing: { screen: Pages.Landing, }, login: { screen: Pages.Login, }, }, { initialRouteName: 'landing', mode: 'modal', headerMode: 'none', navigationOptions: { header: null, }, } ); const SignUpStack = createStackNavigator( { signup: { screen: Pages.Signup, navigationOptions: props => ({ title: I18n.t('signup.title'), headerLeft: ( <HeaderBackButton onPress={() => { props.navigation.goBack(null); }} tintColor={theme.colors.overPrimary} /> ), }), }, }, { initialRouteName: 'signup', navigationOptions: { headerTintColor: theme.colors.overPrimary, headerStyle: { backgroundColor: theme.colors.primary, }, }, } ); const DashboardTab = createTabNavigator( { home: { screen: Pages.Home, navigationOptions: { title: I18n.t('home.title'), tabBarIcon: props => <TabIcon name="home" {...props} />, }, }, account: { screen: Pages.Account, navigationOptions: { title: I18n.t('account.title'), tabBarIcon: props => <TabIcon name="account" {...props} />, }, }, }, { initialRouteName: 'home', animationEnabled: true, backBehavior: 'initialRoute', tabBarOptions: { activeTintColor: theme.colors.primary, pressColor: theme.colors.grayLight, inactiveTintColor: theme.colors.gray, indicatorStyle: { backgroundColor: theme.colors.primary, height: 3, }, style: { backgroundColor: 'white', }, }, } ); const DashboardStack = createStackNavigator( { dashboardTabs: { screen: DashboardTab, navigationOptions: ({ navigationOptions }) => ({ ...navigationOptions, headerStyle: { ...navigationOptions.headerStyle, elevation: 0, }, }), }, }, { initialRouteName: 'dashboardTabs', navigationOptions: { headerTintColor: theme.colors.overPrimary, headerStyle: { backgroundColor: theme.colors.primary, }, }, } ); export const RootNavigator = createStackNavigator( { landing: { screen: LandingStack, }, signup: { screen: SignUpStack, }, dashboard: { screen: DashboardStack, }, }, { initialRouteName: 'landing', headerMode: 'none', } ); export default RootNavigator;
src/molecules/MobileMenu/__tests__/mobile_menu.spec.js
policygenius/athenaeum
import React from 'react'; import { shallow } from 'enzyme'; import Text from 'atoms/Text'; import Icon from 'atoms/Icon'; import renderer from 'react-test-renderer'; import MobileMenu from 'molecules/MobileMenu'; describe('<MobileMenu />', () => { let defaultProps; beforeEach(() => { defaultProps = { tabs: [], onClick: jest.fn(), }; }); it('renders correctly', () => { const actual = renderer.create(<MobileMenu {...defaultProps} />).toJSON(); expect(actual).toMatchSnapshot(); }); it('gives the correct color to Text component', () => { const tabs = [ { icon: 'phone', text: 'Expert Help', active: true, key: 1 }, { icon: 'user', text: 'Save My Progress', active: false, key: 2 } ]; const wrapper = shallow(<MobileMenu {...defaultProps} tabs={tabs} />); const activeText = wrapper.find(Text).first(); expect(activeText.prop('color')).toEqual('primary-3'); const inactiveText = wrapper.find(Text).last(); expect(inactiveText.prop('color')).toEqual('primary-3'); }); it('gives the correct className to Icon component', () => { const tabs = [ { icon: 'phone', text: 'Expert Help', active: true, key: 1 }, { icon: 'user', text: 'Save My Progress', active: false, key: 2 } ]; const wrapper = shallow(<MobileMenu {...defaultProps} tabs={tabs} />); const activeIcon = wrapper.find(Icon).first(); expect(activeIcon.prop('className')).toEqual('icon-active'); const inactiveIcon = wrapper.find(Icon).last(); expect(inactiveIcon.prop('className')).toEqual('icon-inactive'); }); it('gives the correct classname to tab wrapper', () => { const tabs = [ { icon: 'phone', text: 'Expert Help', active: true, key: 1 }, { icon: 'user', text: 'Save My Progress', active: false, key: 2 } ]; const wrapper = shallow(<MobileMenu {...defaultProps} tabs={tabs} />); const activeTab = wrapper.find('li').first(); expect(activeTab.prop('className')).toEqual('tab active'); const inactiveTab = wrapper.find('li').last(); expect(inactiveTab.prop('className')).toEqual('tab inactive'); }); });
ajax/libs/webshim/1.14.5-RC2/dev/shims/combos/26.js
xymostech/cdnjs
/** * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill * v1.2.1 * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing * * Date: 2014-05-14 */ /** * Compiled inline version. (Library mode) */ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ /*globals $code */ (function(exports, undefined) { "use strict"; var modules = {}; function require(ids, callback) { var module, defs = []; for (var i = 0; i < ids.length; ++i) { module = modules[ids[i]] || resolve(ids[i]); if (!module) { throw 'module definition dependecy not found: ' + ids[i]; } defs.push(module); } callback.apply(null, defs); } function define(id, dependencies, definition) { if (typeof id !== 'string') { throw 'invalid module definition, module id must be defined and be a string'; } if (dependencies === undefined) { throw 'invalid module definition, dependencies must be specified'; } if (definition === undefined) { throw 'invalid module definition, definition function must be specified'; } require(dependencies, function() { modules[id] = definition.apply(null, arguments); }); } function defined(id) { return !!modules[id]; } function resolve(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length; ++fi) { if (!target[fragments[fi]]) { return; } target = target[fragments[fi]]; } return target; } function expose(ids) { for (var i = 0; i < ids.length; i++) { var target = exports; var id = ids[i]; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length - 1; ++fi) { if (target[fragments[fi]] === undefined) { target[fragments[fi]] = {}; } target = target[fragments[fi]]; } target[fragments[fragments.length - 1]] = modules[id]; } } // Included from: src/javascript/core/utils/Basic.js /** * Basic.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Basic', [], function() { /** Gets the true type of the built-in object (better version of typeof). @author Angus Croll (http://javascriptweblog.wordpress.com/) @method typeOf @for Utils @static @param {Object} o Object to check. @return {String} Object [[Class]] */ var typeOf = function(o) { var undef; if (o === undef) { return 'undefined'; } else if (o === null) { return 'null'; } else if (o.nodeType) { return 'node'; } // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); }; /** Extends the specified object with another object. @method extend @static @param {Object} target Object to extend. @param {Object} [obj]* Multiple objects to extend with. @return {Object} Same as target, the extended object. */ var extend = function(target) { var undef; each(arguments, function(arg, i) { if (i > 0) { each(arg, function(value, key) { if (value !== undef) { if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) { extend(target[key], value); } else { target[key] = value; } } }); } }); return target; }; /** Executes the callback function for each item in array/object. If you return false in the callback it will break the loop. @method each @static @param {Object} obj Object to iterate. @param {function} callback Callback function to execute for each item. */ var each = function(obj, callback) { var length, key, i, undef; if (obj) { try { length = obj.length; } catch(ex) { length = undef; } if (length === undef) { // Loop object items for (key in obj) { if (obj.hasOwnProperty(key)) { if (callback(obj[key], key) === false) { return; } } } } else { // Loop array items for (i = 0; i < length; i++) { if (callback(obj[i], i) === false) { return; } } } } }; /** Checks if object is empty. @method isEmptyObj @static @param {Object} o Object to check. @return {Boolean} */ var isEmptyObj = function(obj) { var prop; if (!obj || typeOf(obj) !== 'object') { return true; } for (prop in obj) { return false; } return true; }; /** Recieve an array of functions (usually async) to call in sequence, each function receives a callback as first argument that it should call, when it completes. Finally, after everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the sequence and invoke main callback immediately. @method inSeries @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ var inSeries = function(queue, cb) { var i = 0, length = queue.length; if (typeOf(cb) !== 'function') { cb = function() {}; } if (!queue || !queue.length) { cb(); } function callNext(i) { if (typeOf(queue[i]) === 'function') { queue[i](function(error) { /*jshint expr:true */ ++i < length && !error ? callNext(i) : cb(error); }); } } callNext(i); }; /** Recieve an array of functions (usually async) to call in parallel, each function receives a callback as first argument that it should call, when it completes. After everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the process and invoke main callback immediately. @method inParallel @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of erro */ var inParallel = function(queue, cb) { var count = 0, num = queue.length, cbArgs = new Array(num); each(queue, function(fn, i) { fn(function(error) { if (error) { return cb(error); } var args = [].slice.call(arguments); args.shift(); // strip error - undefined or not cbArgs[i] = args; count++; if (count === num) { cbArgs.unshift(null); cb.apply(this, cbArgs); } }); }); }; /** Find an element in array and return it's index if present, otherwise return -1. @method inArray @static @param {Mixed} needle Element to find @param {Array} array @return {Int} Index of the element, or -1 if not found */ var inArray = function(needle, array) { if (array) { if (Array.prototype.indexOf) { return Array.prototype.indexOf.call(array, needle); } for (var i = 0, length = array.length; i < length; i++) { if (array[i] === needle) { return i; } } } return -1; }; /** Returns elements of first array if they are not present in second. And false - otherwise. @private @method arrayDiff @param {Array} needles @param {Array} array @return {Array|Boolean} */ var arrayDiff = function(needles, array) { var diff = []; if (typeOf(needles) !== 'array') { needles = [needles]; } if (typeOf(array) !== 'array') { array = [array]; } for (var i in needles) { if (inArray(needles[i], array) === -1) { diff.push(needles[i]); } } return diff.length ? diff : false; }; /** Find intersection of two arrays. @private @method arrayIntersect @param {Array} array1 @param {Array} array2 @return {Array} Intersection of two arrays or null if there is none */ var arrayIntersect = function(array1, array2) { var result = []; each(array1, function(item) { if (inArray(item, array2) !== -1) { result.push(item); } }); return result.length ? result : null; }; /** Forces anything into an array. @method toArray @static @param {Object} obj Object with length field. @return {Array} Array object containing all items. */ var toArray = function(obj) { var i, arr = []; for (i = 0; i < obj.length; i++) { arr[i] = obj[i]; } return arr; }; /** Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. It's more probable for the earth to be hit with an ansteriod. Y @method guid @static @param {String} prefix to prepend (by default 'o' will be prepended). @method guid @return {String} Virtually unique id. */ var guid = (function() { var counter = 0; return function(prefix) { var guid = new Date().getTime().toString(32), i; for (i = 0; i < 5; i++) { guid += Math.floor(Math.random() * 65535).toString(32); } return (prefix || 'o_') + guid + (counter++).toString(32); }; }()); /** Trims white spaces around the string @method trim @static @param {String} str @return {String} */ var trim = function(str) { if (!str) { return str; } return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); }; /** Parses the specified size string into a byte value. For example 10kb becomes 10240. @method parseSizeStr @static @param {String/Number} size String to parse or number to just pass through. @return {Number} Size in bytes. */ var parseSizeStr = function(size) { if (typeof(size) !== 'string') { return size; } var muls = { t: 1099511627776, g: 1073741824, m: 1048576, k: 1024 }, mul; size = /^([0-9]+)([mgk]?)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, '')); mul = size[2]; size = +size[1]; if (muls.hasOwnProperty(mul)) { size *= muls[mul]; } return size; }; return { guid: guid, typeOf: typeOf, extend: extend, each: each, isEmptyObj: isEmptyObj, inSeries: inSeries, inParallel: inParallel, inArray: inArray, arrayDiff: arrayDiff, arrayIntersect: arrayIntersect, toArray: toArray, trim: trim, parseSizeStr: parseSizeStr }; }); // Included from: src/javascript/core/I18n.js /** * I18n.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/I18n", [ "moxie/core/utils/Basic" ], function(Basic) { var i18n = {}; return { /** * Extends the language pack object with new items. * * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ addI18n: function(pack) { return Basic.extend(i18n, pack); }, /** * Translates the specified string by checking for the english string in the language pack lookup. * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ translate: function(str) { return i18n[str] || str; }, /** * Shortcut for translate function * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ _: function(str) { return this.translate(str); }, /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. * * @param {String} str String with tokens * @return {String} String with replaced tokens */ sprintf: function(str) { var args = [].slice.call(arguments, 1); return str.replace(/%[a-z]/g, function() { var value = args.shift(); return Basic.typeOf(value) !== 'undefined' ? value : ''; }); } }; }); // Included from: src/javascript/core/utils/Mime.js /** * Mime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Mime", [ "moxie/core/utils/Basic", "moxie/core/I18n" ], function(Basic, I18n) { var mimeData = "" + "application/msword,doc dot," + "application/pdf,pdf," + "application/pgp-signature,pgp," + "application/postscript,ps ai eps," + "application/rtf,rtf," + "application/vnd.ms-excel,xls xlb," + "application/vnd.ms-powerpoint,ppt pps pot," + "application/zip,zip," + "application/x-shockwave-flash,swf swfl," + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + "application/x-javascript,js," + "application/json,json," + "audio/mpeg,mp3 mpga mpega mp2," + "audio/x-wav,wav," + "audio/x-m4a,m4a," + "audio/ogg,oga ogg," + "audio/aiff,aiff aif," + "audio/flac,flac," + "audio/aac,aac," + "audio/ac3,ac3," + "audio/x-ms-wma,wma," + "image/bmp,bmp," + "image/gif,gif," + "image/jpeg,jpg jpeg jpe," + "image/photoshop,psd," + "image/png,png," + "image/svg+xml,svg svgz," + "image/tiff,tiff tif," + "text/plain,asc txt text diff log," + "text/html,htm html xhtml," + "text/css,css," + "text/csv,csv," + "text/rtf,rtf," + "video/mpeg,mpeg mpg mpe m2v," + "video/quicktime,qt mov," + "video/mp4,mp4," + "video/x-m4v,m4v," + "video/x-flv,flv," + "video/x-ms-wmv,wmv," + "video/avi,avi," + "video/webm,webm," + "video/3gpp,3gpp 3gp," + "video/3gpp2,3g2," + "video/vnd.rn-realvideo,rv," + "video/ogg,ogv," + "video/x-matroska,mkv," + "application/vnd.oasis.opendocument.formula-template,otf," + "application/octet-stream,exe"; var Mime = { mimes: {}, extensions: {}, // Parses the default mime types string into a mimes and extensions lookup maps addMimeType: function (mimeData) { var items = mimeData.split(/,/), i, ii, ext; for (i = 0; i < items.length; i += 2) { ext = items[i + 1].split(/ /); // extension to mime lookup for (ii = 0; ii < ext.length; ii++) { this.mimes[ext[ii]] = items[i]; } // mime to extension lookup this.extensions[items[i]] = ext; } }, extList2mimes: function (filters, addMissingExtensions) { var self = this, ext, i, ii, type, mimes = []; // convert extensions to mime types list for (i = 0; i < filters.length; i++) { ext = filters[i].extensions.split(/\s*,\s*/); for (ii = 0; ii < ext.length; ii++) { // if there's an asterisk in the list, then accept attribute is not required if (ext[ii] === '*') { return []; } type = self.mimes[ext[ii]]; if (!type) { if (addMissingExtensions && /^\w+$/.test(ext[ii])) { mimes.push('.' + ext[ii]); } else { return []; // accept all } } else if (Basic.inArray(type, mimes) === -1) { mimes.push(type); } } } return mimes; }, mimes2exts: function(mimes) { var self = this, exts = []; Basic.each(mimes, function(mime) { if (mime === '*') { exts = []; return false; } // check if this thing looks like mime type var m = mime.match(/^(\w+)\/(\*|\w+)$/); if (m) { if (m[2] === '*') { // wildcard mime type detected Basic.each(self.extensions, function(arr, mime) { if ((new RegExp('^' + m[1] + '/')).test(mime)) { [].push.apply(exts, self.extensions[mime]); } }); } else if (self.extensions[mime]) { [].push.apply(exts, self.extensions[mime]); } } }); return exts; }, mimes2extList: function(mimes) { var accept = [], exts = []; if (Basic.typeOf(mimes) === 'string') { mimes = Basic.trim(mimes).split(/\s*,\s*/); } exts = this.mimes2exts(mimes); accept.push({ title: I18n.translate('Files'), extensions: exts.length ? exts.join(',') : '*' }); // save original mimes string accept.mimes = mimes; return accept; }, getFileExtension: function(fileName) { var matches = fileName && fileName.match(/\.([^.]+)$/); if (matches) { return matches[1].toLowerCase(); } return ''; }, getFileMime: function(fileName) { return this.mimes[this.getFileExtension(fileName)] || ''; } }; Mime.addMimeType(mimeData); return Mime; }); // Included from: src/javascript/core/utils/Env.js /** * Env.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Env", [ "moxie/core/utils/Basic" ], function(Basic) { // UAParser.js v0.6.2 // Lightweight JavaScript-based User-Agent string parser // https://github.com/faisalman/ua-parser-js // // Copyright © 2012-2013 Faisalman <fyzlman@gmail.com> // Dual licensed under GPLv2 & MIT var UAParser = (function (undefined) { ////////////// // Constants ///////////// var EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', UNDEF_TYPE = 'undefined', OBJ_TYPE = 'object', MAJOR = 'major', MODEL = 'model', NAME = 'name', TYPE = 'type', VENDOR = 'vendor', VERSION = 'version', ARCHITECTURE= 'architecture', CONSOLE = 'console', MOBILE = 'mobile', TABLET = 'tablet'; /////////// // Helper ////////// var util = { has : function (str1, str2) { return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; }, lowerize : function (str) { return str.toLowerCase(); } }; /////////////// // Map helper ////////////// var mapper = { rgx : function () { // loop through all regexes maps for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { var regex = args[i], // even sequence (0,2,4,..) props = args[i + 1]; // odd sequence (1,3,5,..) // construct object barebones if (typeof(result) === UNDEF_TYPE) { result = {}; for (p in props) { q = props[p]; if (typeof(q) === OBJ_TYPE) { result[q[0]] = undefined; } else { result[q] = undefined; } } } // try matching uastring with regexes for (j = k = 0; j < regex.length; j++) { matches = regex[j].exec(this.getUA()); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof(q) === OBJ_TYPE && q.length > 0) { if (q.length == 2) { if (typeof(q[1]) == FUNC_TYPE) { // assign modified match result[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match result[q[0]] = q[1]; } } else if (q.length == 3) { // check whether function or regex if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length == 4) { result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { result[q] = match ? match : undefined; } } break; } } if(!!matches) break; // break the loop immediately if match found } return result; }, str : function (str, map) { for (var i in map) { // check if array if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (util.has(map[i][j], str)) { return (i === UNKNOWN) ? undefined : i; } } } else if (util.has(map[i], str)) { return (i === UNKNOWN) ? undefined : i; } } return str; } }; /////////////// // String map ////////////// var maps = { browser : { oldsafari : { major : { '1' : ['/8', '/1', '/3'], '2' : '/4', '?' : '/' }, version : { '1.0' : '/8', '1.2' : '/1', '1.3' : '/3', '2.0' : '/412', '2.0.2' : '/416', '2.0.3' : '/417', '2.0.4' : '/419', '?' : '/' } } }, device : { sprint : { model : { 'Evo Shift 4G' : '7373KT' }, vendor : { 'HTC' : 'APA', 'Sprint' : 'Sprint' } } }, os : { windows : { version : { 'ME' : '4.90', 'NT 3.11' : 'NT3.51', 'NT 4.0' : 'NT4.0', '2000' : 'NT 5.0', 'XP' : ['NT 5.1', 'NT 5.2'], 'Vista' : 'NT 6.0', '7' : 'NT 6.1', '8' : 'NT 6.2', '8.1' : 'NT 6.3', 'RT' : 'ARM' } } } }; ////////////// // Regex map ///////////// var regexes = { browser : [[ // Presto based /(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet /(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80 /(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80 ], [NAME, VERSION, MAJOR], [ /\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit ], [[NAME, 'Opera'], VERSION, MAJOR], [ // Mixed /(kindle)\/((\d+)?[\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer // Trident based /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, // Avant/IEMobile/SlimBrowser/Baidu /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer // Webkit/KHTML based /(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron ], [NAME, VERSION, MAJOR], [ /(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11 ], [[NAME, 'IE'], VERSION, MAJOR], [ /(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex ], [[NAME, 'Yandex'], VERSION, MAJOR], [ /(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION, MAJOR], [ /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION, MAJOR], [ /(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin ], [[NAME, 'Dolphin'], VERSION, MAJOR], [ /((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS ], [[NAME, 'Chrome'], VERSION, MAJOR], [ /((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i // Android Browser ], [[NAME, 'Android Browser'], VERSION, MAJOR], [ /version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari ], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [ /version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile ], [VERSION, MAJOR, NAME], [ /webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0 ], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [ /(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror /(webkit|khtml)\/((\d+)?[\w\.]+)/i ], [NAME, VERSION, MAJOR], [ // Gecko based /(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION, MAJOR], [ /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla // Other /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, // UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser /(links)\s\(((\d+)?[\w\.]+)/i, // Links /(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser /(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic ], [NAME, VERSION, MAJOR] ], engine : [[ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ /rv\:([\w\.]+).*(gecko)/i // Gecko ], [VERSION, NAME] ], os : [[ // Windows based /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ // Mobile/Embedded OS /\((bb)(10);/i // BlackBerry 10 ], [[NAME, 'BlackBerry'], VERSION], [ /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry /(tizen)\/([\w\.]+)/i, // Tizen /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo ], [NAME, VERSION], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian ], [[NAME, 'Symbian'], VERSION],[ /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS ], [[NAME, 'Firefox OS'], VERSION], [ // Console /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation // GNU/Linux based /(mint)[\/\s\(]?(\w+)*/i, // Mint /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux /(gnu)\s?([\w\.]+)*/i // GNU ], [NAME, VERSION], [ /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS ], [[NAME, 'Chromium OS'], VERSION],[ // Solaris /(sunos)\s?([\w\.]+\d)*/i // Solaris ], [[NAME, 'Solaris'], VERSION], [ // BSD based /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly ], [NAME, VERSION],[ /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ /(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS ], [NAME, [VERSION, /_/g, '.']], [ // Other /(haiku)\s(\w+)/i, // Haiku /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS /(unix)\s?([\w\.]+)*/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (uastring) { var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); this.getBrowser = function () { return mapper.rgx.apply(this, regexes.browser); }; this.getEngine = function () { return mapper.rgx.apply(this, regexes.engine); }; this.getOS = function () { return mapper.rgx.apply(this, regexes.os); }; this.getResult = function() { return { ua : this.getUA(), browser : this.getBrowser(), engine : this.getEngine(), os : this.getOS() }; }; this.getUA = function () { return ua; }; this.setUA = function (uastring) { ua = uastring; return this; }; this.setUA(ua); }; return new UAParser().getResult(); })(); function version_compare(v1, v2, operator) { // From: http://phpjs.org/functions // + original by: Philippe Jausions (http://pear.php.net/user/jausions) // + original by: Aidan Lister (http://aidanlister.com/) // + reimplemented by: Kankrelune (http://www.webfaktory.info/) // + improved by: Brett Zamir (http://brett-zamir.me) // + improved by: Scott Baker // + improved by: Theriault // * example 1: version_compare('8.2.5rc', '8.2.5a'); // * returns 1: 1 // * example 2: version_compare('8.2.50', '8.2.52', '<'); // * returns 2: true // * example 3: version_compare('5.3.0-dev', '5.3.0'); // * returns 3: -1 // * example 4: version_compare('4.1.0.52','4.01.0.51'); // * returns 4: 1 // Important: compare must be initialized at 0. var i = 0, x = 0, compare = 0, // vm maps textual PHP versions to negatives so they're less than 0. // PHP currently defines these as CASE-SENSITIVE. It is important to // leave these as negatives so that they can come before numerical versions // and as if no letters were there to begin with. // (1alpha is < 1 and < 1.1 but > 1dev1) // If a non-numerical value can't be mapped to this table, it receives // -7 as its value. vm = { 'dev': -6, 'alpha': -5, 'a': -5, 'beta': -4, 'b': -4, 'RC': -3, 'rc': -3, '#': -2, 'p': 1, 'pl': 1 }, // This function will be called to prepare each version argument. // It replaces every _, -, and + with a dot. // It surrounds any nonsequence of numbers/dots with dots. // It replaces sequences of dots with a single dot. // version_compare('4..0', '4.0') == 0 // Important: A string of 0 length needs to be converted into a value // even less than an unexisting value in vm (-7), hence [-8]. // It's also important to not strip spaces because of this. // version_compare('', ' ') == 1 prepVersion = function (v) { v = ('' + v).replace(/[_\-+]/g, '.'); v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); return (!v.length ? [-8] : v.split('.')); }, // This converts a version component to a number. // Empty component becomes 0. // Non-numerical component becomes a negative number. // Numerical component becomes itself as an integer. numVersion = function (v) { return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); }; v1 = prepVersion(v1); v2 = prepVersion(v2); x = Math.max(v1.length, v2.length); for (i = 0; i < x; i++) { if (v1[i] == v2[i]) { continue; } v1[i] = numVersion(v1[i]); v2[i] = numVersion(v2[i]); if (v1[i] < v2[i]) { compare = -1; break; } else if (v1[i] > v2[i]) { compare = 1; break; } } if (!operator) { return compare; } // Important: operator is CASE-SENSITIVE. // "No operator" seems to be treated as "<." // Any other values seem to make the function return null. switch (operator) { case '>': case 'gt': return (compare > 0); case '>=': case 'ge': return (compare >= 0); case '<=': case 'le': return (compare <= 0); case '==': case '=': case 'eq': return (compare === 0); case '<>': case '!=': case 'ne': return (compare !== 0); case '': case '<': case 'lt': return (compare < 0); default: return null; } } var can = (function() { var caps = { define_property: (function() { /* // currently too much extra code required, not exactly worth it try { // as of IE8, getters/setters are supported only on DOM elements var obj = {}; if (Object.defineProperty) { Object.defineProperty(obj, 'prop', { enumerable: true, configurable: true }); return true; } } catch(ex) {} if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { return true; }*/ return false; }()), create_canvas: (function() { // On the S60 and BB Storm, getContext exists, but always returns undefined // so we actually have to call getContext() to verify // github.com/Modernizr/Modernizr/issues/issue/97/ var el = document.createElement('canvas'); return !!(el.getContext && el.getContext('2d')); }()), return_response_type: function(responseType) { try { if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { return true; } else if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); xhr.open('get', '/'); // otherwise Gecko throws an exception if ('responseType' in xhr) { xhr.responseType = responseType; // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) if (xhr.responseType !== responseType) { return false; } return true; } } } catch (ex) {} return false; }, // ideas for this heavily come from Modernizr (http://modernizr.com/) use_data_uri: (function() { var du = new Image(); du.onload = function() { caps.use_data_uri = (du.width === 1 && du.height === 1); }; setTimeout(function() { du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; }, 1); return false; }()), use_data_uri_over32kb: function() { // IE8 return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); }, use_data_uri_of: function(bytes) { return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); }, use_fileinput: function() { var el = document.createElement('input'); el.setAttribute('type', 'file'); return !el.disabled; } }; return function(cap) { var args = [].slice.call(arguments); args.shift(); // shift of cap return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; }; }()); var Env = { can: can, browser: UAParser.browser.name, version: parseFloat(UAParser.browser.major), os: UAParser.os.name, // everybody intuitively types it in a lowercase for some reason osVersion: UAParser.os.version, verComp: version_compare, swf_url: "../flash/Moxie.swf", xap_url: "../silverlight/Moxie.xap", global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" }; // for backward compatibility // @deprecated Use `Env.os` instead Env.OS = Env.os; return Env; }); // Included from: src/javascript/core/utils/Dom.js /** * Dom.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { /** Get DOM Element by it's id. @method get @for Utils @param {String} id Identifier of the DOM Element @return {DOMElement} */ var get = function(id) { if (typeof id !== 'string') { return id; } return document.getElementById(id); }; /** Checks if specified DOM element has specified class. @method hasClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var hasClass = function(obj, name) { if (!obj.className) { return false; } var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); return regExp.test(obj.className); }; /** Adds specified className to specified DOM element. @method addClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var addClass = function(obj, name) { if (!hasClass(obj, name)) { obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; } }; /** Removes specified className from specified DOM element. @method removeClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var removeClass = function(obj, name) { if (obj.className) { var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); obj.className = obj.className.replace(regExp, function($0, $1, $2) { return $1 === ' ' && $2 === ' ' ? ' ' : ''; }); } }; /** Returns a given computed style of a DOM element. @method getStyle @static @param {Object} obj DOM element like object. @param {String} name Style you want to get from the DOM element */ var getStyle = function(obj, name) { if (obj.currentStyle) { return obj.currentStyle[name]; } else if (window.getComputedStyle) { return window.getComputedStyle(obj, null)[name]; } }; /** Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @method getPos @static @param {Element} node HTML element or element id to get x, y position from. @param {Element} root Optional root element to stop calculations at. @return {object} Absolute position of the specified element object with x, y fields. */ var getPos = function(node, root) { var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; node = node; root = root || doc.body; // Returns the x, y cordinate for an element on IE 6 and IE 7 function getIEPos(node) { var bodyElm, rect, x = 0, y = 0; if (node) { rect = node.getBoundingClientRect(); bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; x = rect.left + bodyElm.scrollLeft; y = rect.top + bodyElm.scrollTop; } return { x : x, y : y }; } // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { nodeRect = getIEPos(node); rootRect = getIEPos(root); return { x : nodeRect.x - rootRect.x, y : nodeRect.y - rootRect.y }; } parent = node; while (parent && parent != root && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } parent = node.parentNode; while (parent && parent != root && parent.nodeType) { x -= parent.scrollLeft || 0; y -= parent.scrollTop || 0; parent = parent.parentNode; } return { x : x, y : y }; }; /** Returns the size of the specified node in pixels. @method getSize @static @param {Node} node Node to get the size of. @return {Object} Object with a w and h property. */ var getSize = function(node) { return { w : node.offsetWidth || node.clientWidth, h : node.offsetHeight || node.clientHeight }; }; return { get: get, hasClass: hasClass, addClass: addClass, removeClass: removeClass, getStyle: getStyle, getPos: getPos, getSize: getSize }; }); // Included from: src/javascript/core/Exceptions.js /** * Exceptions.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/Exceptions', [ 'moxie/core/utils/Basic' ], function(Basic) { function _findKey(obj, value) { var key; for (key in obj) { if (obj[key] === value) { return key; } } return null; } return { RuntimeError: (function() { var namecodes = { NOT_INIT_ERR: 1, NOT_SUPPORTED_ERR: 9, JS_ERR: 4 }; function RuntimeError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": RuntimeError " + this.code; } Basic.extend(RuntimeError, namecodes); RuntimeError.prototype = Error.prototype; return RuntimeError; }()), OperationNotAllowedException: (function() { function OperationNotAllowedException(code) { this.code = code; this.name = 'OperationNotAllowedException'; } Basic.extend(OperationNotAllowedException, { NOT_ALLOWED_ERR: 1 }); OperationNotAllowedException.prototype = Error.prototype; return OperationNotAllowedException; }()), ImageError: (function() { var namecodes = { WRONG_FORMAT: 1, MAX_RESOLUTION_ERR: 2 }; function ImageError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": ImageError " + this.code; } Basic.extend(ImageError, namecodes); ImageError.prototype = Error.prototype; return ImageError; }()), FileException: (function() { var namecodes = { NOT_FOUND_ERR: 1, SECURITY_ERR: 2, ABORT_ERR: 3, NOT_READABLE_ERR: 4, ENCODING_ERR: 5, NO_MODIFICATION_ALLOWED_ERR: 6, INVALID_STATE_ERR: 7, SYNTAX_ERR: 8 }; function FileException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": FileException " + this.code; } Basic.extend(FileException, namecodes); FileException.prototype = Error.prototype; return FileException; }()), DOMException: (function() { var namecodes = { INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, WRONG_DOCUMENT_ERR: 4, INVALID_CHARACTER_ERR: 5, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, INUSE_ATTRIBUTE_ERR: 10, INVALID_STATE_ERR: 11, SYNTAX_ERR: 12, INVALID_MODIFICATION_ERR: 13, NAMESPACE_ERR: 14, INVALID_ACCESS_ERR: 15, VALIDATION_ERR: 16, TYPE_MISMATCH_ERR: 17, SECURITY_ERR: 18, NETWORK_ERR: 19, ABORT_ERR: 20, URL_MISMATCH_ERR: 21, QUOTA_EXCEEDED_ERR: 22, TIMEOUT_ERR: 23, INVALID_NODE_TYPE_ERR: 24, DATA_CLONE_ERR: 25 }; function DOMException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": DOMException " + this.code; } Basic.extend(DOMException, namecodes); DOMException.prototype = Error.prototype; return DOMException; }()), EventException: (function() { function EventException(code) { this.code = code; this.name = 'EventException'; } Basic.extend(EventException, { UNSPECIFIED_EVENT_TYPE_ERR: 0 }); EventException.prototype = Error.prototype; return EventException; }()) }; }); // Included from: src/javascript/core/EventTarget.js /** * EventTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/EventTarget', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic' ], function(x, Basic) { /** Parent object for all event dispatching components and objects @class EventTarget @constructor EventTarget */ function EventTarget() { // hash of event listeners by object uid var eventpool = {}; Basic.extend(this, { /** Unique id of the event dispatcher, usually overriden by children @property uid @type String */ uid: null, /** Can be called from within a child in order to acquire uniqie id in automated manner @method init */ init: function() { if (!this.uid) { this.uid = Basic.guid('uid_'); } }, /** Register a handler to a specific event dispatched by the object @method addEventListener @param {String} type Type or basically a name of the event to subscribe to @param {Function} fn Callback function that will be called when event happens @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first @param {Object} [scope=this] A scope to invoke event handler in */ addEventListener: function(type, fn, priority, scope) { var self = this, list; type = Basic.trim(type); if (/\s/.test(type)) { // multiple event types were passed for one handler Basic.each(type.split(/\s+/), function(type) { self.addEventListener(type, fn, priority, scope); }); return; } type = type.toLowerCase(); priority = parseInt(priority, 10) || 0; list = eventpool[this.uid] && eventpool[this.uid][type] || []; list.push({fn : fn, priority : priority, scope : scope || this}); if (!eventpool[this.uid]) { eventpool[this.uid] = {}; } eventpool[this.uid][type] = list; }, /** Check if any handlers were registered to the specified event @method hasEventListener @param {String} type Type or basically a name of the event to check @return {Mixed} Returns a handler if it was found and false, if - not */ hasEventListener: function(type) { return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid]; }, /** Unregister the handler from the event, or if former was not specified - unregister all handlers @method removeEventListener @param {String} type Type or basically a name of the event @param {Function} [fn] Handler to unregister */ removeEventListener: function(type, fn) { type = type.toLowerCase(); var list = eventpool[this.uid] && eventpool[this.uid][type], i; if (list) { if (fn) { for (i = list.length - 1; i >= 0; i--) { if (list[i].fn === fn) { list.splice(i, 1); break; } } } else { list = []; } // delete event list if it has become empty if (!list.length) { delete eventpool[this.uid][type]; // and object specific entry in a hash if it has no more listeners attached if (Basic.isEmptyObj(eventpool[this.uid])) { delete eventpool[this.uid]; } } } }, /** Remove all event handlers from the object @method removeAllEventListeners */ removeAllEventListeners: function() { if (eventpool[this.uid]) { delete eventpool[this.uid]; } }, /** Dispatch the event @method dispatchEvent @param {String/Object} Type of event or event object to dispatch @param {Mixed} [...] Variable number of arguments to be passed to a handlers @return {Boolean} true by default and false if any handler returned false */ dispatchEvent: function(type) { var uid, list, args, tmpEvt, evt = {}, result = true, undef; if (Basic.typeOf(type) !== 'string') { // we can't use original object directly (because of Silverlight) tmpEvt = type; if (Basic.typeOf(tmpEvt.type) === 'string') { type = tmpEvt.type; if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event evt.total = tmpEvt.total; evt.loaded = tmpEvt.loaded; } evt.async = tmpEvt.async || false; } else { throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); } } // check if event is meant to be dispatched on an object having specific uid if (type.indexOf('::') !== -1) { (function(arr) { uid = arr[0]; type = arr[1]; }(type.split('::'))); } else { uid = this.uid; } type = type.toLowerCase(); list = eventpool[uid] && eventpool[uid][type]; if (list) { // sort event list by prority list.sort(function(a, b) { return b.priority - a.priority; }); args = [].slice.call(arguments); // first argument will be pseudo-event object args.shift(); evt.type = type; args.unshift(evt); // Dispatch event to all listeners var queue = []; Basic.each(list, function(handler) { // explicitly set the target, otherwise events fired from shims do not get it args[0].target = handler.scope; // if event is marked as async, detach the handler if (evt.async) { queue.push(function(cb) { setTimeout(function() { cb(handler.fn.apply(handler.scope, args) === false); }, 1); }); } else { queue.push(function(cb) { cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation }); } }); if (queue.length) { Basic.inSeries(queue, function(err) { result = !err; }); } } return result; }, /** Alias for addEventListener @method bind @protected */ bind: function() { this.addEventListener.apply(this, arguments); }, /** Alias for removeEventListener @method unbind @protected */ unbind: function() { this.removeEventListener.apply(this, arguments); }, /** Alias for removeAllEventListeners @method unbindAll @protected */ unbindAll: function() { this.removeAllEventListeners.apply(this, arguments); }, /** Alias for dispatchEvent @method trigger @protected */ trigger: function() { return this.dispatchEvent.apply(this, arguments); }, /** Converts properties of on[event] type to corresponding event handlers, is used to avoid extra hassle around the process of calling them back @method convertEventPropsToHandlers @private */ convertEventPropsToHandlers: function(handlers) { var h; if (Basic.typeOf(handlers) !== 'array') { handlers = [handlers]; } for (var i = 0; i < handlers.length; i++) { h = 'on' + handlers[i]; if (Basic.typeOf(this[h]) === 'function') { this.addEventListener(handlers[i], this[h]); } else if (Basic.typeOf(this[h]) === 'undefined') { this[h] = null; // object must have defined event properties, even if it doesn't make use of them } } } }); } EventTarget.instance = new EventTarget(); return EventTarget; }); // Included from: src/javascript/core/utils/Encode.js /** * Encode.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Encode', [], function() { /** Encode string with UTF-8 @method utf8_encode @for Utils @static @param {String} str String to encode @return {String} UTF-8 encoded string */ var utf8_encode = function(str) { return unescape(encodeURIComponent(str)); }; /** Decode UTF-8 encoded string @method utf8_decode @static @param {String} str String to decode @return {String} Decoded string */ var utf8_decode = function(str_data) { return decodeURIComponent(escape(str_data)); }; /** Decode Base64 encoded string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js @method atob @static @param {String} data String to decode @return {String} Decoded string */ var atob = function(data, utf8) { if (typeof(window.atob) === 'function') { return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Thunder.m // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Onno Marsman // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); // * returns 1: 'Kevin van Zonneveld' // mozilla has this native // - but breaks in 2.0.0.12! //if (typeof this.window.atob == 'function') { // return atob(data); //} var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = []; if (!data) { return data; } data += ''; do { // unpack four hexets into three octets using index points in b64 h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits >> 16 & 0xff; o2 = bits >> 8 & 0xff; o3 = bits & 0xff; if (h3 == 64) { tmp_arr[ac++] = String.fromCharCode(o1); } else if (h4 == 64) { tmp_arr[ac++] = String.fromCharCode(o1, o2); } else { tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); } } while (i < data.length); dec = tmp_arr.join(''); return utf8 ? utf8_decode(dec) : dec; }; /** Base64 encode string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js @method btoa @static @param {String} data String to encode @return {String} Base64 encoded string */ var btoa = function(data, utf8) { if (utf8) { utf8_encode(data); } if (typeof(window.btoa) === 'function') { return window.btoa(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Bayron Guevara // + improved by: Thunder.m // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Rafał Kukawski (http://kukawski.pl) // * example 1: base64_encode('Kevin van Zonneveld'); // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' // mozilla has this native // - but breaks in 2.0.0.12! var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); var r = data.length % 3; return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); }; return { utf8_encode: utf8_encode, utf8_decode: utf8_decode, atob: atob, btoa: btoa }; }); // Included from: src/javascript/runtime/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/Runtime', [ "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/EventTarget" ], function(Basic, Dom, EventTarget) { var runtimeConstructors = {}, runtimes = {}; /** Common set of methods and properties for every runtime instance @class Runtime @param {Object} options @param {String} type Sanitized name of the runtime @param {Object} [caps] Set of capabilities that differentiate specified runtime @param {Object} [modeCaps] Set of capabilities that do require specific operational mode @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested */ function Runtime(options, type, caps, modeCaps, preferredMode) { /** Dispatched when runtime is initialized and ready. Results in RuntimeInit on a connected component. @event Init */ /** Dispatched when runtime fails to initialize. Results in RuntimeError on a connected component. @event Error */ var self = this , _shim , _uid = Basic.guid(type + '_') , defaultMode = preferredMode || 'browser' ; options = options || {}; // register runtime in private hash runtimes[_uid] = this; /** Default set of capabilities, which can be redifined later by specific runtime @private @property caps @type Object */ caps = Basic.extend({ // Runtime can: // provide access to raw binary data of the file access_binary: false, // provide access to raw binary data of the image (image extension is optional) access_image_binary: false, // display binary data as thumbs for example display_media: false, // make cross-domain requests do_cors: false, // accept files dragged and dropped from the desktop drag_and_drop: false, // filter files in selection dialog by their extensions filter_by_extension: true, // resize image (and manipulate it raw data of any file in general) resize_image: false, // periodically report how many bytes of total in the file were uploaded (loaded) report_upload_progress: false, // provide access to the headers of http response return_response_headers: false, // support response of specific type, which should be passed as an argument // e.g. runtime.can('return_response_type', 'blob') return_response_type: false, // return http status code of the response return_status_code: true, // send custom http header with the request send_custom_headers: false, // pick up the files from a dialog select_file: false, // select whole folder in file browse dialog select_folder: false, // select multiple files at once in file browse dialog select_multiple: true, // send raw binary data, that is generated after image resizing or manipulation of other kind send_binary_string: false, // send cookies with http request and therefore retain session send_browser_cookies: true, // send data formatted as multipart/form-data send_multipart: true, // slice the file or blob to smaller parts slice_blob: false, // upload file without preloading it to memory, stream it out directly from disk stream_upload: false, // programmatically trigger file browse dialog summon_file_dialog: false, // upload file of specific size, size should be passed as argument // e.g. runtime.can('upload_filesize', '500mb') upload_filesize: true, // initiate http request with specific http method, method should be passed as argument // e.g. runtime.can('use_http_method', 'put') use_http_method: true }, caps); // default to the mode that is compatible with preferred caps if (options.preferred_caps) { defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); } // small extension factory here (is meant to be extended with actual extensions constructors) _shim = (function() { var objpool = {}; return { exec: function(uid, comp, fn, args) { if (_shim[comp]) { if (!objpool[uid]) { objpool[uid] = { context: this, instance: new _shim[comp]() }; } if (objpool[uid].instance[fn]) { return objpool[uid].instance[fn].apply(this, args); } } }, removeInstance: function(uid) { delete objpool[uid]; }, removeAllInstances: function() { var self = this; Basic.each(objpool, function(obj, uid) { if (Basic.typeOf(obj.instance.destroy) === 'function') { obj.instance.destroy.call(obj.context); } self.removeInstance(uid); }); } }; }()); // public methods Basic.extend(this, { /** Specifies whether runtime instance was initialized or not @property initialized @type {Boolean} @default false */ initialized: false, // shims require this flag to stop initialization retries /** Unique ID of the runtime @property uid @type {String} */ uid: _uid, /** Runtime type (e.g. flash, html5, etc) @property type @type {String} */ type: type, /** Runtime (not native one) may operate in browser or client mode. @property mode @private @type {String|Boolean} current mode or false, if none possible */ mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), /** id of the DOM container for the runtime (if available) @property shimid @type {String} */ shimid: _uid + '_container', /** Number of connected clients. If equal to zero, runtime can be destroyed @property clients @type {Number} */ clients: 0, /** Runtime initialization options @property options @type {Object} */ options: options, /** Checks if the runtime has specific capability @method can @param {String} cap Name of capability to check @param {Mixed} [value] If passed, capability should somehow correlate to the value @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) @return {Boolean} true if runtime has such capability and false, if - not */ can: function(cap, value) { var refCaps = arguments[2] || caps; // if cap var is a comma-separated list of caps, convert it to object (key/value) if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { cap = Runtime.parseCaps(cap); } if (Basic.typeOf(cap) === 'object') { for (var key in cap) { if (!this.can(key, cap[key], refCaps)) { return false; } } return true; } // check the individual cap if (Basic.typeOf(refCaps[cap]) === 'function') { return refCaps[cap].call(this, value); } else { return (value === refCaps[cap]); } }, /** Returns container for the runtime as DOM element @method getShimContainer @return {DOMElement} */ getShimContainer: function() { var container, shimContainer = Dom.get(this.shimid); // if no container for shim, create one if (!shimContainer) { container = this.options.container ? Dom.get(this.options.container) : document.body; // create shim container and insert it at an absolute position into the outer container shimContainer = document.createElement('div'); shimContainer.id = this.shimid; shimContainer.className = 'moxie-shim moxie-shim-' + this.type; Basic.extend(shimContainer.style, { position: 'absolute', top: '0px', left: '0px', width: '1px', height: '1px', overflow: 'hidden' }); container.appendChild(shimContainer); container = null; } return shimContainer; }, /** Returns runtime as DOM element (if appropriate) @method getShim @return {DOMElement} */ getShim: function() { return _shim; }, /** Invokes a method within the runtime itself (might differ across the runtimes) @method shimExec @param {Mixed} [] @protected @return {Mixed} Depends on the action and component */ shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return self.getShim().exec.call(this, this.uid, component, action, args); }, /** Operaional interface that is used by components to invoke specific actions on the runtime (is invoked in the scope of component) @method exec @param {Mixed} []* @protected @return {Mixed} Depends on the action and component */ exec: function(component, action) { // this is called in the context of component, not runtime var args = [].slice.call(arguments, 2); if (self[component] && self[component][action]) { return self[component][action].apply(this, args); } return self.shimExec.apply(this, arguments); }, /** Destroys the runtime (removes all events and deletes DOM structures) @method destroy */ destroy: function() { if (!self) { return; // obviously already destroyed } var shimContainer = Dom.get(this.shimid); if (shimContainer) { shimContainer.parentNode.removeChild(shimContainer); } if (_shim) { _shim.removeAllInstances(); } this.unbindAll(); delete runtimes[this.uid]; this.uid = null; // mark this runtime as destroyed _uid = self = _shim = shimContainer = null; } }); // once we got the mode, test against all caps if (this.mode && options.required_caps && !this.can(options.required_caps)) { this.mode = false; } } /** Default order to try different runtime types @property order @type String @static */ Runtime.order = 'html5,flash,silverlight,html4'; /** Retrieves runtime from private hash by it's uid @method getRuntime @private @static @param {String} uid Unique identifier of the runtime @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not */ Runtime.getRuntime = function(uid) { return runtimes[uid] ? runtimes[uid] : false; }; /** Register constructor for the Runtime of new (or perhaps modified) type @method addConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {Function} construct Constructor for the Runtime type */ Runtime.addConstructor = function(type, constructor) { constructor.prototype = EventTarget.instance; runtimeConstructors[type] = constructor; }; /** Get the constructor for the specified type. method getConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @return {Function} Constructor for the Runtime type */ Runtime.getConstructor = function(type) { return runtimeConstructors[type] || null; }; /** Get info about the runtime (uid, type, capabilities) @method getInfo @static @param {String} uid Unique identifier of the runtime @return {Mixed} Info object or null if runtime doesn't exist */ Runtime.getInfo = function(uid) { var runtime = Runtime.getRuntime(uid); if (runtime) { return { uid: runtime.uid, type: runtime.type, mode: runtime.mode, can: function() { return runtime.can.apply(runtime, arguments); } }; } return null; }; /** Convert caps represented by a comma-separated string to the object representation. @method parseCaps @static @param {String} capStr Comma-separated list of capabilities @return {Object} */ Runtime.parseCaps = function(capStr) { var capObj = {}; if (Basic.typeOf(capStr) !== 'string') { return capStr || {}; } Basic.each(capStr.split(','), function(key) { capObj[key] = true; // we assume it to be - true }); return capObj; }; /** Test the specified runtime for specific capabilities. @method can @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {String|Object} caps Set of capabilities to check @return {Boolean} Result of the test */ Runtime.can = function(type, caps) { var runtime , constructor = Runtime.getConstructor(type) , mode ; if (constructor) { runtime = new constructor({ required_caps: caps }); mode = runtime.mode; runtime.destroy(); return !!mode; } return false; }; /** Figure out a runtime that supports specified capabilities. @method thatCan @static @param {String|Object} caps Set of capabilities to check @param {String} [runtimeOrder] Comma-separated list of runtimes to check against @return {String} Usable runtime identifier or null */ Runtime.thatCan = function(caps, runtimeOrder) { var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); for (var i in types) { if (Runtime.can(types[i], caps)) { return types[i]; } } return null; }; /** Figure out an operational mode for the specified set of capabilities. @method getMode @static @param {Object} modeCaps Set of capabilities that depend on particular runtime mode @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for @param {String|Boolean} [defaultMode='browser'] Default mode to use @return {String|Boolean} Compatible operational mode */ Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { var mode = null; if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified defaultMode = 'browser'; } if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { // loop over required caps and check if they do require the same mode Basic.each(requiredCaps, function(value, cap) { if (modeCaps.hasOwnProperty(cap)) { var capMode = modeCaps[cap](value); // make sure we always have an array if (typeof(capMode) === 'string') { capMode = [capMode]; } if (!mode) { mode = capMode; } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { // if cap requires conflicting mode - runtime cannot fulfill required caps return (mode = false); } } }); if (mode) { return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; } else if (mode === false) { return false; } } return defaultMode; }; /** Capability check that always returns true @private @static @return {True} */ Runtime.capTrue = function() { return true; }; /** Capability check that always returns false @private @static @return {False} */ Runtime.capFalse = function() { return false; }; /** Evaluate the expression to boolean value and create a function that always returns it. @private @static @param {Mixed} expr Expression to evaluate @return {Function} Function returning the result of evaluation */ Runtime.capTest = function(expr) { return function() { return !!expr; }; }; return Runtime; }); // Included from: src/javascript/runtime/RuntimeClient.js /** * RuntimeClient.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeClient', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic', 'moxie/runtime/Runtime' ], function(x, Basic, Runtime) { /** Set of methods and properties, required by a component to acquire ability to connect to a runtime @class RuntimeClient */ return function RuntimeClient() { var runtime; Basic.extend(this, { /** Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. Increments number of clients connected to the specified runtime. @method connectRuntime @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites */ connectRuntime: function(options) { var comp = this, ruid; function initialize(items) { var type, constructor; // if we ran out of runtimes if (!items.length) { comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); runtime = null; return; } type = items.shift(); constructor = Runtime.getConstructor(type); if (!constructor) { initialize(items); return; } // try initializing the runtime runtime = new constructor(options); runtime.bind('Init', function() { // mark runtime as initialized runtime.initialized = true; // jailbreak ... setTimeout(function() { runtime.clients++; // this will be triggered on component comp.trigger('RuntimeInit', runtime); }, 1); }); runtime.bind('Error', function() { runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here initialize(items); }); /*runtime.bind('Exception', function() { });*/ // check if runtime managed to pick-up operational mode if (!runtime.mode) { runtime.trigger('Error'); return; } runtime.init(); } // check if a particular runtime was requested if (Basic.typeOf(options) === 'string') { ruid = options; } else if (Basic.typeOf(options.ruid) === 'string') { ruid = options.ruid; } if (ruid) { runtime = Runtime.getRuntime(ruid); if (runtime) { runtime.clients++; return runtime; } else { // there should be a runtime and there's none - weird case throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); } } // initialize a fresh one, that fits runtime list and required features best initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); }, /** Returns the runtime to which the client is currently connected. @method getRuntime @return {Runtime} Runtime or null if client is not connected */ getRuntime: function() { if (runtime && runtime.uid) { return runtime; } runtime = null; // make sure we do not leave zombies rambling around return null; }, /** Disconnects from the runtime. Decrements number of clients connected to the specified runtime. @method disconnectRuntime */ disconnectRuntime: function() { if (runtime && --runtime.clients <= 0) { runtime.destroy(); runtime = null; } } }); }; }); // Included from: src/javascript/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/Blob', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/runtime/RuntimeClient' ], function(Basic, Encode, RuntimeClient) { var blobpool = {}; /** @class Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} blob Object "Native" blob object, as it is represented in the runtime */ function Blob(ruid, blob) { function _sliceDetached(start, end, type) { var blob, data = blobpool[this.uid]; if (Basic.typeOf(data) !== 'string' || !data.length) { return null; // or throw exception } blob = new Blob(null, { type: type, size: end - start }); blob.detach(data.substr(start, blob.size)); return blob; } RuntimeClient.call(this); if (ruid) { this.connectRuntime(ruid); } if (!blob) { blob = {}; } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string blob = { data: blob }; } Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: blob.uid || Basic.guid('uid_'), /** Unique id of the connected runtime, if falsy, then runtime will have to be initialized before this Blob can be used, modified or sent @property ruid @type {String} */ ruid: ruid, /** Size of blob @property size @type {Number} @default 0 */ size: blob.size || 0, /** Mime type of blob @property type @type {String} @default '' */ type: blob.type || '', /** @method slice @param {Number} [start=0] */ slice: function(start, end, type) { if (this.isDetached()) { return _sliceDetached.apply(this, arguments); } return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); }, /** Returns "native" blob object (as it is represented in connected runtime) or null if not found @method getSource @return {Blob} Returns "native" blob object or null if not found */ getSource: function() { if (!blobpool[this.uid]) { return null; } return blobpool[this.uid]; }, /** Detaches blob from any runtime that it depends on and initialize with standalone value @method detach @protected @param {DOMString} [data=''] Standalone value */ detach: function(data) { if (this.ruid) { this.getRuntime().exec.call(this, 'Blob', 'destroy'); this.disconnectRuntime(); this.ruid = null; } data = data || ''; // if dataUrl, convert to binary string var matches = data.match(/^data:([^;]*);base64,/); if (matches) { this.type = matches[1]; data = Encode.atob(data.substring(data.indexOf('base64,') + 7)); } this.size = data.length; blobpool[this.uid] = data; }, /** Checks if blob is standalone (detached of any runtime) @method isDetached @protected @return {Boolean} */ isDetached: function() { return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; }, /** Destroy Blob and free any resources it was using @method destroy */ destroy: function() { this.detach(); delete blobpool[this.uid]; } }); if (blob.data) { this.detach(blob.data); // auto-detach if payload has been passed } else { blobpool[this.uid] = blob; } } return Blob; }); // Included from: src/javascript/file/File.js /** * File.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/File', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/file/Blob' ], function(Basic, Mime, Blob) { /** @class File @extends Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} file Object "Native" file object, as it is represented in the runtime */ function File(ruid, file) { var name, type; if (!file) { // avoid extra errors in case we overlooked something file = {}; } // figure out the type if (file.type && file.type !== '') { type = file.type; } else { type = Mime.getFileMime(file.name); } // sanitize file name or generate new one if (file.name) { name = file.name.replace(/\\/g, '/'); name = name.substr(name.lastIndexOf('/') + 1); } else { var prefix = type.split('/')[0]; name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); if (Mime.extensions[type]) { name += '.' + Mime.extensions[type][0]; // append proper extension if possible } } Blob.apply(this, arguments); Basic.extend(this, { /** File mime type @property type @type {String} @default '' */ type: type || '', /** File name @property name @type {String} @default UID */ name: name || Basic.guid('file_'), /** Relative path to the file inside a directory @property relativePath @type {String} @default '' */ relativePath: '', /** Date of last modification @property lastModifiedDate @type {String} @default now */ lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) }); } File.prototype = Blob.prototype; return File; }); // Included from: src/javascript/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileInput', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/core/utils/Dom', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/core/I18n', 'moxie/file/File', 'moxie/runtime/Runtime', 'moxie/runtime/RuntimeClient' ], function(Basic, Mime, Dom, x, EventTarget, I18n, File, Runtime, RuntimeClient) { /** Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through _XMLHttpRequest_. @class FileInput @constructor @extends EventTarget @uses RuntimeClient @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. @param {Array} [options.accept] Array of mime types to accept. By default accepts all. @param {String} [options.file='file'] Name of the file field (not the filename). @param {Boolean} [options.multiple=false] Enable selection of multiple files. @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode for _browse\_button_. @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. @example <div id="container"> <a id="file-picker" href="javascript:;">Browse...</a> </div> <script> var fileInput = new mOxie.FileInput({ browse_button: 'file-picker', // or document.getElementById('file-picker') container: 'container', accept: [ {title: "Image files", extensions: "jpg,gif,png"} // accept only images ], multiple: true // allow multiple file selection }); fileInput.onchange = function(e) { // do something to files array console.info(e.target.files); // or this.files or fileInput.files }; fileInput.init(); // initialize </script> */ var dispatches = [ /** Dispatched when runtime is connected and file-picker is ready to be used. @event ready @param {Object} event */ 'ready', /** Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. Check [corresponding documentation entry](#method_refresh) for more info. @event refresh @param {Object} event */ /** Dispatched when selection of files in the dialog is complete. @event change @param {Object} event */ 'change', 'cancel', // TODO: might be useful /** Dispatched when mouse cursor enters file-picker area. Can be used to style element accordingly. @event mouseenter @param {Object} event */ 'mouseenter', /** Dispatched when mouse cursor leaves file-picker area. Can be used to style element accordingly. @event mouseleave @param {Object} event */ 'mouseleave', /** Dispatched when functional mouse button is pressed on top of file-picker area. @event mousedown @param {Object} event */ 'mousedown', /** Dispatched when functional mouse button is released on top of file-picker area. @event mouseup @param {Object} event */ 'mouseup' ]; function FileInput(options) { var self = this, container, browseButton, defaults; // if flat argument passed it should be browse_button id if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { options = { browse_button : options }; } // this will help us to find proper default container browseButton = Dom.get(options.browse_button); if (!browseButton) { // browse button is required throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } // figure out the options defaults = { accept: [{ title: I18n.translate('All Files'), extensions: '*' }], name: 'file', multiple: false, required_caps: false, container: browseButton.parentNode || document.body }; options = Basic.extend({}, defaults, options); // convert to object representation if (typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } // normalize accept option (could be list of mime types or array of title/extensions pairs) if (typeof(options.accept) === 'string') { options.accept = Mime.mimes2extList(options.accept); } container = Dom.get(options.container); // make sure we have container if (!container) { container = document.body; } // make container relative, if it's not if (Dom.getStyle(container, 'position') === 'static') { container.style.position = 'relative'; } container = browseButton = null; // IE RuntimeClient.call(self); Basic.extend(self, { /** Unique id of the component @property uid @protected @readOnly @type {String} @default UID */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @protected @type {String} */ ruid: null, /** Unique id of the runtime container. Useful to get hold of it for various manipulations. @property shimid @protected @type {String} */ shimid: null, /** Array of selected mOxie.File objects @property files @type {Array} @default null */ files: null, /** Initializes the file-picker, connects it to runtime and dispatches event ready when done. @method init */ init: function() { self.convertEventPropsToHandlers(dispatches); self.bind('RuntimeInit', function(e, runtime) { self.ruid = runtime.uid; self.shimid = runtime.shimid; self.bind("Ready", function() { self.trigger("Refresh"); }, 999); self.bind("Change", function() { var files = runtime.exec.call(self, 'FileInput', 'getFiles'); self.files = []; Basic.each(files, function(file) { // ignore empty files (IE10 for example hangs if you try to send them via XHR) if (file.size === 0) { return true; } self.files.push(new File(self.ruid, file)); }); }, 999); // re-position and resize shim container self.bind('Refresh', function() { var pos, size, browseButton, shimContainer; browseButton = Dom.get(options.browse_button); shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist if (browseButton) { pos = Dom.getPos(browseButton, Dom.get(options.container)); size = Dom.getSize(browseButton); if (shimContainer) { Basic.extend(shimContainer.style, { top : pos.y + 'px', left : pos.x + 'px', width : size.w + 'px', height : size.h + 'px' }); } } shimContainer = browseButton = null; }); runtime.exec.call(self, 'FileInput', 'init', options); }); // runtime needs: options.required_features, options.runtime_order and options.container self.connectRuntime(Basic.extend({}, options, { required_caps: { select_file: true } })); }, /** Disables file-picker element, so that it doesn't react to mouse clicks. @method disable @param {Boolean} [state=true] Disable component if - true, enable if - false */ disable: function(state) { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); } }, /** Reposition and resize dialog trigger to match the position and size of browse_button element. @method refresh */ refresh: function() { self.trigger("Refresh"); }, /** Destroy component. @method destroy */ destroy: function() { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'destroy'); this.disconnectRuntime(); } if (Basic.typeOf(this.files) === 'array') { // no sense in leaving associated files behind Basic.each(this.files, function(file) { file.destroy(); }); } this.files = null; } }); } FileInput.prototype = EventTarget.instance; return FileInput; }); // Included from: src/javascript/runtime/RuntimeTarget.js /** * RuntimeTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeTarget', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', "moxie/core/EventTarget" ], function(Basic, RuntimeClient, EventTarget) { /** Instance of this class can be used as a target for the events dispatched by shims, when allowing them onto components is for either reason inappropriate @class RuntimeTarget @constructor @protected @extends EventTarget */ function RuntimeTarget() { this.uid = Basic.guid('uid_'); RuntimeClient.call(this); this.destroy = function() { this.disconnectRuntime(); this.unbindAll(); }; } RuntimeTarget.prototype = EventTarget.instance; return RuntimeTarget; }); // Included from: src/javascript/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReader', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/file/Blob', 'moxie/file/File', 'moxie/runtime/RuntimeTarget' ], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) { /** Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) interface. Where possible uses native FileReader, where - not falls back to shims. @class FileReader @constructor FileReader @extends EventTarget @uses RuntimeClient */ var dispatches = [ /** Dispatched when the read starts. @event loadstart @param {Object} event */ 'loadstart', /** Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). @event progress @param {Object} event */ 'progress', /** Dispatched when the read has successfully completed. @event load @param {Object} event */ 'load', /** Dispatched when the read has been aborted. For instance, by invoking the abort() method. @event abort @param {Object} event */ 'abort', /** Dispatched when the read has failed. @event error @param {Object} event */ 'error', /** Dispatched when the request has completed (either in success or failure). @event loadend @param {Object} event */ 'loadend' ]; function FileReader() { var self = this, _fr; Basic.extend(this, { /** UID of the component instance. @property uid @type {String} */ uid: Basic.guid('uid_'), /** Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING and FileReader.DONE. @property readyState @type {Number} @default FileReader.EMPTY */ readyState: FileReader.EMPTY, /** Result of the successful read operation. @property result @type {String} */ result: null, /** Stores the error of failed asynchronous read operation. @property error @type {DOMError} */ error: null, /** Initiates reading of File/Blob object contents to binary string. @method readAsBinaryString @param {Blob|File} blob Object to preload */ readAsBinaryString: function(blob) { _read.call(this, 'readAsBinaryString', blob); }, /** Initiates reading of File/Blob object contents to dataURL string. @method readAsDataURL @param {Blob|File} blob Object to preload */ readAsDataURL: function(blob) { _read.call(this, 'readAsDataURL', blob); }, /** Initiates reading of File/Blob object contents to string. @method readAsText @param {Blob|File} blob Object to preload */ readAsText: function(blob) { _read.call(this, 'readAsText', blob); }, /** Aborts preloading process. @method abort */ abort: function() { this.result = null; if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { return; } else if (this.readyState === FileReader.LOADING) { this.readyState = FileReader.DONE; } if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'abort'); } this.trigger('abort'); this.trigger('loadend'); }, /** Destroy component and release resources. @method destroy */ destroy: function() { this.abort(); if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'destroy'); _fr.disconnectRuntime(); } self = _fr = null; } }); function _read(op, blob) { _fr = new RuntimeTarget(); function error(err) { self.readyState = FileReader.DONE; self.error = err; self.trigger('error'); loadEnd(); } function loadEnd() { _fr.destroy(); _fr = null; self.trigger('loadend'); } function exec(runtime) { _fr.bind('Error', function(e, err) { error(err); }); _fr.bind('Progress', function(e) { self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); }); _fr.bind('Load', function(e) { self.readyState = FileReader.DONE; self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); loadEnd(); }); runtime.exec.call(_fr, 'FileReader', 'read', op, blob); } this.convertEventPropsToHandlers(dispatches); if (this.readyState === FileReader.LOADING) { return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR)); } this.readyState = FileReader.LOADING; this.trigger('loadstart'); // if source is o.Blob/o.File if (blob instanceof Blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsText': case 'readAsBinaryString': this.result = src; break; case 'readAsDataURL': this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); break; } this.readyState = FileReader.DONE; this.trigger('load'); loadEnd(); } else { exec(_fr.connectRuntime(blob.ruid)); } } else { error(new x.DOMException(x.DOMException.NOT_FOUND_ERR)); } } } /** Initial FileReader state @property EMPTY @type {Number} @final @static @default 0 */ FileReader.EMPTY = 0; /** FileReader switches to this state when it is preloading the source @property LOADING @type {Number} @final @static @default 1 */ FileReader.LOADING = 1; /** Preloading is complete, this is a final state @property DONE @type {Number} @final @static @default 2 */ FileReader.DONE = 2; FileReader.prototype = EventTarget.instance; return FileReader; }); // Included from: src/javascript/core/utils/Url.js /** * Url.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Url', [], function() { /** Parse url into separate components and fill in absent parts with parts from current url, based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js @method parseUrl @for Utils @static @param {String} url Url to parse (defaults to empty string if undefined) @return {Object} Hash containing extracted uri components */ var parseUrl = function(url, currentUrl) { var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] , i = key.length , ports = { http: 80, https: 443 } , uri = {} , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ , m = regex.exec(url || '') ; while (i--) { if (m[i]) { uri[key[i]] = m[i]; } } // when url is relative, we set the origin and the path ourselves if (!uri.scheme) { // come up with defaults if (!currentUrl || typeof(currentUrl) === 'string') { currentUrl = parseUrl(currentUrl || document.location.href); } uri.scheme = currentUrl.scheme; uri.host = currentUrl.host; uri.port = currentUrl.port; var path = ''; // for urls without trailing slash we need to figure out the path if (/^[^\/]/.test(uri.path)) { path = currentUrl.path; // if path ends with a filename, strip it if (!/(\/|\/[^\.]+)$/.test(path)) { path = path.replace(/\/[^\/]+$/, '/'); } else { path += '/'; } } uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir } if (!uri.port) { uri.port = ports[uri.scheme] || 80; } uri.port = parseInt(uri.port, 10); if (!uri.path) { uri.path = "/"; } delete uri.source; return uri; }; /** Resolve url - among other things will turn relative url to absolute @method resolveUrl @static @param {String} url Either absolute or relative @return {String} Resolved, absolute url */ var resolveUrl = function(url) { var ports = { // we ignore default ports http: 80, https: 443 } , urlp = parseUrl(url) ; return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); }; /** Check if specified url has the same origin as the current document @method hasSameOrigin @param {String|Object} url @return {Boolean} */ var hasSameOrigin = function(url) { function origin(url) { return [url.scheme, url.host, url.port].join('/'); } if (typeof url === 'string') { url = parseUrl(url); } return origin(parseUrl()) === origin(url); }; return { parseUrl: parseUrl, resolveUrl: resolveUrl, hasSameOrigin: hasSameOrigin }; }); // Included from: src/javascript/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReaderSync', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', 'moxie/core/utils/Encode' ], function(Basic, RuntimeClient, Encode) { /** Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, but probably < 1mb). Not meant to be used directly by user. @class FileReaderSync @private @constructor */ return function() { RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), readAsBinaryString: function(blob) { return _read.call(this, 'readAsBinaryString', blob); }, readAsDataURL: function(blob) { return _read.call(this, 'readAsDataURL', blob); }, /*readAsArrayBuffer: function(blob) { return _read.call(this, 'readAsArrayBuffer', blob); },*/ readAsText: function(blob) { return _read.call(this, 'readAsText', blob); } }); function _read(op, blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsBinaryString': return src; case 'readAsDataURL': return 'data:' + blob.type + ';base64,' + Encode.btoa(src); case 'readAsText': var txt = ''; for (var i = 0, length = src.length; i < length; i++) { txt += String.fromCharCode(src[i]); } return txt; } } else { var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); this.disconnectRuntime(); return result; } } }; }); // Included from: src/javascript/xhr/FormData.js /** * FormData.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/FormData", [ "moxie/core/Exceptions", "moxie/core/utils/Basic", "moxie/file/Blob" ], function(x, Basic, Blob) { /** FormData @class FormData @constructor */ function FormData() { var _blob, _fields = []; Basic.extend(this, { /** Append another key-value pair to the FormData object @method append @param {String} name Name for the new field @param {String|Blob|Array|Object} value Value for the field */ append: function(name, value) { var self = this, valueType = Basic.typeOf(value); // according to specs value might be either Blob or String if (value instanceof Blob) { _blob = { name: name, value: value // unfortunately we can only send single Blob in one FormData }; } else if ('array' === valueType) { name += '[]'; Basic.each(value, function(value) { self.append(name, value); }); } else if ('object' === valueType) { Basic.each(value, function(value, key) { self.append(name + '[' + key + ']', value); }); } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { self.append(name, "false"); } else { _fields.push({ name: name, value: value.toString() }); } }, /** Checks if FormData contains Blob. @method hasBlob @return {Boolean} */ hasBlob: function() { return !!this.getBlob(); }, /** Retrieves blob. @method getBlob @return {Object} Either Blob if found or null */ getBlob: function() { return _blob && _blob.value || null; }, /** Retrieves blob field name. @method getBlobName @return {String} Either Blob field name or null */ getBlobName: function() { return _blob && _blob.name || null; }, /** Loop over the fields in FormData and invoke the callback for each of them. @method each @param {Function} cb Callback to call for each field */ each: function(cb) { Basic.each(_fields, function(field) { cb(field.value, field.name); }); if (_blob) { cb(_blob.value, _blob.name); } }, destroy: function() { _blob = null; _fields = []; } }); } return FormData; }); // Included from: src/javascript/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/XMLHttpRequest", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/core/EventTarget", "moxie/core/utils/Encode", "moxie/core/utils/Url", "moxie/runtime/Runtime", "moxie/runtime/RuntimeTarget", "moxie/file/Blob", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/core/utils/Env", "moxie/core/utils/Mime" ], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { var httpCode = { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', 200: 'OK', 201: 'Created', 202: 'Accepted', 203: 'Non-Authoritative Information', 204: 'No Content', 205: 'Reset Content', 206: 'Partial Content', 207: 'Multi-Status', 226: 'IM Used', 300: 'Multiple Choices', 301: 'Moved Permanently', 302: 'Found', 303: 'See Other', 304: 'Not Modified', 305: 'Use Proxy', 306: 'Reserved', 307: 'Temporary Redirect', 400: 'Bad Request', 401: 'Unauthorized', 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable', 407: 'Proxy Authentication Required', 408: 'Request Timeout', 409: 'Conflict', 410: 'Gone', 411: 'Length Required', 412: 'Precondition Failed', 413: 'Request Entity Too Large', 414: 'Request-URI Too Long', 415: 'Unsupported Media Type', 416: 'Requested Range Not Satisfiable', 417: 'Expectation Failed', 422: 'Unprocessable Entity', 423: 'Locked', 424: 'Failed Dependency', 426: 'Upgrade Required', 500: 'Internal Server Error', 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', 506: 'Variant Also Negotiates', 507: 'Insufficient Storage', 510: 'Not Extended' }; function XMLHttpRequestUpload() { this.uid = Basic.guid('uid_'); } XMLHttpRequestUpload.prototype = EventTarget.instance; /** Implementation of XMLHttpRequest @class XMLHttpRequest @constructor @uses RuntimeClient @extends EventTarget */ var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons) var NATIVE = 1, RUNTIME = 2; function XMLHttpRequest() { var self = this, // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible props = { /** The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. @property timeout @type Number @default 0 */ timeout: 0, /** Current state, can take following values: UNSENT (numeric value 0) The object has been constructed. OPENED (numeric value 1) The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. HEADERS_RECEIVED (numeric value 2) All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. LOADING (numeric value 3) The response entity body is being received. DONE (numeric value 4) @property readyState @type Number @default 0 (UNSENT) */ readyState: XMLHttpRequest.UNSENT, /** True when user credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. @property withCredentials @type Boolean @default false */ withCredentials: false, /** Returns the HTTP status code. @property status @type Number @default 0 */ status: 0, /** Returns the HTTP status text. @property statusText @type String */ statusText: "", /** Returns the response type. Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". @property responseType @type String */ responseType: "", /** Returns the document response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "document". @property responseXML @type Document */ responseXML: null, /** Returns the text response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "text". @property responseText @type String */ responseText: null, /** Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). Can become: ArrayBuffer, Blob, Document, JSON, Text @property response @type Mixed */ response: null }, _async = true, _url, _method, _headers = {}, _user, _password, _encoding = null, _mimeType = null, // flags _sync_flag = false, _send_flag = false, _upload_events_flag = false, _upload_complete_flag = false, _error_flag = false, _same_origin_flag = false, // times _start_time, _timeoutset_time, _finalMime = null, _finalCharset = null, _options = {}, _xhr, _responseHeaders = '', _responseHeadersBag ; Basic.extend(this, props, { /** Unique id of the component @property uid @type String */ uid: Basic.guid('uid_'), /** Target for Upload events @property upload @type XMLHttpRequestUpload */ upload: new XMLHttpRequestUpload(), /** Sets the request method, request URL, synchronous flag, request username, and request password. Throws a "SyntaxError" exception if one of the following is true: method is not a valid HTTP method. url cannot be resolved. url contains the "user:password" format in the userinfo production. Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. Throws an "InvalidAccessError" exception if one of the following is true: Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. There is an associated XMLHttpRequest document and either the timeout attribute is not zero, the withCredentials attribute is true, or the responseType attribute is not the empty string. @method open @param {String} method HTTP method to use on request @param {String} url URL to request @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. @param {String} [user] Username to use in HTTP authentication process on server-side @param {String} [password] Password to use in HTTP authentication process on server-side */ open: function(method, url, async, user, password) { var urlp; // first two arguments are required if (!method || !url) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3 if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { _method = method.toUpperCase(); } // 4 - allowing these methods poses a security risk if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { throw new x.DOMException(x.DOMException.SECURITY_ERR); } // 5 url = Encode.utf8_encode(url); // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". urlp = Url.parseUrl(url); _same_origin_flag = Url.hasSameOrigin(urlp); // 7 - manually build up absolute url _url = Url.resolveUrl(url); // 9-10, 12-13 if ((user || password) && !_same_origin_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } _user = user || urlp.user; _password = password || urlp.pass; // 11 _async = async || true; if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 14 - terminate abort() // 15 - terminate send() // 18 _sync_flag = !_async; _send_flag = false; _headers = {}; _reset.call(this); // 19 _p('readyState', XMLHttpRequest.OPENED); // 20 this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers this.dispatchEvent('readystatechange'); }, /** Appends an header to the list of author request headers, or if header is already in the list of author request headers, combines its value with value. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value is not a valid HTTP header field value. @method setRequestHeader @param {String} header @param {String|Number} value */ setRequestHeader: function(header, value) { var uaHeaders = [ // these headers are controlled by the user agent "accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via" ]; // 1-2 if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 4 /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); }*/ header = Basic.trim(header).toLowerCase(); // setting of proxy-* and sec-* headers is prohibited by spec if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { return false; } // camelize // browsers lowercase header names (at least for custom ones) // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); if (!_headers[header]) { _headers[header] = value; } else { // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) _headers[header] += ', ' + value; } return true; }, /** Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. @method getAllResponseHeaders @return {String} reponse headers or empty string */ getAllResponseHeaders: function() { return _responseHeaders || ''; }, /** Returns the header field value from the response of which the field name matches header, unless the field name is Set-Cookie or Set-Cookie2. @method getResponseHeader @param {String} header @return {String} value(s) for the specified header or null */ getResponseHeader: function(header) { header = header.toLowerCase(); if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { return null; } if (_responseHeaders && _responseHeaders !== '') { // if we didn't parse response headers until now, do it and keep for later if (!_responseHeadersBag) { _responseHeadersBag = {}; Basic.each(_responseHeaders.split(/\r\n/), function(line) { var pair = line.split(/:\s+/); if (pair.length === 2) { // last line might be empty, omit pair[0] = Basic.trim(pair[0]); // just in case _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form header: pair[0], value: Basic.trim(pair[1]) }; } }); } if (_responseHeadersBag.hasOwnProperty(header)) { return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; } } return null; }, /** Sets the Content-Type header for the response to mime. Throws an "InvalidStateError" exception if the state is LOADING or DONE. Throws a "SyntaxError" exception if mime is not a valid media type. @method overrideMimeType @param String mime Mime type to set */ overrideMimeType: function(mime) { var matches, charset; // 1 if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 mime = Basic.trim(mime.toLowerCase()); if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { mime = matches[1]; if (matches[2]) { charset = matches[2]; } } if (!Mime.mimes[mime]) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3-4 _finalMime = mime; _finalCharset = charset; }, /** Initiates the request. The optional argument provides the request entity body. The argument is ignored if request method is GET or HEAD. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. @method send @param {Blob|Document|String|FormData} [data] Request entity body @param {Object} [options] Set of requirements and pre-requisities for runtime initialization */ send: function(data, options) { if (Basic.typeOf(options) === 'string') { _options = { ruid: options }; } else if (!options) { _options = {}; } else { _options = options; } this.convertEventPropsToHandlers(dispatches); this.upload.convertEventPropsToHandlers(dispatches); // 1-2 if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 // sending Blob if (data instanceof Blob) { _options.ruid = data.ruid; _mimeType = data.type || 'application/octet-stream'; } // FormData else if (data instanceof FormData) { if (data.hasBlob()) { var blob = data.getBlob(); _options.ruid = blob.ruid; _mimeType = blob.type || 'application/octet-stream'; } } // DOMString else if (typeof data === 'string') { _encoding = 'UTF-8'; _mimeType = 'text/plain;charset=UTF-8'; // data should be converted to Unicode and encoded as UTF-8 data = Encode.utf8_encode(data); } // if withCredentials not set, but requested, set it automatically if (!this.withCredentials) { this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; } // 4 - storage mutex // 5 _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP // 6 _error_flag = false; // 7 _upload_complete_flag = !data; // 8 - Asynchronous steps if (!_sync_flag) { // 8.1 _send_flag = true; // 8.2 // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr // 8.3 //if (!_upload_complete_flag) { // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr //} } // 8.5 - Return the send() method call, but continue running the steps in this algorithm. _doXHR.call(this, data); }, /** Cancels any network activity. @method abort */ abort: function() { _error_flag = true; _sync_flag = false; if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { _p('readyState', XMLHttpRequest.DONE); _send_flag = false; if (_xhr) { _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); } else { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _upload_complete_flag = true; } else { _p('readyState', XMLHttpRequest.UNSENT); } }, destroy: function() { if (_xhr) { if (Basic.typeOf(_xhr.destroy) === 'function') { _xhr.destroy(); } _xhr = null; } this.unbindAll(); if (this.upload) { this.upload.unbindAll(); this.upload = null; } } }); /* this is nice, but maybe too lengthy // if supported by JS version, set getters/setters for specific properties o.defineProperty(this, 'readyState', { configurable: false, get: function() { return _p('readyState'); } }); o.defineProperty(this, 'timeout', { configurable: false, get: function() { return _p('timeout'); }, set: function(value) { if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // timeout still should be measured relative to the start time of request _timeoutset_time = (new Date).getTime(); _p('timeout', value); } }); // the withCredentials attribute has no effect when fetching same-origin resources o.defineProperty(this, 'withCredentials', { configurable: false, get: function() { return _p('withCredentials'); }, set: function(value) { // 1-2 if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3-4 if (_anonymous_flag || _sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 5 _p('withCredentials', value); } }); o.defineProperty(this, 'status', { configurable: false, get: function() { return _p('status'); } }); o.defineProperty(this, 'statusText', { configurable: false, get: function() { return _p('statusText'); } }); o.defineProperty(this, 'responseType', { configurable: false, get: function() { return _p('responseType'); }, set: function(value) { // 1 if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 3 _p('responseType', value.toLowerCase()); } }); o.defineProperty(this, 'responseText', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'text'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseText'); } }); o.defineProperty(this, 'responseXML', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'document'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseXML'); } }); o.defineProperty(this, 'response', { configurable: false, get: function() { if (!!~o.inArray(_p('responseType'), ['', 'text'])) { if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { return ''; } } if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { return null; } return _p('response'); } }); */ function _p(prop, value) { if (!props.hasOwnProperty(prop)) { return; } if (arguments.length === 1) { // get return Env.can('define_property') ? props[prop] : self[prop]; } else { // set if (Env.can('define_property')) { props[prop] = value; } else { self[prop] = value; } } } /* function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 return str.toLowerCase(); } */ function _doXHR(data) { var self = this; _start_time = new Date().getTime(); _xhr = new RuntimeTarget(); function loadEnd() { if (_xhr) { // it could have been destroyed by now _xhr.destroy(); _xhr = null; } self.dispatchEvent('loadend'); self = null; } function exec(runtime) { _xhr.bind('LoadStart', function(e) { _p('readyState', XMLHttpRequest.LOADING); self.dispatchEvent('readystatechange'); self.dispatchEvent(e); if (_upload_events_flag) { self.upload.dispatchEvent(e); } }); _xhr.bind('Progress', function(e) { if (_p('readyState') !== XMLHttpRequest.LOADING) { _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) self.dispatchEvent('readystatechange'); } self.dispatchEvent(e); }); _xhr.bind('UploadProgress', function(e) { if (_upload_events_flag) { self.upload.dispatchEvent({ type: 'progress', lengthComputable: false, total: e.total, loaded: e.loaded }); } }); _xhr.bind('Load', function(e) { _p('readyState', XMLHttpRequest.DONE); _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); _p('statusText', httpCode[_p('status')] || ""); _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { _p('responseText', _p('response')); } else if (_p('responseType') === 'document') { _p('responseXML', _p('response')); } _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); self.dispatchEvent('readystatechange'); if (_p('status') > 0) { // status 0 usually means that server is unreachable if (_upload_events_flag) { self.upload.dispatchEvent(e); } self.dispatchEvent(e); } else { _error_flag = true; self.dispatchEvent('error'); } loadEnd(); }); _xhr.bind('Abort', function(e) { self.dispatchEvent(e); loadEnd(); }); _xhr.bind('Error', function(e) { _error_flag = true; _p('readyState', XMLHttpRequest.DONE); self.dispatchEvent('readystatechange'); _upload_complete_flag = true; self.dispatchEvent(e); loadEnd(); }); runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { url: _url, method: _method, async: _async, user: _user, password: _password, headers: _headers, mimeType: _mimeType, encoding: _encoding, responseType: self.responseType, withCredentials: self.withCredentials, options: _options }, data); } // clarify our requirements if (typeof(_options.required_caps) === 'string') { _options.required_caps = Runtime.parseCaps(_options.required_caps); } _options.required_caps = Basic.extend({}, _options.required_caps, { return_response_type: self.responseType }); if (data instanceof FormData) { _options.required_caps.send_multipart = true; } if (!_same_origin_flag) { _options.required_caps.do_cors = true; } if (_options.ruid) { // we do not need to wait if we can connect directly exec(_xhr.connectRuntime(_options)); } else { _xhr.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); _xhr.bind('RuntimeError', function(e, err) { self.dispatchEvent('RuntimeError', err); }); _xhr.connectRuntime(_options); } } function _reset() { _p('responseText', ""); _p('responseXML', null); _p('response', null); _p('status', 0); _p('statusText', ""); _start_time = _timeoutset_time = null; } } XMLHttpRequest.UNSENT = 0; XMLHttpRequest.OPENED = 1; XMLHttpRequest.HEADERS_RECEIVED = 2; XMLHttpRequest.LOADING = 3; XMLHttpRequest.DONE = 4; XMLHttpRequest.prototype = EventTarget.instance; return XMLHttpRequest; }); // Included from: src/javascript/runtime/flash/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** Defines constructor for Flash runtime. @class moxie/runtime/flash/Runtime @private */ define("moxie/runtime/flash/Runtime", [ "moxie/core/utils/Basic", "moxie/core/utils/Env", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/runtime/Runtime" ], function(Basic, Env, Dom, x, Runtime) { var type = 'flash', extensions = {}; /** Get the version of the Flash Player @method getShimVersion @private @return {Number} Flash Player version */ function getShimVersion() { var version; try { version = navigator.plugins['Shockwave Flash']; version = version.description; } catch (e1) { try { version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); } catch (e2) { version = '0.0'; } } version = version.match(/\d+/g); return parseFloat(version[0] + '.' + version[1]); } /** Constructor for the Flash Runtime @class FlashRuntime @extends Runtime */ function FlashRuntime(options) { var I = this, initTimer; options = Basic.extend({ swf_url: Env.swf_url }, options); Runtime.call(this, options, type, { access_binary: function(value) { return value && I.mode === 'browser'; }, access_image_binary: function(value) { return value && I.mode === 'browser'; }, display_media: Runtime.capTrue, do_cors: Runtime.capTrue, drag_and_drop: false, report_upload_progress: function() { return I.mode === 'client'; }, resize_image: Runtime.capTrue, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; }, return_status_code: function(code) { return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); }, select_file: Runtime.capTrue, select_multiple: Runtime.capTrue, send_binary_string: function(value) { return value && I.mode === 'browser'; }, send_browser_cookies: function(value) { return value && I.mode === 'browser'; }, send_custom_headers: function(value) { return value && I.mode === 'browser'; }, send_multipart: Runtime.capTrue, slice_blob: function(value) { return value && I.mode === 'browser'; }, stream_upload: function(value) { return value && I.mode === 'browser'; }, summon_file_dialog: false, upload_filesize: function(size) { return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; }, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }, { // capabilities that require specific mode access_binary: function(value) { return value ? 'browser' : 'client'; }, access_image_binary: function(value) { return value ? 'browser' : 'client'; }, report_upload_progress: function(value) { return value ? 'browser' : 'client'; }, return_response_type: function(responseType) { return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; }, return_status_code: function(code) { return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; }, send_binary_string: function(value) { return value ? 'browser' : 'client'; }, send_browser_cookies: function(value) { return value ? 'browser' : 'client'; }, send_custom_headers: function(value) { return value ? 'browser' : 'client'; }, stream_upload: function(value) { return value ? 'client' : 'browser'; }, upload_filesize: function(size) { return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; } }, 'client'); // minimal requirement for Flash Player version if (getShimVersion() < 10) { this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before } Basic.extend(this, { getShim: function() { return Dom.get(this.uid); }, shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return I.getShim().exec(this.uid, component, action, args); }, init: function() { var html, el, container; container = this.getShimContainer(); // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) Basic.extend(container.style, { position: 'absolute', top: '-8px', left: '-8px', width: '9px', height: '9px', overflow: 'hidden' }); // insert flash object html = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + options.swf_url + '" '; if (Env.browser === 'IE') { html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '; } html += 'width="100%" height="100%" style="outline:0">' + '<param name="movie" value="' + options.swf_url + '" />' + '<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + Env.global_event_dispatcher + '" />' + '<param name="wmode" value="transparent" />' + '<param name="allowscriptaccess" value="always" />' + '</object>'; if (Env.browser === 'IE') { el = document.createElement('div'); container.appendChild(el); el.outerHTML = html; el = container = null; // just in case } else { container.innerHTML = html; } // Init is dispatched by the shim initTimer = setTimeout(function() { if (I && !I.initialized) { // runtime might be already destroyed by this moment I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); } }, 5000); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); clearTimeout(initTimer); // initialization check might be still onwait options = initTimer = destroy = I = null; }; }(this.destroy)) }, extensions); } Runtime.addConstructor(type, FlashRuntime); return extensions; }); // Included from: src/javascript/runtime/flash/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/Blob @private */ define("moxie/runtime/flash/file/Blob", [ "moxie/runtime/flash/Runtime", "moxie/file/Blob" ], function(extensions, Blob) { var FlashBlob = { slice: function(blob, start, end, type) { var self = this.getRuntime(); if (start < 0) { start = Math.max(blob.size + start, 0); } else if (start > 0) { start = Math.min(start, blob.size); } if (end < 0) { end = Math.max(blob.size + end, 0); } else if (end > 0) { end = Math.min(end, blob.size); } blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); if (blob) { blob = new Blob(self.uid, blob); } return blob; } }; return (extensions.Blob = FlashBlob); }); // Included from: src/javascript/runtime/flash/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileInput @private */ define("moxie/runtime/flash/file/FileInput", [ "moxie/runtime/flash/Runtime" ], function(extensions) { var FileInput = { init: function(options) { this.getRuntime().shimExec.call(this, 'FileInput', 'init', { name: options.name, accept: options.accept, multiple: options.multiple }); this.trigger('ready'); } }; return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/flash/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReader @private */ define("moxie/runtime/flash/file/FileReader", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { var _result = ''; function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReader = { read: function(op, blob) { var target = this, self = target.getRuntime(); // special prefix for DataURL read mode if (op === 'readAsDataURL') { _result = 'data:' + (blob.type || '') + ';base64,'; } target.bind('Progress', function(e, data) { if (data) { _result += _formatData(data, op); } }); return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); }, getResult: function() { return _result; }, destroy: function() { _result = null; } }; return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/flash/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReaderSync @private */ define("moxie/runtime/flash/file/FileReaderSync", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReaderSync = { read: function(op, blob) { var result, self = this.getRuntime(); result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); if (!result) { return null; // or throw ex } // special prefix for DataURL read mode if (op === 'readAsDataURL') { result = 'data:' + (blob.type || '') + ';base64,' + result; } return _formatData(result, op, blob.type); } }; return (extensions.FileReaderSync = FileReaderSync); }); // Included from: src/javascript/runtime/Transporter.js /** * Transporter.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/runtime/Transporter", [ "moxie/core/utils/Basic", "moxie/core/utils/Encode", "moxie/runtime/RuntimeClient", "moxie/core/EventTarget" ], function(Basic, Encode, RuntimeClient, EventTarget) { function Transporter() { var mod, _runtime, _data, _size, _pos, _chunk_size; RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), state: Transporter.IDLE, result: null, transport: function(data, type, options) { var self = this; options = Basic.extend({ chunk_size: 204798 }, options); // should divide by three, base64 requires this if ((mod = options.chunk_size % 3)) { options.chunk_size += 3 - mod; } _chunk_size = options.chunk_size; _reset.call(this); _data = data; _size = data.length; if (Basic.typeOf(options) === 'string' || options.ruid) { _run.call(self, type, this.connectRuntime(options)); } else { // we require this to run only once var cb = function(e, runtime) { self.unbind("RuntimeInit", cb); _run.call(self, type, runtime); }; this.bind("RuntimeInit", cb); this.connectRuntime(options); } }, abort: function() { var self = this; self.state = Transporter.IDLE; if (_runtime) { _runtime.exec.call(self, 'Transporter', 'clear'); self.trigger("TransportingAborted"); } _reset.call(self); }, destroy: function() { this.unbindAll(); _runtime = null; this.disconnectRuntime(); _reset.call(this); } }); function _reset() { _size = _pos = 0; _data = this.result = null; } function _run(type, runtime) { var self = this; _runtime = runtime; //self.unbind("RuntimeInit"); self.bind("TransportingProgress", function(e) { _pos = e.loaded; if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { _transport.call(self); } }, 999); self.bind("TransportingComplete", function() { _pos = _size; self.state = Transporter.DONE; _data = null; // clean a bit self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); }, 999); self.state = Transporter.BUSY; self.trigger("TransportingStarted"); _transport.call(self); } function _transport() { var self = this, chunk, bytesLeft = _size - _pos; if (_chunk_size > bytesLeft) { _chunk_size = bytesLeft; } chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); } } Transporter.IDLE = 0; Transporter.BUSY = 1; Transporter.DONE = 2; Transporter.prototype = EventTarget.instance; return Transporter; }); // Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/xhr/XMLHttpRequest @private */ define("moxie/runtime/flash/xhr/XMLHttpRequest", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Basic", "moxie/file/Blob", "moxie/file/File", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/runtime/Transporter" ], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) { var XMLHttpRequest = { send: function(meta, data) { var target = this, self = target.getRuntime(); function send() { meta.transport = self.mode; self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); } function appendBlob(name, blob) { self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); data = null; send(); } function attachBlob(blob, cb) { var tr = new Transporter(); tr.bind("TransportingComplete", function() { cb(this.result); }); tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); } // copy over the headers if any if (!Basic.isEmptyObj(meta.headers)) { Basic.each(meta.headers, function(value, header) { self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object }); } // transfer over multipart params and blob itself if (data instanceof FormData) { var blobField; data.each(function(value, name) { if (value instanceof Blob) { blobField = name; } else { self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); } }); if (!data.hasBlob()) { data = null; send(); } else { var blob = data.getBlob(); if (blob.isDetached()) { attachBlob(blob, function(attachedBlob) { blob.destroy(); appendBlob(blobField, attachedBlob); }); } else { appendBlob(blobField, blob); } } } else if (data instanceof Blob) { if (data.isDetached()) { attachBlob(data, function(attachedBlob) { data.destroy(); data = attachedBlob.uid; send(); }); } else { data = data.uid; send(); } } else { send(); } }, getResponse: function(responseType) { var frs, blob, self = this.getRuntime(); blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); if (blob) { blob = new File(self.uid, blob); if ('blob' === responseType) { return blob; } try { frs = new FileReaderSync(); if (!!~Basic.inArray(responseType, ["", "text"])) { return frs.readAsText(blob); } else if ('json' === responseType && !!window.JSON) { return JSON.parse(frs.readAsText(blob)); } } finally { blob.destroy(); } } return null; }, abort: function(upload_complete_flag) { var self = this.getRuntime(); self.shimExec.call(this, 'XMLHttpRequest', 'abort'); this.dispatchEvent('readystatechange'); // this.dispatchEvent('progress'); this.dispatchEvent('abort'); //if (!upload_complete_flag) { // this.dispatchEvent('uploadprogress'); //} } }; return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/html4/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML4 runtime. @class moxie/runtime/html4/Runtime @private */ define("moxie/runtime/html4/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = 'html4', extensions = {}; function Html4Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; Runtime.call(this, options, type, { access_binary: Test(window.FileReader || window.File && File.getAsDataURL), access_image_binary: false, display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))), do_cors: false, drag_and_drop: false, filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); }()), resize_image: function() { return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); }, report_upload_progress: false, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !!~Basic.inArray(responseType, ['text', 'document', '']); }, return_status_code: function(code) { return !Basic.arrayDiff(code, [200, 404]); }, select_file: function() { return Env.can('use_fileinput'); }, select_multiple: false, send_binary_string: false, send_custom_headers: false, send_multipart: true, slice_blob: false, stream_upload: function() { return I.can('select_file'); }, summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... return (Env.browser === 'Firefox' && Env.version >= 4) || (Env.browser === 'Opera' && Env.version >= 12) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); }()), upload_filesize: True, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html4Runtime); return extensions; }); // Included from: src/javascript/core/utils/Events.js /** * Events.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Events', [ 'moxie/core/utils/Basic' ], function(Basic) { var eventhash = {}, uid = 'moxie_' + Basic.guid(); // IE W3C like event funcs function preventDefault() { this.returnValue = false; } function stopPropagation() { this.cancelBubble = true; } /** Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry (@see removeEvent). @method addEvent @for Utils @static @param {Object} obj DOM element like object to add handler to. @param {String} name Name to add event listener to. @param {Function} callback Function to call when event occurs. @param {String} [key] that might be used to add specifity to the event record. */ var addEvent = function(obj, name, callback, key) { var func, events; name = name.toLowerCase(); // Add event listener if (obj.addEventListener) { func = callback; obj.addEventListener(name, func, false); } else if (obj.attachEvent) { func = function() { var evt = window.event; if (!evt.target) { evt.target = evt.srcElement; } evt.preventDefault = preventDefault; evt.stopPropagation = stopPropagation; callback(evt); }; obj.attachEvent('on' + name, func); } // Log event handler to objects internal mOxie registry if (!obj[uid]) { obj[uid] = Basic.guid(); } if (!eventhash.hasOwnProperty(obj[uid])) { eventhash[obj[uid]] = {}; } events = eventhash[obj[uid]]; if (!events.hasOwnProperty(name)) { events[name] = []; } events[name].push({ func: func, orig: callback, // store original callback for IE key: key }); }; /** Remove event handler from the specified object. If third argument (callback) is not specified remove all events with the specified name. @method removeEvent @static @param {Object} obj DOM element to remove event listener(s) from. @param {String} name Name of event listener to remove. @param {Function|String} [callback] might be a callback or unique key to match. */ var removeEvent = function(obj, name, callback) { var type, undef; name = name.toLowerCase(); if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { type = eventhash[obj[uid]][name]; } else { return; } for (var i = type.length - 1; i >= 0; i--) { // undefined or not, key should match if (type[i].orig === callback || type[i].key === callback) { if (obj.removeEventListener) { obj.removeEventListener(name, type[i].func, false); } else if (obj.detachEvent) { obj.detachEvent('on'+name, type[i].func); } type[i].orig = null; type[i].func = null; type.splice(i, 1); // If callback was passed we are done here, otherwise proceed if (callback !== undef) { break; } } } // If event array got empty, remove it if (!type.length) { delete eventhash[obj[uid]][name]; } // If mOxie registry has become empty, remove it if (Basic.isEmptyObj(eventhash[obj[uid]])) { delete eventhash[obj[uid]]; // IE doesn't let you remove DOM object property with - delete try { delete obj[uid]; } catch(e) { obj[uid] = undef; } } }; /** Remove all kind of events from the specified object @method removeAllEvents @static @param {Object} obj DOM element to remove event listeners from. @param {String} [key] unique key to match, when removing events. */ var removeAllEvents = function(obj, key) { if (!obj || !obj[uid]) { return; } Basic.each(eventhash[obj[uid]], function(events, name) { removeEvent(obj, name, key); }); }; return { addEvent: addEvent, removeEvent: removeEvent, removeAllEvents: removeAllEvents }; }); // Included from: src/javascript/runtime/html4/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileInput @private */ define("moxie/runtime/html4/file/FileInput", [ "moxie/runtime/html4/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Events", "moxie/core/utils/Mime", "moxie/core/utils/Env" ], function(extensions, Basic, Dom, Events, Mime, Env) { function FileInput() { var _uid, _files = [], _mimes = [], _options; function addInput() { var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; uid = Basic.guid('uid_'); shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE if (_uid) { // move previous form out of the view currForm = Dom.get(_uid + '_form'); if (currForm) { Basic.extend(currForm.style, { top: '100%' }); } } // build form in DOM, since innerHTML version not able to submit file for some reason form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', 'post'); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); Basic.extend(form.style, { overflow: 'hidden', position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); input = document.createElement('input'); input.setAttribute('id', uid); input.setAttribute('type', 'file'); input.setAttribute('name', _options.name || 'Filedata'); input.setAttribute('accept', _mimes.join(',')); Basic.extend(input.style, { fontSize: '999px', opacity: 0 }); form.appendChild(input); shimContainer.appendChild(form); // prepare file input to be placed underneath the browse_button element Basic.extend(input.style, { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); if (Env.browser === 'IE' && Env.version < 10) { Basic.extend(input.style, { filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" }); } input.onchange = function() { // there should be only one handler for this var file; if (!this.value) { return; } if (this.files) { file = this.files[0]; } else { file = { name: this.value }; } _files = [file]; this.onchange = function() {}; // clear event handler addInput.call(comp); // after file is initialized as o.File, we need to update form and input ids comp.bind('change', function onChange() { var input = Dom.get(uid), form = Dom.get(uid + '_form'), file; comp.unbind('change', onChange); if (comp.files.length && input && form) { file = comp.files[0]; input.setAttribute('id', file.uid); form.setAttribute('id', file.uid + '_form'); // set upload target form.setAttribute('target', file.uid + '_iframe'); } input = form = null; }, 998); input = form = null; comp.trigger('change'); }; // route click event to the input if (I.can('summon_file_dialog')) { browseButton = Dom.get(_options.browse_button); Events.removeEvent(browseButton, 'click', comp.uid); Events.addEvent(browseButton, 'click', function(e) { if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] input.click(); } e.preventDefault(); }, comp.uid); } _uid = uid; shimContainer = currForm = browseButton = null; } Basic.extend(this, { init: function(options) { var comp = this, I = comp.getRuntime(), shimContainer; // figure out accept string _options = options; _mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension')); shimContainer = I.getShimContainer(); (function() { var browseButton, zIndex, top; browseButton = Dom.get(options.browse_button); // Route click event to the input[type=file] element for browsers that support such behavior if (I.can('summon_file_dialog')) { if (Dom.getStyle(browseButton, 'position') === 'static') { browseButton.style.position = 'relative'; } zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; browseButton.style.zIndex = zIndex; shimContainer.style.zIndex = zIndex - 1; } /* Since we have to place input[type=file] on top of the browse_button for some browsers, browse_button loses interactivity, so we restore it here */ top = I.can('summon_file_dialog') ? browseButton : shimContainer; Events.addEvent(top, 'mouseover', function() { comp.trigger('mouseenter'); }, comp.uid); Events.addEvent(top, 'mouseout', function() { comp.trigger('mouseleave'); }, comp.uid); Events.addEvent(top, 'mousedown', function() { comp.trigger('mousedown'); }, comp.uid); Events.addEvent(Dom.get(options.container), 'mouseup', function() { comp.trigger('mouseup'); }, comp.uid); browseButton = null; }()); addInput.call(this); shimContainer = null; // trigger ready event asynchronously comp.trigger({ type: 'ready', async: true }); }, getFiles: function() { return _files; }, disable: function(state) { var input; if ((input = Dom.get(_uid))) { input.disabled = !!state; } }, destroy: function() { var I = this.getRuntime() , shim = I.getShim() , shimContainer = I.getShimContainer() ; Events.removeAllEvents(shimContainer, this.uid); Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); if (shimContainer) { shimContainer.innerHTML = ''; } shim.removeInstance(this.uid); _uid = _files = _mimes = _options = shimContainer = shim = null; } }); } return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/html5/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML5 runtime. @class moxie/runtime/html5/Runtime @private */ define("moxie/runtime/html5/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = "html5", extensions = {}; function Html5Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; var caps = Basic.extend({ access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), access_image_binary: function() { return I.can('access_binary') && !!extensions.Image; }, display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')), do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), drag_and_drop: Test(function() { // this comes directly from Modernizr: http://www.modernizr.com/ var div = document.createElement('div'); // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (Env.browser !== 'IE' || Env.version > 9); }()), filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); }()), return_response_headers: True, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported return true; } return Env.can('return_response_type', responseType); }, return_status_code: True, report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), resize_image: function() { return I.can('access_binary') && Env.can('create_canvas'); }, select_file: function() { return Env.can('use_fileinput') && window.File; }, select_folder: function() { return I.can('select_file') && Env.browser === 'Chrome' && Env.version >= 21; }, select_multiple: function() { // it is buggy on Safari Windows and iOS return I.can('select_file') && !(Env.browser === 'Safari' && Env.os === 'Windows') && !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.4", '<')); }, send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), send_custom_headers: Test(window.XMLHttpRequest), send_multipart: function() { return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); }, slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), stream_upload: function(){ return I.can('slice_blob') && I.can('send_multipart'); }, summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... return (Env.browser === 'Firefox' && Env.version >= 4) || (Env.browser === 'Opera' && Env.version >= 12) || (Env.browser === 'IE' && Env.version >= 10) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); }()), upload_filesize: True }, arguments[2] ); Runtime.call(this, options, (arguments[1] || type), caps); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html5Runtime); return extensions; }); // Included from: src/javascript/runtime/html5/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/FileReader @private */ define("moxie/runtime/html5/file/FileReader", [ "moxie/runtime/html5/Runtime", "moxie/core/utils/Encode", "moxie/core/utils/Basic" ], function(extensions, Encode, Basic) { function FileReader() { var _fr, _convertToBinary = false; Basic.extend(this, { read: function(op, blob) { var target = this; _fr = new window.FileReader(); _fr.addEventListener('progress', function(e) { target.trigger(e); }); _fr.addEventListener('load', function(e) { target.trigger(e); }); _fr.addEventListener('error', function(e) { target.trigger(e, _fr.error); }); _fr.addEventListener('loadend', function() { _fr = null; }); if (Basic.typeOf(_fr[op]) === 'function') { _convertToBinary = false; _fr[op](blob.getSource()); } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ _convertToBinary = true; _fr.readAsDataURL(blob.getSource()); } }, getResult: function() { return _fr && _fr.result ? (_convertToBinary ? _toBinary(_fr.result) : _fr.result) : null; }, abort: function() { if (_fr) { _fr.abort(); } }, destroy: function() { _fr = null; } }); function _toBinary(str) { return Encode.atob(str.substring(str.indexOf('base64,') + 7)); } } return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html4/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileReader @private */ define("moxie/runtime/html4/file/FileReader", [ "moxie/runtime/html4/Runtime", "moxie/runtime/html5/file/FileReader" ], function(extensions, FileReader) { return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/xhr/XMLHttpRequest @private */ define("moxie/runtime/html4/xhr/XMLHttpRequest", [ "moxie/runtime/html4/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Url", "moxie/core/Exceptions", "moxie/core/utils/Events", "moxie/file/Blob", "moxie/xhr/FormData" ], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { function XMLHttpRequest() { var _status, _response, _iframe; function cleanup(cb) { var target = this, uid, form, inputs, i, hasFile = false; if (!_iframe) { return; } uid = _iframe.id.replace(/_iframe$/, ''); form = Dom.get(uid + '_form'); if (form) { inputs = form.getElementsByTagName('input'); i = inputs.length; while (i--) { switch (inputs[i].getAttribute('type')) { case 'hidden': inputs[i].parentNode.removeChild(inputs[i]); break; case 'file': hasFile = true; // flag the case for later break; } } inputs = []; if (!hasFile) { // we need to keep the form for sake of possible retries form.parentNode.removeChild(form); } form = null; } // without timeout, request is marked as canceled (in console) setTimeout(function() { Events.removeEvent(_iframe, 'load', target.uid); if (_iframe.parentNode) { // #382 _iframe.parentNode.removeChild(_iframe); } // check if shim container has any other children, if - not, remove it as well var shimContainer = target.getRuntime().getShimContainer(); if (!shimContainer.children.length) { shimContainer.parentNode.removeChild(shimContainer); } shimContainer = _iframe = null; cb(); }, 1); } Basic.extend(this, { send: function(meta, data) { var target = this, I = target.getRuntime(), uid, form, input, blob; _status = _response = null; function createIframe() { var container = I.getShimContainer() || document.body , temp = document.createElement('div') ; // IE 6 won't be able to set the name using setAttribute or iframe.name temp.innerHTML = '<iframe id="' + uid + '_iframe" name="' + uid + '_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>'; _iframe = temp.firstChild; container.appendChild(_iframe); /* _iframe.onreadystatechange = function() { console.info(_iframe.readyState); };*/ Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 var el; try { el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; // try to detect some standard error pages if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error _status = el.title.replace(/^(\d+).*$/, '$1'); } else { _status = 200; // get result _response = Basic.trim(el.body.innerHTML); // we need to fire these at least once target.trigger({ type: 'progress', loaded: _response.length, total: _response.length }); if (blob) { // if we were uploading a file target.trigger({ type: 'uploadprogress', loaded: blob.size || 1025, total: blob.size || 1025 }); } } } catch (ex) { if (Url.hasSameOrigin(meta.url)) { // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm // which obviously results to cross domain error (wtf?) _status = 404; } else { cleanup.call(target, function() { target.trigger('error'); }); return; } } cleanup.call(target, function() { target.trigger('load'); }); }, target.uid); } // end createIframe // prepare data to be sent and convert if required if (data instanceof FormData && data.hasBlob()) { blob = data.getBlob(); uid = blob.uid; input = Dom.get(uid); form = Dom.get(uid + '_form'); if (!form) { throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } } else { uid = Basic.guid('uid_'); form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', meta.method); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); form.setAttribute('target', uid + '_iframe'); I.getShimContainer().appendChild(form); } if (data instanceof FormData) { data.each(function(value, name) { if (value instanceof Blob) { if (input) { input.setAttribute('name', name); } } else { var hidden = document.createElement('input'); Basic.extend(hidden, { type : 'hidden', name : name, value : value }); // make sure that input[type="file"], if it's there, comes last if (input) { form.insertBefore(hidden, input); } else { form.appendChild(hidden); } } }); } // set destination url form.setAttribute("action", meta.url); createIframe(); form.submit(); target.trigger('loadstart'); }, getStatus: function() { return _status; }, getResponse: function(responseType) { if ('json' === responseType) { // strip off <pre>..</pre> tags that might be enclosing the response if (Basic.typeOf(_response) === 'string' && !!window.JSON) { try { return JSON.parse(_response.replace(/^\s*<pre[^>]*>/, '').replace(/<\/pre>\s*$/, '')); } catch (ex) { return null; } } } else if ('document' === responseType) { } return _response; }, abort: function() { var target = this; if (_iframe && _iframe.contentWindow) { if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome _iframe.contentWindow.stop(); } else if (_iframe.contentWindow.document.execCommand) { // IE _iframe.contentWindow.document.execCommand('Stop'); } else { _iframe.src = "about:blank"; } } cleanup.call(this, function() { // target.dispatchEvent('readystatechange'); target.dispatchEvent('abort'); }); } }); } return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/silverlight/Runtime.js /** * RunTime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** Defines constructor for Silverlight runtime. @class moxie/runtime/silverlight/Runtime @private */ define("moxie/runtime/silverlight/Runtime", [ "moxie/core/utils/Basic", "moxie/core/utils/Env", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/runtime/Runtime" ], function(Basic, Env, Dom, x, Runtime) { var type = "silverlight", extensions = {}; function isInstalled(version) { var isVersionSupported = false, control = null, actualVer, actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0; try { try { control = new ActiveXObject('AgControl.AgControl'); if (control.IsVersionSupported(version)) { isVersionSupported = true; } control = null; } catch (e) { var plugin = navigator.plugins["Silverlight Plug-In"]; if (plugin) { actualVer = plugin.description; if (actualVer === "1.0.30226.2") { actualVer = "2.0.30226.2"; } actualVerArray = actualVer.split("."); while (actualVerArray.length > 3) { actualVerArray.pop(); } while ( actualVerArray.length < 4) { actualVerArray.push(0); } reqVerArray = version.split("."); while (reqVerArray.length > 4) { reqVerArray.pop(); } do { requiredVersionPart = parseInt(reqVerArray[index], 10); actualVersionPart = parseInt(actualVerArray[index], 10); index++; } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) { isVersionSupported = true; } } } } catch (e2) { isVersionSupported = false; } return isVersionSupported; } /** Constructor for the Silverlight Runtime @class SilverlightRuntime @extends Runtime */ function SilverlightRuntime(options) { var I = this, initTimer; options = Basic.extend({ xap_url: Env.xap_url }, options); Runtime.call(this, options, type, { access_binary: Runtime.capTrue, access_image_binary: Runtime.capTrue, display_media: Runtime.capTrue, do_cors: Runtime.capTrue, drag_and_drop: false, report_upload_progress: Runtime.capTrue, resize_image: Runtime.capTrue, return_response_headers: function(value) { return value && I.mode === 'client'; }, return_response_type: function(responseType) { if (responseType !== 'json') { return true; } else { return !!window.JSON; } }, return_status_code: function(code) { return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]); }, select_file: Runtime.capTrue, select_multiple: Runtime.capTrue, send_binary_string: Runtime.capTrue, send_browser_cookies: function(value) { return value && I.mode === 'browser'; }, send_custom_headers: function(value) { return value && I.mode === 'client'; }, send_multipart: Runtime.capTrue, slice_blob: Runtime.capTrue, stream_upload: true, summon_file_dialog: false, upload_filesize: Runtime.capTrue, use_http_method: function(methods) { return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']); } }, { // capabilities that require specific mode return_response_headers: function(value) { return value ? 'client' : 'browser'; }, return_status_code: function(code) { return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser']; }, send_browser_cookies: function(value) { return value ? 'browser' : 'client'; }, send_custom_headers: function(value) { return value ? 'client' : 'browser'; }, use_http_method: function(methods) { return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser']; } }); // minimal requirement if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') { this.mode = false; } Basic.extend(this, { getShim: function() { return Dom.get(this.uid).content.Moxie; }, shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return I.getShim().exec(this.uid, component, action, args); }, init : function() { var container; container = this.getShimContainer(); container.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">' + '<param name="source" value="' + options.xap_url + '"/>' + '<param name="background" value="Transparent"/>' + '<param name="windowless" value="true"/>' + '<param name="enablehtmlaccess" value="true"/>' + '<param name="initParams" value="uid=' + this.uid + ',target=' + Env.global_event_dispatcher + '"/>' + '</object>'; // Init is dispatched by the shim initTimer = setTimeout(function() { if (I && !I.initialized) { // runtime might be already destroyed by this moment I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); } }, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac) }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); clearTimeout(initTimer); // initialization check might be still onwait options = initTimer = destroy = I = null; }; }(this.destroy)) }, extensions); } Runtime.addConstructor(type, SilverlightRuntime); return extensions; }); // Included from: src/javascript/runtime/silverlight/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/Blob @private */ define("moxie/runtime/silverlight/file/Blob", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/Blob" ], function(extensions, Basic, Blob) { return (extensions.Blob = Basic.extend({}, Blob)); }); // Included from: src/javascript/runtime/silverlight/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileInput @private */ define("moxie/runtime/silverlight/file/FileInput", [ "moxie/runtime/silverlight/Runtime" ], function(extensions) { var FileInput = { init: function(options) { function toFilters(accept) { var filter = ''; for (var i = 0; i < accept.length; i++) { filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.'); } return filter; } this.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple); this.trigger('ready'); } }; return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/silverlight/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileReader @private */ define("moxie/runtime/silverlight/file/FileReader", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/FileReader" ], function(extensions, Basic, FileReader) { return (extensions.FileReader = Basic.extend({}, FileReader)); }); // Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/file/FileReaderSync @private */ define("moxie/runtime/silverlight/file/FileReaderSync", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/file/FileReaderSync" ], function(extensions, Basic, FileReaderSync) { return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync)); }); // Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/silverlight/xhr/XMLHttpRequest @private */ define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [ "moxie/runtime/silverlight/Runtime", "moxie/core/utils/Basic", "moxie/runtime/flash/xhr/XMLHttpRequest" ], function(extensions, Basic, XMLHttpRequest) { return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest)); }); expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/core/utils/Events"]); })(this);/** * o.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global moxie:true */ /** Globally exposed namespace with the most frequently used public classes and handy methods. @class o @static @private */ (function(exports) { "use strict"; var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; // directly add some public classes // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) (function addAlias(ns) { var name, itemType; for (name in ns) { itemType = typeof(ns[name]); if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { addAlias(ns[name]); } else if (itemType === 'function') { o[name] = ns[name]; } } })(exports.moxie); // add some manually o.Env = exports.moxie.core.utils.Env; o.Mime = exports.moxie.core.utils.Mime; o.Exceptions = exports.moxie.core.Exceptions; // expose globally exports.mOxie = o; if (!exports.o) { exports.o = o; } return o; })(this); ;webshim.register('filereader', function($, webshim, window, document, undefined, featureOptions){ "use strict"; var mOxie, moxie, hasXDomain; var FormData = $.noop; var sel = 'input[type="file"].ws-filereader'; var loadMoxie = function (){ webshim.loader.loadList(['moxie']); }; var _createFilePicker = function(){ var $input, picker, $parent, onReset; var input = this; if(webshim.implement(input, 'filepicker')){ input = this; $input = $(this); $parent = $input.parent(); onReset = function(){ if(!input.value){ $input.prop('value', ''); } }; $input.attr('tabindex', '-1').on('mousedown.filereaderwaiting click.filereaderwaiting', false); $parent.addClass('ws-loading'); picker = new mOxie.FileInput({ browse_button: this, accept: $.prop(this, 'accept'), multiple: $.prop(this, 'multiple') }); $input.jProp('form').on('reset', function(){ setTimeout(onReset); }); picker.onready = function(){ $input.off('.fileraderwaiting'); $parent.removeClass('ws-waiting'); }; picker.onchange = function(e){ webshim.data(input, 'fileList', e.target.files); $input.trigger('change'); }; picker.onmouseenter = function(){ $input.trigger('mouseover'); $parent.addClass('ws-mouseenter'); }; picker.onmouseleave = function(){ $input.trigger('mouseout'); $parent.removeClass('ws-mouseenter'); }; picker.onmousedown = function(){ $input.trigger('mousedown'); $parent.addClass('ws-active'); }; picker.onmouseup = function(){ $input.trigger('mouseup'); $parent.removeClass('ws-active'); }; webshim.data(input, 'filePicker', picker); webshim.ready('WINDOWLOAD', function(){ var lastWidth; $input.onWSOff('updateshadowdom', function(){ var curWitdth = input.offsetWidth; if(curWitdth && lastWidth != curWitdth){ lastWidth = curWitdth; picker.refresh(); } }); }); webshim.addShadowDom(); picker.init(); if(input.disabled){ picker.disable(true); } } }; var getFileNames = function(file){ return file.name; }; var createFilePicker = function(){ var elem = this; loadMoxie(); $(elem) .on('mousedown.filereaderwaiting click.filereaderwaiting', false) .parent() .addClass('ws-loading') ; webshim.ready('moxie', function(){ createFilePicker.call(elem); }); }; var noxhr = /^(?:script|jsonp)$/i; var notReadyYet = function(){ loadMoxie(); webshim.error('filereader/formdata not ready yet. please wait for moxie to load `webshim.ready("moxie", callbackFn);`` or wait for the first change event on input[type="file"].ws-filereader.') }; var inputValueDesc = webshim.defineNodeNameProperty('input', 'value', { prop: { get: function(){ var fileList = webshim.data(this, 'fileList'); if(fileList && fileList.map){ return fileList.map(getFileNames).join(', '); } return inputValueDesc.prop._supget.call(this); } } } ); var shimMoxiePath = webshim.cfg.basePath+'moxie/'; var crossXMLMessage = 'You nedd a crossdomain.xml to get all "filereader" / "XHR2" / "CORS" features to work. Or host moxie.swf/moxie.xap on your server an configure filereader options: "swfpath"/"xappath"'; var testMoxie = function(options){ return (options.wsType == 'moxie' || (options.data && options.data instanceof mOxie.FormData) || (options.crossDomain && $.support.cors !== false && hasXDomain != 'no' && !noxhr.test(options.dataType || ''))); }; var createMoxieTransport = function (options){ if(testMoxie(options)){ var ajax; webshim.info('moxie transfer used for $.ajax'); if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } return { send: function( headers, completeCallback ) { var proressEvent = function(obj, name){ if(options[name]){ var called = false; ajax.addEventListener('load', function(e){ if(!called){ options[name]({type: 'progress', lengthComputable: true, total: 1, loaded: 1}); } else if(called.lengthComputable && called.total > called.loaded){ options[name]({type: 'progress', lengthComputable: true, total: called.total, loaded: called.total}); } }); obj.addEventListener('progress', function(e){ called = e; options[name](e); }); } }; ajax = new moxie.xhr.XMLHttpRequest(); ajax.open(options.type, options.url, options.async, options.username, options.password); proressEvent(ajax.upload, featureOptions.uploadprogress); proressEvent(ajax.upload, featureOptions.progress); ajax.addEventListener('load', function(e){ var responses = { text: ajax.responseText, xml: ajax.responseXML }; completeCallback(ajax.status, ajax.statusText, responses, ajax.getAllResponseHeaders()); }); if(options.xhrFields && options.xhrFields.withCredentials){ ajax.withCredentials = true; } if(options.timeout){ ajax.timeout = options.timeout; } $.each(headers, function(name, value){ ajax.setRequestHeader(name, value); }); ajax.send(options.data); }, abort: function() { if(ajax){ ajax.abort(); } } }; } }; var transports = { //based on script: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest xdomain: (function(){ var httpRegEx = /^https?:\/\//i; var getOrPostRegEx = /^get|post$/i; var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i'); return function(options, userOptions, jqXHR) { // Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page if (!options.crossDomain || options.username || (options.xhrFields && options.xhrFields.withCredentials) || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url) || (options.data && options.data instanceof mOxie.FormData) || noxhr.test(options.dataType || '')) { return; } var xdr = null; webshim.info('xdomain transport used.'); return { send: function(headers, complete) { var postData = ''; var userType = (userOptions.dataType || '').toLowerCase(); xdr = new XDomainRequest(); if (/^\d+$/.test(userOptions.timeout)) { xdr.timeout = userOptions.timeout; } xdr.ontimeout = function() { complete(500, 'timeout'); }; xdr.onload = function() { var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\r\nContent-Type: ' + xdr.contentType; var status = { code: xdr.status || 200, message: xdr.statusText || 'OK' }; var responses = { text: xdr.responseText, xml: xdr.responseXML }; try { if (userType === 'html' || /text\/html/i.test(xdr.contentType)) { responses.html = xdr.responseText; } else if (userType === 'json' || (userType !== 'text' && /\/json/i.test(xdr.contentType))) { try { responses.json = $.parseJSON(xdr.responseText); } catch(e) { } } else if (userType === 'xml' && !xdr.responseXML) { var doc; try { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = false; doc.loadXML(xdr.responseText); } catch(e) { } responses.xml = doc; } } catch(parseMessage) {} complete(status.code, status.message, responses, allResponseHeaders); }; // set an empty handler for 'onprogress' so requests don't get aborted xdr.onprogress = function(){}; xdr.onerror = function() { complete(500, 'error', { text: xdr.responseText }); }; if (userOptions.data) { postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data); } xdr.open(options.type, options.url); xdr.send(postData); }, abort: function() { if (xdr) { xdr.abort(); } } }; }; })(), moxie: function (options, originalOptions, jqXHR){ if(testMoxie(options)){ loadMoxie(options); var ajax; var tmpTransport = { send: function( headers, completeCallback ) { ajax = true; webshim.ready('moxie', function(){ if(ajax){ ajax = createMoxieTransport(options, originalOptions, jqXHR); tmpTransport.send = ajax.send; tmpTransport.abort = ajax.abort; ajax.send(headers, completeCallback); } }); }, abort: function() { ajax = false; } }; return tmpTransport; } } }; if(!featureOptions.progress){ featureOptions.progress = 'onprogress'; } if(!featureOptions.uploadprogress){ featureOptions.uploadprogress = 'onuploadprogress'; } if(!featureOptions.swfpath){ featureOptions.swfpath = shimMoxiePath+'flash/Moxie.min.swf'; } if(!featureOptions.xappath){ featureOptions.xappath = shimMoxiePath+'silverlight/Moxie.min.xap'; } if($.support.cors !== false || !window.XDomainRequest){ delete transports.xdomain; } $.ajaxTransport("+*", function( options, originalOptions, jqXHR ) { var ajax, type; if(options.wsType || transports[transports]){ ajax = transports[transports](options, originalOptions, jqXHR); } if(!ajax){ for(type in transports){ ajax = transports[type](options, originalOptions, jqXHR); if(ajax){break;} } } return ajax; }); webshim.defineNodeNameProperty('input', 'files', { prop: { writeable: false, get: function(){ if(this.type != 'file'){return null;} if(!$(this).hasClass('ws-filereader')){ webshim.info("please add the 'ws-filereader' class to your input[type='file'] to implement files-property"); } return webshim.data(this, 'fileList') || []; } } } ); webshim.reflectProperties(['input'], ['accept']); if($('<input />').prop('multiple') == null){ webshim.defineNodeNamesBooleanProperty(['input'], ['multiple']); } webshim.onNodeNamesPropertyModify('input', 'disabled', function(value, boolVal, type){ var picker = webshim.data(this, 'filePicker'); if(picker){ picker.disable(boolVal); } }); webshim.onNodeNamesPropertyModify('input', 'value', function(value, boolVal, type){ if(value === '' && this.type == 'file' && $(this).hasClass('ws-filereader')){ webshim.data(this, 'fileList', []); } }); window.FileReader = notReadyYet; window.FormData = notReadyYet; webshim.ready('moxie', function(){ var wsMimes = 'application/xml,xml'; moxie = window.moxie; mOxie = window.mOxie; mOxie.Env.swf_url = featureOptions.swfpath; mOxie.Env.xap_url = featureOptions.xappath; window.FileReader = mOxie.FileReader; window.FormData = function(form){ var appendData, i, len, files, fileI, fileLen, inputName; var moxieData = new mOxie.FormData(); if(form && $.nodeName(form, 'form')){ appendData = $(form).serializeArray(); for(i = 0; i < appendData.length; i++){ if(Array.isArray(appendData[i].value)){ appendData[i].value.forEach(function(val){ moxieData.append(appendData[i].name, val); }); } else { moxieData.append(appendData[i].name, appendData[i].value); } } appendData = form.querySelectorAll('input[type="file"][name]'); for(i = 0, len = appendData.length; i < appendData.length; i++){ inputName = appendData[i].name; if(inputName && !$(appendData[i]).is(':disabled')){ files = $.prop(appendData[i], 'files') || []; if(files.length){ if(files.length > 1 || (moxieData.hasBlob && moxieData.hasBlob())){ webshim.error('FormData shim can only handle one file per ajax. Use multiple ajax request. One per file.'); } for(fileI = 0, fileLen = files.length; fileI < fileLen; fileI++){ moxieData.append(inputName, files[fileI]); } } } } } return moxieData; }; FormData = window.FormData; createFilePicker = _createFilePicker; transports.moxie = createMoxieTransport; featureOptions.mimeTypes = (featureOptions.mimeTypes) ? wsMimes+','+featureOptions.mimeTypes : wsMimes; try { mOxie.Mime.addMimeType(featureOptions.mimeTypes); } catch(e){ webshim.warn('mimetype to moxie error: '+e); } }); webshim.addReady(function(context, contextElem){ $(context.querySelectorAll(sel)).add(contextElem.filter(sel)).each(createFilePicker); }); webshim.ready('WINDOWLOAD', loadMoxie); if(webshim.cfg.debug !== false && featureOptions.swfpath.indexOf((location.protocol+'//'+location.hostname)) && featureOptions.swfpath.indexOf(('https://'+location.hostname))){ webshim.ready('WINDOWLOAD', function(){ var printMessage = function(){ if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } }; try { hasXDomain = sessionStorage.getItem('wsXdomain.xml'); } catch(e){} printMessage(); if(hasXDomain == null){ $.ajax({ url: 'crossdomain.xml', type: 'HEAD', dataType: 'xml', success: function(){ hasXDomain = 'yes'; }, error: function(){ hasXDomain = 'no'; }, complete: function(){ try { sessionStorage.setItem('wsXdomain.xml', hasXDomain); } catch(e){} printMessage(); } }); } }); } });
example/src/js/ChooseCity.js
ravloony/react-dropdown-input
'use strict'; var React = require('react'); var DropdownInput = require('react-dropdown-input'); var ChooseCity = React.createClass({ propTypes: { lookupText: React.PropTypes.string, options: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.array]).isRequired }, getInitialState: function() { return {cityText: null}; }, handleSelect: function(choice) { // returns choice.value and choice.index if (choice.index>=0) { this.setState({cityText: choice.value + ' is a nice choice'}); } else { this.setState({cityText: choice.value + ' isn\'t on the list!'}); } }, render: function() { return ( <div> <DropdownInput menuClassName='dropdown-input' onSelect={this.handleSelect} defaultValue={this.props.lookupText} placeholder='Choose a city...' options={this.props.options} max={12} /> <br /> <div className='pull-right' style={{height: 30, paddingBottom: 80}}>{this.state.cityText}</div> <div className='clearfix'></div> </div> ); } }); module.exports = ChooseCity;
ajax/libs/react-bootstrap/0.24.3/react-bootstrap.min.js
kiwi89/cdnjs
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactBootstrap=t(require("react")):e.ReactBootstrap=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1)["default"],o=n(49)["default"];t.__esModule=!0;var s=n(57),a=r(s);t.Accordion=a["default"];var i=n(58),l=r(i);t.Affix=l["default"];var p=n(32),u=r(p);t.AffixMixin=u["default"];var d=n(59),f=r(d);t.Alert=f["default"];var c=n(60),h=r(c);t.Badge=h["default"];var m=n(5),v=r(m);t.BootstrapMixin=v["default"];var y=n(16),g=r(y);t.Button=g["default"];var b=n(22),T=r(b);t.ButtonGroup=T["default"];var P=n(33),E=r(P);t.ButtonInput=E["default"];var x=n(61),C=r(x);t.ButtonToolbar=C["default"];var N=n(62),_=r(N);t.Carousel=_["default"];var S=n(63),w=r(S);t.CarouselItem=w["default"];var O=n(64),k=r(O);t.Col=k["default"];var D=n(65),M=r(D);t.CollapsibleMixin=M["default"];var I=n(66),A=r(I);t.CollapsibleNav=A["default"];var L=n(67),K=r(L);t.DropdownButton=K["default"];var B=n(23),R=r(B);t.DropdownMenu=R["default"];var j=n(24),H=r(j);t.DropdownStateMixin=H["default"];var F=n(68),W=r(F);t.FadeMixin=W["default"];var U=n(37),z=r(U);t.Glyphicon=z["default"];var V=n(70),G=r(V);t.Grid=G["default"];var q=n(71),Y=r(q);t.Input=Y["default"];var Q=n(38),$=r(Q);t.Interpolate=$["default"];var Z=n(72),J=r(Z);t.Jumbotron=J["default"];var X=n(73),ee=r(X);t.Label=ee["default"];var te=n(74),ne=r(te);t.ListGroup=ne["default"];var re=n(75),oe=r(re);t.ListGroupItem=oe["default"];var se=n(76),ae=r(se);t.MenuItem=ae["default"];var ie=n(77),le=r(ie);t.Modal=le["default"];var pe=n(41),ue=r(pe);t.ModalHeader=ue["default"];var de=n(42),fe=r(de);t.ModalTitle=fe["default"];var ce=n(39),he=r(ce);t.ModalBody=he["default"];var me=n(40),ve=r(me);t.ModalFooter=ve["default"];var ye=n(43),ge=r(ye);t.Nav=ge["default"];var be=n(79),Te=r(be);t.Navbar=Te["default"];var Pe=n(44),Ee=r(Pe);t.NavItem=Ee["default"];var xe=n(45),Ce=r(xe);t.Overlay=Ce["default"];var Ne=n(80),_e=r(Ne);t.OverlayTrigger=_e["default"];var Se=n(81),we=r(Se);t.PageHeader=we["default"];var Oe=n(82),ke=r(Oe);t.PageItem=ke["default"];var De=n(83),Me=r(De);t.Pager=Me["default"];var Ie=n(84),Ae=r(Ie);t.Pagination=Ae["default"];var Le=n(86),Ke=r(Le);t.Panel=Ke["default"];var Be=n(46),Re=r(Be);t.PanelGroup=Re["default"];var je=n(87),He=r(je);t.Popover=He["default"];var Fe=n(88),We=r(Fe);t.ProgressBar=We["default"];var Ue=n(90),ze=r(Ue);t.Row=ze["default"];var Ve=n(14),Ge=r(Ve);t.SafeAnchor=Ge["default"];var qe=n(91),Ye=r(qe);t.SplitButton=Ye["default"];var Qe=n(18),$e=r(Qe);t.styleMaps=$e["default"];var Ze=n(92),Je=r(Ze);t.SubNav=Je["default"];var Xe=n(94),et=r(Xe);t.TabbedArea=et["default"];var tt=n(95),nt=r(tt);t.Table=nt["default"];var rt=n(93),ot=r(rt);t.TabPane=ot["default"];var st=n(96),at=r(st);t.Thumbnail=at["default"];var it=n(97),lt=r(it);t.Tooltip=lt["default"];var pt=n(98),ut=r(pt);t.Well=ut["default"];var dt=n(26),ft=r(dt);t.Portal=ft["default"];var ct=n(47),ht=r(ct);t.Position=ht["default"];var mt=n(17),vt=r(mt);t.Collapse=vt["default"];var yt=r(mt);t.Fade=yt["default"];var gt=n(35),bt=o(gt);t.FormControls=bt;var Tt=n(101),Pt=o(Tt);t.utils=Pt},function(e,t){"use strict";t["default"]=function(e){return e&&e.__esModule?e:{"default":e}},t.__esModule=!0},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(103)["default"];t["default"]=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.__esModule=!0},function(e,t,n){var r;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e+=" "+n;else if(Array.isArray(n))e+=" "+o.apply(null,n);else if("object"===r)for(var s in n)n.hasOwnProperty(s)&&n[s]&&(e+=" "+s)}}return e.substr(1)}"undefined"!=typeof e&&e.exports?e.exports=o:(r=function(){return o}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}()},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(2),s=r(o),a=n(18),i=r(a),l=n(6),p=r(l),u={propTypes:{bsClass:p["default"].keyOf(i["default"].CLASSES),bsStyle:s["default"].PropTypes.oneOf(i["default"].STYLES),bsSize:p["default"].keyOf(i["default"].SIZES)},getBsClassSet:function(){var e={},t=this.props.bsClass&&i["default"].CLASSES[this.props.bsClass];if(t){e[t]=!0;var n=t+"-",r=this.props.bsSize&&i["default"].SIZES[this.props.bsSize];r&&(e[n+r]=!0),this.props.bsStyle&&(i["default"].STYLES.indexOf(this.props.bsStyle)>=0?e[n+this.props.bsStyle]=!0:e[this.props.bsStyle]=!0)}return e},prefixClass:function(e){return i["default"].CLASSES[this.props.bsClass]+"-"+e}};t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n,r){return"Invalid prop '"+t+"' of value '"+e[t]+"'"+(" supplied to '"+n+"'"+r)}function o(e){function t(t,n,r,o){return o=o||h,null!=n[r]?e(n,r,o):t?new Error("Required prop '"+r+"' was not specified in '"+o+"'."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function s(){function e(e,t,n){return"object"!=typeof e[t]||"function"!=typeof e[t].render&&1!==e[t].nodeType?new Error(r(e,t,n,", expected a DOM element or an object that has a `render` method")):void 0}return o(e)}function a(e){function t(t,n,o){var s=t[n];if(!e.hasOwnProperty(s)){var a=JSON.stringify(u(e));return new Error(r(t,n,o,", expected one of "+a+"."))}}return o(t)}function i(e){function t(t,n,r){var o=e.map(function(e){return t[e]}).reduce(function(e,t){return e+(void 0!==t?1:0)},0);if(o>1){var s=e[0],a=e.slice(1),i=a.join(", ")+" and "+s;return new Error("Invalid prop '"+n+"', only one of the following may be provided: "+i)}}return t}function l(e){if(void 0===e)throw new Error("No validations provided");if(!(e instanceof Array))throw new Error("Invalid argument must be an array");if(0===e.length)throw new Error("No validations provided");return function(t,n,r){for(var o=0;o<e.length;o++){var s=e[o](t,n,r);if(void 0!==s&&null!==s)return s}}}function p(){function e(e,t,n){var o=r(e,t,n,". Expected an Element `type`");if("function"!=typeof e[t]){if(c["default"].isValidElement(e[t]))return new Error(o+", not an actual Element");if("string"!=typeof e[t])return new Error(o+" such as a tag name or return value of React.createClass(...)")}}return o(e)}var u=n(15)["default"],d=n(1)["default"];t.__esModule=!0;var f=n(2),c=d(f),h="<<anonymous>>",m={isRequiredForA11y:function(e){return function(t,n,r){return null===t[n]?new Error("The prop `"+n+"` is required to make "+r+" accessible for users using assistive technologies such as screen readers `"):e(t,n,r)}},mountable:s(),elementType:p(),keyOf:a,singlePropFrom:i,all:l};t["default"]=m,e.exports=t["default"]},function(e,t){"use strict";t["default"]=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.__esModule=!0},function(e,t,n){"use strict";var r=n(104)["default"],o=n(106)["default"];t["default"]=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=r(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o?o(e,t):e.__proto__=t)},t.__esModule=!0},function(e,t,n){"use strict";function r(e,t,n){var r=0;return p["default"].Children.map(e,function(e){if(p["default"].isValidElement(e)){var o=r;return r++,t.call(n,e,o)}return e})}function o(e,t,n){var r=0;return p["default"].Children.forEach(e,function(e){p["default"].isValidElement(e)&&(t.call(n,e,r),r++)})}function s(e){var t=0;return p["default"].Children.forEach(e,function(e){p["default"].isValidElement(e)&&t++}),t}function a(e){var t=!1;return p["default"].Children.forEach(e,function(e){!t&&p["default"].isValidElement(e)&&(t=!0)}),t}var i=n(1)["default"];t.__esModule=!0;var l=n(2),p=i(l);t["default"]={map:r,forEach:o,numberOf:s,hasValidComponent:a},e.exports=t["default"]},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.filter(function(e){return null!=e}).reduce(function(e,t){if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var n=arguments.length,r=Array(n),o=0;n>o;o++)r[o]=arguments[o];e.apply(this,r),t.apply(this,r)}},null)}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return isNaN(e=+e)?0:(e>0?m:h)(e)}function o(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function s(e,t,n){return e[t]=n,e}function a(e){return g?function(t,n,r){return T.setDesc(t,n,o(e,r))}:s}function i(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function l(e){return"function"==typeof e}function p(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}var u="undefined"!=typeof self?self:Function("return this")(),d={},f=Object.defineProperty,c={}.hasOwnProperty,h=Math.ceil,m=Math.floor,v=Math.max,y=Math.min,g=!!function(){try{return 2==f({},"a",{get:function(){return 2}}).a}catch(e){}}(),b=a(1),T=e.exports=n(115)({g:u,core:d,html:u.document&&document.documentElement,isObject:i,isFunction:l,that:function(){return this},toInteger:r,toLength:function(e){return e>0?y(r(e),9007199254740991):0},toIndex:function(e,t){return e=r(e),0>e?v(e+t,0):y(e,t)},has:function(e,t){return c.call(e,t)},create:Object.create,getProto:Object.getPrototypeOf,DESC:g,desc:o,getDesc:Object.getOwnPropertyDescriptor,setDesc:f,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:p,ES5Object:Object,toObject:function(e){return T.ES5Object(p(e))},hide:b,def:a(0),set:u.Symbol?s:b,each:[].forEach});"undefined"!=typeof __e&&(__e=d),"undefined"!=typeof __g&&(__g=u)},function(e,t,n){"use strict";function r(e){var t=h["default"].findDOMNode(e);return t&&t.ownerDocument||document}function o(e){var t=r(e);return t.defaultView?t.defaultView:t.parentWindow}function s(e){var t=r(e);try{return t.activeElement||t.body}catch(n){return t.body}}function a(e){return r(e).defaultView.getComputedStyle(e,null)}function i(e){if(window.jQuery)return window.jQuery(e).offset();var t=r(e).documentElement,n={top:0,left:0};return"undefined"!=typeof e.getBoundingClientRect&&(n=e.getBoundingClientRect()),{top:n.top+window.pageYOffset-t.clientTop,left:n.left+window.pageXOffset-t.clientLeft}}function l(e,t){var n=void 0,r=void 0;return window.jQuery?t?(n=window.jQuery(e).offset(),r=window.jQuery(t).offset(),{top:n.top-r.top,left:n.left-r.left}):window.jQuery(e).position():(r={top:0,left:0},"fixed"===a(e).position?n=e.getBoundingClientRect():(t||(t=u(e)),n=i(e),"HTML"!==t.nodeName&&(r=i(t)),r.top+=parseInt(a(t).borderTopWidth,10),r.left+=parseInt(a(t).borderLeftWidth,10)),{top:n.top-r.top-parseInt(a(e).marginTop,10),left:n.left-r.left-parseInt(a(e).marginLeft,10)})}function p(e){var t={width:e.offsetWidth||0,height:e.offsetHeight||0};if("undefined"!=typeof e.getBoundingClientRect){var n=e.getBoundingClientRect(),r=n.width,o=n.height;t.width=r||t.width,t.height=o||t.height}return t}function u(e){for(var t=r(e).documentElement,n=e.offsetParent||t;n&&"HTML"!==n.nodeName&&"static"===a(n).position;)n=n.offsetParent;return n||t}function d(e,t){function n(e,t){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}return e&&e.contains?e.contains(t):e&&e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):n(e,t)}var f=n(1)["default"];t.__esModule=!0;var c=n(2),h=f(c),m=!("undefined"==typeof window||!window.document||!window.document.createElement);t["default"]={canUseDom:m,contains:d,ownerWindow:o,ownerDocument:r,getComputedStyles:a,getOffset:i,getPosition:l,getSize:p,activeElement:s,offsetParent:u},e.exports=t["default"]},function(e,t){"use strict";t["default"]=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},t.__esModule=!0},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(10),u=a(p),d=function(e){function t(n){o(this,t),e.call(this,n),this.handleClick=this.handleClick.bind(this)}return r(t,e),t.prototype.handleClick=function(e){void 0===this.props.href&&e.preventDefault()},t.prototype.render=function(){return l["default"].createElement("a",s({role:this.props.href?void 0:"button"},this.props,{onClick:u["default"](this.props.onClick,this.handleClick),href:this.props.href||""}))},t}(l["default"].Component);t["default"]=d,d.propTypes={href:l["default"].PropTypes.string,onClick:l["default"].PropTypes.func},e.exports=t["default"]},function(e,t,n){e.exports={"default":n(110),__esModule:!0}},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(6),f=o(d),c=n(33),h=o(c),m=a["default"].createClass({displayName:"Button",mixins:[u["default"]],propTypes:{active:a["default"].PropTypes.bool,disabled:a["default"].PropTypes.bool,block:a["default"].PropTypes.bool,navItem:a["default"].PropTypes.bool,navDropdown:a["default"].PropTypes.bool,componentClass:f["default"].elementType,href:a["default"].PropTypes.string,target:a["default"].PropTypes.string,type:a["default"].PropTypes.oneOf(h["default"].types)},getDefaultProps:function(){return{bsClass:"button",bsStyle:"default"}},render:function(){var e=this.props.navDropdown?{}:this.getBsClassSet(),t=void 0;return e=r({active:this.props.active,"btn-block":this.props.block},e),this.props.navItem?this.renderNavItem(e):(t=this.props.href||this.props.target||this.props.navDropdown?"renderAnchor":"renderButton",this[t](e))},renderAnchor:function(e){var t=this.props.componentClass||"a",n=this.props.href||"#";return e.disabled=this.props.disabled,a["default"].createElement(t,r({},this.props,{href:n,className:l["default"](this.props.className,e),role:"button"}),this.props.children)},renderButton:function(e){var t=this.props.componentClass||"button";return a["default"].createElement(t,r({},this.props,{type:this.props.type||"button",className:l["default"](this.props.className,e)}),this.props.children)},renderNavItem:function(e){var t={active:this.props.active};return a["default"].createElement("li",{className:l["default"](t)},this.renderAnchor(e))}});t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n=t["offset"+v(e)],r=c["default"].getComputedStyles(t),o=g[e];return n+parseInt(r[o[0]],10)+parseInt(r[o[1]],10)}var o=n(8)["default"],s=n(7)["default"],a=n(3)["default"],i=n(1)["default"];t.__esModule=!0;var l=n(2),p=i(l),u=n(48),d=i(u),f=n(12),c=i(f),h=n(10),m=i(h),v=function(e){return e[0].toUpperCase()+e.substr(1)},y=function(e){return e.offsetHeight},g={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]},b=function(e){function t(n,r){s(this,t),e.call(this,n,r),this.onEnterListener=this.handleEnter.bind(this),this.onEnteringListener=this.handleEntering.bind(this),this.onEnteredListener=this.handleEntered.bind(this),this.onExitListener=this.handleExit.bind(this),this.onExitingListener=this.handleExiting.bind(this)}return o(t,e),t.prototype.render=function(){var e=m["default"](this.onEnterListener,this.props.onEnter),t=m["default"](this.onEnteringListener,this.props.onEntering),n=m["default"](this.onEnteredListener,this.props.onEntered),r=m["default"](this.onExitListener,this.props.onExit),o=m["default"](this.onExitingListener,this.props.onExiting);return p["default"].createElement(d["default"],a({ref:"transition"},this.props,{"aria-expanded":this.props["in"],className:"width"===this._dimension()?"width":"",exitedClassName:"collapse",exitingClassName:"collapsing",enteredClassName:"collapse in",enteringClassName:"collapsing",onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:o,onExited:this.props.onExited}),this.props.children)},t.prototype.handleEnter=function(e){var t=this._dimension();e.style[t]="0"},t.prototype.handleEntering=function(e){var t=this._dimension();e.style[t]=this._getScrollDimensionValue(e,t)},t.prototype.handleEntered=function(e){var t=this._dimension();e.style[t]=null},t.prototype.handleExit=function(e){var t=this._dimension();e.style[t]=this.props.getDimensionValue(t,e)+"px"},t.prototype.handleExiting=function(e){var t=this._dimension();y(e),e.style[t]="0"},t.prototype._dimension=function(){return"function"==typeof this.props.dimension?this.props.dimension():this.props.dimension},t.prototype._getTransitionInstance=function(){return this.refs.transition},t.prototype._getScrollDimensionValue=function(e,t){return e["scroll"+v(t)]+"px"},t}(p["default"].Component);b.propTypes={"in":p["default"].PropTypes.bool,unmountOnExit:p["default"].PropTypes.bool,transitionAppear:p["default"].PropTypes.bool,duration:p["default"].PropTypes.number,onEnter:p["default"].PropTypes.func,onEntering:p["default"].PropTypes.func,onEntered:p["default"].PropTypes.func,onExit:p["default"].PropTypes.func,onExiting:p["default"].PropTypes.func,onExited:p["default"].PropTypes.func,dimension:p["default"].PropTypes.oneOfType([p["default"].PropTypes.oneOf(["height","width"]),p["default"].PropTypes.func]),getDimensionValue:p["default"].PropTypes.func},b.defaultProps={"in":!1,duration:300,unmountOnExit:!1,transitionAppear:!1,dimension:"height",getDimensionValue:r},t["default"]=b,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0;var n={CLASSES:{alert:"alert",button:"btn","button-group":"btn-group","button-toolbar":"btn-toolbar",column:"col","input-group":"input-group",form:"form",glyphicon:"glyphicon",label:"label",thumbnail:"thumbnail","list-group-item":"list-group-item",panel:"panel","panel-group":"panel-group",pagination:"pagination","progress-bar":"progress-bar",nav:"nav",navbar:"navbar",modal:"modal",row:"row",well:"well"},STYLES:["default","primary","success","info","warning","danger","link","inline","tabs","pills"],addStyle:function(e){n.STYLES.push(e)},SIZES:{large:"lg",medium:"md",small:"sm",xsmall:"xs",lg:"lg",md:"md",sm:"sm",xs:"xs"},GLYPHS:["asterisk","plus","euro","eur","minus","cloud","envelope","pencil","glass","music","search","heart","star","star-empty","user","film","th-large","th","th-list","ok","remove","zoom-in","zoom-out","off","signal","cog","trash","home","file","time","road","download-alt","download","upload","inbox","play-circle","repeat","refresh","list-alt","lock","flag","headphones","volume-off","volume-down","volume-up","qrcode","barcode","tag","tags","book","bookmark","print","camera","font","bold","italic","text-height","text-width","align-left","align-center","align-right","align-justify","list","indent-left","indent-right","facetime-video","picture","map-marker","adjust","tint","edit","share","check","move","step-backward","fast-backward","backward","play","pause","stop","forward","fast-forward","step-forward","eject","chevron-left","chevron-right","plus-sign","minus-sign","remove-sign","ok-sign","question-sign","info-sign","screenshot","remove-circle","ok-circle","ban-circle","arrow-left","arrow-right","arrow-up","arrow-down","share-alt","resize-full","resize-small","exclamation-sign","gift","leaf","fire","eye-open","eye-close","warning-sign","plane","calendar","random","comment","magnet","chevron-up","chevron-down","retweet","shopping-cart","folder-close","folder-open","resize-vertical","resize-horizontal","hdd","bullhorn","bell","certificate","thumbs-up","thumbs-down","hand-right","hand-left","hand-up","hand-down","circle-arrow-right","circle-arrow-left","circle-arrow-up","circle-arrow-down","globe","wrench","tasks","filter","briefcase","fullscreen","dashboard","paperclip","heart-empty","link","phone","pushpin","usd","gbp","sort","sort-by-alphabet","sort-by-alphabet-alt","sort-by-order","sort-by-order-alt","sort-by-attributes","sort-by-attributes-alt","unchecked","expand","collapse-down","collapse-up","log-in","flash","log-out","new-window","record","save","open","saved","import","export","send","floppy-disk","floppy-saved","floppy-remove","floppy-save","floppy-open","credit-card","transfer","cutlery","header","compressed","earphone","phone-alt","tower","stats","sd-video","hd-video","subtitles","sound-stereo","sound-dolby","sound-5-1","sound-6-1","sound-7-1","copyright-mark","registration-mark","cloud-download","cloud-upload","tree-conifer","tree-deciduous","cd","save-file","open-file","level-up","copy","paste","alert","equalizer","king","queen","pawn","bishop","knight","baby-formula","tent","blackboard","bed","apple","erase","hourglass","lamp","duplicate","piggy-bank","scissors","bitcoin","yen","ruble","scale","ice-lolly","ice-lolly-tasted","education","option-horizontal","option-vertical","menu-hamburger","modal-window","oil","grain","sunglasses","text-size","text-color","text-background","object-align-top","object-align-bottom","object-align-horizontal","object-align-left","object-align-vertical","object-align-right","triangle-right","triangle-left","triangle-bottom","triangle-top","console","superscript","subscript","menu-left","menu-right","menu-down","menu-up"]};t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0;var n={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0}};t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var n in a){var r=a[n];for(var o in r)if(o in t){i.push(r[o]);break}}}function r(e,t,n){e.addEventListener(t,n,!1)}function o(e,t,n){e.removeEventListener(t,n,!1)}t.__esModule=!0;var s=!("undefined"==typeof window||!window.document||!window.document.createElement),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},i=[];s&&n();var l={addEndEventListener:function(e,t){return 0===i.length?void window.setTimeout(t,0):void i.forEach(function(n){r(e,n,t)})},removeEndEventListener:function(e,t){0!==i.length&&i.forEach(function(n){o(e,n,t)})}};t["default"]=l,e.exports=t["default"]},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(6),f=o(d),c=a["default"].createClass({displayName:"ButtonGroup",mixins:[u["default"]],propTypes:{vertical:a["default"].PropTypes.bool,justified:a["default"].PropTypes.bool,block:f["default"].all([a["default"].PropTypes.bool,function(e,t,n){return e.block&&!e.vertical?new Error("The block property requires the vertical property to be set to have any effect"):void 0}])},getDefaultProps:function(){return{bsClass:"button-group"}},render:function(){var e=this.getBsClassSet();return e["btn-group"]=!this.props.vertical,e["btn-group-vertical"]=this.props.vertical,e["btn-group-justified"]=this.props.justified,e["btn-block"]=this.props.block,a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(10),u=o(p),d=n(9),f=o(d),c=a["default"].createClass({displayName:"DropdownMenu",propTypes:{pullRight:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func},render:function(){var e={"dropdown-menu":!0,"dropdown-menu-right":this.props.pullRight};return a["default"].createElement("ul",r({},this.props,{className:l["default"](this.props.className,e),role:"menu"}),f["default"].map(this.props.children,this.renderMenuItem))},renderMenuItem:function(e,t){return s.cloneElement(e,{onSelect:u["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(12),l=o(i),p=n(19),u=o(p),d={getInitialState:function(){return{open:!1}},setDropdownState:function(e,t){e?this.bindRootCloseHandlers():this.unbindRootCloseHandlers(),this.setState({open:e},t)},handleDocumentKeyUp:function(e){27===e.keyCode&&this.setDropdownState(!1)},handleDocumentClick:function(e){var t=e.target||e.srcElement;r(t,a["default"].findDOMNode(this))||this.setDropdownState(!1)},bindRootCloseHandlers:function(){var e=l["default"].ownerDocument(this);this._onDocumentClickListener=u["default"].listen(e,"click",this.handleDocumentClick),this._onDocumentKeyupListener=u["default"].listen(e,"keyup",this.handleDocumentKeyUp)},unbindRootCloseHandlers:function(){this._onDocumentClickListener&&this._onDocumentClickListener.remove(),this._onDocumentKeyupListener&&this._onDocumentKeyupListener.remove()},componentWillUnmount:function(){this.unbindRootCloseHandlers()}};t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=n(36),f=a(d),c=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.getInputDOMNode=function(){return l["default"].findDOMNode(this.refs.input)},t.prototype.getValue=function(){if("static"===this.props.type)return this.props.value;if(this.props.type)return"select"===this.props.type&&this.props.multiple?this.getSelectedOptions():this.getInputDOMNode().value;throw"Cannot use getValue without specifying input type."},t.prototype.getChecked=function(){return this.getInputDOMNode().checked},t.prototype.getSelectedOptions=function(){var e=[];return Array.prototype.forEach.call(this.getInputDOMNode().getElementsByTagName("option"),function(t){if(t.selected){var n=t.getAttribute("value")||t.innerHtml;e.push(n)}}),e},t.prototype.isCheckboxOrRadio=function(){return"checkbox"===this.props.type||"radio"===this.props.type},t.prototype.isFile=function(){return"file"===this.props.type},t.prototype.renderInputGroup=function(e){var t=this.props.addonBefore?l["default"].createElement("span",{className:"input-group-addon",key:"addonBefore"},this.props.addonBefore):null,n=this.props.addonAfter?l["default"].createElement("span",{className:"input-group-addon",key:"addonAfter"},this.props.addonAfter):null,r=this.props.buttonBefore?l["default"].createElement("span",{className:"input-group-btn"},this.props.buttonBefore):null,o=this.props.buttonAfter?l["default"].createElement("span",{className:"input-group-btn"},this.props.buttonAfter):null,s=void 0;switch(this.props.bsSize){case"small":s="input-group-sm";break;case"large":s="input-group-lg"}return t||n||r||o?l["default"].createElement("div",{className:u["default"](s,"input-group"),key:"input-group"},t,r,e,n,o):e},t.prototype.renderIcon=function(){var e={glyphicon:!0,"form-control-feedback":!0,"glyphicon-ok":"success"===this.props.bsStyle,"glyphicon-warning-sign":"warning"===this.props.bsStyle,"glyphicon-remove":"error"===this.props.bsStyle};return this.props.hasFeedback?l["default"].createElement("span",{className:u["default"](e),key:"icon"}):null},t.prototype.renderHelp=function(){return this.props.help?l["default"].createElement("span",{className:"help-block",key:"help"},this.props.help):null},t.prototype.renderCheckboxAndRadioWrapper=function(e){var t={checkbox:"checkbox"===this.props.type,radio:"radio"===this.props.type};return l["default"].createElement("div",{className:u["default"](t),key:"checkboxRadioWrapper"},e)},t.prototype.renderWrapper=function(e){return this.props.wrapperClassName?l["default"].createElement("div",{className:this.props.wrapperClassName,key:"wrapper"},e):e},t.prototype.renderLabel=function(e){var t={"control-label":!this.isCheckboxOrRadio()};return t[this.props.labelClassName]=this.props.labelClassName,this.props.label?l["default"].createElement("label",{htmlFor:this.props.id,className:u["default"](t),key:"label"},e,this.props.label):e},t.prototype.renderInput=function(){if(!this.props.type)return this.props.children;switch(this.props.type){case"select":return l["default"].createElement("select",s({},this.props,{className:u["default"](this.props.className,"form-control"),ref:"input",key:"input"}),this.props.children);case"textarea":return l["default"].createElement("textarea",s({},this.props,{className:u["default"](this.props.className,"form-control"),ref:"input",key:"input"}));case"static":return l["default"].createElement("p",s({},this.props,{className:u["default"](this.props.className,"form-control-static"),ref:"input",key:"input"}),this.props.value)}var e=this.isCheckboxOrRadio()||this.isFile()?"":"form-control";return l["default"].createElement("input",s({},this.props,{className:u["default"](this.props.className,e),ref:"input",key:"input"}))},t.prototype.renderFormGroup=function(e){return l["default"].createElement(f["default"],this.props,e)},t.prototype.renderChildren=function(){return this.isCheckboxOrRadio()?this.renderWrapper([this.renderCheckboxAndRadioWrapper(this.renderLabel(this.renderInput())),this.renderHelp()]):[this.renderLabel(),this.renderWrapper([this.renderInputGroup(this.renderInput()),this.renderIcon(),this.renderHelp()])]},t.prototype.render=function(){var e=this.renderChildren();return this.renderFormGroup(e)},t}(l["default"].Component);c.propTypes={type:l["default"].PropTypes.string,label:l["default"].PropTypes.node,help:l["default"].PropTypes.node,addonBefore:l["default"].PropTypes.node,addonAfter:l["default"].PropTypes.node,buttonBefore:l["default"].PropTypes.node,buttonAfter:l["default"].PropTypes.node,bsSize:l["default"].PropTypes.oneOf(["small","medium","large"]),bsStyle:l["default"].PropTypes.oneOf(["success","warning","error"]),hasFeedback:l["default"].PropTypes.bool,id:l["default"].PropTypes.string,groupClassName:l["default"].PropTypes.string,wrapperClassName:l["default"].PropTypes.string,labelClassName:l["default"].PropTypes.string,multiple:l["default"].PropTypes.bool,disabled:l["default"].PropTypes.bool,value:l["default"].PropTypes.any},t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(2),s=r(o),a=n(6),i=r(a),l=n(12),p=r(l),u=s["default"].createClass({displayName:"Portal",propTypes:{container:i["default"].mountable},componentDidMount:function(){this._renderOverlay()},componentDidUpdate:function(){this._renderOverlay()},componentWillUnmount:function(){this._unrenderOverlay(),this._unmountOverlayTarget()},_mountOverlayTarget:function(){this._overlayTarget||(this._overlayTarget=document.createElement("div"),this.getContainerDOMNode().appendChild(this._overlayTarget))},_unmountOverlayTarget:function(){this._overlayTarget&&(this.getContainerDOMNode().removeChild(this._overlayTarget),this._overlayTarget=null)},_renderOverlay:function(){var e=this.props.children?s["default"].Children.only(this.props.children):null;null!==e?(this._mountOverlayTarget(),this._overlayInstance=s["default"].render(e,this._overlayTarget)):(this._unrenderOverlay(),this._unmountOverlayTarget())},_unrenderOverlay:function(){this._overlayTarget&&(s["default"].unmountComponentAtNode(this._overlayTarget),this._overlayInstance=null)},render:function(){return null},getOverlayDOMNode:function(){if(!this.isMounted())throw new Error("getOverlayDOMNode(): A component must be mounted to have a DOM node.");return this._overlayInstance?this._overlayInstance.getWrappedDOMNode?this._overlayInstance.getWrappedDOMNode():s["default"].findDOMNode(this._overlayInstance):null},getContainerDOMNode:function(){return s["default"].findDOMNode(this.props.container)||p["default"].ownerDocument(this).body}});t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){var r=i.singlePropFrom(l)(e,t,n);if(!r){var o=a["default"].PropTypes.oneOfType(p);r=o(e,t,n)}return r}var o=n(1)["default"];t.__esModule=!0,t["default"]=r;var s=n(2),a=o(s),i=n(6),l=["children","value"],p=[a["default"].PropTypes.number,a["default"].PropTypes.string];e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){var r=e+" is deprecated. Use "+t+" instead.";n&&(r+="\nYou can read more about it at "+n),a["default"](!1,r)}var o=n(1)["default"];t.__esModule=!0,t["default"]=r;var s=n(56),a=o(s);e.exports=t["default"]},function(e,t,n){function r(e,t){return function(){return e.apply(t,arguments)}}function o(e,t,n){var s,p,u,d,f=e&o.G,c=e&o.P,h=f?a:e&o.S?a[t]:(a[t]||{}).prototype,m=f?i:i[t]||(i[t]={});f&&(n=t);for(s in n)p=!(e&o.F)&&h&&s in h,p&&s in m||(u=p?h[s]:n[s],f&&!l(h[s])?d=n[s]:e&o.B&&p?d=r(u,a):e&o.W&&h[s]==u?!function(e){d=function(t){return this instanceof e?new e(t):e(t)},d.prototype=e.prototype}(u):d=c&&l(u)?r(Function.call,u):u,m[s]=d,c&&((m.prototype||(m.prototype={}))[s]=u))}var s=n(11),a=s.g,i=s.core,l=s.isFunction;o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,e.exports=o},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(2),s=r(o),a=n(12),i=r(a),l=n(19),p=r(l),u={propTypes:{offset:s["default"].PropTypes.number,offsetTop:s["default"].PropTypes.number,offsetBottom:s["default"].PropTypes.number},getInitialState:function(){return{affixClass:"affix-top"}},getPinnedOffset:function(e){return this.pinnedOffset?this.pinnedOffset:(e.className=e.className.replace(/affix-top|affix-bottom|affix/,""),e.className+=e.className.length?" affix":"affix",this.pinnedOffset=i["default"].getOffset(e).top-window.pageYOffset,this.pinnedOffset)},checkPosition:function(){var e=void 0,t=void 0,n=void 0,r=void 0,o=void 0,a=void 0,l=void 0,p=void 0,u=void 0;this.isMounted()&&(e=s["default"].findDOMNode(this),t=document.documentElement.offsetHeight,n=window.pageYOffset,r=i["default"].getOffset(e),"top"===this.affixed&&(r.top+=n),o=null!=this.props.offsetTop?this.props.offsetTop:this.props.offset,a=null!=this.props.offsetBottom?this.props.offsetBottom:this.props.offset,(null!=o||null!=a)&&(null==o&&(o=0),null==a&&(a=0),l=null!=this.unpin&&n+this.unpin<=r.top?!1:null!=a&&r.top+e.offsetHeight>=t-a?"bottom":null!=o&&o>=n?"top":!1,this.affixed!==l&&(null!=this.unpin&&(e.style.top=""),p="affix"+(l?"-"+l:""),this.affixed=l,this.unpin="bottom"===l?this.getPinnedOffset(e):null,"bottom"===l&&(e.className=e.className.replace(/affix-top|affix-bottom|affix/,"affix-bottom"),u=t-a-e.offsetHeight-i["default"].getOffset(e).top),this.setState({affixClass:p,affixPositionTop:u}))))},checkPositionWithEventLoop:function(){setTimeout(this.checkPosition,0)},componentDidMount:function(){this._onWindowScrollListener=p["default"].listen(window,"scroll",this.checkPosition),this._onDocumentClickListener=p["default"].listen(i["default"].ownerDocument(this),"click",this.checkPositionWithEventLoop)},componentWillUnmount:function(){this._onWindowScrollListener&&this._onWindowScrollListener.remove(),this._onDocumentClickListener&&this._onDocumentClickListener.remove()},componentDidUpdate:function(e,t){t.affixClass===this.state.affixClass&&this.checkPositionWithEventLoop(); }};t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(13)["default"],a=n(3)["default"],i=n(1)["default"];t.__esModule=!0;var l=n(2),p=i(l),u=n(16),d=i(u),f=n(36),c=i(f),h=n(25),m=i(h),v=n(27),y=i(v),g=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.renderFormGroup=function(e){var t=this.props,n=(t.bsStyle,t.value,s(t,["bsStyle","value"]));return p["default"].createElement(c["default"],n,e)},t.prototype.renderInput=function(){var e=this.props,t=e.children,n=e.value,r=s(e,["children","value"]),o=t?t:n;return p["default"].createElement(d["default"],a({},r,{componentClass:"input",ref:"input",key:"input",value:o}))},t}(m["default"]);g.types=["button","reset","submit"],g.defaultProps={type:"button"},g.propTypes={type:p["default"].PropTypes.oneOf(g.types),bsStyle:function(e){return null},children:y["default"],value:y["default"]},t["default"]=g,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(48),u=a(p),d=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return l["default"].createElement(u["default"],s({},this.props,{className:"fade",enteredClassName:"in",enteringClassName:"in"}),this.props.children)},t}(l["default"].Component);d.propTypes={"in":l["default"].PropTypes.bool,unmountOnExit:l["default"].PropTypes.bool,transitionAppear:l["default"].PropTypes.bool,duration:l["default"].PropTypes.number,onEnter:l["default"].PropTypes.func,onEntering:l["default"].PropTypes.func,onEntered:l["default"].PropTypes.func,onExit:l["default"].PropTypes.func,onExiting:l["default"].PropTypes.func,onExited:l["default"].PropTypes.func},d.defaultProps={"in":!1,duration:300,unmountOnExit:!1,transitionAppear:!1},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(69),s=r(o);t.Static=s["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(1)["default"];t.__esModule=!0;var a=n(2),i=s(a),l=n(4),p=s(l),u=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){var e={"form-group":!this.props.standalone,"form-group-lg":!this.props.standalone&&"large"===this.props.bsSize,"form-group-sm":!this.props.standalone&&"small"===this.props.bsSize,"has-feedback":this.props.hasFeedback,"has-success":"success"===this.props.bsStyle,"has-warning":"warning"===this.props.bsStyle,"has-error":"error"===this.props.bsStyle};return i["default"].createElement("div",{className:p["default"](e,this.props.groupClassName)},this.props.children)},t}(i["default"].Component);u.defaultProps={standalone:!1},u.propTypes={standalone:i["default"].PropTypes.bool,hasFeedback:i["default"].PropTypes.bool,bsSize:function(e){return e.standalone&&void 0!==e.bsSize?new Error("bsSize will not be used when `standalone` is set."):i["default"].PropTypes.oneOf(["small","medium","large"]).apply(null,arguments)},bsStyle:i["default"].PropTypes.oneOf(["success","warning","error"]),groupClassName:i["default"].PropTypes.string},t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(18),f=o(d),c=a["default"].createClass({displayName:"Glyphicon",mixins:[u["default"]],propTypes:{glyph:a["default"].PropTypes.oneOf(f["default"].GLYPHS).isRequired},getDefaultProps:function(){return{bsClass:"glyphicon"}},render:function(){var e=this.getBsClassSet();return e["glyphicon-"+this.props.glyph]=!0,a["default"].createElement("span",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(9),l=o(i),p=/\%\((.+?)\)s/,u=a["default"].createClass({displayName:"Interpolate",propTypes:{component:a["default"].PropTypes.node,format:a["default"].PropTypes.string,unsafe:a["default"].PropTypes.bool},getDefaultProps:function(){return{component:"span"}},render:function(){var e=l["default"].hasValidComponent(this.props.children)||"string"==typeof this.props.children?this.props.children:this.props.format,t=this.props.component,n=this.props.unsafe===!0,o=r({},this.props);if(delete o.children,delete o.format,delete o.component,delete o.unsafe,n){var s=e.split(p).reduce(function(e,t,n){var r=void 0;if(n%2===0?r=t:(r=o[t],delete o[t]),a["default"].isValidElement(r))throw new Error("cannot interpolate a React component into unsafe text");return e+=r},"");return o.dangerouslySetInnerHTML={__html:s},a["default"].createElement(t,o)}var i=e.split(p).reduce(function(e,t,n){var r=void 0;if(n%2===0){if(0===t.length)return e;r=t}else r=o[t],delete o[t];return e.push(r),e},[]);return a["default"].createElement(t,o,i)}});t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return l["default"].createElement("div",s({},this.props,{className:u["default"](this.props.className,this.props.modalClassName)}),this.props.children)},t}(l["default"].Component);d.propTypes={modalClassName:l["default"].PropTypes.string},d.defaultProps={modalClassName:"modal-body"},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return l["default"].createElement("div",s({},this.props,{className:u["default"](this.props.className,this.props.modalClassName)}),this.props.children)},t}(l["default"].Component);d.propTypes={modalClassName:l["default"].PropTypes.string},d.defaultProps={modalClassName:"modal-footer"},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return l["default"].createElement("div",s({},this.props,{className:u["default"](this.props.className,this.props.modalClassName)}),this.props.closeButton&&l["default"].createElement("button",{className:"close",onClick:this.props.onHide},l["default"].createElement("span",{"aria-hidden":"true"},"×")),this.props.children)},t}(l["default"].Component);d.__isModalHeader=!0,d.propTypes={"aria-label":l["default"].PropTypes.string,modalClassName:l["default"].PropTypes.string,closeButton:l["default"].PropTypes.bool,onHide:l["default"].PropTypes.func},d.defaultProps={"aria-label":"Close",modalClassName:"modal-header",closeButton:!1},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return l["default"].createElement("h4",s({},this.props,{className:u["default"](this.props.className,this.props.modalClassName)}),this.props.children)},t}(l["default"].Component);d.propTypes={modalClassName:l["default"].PropTypes.string},d.defaultProps={modalClassName:"modal-title"},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(5),l=o(i),p=n(17),u=o(p),d=n(4),f=o(d),c=n(9),h=o(c),m=n(10),v=o(m),y=a["default"].createClass({displayName:"Nav",mixins:[l["default"]],propTypes:{activeHref:a["default"].PropTypes.string,activeKey:a["default"].PropTypes.any,bsStyle:a["default"].PropTypes.oneOf(["tabs","pills"]),stacked:a["default"].PropTypes.bool,justified:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,collapsible:a["default"].PropTypes.bool,className:a["default"].PropTypes.string,id:a["default"].PropTypes.string,ulClassName:a["default"].PropTypes.string,ulId:a["default"].PropTypes.string,expanded:a["default"].PropTypes.bool,navbar:a["default"].PropTypes.bool,eventKey:a["default"].PropTypes.any,pullRight:a["default"].PropTypes.bool,right:a["default"].PropTypes.bool},getDefaultProps:function(){return{bsClass:"nav",expanded:!0}},render:function(){var e=this.props.collapsible?"navbar-collapse":null;return this.props.navbar&&!this.props.collapsible?this.renderUl():a["default"].createElement(u["default"],{"in":this.props.expanded},a["default"].createElement("nav",r({},this.props,{className:f["default"](this.props.className,e)}),this.renderUl()))},renderUl:function(){var e=this.getBsClassSet();return e["nav-stacked"]=this.props.stacked,e["nav-justified"]=this.props.justified,e["navbar-nav"]=this.props.navbar,e["pull-right"]=this.props.pullRight,e["navbar-right"]=this.props.right,a["default"].createElement("ul",r({},this.props,{role:"tabs"===this.props.bsStyle?"tablist":null,className:f["default"](this.props.ulClassName,e),id:this.props.ulId,ref:"ul"}),h["default"].map(this.props.children,this.renderNavItem))},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},renderNavItem:function(e,t){return s.cloneElement(e,{role:"tabs"===this.props.bsStyle?"tab":null,active:this.getChildActiveProp(e),activeKey:this.props.activeKey,activeHref:this.props.activeHref,onSelect:v["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t,navItem:!0})}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(13)["default"],o=n(3)["default"],s=n(1)["default"];t.__esModule=!0;var a=n(2),i=s(a),l=n(4),p=s(l),u=n(5),d=s(u),f=n(14),c=s(f),h=i["default"].createClass({displayName:"NavItem",mixins:[d["default"]],propTypes:{linkId:i["default"].PropTypes.string,onSelect:i["default"].PropTypes.func,active:i["default"].PropTypes.bool,disabled:i["default"].PropTypes.bool,href:i["default"].PropTypes.string,role:i["default"].PropTypes.string,title:i["default"].PropTypes.node,eventKey:i["default"].PropTypes.any,target:i["default"].PropTypes.string,"aria-controls":i["default"].PropTypes.string},render:function(){var e=this.props,t=e.role,n=e.linkId,s=e.disabled,a=e.active,l=e.href,u=e.title,d=e.target,f=e.children,h=e["aria-controls"],m=r(e,["role","linkId","disabled","active","href","title","target","children","aria-controls"]),v={active:a,disabled:s},y={role:t,href:l,title:u,target:d,id:n,onClick:this.handleClick};return t||"#"!==l||(y.role="button"),i["default"].createElement("li",o({},m,{role:"presentation",className:p["default"](m.className,v)}),i["default"].createElement(c["default"],o({},y,{"aria-selected":a,"aria-controls":h}),f))},handleClick:function(e){this.props.onSelect&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(13)["default"],i=n(1)["default"];t.__esModule=!0;var l=n(2),p=i(l),u=n(26),d=i(u),f=n(47),c=i(f),h=n(89),m=i(h),v=n(6),y=i(v),g=n(34),b=i(g),T=n(4),P=i(T),E=function(e){function t(n,r){o(this,t),e.call(this,n,r),this.state={exited:!n.show},this.onHiddenListener=this.handleHidden.bind(this)}return r(t,e),t.prototype.componentWillReceiveProps=function(e){e.show?this.setState({exited:!1}):e.animation||this.setState({exited:!0})},t.prototype.render=function(){var e=this.props,t=e.container,n=e.containerPadding,r=e.target,o=e.placement,s=e.rootClose,i=e.children,u=e.animation,f=a(e,["container","containerPadding","target","placement","rootClose","children","animation"]);u===!0&&(u=b["default"]);var h=f.show||u&&!this.state.exited;if(!h)return null;var v=i;if(v=p["default"].createElement(c["default"],{container:t,containerPadding:n,target:r,placement:o},v),u){var y=f.onExit,g=f.onExiting,T=f.onEnter,E=f.onEntering,x=f.onEntered;v=p["default"].createElement(u,{"in":f.show,transitionAppear:!0,onExit:y,onExiting:g,onExited:this.onHiddenListener,onEnter:T,onEntering:E,onEntered:x},v)}else v=l.cloneElement(v,{className:P["default"]("in",v.props.className)});return s&&(v=p["default"].createElement(m["default"],{onRootClose:f.onHide},v)),p["default"].createElement(d["default"],{container:t},v)},t.prototype.handleHidden=function(){if(this.setState({exited:!0}),this.props.onExited){var e;(e=this.props).onExited.apply(e,arguments)}},t}(p["default"].Component);E.propTypes=s({},d["default"].propTypes,c["default"].propTypes,{show:p["default"].PropTypes.bool,rootClose:p["default"].PropTypes.bool,onHide:p["default"].PropTypes.func,animation:p["default"].PropTypes.oneOfType([p["default"].PropTypes.bool,y["default"].elementType]),onEnter:p["default"].PropTypes.func,onEntering:p["default"].PropTypes.func,onEntered:p["default"].PropTypes.func,onExit:p["default"].PropTypes.func,onExiting:p["default"].PropTypes.func,onExited:p["default"].PropTypes.func}),E.defaultProps={animation:b["default"]},t["default"]=E,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(9),f=o(d),c=a["default"].createClass({displayName:"PanelGroup",mixins:[u["default"]],propTypes:{accordion:a["default"].PropTypes.bool,activeKey:a["default"].PropTypes.any,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node,defaultActiveKey:a["default"].PropTypes.any,onSelect:a["default"].PropTypes.func},getDefaultProps:function(){return{bsClass:"panel-group"}},getInitialState:function(){var e=this.props.defaultActiveKey;return{activeKey:e}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e),onSelect:null}),f["default"].map(this.props.children,this.renderPanel))},renderPanel:function(e,t){var n=null!=this.props.activeKey?this.props.activeKey:this.state.activeKey,r={bsStyle:e.props.bsStyle||this.props.bsStyle,key:e.key?e.key:t,ref:e.ref};return this.props.accordion&&(r.collapsible=!0,r.expanded=e.props.eventKey===n,r.onSelect=this.handleSelect),s.cloneElement(e,r)},shouldComponentUpdate:function(){return!this._isChanging},handleSelect:function(e,t){e.preventDefault(),this.props.onSelect&&(this._isChanging=!0,this.props.onSelect(t),this._isChanging=!1),this.state.activeKey===t&&(t=null),this.setState({activeKey:t})}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(13)["default"],i=n(1)["default"];t.__esModule=!0;var l=n(2),p=i(l),u=n(4),d=i(u),f=n(12),c=i(f),h=n(102),m=n(6),v=i(m),y=function(e){function t(n,r){o(this,t),e.call(this,n,r),this.state={positionLeft:null,positionTop:null,arrowOffsetLeft:null,arrowOffsetTop:null},this._needsFlush=!1,this._lastTarget=null}return r(t,e),t.prototype.componentDidMount=function(){this.updatePosition()},t.prototype.componentWillReceiveProps=function(){this._needsFlush=!0},t.prototype.componentDidUpdate=function(){this._needsFlush&&(this._needsFlush=!1,this.updatePosition())},t.prototype.componentWillUnmount=function(){this._lastTarget=null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.className,r=a(e,["children","className"]),o=this.state,i=o.positionLeft,u=o.positionTop,f=a(o,["positionLeft","positionTop"]),c=p["default"].Children.only(t);return l.cloneElement(c,s({},r,f,{positionTop:u,positionLeft:i,className:d["default"](n,c.props.className),style:s({},c.props.style,{left:i,top:u})}))},t.prototype.getTargetSafe=function(){if(!this.props.target)return null;var e=this.props.target(this.props);return e?e:null},t.prototype.updatePosition=function(){var e=this.getTargetSafe();if(e!==this._lastTarget){if(this._lastTarget=e,!e)return void this.setState({positionLeft:null,positionTop:null,arrowOffsetLeft:null,arrowOffsetTop:null});var t=p["default"].findDOMNode(this),n=p["default"].findDOMNode(this.props.container)||c["default"].ownerDocument(this).body;this.setState(h.calcOverlayPosition(this.props.placement,t,e,n,this.props.containerPadding))}},t}(p["default"].Component);y.propTypes={target:p["default"].PropTypes.func,container:v["default"].mountable,containerPadding:p["default"].PropTypes.number,placement:p["default"].PropTypes.oneOf(["top","right","bottom","left"])},y.defaultProps={containerPadding:0,placement:"right"},t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(){}var o=n(8)["default"],s=n(7)["default"],a=n(3)["default"],i=n(13)["default"],l=n(15)["default"],p=n(1)["default"];t.__esModule=!0;var u=n(2),d=p(u),f=n(20),c=p(f),h=n(4),m=p(h),v=0;t.UNMOUNTED=v;var y=1;t.EXITED=y;var g=2;t.ENTERING=g;var b=3;t.ENTERED=b;var T=4;t.EXITING=T;var P=function(e){function t(n,r){s(this,t),e.call(this,n,r);var o=void 0;o=n["in"]?n.transitionAppear?y:b:n.unmountOnExit?v:y,this.state={status:o},this.nextCallback=null}return o(t,e),t.prototype.componentDidMount=function(){this.props.transitionAppear&&this.props["in"]&&this.performEnter(this.props)},t.prototype.componentWillReceiveProps=function(e){var t=this.state.status;e["in"]?t===T?this.performEnter(e):this.props.unmountOnExit?t===v&&this.setState({status:y}):t===y&&this.performEnter(e):(t===g||t===b)&&this.performExit(e)},t.prototype.componentDidUpdate=function(){this.props.unmountOnExit&&this.state.status===y&&(this.props["in"]?this.performEnter(this.props):this.setState({status:v}))},t.prototype.componentWillUnmount=function(){this.cancelNextCallback()},t.prototype.performEnter=function(e){var t=this;this.cancelNextCallback();var n=d["default"].findDOMNode(this);e.onEnter(n),this.safeSetState({status:g},function(){t.props.onEntering(n),t.onTransitionEnd(n,function(){t.safeSetState({status:b},function(){t.props.onEntered(n)})})})},t.prototype.performExit=function(e){var t=this;this.cancelNextCallback();var n=d["default"].findDOMNode(this);e.onExit(n),this.safeSetState({status:T},function(){t.props.onExiting(n),t.onTransitionEnd(n,function(){t.safeSetState({status:y},function(){t.props.onExited(n)})})})},t.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.prototype.safeSetState=function(e,t){this.setState(e,this.setNextCallback(t))},t.prototype.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},t.prototype.onTransitionEnd=function(e,t){this.setNextCallback(t),e?(c["default"].addEndEventListener(e,this.nextCallback),setTimeout(this.nextCallback,this.props.duration)):setTimeout(this.nextCallback,0)},t.prototype.render=function(){var e=this.state.status;if(e===v)return null;var n=this.props,r=n.children,o=n.className,s=i(n,["children","className"]);l(t.propTypes).forEach(function(e){return delete s[e]});var p=void 0;e===y?p=this.props.exitedClassName:e===g?p=this.props.enteringClassName:e===b?p=this.props.enteredClassName:e===T&&(p=this.props.exitingClassName);var u=d["default"].Children.only(r);return d["default"].cloneElement(u,a({},s,{className:m["default"](u.props.className,o,p)}))},t}(d["default"].Component);P.propTypes={"in":d["default"].PropTypes.bool,unmountOnExit:d["default"].PropTypes.bool,transitionAppear:d["default"].PropTypes.bool,duration:d["default"].PropTypes.number,exitedClassName:d["default"].PropTypes.string,exitingClassName:d["default"].PropTypes.string,enteredClassName:d["default"].PropTypes.string,enteringClassName:d["default"].PropTypes.string,onEnter:d["default"].PropTypes.func,onEntering:d["default"].PropTypes.func,onEntered:d["default"].PropTypes.func,onExit:d["default"].PropTypes.func,onExiting:d["default"].PropTypes.func,onExited:d["default"].PropTypes.func},P.defaultProps={"in":!1,duration:300,unmountOnExit:!1,transitionAppear:!1,onEnter:r,onEntering:r,onEntered:r,onExit:r,onExiting:r,onExited:r},t["default"]=P},function(e,t){"use strict";t["default"]=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t},t.__esModule=!0},function(e,t,n){function r(e,t,n){if(!e)throw TypeError(n?t+n:t)}var o=n(11);r.def=o.assertDefined,r.fn=function(e){if(!o.isFunction(e))throw TypeError(e+" is not a function!");return e},r.obj=function(e){if(!o.isObject(e))throw TypeError(e+" is not an object!");return e},r.inst=function(e,t,n){if(!(e instanceof t))throw TypeError(n+": use the 'new' operator!");return e},e.exports=r},function(e,t,n){var r=n(11),o=n(29),s=r.isObject,a=r.toObject;r.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(e,t){var i=(r.core.Object||{})[e]||Object[e],l=0,p={};p[e]=0==t?function(e){return s(e)?i(e):e}:1==t?function(e){return s(e)?i(e):e}:2==t?function(e){return s(e)?i(e):e}:3==t?function(e){return s(e)?i(e):!0}:4==t?function(e){return s(e)?i(e):!0}:5==t?function(e){return s(e)?i(e):!1}:6==t?function(e,t){return i(a(e),t)}:7==t?function(e){return i(Object(r.assertDefined(e)))}:8==t?function(e){return i(a(e))}:n(116).get;try{i("z")}catch(u){l=1}o(o.S+o.F*l,"Object",p)})},function(e,t,n){function r(e){return null!=e&&s(o(e))}var o=n(128),s=n(30);e.exports=r},function(e,t,n){function r(e){return o(e)?e:Object(e)}var o=n(31);e.exports=r},function(e,t,n){function r(e){return s(e)&&o(e)&&i.call(e,"callee")&&!l.call(e,"callee")}var o=n(52),s=n(21),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable;e.exports=r},function(e,t,n){var r=n(129),o=n(30),s=n(21),a="[object Array]",i=Object.prototype,l=i.toString,p=r(Array,"isArray"),u=p||function(e){return s(e)&&o(e.length)&&l.call(e)==a};e.exports=u},function(e,t,n){"use strict";var r=n(138),o=r;e.exports=o},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(46),l=o(i),p=a["default"].createClass({displayName:"Accordion",render:function(){return a["default"].createElement(l["default"],r({},this.props,{accordion:!0}),this.props.children)}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(32),u=o(p),d=n(12),f=o(d),c=a["default"].createClass({displayName:"Affix",statics:{domUtils:f["default"]},mixins:[u["default"]],render:function(){var e={top:this.state.affixPositionTop};return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,this.state.affixClass),style:e}),this.props.children)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=a["default"].createClass({displayName:"Alert",mixins:[u["default"]],propTypes:{onDismiss:a["default"].PropTypes.func,dismissAfter:a["default"].PropTypes.number,closeLabel:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"alert",bsStyle:"info",closeLabel:"Close Alert"}},renderDismissButton:function(){return a["default"].createElement("button",{type:"button",className:"close","aria-label":this.props.closeLabel,onClick:this.props.onDismiss},a["default"].createElement("span",{"aria-hidden":"true"},"×"))},render:function(){var e=this.getBsClassSet(),t=!!this.props.onDismiss;return e["alert-dismissable"]=t,a["default"].createElement("div",r({},this.props,{role:"alert",className:l["default"](this.props.className,e)}),t?this.renderDismissButton():null,this.props.children)},componentDidMount:function(){this.props.dismissAfter&&this.props.onDismiss&&(this.dismissTimer=setTimeout(this.props.onDismiss,this.props.dismissAfter))},componentWillUnmount:function(){clearTimeout(this.dismissTimer)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(9),l=o(i),p=n(4),u=o(p),d=a["default"].createClass({displayName:"Badge",propTypes:{pullRight:a["default"].PropTypes.bool},hasContent:function(){return l["default"].hasValidComponent(this.props.children)||a["default"].Children.count(this.props.children)>1||"string"==typeof this.props.children||"number"==typeof this.props.children},render:function(){var e={"pull-right":this.props.pullRight,badge:this.hasContent()};return a["default"].createElement("span",r({},this.props,{className:u["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=a["default"].createClass({displayName:"ButtonToolbar",mixins:[u["default"]],getDefaultProps:function(){return{bsClass:"button-toolbar"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",r({},this.props,{role:"toolbar",className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(9),f=o(d),c=n(37),h=o(c),m=a["default"].createClass({displayName:"Carousel",mixins:[u["default"]],propTypes:{slide:a["default"].PropTypes.bool,indicators:a["default"].PropTypes.bool,interval:a["default"].PropTypes.number,controls:a["default"].PropTypes.bool,pauseOnHover:a["default"].PropTypes.bool,wrap:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,onSlideEnd:a["default"].PropTypes.func,activeIndex:a["default"].PropTypes.number,defaultActiveIndex:a["default"].PropTypes.number,direction:a["default"].PropTypes.oneOf(["prev","next"]),prevIcon:a["default"].PropTypes.node,nextIcon:a["default"].PropTypes.node},getDefaultProps:function(){return{slide:!0,interval:5e3,pauseOnHover:!0,wrap:!0,indicators:!0,controls:!0,prevIcon:a["default"].createElement(h["default"],{glyph:"chevron-left"}),nextIcon:a["default"].createElement(h["default"],{glyph:"chevron-right"})}},getInitialState:function(){return{activeIndex:null==this.props.defaultActiveIndex?0:this.props.defaultActiveIndex,previousActiveIndex:null,direction:null}},getDirection:function(e,t){return e===t?null:e>t?"prev":"next"},componentWillReceiveProps:function(e){var t=this.getActiveIndex();null!=e.activeIndex&&e.activeIndex!==t&&(clearTimeout(this.timeout),this.setState({previousActiveIndex:t,direction:null!=e.direction?e.direction:this.getDirection(t,e.activeIndex)}))},componentDidMount:function(){this.waitForNext()},componentWillUnmount:function(){clearTimeout(this.timeout)},next:function(e){e&&e.preventDefault();var t=this.getActiveIndex()+1,n=f["default"].numberOf(this.props.children);if(t>n-1){if(!this.props.wrap)return;t=0}this.handleSelect(t,"next")},prev:function(e){e&&e.preventDefault();var t=this.getActiveIndex()-1;if(0>t){if(!this.props.wrap)return;t=f["default"].numberOf(this.props.children)-1}this.handleSelect(t,"prev")},pause:function(){this.isPaused=!0,clearTimeout(this.timeout)},play:function(){this.isPaused=!1,this.waitForNext()},waitForNext:function(){!this.isPaused&&this.props.slide&&this.props.interval&&null==this.props.activeIndex&&(this.timeout=setTimeout(this.next,this.props.interval))},handleMouseOver:function(){this.props.pauseOnHover&&this.pause()},handleMouseOut:function(){this.isPaused&&this.play()},render:function(){var e={carousel:!0,slide:this.props.slide};return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e),onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut}),this.props.indicators?this.renderIndicators():null,a["default"].createElement("div",{className:"carousel-inner",ref:"inner"},f["default"].map(this.props.children,this.renderItem)),this.props.controls?this.renderControls():null)},renderPrev:function(){return a["default"].createElement("a",{className:"left carousel-control",href:"#prev",key:0,onClick:this.prev},this.props.prevIcon)},renderNext:function(){return a["default"].createElement("a",{className:"right carousel-control",href:"#next",key:1,onClick:this.next},this.props.nextIcon)},renderControls:function(){if(!this.props.wrap){var e=this.getActiveIndex(),t=f["default"].numberOf(this.props.children);return[0!==e?this.renderPrev():null,e!==t-1?this.renderNext():null]}return[this.renderPrev(),this.renderNext()]},renderIndicator:function(e,t){var n=t===this.getActiveIndex()?"active":null;return a["default"].createElement("li",{key:t,className:n,onClick:this.handleSelect.bind(this,t,null)})},renderIndicators:function(){var e=[];return f["default"].forEach(this.props.children,function(t,n){e.push(this.renderIndicator(t,n)," ")},this),a["default"].createElement("ol",{className:"carousel-indicators"},e)},getActiveIndex:function(){return null!=this.props.activeIndex?this.props.activeIndex:this.state.activeIndex},handleItemAnimateOutEnd:function(){this.setState({previousActiveIndex:null,direction:null},function(){this.waitForNext(),this.props.onSlideEnd&&this.props.onSlideEnd()})},renderItem:function(e,t){var n=this.getActiveIndex(),r=t===n,o=null!=this.state.previousActiveIndex&&this.state.previousActiveIndex===t&&this.props.slide;return s.cloneElement(e,{active:r,ref:e.ref,key:e.key?e.key:t,index:t,animateOut:o,animateIn:r&&null!=this.state.previousActiveIndex&&this.props.slide,direction:this.state.direction,onAnimateOutEnd:o?this.handleItemAnimateOutEnd:null})},handleSelect:function(e,t){if(clearTimeout(this.timeout),this.isMounted()){var n=this.getActiveIndex();if(t=t||this.getDirection(n,e),this.props.onSelect&&this.props.onSelect(e,t),null==this.props.activeIndex&&e!==n){if(null!=this.state.previousActiveIndex)return;this.setState({activeIndex:e,previousActiveIndex:n,direction:t})}}}});t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(20),u=o(p),d=a["default"].createClass({displayName:"CarouselItem",propTypes:{direction:a["default"].PropTypes.oneOf(["prev","next"]),onAnimateOutEnd:a["default"].PropTypes.func,active:a["default"].PropTypes.bool,animateIn:a["default"].PropTypes.bool,animateOut:a["default"].PropTypes.bool,caption:a["default"].PropTypes.node,index:a["default"].PropTypes.number},getInitialState:function(){return{direction:null}},getDefaultProps:function(){return{animation:!0}},handleAnimateOutEnd:function(){this.props.onAnimateOutEnd&&this.isMounted()&&this.props.onAnimateOutEnd(this.props.index)},componentWillReceiveProps:function(e){this.props.active!==e.active&&this.setState({direction:null})},componentDidUpdate:function(e){!this.props.active&&e.active&&u["default"].addEndEventListener(a["default"].findDOMNode(this),this.handleAnimateOutEnd),this.props.active!==e.active&&setTimeout(this.startAnimation,20)},startAnimation:function(){this.isMounted()&&this.setState({direction:"prev"===this.props.direction?"right":"left"})},render:function(){var e={item:!0,active:this.props.active&&!this.props.animateIn||this.props.animateOut,next:this.props.active&&this.props.animateIn&&"next"===this.props.direction,prev:this.props.active&&this.props.animateIn&&"prev"===this.props.direction};return this.state.direction&&(this.props.animateIn||this.props.animateOut)&&(e[this.state.direction]=!0),a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children,this.props.caption?this.renderCaption():null)},renderCaption:function(){return a["default"].createElement("div",{ className:"carousel-caption"},this.props.caption)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(15)["default"],s=n(1)["default"];t.__esModule=!0;var a=n(2),i=s(a),l=n(4),p=s(l),u=n(18),d=s(u),f=n(6),c=s(f),h=i["default"].createClass({displayName:"Col",propTypes:{xs:i["default"].PropTypes.number,sm:i["default"].PropTypes.number,md:i["default"].PropTypes.number,lg:i["default"].PropTypes.number,xsOffset:i["default"].PropTypes.number,smOffset:i["default"].PropTypes.number,mdOffset:i["default"].PropTypes.number,lgOffset:i["default"].PropTypes.number,xsPush:i["default"].PropTypes.number,smPush:i["default"].PropTypes.number,mdPush:i["default"].PropTypes.number,lgPush:i["default"].PropTypes.number,xsPull:i["default"].PropTypes.number,smPull:i["default"].PropTypes.number,mdPull:i["default"].PropTypes.number,lgPull:i["default"].PropTypes.number,componentClass:c["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass,t={};return o(d["default"].SIZES).forEach(function(e){var n=d["default"].SIZES[e],r=n,o=n+"-";this.props[r]&&(t["col-"+o+this.props[r]]=!0),r=n+"Offset",o=n+"-offset-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0),r=n+"Push",o=n+"-push-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0),r=n+"Pull",o=n+"-pull-",this.props[r]>=0&&(t["col-"+o+this.props[r]]=!0)},this),i["default"].createElement(e,r({},this.props,{className:p["default"](this.props.className,t)}),this.props.children)}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(2),s=r(o),a=n(20),i=r(a),l=n(28),p=r(l),u=!1,d={propTypes:{defaultExpanded:s["default"].PropTypes.bool,expanded:s["default"].PropTypes.bool},getInitialState:function(){var e=null!=this.props.defaultExpanded?this.props.defaultExpanded:null!=this.props.expanded?this.props.expanded:!1;return{expanded:e,collapsing:!1}},componentWillMount:function(){u||(p["default"]("CollapsibleMixin","Collapse Component"),u=!0)},componentWillUpdate:function(e,t){var n=null!=e.expanded?e.expanded:t.expanded;if(n!==this.isExpanded()){var r=this.getCollapsibleDOMNode(),o=this.dimension(),s="0";n||(s=this.getCollapsibleDimensionValue()),r.style[o]=s+"px",this._afterWillUpdate()}},componentDidUpdate:function(e,t){this._checkToggleCollapsing(e,t),this._checkStartAnimation()},_afterWillUpdate:function(){},_checkStartAnimation:function(){if(this.state.collapsing){var e=this.getCollapsibleDOMNode(),t=this.dimension(),n=this.getCollapsibleDimensionValue(),r=void 0;r=this.isExpanded()?n+"px":"0px",e.style[t]=r}},_checkToggleCollapsing:function(e,t){var n=null!=e.expanded?e.expanded:t.expanded,r=this.isExpanded();n!==r&&(n?this._handleCollapse():this._handleExpand())},_handleExpand:function(){var e=this,t=this.getCollapsibleDOMNode(),n=this.dimension(),r=function o(){e._removeEndEventListener(t,o),t.style[n]="",e.setState({collapsing:!1})};this._addEndEventListener(t,r),this.setState({collapsing:!0})},_handleCollapse:function(){var e=this,t=this.getCollapsibleDOMNode(),n=function r(){e._removeEndEventListener(t,r),e.setState({collapsing:!1})};this._addEndEventListener(t,n),this.setState({collapsing:!0})},_addEndEventListener:function(e,t){i["default"].addEndEventListener(e,t)},_removeEndEventListener:function(e,t){i["default"].removeEndEventListener(e,t)},dimension:function(){return"function"==typeof this.getCollapsibleDimension?this.getCollapsibleDimension():"height"},isExpanded:function(){return null!=this.props.expanded?this.props.expanded:this.state.expanded},getCollapsibleClassSet:function(e){var t={};return"string"==typeof e&&e.split(" ").forEach(function(e){e&&(t[e]=!0)}),t.collapsing=this.state.collapsing,t.collapse=!this.state.collapsing,t["in"]=this.isExpanded()&&!this.state.collapsing,t}};t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(2),s=r(o),a=n(5),i=r(a),l=n(17),p=r(l),u=n(4),d=r(u),f=n(9),c=r(f),h=n(10),m=r(h),v=s["default"].createClass({displayName:"CollapsibleNav",mixins:[i["default"]],propTypes:{onSelect:s["default"].PropTypes.func,activeHref:s["default"].PropTypes.string,activeKey:s["default"].PropTypes.any,collapsible:s["default"].PropTypes.bool,expanded:s["default"].PropTypes.bool,eventKey:s["default"].PropTypes.any},render:function(){var e=this.props.collapsible?"navbar-collapse":null,t=this.props.collapsible?this.renderCollapsibleNavChildren:this.renderChildren,n=s["default"].createElement("div",{eventKey:this.props.eventKey,className:d["default"](this.props.className,e)},c["default"].map(this.props.children,t));return this.props.collapsible?s["default"].createElement(p["default"],{"in":this.props.expanded},n):n},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},renderChildren:function(e,t){var n=e.key?e.key:t;return o.cloneElement(e,{activeKey:this.props.activeKey,activeHref:this.props.activeHref,ref:"nocollapse_"+n,key:n,navItem:!0})},renderCollapsibleNavChildren:function(e,t){var n=e.key?e.key:t;return o.cloneElement(e,{active:this.getChildActiveProp(e),activeKey:this.props.activeKey,activeHref:this.props.activeHref,onSelect:m["default"](e.props.onSelect,this.props.onSelect),ref:"collapsible_"+n,key:n,navItem:!0})}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(10),u=o(p),d=n(5),f=o(d),c=n(24),h=o(c),m=n(16),v=o(m),y=n(22),g=o(y),b=n(23),T=o(b),P=n(9),E=o(P),x=a["default"].createClass({displayName:"DropdownButton",mixins:[f["default"],h["default"]],propTypes:{pullRight:a["default"].PropTypes.bool,dropup:a["default"].PropTypes.bool,title:a["default"].PropTypes.node,href:a["default"].PropTypes.string,id:a["default"].PropTypes.string,onClick:a["default"].PropTypes.func,onSelect:a["default"].PropTypes.func,navItem:a["default"].PropTypes.bool,noCaret:a["default"].PropTypes.bool,buttonClassName:a["default"].PropTypes.string,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node},render:function(){var e=this.props.navItem?"renderNavItem":"renderButtonGroup",t=this.props.noCaret?null:a["default"].createElement("span",{className:"caret"});return this[e]([a["default"].createElement(v["default"],r({},this.props,{ref:"dropdownButton",className:l["default"]("dropdown-toggle",this.props.buttonClassName),onClick:u["default"](this.props.onClick,this.handleDropdownClick),key:0,navDropdown:this.props.navItem,navItem:null,title:null,pullRight:null,dropup:null}),this.props.title," ",t),a["default"].createElement(T["default"],{ref:"menu","aria-labelledby":this.props.id,pullRight:this.props.pullRight,key:1},E["default"].map(this.props.children,this.renderMenuItem))])},renderButtonGroup:function(e){var t={open:this.state.open,dropup:this.props.dropup};return a["default"].createElement(g["default"],{bsSize:this.props.bsSize,className:l["default"](this.props.className,t)},e)},renderNavItem:function(e){var t={dropdown:!0,open:this.state.open,dropup:this.props.dropup};return a["default"].createElement("li",{className:l["default"](this.props.className,t)},e)},renderMenuItem:function(e,t){var n=this.props.onSelect||e.props.onSelect?this.handleOptionSelect:null;return s.cloneElement(e,{onSelect:u["default"](e.props.onSelect,n),key:e.key?e.key:t})},handleDropdownClick:function(e){e.preventDefault(),this.setDropdownState(!this.state.open)},handleOptionSelect:function(e){this.props.onSelect&&this.props.onSelect(e),this.setDropdownState(!1)}});t["default"]=x,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n=e.querySelectorAll("."+t.join("."));n=[].map.call(n,function(e){return e});for(var r=0;r<t.length;r++)if(!e.className.match(new RegExp("\\b"+t[r]+"\\b")))return n;return n.unshift(e),n}var o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(12),l=o(i),p=n(28),u=o(p),d=!1;t["default"]={componentWillMount:function(){d||(u["default"]("FadeMixin","Fade Component"),d=!0)},_fadeIn:function(){var e=void 0;this.isMounted()&&(e=r(a["default"].findDOMNode(this),["fade"]),e.length&&e.forEach(function(e){e.className+=" in"}))},_fadeOut:function(){var e=r(this._fadeOutEl,["fade","in"]);e.length&&e.forEach(function(e){e.className=e.className.replace(/\bin\b/,"")}),setTimeout(this._handleFadeOutEnd,300)},_handleFadeOutEnd:function(){this._fadeOutEl&&this._fadeOutEl.parentNode&&this._fadeOutEl.parentNode.removeChild(this._fadeOutEl)},componentDidMount:function(){document.querySelectorAll&&setTimeout(this._fadeIn,20)},componentWillUnmount:function(){var e=r(a["default"].findDOMNode(this),["fade"]),t=this.props.container&&a["default"].findDOMNode(this.props.container)||l["default"].ownerDocument(this).body;e.length&&(this._fadeOutEl=document.createElement("div"),t.appendChild(this._fadeOutEl),this._fadeOutEl.appendChild(a["default"].findDOMNode(this).cloneNode(!0)),setTimeout(this._fadeOut,20))}},e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=n(25),f=a(d),c=n(27),h=a(c),m=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.getValue=function(){var e=this.props,t=e.children,n=e.value;return t?t:n},t.prototype.renderInput=function(){return l["default"].createElement("p",s({},this.props,{className:u["default"](this.props.className,"form-control-static"),ref:"input",key:"input"}),this.getValue())},t}(f["default"]);m.propTypes={value:h["default"],children:h["default"]},t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(6),u=o(p),d=a["default"].createClass({displayName:"Grid",propTypes:{fluid:a["default"].PropTypes.bool,componentClass:u["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass,t=this.props.fluid?"container-fluid":"container";return a["default"].createElement(e,r({},this.props,{className:l["default"](this.props.className,t)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(1)["default"],a=n(49)["default"];t.__esModule=!0;var i=n(2),l=s(i),p=n(25),u=s(p),d=n(35),f=a(d),c=n(28),h=s(c),m=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){return"static"===this.props.type?(h["default"]("Input type=static","StaticText"),l["default"].createElement(f.Static,this.props)):e.prototype.render.call(this)},t}(u["default"]);m.propTypes={type:l["default"].PropTypes.string},t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(6),u=o(p),d=a["default"].createClass({displayName:"Jumbotron",propTypes:{componentClass:u["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass;return a["default"].createElement(e,r({},this.props,{className:l["default"](this.props.className,"jumbotron")}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=a["default"].createClass({displayName:"Label",mixins:[u["default"]],getDefaultProps:function(){return{bsClass:"label",bsStyle:"default"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("span",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(8)["default"],o=n(7)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(4),u=a(p),d=n(9),f=a(d),c=function(e){function t(){o(this,t),e.apply(this,arguments)}return r(t,e),t.prototype.render=function(){var e=this,t=f["default"].map(this.props.children,function(e,t){return i.cloneElement(e,{key:e.key?e.key:t})}),n=!1;return this.props.children?(l["default"].Children.forEach(this.props.children,function(t){e.isAnchor(t.props)&&(n=!0)}),n?this.renderDiv(t):this.renderUL(t)):this.renderDiv(t)},t.prototype.isAnchor=function(e){return e.href||e.onClick},t.prototype.renderUL=function(e){var t=f["default"].map(e,function(e,t){return i.cloneElement(e,{listItem:!0})});return l["default"].createElement("ul",s({},this.props,{className:u["default"](this.props.className,"list-group")}),t)},t.prototype.renderDiv=function(e){return l["default"].createElement("div",s({},this.props,{className:u["default"](this.props.className,"list-group")}),e)},t}(l["default"].Component);c.propTypes={className:l["default"].PropTypes.string,id:l["default"].PropTypes.string},t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(5),l=o(i),p=n(4),u=o(p),d=n(14),f=o(d),c=a["default"].createClass({displayName:"ListGroupItem",mixins:[l["default"]],propTypes:{bsStyle:a["default"].PropTypes.oneOf(["danger","info","success","warning"]),className:a["default"].PropTypes.string,active:a["default"].PropTypes.any,disabled:a["default"].PropTypes.any,header:a["default"].PropTypes.node,listItem:a["default"].PropTypes.bool,onClick:a["default"].PropTypes.func,eventKey:a["default"].PropTypes.any,href:a["default"].PropTypes.string,target:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"list-group-item"}},render:function(){var e=this.getBsClassSet();return e.active=this.props.active,e.disabled=this.props.disabled,this.props.href||this.props.onClick?this.renderAnchor(e):this.props.listItem?this.renderLi(e):this.renderSpan(e)},renderLi:function(e){return a["default"].createElement("li",r({},this.props,{className:u["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderAnchor:function(e){return a["default"].createElement(f["default"],r({},this.props,{className:u["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderSpan:function(e){return a["default"].createElement("span",r({},this.props,{className:u["default"](this.props.className,e)}),this.props.header?this.renderStructuredContent():this.props.children)},renderStructuredContent:function(){var e=void 0;e=a["default"].isValidElement(this.props.header)?s.cloneElement(this.props.header,{key:"header",className:u["default"](this.props.header.props.className,"list-group-item-heading")}):a["default"].createElement("h4",{key:"header",className:"list-group-item-heading"},this.props.header);var t=a["default"].createElement("p",{key:"content",className:"list-group-item-text"},this.props.children);return[e,t]}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(14),u=o(p),d=a["default"].createClass({displayName:"MenuItem",propTypes:{header:a["default"].PropTypes.bool,divider:a["default"].PropTypes.bool,href:a["default"].PropTypes.string,title:a["default"].PropTypes.string,target:a["default"].PropTypes.string,onSelect:a["default"].PropTypes.func,eventKey:a["default"].PropTypes.any,active:a["default"].PropTypes.bool,disabled:a["default"].PropTypes.bool},getDefaultProps:function(){return{active:!1}},handleClick:function(e){return this.props.disabled?void e.preventDefault():void(this.props.onSelect&&(e.preventDefault(),this.props.onSelect(this.props.eventKey,this.props.href,this.props.target)))},renderAnchor:function(){return a["default"].createElement(u["default"],{onClick:this.handleClick,href:this.props.href,target:this.props.target,title:this.props.title,tabIndex:"-1"},this.props.children)},render:function(){var e={"dropdown-header":this.props.header,divider:this.props.divider,active:this.props.active,disabled:this.props.disabled},t=null;return this.props.header?t=this.props.children:this.props.divider||(t=this.renderAnchor()),a["default"].createElement("li",r({},this.props,{role:"presentation",title:null,href:null,className:l["default"](this.props.className,e)}),t)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n=y["default"].ownerDocument(t);return e===n.body||e===n.documentElement?n.documentElement.clientHeight:e.clientHeight}function o(e){return e.props.container&&c["default"].findDOMNode(e.props.container)||y["default"].ownerDocument(e).body}function s(e,t){var n=y["default"].ownerDocument(e),r=!n.addEventListener,o=void 0;return R&&R.remove(),r?(document.attachEvent("onfocusin",t),o=function(){return document.detachEvent("onfocusin",t)}):(document.addEventListener("focus",t,!0),o=function(){return document.removeEventListener("focus",t,!0)}),R={remove:o}}function a(){if(void 0!==j)return j;var e=document.createElement("div");return e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),j=e.offsetWidth-e.clientWidth,document.body.removeChild(e),e=null,j}var i=n(3)["default"],l=n(13)["default"],p=n(105)["default"],u=n(15)["default"],d=n(1)["default"];t.__esModule=!0;var f=n(2),c=d(f),h=n(4),m=d(h),v=n(12),y=d(v),g=n(19),b=d(g),T=n(10),P=d(T),E=n(6),x=d(E),C=n(26),N=d(C),_=n(34),S=d(_),w=n(78),O=d(w),k=n(39),D=d(k),M=n(41),I=d(M),A=n(42),L=d(A),K=n(40),B=d(K),R=void 0,j=void 0,H=c["default"].createClass({displayName:"Modal",propTypes:i({},N["default"].propTypes,O["default"].propTypes,{backdrop:c["default"].PropTypes.oneOf(["static",!0,!1]),keyboard:c["default"].PropTypes.bool,animation:c["default"].PropTypes.bool,dialogComponent:x["default"].elementType,autoFocus:c["default"].PropTypes.bool,enforceFocus:c["default"].PropTypes.bool}),getDefaultProps:function(){return{bsClass:"modal",dialogComponent:O["default"],show:!1,animation:!0,backdrop:!0,keyboard:!0,autoFocus:!0,enforceFocus:!0}},getInitialState:function(){return{exited:!this.props.show}},render:function(){var e=this.props,t=(e.children,e.animation),n=e.backdrop,r=l(e,["children","animation","backdrop"]),o=r.onExit,s=r.onExiting,a=r.onEnter,p=r.onEntering,u=r.onEntered,d=!!r.show,f=r.dialogComponent,h=d||t&&!this.state.exited;if(!h)return null;var v=c["default"].createElement(f,i({},r,{ref:this._setDialogRef,className:m["default"]({"in":d&&!t}),onClick:n===!0?this.handleBackdropClick:null}),this.renderContent());return t&&(v=c["default"].createElement(S["default"],{transitionAppear:!0,unmountOnExit:!0,"in":d,duration:H.TRANSITION_DURATION,onExit:o,onExiting:s,onExited:this.handleHidden,onEnter:a,onEntering:p,onEntered:u},v)),n&&(v=this.renderBackdrop(v)),c["default"].createElement(N["default"],{container:r.container},v)},renderContent:function(){var e=this;return c["default"].Children.map(this.props.children,function(t){return t&&t.type&&t.type.__isModalHeader?f.cloneElement(t,{onHide:P["default"](e.props.onHide,t.props.onHide)}):t})},renderBackdrop:function(e){var t=this.props,n=t.animation,r=t.bsClass,o=H.BACKDROP_TRANSITION_DURATION,s=this.props.backdrop===!0?this.handleBackdropClick:null,a=c["default"].createElement("div",{ref:"backdrop",className:m["default"](r+"-backdrop",{"in":this.props.show&&!n}),onClick:s});return c["default"].createElement("div",{ref:"modal"},n?c["default"].createElement(S["default"],{transitionAppear:!0,"in":this.props.show,duration:o},a):a,e)},_setDialogRef:function(e){p(this.refs)&&!u(this.refs).length&&(this.refs={}),this.refs.dialog=e,this.props.backdrop||(this.refs.modal=e)},componentWillReceiveProps:function(e){e.show?this.setState({exited:!1}):e.animation||this.setState({exited:!0})},componentWillUpdate:function(e){e.show&&this.checkForFocus()},componentDidMount:function(){this.props.show&&this.onShow()},componentDidUpdate:function(e){var t=this.props.animation;!e.show||this.props.show||t?!e.show&&this.props.show&&this.onShow():this.onHide()},componentWillUnmount:function(){this.props.show&&this.onHide()},onShow:function(){var e=this,t=y["default"].ownerDocument(this),n=y["default"].ownerWindow(this);this._onDocumentKeyupListener=b["default"].listen(t,"keyup",this.handleDocumentKeyUp),this._onWindowResizeListener=b["default"].listen(n,"resize",this.handleWindowResize),this.props.enforceFocus&&(this._onFocusinListener=s(this,this.enforceFocus));var i=o(this);i.className+=i.className.length?" modal-open":"modal-open",this._containerIsOverflowing=i.scrollHeight>r(i,this),this._originalPadding=i.style.paddingRight,this._containerIsOverflowing&&(i.style.paddingRight=parseInt(this._originalPadding||0,10)+a()+"px"),this.props.backdrop&&this.iosClickHack(),this.setState(this._getStyles(),function(){return e.focusModalContent()})},onHide:function(){this._onDocumentKeyupListener.remove(),this._onWindowResizeListener.remove(),this._onFocusinListener&&this._onFocusinListener.remove();var e=o(this);e.style.paddingRight=this._originalPadding,e.className=e.className.replace(/ ?modal-open/,""),this.restoreLastFocus()},handleHidden:function(){if(this.setState({exited:!0}),this.onHide(),this.props.onExited){var e;(e=this.props).onExited.apply(e,arguments)}},handleBackdropClick:function(e){e.target===e.currentTarget&&this.props.onHide()},handleDocumentKeyUp:function(e){this.props.keyboard&&27===e.keyCode&&this.props.onHide()},handleWindowResize:function(){this.setState(this._getStyles())},checkForFocus:function(){if(y["default"].canUseDom)try{this.lastFocus=document.activeElement}catch(e){}},focusModalContent:function(){var e=c["default"].findDOMNode(this.refs.dialog),t=y["default"].activeElement(this),n=t&&y["default"].contains(e,t);e&&this.props.autoFocus&&!n&&(this.lastFocus=t,e.focus())},restoreLastFocus:function(){this.lastFocus&&this.lastFocus.focus&&(this.lastFocus.focus(),this.lastFocus=null)},enforceFocus:function(){if(this.isMounted()){var e=y["default"].activeElement(this),t=c["default"].findDOMNode(this.refs.dialog);t&&t!==e&&!y["default"].contains(t,e)&&t.focus()}},iosClickHack:function(){c["default"].findDOMNode(this.refs.modal).onclick=function(){},c["default"].findDOMNode(this.refs.backdrop).onclick=function(){}},_getStyles:function(){if(!y["default"].canUseDom)return{};var e=c["default"].findDOMNode(this.refs.modal),t=e.scrollHeight,n=o(this),s=this._containerIsOverflowing,i=t>r(n,this);return{dialogStyles:{paddingRight:s&&!i?a():void 0,paddingLeft:!s&&i?a():void 0}}}});H.Body=D["default"],H.Header=I["default"],H.Title=L["default"],H.Footer=B["default"],H.Dialog=O["default"],H.TRANSITION_DURATION=300,H.BACKDROP_TRANSITION_DURATION=150,t["default"]=H,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=a["default"].createClass({displayName:"ModalDialog",mixins:[u["default"]],propTypes:{onHide:a["default"].PropTypes.func.isRequired,dialogClassName:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"modal",closeButton:!0}},render:function(){var e={display:"block"},t=this.props.bsClass,n=this.getBsClassSet();return delete n.modal,n[t+"-dialog"]=!0,a["default"].createElement("div",r({},this.props,{title:null,tabIndex:"-1",role:"dialog",style:e,className:l["default"](this.props.className,t)}),a["default"].createElement("div",{className:l["default"](this.props.dialogClassName,n)},a["default"].createElement("div",{className:t+"-content",role:"document"},this.props.children)))}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(5),l=o(i),p=n(4),u=o(p),d=n(9),f=o(d),c=n(10),h=o(c),m=n(6),v=o(m),y=a["default"].createClass({displayName:"Navbar",mixins:[l["default"]],propTypes:{fixedTop:a["default"].PropTypes.bool,fixedBottom:a["default"].PropTypes.bool,staticTop:a["default"].PropTypes.bool,inverse:a["default"].PropTypes.bool,fluid:a["default"].PropTypes.bool,role:a["default"].PropTypes.string,componentClass:v["default"].elementType,brand:a["default"].PropTypes.node,toggleButton:a["default"].PropTypes.node,toggleNavKey:a["default"].PropTypes.oneOfType([a["default"].PropTypes.string,a["default"].PropTypes.number]),onToggle:a["default"].PropTypes.func,navExpanded:a["default"].PropTypes.bool,defaultNavExpanded:a["default"].PropTypes.bool},getDefaultProps:function(){return{bsClass:"navbar",bsStyle:"default",role:"navigation",componentClass:"nav"}},getInitialState:function(){return{navExpanded:this.props.defaultNavExpanded}},shouldComponentUpdate:function(){return!this._isChanging},handleToggle:function(){this.props.onToggle&&(this._isChanging=!0,this.props.onToggle(),this._isChanging=!1),this.setState({navExpanded:!this.state.navExpanded})},isNavExpanded:function(){return null!=this.props.navExpanded?this.props.navExpanded:this.state.navExpanded},render:function(){var e=this.getBsClassSet(),t=this.props.componentClass;return e["navbar-fixed-top"]=this.props.fixedTop,e["navbar-fixed-bottom"]=this.props.fixedBottom,e["navbar-static-top"]=this.props.staticTop,e["navbar-inverse"]=this.props.inverse,a["default"].createElement(t,r({},this.props,{className:u["default"](this.props.className,e)}),a["default"].createElement("div",{className:this.props.fluid?"container-fluid":"container"},this.props.brand||this.props.toggleButton||null!=this.props.toggleNavKey?this.renderHeader():null,f["default"].map(this.props.children,this.renderChild)))},renderChild:function(e,t){return s.cloneElement(e,{navbar:!0,collapsible:null!=this.props.toggleNavKey&&this.props.toggleNavKey===e.props.eventKey,expanded:null!=this.props.toggleNavKey&&this.props.toggleNavKey===e.props.eventKey&&this.isNavExpanded(),key:e.key?e.key:t})},renderHeader:function(){var e=void 0;return this.props.brand&&(e=a["default"].isValidElement(this.props.brand)?s.cloneElement(this.props.brand,{className:u["default"](this.props.brand.props.className,"navbar-brand")}):a["default"].createElement("span",{className:"navbar-brand"},this.props.brand)),a["default"].createElement("div",{className:"navbar-header"},e,this.props.toggleButton||null!=this.props.toggleNavKey?this.renderToggleButton():null)},renderToggleButton:function(){var e=void 0;return a["default"].isValidElement(this.props.toggleButton)?s.cloneElement(this.props.toggleButton,{className:u["default"](this.props.toggleButton.props.className,"navbar-toggle"),onClick:h["default"](this.handleToggle,this.props.toggleButton.props.onClick)}):(e=null!=this.props.toggleButton?this.props.toggleButton:[a["default"].createElement("span",{className:"sr-only",key:0},"Toggle navigation"),a["default"].createElement("span",{className:"icon-bar",key:1}),a["default"].createElement("span",{className:"icon-bar",key:2}),a["default"].createElement("span",{className:"icon-bar",key:3})],a["default"].createElement("button",{className:"navbar-toggle",type:"button",onClick:this.handleToggle},e))}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)?t.indexOf(e)>=0:e===t}var o=n(3)["default"],s=n(15)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(10),u=a(p),d=n(99),f=a(d),c=n(45),h=a(c),m=n(56),v=a(m),y=n(136),g=a(y),b=l["default"].createClass({displayName:"OverlayTrigger",propTypes:o({},h["default"].propTypes,{trigger:l["default"].PropTypes.oneOfType([l["default"].PropTypes.oneOf(["click","hover","focus"]),l["default"].PropTypes.arrayOf(l["default"].PropTypes.oneOf(["click","hover","focus"]))]),delay:l["default"].PropTypes.number,delayShow:l["default"].PropTypes.number,delayHide:l["default"].PropTypes.number,defaultOverlayShown:l["default"].PropTypes.bool,overlay:l["default"].PropTypes.node.isRequired,onBlur:l["default"].PropTypes.func,onClick:l["default"].PropTypes.func,onFocus:l["default"].PropTypes.func,onMouseEnter:l["default"].PropTypes.func,onMouseLeave:l["default"].PropTypes.func,target:function(){},onHide:function(){},show:function(){}}),getDefaultProps:function(){return{trigger:["hover","focus"]}},getInitialState:function(){return{isOverlayShown:null==this.props.defaultOverlayShown?!1:this.props.defaultOverlayShown}},show:function(){this.setState({isOverlayShown:!0})},hide:function(){this.setState({isOverlayShown:!1})},toggle:function(){this.state.isOverlayShown?this.hide():this.show()},componentDidMount:function(){this._mountNode=document.createElement("div"),l["default"].render(this._overlay,this._mountNode)},componentWillUnmount:function(){l["default"].unmountComponentAtNode(this._mountNode),this._mountNode=null,clearTimeout(this._hoverDelay)},componentDidUpdate:function(){this._mountNode&&l["default"].render(this._overlay,this._mountNode)},getOverlayTarget:function(){return l["default"].findDOMNode(this)},getOverlay:function(){var e=o({},g["default"](this.props,s(h["default"].propTypes)),{show:this.state.isOverlayShown,onHide:this.hide,target:this.getOverlayTarget,onExit:this.props.onExit,onExiting:this.props.onExiting,onExited:this.props.onExited,onEnter:this.props.onEnter,onEntering:this.props.onEntering,onEntered:this.props.onEntered}),t=i.cloneElement(this.props.overlay,{placement:e.placement,container:e.container});return l["default"].createElement(h["default"],e,t)},render:function(){var e=l["default"].Children.only(this.props.children),t={"aria-describedby":this.props.overlay.props.id};return this._overlay=this.getOverlay(),t.onClick=u["default"](e.props.onClick,this.props.onClick),r("click",this.props.trigger)&&(t.onClick=u["default"](this.toggle,t.onClick)),r("hover",this.props.trigger)&&(v["default"](!("hover"===this.props.trigger),'[react-bootstrap] Specifying only the `"hover"` trigger limits the visibilty of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'),t.onMouseOver=u["default"](this.handleDelayedShow,this.props.onMouseOver),t.onMouseOut=u["default"](this.handleDelayedHide,this.props.onMouseOut)),r("focus",this.props.trigger)&&(t.onFocus=u["default"](this.handleDelayedShow,this.props.onFocus),t.onBlur=u["default"](this.handleDelayedHide,this.props.onBlur)),i.cloneElement(e,t)},handleDelayedShow:function(){var e=this;if(null!=this._hoverDelay)return clearTimeout(this._hoverDelay),void(this._hoverDelay=null);var t=null!=this.props.delayShow?this.props.delayShow:this.props.delay;return t?void(this._hoverDelay=setTimeout(function(){e._hoverDelay=null,e.show()},t)):void this.show()},handleDelayedHide:function(){var e=this;if(null!=this._hoverDelay)return clearTimeout(this._hoverDelay),void(this._hoverDelay=null);var t=null!=this.props.delayHide?this.props.delayHide:this.props.delay;return t?void(this._hoverDelay=setTimeout(function(){e._hoverDelay=null,e.hide()},t)):void this.hide()}});b.withContext=f["default"](b,"overlay"),t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=a["default"].createClass({displayName:"PageHeader",render:function(){return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,"page-header")}),a["default"].createElement("h1",null,this.props.children))}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(14),u=o(p),d=a["default"].createClass({displayName:"PageItem",propTypes:{href:a["default"].PropTypes.string,target:a["default"].PropTypes.string,title:a["default"].PropTypes.string,disabled:a["default"].PropTypes.bool,previous:a["default"].PropTypes.bool,next:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func, eventKey:a["default"].PropTypes.any},render:function(){var e={disabled:this.props.disabled,previous:this.props.previous,next:this.props.next};return a["default"].createElement("li",r({},this.props,{className:l["default"](this.props.className,e)}),a["default"].createElement(u["default"],{href:this.props.href,title:this.props.title,target:this.props.target,onClick:this.handleSelect},this.props.children))},handleSelect:function(e){(this.props.onSelect||this.props.disabled)&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(9),u=o(p),d=n(10),f=o(d),c=a["default"].createClass({displayName:"Pager",propTypes:{onSelect:a["default"].PropTypes.func},render:function(){return a["default"].createElement("ul",r({},this.props,{className:l["default"](this.props.className,"pager")}),u["default"].map(this.props.children,this.renderPageItem))},renderPageItem:function(e,t){return s.cloneElement(e,{onSelect:f["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(85),f=o(d),c=n(6),h=o(c),m=n(14),v=o(m),y=a["default"].createClass({displayName:"Pagination",mixins:[u["default"]],propTypes:{activePage:a["default"].PropTypes.number,items:a["default"].PropTypes.number,maxButtons:a["default"].PropTypes.number,ellipsis:a["default"].PropTypes.bool,first:a["default"].PropTypes.bool,last:a["default"].PropTypes.bool,prev:a["default"].PropTypes.bool,next:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,buttonComponentClass:h["default"].elementType},getDefaultProps:function(){return{activePage:1,items:1,maxButtons:0,first:!1,last:!1,prev:!1,next:!1,ellipsis:!0,buttonComponentClass:v["default"],bsClass:"pagination"}},renderPageButtons:function(){var e=[],t=void 0,n=void 0,r=void 0,o=this.props,s=o.maxButtons,i=o.activePage,l=o.items,p=o.onSelect,u=o.ellipsis,d=o.buttonComponentClass;if(s){var c=i-parseInt(s/2);t=c>1?c:1,r=l>=t+s,r?n=t+s-1:(n=l,t=l-s+1,1>t&&(t=1))}else t=1,n=l;for(var h=t;n>=h;h++)e.push(a["default"].createElement(f["default"],{key:h,eventKey:h,active:h===i,onSelect:p,buttonComponentClass:d},h));return s&&r&&u&&e.push(a["default"].createElement(f["default"],{key:"ellipsis",disabled:!0,buttonComponentClass:d},a["default"].createElement("span",{"aria-label":"More"},"..."))),e},renderPrev:function(){return this.props.prev?a["default"].createElement(f["default"],{key:"prev",eventKey:this.props.activePage-1,disabled:1===this.props.activePage,onSelect:this.props.onSelect,buttonComponentClass:this.props.buttonComponentClass},a["default"].createElement("span",{"aria-label":"Previous"},"‹")):null},renderNext:function(){return this.props.next?a["default"].createElement(f["default"],{key:"next",eventKey:this.props.activePage+1,disabled:this.props.activePage>=this.props.items,onSelect:this.props.onSelect,buttonComponentClass:this.props.buttonComponentClass},a["default"].createElement("span",{"aria-label":"Next"},"›")):null},renderFirst:function(){return this.props.first?a["default"].createElement(f["default"],{key:"first",eventKey:1,disabled:1===this.props.activePage,onSelect:this.props.onSelect,buttonComponentClass:this.props.buttonComponentClass},a["default"].createElement("span",{"aria-label":"First"},"«")):null},renderLast:function(){return this.props.last?a["default"].createElement(f["default"],{key:"last",eventKey:this.props.items,disabled:this.props.activePage>=this.props.items,onSelect:this.props.onSelect,buttonComponentClass:this.props.buttonComponentClass},a["default"].createElement("span",{"aria-label":"Last"},"»")):null},render:function(){return a["default"].createElement("ul",r({},this.props,{className:l["default"](this.props.className,this.getBsClassSet())}),this.renderFirst(),this.renderPrev(),this.renderPageButtons(),this.renderNext(),this.renderLast())}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(13)["default"],s=n(1)["default"];t.__esModule=!0;var a=n(2),i=s(a),l=n(4),p=s(l),u=n(5),d=s(u),f=n(100),c=s(f),h=n(6),m=s(h),v=i["default"].createClass({displayName:"PaginationButton",mixins:[d["default"]],propTypes:{className:i["default"].PropTypes.string,eventKey:i["default"].PropTypes.oneOfType([i["default"].PropTypes.string,i["default"].PropTypes.number]),onSelect:i["default"].PropTypes.func,disabled:i["default"].PropTypes.bool,active:i["default"].PropTypes.bool,buttonComponentClass:m["default"].elementType},getDefaultProps:function(){return{active:!1,disabled:!1}},handleClick:function(e){if(this.props.onSelect){var t=c["default"](this.props.eventKey);this.props.onSelect(e,t)}},render:function(){var e=r({active:this.props.active,disabled:this.props.disabled},this.getBsClassSet()),t=this.props,n=t.className,s=o(t,["className"]),a=this.props.buttonComponentClass;return i["default"].createElement("li",{className:p["default"](n,e)},i["default"].createElement(a,r({},s,{onClick:this.handleClick})))}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(17),f=o(d),c=a["default"].createClass({displayName:"Panel",mixins:[u["default"]],propTypes:{collapsible:a["default"].PropTypes.bool,onSelect:a["default"].PropTypes.func,header:a["default"].PropTypes.node,id:a["default"].PropTypes.string,footer:a["default"].PropTypes.node,defaultExpanded:a["default"].PropTypes.bool,expanded:a["default"].PropTypes.bool,eventKey:a["default"].PropTypes.any},getDefaultProps:function(){return{bsClass:"panel",bsStyle:"default"}},getInitialState:function(){var e=null!=this.props.defaultExpanded?this.props.defaultExpanded:null!=this.props.expanded?this.props.expanded:!1;return{expanded:e}},handleSelect:function(e){e.selected=!0,this.props.onSelect?this.props.onSelect(e,this.props.eventKey):e.preventDefault(),e.selected&&this.handleToggle()},handleToggle:function(){this.setState({expanded:!this.state.expanded})},isExpanded:function(){return null!=this.props.expanded?this.props.expanded:this.state.expanded},render:function(){return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,this.getBsClassSet()),id:this.props.collapsible?null:this.props.id,onSelect:null}),this.renderHeading(),this.props.collapsible?this.renderCollapsibleBody():this.renderBody(),this.renderFooter())},renderCollapsibleBody:function(){var e=this.prefixClass("collapse");return a["default"].createElement(f["default"],{"in":this.isExpanded()},a["default"].createElement("div",{className:e,id:this.props.id,ref:"panel","aria-expanded":this.isExpanded()},this.renderBody()))},renderBody:function(){function e(){return{key:l.length}}function t(t){l.push(s.cloneElement(t,e()))}function n(t){l.push(a["default"].createElement("div",r({className:u},e()),t))}function o(){0!==p.length&&(n(p),p=[])}var i=this.props.children,l=[],p=[],u=this.prefixClass("body");return Array.isArray(i)&&0!==i.length?(i.forEach(function(e){this.shouldRenderFill(e)?(o(),t(e)):p.push(e)}.bind(this)),o()):this.shouldRenderFill(i)?t(i):n(i),l},shouldRenderFill:function(e){return a["default"].isValidElement(e)&&null!=e.props.fill},renderHeading:function(){var e=this.props.header;if(!e)return null;if(!a["default"].isValidElement(e)||Array.isArray(e))e=this.props.collapsible?this.renderCollapsibleTitle(e):e;else{var t=l["default"](this.prefixClass("title"),e.props.className);e=this.props.collapsible?s.cloneElement(e,{className:t,children:this.renderAnchor(e.props.children)}):s.cloneElement(e,{className:t})}return a["default"].createElement("div",{className:this.prefixClass("heading")},e)},renderAnchor:function(e){return a["default"].createElement("a",{href:"#"+(this.props.id||""),"aria-controls":this.props.collapsible?this.props.id:null,className:this.isExpanded()?null:"collapsed","aria-expanded":this.isExpanded(),onClick:this.handleSelect},e)},renderCollapsibleTitle:function(e){return a["default"].createElement("h4",{className:this.prefixClass("title")},this.renderAnchor(e))},renderFooter:function(){return this.props.footer?a["default"].createElement("div",{className:this.prefixClass("footer")},this.props.footer):null}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(6),f=o(d),c=a["default"].createClass({displayName:"Popover",mixins:[u["default"]],propTypes:{id:f["default"].isRequiredForA11y(a["default"].PropTypes.string),placement:a["default"].PropTypes.oneOf(["top","right","bottom","left"]),positionLeft:a["default"].PropTypes.number,positionTop:a["default"].PropTypes.number,arrowOffsetLeft:a["default"].PropTypes.oneOfType([a["default"].PropTypes.number,a["default"].PropTypes.string]),arrowOffsetTop:a["default"].PropTypes.oneOfType([a["default"].PropTypes.number,a["default"].PropTypes.string]),title:a["default"].PropTypes.node},getDefaultProps:function(){return{placement:"right"}},render:function(){var e,t=(e={popover:!0},e[this.props.placement]=!0,e),n={left:this.props.positionLeft,top:this.props.positionTop,display:"block"},o={left:this.props.arrowOffsetLeft,top:this.props.arrowOffsetTop};return a["default"].createElement("div",r({role:"tooltip"},this.props,{className:l["default"](this.props.className,t),style:n,title:null}),a["default"].createElement("div",{className:"arrow",style:o}),this.props.title?this.renderTitle():null,a["default"].createElement("div",{className:"popover-content"},this.props.children))},renderTitle:function(){return a["default"].createElement("h3",{className:"popover-title"},this.props.title)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){if(e[t]){var r=function(){var r=void 0,o=void 0;return i["default"].Children.forEach(e[t],function(e){e.type!==v&&(o=e.type.displayName?e.type.displayName:e.type,r=new Error("Children of "+n+" can contain only ProgressBar components. Found "+o))}),{v:r}}();if("object"==typeof r)return r.v}}var o=n(3)["default"],s=n(1)["default"];t.__esModule=!0;var a=n(2),i=s(a),l=n(38),p=s(l),u=n(5),d=s(u),f=n(4),c=s(f),h=n(9),m=s(h),v=i["default"].createClass({displayName:"ProgressBar",propTypes:{min:a.PropTypes.number,now:a.PropTypes.number,max:a.PropTypes.number,label:a.PropTypes.node,srOnly:a.PropTypes.bool,striped:a.PropTypes.bool,active:a.PropTypes.bool,children:r,className:i["default"].PropTypes.string,interpolateClass:a.PropTypes.node,isChild:a.PropTypes.bool},mixins:[d["default"]],getDefaultProps:function(){return{bsClass:"progress-bar",min:0,max:100}},getPercentage:function(e,t,n){var r=1e3;return Math.round((e-t)/(n-t)*100*r)/r},render:function(){if(this.props.isChild)return this.renderProgressBar();var e=void 0;return e=this.props.children?m["default"].map(this.props.children,this.renderChildBar):this.renderProgressBar(),i["default"].createElement("div",o({},this.props,{className:c["default"](this.props.className,"progress")}),e)},renderChildBar:function(e,t){return a.cloneElement(e,{isChild:!0,key:e.key?e.key:t})},renderProgressBar:function(){var e=this.getPercentage(this.props.now,this.props.min,this.props.max),t=void 0;t="string"==typeof this.props.label?this.renderLabel(e):this.props.label,this.props.srOnly&&(t=i["default"].createElement("span",{className:"sr-only"},t));var n=c["default"](this.props.className,this.getBsClassSet(),{active:this.props.active,"progress-bar-striped":this.props.active||this.props.striped});return i["default"].createElement("div",o({},this.props,{className:n,role:"progressbar",style:{width:e+"%"},"aria-valuenow":this.props.now,"aria-valuemin":this.props.min,"aria-valuemax":this.props.max}),t)},renderLabel:function(e){var t=this.props.interpolateClass||p["default"];return i["default"].createElement(t,{now:this.props.now,min:this.props.min,max:this.props.max,percent:e,bsStyle:this.props.bsStyle},this.props.label)}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){e.nativeEvent[c]=!0}var o=n(8)["default"],s=n(7)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(12),u=a(p),d=n(19),f=a(d),c="__click_was_inside",h=function(e){function t(n){s(this,t),e.call(this,n),this.handleDocumentClick=this.handleDocumentClick.bind(this),this.handleDocumentKeyUp=this.handleDocumentKeyUp.bind(this)}return o(t,e),t.prototype.bindRootCloseHandlers=function(){var e=u["default"].ownerDocument(this);this._onDocumentClickListener=f["default"].listen(e,"click",this.handleDocumentClick),this._onDocumentKeyupListener=f["default"].listen(e,"keyup",this.handleDocumentKeyUp)},t.prototype.handleDocumentClick=function(e){e[c]||this.props.onRootClose()},t.prototype.handleDocumentKeyUp=function(e){27===e.keyCode&&this.props.onRootClose()},t.prototype.unbindRootCloseHandlers=function(){this._onDocumentClickListener&&this._onDocumentClickListener.remove(),this._onDocumentKeyupListener&&this._onDocumentKeyupListener.remove()},t.prototype.componentDidMount=function(){this.bindRootCloseHandlers()},t.prototype.render=function(){return l["default"].createElement("div",{onClick:r},l["default"].Children.only(this.props.children))},t.prototype.getWrappedDOMNode=function(){return l["default"].findDOMNode(this).children[0]},t.prototype.componentWillUnmount=function(){this.unbindRootCloseHandlers()},t}(l["default"].Component);t["default"]=h,h.propTypes={onRootClose:l["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(6),u=o(p),d=a["default"].createClass({displayName:"Row",propTypes:{componentClass:u["default"].elementType},getDefaultProps:function(){return{componentClass:"div"}},render:function(){var e=this.props.componentClass;return a["default"].createElement(e,r({},this.props,{className:l["default"](this.props.className,"row")}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(24),f=o(d),c=n(16),h=o(c),m=n(22),v=o(m),y=n(23),g=o(y),b=a["default"].createClass({displayName:"SplitButton",mixins:[u["default"],f["default"]],propTypes:{pullRight:a["default"].PropTypes.bool,title:a["default"].PropTypes.node,href:a["default"].PropTypes.string,id:a["default"].PropTypes.string,target:a["default"].PropTypes.string,dropdownTitle:a["default"].PropTypes.node,dropup:a["default"].PropTypes.bool,onClick:a["default"].PropTypes.func,onSelect:a["default"].PropTypes.func,disabled:a["default"].PropTypes.bool,className:a["default"].PropTypes.string,children:a["default"].PropTypes.node},getDefaultProps:function(){return{dropdownTitle:"Toggle dropdown"}},render:function(){var e={open:this.state.open,dropup:this.props.dropup},t=a["default"].createElement(h["default"],r({},this.props,{ref:"button",onClick:this.handleButtonClick,title:null,id:null}),this.props.title),n=a["default"].createElement(h["default"],r({},this.props,{ref:"dropdownButton",className:l["default"](this.props.className,"dropdown-toggle"),onClick:this.handleDropdownClick,title:null,href:null,target:null,id:null}),a["default"].createElement("span",{className:"sr-only"},this.props.dropdownTitle),a["default"].createElement("span",{className:"caret"}),a["default"].createElement("span",{style:{letterSpacing:"-.3em"}}," "));return a["default"].createElement(v["default"],{bsSize:this.props.bsSize,className:l["default"](e),id:this.props.id},t,n,a["default"].createElement(g["default"],{ref:"menu",onSelect:this.handleOptionSelect,"aria-labelledby":this.props.id,pullRight:this.props.pullRight},this.props.children))},handleButtonClick:function(e){this.state.open&&this.setDropdownState(!1),this.props.onClick&&this.props.onClick(e,this.props.href,this.props.target)},handleDropdownClick:function(e){e.preventDefault(),this.setDropdownState(!this.state.open)},handleOptionSelect:function(e){this.props.onSelect&&this.props.onSelect(e),this.setDropdownState(!1)}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(9),u=o(p),d=n(10),f=o(d),c=n(5),h=o(c),m=n(14),v=o(m),y=a["default"].createClass({displayName:"SubNav",mixins:[h["default"]],propTypes:{onSelect:a["default"].PropTypes.func,active:a["default"].PropTypes.bool,activeHref:a["default"].PropTypes.string,activeKey:a["default"].PropTypes.any,disabled:a["default"].PropTypes.bool,eventKey:a["default"].PropTypes.any,href:a["default"].PropTypes.string,title:a["default"].PropTypes.string,text:a["default"].PropTypes.node,target:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"nav"}},handleClick:function(e){this.props.onSelect&&(e.preventDefault(),this.props.disabled||this.props.onSelect(this.props.eventKey,this.props.href,this.props.target))},isActive:function(){return this.isChildActive(this)},isChildActive:function(e){if(e.props.active)return!0;if(null!=this.props.activeKey&&this.props.activeKey===e.props.eventKey)return!0;if(null!=this.props.activeHref&&this.props.activeHref===e.props.href)return!0;if(e.props.children){var t=!1;return u["default"].forEach(e.props.children,function(e){this.isChildActive(e)&&(t=!0)},this),t}return!1},getChildActiveProp:function(e){return e.props.active?!0:null!=this.props.activeKey&&e.props.eventKey===this.props.activeKey?!0:null!=this.props.activeHref&&e.props.href===this.props.activeHref?!0:e.props.active},render:function(){var e={active:this.isActive(),disabled:this.props.disabled};return a["default"].createElement("li",r({},this.props,{className:l["default"](this.props.className,e)}),a["default"].createElement(v["default"],{href:this.props.href,title:this.props.title,target:this.props.target,onClick:this.handleClick},this.props.text),a["default"].createElement("ul",{className:"nav"},u["default"].map(this.props.children,this.renderNavItem)))},renderNavItem:function(e,t){return s.cloneElement(e,{active:this.getChildActiveProp(e),onSelect:f["default"](e.props.onSelect,this.props.onSelect),key:e.key?e.key:t})}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(20),u=o(p),d=a["default"].createClass({displayName:"TabPane",propTypes:{active:a["default"].PropTypes.bool,animation:a["default"].PropTypes.bool,onAnimateOutEnd:a["default"].PropTypes.func,disabled:a["default"].PropTypes.bool},getDefaultProps:function(){return{animation:!0}},getInitialState:function(){return{animateIn:!1,animateOut:!1}},componentWillReceiveProps:function(e){this.props.animation&&(this.state.animateIn||!e.active||this.props.active?this.state.animateOut||e.active||!this.props.active||this.setState({animateOut:!0}):this.setState({animateIn:!0}))},componentDidUpdate:function(){this.state.animateIn&&setTimeout(this.startAnimateIn,0),this.state.animateOut&&u["default"].addEndEventListener(a["default"].findDOMNode(this),this.stopAnimateOut)},startAnimateIn:function(){this.isMounted()&&this.setState({animateIn:!1})},stopAnimateOut:function(){this.isMounted()&&(this.setState({animateOut:!1}),this.props.onAnimateOutEnd&&this.props.onAnimateOutEnd())},render:function(){var e={"tab-pane":!0,fade:!0,active:this.props.active||this.state.animateOut,"in":this.props.active&&!this.state.animateIn};return a["default"].createElement("div",r({},this.props,{role:"tabpanel","aria-hidden":!this.props.active,className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){var t=void 0;return f["default"].forEach(e,function(e){null==t&&(t=e.props.eventKey)}),t}var o=n(13)["default"],s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(2),l=a(i),p=n(5),u=a(p),d=n(9),f=a(d),c=n(43),h=a(c),m=n(44),v=a(m),y=function(e,t){return t.props.id?t.props.id:e.id&&e.id+"___panel___"+t.props.eventKey},g=function(e,t){return t.props.id?t.props.id+"___tab":e.id&&e.id+"___tab___"+t.props.eventKey},b=l["default"].createClass({displayName:"TabbedArea",mixins:[u["default"]],propTypes:{activeKey:l["default"].PropTypes.any,defaultActiveKey:l["default"].PropTypes.any,bsStyle:l["default"].PropTypes.oneOf(["tabs","pills"]),animation:l["default"].PropTypes.bool,id:l["default"].PropTypes.string,onSelect:l["default"].PropTypes.func},getDefaultProps:function(){return{bsStyle:"tabs",animation:!0}},getInitialState:function(){var e=null!=this.props.defaultActiveKey?this.props.defaultActiveKey:r(this.props.children);return{activeKey:e,previousActiveKey:null}},componentWillReceiveProps:function(e){var t=this;null!=e.activeKey&&e.activeKey!==this.props.activeKey&&!function(){var n=t.props.activeKey;l["default"].Children.forEach(e.children,function(e){return l["default"].isValidElement(e)&&e.props.eventKey===n?void t.setState({previousActiveKey:n}):void 0}),t.setState({previousActiveKey:null})}()},handlePaneAnimateOutEnd:function(){this.setState({previousActiveKey:null})},render:function(){function e(e){return null!=e.props.tab?this.renderTab(e):null}var t=this.props,n=t.id,r=o(t,["id"]),a=l["default"].createElement(h["default"],s({},r,{activeKey:this.getActiveKey(),onSelect:this.handleSelect,ref:"tabs"}),f["default"].map(this.props.children,e,this));return l["default"].createElement("div",null,a,l["default"].createElement("div",{id:n,className:"tab-content",ref:"panes"},f["default"].map(this.props.children,this.renderPane)))},getActiveKey:function(){return null!=this.props.activeKey?this.props.activeKey:this.state.activeKey},renderPane:function(e,t){var n=this.state.previousActiveKey,r=e.props.eventKey===this.getActiveKey(),o=null==n,s=null!=n&&e.props.eventKey===n;return i.cloneElement(e,{active:r&&(o||!this.props.animation),id:y(this.props,e),"aria-labelledby":g(this.props,e),key:e.key?e.key:t,animation:this.props.animation,onAnimateOutEnd:s?this.handlePaneAnimateOutEnd:null})},renderTab:function(e){var t=e.props,n=t.eventKey,r=t.className,o=t.tab,s=t.disabled;return l["default"].createElement(v["default"],{linkId:g(this.props,e),ref:"tab"+n,"aria-controls":y(this.props,e),eventKey:n,className:r,disabled:s},o)},shouldComponentUpdate:function(){return!this._isChanging},handleSelect:function(e){if(this.props.onSelect)return this._isChanging=!0,this.props.onSelect(e),void(this._isChanging=!1);var t=this.getActiveKey();e!==t&&this.setState({activeKey:e,previousActiveKey:t})}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=a["default"].createClass({displayName:"Table",propTypes:{striped:a["default"].PropTypes.bool,bordered:a["default"].PropTypes.bool,condensed:a["default"].PropTypes.bool,hover:a["default"].PropTypes.bool,responsive:a["default"].PropTypes.bool},render:function(){var e={table:!0,"table-striped":this.props.striped,"table-bordered":this.props.bordered,"table-condensed":this.props.condensed,"table-hover":this.props.hover},t=a["default"].createElement("table",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children);return this.props.responsive?a["default"].createElement("div",{className:"table-responsive"},t):t}});t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(14),f=o(d),c=a["default"].createClass({displayName:"Thumbnail",mixins:[u["default"]],propTypes:{alt:a["default"].PropTypes.string,href:a["default"].PropTypes.string,src:a["default"].PropTypes.string},getDefaultProps:function(){return{bsClass:"thumbnail"}},render:function(){var e=this.getBsClassSet();return this.props.href?a["default"].createElement(f["default"],r({},this.props,{href:this.props.href,className:l["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt})):this.props.children?a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt}),a["default"].createElement("div",{className:"caption"},this.props.children)):a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e)}),a["default"].createElement("img",{src:this.props.src,alt:this.props.alt}))}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=n(6),f=o(d),c=a["default"].createClass({displayName:"Tooltip",mixins:[u["default"]],propTypes:{id:f["default"].isRequiredForA11y(a["default"].PropTypes.string),placement:a["default"].PropTypes.oneOf(["top","right","bottom","left"]),positionLeft:a["default"].PropTypes.number,positionTop:a["default"].PropTypes.number,arrowOffsetLeft:a["default"].PropTypes.oneOfType([a["default"].PropTypes.number,a["default"].PropTypes.string]),arrowOffsetTop:a["default"].PropTypes.oneOfType([a["default"].PropTypes.number,a["default"].PropTypes.string]),title:a["default"].PropTypes.node},getDefaultProps:function(){return{placement:"right"}},render:function(){var e,t=(e={tooltip:!0},e[this.props.placement]=!0,e),n=r({left:this.props.positionLeft,top:this.props.positionTop},this.props.style),o={left:this.props.arrowOffsetLeft,top:this.props.arrowOffsetTop};return a["default"].createElement("div",r({role:"tooltip"},this.props,{className:l["default"](this.props.className,t),style:n}),a["default"].createElement("div",{className:"tooltip-arrow",style:o}),a["default"].createElement("div",{className:"tooltip-inner"},this.props.children))}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(3)["default"],o=n(1)["default"];t.__esModule=!0;var s=n(2),a=o(s),i=n(4),l=o(i),p=n(5),u=o(p),d=a["default"].createClass({displayName:"Well",mixins:[u["default"]],getDefaultProps:function(){return{bsClass:"well"}},render:function(){var e=this.getBsClassSet();return a["default"].createElement("div",r({},this.props,{className:l["default"](this.props.className,e)}),this.props.children)}});t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return function(n){var r=function(e){function t(){s(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.getChildContext=function(){return this.props.context},t.prototype.render=function(){var e=this.props,t=e.wrapped,n=(e.context,i(e,["wrapped","context"]));return u["default"].cloneElement(t,n)},t}(u["default"].Component);r.childContextTypes=n;var l=function(){function n(){s(this,n)}return n.prototype.render=function(){var n=a({},this.props);return n[t]=this.getWrappedOverlay(),u["default"].createElement(e,n,this.props.children)},n.prototype.getWrappedOverlay=function(){return u["default"].createElement(r,{context:this.context,wrapped:this.props[t]})},n}();return l.contextTypes=n,l}}var o=n(8)["default"],s=n(7)["default"],a=n(3)["default"],i=n(13)["default"],l=n(1)["default"];t.__esModule=!0,t["default"]=r;var p=n(2),u=l(p);e.exports=t["default"]},function(e,t){"use strict";function n(e){var t=!1;return{eventKey:e,preventSelection:function(){t=!0},isSelectionPrevented:function(){return t}}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";var r=n(1)["default"];t.__esModule=!0;var o=n(27),s=r(o);t.childrenValueInputValidation=s["default"];var a=n(10),i=r(a);t.createChainedFunction=i["default"];var l=n(6),p=r(l);t.CustomPropTypes=p["default"];var u=n(12),d=r(u);t.domUtils=d["default"];var f=n(9),c=r(f);t.ValidComponentChildren=c["default"]},function(e,t,n){"use strict";function r(e,t,n,r){var o=p.getContainerDimensions(n),s=o.scroll,a=o.height,i=e-r-s,l=e+r-s+t;return 0>i?-i:l>a?a-l:0}function o(e,t,n,r){var o=p.getContainerDimensions(n),s=o.width,a=e-r,i=e+r+t;return 0>a?-a:i>s?s-i:0}var s=n(3)["default"],a=n(1)["default"];t.__esModule=!0;var i=n(12),l=a(i),p={getContainerDimensions:function(e){var t=void 0,n=void 0;return"BODY"===e.tagName?(t={width:window.innerWidth,height:window.innerHeight},n=l["default"].ownerDocument(e).documentElement.scrollTop||e.scrollTop):(t=l["default"].getSize(e),n=e.scrollTop),s({},t,{scroll:n})},getPosition:function(e,t){var n="BODY"===t.tagName?l["default"].getOffset(e):l["default"].getPosition(e,t),r=l["default"].getSize(e);return s({},n,r)},calcOverlayPosition:function(e,t,n,s,a){var i=p.getPosition(n,s),u=l["default"].getSize(t),d=u.height,f=u.width,c=void 0,h=void 0,m=void 0,v=void 0;if("left"===e||"right"===e){h=i.top+(i.height-d)/2,c="left"===e?i.left-f:i.left+i.width;var y=r(h,d,s,a);h+=y,v=50*(1-2*y/d)+"%",m=null}else{if("top"!==e&&"bottom"!==e)throw new Error('calcOverlayPosition(): No such placement of "'+e+'" found.');c=i.left+(i.width-f)/2,h="top"===e?i.top-d:i.top+i.height;var g=o(c,f,s,a);c+=g,m=50*(1-2*g/f)+"%",v=null}return{positionLeft:c,positionTop:h,arrowOffsetLeft:m,arrowOffsetTop:v}}};t["default"]=p,e.exports=t["default"]},function(e,t,n){e.exports={"default":n(107),__esModule:!0}},function(e,t,n){e.exports={"default":n(108),__esModule:!0}},function(e,t,n){e.exports={"default":n(109),__esModule:!0}},function(e,t,n){e.exports={"default":n(111),__esModule:!0}},function(e,t,n){n(118),e.exports=n(11).core.Object.assign},function(e,t,n){var r=n(11);e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){n(51),e.exports=n(11).core.Object.isFrozen},function(e,t,n){n(51),e.exports=n(11).core.Object.keys},function(e,t,n){n(119),e.exports=n(11).core.Object.setPrototypeOf},function(e,t,n){var r=n(11),o=n(114);e.exports=Object.assign||function(e,t){for(var n=Object(r.assertDefined(e)),s=arguments.length,a=1;s>a;)for(var i,l=r.ES5Object(arguments[a++]),p=o(l),u=p.length,d=0;u>d;)n[i=p[d++]]=l[i];return n}},function(e,t,n){var r=n(50).fn;e.exports=function(e,t,n){if(r(e),~n&&void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(11);e.exports=function(e){var t=r.getKeys(e),n=r.getDesc,o=r.getSymbols;return o&&r.each.call(o(e),function(r){n(e,r).enumerable&&t.push(r)}),t}},function(e,t){e.exports=function(e){return e.FW=!1,e.path=e.core,e}},function(e,t,n){function r(e){try{return a(e)}catch(t){return i.slice()}}var o=n(11),s={}.toString,a=o.getNames,i="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.get=function(e){return i&&"[object Window]"==s.call(e)?r(e):a(o.toObject(e))}},function(e,t,n){function r(e,t){s.obj(e),s(null===t||o.isObject(t),t,": can't set as prototype!")}var o=n(11),s=n(50);e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t){try{t=n(113)(Function.call,o.getDesc(Object.prototype,"__proto__").set,2),t({},[])}catch(s){e=!0}return function(n,o){return r(n,o),e?n.__proto__=o:t(n,o),n}}():void 0),check:r}},function(e,t,n){var r=n(29);r(r.S,"Object",{assign:n(112)})},function(e,t,n){var r=n(29);r(r.S,"Object",{setPrototypeOf:n(117).set})},function(e,t){function n(e,t){if("function"!=typeof e)throw new TypeError(r);return t=o(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,s=o(n.length-t,0),a=Array(s);++r<s;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var i=Array(t+1);for(r=-1;++r<t;)i[r]=n[r];return i[t]=a,e.apply(this,i)}}var r="Expected a function",o=Math.max;e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n]; return e}e.exports=n},function(e,t,n){function r(e,t,n,p){p||(p=[]);for(var u=-1,d=e.length;++u<d;){var f=e[u];l(f)&&i(f)&&(n||a(f)||s(f))?t?r(f,t,n,p):o(p,f):n||(p[p.length]=f)}return p}var o=n(121),s=n(54),a=n(55),i=n(52),l=n(21);e.exports=r},function(e,t,n){var r=n(127),o=r();e.exports=o},function(e,t,n){function r(e,t){return o(e,t,s)}var o=n(123),s=n(135);e.exports=r},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return o;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,s){return e.call(t,n,r,o,s)};case 5:return function(n,r,o,s,a){return e.call(t,n,r,o,s,a)}}return function(){return e.apply(t,arguments)}}var o=n(137);e.exports=r},function(e,t,n){function r(e){return function(t,n,r){for(var s=o(t),a=r(t),i=a.length,l=e?i:-1;e?l--:++l<i;){var p=a[l];if(n(s[p],p,s)===!1)break}return t}}var o=n(53);e.exports=r},function(e,t,n){var r=n(125),o=r("length");e.exports=o},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return o(n)?n:void 0}var o=n(134);e.exports=r},function(e,t){function n(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?o:t,e>-1&&e%1==0&&t>e}var r=/^\d+$/,o=9007199254740991;e.exports=n},function(e,t,n){function r(e,t){e=o(e);for(var n=-1,r=t.length,s={};++n<r;){var a=t[n];a in e&&(s[a]=e[a])}return s}var o=n(53);e.exports=r},function(e,t,n){function r(e,t){var n={};return o(e,function(e,r,o){t(e,r,o)&&(n[r]=e)}),n}var o=n(124);e.exports=r},function(e,t,n){function r(e){return o(e)&&i.call(e)==s}var o=n(31),s="[object Function]",a=Object.prototype,i=a.toString;e.exports=r},function(e,t,n){function r(e){return null==e?!1:o(e)?u.test(l.call(e)):s(e)&&a.test(e)}var o=n(133),s=n(21),a=/^\[object .+?Constructor\]$/,i=Object.prototype,l=Function.prototype.toString,p=i.hasOwnProperty,u=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&i(t)&&(s(e)||o(e))&&t||0;for(var n=e.constructor,r=-1,p="function"==typeof n&&n.prototype===e,d=Array(t),f=t>0;++r<t;)d[r]=r+"";for(var c in e)f&&a(c,t)||"constructor"==c&&(p||!u.call(e,c))||d.push(c);return d}var o=n(54),s=n(55),a=n(130),i=n(30),l=n(31),p=Object.prototype,u=p.hasOwnProperty;e.exports=r},function(e,t,n){var r=n(122),o=n(126),s=n(131),a=n(132),i=n(120),l=i(function(e,t){return null==e?{}:"function"==typeof t[0]?a(e,o(t[0],t[1],3)):s(e,r(t))});e.exports=l},function(e,t){function n(e){return e}e.exports=n},function(e,t){function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r}])}); //# sourceMappingURL=react-bootstrap.min.js.map
docs/src/examples/elements/Input/Variations/index.js
Semantic-Org/Semantic-UI-React
import React from 'react' import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample' import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' import { Message } from 'semantic-ui-react' const InputVariationsExamples = () => ( <ExampleSection title='Variations'> <ComponentExample title='Icon' description='An input can be formatted with an icon.' examplePath='elements/Input/Variations/InputExampleIcon' /> <ComponentExample description='You can position the icon.' examplePath='elements/Input/Variations/InputExampleIconPosition' /> <ComponentExample description='You can pass an Icon props object.' examplePath='elements/Input/Variations/InputExampleIconProps' /> <ComponentExample description='You can pass an Icon element.' examplePath='elements/Input/Variations/InputExampleIconElement' /> <ComponentExample description='You can pass an Icon child.' examplePath='elements/Input/Variations/InputExampleIconChild' > <Message warning> When using <code>children</code>, you must add a placeholder{' '} <code>{'<input />'}</code>. </Message> </ComponentExample> <ComponentExample title='Labeled' description='An input can be formatted with a label.' examplePath='elements/Input/Variations/InputExampleLabeled' /> <ComponentExample description='You can pass any element.' examplePath='elements/Input/Variations/InputExampleRightLabeled' /> <ComponentExample description='You can pass a Label props object.' examplePath='elements/Input/Variations/InputExampleRightLabeledBasic' /> <ComponentExample description='You can pass a Label child.' examplePath='elements/Input/Variations/InputExampleRightLeftLabeled' > <Message warning> Multiple Labels require <code>children</code>. When using{' '} <code>children</code>, you must add a placeholder{' '} <code>{'<input />'}</code>. </Message> </ComponentExample> <ComponentExample examplePath='elements/Input/Variations/InputExampleRightLabeledTag' /> <ComponentExample examplePath='elements/Input/Variations/InputExampleLeftCornerLabeled' /> <ComponentExample examplePath='elements/Input/Variations/InputExampleRightCornerLabeled' /> <ComponentExample title='Action' description='An input can be formatted to alert the user to an action they may perform.' examplePath='elements/Input/Variations/InputExampleAction' /> <ComponentExample description='You can pass a Button props object.' examplePath='elements/Input/Variations/InputExampleLeftActionLabeledButton' /> <ComponentExample description='You can pass any element.' examplePath='elements/Input/Variations/InputExampleActionDropdown' /> <ComponentExample examplePath='elements/Input/Variations/InputExampleActions'> <Message warning> Multiple Actions require <code>children</code>. When using{' '} <code>children</code>, you must add a placeholder{' '} <code>{'<input />'}</code>. </Message> </ComponentExample> <ComponentExample examplePath='elements/Input/Variations/InputExampleActionLabeledButton' /> <ComponentExample examplePath='elements/Input/Variations/InputExampleActionIconButton' /> <ComponentExample title='Transparent' description='A transparent input has no background.' examplePath='elements/Input/Variations/InputExampleTransparent' /> <ComponentExample title='Inverted' description='An input can be formatted to appear on dark backgrounds.' examplePath='elements/Input/Variations/InputExampleInverted' /> <ComponentExample title='Fluid' description='An input can take on the size of its container.' examplePath='elements/Input/Variations/InputExampleFluid' /> <ComponentExample title='Size' description='An input can vary in size.' examplePath='elements/Input/Variations/InputExampleSize' /> </ExampleSection> ) export default InputVariationsExamples
src/svg-icons/av/library-add.js
pomerantsev/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvLibraryAdd = (props) => ( <SvgIcon {...props}> <path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"/> </SvgIcon> ); AvLibraryAdd = pure(AvLibraryAdd); AvLibraryAdd.displayName = 'AvLibraryAdd'; AvLibraryAdd.muiName = 'SvgIcon'; export default AvLibraryAdd;
server/sonar-web/src/main/js/components/shared/avatar.js
abbeyj/sonarqube
import React from 'react'; import md5 from 'blueimp-md5'; export default React.createClass({ propTypes: { email: React.PropTypes.string, size: React.PropTypes.number.isRequired }, render() { const shouldShowAvatar = window.SS && window.SS.lf && window.SS.lf.enableGravatar; if (!shouldShowAvatar) { return null; } const emailHash = md5.md5(this.props.email || '').trim(); const url = ('' + window.SS.lf.gravatarServerUrl) .replace('{EMAIL_MD5}', emailHash) .replace('{SIZE}', this.props.size * 2); return <img className="rounded" src={url} width={this.props.size} height={this.props.size} alt={this.props.email}/>; } });
docs/app/Examples/addons/Radio/Types/RadioExampleSlider.js
clemensw/stardust
import React from 'react' import { Radio } from 'semantic-ui-react' const RadioExampleSlider = () => ( <Radio slider /> ) export default RadioExampleSlider
src/component/canvas/__test__/Gridlines-test.js
bigdatr/pnut
import React from 'react'; import {scaleLinear, scaleBand} from 'd3-scale'; import Gridlines, {GridlinesRenderable} from '../Gridlines'; const xScale = scaleLinear() .domain([0,100]) .range([0,200]); const yScale = scaleLinear() .domain([0,100]) .range([0,200]); const basicGridlinesRenderable = shallow(<GridlinesRenderable xScale={xScale} yScale={yScale} xTicks={scale => scale.ticks()} yTicks={scale => scale.ticks()} />); test('GridlinesRenderable draws lines by default', () => { expect(basicGridlinesRenderable.childAt(0).childAt(0).shallow().type()).toBe('line'); }); const xScaleBand = scaleBand() .domain(['category 1', 'category 2']) .range([0, 200]); const customGridlinesRenderable = shallow(<GridlinesRenderable xScale={xScaleBand} yScale={yScale} xTicks={() => ['category 1', 'category 2']} yTicks={scale => scale.ticks()} lineHorizontal={(props) => { const {coordinates, tick, scale} = props; return <line {...coordinates} strokeWidth="1" stroke="rgba(0,0,0,0.2)"/> }} lineVertical={(props) => { const {coordinates, tick} = props; return <rect x={coordinates.x1 - xScaleBand.bandwidth() / 2} y={coordinates.y1} width={xScaleBand.bandwidth()} height={coordinates.y2 - coordinates.y1} fill='rgba(0,0,0,0.1)'/> }} />); test('GridlinesRenderable accepts a custom rect for vertical line', () => { expect(customGridlinesRenderable.childAt(1).childAt(0).shallow().type()).toBe('rect'); }); test('GridlinesRenderable accepts a custom line for horizontal line', () => { expect(customGridlinesRenderable.childAt(0).childAt(0).shallow().prop('stroke')).toBe('rgba(0,0,0,0.2)'); }); const withBandwidth = shallow(<GridlinesRenderable xScale={xScaleBand} yScale={xScaleBand} xTicks={() => ['category 1', 'category 2']} yTicks={() => ['category 1', 'category 2']} />); test('GridlinesRenderable renders vertical line in middle of bandwidth', () => { expect(withBandwidth.childAt(1).childAt(0).shallow().prop('x1')).toBe(200 / 4); }); test('GridlinesRenderable renders horizontal line in middle of bandwidth', () => { expect(withBandwidth.childAt(0).childAt(0).shallow().prop('y1')).toBe(200 - (200 / 4)); }); test('Gridlines renders a GridlinesRenderable', () => { const scale = scaleLinear().range([0,1]).domain([0,1]); const canvas = shallow(<Gridlines xScale={scale} yScale={scale} />); expect(canvas.name()).toBe('GridlinesRenderable'); }); test('GridlinesRenderable with discrete scales will use domain for ticks. Other will use ticks', () => { const linear = scaleLinear() .domain([0, 100]) .range([0, 200]); const band = scaleBand() .domain(['category1', 'category2']) .range([0, 200]); const linearAxis = shallow(<GridlinesRenderable xScale={linear} yScale={linear}/>); const bandAxis = shallow(<GridlinesRenderable xScale={band} yScale={band}/>); expect(linearAxis.childAt(0).children().length).toBe(11); expect(bandAxis.childAt(0).children().length).toBe(2); });
examples/huge-apps/components/App.js
Dodelkin/react-router
/*globals COURSES:true */ import React from 'react' import Dashboard from './Dashboard' import GlobalNav from './GlobalNav' class App extends React.Component { render() { return ( <div> <GlobalNav /> <div style={{ padding: 20 }}> {this.props.children || <Dashboard courses={COURSES} />} </div> </div> ) } } export default App
src/components/Card/PlayerCard.stories.js
guilhermecvm/react-dribbble-components
import React from 'react' import { storiesOf } from '@storybook/react' import IoIosPlay from 'react-icons/lib/io/ios-play' import IoIosPause from 'react-icons/lib/io/ios-pause' import IoIosFastForward from 'react-icons/lib/io/ios-fastforward' import IoIosRewind from 'react-icons/lib/io/ios-rewind' import IoIosVolume from 'react-icons/lib/io/volume-low' import { Card, CardBackground } from './Card' import { ProgressBar } from '../ProgressBar/ProgressBar' import { Flex } from '../Flex/Flex' const BackgroundDecorator = story => <div style={styles.story}>{story()}</div> storiesOf('Card', module) .addDecorator(BackgroundDecorator) .add('PlayerCard', () => ( <Card width={400}> <CardBackground img="http://www.globalvillage-travel.com/images/phuket/phuketsightseeing.jpg" color="#ffffff" height={150} padding={8} center sepia={0.5} > <div style={{ fontSize: 14, alignSelf: 'flex-start' }}> Despacito - Luis Fonsi ft. Daddy Yankee </div> </CardBackground> <Flex direction="row" justify="space-between" background="#F0E9DD" color="#6F5F5C" > <Flex direction="row" justify="space-between" padding={10} width={120}> <IoIosRewind size={22} style={styles.icon} /> <IoIosPlay size={22} style={styles.icon} color="E18F74" /> <IoIosPause size={22} style={styles.icon} style={styles.pauseIcon} /> <IoIosFastForward size={22} style={styles.icon} /> </Flex> <Flex direction="row" padding={10} width={120} alignItems="center"> <IoIosVolume size={22} /> <Flex pl={5} width={95}> <ProgressBar pct={75} color="#E18F74" height={8} /> </Flex> </Flex> </Flex> </Card> )) const styles = { story: { padding: 50, background: '#6F7078', }, center: { textAlign: 'center', }, pauseIcon: { marginLeft: '-5px', }, }
app/scripts/app.js
DDDas/reactjs-datagrid-widgets
import React from 'react'; import Router from 'react-router'; import ReactDOM from 'react-dom'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import routes from './routes'; let history = createBrowserHistory(); ReactDOM.render(<Router history={history}>{routes}</Router>, document.getElementById('app'));
ajax/libs/swagger-ui/4.0.0/swagger-ui-standalone-preset.min.js
cdnjs/cdnjs
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,function(){return n=[function(t,e,n){t.exports=function(){"use strict";var r=Array.prototype.slice;function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function a(t){return f(t)?t:J(t)}function s(t){return l(t)?t:Z(t)}function c(t){return p(t)?t:X(t)}function i(t){return f(t)&&!h(t)?t:V(t)}function f(t){return!(!t||!t[e])}function l(t){return!(!t||!t[n])}function p(t){return!(!t||!t[o])}function h(t){return l(t)||p(t)}function d(t){return!(!t||!t[u])}t(s,a),t(c,a),t(i,a),a.isIterable=f,a.isKeyed=l,a.isIndexed=p,a.isAssociative=h,a.isOrdered=d,a.Keyed=s,a.Indexed=c,a.Set=i;var e="@@__IMMUTABLE_ITERABLE__@@",n="@@__IMMUTABLE_KEYED__@@",o="@@__IMMUTABLE_INDEXED__@@",u="@@__IMMUTABLE_ORDERED__@@",y="delete",_=5,L=1<<_,w=L-1,g={},v={value:!1},M={value:!1};function m(t){return t.value=!1,t}function j(t){t&&(t.value=!0)}function x(){}function b(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function N(t){return void 0===t.size&&(t.size=t.__iterate(D)),t.size}function S(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295==n)return NaN;e=n}return e<0?N(t)+e:e}function D(){return!0}function I(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&n<=e)}function A(t,e){return T(t,e,0)}function O(t,e){return T(t,e,e)}function T(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var C=0,E=1,z=2,k="function"==typeof Symbol&&Symbol.iterator,U="@@iterator",Y=k||U;function P(t){this.next=t}function R(t,e,n,r){n=0===t?e:1===t?n:[e,n];return r?r.value=n:r={value:n,done:!1},r}function Q(){return{value:void 0,done:!0}}function B(t){return W(t)}function F(t){return t&&"function"==typeof t.next}function G(t){var e=W(t);return e&&e.call(t)}function W(t){t=t&&(k&&t[k]||t[U]);if("function"==typeof t)return t}function q(t){return t&&"number"==typeof t.length}function J(t){return null==t?ut():f(t)?t.toSeq():function(t){var e=ct(t)||"object"==typeof t&&new nt(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}(t)}function Z(t){return null==t?ut().toKeyedSeq():f(t)?l(t)?t.toSeq():t.fromEntrySeq():st(t)}function X(t){return null==t?ut():f(t)?l(t)?t.entrySeq():t.toIndexedSeq():at(t)}function V(t){return(null==t?ut():f(t)?l(t)?t.entrySeq():t:at(t)).toSetSeq()}P.prototype.toString=function(){return"[Iterator]"},P.KEYS=C,P.VALUES=E,P.ENTRIES=z,P.prototype.inspect=P.prototype.toSource=function(){return this.toString()},P.prototype[Y]=function(){return this},t(J,a),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(t,e){return ft(this,t,e,!0)},J.prototype.__iterator=function(t,e){return lt(this,t,e,!0)},t(Z,J),Z.prototype.toKeyedSeq=function(){return this},t(X,J),X.of=function(){return X(arguments)},X.prototype.toIndexedSeq=function(){return this},X.prototype.toString=function(){return this.__toString("Seq [","]")},X.prototype.__iterate=function(t,e){return ft(this,t,e,!1)},X.prototype.__iterator=function(t,e){return lt(this,t,e,!1)},t(V,J),V.of=function(){return V(arguments)},V.prototype.toSetSeq=function(){return this},J.isSeq=ot,J.Keyed=Z,J.Set=V,J.Indexed=X;var H,K,$,tt="@@__IMMUTABLE_SEQ__@@";function et(t){this._array=t,this.size=t.length}function nt(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function rt(t){this._iterable=t,this.size=t.length||t.size}function it(t){this._iterator=t,this._iteratorCache=[]}function ot(t){return!(!t||!t[tt])}function ut(){return H=H||new et([])}function st(t){var e=Array.isArray(t)?new et(t).fromEntrySeq():F(t)?new it(t).fromEntrySeq():B(t)?new rt(t).fromEntrySeq():"object"==typeof t?new nt(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function at(t){var e=ct(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function ct(t){return q(t)?new et(t):F(t)?new it(t):B(t)?new rt(t):void 0}function ft(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var s=i[n?o-u:u];if(!1===e(s[1],r?s[0]:u,t))return u+1}return u}return t.__iterateUncached(e,n)}function lt(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new P(function(){var t=i[n?o-u:u];return u++>o?Q():R(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function pt(t,e){return e?function n(r,i,t,e){return Array.isArray(i)?r.call(e,t,X(i).map(function(t,e){return n(r,t,e,i)})):dt(i)?r.call(e,t,Z(i).map(function(t,e){return n(r,t,e,i)})):i}(e,t,"",{"":t}):ht(t)}function ht(t){return Array.isArray(t)?X(t).map(ht).toList():dt(t)?Z(t).map(ht).toMap():t}function dt(t){return t&&(t.constructor===Object||void 0===t.constructor)}function yt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function gt(n,t){if(n===t)return!0;if(!f(t)||void 0!==n.size&&void 0!==t.size&&n.size!==t.size||void 0!==n.__hash&&void 0!==t.__hash&&n.__hash!==t.__hash||l(n)!==l(t)||p(n)!==p(t)||d(n)!==d(t))return!1;if(0===n.size&&0===t.size)return!0;var r=!h(n);if(d(n)){var i=n.entries();return t.every(function(t,e){var n=i.next().value;return n&&yt(n[1],t)&&(r||yt(n[0],e))})&&i.next().done}var e,o=!1;void 0===n.size&&(void 0===t.size?"function"==typeof n.cacheResult&&n.cacheResult():(o=!0,e=n,n=t,t=e));var u=!0,t=t.__iterate(function(t,e){if(r?!n.has(t):o?!yt(t,n.get(e,g)):!yt(n.get(e,g),t))return u=!1});return u&&n.size===t}function wt(t,e){if(!(this instanceof wt))return new wt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(K)return K;K=this}}function vt(t,e){if(!t)throw new Error(e)}function Mt(t,e,n){if(!(this instanceof Mt))return new Mt(t,e,n);if(vt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if($)return $;$=this}}function _t(){throw TypeError("Abstract")}function Lt(){}function mt(){}function jt(){}J.prototype[tt]=!0,t(et,X),et.prototype.get=function(t,e){return this.has(t)?this._array[S(this,t)]:e},et.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},et.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new P(function(){return r<i?Q():R(t,i,n[e?r-i++:i++])})},t(nt,Z),nt.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},nt.prototype.has=function(t){return this._object.hasOwnProperty(t)},nt.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var u=r[e?i-o:o];if(!1===t(n[u],u,this))return o+1}return o},nt.prototype.__iterator=function(e,n){var r=this._object,i=this._keys,o=i.length-1,u=0;return new P(function(){var t=i[n?o-u:u];return u++>o?Q():R(e,t,r[t])})},nt.prototype[u]=!0,t(rt,X),rt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n,r=G(this._iterable),i=0;if(F(r))for(;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},rt.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=G(this._iterable);if(!F(n))return new P(Q);var r=0;return new P(function(){var t=n.next();return t.done?t:R(e,r++,t.value)})},t(it,X),it.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===t(r[i],i++,this))return i;for(;!(o=n.next()).done;){var o=o.value;if(!1===t(r[i]=o,i++,this))break}return i},it.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new P(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return R(e,i,r[i++])})},t(wt,X),wt.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},wt.prototype.get=function(t,e){return this.has(t)?this._value:e},wt.prototype.includes=function(t){return yt(this._value,t)},wt.prototype.slice=function(t,e){var n=this.size;return I(t,e,n)?this:new wt(this._value,O(e,n)-A(t,n))},wt.prototype.reverse=function(){return this},wt.prototype.indexOf=function(t){return yt(this._value,t)?0:-1},wt.prototype.lastIndexOf=function(t){return yt(this._value,t)?this.size:-1},wt.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},wt.prototype.__iterator=function(t,e){var n=this,r=0;return new P(function(){return r<n.size?R(t,r++,n._value):Q()})},wt.prototype.equals=function(t){return t instanceof wt?yt(this._value,t._value):gt(t)},t(Mt,X),Mt.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Mt.prototype.get=function(t,e){return this.has(t)?this._start+S(this,t)*this._step:e},Mt.prototype.includes=function(t){t=(t-this._start)/this._step;return 0<=t&&t<this.size&&t===Math.floor(t)},Mt.prototype.slice=function(t,e){return I(t,e,this.size)?this:(t=A(t,this.size),(e=O(e,this.size))<=t?new Mt(0,0):new Mt(this.get(t,this._end),this.get(e,this._end),this._step))},Mt.prototype.indexOf=function(t){t-=this._start;if(t%this._step==0){t=t/this._step;if(0<=t&&t<this.size)return t}return-1},Mt.prototype.lastIndexOf=function(t){return this.indexOf(t)},Mt.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},Mt.prototype.__iterator=function(e,n){var r=this.size-1,i=this._step,o=n?this._start+r*i:this._start,u=0;return new P(function(){var t=o;return o+=n?-i:i,r<u?Q():R(e,u++,t)})},Mt.prototype.equals=function(t){return t instanceof Mt?this._start===t._start&&this._end===t._end&&this._step===t._step:gt(this,t)},t(_t,a),t(Lt,_t),t(mt,_t),t(jt,_t),_t.Keyed=Lt,_t.Indexed=mt,_t.Set=jt;var xt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var n=65535&(t|=0),r=65535&(e|=0);return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0};function bt(t){return t>>>1&1073741824|3221225471&t}function Nt(t){if(!1===t||null==t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null==t))return 0;if(!0===t)return 1;var e,n,r=typeof t;if("number"==r){if(t!=t||t===1/0)return 0;var i=0|t;for(i!==t&&(i^=4294967295*t);4294967295<t;)i^=t/=4294967295;return bt(i)}if("string"==r)return t.length>Et?(void 0===(n=Ut[e=t])&&(n=St(e),kt===zt&&(kt=0,Ut={}),kt++,Ut[e]=n),n):St(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"==r)return function(t){var e;if(Ot&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[Ct]))return e;if(!It){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ct]))return e;if(void 0!==(e=function(t){if(t&&0<t.nodeType)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=++Tt,1073741824&Tt&&(Tt=0),Ot)At.set(t,e);else{if(void 0!==Dt&&!1===Dt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(It)Object.defineProperty(t,Ct,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ct]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Ct]=e}}return e}(t);if("function"==typeof t.toString)return St(t.toString());throw new Error("Value type "+r+" cannot be hashed.")}function St(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return bt(e)}var Dt=Object.isExtensible,It=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();var At,Ot="function"==typeof WeakMap;Ot&&(At=new WeakMap);var Tt=0,Ct="__immutablehash__";"function"==typeof Symbol&&(Ct=Symbol(Ct));var Et=16,zt=255,kt=0,Ut={};function Yt(t){vt(t!==1/0,"Cannot perform this action with an infinite size.")}function Pt(e){return null==e?$t():Rt(e)&&!d(e)?e:$t().withMutations(function(n){var t=s(e);Yt(t.size),t.forEach(function(t,e){return n.set(e,t)})})}function Rt(t){return!(!t||!t[Bt])}t(Pt,Lt),Pt.of=function(){var n=r.call(arguments,0);return $t().withMutations(function(t){for(var e=0;e<n.length;e+=2){if(e+1>=n.length)throw new Error("Missing value for key: "+n[e]);t.set(n[e],n[e+1])}})},Pt.prototype.toString=function(){return this.__toString("Map {","}")},Pt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Pt.prototype.set=function(t,e){return te(this,t,e)},Pt.prototype.setIn=function(t,e){return this.updateIn(t,g,function(){return e})},Pt.prototype.remove=function(t){return te(this,t,g)},Pt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return g})},Pt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Pt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);n=function t(e,n,r,i){var o=e===g,u=n.next();if(u.done){var s=o?r:e,a=i(s);return a===s?e:a}vt(o||e&&e.set,"invalid keyPath");a=u.value,u=o?g:e.get(a,g),i=t(u,n,r,i);return i===u?e:i===g?e.remove(a):(o?$t():e).set(a,i)}(this,rn(t),e,n);return n===g?void 0:n},Pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):$t()},Pt.prototype.merge=function(){return ie(this,void 0,arguments)},Pt.prototype.mergeWith=function(t){return ie(this,t,r.call(arguments,1))},Pt.prototype.mergeIn=function(t){var e=r.call(arguments,1);return this.updateIn(t,$t(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Pt.prototype.mergeDeep=function(){return ie(this,oe,arguments)},Pt.prototype.mergeDeepWith=function(t){return ie(this,ue(t),r.call(arguments,1))},Pt.prototype.mergeDeepIn=function(t){var e=r.call(arguments,1);return this.updateIn(t,$t(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Pt.prototype.sort=function(t){return Ae(qe(this,t))},Pt.prototype.sortBy=function(t,e){return Ae(qe(this,e,t))},Pt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Pt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new x)},Pt.prototype.asImmutable=function(){return this.__ensureOwner()},Pt.prototype.wasAltered=function(){return this.__altered},Pt.prototype.__iterator=function(t,e){return new Xt(this,t,e)},Pt.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Pt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Kt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Pt.isMap=Rt;var Qt,Bt="@@__IMMUTABLE_MAP__@@",Ft=Pt.prototype;function Gt(t,e){this.ownerID=t,this.entries=e}function Wt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function qt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function Jt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function Zt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function Xt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Ht(t._root)}function Vt(t,e){return R(t,e[0],e[1])}function Ht(t,e){return{node:t,index:0,__prev:e}}function Kt(t,e,n,r){var i=Object.create(Ft);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function $t(){return Qt=Qt||Kt(0)}function te(t,e,n){if(t._root){var r=m(v),i=m(M),o=ee(t._root,t.__ownerID,0,void 0,e,n,r,i);if(!i.value)return t;r=t.size+(r.value?n===g?-1:1:0)}else{if(n===g)return t;r=1,o=new Gt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=r,t._root=o,t.__hash=void 0,t.__altered=!0,t):o?Kt(r,o):$t()}function ee(t,e,n,r,i,o,u,s){return t?t.update(e,n,r,i,o,u,s):o===g?t:(j(s),j(u),new Zt(e,r,[i,o]))}function ne(t){return t.constructor===Zt||t.constructor===Jt}function re(t,e,n,r,i){if(t.keyHash===r)return new Jt(e,r,[t.entry,i]);var o=(0===n?t.keyHash:t.keyHash>>>n)&w,u=(0===n?r:r>>>n)&w;return new Wt(e,1<<o|1<<u,o==u?[re(t,e,n+_,r,i)]:(i=new Zt(e,r,i),o<u?[t,i]:[i,t]))}function ie(t,e,n){for(var r=[],i=0;i<n.length;i++){var o=n[i],u=s(o);f(o)||(u=u.map(function(t){return pt(t)})),r.push(u)}return se(t,e,r)}function oe(t,e,n){return t&&t.mergeDeep&&f(e)?t.mergeDeep(e):yt(t,e)?t:e}function ue(r){return function(t,e,n){if(t&&t.mergeDeepWith&&f(e))return t.mergeDeepWith(r,e);n=r(t,e,n);return yt(t,n)?t:n}}function se(t,i,n){return 0===(n=n.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(r){for(var t=i?function(e,n){r.update(n,g,function(t){return t===g?e:i(t,e,n)})}:function(t,e){r.set(e,t)},e=0;e<n.length;e++)n[e].forEach(t)}):t.constructor(n[0])}function ae(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ce(t,e,n,r){t=r?t:b(t);return t[e]=n,t}Ft[Bt]=!0,Ft[y]=Ft.remove,Ft.removeIn=Ft.deleteIn,Gt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(yt(n,i[o][0]))return i[o][1];return r},Gt.prototype.update=function(t,e,n,r,i,o,u){for(var s=i===g,a=this.entries,c=0,f=a.length;c<f&&!yt(r,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:s)return this;if(j(u),!s&&l||j(o),!s||1!==a.length){if(!l&&!s&&a.length>=fe)return function(t,e,n,r){for(var i=new Zt(t=t||new x,Nt(n),[n,r]),o=0;o<e.length;o++)var u=e[o],i=i.update(t,0,void 0,u[0],u[1]);return i}(t,a,r,i);u=t&&t===this.ownerID,o=u?a:b(a);return l?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[r,i]:o.push([r,i]),u?(this.entries=o,this):new Gt(t,o)}},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=Nt(n));var i=1<<((0===t?e:e>>>t)&w),o=this.bitmap;return 0==(o&i)?r:this.nodes[ae(o&i-1)].get(t+_,e,n,r)},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=Nt(r));var s=(0===e?n:n>>>e)&w,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===g)return this;var l=ae(c&a-1),p=this.nodes,h=f?p[l]:void 0,u=ee(h,t,e+_,n,r,i,o,u);if(u===h)return this;if(!f&&u&&p.length>=le)return function(t,e,n,r,i){for(var o=0,u=new Array(L),s=0;0!==n;s++,n>>>=1)u[s]=1&n?e[o++]:void 0;return u[r]=i,new qt(t,o+1,u)}(t,p,c,s,u);if(f&&!u&&2===p.length&&ne(p[1^l]))return p[1^l];if(f&&u&&1===p.length&&ne(u))return u;s=t&&t===this.ownerID,a=f?u?c:c^a:c|a,u=f?u?ce(p,l,u,s):function(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,u=0;u<r;u++)i[u]=t[u+(o=u===e?1:o)];return i}(p,l,s):function(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=n,u=-1):o[s]=t[s+u];return o}(p,l,u,s);return s?(this.bitmap=a,this.nodes=u,this):new Wt(t,a,u)},qt.prototype.get=function(t,e,n,r){void 0===e&&(e=Nt(n));var i=this.nodes[(0===t?e:e>>>t)&w];return i?i.get(t+_,e,n,r):r},qt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=Nt(r));var s=(0===e?n:n>>>e)&w,a=i===g,c=this.nodes,f=c[s];if(a&&!f)return this;o=ee(f,t,e+_,n,r,i,o,u);if(o===f)return this;u=this.count;if(f){if(!o&&--u<pe)return function(t,e,n,r){for(var i=0,o=0,u=new Array(n),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==r&&(i|=a,u[o++]=f)}return new Wt(t,i,u)}(t,c,u,s)}else u++;f=t&&t===this.ownerID,o=ce(c,s,o,f);return f?(this.count=u,this.nodes=o,this):new qt(t,u,o)},Jt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(yt(n,i[o][0]))return i[o][1];return r},Jt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=Nt(r));var s=i===g;if(n!==this.keyHash)return s?this:(j(u),j(o),re(this,t,e,n,[r,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!yt(r,a[c][0]);c++);n=c<f;if(n?a[c][1]===i:s)return this;if(j(u),!s&&n||j(o),s&&2===f)return new Zt(t,this.keyHash,a[1^c]);u=t&&t===this.ownerID,o=u?a:b(a);return n?s?c===f-1?o.pop():o[c]=o.pop():o[c]=[r,i]:o.push([r,i]),u?(this.entries=o,this):new Jt(t,this.keyHash,o)},Zt.prototype.get=function(t,e,n,r){return yt(n,this.entry[0])?this.entry[1]:r},Zt.prototype.update=function(t,e,n,r,i,o,u){var s=i===g,a=yt(r,this.entry[0]);return(a?i===this.entry[1]:s)?this:(j(u),s?void j(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new Zt(t,this.keyHash,[r,i]):(j(o),re(this,t,e,Nt(r),[r,i])))},Gt.prototype.iterate=Jt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},Wt.prototype.iterate=qt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},Zt.prototype.iterate=function(t,e){return t(this.entry)},t(Xt,P),Xt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0==i)return Vt(t,r.entry)}else if(r.entries){if(i<=(n=r.entries.length-1))return Vt(t,r.entries[this._reverse?n-i:i])}else if(i<=(n=r.nodes.length-1)){i=r.nodes[this._reverse?n-i:i];if(i){if(i.entry)return Vt(t,i.entry);e=this._stack=Ht(i,e)}continue}e=this._stack=this._stack.__prev}return Q()};var fe=L/4,le=L/2,pe=L/4;function he(t){var e=je();if(null==t)return e;if(de(t))return t;var r=c(t),i=r.size;return 0===i?e:(Yt(i),0<i&&i<L?me(0,i,_,null,new we(r.toArray())):e.withMutations(function(n){n.setSize(i),r.forEach(function(t,e){return n.set(e,t)})}))}function de(t){return!(!t||!t[ye])}t(he,mt),he.of=function(){return this(arguments)},he.prototype.toString=function(){return this.__toString("List [","]")},he.prototype.get=function(t,e){if(0<=(t=S(this,t))&&t<this.size){var n=Ne(this,t+=this._origin);return n&&n.array[t&w]}return e},he.prototype.set=function(t,e){return function(t,e,n){if((e=S(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Se(t,e).set(0,n):Se(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=m(M);return e>=Ie(t._capacity)?r=xe(r,t.__ownerID,0,e,n,o):i=xe(i,t.__ownerID,t._level,e,n,o),o.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):me(t._origin,t._capacity,t._level,i,r):t}(this,t,e)},he.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},he.prototype.insert=function(t,e){return this.splice(t,0,e)},he.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=_,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):je()},he.prototype.push=function(){var n=arguments,r=this.size;return this.withMutations(function(t){Se(t,0,r+n.length);for(var e=0;e<n.length;e++)t.set(r+e,n[e])})},he.prototype.pop=function(){return Se(this,0,-1)},he.prototype.unshift=function(){var n=arguments;return this.withMutations(function(t){Se(t,-n.length);for(var e=0;e<n.length;e++)t.set(e,n[e])})},he.prototype.shift=function(){return Se(this,1)},he.prototype.merge=function(){return De(this,void 0,arguments)},he.prototype.mergeWith=function(t){return De(this,t,r.call(arguments,1))},he.prototype.mergeDeep=function(){return De(this,oe,arguments)},he.prototype.mergeDeepWith=function(t){return De(this,ue(t),r.call(arguments,1))},he.prototype.setSize=function(t){return Se(this,0,t)},he.prototype.slice=function(t,e){var n=this.size;return I(t,e,n)?this:Se(this,A(t,n),O(e,n))},he.prototype.__iterator=function(e,t){var n=0,r=Le(this,t);return new P(function(){var t=r();return t===_e?Q():R(e,n++,t)})},he.prototype.__iterate=function(t,e){for(var n,r=0,i=Le(this,e);(n=i())!==_e&&!1!==t(n,r++,this););return r},he.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?me(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},he.isList=de;var ye="@@__IMMUTABLE_LIST__@@",ge=he.prototype;function we(t,e){this.array=t,this.ownerID=e}ge[ye]=!0,ge[y]=ge.remove,ge.setIn=Ft.setIn,ge.deleteIn=ge.removeIn=Ft.removeIn,ge.update=Ft.update,ge.updateIn=Ft.updateIn,ge.mergeIn=Ft.mergeIn,ge.mergeDeepIn=Ft.mergeDeepIn,ge.withMutations=Ft.withMutations,ge.asMutable=Ft.asMutable,ge.asImmutable=Ft.asImmutable,ge.wasAltered=Ft.wasAltered,we.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&w;if(r>=this.array.length)return new we([],t);var i,o=0==r;if(0<e){var u=this.array[r];if((i=u&&u.removeBefore(t,e-_,n))===u&&o)return this}if(o&&!i)return this;var s=be(this,t);if(!o)for(var a=0;a<r;a++)s.array[a]=void 0;return i&&(s.array[r]=i),s},we.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r,i=n-1>>>e&w;if(i>=this.array.length)return this;if(0<e){var o=this.array[i];if((r=o&&o.removeAfter(t,e-_,n))===o&&i==this.array.length-1)return this}t=be(this,t);return t.array.splice(1+i),r&&(t.array[i]=r),t};var ve,Me,_e={};function Le(t,d){var y=t._origin,g=t._capacity,w=Ie(g),v=t._tail;return M(t._root,t._level,0);function M(t,e,n){return 0===e?(c=t,l=(f=n)===w?v&&v.array:c&&c.array,p=y<f?0:y-f,L<(h=g-f)&&(h=L),function(){if(p===h)return _e;var t=d?--h:p++;return l&&l[t]}):(r=e,i=n,u=(t=t)&&t.array,s=y<i?0:y-i>>r,L<(a=1+(g-i>>r))&&(a=L),function(){for(;;){if(o){var t=o();if(t!==_e)return t;o=null}if(s===a)return _e;t=d?--a:s++;o=M(u&&u[t],r-_,i+(t<<r))}});var r,i,o,u,s,a,c,f,l,p,h}}function me(t,e,n,r,i,o,u){var s=Object.create(ge);return s.size=e-t,s._origin=t,s._capacity=e,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function je(){return ve=ve||me(0,0,_)}function xe(t,e,n,r,i,o){var u,s=r>>>n&w,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(0<n){var c=t&&t.array[s],r=xe(c,e,n-_,r,i,o);return r===c?t:((u=be(t,e)).array[s]=r,u)}return a&&t.array[s]===i?t:(j(o),u=be(t,e),void 0===i&&s==u.array.length-1?u.array.pop():u.array[s]=i,u)}function be(t,e){return e&&t&&e===t.ownerID?t:new we(t?t.array.slice():[],e)}function Ne(t,e){if(e>=Ie(t._capacity))return t._tail;if(e<1<<t._level+_){for(var n=t._root,r=t._level;n&&0<r;)n=n.array[e>>>r&w],r-=_;return n}}function Se(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new x,i=t._origin,o=t._capacity,u=i+e,s=void 0===n?o:n<0?o+n:i+n;if(u===i&&s===o)return t;if(s<=u)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new we(c&&c.array.length?[void 0,c]:[],r),f+=1<<(a+=_);f&&(u+=f,i+=f,s+=f,o+=f);for(var l=Ie(o),p=Ie(s);1<<a+_<=p;)c=new we(c&&c.array.length?[c]:[],r),a+=_;e=t._tail,n=p<l?Ne(t,s-1):l<p?new we([],r):e;if(e&&l<p&&u<o&&e.array.length){for(var h=c=be(c,r),d=a;_<d;d-=_)var y=l>>>d&w,h=h.array[y]=be(h.array[y],r);h.array[l>>>_&w]=e}if(s<o&&(n=n&&n.removeAfter(r,0,s)),p<=u)u-=p,s-=p,a=_,c=null,n=n&&n.removeBefore(r,0,u);else if(i<u||p<l){for(f=0;c;){var g=u>>>a&w;if(g!=p>>>a&w)break;g&&(f+=(1<<a)*g),a-=_,c=c.array[g]}(c=c&&i<u?c.removeBefore(r,a,u-f):c)&&p<l&&(c=c.removeAfter(r,a,p-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=n,t.__hash=void 0,t.__altered=!0,t):me(u,s,a,c,n)}function De(t,e,n){for(var r=[],i=0,o=0;o<n.length;o++){var u=n[o],s=c(u);s.size>i&&(i=s.size),f(u)||(s=s.map(function(t){return pt(t)})),r.push(s)}return se(t=i>t.size?t.setSize(i):t,e,r)}function Ie(t){return t<L?0:t-1>>>_<<_}function Ae(e){return null==e?Ce():Oe(e)?e:Ce().withMutations(function(n){var t=s(e);Yt(t.size),t.forEach(function(t,e){return n.set(e,t)})})}function Oe(t){return Rt(t)&&d(t)}function Te(t,e,n,r){var i=Object.create(Ae.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function Ce(){return Me=Me||Te($t(),je())}function Ee(t,e,n){var r,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(n===g){if(!a)return t;u.size>=L&&u.size>=2*o.size?(r=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(n===u.get(s)[1])return t;r=o,i=u.set(s,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Te(r,i)}function ze(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ke(t){this._iter=t,this.size=t.size}function Ue(t){this._iter=t,this.size=t.size}function Ye(t){this._iter=t,this.size=t.size}function Pe(i){var t=tn(i);return t._iter=i,t.size=i.size,t.flip=function(){return i},t.reverse=function(){var t=i.reverse.apply(this);return t.flip=function(){return i.reverse()},t},t.has=function(t){return i.includes(t)},t.includes=function(t){return i.has(t)},t.cacheResult=en,t.__iterateUncached=function(n,t){var r=this;return i.__iterate(function(t,e){return!1!==n(e,t,r)},t)},t.__iteratorUncached=function(t,e){if(t!==z)return i.__iterator(t===E?C:E,e);var n=i.__iterator(t,e);return new P(function(){var t,e=n.next();return e.done||(t=e.value[0],e.value[0]=e.value[1],e.value[1]=t),e})},t}function Re(o,u,s){var t=tn(o);return t.size=o.size,t.has=function(t){return o.has(t)},t.get=function(t,e){var n=o.get(t,g);return n===g?e:u.call(s,n,t,o)},t.__iterateUncached=function(r,t){var i=this;return o.__iterate(function(t,e,n){return!1!==r(u.call(s,t,e,n),e,i)},t)},t.__iteratorUncached=function(r,t){var i=o.__iterator(z,t);return new P(function(){var t=i.next();if(t.done)return t;var e=t.value,n=e[0];return R(r,n,u.call(s,e[1],n,o),t)})},t}function Qe(i,n){var t=tn(i);return t._iter=i,t.size=i.size,t.reverse=function(){return i},i.flip&&(t.flip=function(){var t=Pe(i);return t.reverse=function(){return i.flip()},t}),t.get=function(t,e){return i.get(n?t:-1-t,e)},t.has=function(t){return i.has(n?t:-1-t)},t.includes=function(t){return i.includes(t)},t.cacheResult=en,t.__iterate=function(n,t){var r=this;return i.__iterate(function(t,e){return n(t,e,r)},!t)},t.__iterator=function(t,e){return i.__iterator(t,!e)},t}function Be(u,s,a,c){var t=tn(u);return c&&(t.has=function(t){var e=u.get(t,g);return e!==g&&!!s.call(a,e,t,u)},t.get=function(t,e){var n=u.get(t,g);return n!==g&&s.call(a,n,t,u)?n:e}),t.__iterateUncached=function(r,t){var i=this,o=0;return u.__iterate(function(t,e,n){if(s.call(a,t,e,n))return o++,r(t,c?e:o-1,i)},t),o},t.__iteratorUncached=function(r,t){var i=u.__iterator(z,t),o=0;return new P(function(){for(;;){var t=i.next();if(t.done)return t;var e=t.value,n=e[0],e=e[1];if(s.call(a,e,n,u))return R(r,c?n:o++,e,t)}})},t}function Fe(s,t,e,a){var n=s.size;if(void 0!==t&&(t|=0),void 0!==e&&(e===1/0?e=n:e|=0),I(t,e,n))return s;var c=A(t,n),n=O(e,n);if(c!=c||n!=n)return Fe(s.toSeq().cacheResult(),t,e,a);var f,n=n-c;n==n&&(f=n<0?0:n);n=tn(s);return n.size=0===f?f:s.size&&f||void 0,!a&&ot(s)&&0<=f&&(n.get=function(t,e){return 0<=(t=S(this,t))&&t<f?s.get(t+c,e):e}),n.__iterateUncached=function(n,t){var r=this;if(0===f)return 0;if(t)return this.cacheResult().__iterate(n,t);var i=0,o=!0,u=0;return s.__iterate(function(t,e){if(!o||!(o=i++<c))return u++,!1!==n(t,a?e:u-1,r)&&u!==f}),u},n.__iteratorUncached=function(e,t){if(0!==f&&t)return this.cacheResult().__iterator(e,t);var n=0!==f&&s.__iterator(e,t),r=0,i=0;return new P(function(){for(;r++<c;)n.next();if(++i>f)return Q();var t=n.next();return a||e===E?t:R(e,i-1,e===C?void 0:t.value[1],t)})},n}function Ge(e,c,f,l){var t=tn(e);return t.__iterateUncached=function(r,t){var i=this;if(t)return this.cacheResult().__iterate(r,t);var o=!0,u=0;return e.__iterate(function(t,e,n){if(!o||!(o=c.call(f,t,e,n)))return u++,r(t,l?e:u-1,i)}),u},t.__iteratorUncached=function(i,t){var o=this;if(t)return this.cacheResult().__iterator(i,t);var u=e.__iterator(z,t),s=!0,a=0;return new P(function(){var t;do{if((t=u.next()).done)return l||i===E?t:R(i,a++,i===C?void 0:t.value[1],t);var e=t.value,n=e[0],r=e[1]}while(s=s&&c.call(f,r,n,o));return i===z?t:R(i,n,r,t)})},t}function We(t,a,c){var e=tn(t);return e.__iterateUncached=function(o,e){var u=0,s=!1;return function n(t,r){var i=this;t.__iterate(function(t,e){return(!a||r<a)&&f(t)?n(t,r+1):!1===o(t,c?e:u++,i)&&(s=!0),!s},e)}(t,0),u},e.__iteratorUncached=function(n,r){var i=t.__iterator(n,r),o=[],u=0;return new P(function(){for(;i;){var t=i.next();if(!1===t.done){var e=t.value;if(n===z&&(e=e[1]),a&&!(o.length<a)||!f(e))return c?t:R(n,u++,e,t);o.push(i),i=e.__iterator(n,r)}else i=o.pop()}return Q()})},e}function qe(n,r,i){r=r||nn;var t=l(n),o=0,u=n.toSeq().map(function(t,e){return[e,t,o++,i?i(t,e,n):t]}).toArray();return u.sort(function(t,e){return r(t[3],e[3])||t[2]-e[2]}).forEach(t?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),(t?Z:p(n)?X:V)(u)}function Je(n,r,i){if(r=r||nn,i){var t=n.toSeq().map(function(t,e){return[t,i(t,e,n)]}).reduce(function(t,e){return Ze(r,t[1],e[1])?e:t});return t&&t[0]}return n.reduce(function(t,e){return Ze(r,t,e)?e:t})}function Ze(t,e,n){t=t(n,e);return 0===t&&n!==e&&(null==n||n!=n)||0<t}function Xe(t,u,s){t=tn(t);return t.size=new et(s).map(function(t){return t.size}).min(),t.__iterate=function(t,e){for(var n,r=this.__iterator(E,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},t.__iteratorUncached=function(e,n){var r=s.map(function(t){return t=a(t),G(n?t.reverse():t)}),i=0,o=!1;return new P(function(){var t;return o||(t=r.map(function(t){return t.next()}),o=t.some(function(t){return t.done})),o?Q():R(e,i++,u.apply(null,t.map(function(t){return t.value})))})},t}function Ve(t,e){return ot(t)?e:t.constructor(e)}function He(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ke(t){return Yt(t.size),N(t)}function $e(t){return l(t)?s:p(t)?c:i}function tn(t){return Object.create((l(t)?Z:p(t)?X:V).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function nn(t,e){return e<t?1:t<e?-1:0}function rn(t){var e=G(t);if(!e){if(!q(t))throw new TypeError("Expected iterable or array-like: "+t);e=G(a(t))}return e}function on(n,r){function i(t){return t instanceof i?t:this instanceof i?(o||(o=!0,e=Object.keys(n),function(t,e){try{e.forEach(function(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){vt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}.bind(void 0,t))}catch(t){}}(u,e),u.size=e.length,u._name=r,u._keys=e,u._defaultValues=n),void(this._map=Pt(t))):new i(t);var e}var o,u=i.prototype=Object.create(un);return u.constructor=i}t(Ae,Pt),Ae.of=function(){return this(arguments)},Ae.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ae.prototype.get=function(t,e){t=this._map.get(t);return void 0!==t?this._list.get(t)[1]:e},Ae.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Ce()},Ae.prototype.set=function(t,e){return Ee(this,t,e)},Ae.prototype.remove=function(t){return Ee(this,t,g)},Ae.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ae.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ae.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Ae.isOrderedMap=Oe,Ae.prototype[u]=!0,Ae.prototype[y]=Ae.prototype.remove,t(ze,Z),ze.prototype.get=function(t,e){return this._iter.get(t,e)},ze.prototype.has=function(t){return this._iter.has(t)},ze.prototype.valueSeq=function(){return this._iter.valueSeq()},ze.prototype.reverse=function(){var t=this,e=Qe(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},ze.prototype.map=function(t,e){var n=this,r=Re(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},ze.prototype.__iterate=function(n,e){var r,i=this;return this._iter.__iterate(this._useKeys?function(t,e){return n(t,e,i)}:(r=e?Ke(this):0,function(t){return n(t,e?--r:r++,i)}),e)},ze.prototype.__iterator=function(e,n){if(this._useKeys)return this._iter.__iterator(e,n);var r=this._iter.__iterator(E,n),i=n?Ke(this):0;return new P(function(){var t=r.next();return t.done?t:R(e,n?--i:i++,t.value,t)})},ze.prototype[u]=!0,t(ke,X),ke.prototype.includes=function(t){return this._iter.includes(t)},ke.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},ke.prototype.__iterator=function(e,t){var n=this._iter.__iterator(E,t),r=0;return new P(function(){var t=n.next();return t.done?t:R(e,r++,t.value,t)})},t(Ue,V),Ue.prototype.has=function(t){return this._iter.includes(t)},Ue.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Ue.prototype.__iterator=function(e,t){var n=this._iter.__iterator(E,t);return new P(function(){var t=n.next();return t.done?t:R(e,t.value,t.value,t)})},t(Ye,Z),Ye.prototype.entrySeq=function(){return this._iter.toSeq()},Ye.prototype.__iterate=function(n,t){var r=this;return this._iter.__iterate(function(t){if(t){He(t);var e=f(t);return n(e?t.get(1):t[1],e?t.get(0):t[0],r)}},t)},Ye.prototype.__iterator=function(r,t){var i=this._iter.__iterator(E,t);return new P(function(){for(;;){var t=i.next();if(t.done)return t;var e=t.value;if(e){He(e);var n=f(e);return R(r,n?e.get(0):e[0],n?e.get(1):e[1],t)}}})},ke.prototype.cacheResult=ze.prototype.cacheResult=Ue.prototype.cacheResult=Ye.prototype.cacheResult=en,t(on,Lt),on.prototype.toString=function(){return this.__toString(an(this)+" {","}")},on.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},on.prototype.get=function(t,e){if(!this.has(t))return e;e=this._defaultValues[t];return this._map?this._map.get(t,e):e},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=sn(this,$t()))},on.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+an(this));if(this._map&&!this._map.has(t)&&e===this._defaultValues[t])return this;e=this._map&&this._map.set(t,e);return this.__ownerID||e===this._map?this:sn(this,e)},on.prototype.remove=function(t){if(!this.has(t))return this;t=this._map&&this._map.remove(t);return this.__ownerID||t===this._map?this:sn(this,t)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(t,e){var n=this;return s(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},on.prototype.__iterate=function(t,e){var n=this;return s(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},on.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?sn(this,e,t):(this.__ownerID=t,this._map=e,this)};var un=on.prototype;function sn(t,e,n){t=Object.create(Object.getPrototypeOf(t));return t._map=e,t.__ownerID=n,t}function an(t){return t._name||t.constructor.name||"Record"}function cn(n){return null==n?gn():fn(n)&&!d(n)?n:gn().withMutations(function(e){var t=i(n);Yt(t.size),t.forEach(function(t){return e.add(t)})})}function fn(t){return!(!t||!t[pn])}un[y]=un.remove,un.deleteIn=un.removeIn=Ft.removeIn,un.merge=Ft.merge,un.mergeWith=Ft.mergeWith,un.mergeIn=Ft.mergeIn,un.mergeDeep=Ft.mergeDeep,un.mergeDeepWith=Ft.mergeDeepWith,un.mergeDeepIn=Ft.mergeDeepIn,un.setIn=Ft.setIn,un.update=Ft.update,un.updateIn=Ft.updateIn,un.withMutations=Ft.withMutations,un.asMutable=Ft.asMutable,un.asImmutable=Ft.asImmutable,t(cn,jt),cn.of=function(){return this(arguments)},cn.fromKeys=function(t){return this(s(t).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(t){return this._map.has(t)},cn.prototype.add=function(t){return dn(this,this._map.set(t,!0))},cn.prototype.remove=function(t){return dn(this,this._map.remove(t))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var n=r.call(arguments,0);return 0===(n=n.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==n.length?this.withMutations(function(e){for(var t=0;t<n.length;t++)i(n[t]).forEach(function(t){return e.add(t)})}):this.constructor(n[0])},cn.prototype.intersect=function(){if(0===(n=r.call(arguments,0)).length)return this;var n=n.map(i),e=this;return this.withMutations(function(t){e.forEach(function(e){n.every(function(t){return t.includes(e)})||t.remove(e)})})},cn.prototype.subtract=function(){if(0===(n=r.call(arguments,0)).length)return this;var n=n.map(i),e=this;return this.withMutations(function(t){e.forEach(function(e){n.some(function(t){return t.includes(e)})&&t.remove(e)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var e=r.call(arguments,1);return this.union.apply(this,e)},cn.prototype.sort=function(t){return wn(qe(this,t))},cn.prototype.sortBy=function(t,e){return wn(qe(this,e,t))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(n,t){var r=this;return this._map.__iterate(function(t,e){return n(e,e,r)},t)},cn.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},cn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},cn.isSet=fn;var ln,pn="@@__IMMUTABLE_SET__@@",hn=cn.prototype;function dn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function yn(t,e){var n=Object.create(hn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function gn(){return ln=ln||yn($t())}function wn(n){return null==n?mn():vn(n)?n:mn().withMutations(function(e){var t=i(n);Yt(t.size),t.forEach(function(t){return e.add(t)})})}function vn(t){return fn(t)&&d(t)}hn[pn]=!0,hn[y]=hn.remove,hn.mergeDeep=hn.merge,hn.mergeDeepWith=hn.mergeWith,hn.withMutations=Ft.withMutations,hn.asMutable=Ft.asMutable,hn.asImmutable=Ft.asImmutable,hn.__empty=gn,hn.__make=yn,t(wn,cn),wn.of=function(){return this(arguments)},wn.fromKeys=function(t){return this(s(t).keySeq())},wn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},wn.isOrderedSet=vn;var Mn,_n=wn.prototype;function Ln(t,e){var n=Object.create(_n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function mn(){return Mn=Mn||Ln(Ce())}function jn(t){return null==t?In():xn(t)?t:In().unshiftAll(t)}function xn(t){return!(!t||!t[Nn])}_n[u]=!0,_n.__empty=mn,_n.__make=Ln,t(jn,mt),jn.of=function(){return this(arguments)},jn.prototype.toString=function(){return this.__toString("Stack [","]")},jn.prototype.get=function(t,e){var n=this._head;for(t=S(this,t);n&&t--;)n=n.next;return n?n.value:e},jn.prototype.peek=function(){return this._head&&this._head.value},jn.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;0<=n;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Dn(t,e)},jn.prototype.pushAll=function(t){if(0===(t=c(t)).size)return this;Yt(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Dn(e,n)},jn.prototype.pop=function(){return this.slice(1)},jn.prototype.unshift=function(){return this.push.apply(this,arguments)},jn.prototype.unshiftAll=function(t){return this.pushAll(t)},jn.prototype.shift=function(){return this.pop.apply(this,arguments)},jn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):In()},jn.prototype.slice=function(t,e){if(I(t,e,this.size))return this;var n=A(t,this.size);if(O(e,this.size)!==this.size)return mt.prototype.slice.call(this,t,e);for(var e=this.size-n,r=this._head;n--;)r=r.next;return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Dn(e,r)},jn.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Dn(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},jn.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},jn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new P(function(){if(r){var t=r.value;return r=r.next,R(e,n++,t)}return Q()})},jn.isStack=xn;var bn,Nn="@@__IMMUTABLE_STACK__@@",Sn=jn.prototype;function Dn(t,e,n,r){var i=Object.create(Sn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function In(){return bn=bn||Dn(0)}function An(e,n){function t(t){e.prototype[t]=n[t]}return Object.keys(n).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(n).forEach(t),e}Sn[Nn]=!0,Sn.withMutations=Ft.withMutations,Sn.asMutable=Ft.asMutable,Sn.asImmutable=Ft.asImmutable,Sn.wasAltered=Ft.wasAltered,a.Iterator=P,An(a,{toArray:function(){Yt(this.size);var n=new Array(this.size||0);return this.valueSeq().__iterate(function(t,e){n[e]=t}),n},toIndexedSeq:function(){return new ke(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new ze(this,!0)},toMap:function(){return Pt(this.toKeyedSeq())},toObject:function(){Yt(this.size);var n={};return this.__iterate(function(t,e){n[e]=t}),n},toOrderedMap:function(){return Ae(this.toKeyedSeq())},toOrderedSet:function(){return wn(l(this)?this.valueSeq():this)},toSet:function(){return cn(l(this)?this.valueSeq():this)},toSetSeq:function(){return new Ue(this)},toSeq:function(){return p(this)?this.toIndexedSeq():l(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return jn(l(this)?this.valueSeq():this)},toList:function(){return he(l(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return Ve(this,function(t,e){var n=l(t);if(0===(e=[t].concat(e).map(function(t){return f(t)?n&&(t=s(t)):t=n?st(t):at(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size})).length)return t;if(1===e.length){var r=e[0];if(r===t||n&&l(r)||p(t)&&p(r))return r}return r=new et(e),n?r=r.toKeyedSeq():p(t)||(r=r.toSetSeq()),(r=r.flatten(!0)).size=e.reduce(function(t,e){if(void 0!==t){e=e.size;if(void 0!==e)return t+e}},0),r}(this,r.call(arguments,0)))},includes:function(e){return this.some(function(t){return yt(t,e)})},entries:function(){return this.__iterator(z)},every:function(r,i){Yt(this.size);var o=!0;return this.__iterate(function(t,e,n){if(!r.call(i,t,e,n))return o=!1}),o},filter:function(t,e){return Ve(this,Be(this,t,e,!0))},find:function(t,e,n){e=this.findEntry(t,e);return e?e[1]:n},forEach:function(t,e){return Yt(this.size),this.__iterate(e?t.bind(e):t)},join:function(e){Yt(this.size),e=void 0!==e?""+e:",";var n="",r=!0;return this.__iterate(function(t){r?r=!1:n+=e,n+=null!=t?t.toString():""}),n},keys:function(){return this.__iterator(C)},map:function(t,e){return Ve(this,Re(this,t,e))},reduce:function(r,t,i){var o,u;return Yt(this.size),arguments.length<2?u=!0:o=t,this.__iterate(function(t,e,n){o=u?(u=!1,t):r.call(i,o,t,e,n)}),o},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Ve(this,Qe(this,!0))},slice:function(t,e){return Ve(this,Fe(this,t,e,!0))},some:function(t,e){return!this.every(En(t),e)},sort:function(t){return Ve(this,qe(this,t))},values:function(){return this.__iterator(E)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return N(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return n=this,r=t,i=e,o=Pt().asMutable(),n.__iterate(function(t,e){o.update(r.call(i,t,e,n),0,function(t){return t+1})}),o.asImmutable();var n,r,i,o},equals:function(t){return gt(this,t)},entrySeq:function(){var t=this;if(t._cache)return new et(t._cache);var e=t.toSeq().map(Cn).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(En(t),e)},findEntry:function(r,i,t){var o=t;return this.__iterate(function(t,e,n){if(r.call(i,t,e,n))return!(o=[e,t])}),o},findKey:function(t,e){e=this.findEntry(t,e);return e&&e[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(D)},flatMap:function(t,e){return Ve(this,(r=t,i=e,o=$e(n=this),n.toSeq().map(function(t,e){return o(r.call(i,t,e,n))}).flatten(!0)));var n,r,i,o},flatten:function(t){return Ve(this,We(this,t,!0))},fromEntrySeq:function(){return new Ye(this)},get:function(n,t){return this.find(function(t,e){return yt(e,n)},void 0,t)},getIn:function(t,e){for(var n=this,r=rn(t);!(i=r.next()).done;){var i=i.value;if((n=n&&n.get?n.get(i,g):g)===g)return e}return n},groupBy:function(t,e){return function(r,t,i){var o=l(r),u=(d(r)?Ae:Pt)().asMutable();r.__iterate(function(e,n){u.update(t.call(i,e,n,r),function(t){return(t=t||[]).push(o?[n,e]:e),t})});var e=$e(r);return u.map(function(t){return Ve(r,e(t))})}(this,t,e)},has:function(t){return this.get(t,g)!==g},hasIn:function(t){return this.getIn(t,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:a(e),this.every(function(t){return e.includes(t)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:a(t)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return yt(t,e)})},keySeq:function(){return this.toSeq().map(Tn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Je(this,t)},maxBy:function(t,e){return Je(this,e,t)},min:function(t){return Je(this,t?zn(t):Yn)},minBy:function(t,e){return Je(this,e?zn(e):Yn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Ve(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Ve(this,Ge(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(En(t),e)},sortBy:function(t,e){return Ve(this,qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Ve(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Ve(this,(s=t,a=e,(e=tn(n=this)).__iterateUncached=function(r,t){var i=this;if(t)return this.cacheResult().__iterate(r,t);var o=0;return n.__iterate(function(t,e,n){return s.call(a,t,e,n)&&++o&&r(t,e,i)}),o},e.__iteratorUncached=function(r,t){var i=this;if(t)return this.cacheResult().__iterator(r,t);var o=n.__iterator(z,t),u=!0;return new P(function(){if(!u)return Q();var t=o.next();if(t.done)return t;var e=t.value,n=e[0],e=e[1];return s.call(a,e,n,i)?r===z?t:R(r,n,e,t):(u=!1,Q())})},e));var n,s,a},takeUntil:function(t,e){return this.takeWhile(En(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=d(t),n=l(t),r=e?1:0;return function(t,e){return e=xt(e,3432918353),e=xt(e<<15|e>>>-15,461845907),e=xt(e<<13|e>>>-13,5),e=xt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=bt((e=xt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+Pn(Nt(t),Nt(e))|0}:function(t,e){r=r+Pn(Nt(t),Nt(e))|0}:e?function(t){r=31*r+Nt(t)|0}:function(t){r=r+Nt(t)|0}),r)}(this))}});var On=a.prototype;On[e]=!0,On[Y]=On.values,On.__toJS=On.toArray,On.__toStringMapper=kn,On.inspect=On.toSource=function(){return this.toString()},On.chain=On.flatMap,On.contains=On.includes,An(s,{flip:function(){return Ve(this,Pe(this))},mapEntries:function(n,r){var i=this,o=0;return Ve(this,this.toSeq().map(function(t,e){return n.call(r,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(n,r){var i=this;return Ve(this,this.toSeq().flip().map(function(t,e){return n.call(r,t,e,i)}).flip())}});y=s.prototype;function Tn(t,e){return e}function Cn(t,e){return[e,t]}function En(t){return function(){return!t.apply(this,arguments)}}function zn(t){return function(){return-t.apply(this,arguments)}}function kn(t){return"string"==typeof t?JSON.stringify(t):String(t)}function Un(){return b(arguments)}function Yn(t,e){return t<e?1:e<t?-1:0}function Pn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return y[n]=!0,y[Y]=On.entries,y.__toJS=On.toObject,y.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+kn(t)},An(c,{toKeyedSeq:function(){return new ze(this,!1)},filter:function(t,e){return Ve(this,Be(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Ve(this,Qe(this,!1))},slice:function(t,e){return Ve(this,Fe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=A(t,t<0?this.count():this.size);var r=this.slice(0,t);return Ve(this,1===n?r:r.concat(b(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(){return this.get(0)},flatten:function(t){return Ve(this,We(this,t,!1))},get:function(n,t){return(n=S(this,n))<0||this.size===1/0||void 0!==this.size&&n>this.size?t:this.find(function(t,e){return e===n},void 0,t)},has:function(t){return 0<=(t=S(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Ve(this,(u=t,(t=tn(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(n,t){var r=this,i=0;return o.__iterate(function(t,e){return(!i||!1!==n(u,i++,r))&&!1!==n(t,i++,r)},t),i},t.__iteratorUncached=function(t,e){var n,r=o.__iterator(E,e),i=0;return new P(function(){return(!n||i%2)&&(n=r.next()).done?n:i%2?R(t,i++,u):R(t,i++,n.value,n)})},t));var o,u},interleave:function(){var t=[this].concat(b(arguments)),e=Xe(this.toSeq(),X.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),Ve(this,n)},keySeq:function(){return Mt(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Ve(this,Ge(this,t,e,!1))},zip:function(){return Ve(this,Xe(this,Un,[this].concat(b(arguments))))},zipWith:function(t){var e=b(arguments);return Ve(e[0]=this,Xe(this,t,e))}}),c.prototype[o]=!0,c.prototype[u]=!0,An(i,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=On.includes,i.prototype.contains=i.prototype.includes,An(Z,s.prototype),An(X,c.prototype),An(V,i.prototype),An(Lt,s.prototype),An(mt,c.prototype),An(jt,i.prototype),{Iterable:a,Seq:J,Collection:_t,Map:Pt,OrderedMap:Ae,List:he,Stack:jn,Set:cn,OrderedSet:wn,Record:on,Range:Mt,Repeat:wt,is:yt,fromJS:pt}}()},function(t,e,n){"use strict";function d(r){function t(t,e,n){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,e)}return new r(t,e,n)}return r.apply(this,arguments)}return t.prototype=r.prototype,t}var y=n(13),g=n(102).f,w=n(231),v=n(10),M=n(108),_=n(28),L=n(21);t.exports=function(t,e){var n,r,i,o,u,s=t.target,a=t.global,c=t.stat,f=t.proto,l=a?y:c?y[s]:(y[s]||{}).prototype,p=a?v:v[s]||(v[s]={}),h=p.prototype;for(n in e)o=!w(a?n:s+(c?".":"#")+n,t.forced)&&l&&L(l,n),r=p[n],o&&(i=t.noTargetGet?(u=g(l,n))&&u.value:l[n]),u=o&&i?i:e[n],o&&typeof r==typeof u||(o=t.bind&&o?M(u,y):t.wrap&&o?d(u):f&&"function"==typeof u?M(Function.call,u):u,(t.sham||u&&u.sham||r&&r.sham)&&_(o,"sham",!0),p[n]=o,f&&(L(v,o=s+"Prototype")||_(v,o,{}),v[o][n]=u,t.real&&h&&!h[n]&&_(h,n,u)))}},function(t,e,n){"use strict";t.exports=n(289)},function(t,e,n){t.exports=n(293)},function(t,e,n){var r=n(10),i=n(21),o=n(115),u=n(33).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||u(e,t,{value:o.f(t)})}},function(t,e,n){t.exports=n(329)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(13),i=n(105),o=n(21),u=n(107),s=n(104),n=n(149),a=i("wks"),c=r.Symbol,f=n?c:c&&c.withoutSetter||u;t.exports=function(t){return o(a,t)&&(s||"string"==typeof a[t])||(s&&o(c,t)?a[t]=c[t]:a[t]=f("Symbol."+t)),a[t]}},function(t,e,n){var r=n(10);t.exports=function(t){return r[t+"Prototype"]}},function(t,e,n){t.exports=n(296)},function(t,e){t.exports={}},function(t,e,n){t.exports=n(302)},function(t,w,v){"use strict";!function(t){v.d(w,"d",function(){return l}),v.d(w,"c",function(){return p}),v.d(w,"b",function(){return h}),v.d(w,"e",function(){return d}),v.d(w,"f",function(){return y}),v.d(w,"a",function(){return g}),v(53),v(211);var e=v(18),i=v.n(e),e=(v(142),v(5)),o=v.n(e),e=v(11),n=v.n(e),e=(v(71),v(3),v(9)),u=v.n(e),e=(v(26),v(27)),s=v.n(e),e=(v(212),v(101),v(143)),a=v.n(e),e=(v(213),v(51),v(52),v(41),v(144),v(42),v(100),v(214),v(215),v(0)),r=v.n(e),e=(v(216),v(217),v(140),v(141)),e=v.n(e),c=(v(218),v(145),v(50),v(69),v(146),v(72)),f=(v(220),v(221),v(222),v(223),v(70),function(t){return r.a.Iterable.isIterable(t)});function l(t){return!(e=t)||"object"!==i()(e)?{}:f(t)?t.toJS():t;var e}function p(t){return o()(t)?t:[t]}function h(t){return"function"==typeof t}e.a;var d=function(){var t={},e=c.a.location.search;if(!e)return{};if(""!=e){var n,r=e.substr(1).split("&");for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(n=r[n].split("="),t[decodeURIComponent(n[0])]=n[1]&&decodeURIComponent(n[1])||"")}return t},y=function(e){var t;return n()(t=s()(e)).call(t,function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")};function g(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==i()(t)||o()(t)||null===t||!e)return t;var r=a()({},t);return u()(t=s()(r)).call(t,function(t){t===e&&n(r[t],t)?delete r[t]:r[t]=g(r[t],e,n)}),r}}.call(this,v(121).Buffer)},function(n,t,e){!function(t){function e(t){return t&&t.Math==Math&&t}n.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")()}.call(this,e(20))},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(148);t.exports=function(t,e,n){return e in t?r(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){var n;e&&(t.super_=e,(n=function(){}).prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t)}},function(t,e,n){var r=n(121),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function u(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=u),o(i,u),u.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},u.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");t=i(t);return void 0!==e?"string"==typeof n?t.fill(e,n):t.fill(e):t.fill(0),t},u.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},u.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(e,t,n){var r=n(81),i=n(284);function o(t){return e.exports=o="function"==typeof r&&"symbol"==typeof i?function(t){return typeof t}:function(t){return t&&"function"==typeof r&&t.constructor===r&&t!==r.prototype?"symbol":typeof t},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(t,e,n){var r=n(43);t.exports=function(t){return Object(r(t))}},function(t,e){var n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(19),i={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return i.call(r(t),e)}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){n=n(6);t.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(t,e,n){var r=n(177),n="object"==typeof self&&self&&self.Object===Object&&self,n=r||n||Function("return this")();t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){t.exports=n(333)},function(t,e,n){t.exports=n(337)},function(t,e,n){var r=n(23),i=n(33),o=n(55);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(14);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(110),i=Math.min;t.exports=function(t){return 0<t?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var r=n(73),i=n(43);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(23),i=n(150),o=n(29),u=n(74),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(o(t),e=u(e),o(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(75);t.exports=function(t){if(r(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},function(t,e){var n,r,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,a=[],c=!1,f=-1;function l(){c&&s&&(c=!1,s.length?a=s.concat(a):f=-1,a.length&&p())}function p(){if(!c){var t=u(l);c=!0;for(var e=a.length;e;){for(s=a,a=[];++f<e;)s&&s[f].run();f=-1,e=a.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function d(){}t.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new h(t,e)),1!==a.length||c||u(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.prependListener=d,t.prependOnceListener=d,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(93),i=Object.keys||function(t){var e,n=[];for(e in t)n.push(e);return n};t.exports=f;t=Object.create(n(68));t.inherits=n(16);var o=n(192),u=n(136);t.inherits(f,o);for(var s=i(u.prototype),a=0;a<s.length;a++){var c=s[a];f.prototype[c]||(f.prototype[c]=u.prototype[c])}function f(t){if(!(this instanceof f))return new f(t);o.call(this,t),u.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),f.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";var r=n(511)();t.exports=function(t){return t!==r&&null!==t}},function(t,e,n){"use strict";var r=n(512),i=Math.max;t.exports=function(t){return i(0,r(t))}},function(t,e,n){},function(t,e,n){"use strict";var u=n(203),o=n(526),s=n(200),a=n(198),c=n(530);(t.exports=function(t,e){var n,r,i,o;return arguments.length<2||"string"!=typeof t?(i=e,e=t,t=null):i=arguments[2],u(t)?(n=c.call(t,"c"),r=c.call(t,"e"),o=c.call(t,"w")):r=!(n=o=!0),o={value:e,configurable:n,enumerable:r,writable:o},i?s(a(i),o):o}).gs=function(t,e,n){var r,i;return"string"!=typeof t?(i=n,n=e,e=t,t=null):i=arguments[3],u(e)?o(e)?u(n)?o(n)||(i=n,n=void 0):n=void 0:(i=e,e=n=void 0):e=void 0,t=u(t)?(r=c.call(t,"c"),c.call(t,"e")):!(r=!0),t={get:e,set:n,configurable:r,enumerable:t},i?s(a(i),t):t}},function(t,e,n){t.exports=n(367)},function(t,e,n){t.exports=n(377)},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){function r(t){return"function"==typeof t?t:void 0}var i=n(10),o=n(13);t.exports=function(t,e){return arguments.length<2?r(i[t])||r(o[t]):i[t]&&i[t][e]||o[t]&&o[t][e]}},function(t,e,n){var _=n(108),L=n(73),m=n(19),j=n(30),x=n(160),b=[].push,n=function(p){var h=1==p,d=2==p,y=3==p,g=4==p,w=6==p,v=7==p,M=5==p||w;return function(t,e,n,r){for(var i,o,u=m(t),s=L(u),a=_(e,n,3),c=j(s.length),f=0,r=r||x,l=h?r(t,c):d||v?r(t,0):void 0;f<c;f++)if((M||f in s)&&(o=a(i=s[f],f,u),p))if(h)l[f]=o;else if(o)switch(p){case 3:return!0;case 5:return i;case 6:return f;case 2:b.call(l,i)}else switch(p){case 4:return!1;case 7:b.call(l,i)}return w?-1:y||g?g:l}};t.exports={forEach:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6),filterReject:n(7)}},function(t,e){t.exports={}},function(t,e,n){var r=n(418),i=n(421);t.exports=function(t,e){e=i(t,e);return r(e)?e:void 0}},function(t,e,n){"use strict";var r=n(37);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){var f=n(17).Buffer;function r(t,e){this._block=f.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}r.prototype.update=function(t,e){"string"==typeof t&&(t=f.from(t,e=e||"utf8"));for(var n=this._block,r=this._blockSize,i=t.length,o=this._len,u=0;u<i;){for(var s=o%r,a=Math.min(i-u,r-s),c=0;c<a;c++)n[s+c]=t[u+c];u+=a,(o+=a)%r==0&&this._update(n)}return this._len+=i,this},r.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,1+e),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));e=8*this._len;e<=4294967295?this._block.writeUInt32BE(e,this._blockSize-4):(this._block.writeUInt32BE((e-(n=(4294967295&e)>>>0))/4294967296,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)),this._update(this._block);var n=this._hash();return t?n.toString(t):n},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){t.exports=n(362)},function(t,e,n){t.exports=n(363)},function(t,e,n){var r=n(308),i=n(311),o=n(124),u=n(325);t.exports=function(t){return r(t)||i(t)||o(t)||u()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(185),i=n(187),o=n(128),u=n(22),s=n(67),a=n(129),c=n(186),f=n(131),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(u(t)||"string"==typeof t||"function"==typeof t.splice||a(t)||f(t)||o(t)))return!t.length;var e,n=i(t);if("[object Map]"==n||"[object Set]"==n)return!t.size;if(c(t))return!r(t).length;for(e in t)if(l.call(t,e))return!1;return!0}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r,i,o=n(13),u=n(76),n=o.process,o=o.Deno,o=n&&n.versions||o&&o.version,o=o&&o.v8;o?i=(r=o.split("."))[0]<4?1:r[0]+r[1]:u&&(!(r=u.match(/Edge\/(\d+)/))||74<=r[1])&&(r=u.match(/Chrome\/(\d+)/))&&(i=r[1]),t.exports=i&&+i},function(t,e){t.exports=!0},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(56);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(116),i=n(56),o=n(7)("toStringTag"),u="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(t=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?t:u?i(e):"Object"==(t=i(e))&&"function"==typeof e.callee?"Arguments":t}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t,e){var n=[][t];return!!n&&r(function(){n.call(null,e||function(){throw 1},1)})}},function(t,e,n){var r=n(396);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(85),i=n(398),o=n(399),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(u&&u in Object(t)?i:o)(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(69),i=n(132);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,n,e){!function(t){function e(t){return Object.prototype.toString.call(t)}n.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},n.isBoolean=function(t){return"boolean"==typeof t},n.isNull=function(t){return null===t},n.isNullOrUndefined=function(t){return null==t},n.isNumber=function(t){return"number"==typeof t},n.isString=function(t){return"string"==typeof t},n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=function(t){return void 0===t},n.isRegExp=function(t){return"[object RegExp]"===e(t)},n.isObject=function(t){return"object"==typeof t&&null!==t},n.isDate=function(t){return"[object Date]"===e(t)},n.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},n.isFunction=function(t){return"function"==typeof t},n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t.isBuffer}.call(this,e(121).Buffer)},function(t,e,n){var r=n(64),i=n(66);t.exports=function(t){if(!i(t))return!1;t=r(t);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(t,e,n){"use strict";function r(t){return null==t}var y={isNothing:r,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:r(t)?[]:[t]},repeat:function(t,e){for(var n="",r=0;r<e;r+=1)n+=t;return n},isNegativeZero:function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},extend:function(t,e){var n,r,i,o;if(e)for(n=0,r=(o=Object.keys(e)).length;n<r;n+=1)t[i=o[n]]=e[i];return t}};function i(t,e){var n="",r=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+="\n\n"+t.mark.snippet),r+" "+n):r}function o(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=i(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}((o.prototype=Object.create(Error.prototype)).constructor=o).prototype.toString=function(t){return this.name+": "+i(this,t)};var p=o;function h(t,e,n,r,i){var o="",u="",i=Math.floor(i/2)-1;return i<r-e&&(e=r-i+(o=" ... ").length),i<n-r&&(n=r+i-(u=" ...").length),{str:o+t.slice(e,n).replace(/\t/g,"→")+u,pos:r-e+o.length}}function d(t,e){return y.repeat(" ",e-t.length)+t}function u(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new p('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(t){return t},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,r={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){r[String(t)]=e})}),r),-1===c.indexOf(this.kind))throw new p('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.');var n,r}var s=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],u=-1;n=r.exec(t.buffer);)o.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&u<0&&(u=i.length-2);u<0&&(u=i.length-1);for(var s,a="",c=Math.min(t.line+e.linesAfter,o.length).toString().length,f=e.maxLength-(e.indent+c+3),l=1;l<=e.linesBefore&&!(u-l<0);l++)s=h(t.buffer,i[u-l],o[u-l],t.position-(i[u]-i[u-l]),f),a=y.repeat(" ",e.indent)+d((t.line-l+1).toString(),c)+" | "+s.str+"\n"+a;for(s=h(t.buffer,i[u],o[u],t.position,f),a+=y.repeat(" ",e.indent)+d((t.line+1).toString(),c)+" | "+s.str+"\n",a+=y.repeat("-",e.indent+c+3+s.pos)+"^\n",l=1;l<=e.linesAfter&&!(u+l>=o.length);l++)s=h(t.buffer,i[u+l],o[u+l],t.position-(i[u]-i[u+l]),f),a+=y.repeat(" ",e.indent)+d((t.line+l+1).toString(),c)+" | "+s.str+"\n";return a.replace(/\n$/,"")},a=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],c=["scalar","sequence","mapping"];function f(t,e){var i=[];return t[e].forEach(function(n){var r=i.length;i.forEach(function(t,e){t.tag===n.tag&&t.kind===n.kind&&t.multi===n.multi&&(r=e)}),i[r]=n}),i}function l(t){return this.extend(t)}l.prototype.extend=function(t){var e=[],n=[];if(t instanceof u)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new p("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach(function(t){if(!(t instanceof u))throw new p("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new p("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new p("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(t){if(!(t instanceof u))throw new p("Specified list of YAML types (or a single Type object) contains a non-Type object.")});t=Object.create(l.prototype);return t.implicit=(this.implicit||[]).concat(e),t.explicit=(this.explicit||[]).concat(n),t.compiledImplicit=f(t,"implicit"),t.compiledExplicit=f(t,"explicit"),t.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(r);return n}(t.compiledImplicit,t.compiledExplicit),t};var g=l,w=new u("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}}),v=new u("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}}),M=new u("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}}),_=new g({explicit:[w,v,M]}),L=new u("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),m=new u("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});var j=new u("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r,i,o=t.length,u=0,s=!1;if(!o)return!1;if("0"===(e="-"===(e=t[u])||"+"===e?t[++u]:e)){if(u+1===o)return!0;if("b"===(e=t[++u])){for(u++;u<o;u++)if("_"!==(e=t[u])){if("0"!==e&&"1"!==e)return!1;s=!0}return s&&"_"!==e}if("x"===e){for(u++;u<o;u++)if("_"!==(e=t[u])){if(!(48<=(n=t.charCodeAt(u))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==e}if("o"===e){for(u++;u<o;u++)if("_"!==(e=t[u])){if(!(48<=(r=t.charCodeAt(u))&&r<=55))return!1;s=!0}return s&&"_"!==e}}if("_"===e)return!1;for(;u<o;u++)if("_"!==(e=t[u])){if(!(48<=(i=t.charCodeAt(u))&&i<=57))return!1;s=!0}return!(!s||"_"===e)},construct:function(t){var e=t,n=1;if("-"!==(t=(e=-1!==e.indexOf("_")?e.replace(/_/g,""):e)[0])&&"+"!==t||("-"===t&&(n=-1),t=(e=e.slice(1))[0]),"0"===e)return 0;if("0"===t){if("b"===e[1])return n*parseInt(e.slice(2),2);if("x"===e[1])return n*parseInt(e.slice(2),16);if("o"===e[1])return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!y.isNegativeZero(t)},represent:{binary:function(t){return 0<=t?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return 0<=t?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return 0<=t?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),x=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),b=/^[-+]?[0-9]+e/,N=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!x.test(t)||"_"===t[t.length-1])},construct:function(t){var e,t="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1;return".inf"===(e=0<="+-".indexOf(e[0])?e.slice(1):e)?1==t?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:t*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||y.isNegativeZero(t))},represent:function(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(y.isNegativeZero(t))return"-0.0";return t=t.toString(10),b.test(t)?t.replace("e",".e"):t},defaultStyle:"lowercase"}),S=_.extend({implicit:[L,m,j,N]}),D=S,I=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),A=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),O=new u("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==I.exec(t)||null!==A.exec(t))},construct:function(t){var e,n,r,i,o,u,s=0,a=null;if(null===(e=null===(e=I.exec(t))?A.exec(t):e))throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(o=+e[4],u=+e[5],t=+e[6],e[7]){for(s=e[7].slice(0,3);s.length<3;)s+="0";s=+s}return e[9]&&(a=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(a=-a)),t=new Date(Date.UTC(n,r,i,o,u,t,s)),a&&t.setTime(t.getTime()-a),t},instanceOf:Date,represent:function(t){return t.toISOString()}}),T=new u("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",E=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;for(var e,n=0,r=t.length,i=C,o=0;o<r;o++)if(!(64<(e=i.indexOf(t.charAt(o))))){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){for(var e=t.replace(/[\r\n=]/g,""),n=e.length,r=C,i=0,o=[],u=0;u<n;u++)u%4==0&&u&&(o.push(i>>16&255),o.push(i>>8&255),o.push(255&i)),i=i<<6|r.indexOf(e.charAt(u));return 0==(t=n%4*6)?(o.push(i>>16&255),o.push(i>>8&255),o.push(255&i)):18==t?(o.push(i>>10&255),o.push(i>>2&255)):12==t&&o.push(i>>4&255),new Uint8Array(o)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){for(var e,n="",r=0,i=t.length,o=C,u=0;u<i;u++)u%3==0&&u&&(n+=o[r>>18&63],n+=o[r>>12&63],n+=o[r>>6&63],n+=o[63&r]),r=(r<<8)+t[u];return 0==(e=i%3)?(n+=o[r>>18&63],n+=o[r>>12&63],n+=o[r>>6&63],n+=o[63&r]):2==e?(n+=o[r>>10&63],n+=o[r>>4&63],n+=o[r<<2&63],n+=o[64]):1==e&&(n+=o[r>>2&63],n+=o[r<<4&63],n+=o[64],n+=o[64]),n}}),z=Object.prototype.hasOwnProperty,k=Object.prototype.toString,U=new u("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;for(var e,n,r,i=[],o=t,u=0,s=o.length;u<s;u+=1){if(e=o[u],r=!1,"[object Object]"!==k.call(e))return!1;for(n in e)if(z.call(e,n)){if(r)return!1;r=!0}if(!r)return!1;if(-1!==i.indexOf(n))return!1;i.push(n)}return!0},construct:function(t){return null!==t?t:[]}}),Y=Object.prototype.toString,P=new u("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;for(var e,n,r=t,i=new Array(r.length),o=0,u=r.length;o<u;o+=1){if(e=r[o],"[object Object]"!==Y.call(e))return!1;if(1!==(n=Object.keys(e)).length)return!1;i[o]=[n[0],e[n[0]]]}return!0},construct:function(t){if(null===t)return[];for(var e,n,r=t,i=new Array(r.length),o=0,u=r.length;o<u;o+=1)e=r[o],n=Object.keys(e),i[o]=[n[0],e[n[0]]];return i}}),R=Object.prototype.hasOwnProperty,Q=new u("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(R.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}}),B=D.extend({implicit:[O,T],explicit:[E,U,P,Q]}),F=Object.prototype.hasOwnProperty,G=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,W=/[\x85\u2028\u2029]/,q=/[,\[\]\{\}]/,J=/^(?:!|!!|![a-z\-]+!)$/i,Z=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function X(t){return Object.prototype.toString.call(t)}function V(t){return 10===t||13===t}function H(t){return 9===t||32===t}function K(t){return 9===t||32===t||10===t||13===t}function $(t){return 44===t||91===t||93===t||123===t||125===t}function tt(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}for(var et=new Array(256),nt=new Array(256),rt=0;rt<256;rt++)et[rt]=tt(rt)?1:0,nt[rt]=tt(rt);function it(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||B,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ot(t,e){t={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return t.snippet=s(t),new p(e,t)}function ut(t,e){throw ot(t,e)}function st(t,e){t.onWarning&&t.onWarning.call(null,ot(t,e))}var at={YAML:function(t,e,n){var r,i;null!==t.version&&ut(t,"duplication of %YAML directive"),1!==n.length&&ut(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ut(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),i=parseInt(i[2],10),1!==r&&ut(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=i<2,1!==i&&2!==i&&st(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r;2!==n.length&&ut(t,"TAG directive accepts exactly two arguments"),r=n[0],n=n[1],J.test(r)||ut(t,"ill-formed tag handle (first argument) of the TAG directive"),F.call(t.tagMap,r)&&ut(t,'there is a previously declared suffix for "'+r+'" tag handle'),Z.test(n)||ut(t,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch(e){ut(t,"tag prefix is malformed: "+n)}t.tagMap[r]=n}};function ct(t,e,n,r){var i,o,u,s;if(e<n){if(s=t.input.slice(e,n),r)for(i=0,o=s.length;i<o;i+=1)9===(u=s.charCodeAt(i))||32<=u&&u<=1114111||ut(t,"expected valid JSON character");else G.test(s)&&ut(t,"the stream contains non-printable characters");t.result+=s}}function ft(t,e,n,r){var i,o,u,s;for(y.isObject(n)||ut(t,"cannot merge mappings; the provided source object is unacceptable"),u=0,s=(i=Object.keys(n)).length;u<s;u+=1)o=i[u],F.call(e,o)||(e[o]=n[o],r[o]=!0)}function lt(t,e,n,r,i,o,u,s,a){var c,f;if(Array.isArray(i))for(c=0,f=(i=Array.prototype.slice.call(i)).length;c<f;c+=1)Array.isArray(i[c])&&ut(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===X(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===X(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)ft(t,e,o[c],n);else ft(t,e,o,n);else t.json||F.call(n,i)||!F.call(e,i)||(t.line=u||t.line,t.lineStart=s||t.lineStart,t.position=a||t.position,ut(t,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):e[i]=o,delete n[i];return e}function pt(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):ut(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function ht(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);0!==i;){for(;H(i);)9===i&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&35===i)for(;10!==(i=t.input.charCodeAt(++t.position))&&13!==i&&0!==i;);if(!V(i))break;for(pt(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==n&&0!==r&&t.lineIndent<n&&st(t,"deficient indentation"),r}function dt(t){var e,n=t.position;return(45===(e=t.input.charCodeAt(n))||46===e)&&e===t.input.charCodeAt(n+1)&&e===t.input.charCodeAt(n+2)&&(0===(e=t.input.charCodeAt(n+=3))||K(e))}function yt(t,e){1===e?t.result+=" ":1<e&&(t.result+=y.repeat("\n",e-1))}function gt(t,e){var n,r,i=t.tag,o=t.anchor,u=[],s=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),r=t.input.charCodeAt(t.position);0!==r&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,ut(t,"tab characters must not be used in indentation")),45===r)&&K(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,ht(t,!0,-1)&&t.lineIndent<=e)u.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,wt(t,e,3,!1,!0),u.push(t.result),ht(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)ut(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!s&&(t.tag=i,t.anchor=o,t.kind="sequence",t.result=u,!0)}function wt(t,e,n,r,i){var o,u,s,a,c,f,l,p=1,h=!1,d=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,o=u=s=4===n||3===n,r&&ht(t,!0,-1)&&(h=!0,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)),1===p)for(;function(t){var e,n,r,i,o=!1,u=!1;if(33===(i=t.input.charCodeAt(t.position))){if(null!==t.tag&&ut(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(o=!0,i=t.input.charCodeAt(++t.position)):33===i?(u=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,o){for(;0!==(i=t.input.charCodeAt(++t.position))&&62!==i;);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):ut(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!K(i);)33===i&&(u?ut(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),J.test(n)||ut(t,"named tag handle cannot contain such characters"),u=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),q.test(r)&&ut(t,"tag suffix cannot contain flow indicator characters")}r&&!Z.test(r)&&ut(t,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(e){ut(t,"tag name is malformed: "+r)}return o?t.tag=r:F.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:ut(t,'undeclared tag handle "'+n+'"'),1}}(t)||function(t){var e,n;if(38===(n=t.input.charCodeAt(t.position))){for(null!==t.anchor&&ut(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!K(n)&&!$(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&ut(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),1}}(t);)ht(t,!0,-1)?(h=!0,s=o,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)):s=!1;if(s=s&&(h||i),1!==p&&4!==n||(r=1===n||2===n?e:e+1,i=t.position-t.lineStart,1===p?s&&(gt(t,i)||function(t,e,n){var r,i,o,u,s,a,c,f=t.tag,l=t.anchor,p={},h=Object.create(null),d=null,y=null,g=null,w=!1,v=!1;if(-1===t.firstTabInLine){for(null!==t.anchor&&(t.anchorMap[t.anchor]=p),c=t.input.charCodeAt(t.position);0!==c;){if(w||-1===t.firstTabInLine||(t.position=t.firstTabInLine,ut(t,"tab characters must not be used in indentation")),r=t.input.charCodeAt(t.position+1),o=t.line,63!==c&&58!==c||!K(r)){if(u=t.line,s=t.lineStart,a=t.position,!wt(t,n,2,!1,!0))break;if(t.line===o){for(c=t.input.charCodeAt(t.position);H(c);)c=t.input.charCodeAt(++t.position);if(58===c)K(c=t.input.charCodeAt(++t.position))||ut(t,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(lt(t,p,h,d,y,null,u,s,a),d=y=g=null),i=w=!(v=!0),d=t.tag,y=t.result;else{if(!v)return t.tag=f,t.anchor=l,1;ut(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return t.tag=f,t.anchor=l,1;ut(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(w&&(lt(t,p,h,d,y,null,u,s,a),d=y=g=null),i=w=v=!0):w?i=!(w=!1):ut(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=r;if((t.line===o||t.lineIndent>e)&&(w&&(u=t.line,s=t.lineStart,a=t.position),wt(t,e,4,!0,i)&&(w?y=t.result:g=t.result),w||(lt(t,p,h,d,y,g,u,s,a),d=y=g=null),ht(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===o||t.lineIndent>e)&&0!==c)ut(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return w&&lt(t,p,h,d,y,null,u,s,a),v&&(t.tag=f,t.anchor=l,t.kind="mapping",t.result=p),v}}(t,i,r))||function(t,e){var n,r,i,o,u,s,a,c,f,l,p,h,d=!0,y=t.tag,g=t.anchor,w=Object.create(null);if(91===(h=t.input.charCodeAt(t.position)))c=!(u=93),o=[];else{if(123!==h)return;u=125,c=!0,o={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),h=t.input.charCodeAt(++t.position);0!==h;){if(ht(t,!0,e),(h=t.input.charCodeAt(t.position))===u)return t.position++,t.tag=y,t.anchor=g,t.kind=c?"mapping":"sequence",t.result=o,1;d?44===h&&ut(t,"expected the node content, but found ','"):ut(t,"missed comma between flow collection entries"),p=null,s=a=!1,63===h&&K(t.input.charCodeAt(t.position+1))&&(s=a=!0,t.position++,ht(t,!0,e)),n=t.line,r=t.lineStart,i=t.position,wt(t,e,1,!1,!0),l=t.tag,f=t.result,ht(t,!0,e),h=t.input.charCodeAt(t.position),!a&&t.line!==n||58!==h||(s=!0,h=t.input.charCodeAt(++t.position),ht(t,!0,e),wt(t,e,1,!1,!0),p=t.result),c?lt(t,o,w,l,f,p,n,r,i):s?o.push(lt(t,null,w,l,f,p,n,r,i)):o.push(f),ht(t,!0,e),44===(h=t.input.charCodeAt(t.position))?(d=!0,h=t.input.charCodeAt(++t.position)):d=!1}ut(t,"unexpected end of the stream within a flow collection")}(t,r)?d=!0:(u&&function(t,e){var n,r,i,o,u=1,s=!1,a=!1,c=e,f=0,l=!1;if(124===(o=t.input.charCodeAt(t.position)))r=!1;else{if(62!==o)return;r=!0}for(t.kind="scalar",t.result="";0!==o;)if(43===(o=t.input.charCodeAt(++t.position))||45===o)1===u?u=43===o?3:2:ut(t,"repeat of a chomping mode identifier");else{if(!(0<=(i=48<=o&&o<=57?o-48:-1)))break;0==i?ut(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?ut(t,"repeat of an indentation width identifier"):(c=e+i-1,a=!0)}if(H(o)){for(;H(o=t.input.charCodeAt(++t.position)););if(35===o)for(;!V(o=t.input.charCodeAt(++t.position))&&0!==o;);}for(;0!==o;){for(pt(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!a||t.lineIndent<c)&&32===o;)t.lineIndent++,o=t.input.charCodeAt(++t.position);if(!a&&t.lineIndent>c&&(c=t.lineIndent),V(o))f++;else{if(t.lineIndent<c){3===u?t.result+=y.repeat("\n",s?1+f:f):1===u&&s&&(t.result+="\n");break}for(r?H(o)?(l=!0,t.result+=y.repeat("\n",s?1+f:f)):l?(l=!1,t.result+=y.repeat("\n",f+1)):0===f?s&&(t.result+=" "):t.result+=y.repeat("\n",f):t.result+=y.repeat("\n",s?1+f:f),a=s=!0,f=0,n=t.position;!V(o)&&0!==o;)o=t.input.charCodeAt(++t.position);ct(t,n,t.position,!1)}}return 1}(t,r)||function(t,e){var n,r,i;if(39===(n=t.input.charCodeAt(t.position))){for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(ct(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return 1;r=t.position,t.position++,i=t.position}else V(n)?(ct(t,r,i,!0),yt(t,ht(t,!1,e)),r=i=t.position):t.position===t.lineStart&&dt(t)?ut(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);ut(t,"unexpected end of the stream within a single quoted scalar")}}(t,r)||function(t,e){var n,r,i,o,u,s,a,c;if(34===(s=t.input.charCodeAt(t.position))){for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(s=t.input.charCodeAt(t.position));){if(34===s)return ct(t,n,t.position,!0),t.position++,1;if(92===s){if(ct(t,n,t.position,!0),V(s=t.input.charCodeAt(++t.position)))ht(t,!1,e);else if(s<256&&et[s])t.result+=nt[s],t.position++;else if(0<(u=120===s?2:117===s?4:85===s?8:0)){for(i=u,o=0;0<i;i--)0<=(u=48<=(c=s=t.input.charCodeAt(++t.position))&&c<=57?c-48:97<=(c=32|c)&&c<=102?c-97+10:-1)?o=(o<<4)+u:ut(t,"expected hexadecimal character");t.result+=(a=o)<=65535?String.fromCharCode(a):String.fromCharCode(55296+(a-65536>>10),56320+(a-65536&1023)),t.position++}else ut(t,"unknown escape sequence");n=r=t.position}else V(s)?(ct(t,n,r,!0),yt(t,ht(t,!1,e)),n=r=t.position):t.position===t.lineStart&&dt(t)?ut(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}ut(t,"unexpected end of the stream within a double quoted scalar")}}(t,r)?d=!0:function(t){var e,n;if(42===(n=t.input.charCodeAt(t.position))){for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!K(n)&&!$(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&ut(t,"name of an alias node must contain at least one character"),e=t.input.slice(e,t.position),F.call(t.anchorMap,e)||ut(t,'unidentified alias "'+e+'"'),t.result=t.anchorMap[e],ht(t,!0,-1),1}}(t)?(d=!0,null===t.tag&&null===t.anchor||ut(t,"alias node should not have any properties")):function(t,e,n){var r,i,o,u,s,a,c,f,l=t.kind,p=t.result;if(!K(f=t.input.charCodeAt(t.position))&&!$(f)&&35!==f&&38!==f&&42!==f&&33!==f&&124!==f&&62!==f&&39!==f&&34!==f&&37!==f&&64!==f&&96!==f&&(63!==f&&45!==f||!(K(r=t.input.charCodeAt(t.position+1))||n&&$(r)))){for(t.kind="scalar",t.result="",i=o=t.position,u=!1;0!==f;){if(58===f){if(K(r=t.input.charCodeAt(t.position+1))||n&&$(r))break}else if(35===f){if(K(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&dt(t)||n&&$(f))break;if(V(f)){if(s=t.line,a=t.lineStart,c=t.lineIndent,ht(t,!1,-1),t.lineIndent>=e){u=!0,f=t.input.charCodeAt(t.position);continue}t.position=o,t.line=s,t.lineStart=a,t.lineIndent=c;break}}u&&(ct(t,i,o,!1),yt(t,t.line-s),i=o=t.position,u=!1),H(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return ct(t,i,o,!1),t.result||(t.kind=l,t.result=p,0)}}(t,r,1===n)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===p&&(d=s&&gt(t,i))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&ut(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),a=0,c=t.implicitTypes.length;a<c;a+=1)if((l=t.implicitTypes[a]).resolve(t.result)){t.result=l.construct(t.result),t.tag=l.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(F.call(t.typeMap[t.kind||"fallback"],t.tag))l=t.typeMap[t.kind||"fallback"][t.tag];else for(l=null,a=0,c=(f=t.typeMap.multi[t.kind||"fallback"]).length;a<c;a+=1)if(t.tag.slice(0,f[a].tag.length)===f[a].tag){l=f[a];break}l||ut(t,"unknown tag !<"+t.tag+">"),null!==t.result&&l.kind!==t.kind&&ut(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+l.kind+'", not "'+t.kind+'"'),l.resolve(t.result,t.tag)?(t.result=l.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):ut(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||d}function vt(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new it(t,e),t=t.indexOf("\0");for(-1!==t&&(n.position=t,ut(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)!function(t){var e,n,r,i,o=t.position,u=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(ht(t,!0,-1),i=t.input.charCodeAt(t.position),!(0<t.lineIndent||37!==i));){for(u=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!K(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&ut(t,"directive name must not be less than one character in length");0!==i;){for(;H(i);)i=t.input.charCodeAt(++t.position);if(35===i){for(;0!==(i=t.input.charCodeAt(++t.position))&&!V(i););break}if(V(i))break;for(e=t.position;0!==i&&!K(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&pt(t),F.call(at,n)?at[n](t,n,r):st(t,'unknown document directive "'+n+'"')}ht(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,ht(t,!0,-1)):u&&ut(t,"directives end mark is expected"),wt(t,t.lineIndent-1,4,!1,!0),ht(t,!0,-1),t.checkLineBreaks&&W.test(t.input.slice(o,t.position))&&st(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&dt(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,ht(t,!0,-1)):t.position<t.length-1&&ut(t,"end of the stream or a document separator is expected")}(n);return n.documents}var Mt={loadAll:function(t,e,n){null!==e&&"object"==typeof e&&void 0===n&&(n=e,e=null);var r=vt(t,n);if("function"!=typeof e)return r;for(var i=0,o=r.length;i<o;i+=1)e(r[i])},load:function(t,e){e=vt(t,e);if(0!==e.length){if(1===e.length)return e[0];throw new p("expected a single document in the stream, but found more")}}},_t=Object.prototype.toString,Lt=Object.prototype.hasOwnProperty,mt=65279,jt={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},xt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],bt=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Nt(t){this.schema=t.schema||B,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=y.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,r,i,o,u,s,a;if(null===e)return{};for(n={},i=0,o=(r=Object.keys(e)).length;i<o;i+=1)u=r[i],s=String(e[u]),"!!"===u.slice(0,2)&&(u="tag:yaml.org,2002:"+u.slice(2)),(a=t.compiledTypeMap.fallback[u])&&Lt.call(a.styleAliases,s)&&(s=a.styleAliases[s]),n[u]=s;return n}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function St(t,e){for(var n,r,i=y.repeat(" ",e),o=0,u="",s=t.length;o<s;)o=-1===(r=t.indexOf("\n",o))?(n=t.slice(o),s):(n=t.slice(o,r+1),r+1),n.length&&"\n"!==n&&(u+=i),u+=n;return u}function Dt(t,e){return"\n"+y.repeat(" ",t.indent*e)}function It(t){return 32===t||9===t}function At(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&t!==mt||65536<=t&&t<=1114111}function Ot(t){return At(t)&&t!==mt&&13!==t&&10!==t}function Tt(t,e,n){var r=Ot(t),i=r&&!It(t);return(n?r:r&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!i)||Ot(e)&&!It(e)&&35===t||58===e&&i}function Ct(t,e){var n,r=t.charCodeAt(e);return 55296<=r&&r<=56319&&e+1<t.length&&56320<=(n=t.charCodeAt(e+1))&&n<=57343?1024*(r-55296)+n-56320+65536:r}function Et(t){return/^\n* /.test(t)}function zt(r,i,o,u,s){r.dump=function(){if(0===i.length)return 2===r.quotingType?'""':"''";if(!r.noCompatMode&&(-1!==xt.indexOf(i)||bt.test(i)))return 2===r.quotingType?'"'+i+'"':"'"+i+"'";var t=r.indent*Math.max(1,o),e=-1===r.lineWidth?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-t),n=u||-1<r.flowLevel&&o>=r.flowLevel;switch(function(t,e,n,r,i,o,u,s){var a,c,f=0,l=null,p=!1,h=!1,d=-1!==r,y=-1,g=At(c=Ct(t,0))&&c!==mt&&!It(c)&&45!==c&&63!==c&&58!==c&&44!==c&&91!==c&&93!==c&&123!==c&&125!==c&&35!==c&&38!==c&&42!==c&&33!==c&&124!==c&&61!==c&&62!==c&&39!==c&&34!==c&&37!==c&&64!==c&&96!==c&&(!It(c=Ct(t,t.length-1))&&58!==c);if(e||u)for(a=0;a<t.length;65536<=f?a+=2:a++){if(!At(f=Ct(t,a)))return 5;g=g&&Tt(f,l,s),l=f}else{for(a=0;a<t.length;65536<=f?a+=2:a++){if(10===(f=Ct(t,a)))p=!0,d&&(h=h||r<a-y-1&&" "!==t[y+1],y=a);else if(!At(f))return 5;g=g&&Tt(f,l,s),l=f}h=h||d&&r<a-y-1&&" "!==t[y+1]}return p||h?9<n&&Et(t)?5:u?2===o?5:2:h?4:3:!g||u||i(t)?2===o?5:2:1}(i,n,r.indent,e,function(t){return function(t,e){for(var n=0,r=t.implicitTypes.length;n<r;n+=1)if(t.implicitTypes[n].resolve(e))return 1}(r,t)},r.quotingType,r.forceQuotes&&!u,s)){case 1:return i;case 2:return"'"+i.replace(/'/g,"''")+"'";case 3:return"|"+kt(i,r.indent)+Ut(St(i,t));case 4:return">"+kt(i,r.indent)+Ut(St(function(t,e){for(var n,r=/(\n+)([^\n]*)/g,i=(n=-1!==(n=t.indexOf("\n"))?n:t.length,r.lastIndex=n,Yt(t.slice(0,n),e)),o="\n"===t[0]||" "===t[0];a=r.exec(t);){var u=a[1],s=a[2],a=" "===s[0];i+=u+(o||a||""===s?"":"\n")+Yt(s,e),o=a}return i}(i,e),t));case 5:return'"'+function(t){for(var e,n,r="",i=0;i<t.length;65536<=n?i+=2:i++)n=Ct(t,i),!(e=jt[n])&&At(n)?(r+=t[i],65536<=n&&(r+=t[i+1])):r+=e||function(t){var e,n,r=t.toString(16).toUpperCase();if(t<=255)e="x",n=2;else if(t<=65535)e="u",n=4;else{if(!(t<=4294967295))throw new p("code point within a string may not be greater than 0xFFFFFFFF");e="U",n=8}return"\\"+e+y.repeat("0",n-r.length)+r}(n);return r}(i)+'"';default:throw new p("impossible error: invalid scalar style")}}()}function kt(t,e){var n=Et(t)?String(e):"",e="\n"===t[t.length-1];return n+(!e||"\n"!==t[t.length-2]&&"\n"!==t?e?"":"-":"+")+"\n"}function Ut(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Yt(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,u=0,s="";n=i.exec(t);)(r=n.index)-o>e&&(s+="\n"+t.slice(o,n=o<u?u:r),o=n+1),u=r;return s+="\n",t.length-o>e&&o<u?s+=t.slice(o,u)+"\n"+t.slice(u+1):s+=t.slice(o),s.slice(1)}function Pt(t,e,n,r){for(var i,o="",u=t.tag,s=0,a=n.length;s<a;s+=1)i=n[s],t.replacer&&(i=t.replacer.call(n,String(s),i)),(Qt(t,e+1,i,!0,!0,!1,!0)||void 0===i&&Qt(t,e+1,null,!0,!0,!1,!0))&&(r&&""===o||(o+=Dt(t,e)),t.dump&&10===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=u,t.dump=o||"[]"}function Rt(t,e,n){for(var r,i,o,u,s=0,a=(i=n?t.explicitTypes:t.implicitTypes).length;s<a;s+=1)if(((o=i[s]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof e&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(n?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){if(u=t.styleMap[o.tag]||o.defaultStyle,"[object Function]"===_t.call(o.represent))r=o.represent(e,u);else{if(!Lt.call(o.represent,u))throw new p("!<"+o.tag+'> tag resolver accepts not "'+u+'" style');r=o.represent[u](e,u)}t.dump=r}return 1}}function Qt(t,e,n,r,i,o,u){t.tag=null,t.dump=n,Rt(t,n,!1)||Rt(t,n,!0);var s=_t.call(t.dump),a=r;r=r&&(t.flowLevel<0||t.flowLevel>e);var c,f,l="[object Object]"===s||"[object Array]"===s;if(l&&(f=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||f||2!==t.indent&&0<e)&&(i=!1),f&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(l&&f&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===s)r&&0!==Object.keys(t.dump).length?(function(t,e,n,r){var i,o,u,s,a,c="",f=t.tag,l=Object.keys(n);if(!0===t.sortKeys)l.sort();else if("function"==typeof t.sortKeys)l.sort(t.sortKeys);else if(t.sortKeys)throw new p("sortKeys must be a boolean or a function");for(i=0,o=l.length;i<o;i+=1)a="",r&&""===c||(a+=Dt(t,e)),u=n[s=l[i]],t.replacer&&(u=t.replacer.call(n,s,u)),Qt(t,e+1,s,!0,!0,!0)&&((s=null!==t.tag&&"?"!==t.tag||t.dump&&1024<t.dump.length)&&(t.dump&&10===t.dump.charCodeAt(0)?a+="?":a+="? "),a+=t.dump,s&&(a+=Dt(t,e)),Qt(t,e+1,u,!0,s)&&(t.dump&&10===t.dump.charCodeAt(0)?a+=":":a+=": ",c+=a+=t.dump));t.tag=f,t.dump=c||"{}"}(t,e,t.dump,i),f&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){for(var r,i,o,u="",s=t.tag,a=Object.keys(n),c=0,f=a.length;c<f;c+=1)(o="")!==u&&(o+=", "),t.condenseFlow&&(o+='"'),i=n[r=a[c]],t.replacer&&(i=t.replacer.call(n,r,i)),Qt(t,e,r,!1,!1)&&(1024<t.dump.length&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Qt(t,e,i,!1,!1)&&(u+=o+=t.dump));t.tag=s,t.dump="{"+u+"}"}(t,e,t.dump),f&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===s)r&&0!==t.dump.length?(t.noArrayIndent&&!u&&0<e?Pt(t,e-1,t.dump,i):Pt(t,e,t.dump,i),f&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){for(var r,i="",o=t.tag,u=0,s=n.length;u<s;u+=1)r=n[u],t.replacer&&(r=t.replacer.call(n,String(u),r)),(Qt(t,e,r,!1,!1)||void 0===r&&Qt(t,e,null,!1,!1))&&(""!==i&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=o,t.dump="["+i+"]"}(t,e,t.dump),f&&(t.dump="&ref_"+c+" "+t.dump));else{if("[object String]"!==s){if("[object Undefined]"===s)return;if(t.skipInvalid)return;throw new p("unacceptable kind of an object to dump "+s)}"?"!==t.tag&&zt(t,t.dump,e,o,a)}null!==t.tag&&"?"!==t.tag&&(a=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),a="!"===t.tag[0]?"!"+a:"tag:yaml.org,2002:"===a.slice(0,18)?"!!"+a.slice(18):"!<"+a+">",t.dump=a+" "+t.dump)}return 1}function Bt(t,e){var n,r,i=[],o=[];for(function t(e,n,r){var i,o,u;if(null!==e&&"object"==typeof e)if(-1!==(o=n.indexOf(e)))-1===r.indexOf(o)&&r.push(o);else if(n.push(e),Array.isArray(e))for(o=0,u=e.length;o<u;o+=1)t(e[o],n,r);else for(o=0,u=(i=Object.keys(e)).length;o<u;o+=1)t(e[i[o]],n,r)}(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function Ft(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}w={Type:u,Schema:g,FAILSAFE_SCHEMA:_,JSON_SCHEMA:S,CORE_SCHEMA:D,DEFAULT_SCHEMA:B,load:Mt.load,loadAll:Mt.loadAll,dump:function(t,e){e=new Nt(e=e||{});e.noRefs||Bt(t,e);return e.replacer&&(t=e.replacer.call({"":t},"",t)),Qt(e,0,t,!0,!0)?e.dump+"\n":""},YAMLException:p,types:{binary:E,float:N,map:M,null:L,pairs:P,set:Q,timestamp:O,bool:m,int:j,merge:T,omap:U,seq:v,str:w},safeLoad:Ft("safeLoad","load"),safeLoadAll:Ft("safeLoadAll","loadAll"),safeDump:Ft("safeDump","dump")};e.a=w},function(t,e,n){t.exports=n(330)},function(t,e,n){"use strict";e.a=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{for(var t=window,e=0,n=["File","Blob","FormData"];e<n.length;e++){var r=n[e];r in window&&(t[r]=window[r])}}catch(t){console.error(t)}return t}()},function(t,e,n){var r=n(6),i=n(56),o="".split;t.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},function(t,e,n){var r=n(228),i=n(75);t.exports=function(t){t=r(t,"string");return i(t)?t:String(t)}},function(t,e,n){var r=n(44),n=n(149);t.exports=n?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return"function"==typeof e&&Object(t)instanceof e}},function(t,e,n){n=n(44);t.exports=n("navigator","userAgent")||""},function(t,e,n){function r(){}function i(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e}var o,u=n(29),s=n(236),a=n(111),c=n(79),f=n(237),l=n(151),p=n(80)("IE_PROTO"),h=function(t){return"<script>"+t+"<\/script>"},d=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}d=(!document.domain||!o)&&function(){var t=l("iframe");if(t.style)return t.style.display="none",f.appendChild(t),t.src=String("javascript:"),(t=t.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F}()||i(o);for(var t=a.length;t--;)delete d.prototype[a[t]];return d()};c[p]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(r.prototype=u(t),n=new r,r.prototype=null,n[p]=t):n=d(),void 0===e?n:s(n,e)}},function(t,e,n){var r=n(152),i=n(111);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports={}},function(t,e,n){var r=n(105),i=n(107),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){t.exports=n(253)},function(t,e,n){var r=n(6),i=n(7),o=n(57),u=i("species");t.exports=function(e){return 51<=o||!r(function(){var t=[];return(t.constructor={})[u]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},function(t,e,n){var i=n(116),o=n(33).f,u=n(28),s=n(21),a=n(258),c=n(7)("toStringTag");t.exports=function(t,e,n,r){t&&(t=n?t:t.prototype,s(t,c)||o(t,c,{configurable:!0,value:e}),r&&!i&&u(t,"toString",a))}},function(t,e,n){"use strict";var r=n(32),i=n(118),o=n(46),u=n(117),n=n(165),s="Array Iterator",a=u.set,c=u.getterFor(s);t.exports=n(Array,"Array",function(t,e){a(this,{type:s,target:r(t),index:0,kind:e})},function(){var t=c(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?{value:t.target=void 0,done:!0}:"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){n=n(24).Symbol;t.exports=n},function(t,e,n){var r=n(64),i=n(65);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){n=n(47)(Object,"create");t.exports=n},function(t,e,n){var r=n(426),i=n(427),o=n(428),u=n(429),n=n(430);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=n,t.exports=s},function(t,e,n){var r=n(50);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(432);t.exports=function(t,e){t=t.__data__;return r(e)?t["string"==typeof e?"string":"hash"]:t.map}},function(t,e,n){var r=n(460),i=n(185),o=n(67);t.exports=function(t){return(o(t)?r:i)(t)}},function(t,e,n){var r=n(86);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){"use strict";!function(s){void 0===s||!s.version||0===s.version.indexOf("v0.")||0===s.version.indexOf("v1.")&&0!==s.version.indexOf("v1.8.")?t.exports={nextTick:function(t,e,n,r){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,o,u=arguments.length;switch(u){case 0:case 1:return s.nextTick(t);case 2:return s.nextTick(function(){t.call(null,e)});case 3:return s.nextTick(function(){t.call(null,e,n)});case 4:return s.nextTick(function(){t.call(null,e,n,r)});default:for(i=new Array(u-1),o=0;o<i.length;)i[o++]=arguments[o];return s.nextTick(function(){t.apply(null,i)})}}}:t.exports=s}.call(this,n(35))},function(t,e,n){"use strict";t.exports=n(517)("forEach")},function(t,e,n){"use strict";t.exports=n(540)()?globalThis:n(541)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(148);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),i(t,r.key,r)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(232),i=n(238);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=r(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(156),o=n(246),u=n(251),s=n(252);t.exports=function(n){var r=u();return function(){var t,e=o(n);return e=r?(t=o(this).constructor,i(e,arguments,t)):e.apply(this,arguments),s(this,e)}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){t.exports=n(381)},function(t,e,n){t.exports=n(344)},function(t,e,n){var r=n(23),i=n(103),o=n(55),u=n(32),s=n(74),a=n(21),c=n(150),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=u(t),e=s(e),c)try{return f(t,e)}catch(t){}if(a(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){t=i(this,t);return!!t&&t.enumerable}:r},function(t,e,n){var r=n(57),n=n(6);t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})},function(t,e,n){var r=n(58),i=n(106);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(13),i=n(230),n="__core-js_shared__",n=r[n]||i(n,{});t.exports=n},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e,n){var o=n(59);t.exports=function(r,i,t){if(o(r),void 0===i)return r;switch(t){case 0:return function(){return r.call(i)};case 1:return function(t){return r.call(i,t)};case 2:return function(t,e){return r.call(i,t,e)};case 3:return function(t,e,n){return r.call(i,t,e,n)}}return function(){return r.apply(i,arguments)}}},function(t,e,n){var a=n(32),c=n(30),f=n(153),n=function(s){return function(t,e,n){var r,i=a(t),o=c(i.length),u=f(n,o);if(s&&e!=e){for(;u<o;)if((r=i[u++])!=r)return!0}else for(;u<o;u++)if((s||u in i)&&i[u]===e)return s||u||0;return!s&&-1}};t.exports={includes:n(!0),indexOf:n(!1)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?r:n)(t)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(21),i=n(19),o=n(80),n=n(158),u=o("IE_PROTO"),s=Object.prototype;t.exports=n?Object.getPrototypeOf:function(t){return t=i(t),r(t,u)?t[u]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){"use strict";var r=n(74),i=n(33),o=n(55);t.exports=function(t,e,n){e=r(e);e in t?i.f(t,e,o(0,n)):t[e]=n}},function(t,e){},function(t,e,n){n=n(7);e.f=n},function(t,e,n){var r={};r[n(7)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){var r,i,o,u,s,a,c,f,l=n(259),p=n(13),h=n(14),d=n(28),y=n(21),g=n(106),w=n(80),n=n(79),v="Object already initialized",p=p.WeakMap;c=l||g.state?(r=g.state||(g.state=new p),i=r.get,o=r.has,u=r.set,s=function(t,e){if(o.call(r,t))throw new TypeError(v);return e.facade=t,u.call(r,t,e),e},a=function(t){return i.call(r,t)||{}},function(t){return o.call(r,t)}):(n[f=w("state")]=!0,s=function(t,e){if(y(t,f))throw new TypeError(v);return e.facade=t,d(t,f,e),e},a=function(t){return y(t,f)?t[f]:{}},function(t){return y(t,f)}),t.exports={set:s,get:a,has:c,enforce:function(t){return c(t)?a(t):s(t,{})},getterFor:function(n){return function(t){var e;if(!h(t)||(e=a(t)).type!==n)throw TypeError("Incompatible receiver, "+n+" required");return e}}}},function(t,e){t.exports=function(){}},function(t,e,n){"use strict";var r=n(288).charAt,i=n(34),o=n(117),n=n(165),u="String Iterator",s=o.set,a=o.getterFor(u);n(String,"String",function(t){s(this,{type:u,string:i(t),index:0})},function(){var t=a(this),e=t.string,n=t.index;return n>=e.length?{value:void 0,done:!0}:(n=r(e,n),t.index+=n.length,{value:n,done:!1})})},function(t,e,n){n(84);var r,i=n(297),o=n(13),u=n(61),s=n(28),a=n(46),c=n(7)("toStringTag");for(r in i){var f=o[r],f=f&&f.prototype;f&&u(f)!==c&&s(f,c,r),a[r]=a.Array}},function(t,O,T){"use strict";!function(t){var s=T(306),o=T(307),u=T(168);function n(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(n()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(t=null===t?new l(e):t).length=e,t}function l(t,e,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,n);if("number"!=typeof t)return r(this,t,e,n);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}function r(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=f(t,e),t}(t,e,n,r):"string"==typeof e?function(t,e,n){if(!l.isEncoding(n="string"!=typeof n||""===n?"utf8":n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(e,n),n=(t=i(t,r)).write(e,n);return t=n!==r?t.slice(0,n):t}(t,e,n):function(t,e){if(l.isBuffer(e)){var n=0|p(e.length);return 0===(t=i(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?i(t,0):f(t,e);if("Buffer"===e.type&&u(e.data))return f(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(a(e),t=i(t,e<0?0:0|p(e)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function h(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var n=(t="string"!=typeof t?""+t:t).length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(t).length;default:if(r)return D(t).length;e=(""+e).toLowerCase(),r=!0}}function e(t,e,n){var r,i,o,u=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,n){var r=t.length;(!n||n<0||r<n)&&(n=r);for(var i="",o=e=!e||e<0?0:e;o<n;++o)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[o]);return i}(this,e,n);case"utf8":case"utf-8":return v(this,e,n);case"ascii":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}(this,e,n);case"latin1":case"binary":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}(this,e,n);case"base64":return r=this,o=n,0===(i=e)&&o===r.length?s.fromByteArray(r):s.fromByteArray(r.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,e,n);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),u=!0}}function d(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,(n=(n=isNaN(n)?i?0:t.length-1:n)<0?t.length+n:n)>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o=1,u=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u/=o=2,s/=2,n/=2}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var c=-1,f=n;f<u;f++)if(a(t,f)===a(e,-1===c?0:f-c)){if(f-(c=-1===c?f:c)+1===s)return c*o}else-1!==c&&(f-=f-c),c=-1;else for(f=n=u<n+s?u-s:n;0<=f;f--){for(var l=!0,p=0;p<s;p++)if(a(t,f+p)!==a(e,p)){l=!1;break}if(l)return f}return-1}function w(t,e,n,r){return A(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function v(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,s,a,c=t[i],f=null,l=239<c?4:223<c?3:191<c?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&127<(a=(31&c)<<6|63&o)&&(f=a);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&2047<(a=(15&c)<<12|(63&o)<<6|63&u)&&(a<55296||57343<a)&&(f=a);break;case 4:o=t[i+1],u=t[i+2],s=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&s)&&65535<(a=(15&c)<<18|(63&o)<<12|(63&u)<<6|63&s)&&a<1114112&&(f=a)}null===f?(f=65533,l=1):65535<f&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=M)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=M));return n}(r)}O.Buffer=l,O.SlowBuffer=function(t){return l.alloc(+(t=+t!=t?0:t))},O.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),O.kMaxLength=n(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,n){return r(null,t,e,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,n){return e=e,n=n,a(t=t),!(t<=0)&&void 0!==e?"string"==typeof n?i(null,t).fill(e,n):i(null,t).fill(e):i(null,t)},l.allocUnsafe=function(t){return c(null,t)},l.allocUnsafeSlow=function(t){return c(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!u(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var n=l.allocUnsafe(e),r=0,i=0;i<t.length;++i){var o=t[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?v(this,0,t):e.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",e=O.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=e)return 0;if(i<=r)return-1;if(n<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(o,u),a=this.slice(r,i),c=t.slice(e,n),f=0;f<s;++f)if(a[f]!==c[f]){o=a[f],u=c[f];break}return o<u?-1:u<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||i<n)&&(n=i),0<t.length&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,u,s,a,c,f,l=!1;;)switch(r){case"hex":return function(t,e,n,r){n=Number(n)||0;var i=t.length-n;if((!r||(r=Number(r))>i)&&(r=i),(i=e.length)%2!=0)throw new TypeError("Invalid hex string");i/2<r&&(r=i/2);for(var o=0;o<r;++o){var u=parseInt(e.substr(2*o,2),16);if(isNaN(u))return o;t[n+o]=u}return o}(this,t,e,n);case"utf8":case"utf-8":return c=e,f=n,A(D(t,(a=this).length-c),a,c,f);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return o=this,u=e,s=n,A(I(t),o,u,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,u=n,A(function(t,e){for(var n,r,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=(n=t.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(t,(s=this).length-o),s,o,u);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),l=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function _(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(n<t+e)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function m(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function j(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function x(t,e,n,r){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function b(t,e,n,r,i){return i||x(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function N(t,e,n,r,i){return i||x(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else for(var r=e-t,i=new l(r,void 0),o=0;o<r;++o)i[o]=this[o+t];return i},l.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t+--e],i=1;0<e&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUInt8=function(t,e){return e||_(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||_(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||_(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||_(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=e,i=1,o=this[t+--r];0<r&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||_(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||_(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt16BE=function(t,e){e||_(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt32LE=function(t,e){return e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):m(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):m(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){t=+t,e|=0,r||L(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,u=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){t=+t,e|=0,r||L(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,u=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):m(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):m(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return b(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return b(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n=n||0,r||0===r||(r=this.length),e>=t.length&&(e=t.length),(r=0<r&&r<n?n:r)===n)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i,o=(r=t.length-e<r-n?t.length-e+n:r)-n;if(this===t&&n<e&&e<r)for(i=o-1;0<=i;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){var i;if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length&&(i=t.charCodeAt(0))<256&&(t=i),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;if(e>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(t=t||0))for(s=e;s<n;++s)this[s]=t;else for(var o=l.isBuffer(t)?t:D(new l(t,r).toString()),u=o.length,s=0;s<n-e;++s)this[s+e]=o[s%u];return this};var S=/[^+\/0-9A-Za-z-_]/g;function D(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],u=0;u<r;++u){if(55295<(n=t.charCodeAt(u))&&n<57344){if(!i){if(56319<n){-1<(e-=3)&&o.push(239,191,189);continue}if(u+1===r){-1<(e-=3)&&o.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(e-=3)&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,n<128){if(--e<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function I(t){return s.toByteArray(function(t){if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(S,"")).length<2)return"";for(var e;t.length%4!=0;)t+="=";return t}(t))}function A(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}.call(this,T(20))},function(t,e,n){t.exports=n(309)},function(t,e,n){t.exports=n(312)},function(t,e,n){var r=n(321),i=n(172),o=n(170);t.exports=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=r(n=Object.prototype.toString.call(t)).call(n,8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?i(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(415),i=n(431),o=n(433),u=n(434),n=n(435);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=n,t.exports=s},function(t,e,n){n=n(47)(n(24),"Map");t.exports=n},function(t,e,n){var r=n(437),i=n(474),o=n(481),u=n(22),s=n(482);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?u(t)?i(t[0],t[1]):r(t):s(t)}},function(t,e,n){var r=n(462),i=n(65),n=Object.prototype,o=n.hasOwnProperty,u=n.propertyIsEnumerable,r=r(function(){return arguments}())?r:function(t){return i(t)&&o.call(t,"callee")&&!u.call(t,"callee")};t.exports=r},function(t,o,u){!function(t){var e=u(24),n=u(463),r=o&&!o.nodeType&&o,i=r&&"object"==typeof t&&t&&!t.nodeType&&t,e=i&&i.exports===r?e.Buffer:void 0,n=(e?e.isBuffer:void 0)||n;t.exports=n}.call(this,u(184)(t))},function(t,e){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&-1<t&&t%1==0&&t<e}},function(t,e,n){var r=n(464),i=n(465),n=n(466),n=n&&n.isTypedArray,r=n?i(n):r;t.exports=r},function(t,e){t.exports=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(22),i=n(86),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||u.test(t)||!o.test(t)||null!=e&&t in Object(e)}},function(t,e,n){"use strict";var r="object"==typeof Reflect?Reflect:null,a=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)},i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},o=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(i,o){return new Promise(function(t,e){function n(t){i.removeListener(o,r),e(t)}function r(){"function"==typeof i.removeListener&&i.removeListener("error",n),t([].slice.call(arguments))}g(i,o,r,{once:!0}),"error"===o||"function"==typeof i.on&&g(i,"error",n,{once:!0})})},(u.EventEmitter=u).prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,n,r){var i,o;return c(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener||n),i=t._events),o=i[e]),void 0===o?(o=i[e]=n,++t._eventsCount):("function"==typeof o?o=i[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),0<(n=f(t))&&o.length>n&&!o.warned&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=t,n.type=e,n.count=o.length,console&&console.warn&&console.warn(n))),t}function p(t,e,n){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t);return e.listener=n,t.wrapFn=e}function h(t,e,n){t=t._events;if(void 0===t)return[];e=t[e];return void 0===e?[]:"function"==typeof e?n?[e.listener||e]:[e]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):y(e,e.length)}function d(t){var e=this._events;if(void 0!==e){t=e[t];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(n,r,i,o){if("function"==typeof n.on)o.once?n.once(r,i):n.on(r,i);else{if("function"!=typeof n.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n);n.addEventListener(r,function t(e){o.once&&n.removeEventListener(r,t),i(e)})}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r,i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if((r=0<e.length?e[0]:r)instanceof Error)throw r;i=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw i.context=r,i}t=o[t];if(void 0===t)return!1;if("function"==typeof t)a(t,this,e);else for(var u=t.length,s=y(t,u),n=0;n<u;++n)a(s[n],this,e);return!0},u.prototype.on=u.prototype.addListener=function(t,e){return l(this,t,e,!1)},u.prototype.prependListener=function(t,e){return l(this,t,e,!0)},u.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},u.prototype.removeListener=function(t,e){var n,r,i,o,u;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;0<=o;o--)if(n[o]===e||n[o].listener===e){u=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,u||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(o=e.length-1;0<=o;o--)this.removeListener(t,e[o]);return this},u.prototype.listeners=function(t){return h(this,t,!0)},u.prototype.rawListeners=function(t){return h(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return 0<this._eventsCount?i(this._events):[]}},function(t,e,n){(((e=t.exports=n(192)).Stream=e).Readable=e).Writable=n(136),e.Duplex=n(36),e.Transform=n(197),e.PassThrough=n(506)},function(L,t,m){"use strict";!function(t,e,n){var p=m(93);function f(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e){var n=t.entry;for(t.entry=null;n;){var r=n.callback;e.pendingcb--,r(void 0),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}L.exports=a;var o,l=!t.browser&&-1<["v0.10","v0.9."].indexOf(t.version.slice(0,5))?e:p.nextTick;a.WritableState=s;e=Object.create(m(68));e.inherits=m(16);var r,i={deprecate:m(505)},u=m(193),h=m(17).Buffer,d=n.Uint8Array||function(){},n=m(194);function y(){}function s(t,c){o=o||m(36);var e=c instanceof o;this.objectMode=!!(t=t||{}).objectMode,e&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,r=t.writableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:e&&(r||0===r)?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;i=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var e,n,r,i,o,u,s,a;n=t,u=(e=c)._writableState,s=u.sync,a=u.writecb,(o=u).writing=!1,o.writecb=null,o.length-=o.writelen,o.writelen=0,n?(r=e,t=s,o=n,n=a,--(i=u).pendingcb,t?(p.nextTick(n,o),p.nextTick(_,r,i),r._writableState.errorEmitted=!0,r.emit("error",o)):(n(o),r._writableState.errorEmitted=!0,r.emit("error",o),_(r,i))):((i=M(u))||u.corked||u.bufferProcessing||!u.bufferedRequest||v(e,u),s?l(w,e,u,i,a):w(e,u,i,a))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function a(t){if(o=o||m(36),!(r.call(a,this)||this instanceof o))return new a(t);this._writableState=new s(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function g(t,e,n,r,i,o,u){e.writelen=r,e.writecb=u,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,n,r){var i;n||(i=t,0===(n=e).length&&n.needDrain&&(n.needDrain=!1,i.emit("drain"))),e.pendingcb--,r(),_(t,e)}function v(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),r=e.corkedRequestsFree;r.entry=n;for(var o=0,u=!0;n;)(i[o]=n).isBuf||(u=!1),n=n.next,o+=1;i.allBuffers=u,g(t,e,!0,e.length,i,"",r.finish),e.pendingcb++,e.lastBufferedRequest=null,r.next?(e.corkedRequestsFree=r.next,r.next=null):e.corkedRequestsFree=new f(e),e.bufferedRequestCount=0}else{for(;n;){var s=n.chunk,a=n.encoding,c=n.callback;if(g(t,e,!1,e.objectMode?1:s.length,s,a,c),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function c(e,n){e._final(function(t){n.pendingcb--,t&&e.emit("error",t),n.prefinished=!0,e.emit("prefinish"),_(e,n)})}function _(t,e){var n,r,i=M(e);return i&&(n=t,(r=e).prefinished||r.finalCalled||("function"==typeof n._final?(r.pendingcb++,r.finalCalled=!0,p.nextTick(c,n,r)):(r.prefinished=!0,n.emit("prefinish"))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}e.inherits(a,u),s.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(s.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(t){return!!r.call(this,t)||this===a&&t&&t._writableState instanceof s}})):r=function(t){return t instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(t,e,n){var r,i,o,u,s,a,c=this._writableState,f=!1,l=!c.objectMode&&(i=t,h.isBuffer(i)||i instanceof d);return l&&!h.isBuffer(t)&&(a=t,t=h.from(a)),"function"==typeof e&&(n=e,e=null),e=l?"buffer":e||c.defaultEncoding,"function"!=typeof n&&(n=y),c.ended?(o=this,u=n,s=new Error("write after end"),o.emit("error",s),p.nextTick(u,s)):(l||(r=this,i=c,a=n,u=!(o=!0),null===(s=t)?u=new TypeError("May not write null values to stream"):"string"==typeof s||void 0===s||i.objectMode||(u=new TypeError("Invalid non-string/buffer chunk")),u&&(r.emit("error",u),p.nextTick(a,u),o=!1),o))&&(c.pendingcb++,f=function(t,e,n,r,i,o){n||(s=r,a=i,s=e.objectMode||!1===e.decodeStrings||"string"!=typeof s?s:h.from(s,a),r!==s&&(n=!0,i="buffer",r=s));var u=e.objectMode?1:r.length;e.length+=u;var s,a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked?(s=e.lastBufferedRequest,e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},s?s.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1):g(t,e,!1,u,r,i,o),a}(this,c,l,t,e,n)),f},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||v(this,t))},a.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),a.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,e=t=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||(e=this,n=n,(r=r).ending=!0,_(e,r),n&&(r.finished?p.nextTick(n):e.once("finish",n)),r.ended=!0,e.writable=!1)},Object.defineProperty(a.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),a.prototype.destroy=n.destroy,a.prototype._undestroy=n.undestroy,a.prototype._destroy=function(t,e){this.end(),e(t)}}.call(this,m(35),m(195).setImmediate,m(20))},function(t,e,n){"use strict";t.exports=n(536)()?Array.from:n(537)},function(t,e,n){"use strict";var i=n(554),o=n(38),u=n(48),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,c=Math.abs,f=Math.floor;t.exports=function(t){var e,n,r;if(!i(t))return s.apply(this,arguments);for(n=o(u(this).length),t=arguments[1],e=t=isNaN(t)?0:0<=t?f(t):o(this.length)-f(c(t));e<n;++e)if(a.call(this,e)&&(r=this[e],i(r)))return e;return-1}},function(r,t,e){"use strict";!function(t,e){function o(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}function n(t){var e,n,r=document.createTextNode(""),i=0;return new t(function(){var t;if(e)n&&(e=n.concat(e));else{if(!n)return;e=n}if(n=e,e=null,"function"==typeof n)return t=n,n=null,void t();for(r.data=i=++i%2;n;)t=n.shift(),n.length||(n=null),t()}).observe(r,{characterData:!0}),function(t){o(t),e?"function"==typeof e?e=[e,t]:e.push(t):(e=t,r.data=i=++i%2)}}r.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("function"==typeof queueMicrotask)return function(t){queueMicrotask(o(t))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof e?function(t){e(o(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(o(t),0)}:null}()}.call(this,e(35),e(195).setImmediate)},function(t,e,n){n=n(400)("toUpperCase");t.exports=n},function(t,e,n){var u=n(125);function s(r,i){if("function"!=typeof r||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var t=arguments,e=i?i.apply(this,t):t[0],n=o.cache;return n.has(e)?n.get(e):(t=r.apply(this,t),o.cache=n.set(e,t)||n,t)}return o.cache=new(s.Cache||u),o}s.Cache=u,t.exports=s},function(t,e,n){var s=n(81),a=n(123),c=n(122),f=n(124);t.exports=function(t,e){var n=void 0!==s&&a(t)||t["@@iterator"];if(!n){if(c(t)||(n=f(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,e=function(){};return{s:e,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){u=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw i}}}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){t.exports=n(350)},function(t,e,n){t.exports=n(374)},function(t,e,n){var i=n(183),o=n(127),u=n(492),s=n(22),a=n(498);t.exports=function(t,e,n){var r=s(t)?i:u;return n&&a(t,e,n)&&(e=void 0),r(t,o(e,3))}},function(t,e,n){"use strict";n.d(e,"a",function(){return u}),n.d(e,"b",function(){return a});function Q(t){var e=t=Object(tt.d)(t),n=e.type,r=e.format,n=o[W()(e="".concat(n,"_")).call(e,r)]||o[n];return Object(tt.b)(n)?n(t):"Unknown Type: "+t.type}function B(e,n){var t,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(J()(t=W()(t=["example","default","enum","xml","type"]).call(t,nt,rt,it,s)).call(t,function(t){void 0===n[t=t]&&void 0!==e[t]&&(n[t]=e[t])}),void 0!==e.required&&Z()(e.required)&&(void 0!==n.required&&n.required.length||(n.required=[]),J()(t=e.required).call(t,function(t){var e;X()(e=n.required).call(e,t)||n.required.push(t)})),e.properties){n.properties||(n.properties={});var i,o,u=Object(tt.d)(e.properties);for(i in u)Object.prototype.hasOwnProperty.call(u,i)&&(u[i]&&u[i].deprecated||u[i]&&u[i].readOnly&&!r.includeReadOnly||u[i]&&u[i].writeOnly&&!r.includeWriteOnly||n.properties[i]||(n.properties[i]=u[i],!e.required&&Z()(e.required)&&-1!==q()(o=e.required).call(o,i)&&(n.required?n.required.push(i):n.required=[i])))}return e.items&&(n.items||(n.items={}),n.items=B(e.items,n.items,r)),n}function F(o){var u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0,s=3<arguments.length&&void 0!==arguments[3]&&arguments[3];o&&Object(tt.b)(o.toJS)&&(o=o.toJS());var e=void 0!==t||o&&void 0!==o.example||o&&void 0!==o.default,n=!e&&o&&o.oneOf&&0<o.oneOf.length,r=!e&&o&&o.anyOf&&0<o.anyOf.length;if(!e&&(n||r)){var i=Object(tt.d)((n?o.oneOf:o.anyOf)[0]);if(B(i,o,u),!o.xml&&i.xml&&(o.xml=i.xml),void 0!==o.example&&void 0!==i.example)e=!0;else if(i.properties){o.properties||(o.properties={});var a,c,f=Object(tt.d)(i.properties);for(a in f)Object.prototype.hasOwnProperty.call(f,a)&&(f[a]&&f[a].deprecated||f[a]&&f[a].readOnly&&!u.includeReadOnly||f[a]&&f[a].writeOnly&&!u.includeWriteOnly||o.properties[a]||(o.properties[a]=f[a],!i.required&&Z()(i.required)&&-1!==q()(c=i.required).call(c,a)&&(o.required?o.required.push(a):o.required=[a])))}}var l,p={},h=(L=o||{}).xml,d=L.type,y=L.example,g=L.properties,w=L.additionalProperties,v=L.items,M=u.includeReadOnly,_=u.includeWriteOnly,r=(h=h||{}).name,n=h.prefix,L=h.namespace,m={};function j(){return o&&null!==o.maxProperties&&void 0!==o.maxProperties&&I>=o.maxProperties}function x(t){return!o||null===o.maxProperties||void 0===o.maxProperties||!j()&&(e=t,!!(o&&o.required&&o.required.length&&X()(t=o.required).call(t,e))||0<o.maxProperties-I-function(){if(!o||!o.required)return 0;var t,n=0;return s?J()(t=o.required).call(t,function(t){return n+=void 0===m[t]?0:1}):J()(t=o.required).call(t,function(e){var t;return n+=void 0===(null===(t=m[l])||void 0===t?void 0:K()(t).call(t,function(t){return void 0!==t[e]}))?0:1}),o.required.length-n}());var e}s&&(l=(n?n+":":"")+(r||"notagname"),L)&&(p[n?"xmlns:"+n:"xmlns"]=L),s&&(m[l]=[]),L=function(t){return V()(t).call(t,function(t){return Object.prototype.hasOwnProperty.call(o,t)})},o&&!d&&(g||w||L(nt)?d="object":v||L(rt)?d="array":L(it)?o.type=d="number":e||o.enum||(o.type=d="string"));var b,N,S,L=function(t){if(null!==(null===o||void 0===o?void 0:o.maxItems)&&void 0!==(null===o||void 0===o?void 0:o.maxItems)&&(t=H()(t).call(t,0,null===o||void 0===o?void 0:o.maxItems)),null!==(null===o||void 0===o?void 0:o.minItems)&&void 0!==(null===o||void 0===o?void 0:o.minItems))for(var e=0;t.length<(null===o||void 0===o?void 0:o.minItems);)t.push(t[e++%t.length]);return t},D=Object(tt.d)(g),I=0,A=s?function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:void 0;if(o&&D[t]){if(D[t].xml=D[t].xml||{},D[t].xml.attribute){var n=Z()(D[t].enum)?D[t].enum[0]:void 0,r=D[t].example,i=D[t].default;return void(p[D[t].xml.name||t]=void 0!==r?r:void 0!==i?i:void 0!==n?n:Q(D[t]))}D[t].xml.name=D[t].xml.name||t}else D[t]||!1===w||(D[t]={xml:{name:t}});e=F(o&&D[t]||void 0,u,e,s);x(t)&&(I++,Z()(e)?m[l]=W()(t=m[l]).call(t,e):m[l].push(e))}:function(t,e){x(t)&&(m[t]=F(D[t],u,e,s),I++)};if(e){if(y=void 0!==t?t:void 0!==y?y:o.default,N=Object(tt.a)(y,"$$ref",function(t){return"string"==typeof t&&-1<q()(t).call(t,"#")}),!s){if("number"==typeof N&&"string"===d)return"".concat(N);if("string"!=typeof N||"string"===d)return N;try{return JSON.parse(N)}catch(t){return N}}if("array"===(d=!o?Z()(N)?"array":G()(N):d)){if(!Z()(N)){if("string"==typeof N)return N;N=[N]}var O=o?o.items:void 0;O&&(O.xml=O.xml||h||{},O.xml.name=O.xml.name||h.name);var T=L(T=$()(N).call(N,function(t){return F(O,u,t,s)}));return h.wrapped?(m[l]=T,et()(p)||m[l].push({_attr:p})):m=T,m}if("object"!==d)return m[l]=et()(p)?N:[{_attr:p},N],m;if("string"==typeof N)return N;for(S in N)Object.prototype.hasOwnProperty.call(N,S)&&(o&&D[S]&&D[S].readOnly&&!M||o&&D[S]&&D[S].writeOnly&&!_||(o&&D[S]&&D[S].xml&&D[S].xml.attribute?p[D[S].xml.name||S]=N[S]:A(S,N[S])));return et()(p)||m[l].push({_attr:p}),m}if("object"===d){for(var C in D)Object.prototype.hasOwnProperty.call(D,C)&&(D[C]&&D[C].deprecated||D[C]&&D[C].readOnly&&!M||D[C]&&D[C].writeOnly&&!_||A(C));if(s&&p&&m[l].push({_attr:p}),j())return m;if(!0===w)s?m[l].push({additionalProp:"Anything can be here"}):m.additionalProp1={},I++;else if(w){var E,T=Object(tt.d)(w),z=F(T,u,void 0,s);if(s&&T.xml&&T.xml.name&&"notagname"!==T.xml.name)m[l].push(z);else for(var k=null!==o.minProperties&&void 0!==o.minProperties&&I<o.minProperties?o.minProperties-I:3,U=1;U<=k;U++){if(j())return m;s?((E={})["additionalProp"+U]=z.notagname,m[l].push(E)):m["additionalProp"+U]=z,I++}}return m}if("array"===d){if(!v)return;if(s&&(v.xml=v.xml||(null===o||void 0===o?void 0:o.xml)||{},v.xml.name=v.xml.name||h.name),Z()(v.anyOf))P=$()(Y=v.anyOf).call(Y,function(t){return F(B(v,t,u),u,void 0,s)});else if(Z()(v.oneOf))var Y,P=$()(Y=v.oneOf).call(Y,function(t){return F(B(v,t,u),u,void 0,s)});else{if(s&&!h.wrapped)return F(v,u,void 0,s);P=[F(v,u,void 0,s)]}return P=L(P),s&&h.wrapped?(m[l]=P,et()(p)||m[l].push({_attr:p}),m):P}if(o&&Z()(o.enum))b=Object(tt.c)(o.enum)[0];else{if(!o)return;if("number"==typeof(b=Q(o))&&(null!=(P=o.minimum)&&(o.exclusiveMinimum&&P++,b=P),null!=(P=o.maximum)&&(o.exclusiveMaximum&&P--,b=P)),"string"==typeof b&&(null!==o.maxLength&&void 0!==o.maxLength&&(b=H()(b).call(b,0,o.maxLength)),null!==o.minLength&&void 0!==o.minLength))for(var R=0;b.length<o.minLength;)b+=b[R++%b.length]}if("file"!==d)return s?(m[l]=et()(p)?b:[{_attr:p},b],m):b}var r=n(18),G=n.n(r),e=n(3),W=n.n(e),r=n(42),q=n.n(r),e=n(9),J=n.n(e),r=n(5),Z=n.n(r),e=n(41),X=n.n(e),r=n(52),V=n.n(r),e=n(51),H=n.n(e),r=n(100),K=n.n(r),e=n(11),$=n.n(e),tt=n(12),r=n(219),i=n.n(r),e=n(147),r=n.n(e),e=n(54),et=n.n(e),o={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(t){return"boolean"!=typeof t.default||t.default}},nt=["maxProperties","minProperties"],rt=["minItems","maxItems"],it=["minimum","maximum","exclusiveMinimum","exclusiveMaximum"],s=["minLength","maxLength"],u=r()(function(t,e,n){n=F(t,e,n,!0);if(n)return"string"==typeof n?n:i()(n,{declaration:!0,indent:"\t"})}),a=r()(function(t,e,n){return F(t,e,n,!1)})},function(t,e,r){"use strict";var i=r(198),o=r(199),u=r(516);t.exports=function(t){var e,n=i(arguments[1]);return n.normalizer||0!==(e=n.length=o(n.length,t.length,n.async))&&(n.primitive?!1===e?n.normalizer=r(551):1<e&&(n.normalizer=r(552)(e)):n.normalizer=!1===e?r(553)():1===e?r(557)():r(558)(e)),n.async&&r(559),n.promise&&r(560),n.dispose&&r(566),n.maxAge&&r(567),n.max&&r(570),n.refCounter&&r(572),u(t,n)}},function(t,e,n){t.exports=n(225)},function(t,e,n){n=n(104);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(23),i=n(6),o=n(151);t.exports=!r&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(13),n=n(14),i=r.document,o=n(i)&&n(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var u=n(21),s=n(32),a=n(109).indexOf,c=n(79);t.exports=function(t,e){var n,r=s(t),i=0,o=[];for(n in r)!u(c,n)&&u(r,n)&&o.push(n);for(;e.length>i;)u(r,n=e[i++])&&(~a(o,n)||o.push(n));return o}},function(t,e,n){var r=n(110),i=Math.max,o=Math.min;t.exports=function(t,e){t=r(t);return t<0?i(t+e,0):o(t,e)}},function(t,e,n){t.exports=n(239)},function(t,e,n){var i=n(29),o=n(242);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n,r=!1,t={};try{(n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(t,[]),r=t instanceof Array}catch(n){}return function(t,e){return i(t),o(e),r?n.call(t,e):t.__proto__=e,t}}():void 0)},function(t,e,n){t.exports=n(243)},function(t,e,n){"use strict";var o=n(59),u=n(14),s=[].slice,a={};t.exports=Function.bind||function(e){var n=o(this),r=s.call(arguments,1),i=function(){var t=r.concat(s.call(arguments));return this instanceof i?function(t,e,n){if(!(e in a)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";a[e]=Function("C,a","return new C("+r.join(",")+")")}return a[e](t,n)}(n,t.length,t):n.apply(e,t)};return u(n.prototype)&&(i.prototype=n.prototype),i}},function(t,e,n){n=n(6);t.exports=!n(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,e,n){"use strict";var r=n(1),i=n(6),c=n(60),f=n(14),l=n(19),p=n(30),h=n(113),d=n(160),o=n(82),u=n(7),n=n(57),y=u("isConcatSpreadable"),g=9007199254740991,w="Maximum allowed index exceeded",i=51<=n||!i(function(){var t=[];return t[y]=!1,t.concat()[0]!==t}),o=o("concat");r({target:"Array",proto:!0,forced:!i||!o},{concat:function(t){for(var e,n,r,i=l(this),o=d(i,0),u=0,s=-1,a=arguments.length;s<a;s++)if(function(t){if(!f(t))return!1;var e=t[y];return void 0!==e?!!e:c(t)}(r=-1===s?i:arguments[s])){if(u+(n=p(r.length))>g)throw TypeError(w);for(e=0;e<n;e++,u++)e in r&&h(o,u,r[e])}else{if(g<=u)throw TypeError(w);h(o,u++,r)}return o.length=u,o}})},function(t,e,n){var r=n(255);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},function(t,e,n){var r=n(152),i=n(111).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(28);t.exports=function(t,e,n,r){r&&r.enumerable?t[e]=n:i(t,e,n)}},function(t,e,n){n(4)("iterator")},function(t,e,n){"use strict";function y(){return this}var g=n(1),w=n(287),v=n(112),M=n(155),_=n(83),L=n(28),m=n(163),r=n(7),j=n(58),x=n(46),n=n(166),b=n.IteratorPrototype,N=n.BUGGY_SAFARI_ITERATORS,S=r("iterator"),D="values";t.exports=function(t,e,n,r,i,o,u){w(n,e,r);function s(t){if(t===i&&d)return d;if(!N&&t in p)return p[t];switch(t){case"keys":case D:case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}}var a,c,f=e+" Iterator",l=!1,p=t.prototype,h=p[S]||p["@@iterator"]||i&&p[i],d=!N&&h||s(i),r="Array"==e&&p.entries||h;if(r&&(t=v(r.call(new t)),b!==Object.prototype&&t.next&&(j||v(t)===b||(M?M(t,b):"function"!=typeof t[S]&&L(t,S,y)),_(t,f,!0,!0),j&&(x[f]=y))),i==D&&h&&h.name!==D&&(l=!0,d=function(){return h.call(this)}),j&&!u||p[S]===d||L(p,S,d),x[e]=d,i)if(a={values:s(D),keys:o?d:s("keys"),entries:s("entries")},u)for(c in a)!N&&!l&&c in p||m(p,c,a[c]);else g({target:e,proto:!0,forced:N||l},a);return a}},function(t,e,n){"use strict";var r,i=n(6),o=n(112),u=n(28),s=n(21),a=n(7),c=n(58),f=a("iterator"),n=!1;[].keys&&("next"in(a=[].keys())?(a=o(o(a)))!==Object.prototype&&(r=a):n=!0);i=null==r||i(function(){var t={};return r[f].call(t)!==t});i&&(r={}),c&&!i||s(r,f)||u(r,f,function(){return this}),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:n}},function(t,e,n){t.exports=n(291)()},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){n(310);n=n(10);t.exports=n.Array.isArray},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(61),i=n(46),o=n(7)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){t.exports=n(313)},function(t,e,n){var r=n(323),i=Array.prototype;t.exports=function(t){var e=t.slice;return t===i||t instanceof Array&&e===i.slice?r:e}},function(t,e,n){var r=n(373);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(7)("match");t.exports=function(e){var n=/./;try{"/./"[e](n)}catch(t){try{return n[r]=!1,"/./"[e](n)}catch(e){}}return!1}},function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,n){!function(t){t="object"==typeof t&&t&&t.Object===Object&&t;e.exports=t}.call(this,n(20))},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(88),i=n(439),o=n(440),u=n(441),s=n(442),n=n(443);function a(t){t=this.__data__=new r(t);this.size=t.size}a.prototype.clear=i,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=s,a.prototype.set=n,t.exports=a},function(t,e,n){var u=n(444),s=n(65);t.exports=function t(e,n,r,i,o){return e===n||(null==e||null==n||!s(e)&&!s(n)?e!=e&&n!=n:u(e,n,r,i,t,o))}},function(t,e,n){var g=n(445),w=n(183),v=n(448);t.exports=function(t,e,n,r,i,o){var u=1&n,s=t.length,a=e.length;if(s!=a&&!(u&&s<a))return!1;var c=o.get(t),a=o.get(e);if(c&&a)return c==e&&a==t;var f=-1,l=!0,p=2&n?new g:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var h,d=t[f],y=e[f];if(void 0!==(h=r?u?r(y,d,f,e,t,o):r(d,y,f,t,e,o):h)){if(h)continue;l=!1;break}if(p){if(!w(e,function(t,e){if(!v(p,e)&&(d===t||i(d,t,n,r,o)))return p.push(e)})){l=!1;break}}else if(d!==y&&!i(d,y,n,r,o)){l=!1;break}}return o.delete(t),o.delete(e),l}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(186),i=n(467),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e,n=[];for(e in Object(t))o.call(t,e)&&"constructor"!=e&&n.push(e);return n}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(469),i=n(126),o=n(470),u=n(471),s=n(472),a=n(64),c=n(179),f="[object Map]",l="[object Promise]",p="[object Set]",h="[object WeakMap]",d="[object DataView]",y=c(r),g=c(i),w=c(o),v=c(u),M=c(s),n=a;(r&&n(new r(new ArrayBuffer(1)))!=d||i&&n(new i)!=f||o&&n(o.resolve())!=l||u&&n(new u)!=p||s&&n(new s)!=h)&&(n=function(t){var e=a(t),t="[object Object]"==e?t.constructor:void 0,t=t?c(t):"";if(t)switch(t){case y:return d;case g:return f;case w:return l;case v:return p;case M:return h}return e}),t.exports=n},function(t,e,n){var r=n(66);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(e,n){return function(t){return null!=t&&t[e]===n&&(void 0!==n||e in Object(t))}}},function(t,e,n){var i=n(191),o=n(92);t.exports=function(t,e){for(var n=0,r=(e=i(e,t)).length;null!=t&&n<r;)t=t[o(e[n++])];return n&&n==r?t:void 0}},function(t,e,n){var r=n(22),i=n(133),o=n(476),u=n(63);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(u(t))}},function(A,t,O){"use strict";!function(t,g){var w=O(93);A.exports=i;var o,v=O(168);i.ReadableState=r,O(134).EventEmitter;function M(t,e){return t.listeners(e).length}var n=O(193),l=O(17).Buffer,p=t.Uint8Array||function(){},e=Object.create(O(68));e.inherits=O(16);var u,t=O(501),_=void 0,_=t&&t.debuglog?t.debuglog("stream"):function(){},s=O(502),t=O(194);e.inherits(i,n);var a=["error","close","destroy","pause","resume"];function r(t,e){t=t||{};var n=e instanceof(o=o||O(36));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=t.readableHighWaterMark,e=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(i||0===i)?i:e,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u=u||O(196).StringDecoder,this.decoder=new u(t.encoding),this.encoding=t.encoding)}function i(t){if(o=o||O(36),!(this instanceof i))return new i(t);this._readableState=new r(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),n.call(this)}function c(t,e,n,r,i){var o,u,s,a,c,f=t._readableState;return null===e?(f.reading=!1,s=t,(a=f).ended||(!a.decoder||(c=a.decoder.end())&&c.length&&(a.buffer.push(c),a.length+=a.objectMode?1:c.length),a.ended=!0,d(s))):(i||(o=f,i=s=e,o=u=l.isBuffer(i)||i instanceof p||"string"==typeof s||void 0===s||o.objectMode?u:new TypeError("Invalid non-string/buffer chunk")),o?t.emit("error",o):f.objectMode||e&&0<e.length?("string"==typeof e||f.objectMode||Object.getPrototypeOf(e)===l.prototype||(o=e,e=l.from(o)),r?f.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):h(t,f,e,!0):f.ended?t.emit("error",new Error("stream.push() after EOF")):(f.reading=!1,f.decoder&&!n?(e=f.decoder.write(e),f.objectMode||0!==e.length?h(t,f,e,!1):L(t,f)):h(t,f,e,!1))):r||(f.reading=!1)),!f.ended&&(f.needReadable||f.length<f.highWaterMark||0===f.length)}function h(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&d(t)),L(t,e)}Object.defineProperty(i.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),i.prototype.destroy=t.destroy,i.prototype._undestroy=t.undestroy,i.prototype._destroy=function(t,e){this.push(null),e(t)},i.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=l.from(t,e),e=""),n=!0),c(this,t,e,!1,n)},i.prototype.unshift=function(t){return c(this,t,null,!0,!1)},i.prototype.isPaused=function(){return!1===this._readableState.flowing},i.prototype.setEncoding=function(t){return u=u||O(196).StringDecoder,this._readableState.decoder=new u(t),this._readableState.encoding=t,this};function f(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?(e.flowing&&e.length?e.buffer.head.data:e).length:(t>e.highWaterMark&&(e.highWaterMark=(8388608<=(n=t)?n=8388608:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var n}function d(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(_("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?w.nextTick(y,t):y(t))}function y(t){_("emit readable"),t.emit("readable"),b(t)}function L(t,e){e.readingMore||(e.readingMore=!0,w.nextTick(m,t,e))}function m(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(_("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function j(t){_("readable nexttick read 0"),t.read(0)}function x(t,e){e.reading||(_("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),b(t),e.flowing&&!e.reading&&t.read(0)}function b(t){var e=t._readableState;for(_("flow",e.flowing);e.flowing&&null!==t.read(););}function N(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):(n=t,t=e.buffer,e=e.decoder,n<t.head.data.length?(r=t.head.data.slice(0,n),t.head.data=t.head.data.slice(n)):r=n===t.head.data.length?t.shift():(e?function(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,u=t>o.length?o.length:t;if(u===o.length?i+=o:i+=o.slice(0,t),0==(t-=u)){u===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n).data=o.slice(u);break}++r}return e.length-=r,i}:function(t,e){var n=l.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,u=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,u),0==(t-=u)){u===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r).data=o.slice(u);break}++i}return e.length-=i,n})(n,t),i=r),i);var n,r,i}function S(t){var e=t._readableState;if(0<e.length)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,w.nextTick(D,e,t))}function D(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function I(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}i.prototype.read=function(t){_("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return _("read: emitReadable",e.length,e.ended),(0===e.length&&e.ended?S:d)(this),null;if(0===(t=f(t,e))&&e.ended)return 0===e.length&&S(this),null;var r=e.needReadable;return _("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&_("length less than watermark",r=!0),e.ended||e.reading?_("reading or ended",r=!1):r&&(_("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=f(n,e))),null===(r=0<t?N(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&S(this)),null!==r&&this.emit("data",r),r},i.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},i.prototype.pipe=function(r,t){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=r;break;case 1:o.pipes=[o.pipes,r];break;default:o.pipes.push(r)}o.pipesCount+=1,_("pipe count=%d opts=%j",o.pipesCount,t);var e=t&&!1===t.end||r===g.stdout||r===g.stderr?y:u;function u(){_("onend"),r.end()}o.endEmitted?w.nextTick(e):i.once("end",e),r.on("unpipe",function t(e,n){_("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,_("cleanup"),r.removeListener("close",h),r.removeListener("finish",d),r.removeListener("drain",s),r.removeListener("error",p),r.removeListener("unpipe",t),i.removeListener("end",u),i.removeListener("end",y),i.removeListener("data",l),c=!0,!o.awaitDrain||r._writableState&&!r._writableState.needDrain||s())});var n,s=(n=i,function(){var t=n._readableState;_("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&M(n,"data")&&(t.flowing=!0,b(n))});r.on("drain",s);var a,c=!1,f=!1;function l(t){_("ondata"),(f=!1)!==r.write(t)||f||((1===o.pipesCount&&o.pipes===r||1<o.pipesCount&&-1!==I(o.pipes,r))&&!c&&(_("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,f=!0),i.pause())}function p(t){_("onerror",t),y(),r.removeListener("error",p),0===M(r,"error")&&r.emit("error",t)}function h(){r.removeListener("finish",d),y()}function d(){_("onfinish"),r.removeListener("close",h),y()}function y(){_("unpipe"),i.unpipe(r)}return i.on("data",l),a="error",t=p,"function"==typeof(e=r).prependListener?e.prependListener(a,t):e._events&&e._events[a]?v(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t),r.once("close",h),r.once("finish",d),r.emit("pipe",i),o.flowing||(_("pipe resume"),i.resume()),r},i.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t=t||e.pipes,e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var u=I(e.pipes,t);return-1===u||(e.pipes.splice(u,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},i.prototype.addListener=i.prototype.on=function(t,e){e=n.prototype.on.call(this,t,e);return"data"===t?!1!==this._readableState.flowing&&this.resume():"readable"===t&&((t=this._readableState).endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.emittedReadable=!1,t.reading?t.length&&d(this):w.nextTick(j,this))),e},i.prototype.resume=function(){var t,e=this._readableState;return e.flowing||(_("resume"),e.flowing=!0,t=this,(e=e).resumeScheduled||(e.resumeScheduled=!0,w.nextTick(x,t,e))),this},i.prototype.pause=function(){return _("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(_("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(e){var t,n=this,r=this._readableState,i=!1;for(t in e.on("end",function(){var t;_("wrapped end"),r.decoder&&!r.ended&&(t=r.decoder.end())&&t.length&&n.push(t),n.push(null)}),e.on("data",function(t){_("wrapped data"),r.decoder&&(t=r.decoder.write(t)),r.objectMode&&null==t||(r.objectMode||t&&t.length)&&(n.push(t)||(i=!0,e.pause()))}),e)void 0===this[t]&&"function"==typeof e[t]&&(this[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t));for(var o=0;o<a.length;o++)e.on(a[o],this.emit.bind(this,a[o]));return this._read=function(t){_("wrapped _read",t),i&&(i=!1,e.resume())},this},Object.defineProperty(i.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),i._fromList=N}.call(this,O(20),O(35))},function(t,e,n){t.exports=n(134).EventEmitter},function(t,e,n){"use strict";var o=n(93);function u(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||o.nextTick(u,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(o.nextTick(u,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,i,o){!function(t){var e=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function r(t,e){this._id=t,this._clearFn=e}i.setTimeout=function(){return new r(n.call(setTimeout,e,arguments),clearTimeout)},i.setInterval=function(){return new r(n.call(setInterval,e,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(e,this._id)},i.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},i.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},i._unrefActive=i.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},o(504),i.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,i.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}.call(this,o(20))},function(t,e,n){"use strict";var r=n(17).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function u(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e,n,r=this.lastTotal-this.lastNeed,e=(e=this,128!=(192&(n=t)[0])?(e.lastNeed=0,"�"):1<e.lastNeed&&1<n.length?128!=(192&n[1])?(e.lastNeed=1,"�"):2<e.lastNeed&&2<n.length&&128!=(192&n[2])?(e.lastNeed=2,"�"):void 0:void 0);return void 0!==e?e:this.lastNeed<=t.length?(t.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,r,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1);var n=t.toString("utf16le",e);if(n){e=n.charCodeAt(n.length-1);if(55296<=e&&e<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function f(t,e){var n=(t.length-e)%3;return 0==n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}(e.StringDecoder=o).prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+"�":t},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=u(e[r]);return 0<=i?(0<i&&(t.lastNeed=i-1),i):--r<n||-2===i?0:0<=(i=u(e[r]))?(0<i&&(t.lastNeed=i-2),i):!(--r<n||-2===i)&&0<=(i=u(e[r]))?(0<i&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;n=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=i;var r=n(36),t=Object.create(n(68));function i(t){if(!(this instanceof i))return new i(t);r.call(this,t),this._transformState={afterTransform:function(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,(n.writecb=null)!=e&&this.push(e),r(t),(t=this._readableState).reading=!1,(t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",o)}function o(){var n=this;"function"==typeof this._flush?this._flush(function(t,e){u(n,t,e)}):u(this,null,null)}function u(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}t.inherits=n(16),t.inherits(i,r),i.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},i.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},i.prototype._write=function(t,e,n){var r=this._transformState;r.writecb=n,r.writechunk=t,r.writeencoding=e,r.transforming||(e=this._readableState,(r.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark))},i.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},i.prototype._destroy=function(t,e){var n=this;r.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var r=n(37),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&function(t,e){for(var n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t,e,n){"use strict";var r=n(38);t.exports=function(t,e,n){return isNaN(t)?0<=e?n&&e?e-1:e:1:!1!==t&&r(t)}},function(t,e,n){"use strict";t.exports=n(520)()?Object.assign:n(521)},function(t,e,n){"use strict";function r(t,e){return e}var i,o,u,s,a,c=n(38);try{Object.defineProperty(r,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(t){}1===r.length?(i={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,t.exports=function(t,e){return e=c(e),t.length===e?t:(i.value=e,o(t,"length",i))}):(s=n(202),a=[],u=function(t){var e,n=0;if(a[t])return a[t];for(e=[];t--;)e.push("a"+(++n).toString(36));return new Function("fn","return function ("+e.join(", ")+") { return fn.apply(this, arguments); };")},t.exports=function(t,e){if(e=c(e),t.length===e)return t;e=u(e)(t);try{s(e,t)}catch(t){}return e})},function(t,e,n){"use strict";var i=n(48),o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;t.exports=function(e,n){var r,t=Object(i(n));if(e=Object(i(e)),s(t).forEach(function(t){try{o(e,t,u(n,t))}catch(t){r=t}}),"function"==typeof a&&a(t).forEach(function(t){try{o(e,t,u(n,t))}catch(t){r=t}}),void 0!==r)throw r;return e}},function(t,e,n){"use strict";t.exports=function(t){return null!=t}},function(t,e,n){"use strict";var r=n(543);t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";var r=n(31),s=n(94),a=Function.prototype.call;t.exports=function(t,i){var o={},u=arguments[2];return r(i),s(t,function(t,e,n,r){o[e]=a.call(i,u,t,e,n,r)}),o}},function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e){function n(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}t.exports=n,t.exports.default=n},function(t,e,n){var r=n(16),i=n(49),o=n(17).Buffer,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=new Array(64);function s(){this.init(),this._w=u,i.call(this,64,56)}r(s,i),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,u=0|this._d,s=0|this._e,a=0|this._f,c=0|this._g,f=0|this._h,l=0;l<16;++l)n[l]=t.readInt32BE(4*l);for(;l<64;++l)n[l]=0|(((e=n[l-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+n[l-7]+(((e=n[l-15])>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)+n[l-16];for(var p=0;p<64;++p)var h=f+((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(c^s&(a^c))+y[p]+n[p]|0,d=0|((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i|o&(r|i)),f=c,c=a,a=s,s=u+h|0,u=o,o=i,i=r,r=h+d|0;this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=f+this._h|0},s.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=s},function(t,e,n){var r=n(16),i=n(49),o=n(17).Buffer,P=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=new Array(160);function s(){this.init(),this._w=u,i.call(this,128,112)}function R(t,e,n){return n^t&(e^n)}function Q(t,e,n){return t&e|n&(t|e)}function B(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function F(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function G(t,e){return t>>>0<e>>>0?1:0}r(s,i),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,u=0|this._eh,s=0|this._fh,a=0|this._gh,c=0|this._hh,f=0|this._al,l=0|this._bl,p=0|this._cl,h=0|this._dl,d=0|this._el,y=0|this._fl,g=0|this._gl,w=0|this._hl,v=0;v<32;v+=2)e[v]=t.readInt32BE(4*v),e[v+1]=t.readInt32BE(4*v+4);for(;v<160;v+=2){var M=e[v-30],_=e[v-30+1],L=(M>>>1|_<<31)^(M>>>8|_<<24)^M>>>7,m=(_>>>1|M<<31)^(_>>>8|M<<24)^(_>>>7|M<<25),j=(M=e[v-4],_=e[v-4+1],(M>>>19|_<<13)^(_>>>29|M<<3)^M>>>6),x=(_>>>19|M<<13)^(M>>>29|_<<3)^(_>>>6|M<<26),b=e[v-14],N=e[v-14+1],_=e[v-32],M=e[v-32+1],S=m+N|0,D=(D=(D=L+b+G(S,m)|0)+j+G(S=S+x|0,x)|0)+_+G(S=S+M|0,M)|0;e[v]=D,e[v+1]=S}for(var I=0;I<160;I+=2){D=e[I];var S=e[I+1],A=Q(n,r,i),O=Q(f,l,p),T=B(n,f),C=B(f,n),E=F(u,d),z=F(d,u),k=P[I+1],U=R(u,s,a),Y=R(d,y,g),z=w+z|0,E=(E=(E=(E=c+E+G(z,w)|0)+U+G(z=z+Y|0,Y)|0)+P[I]+G(z=z+k|0,k)|0)+D+G(z=z+S|0,S)|0,O=C+O|0,C=T+A+G(O,C)|0,c=a,w=g,a=s,g=y,s=u,y=d,u=o+E+G(d=h+z|0,h)|0,o=i,h=p,i=r,p=l,r=n,l=f,n=E+C+G(f=z+O|0,z)|0}this._al=this._al+f|0,this._bl=this._bl+l|0,this._cl=this._cl+p|0,this._dl=this._dl+h|0,this._el=this._el+d|0,this._fl=this._fl+y|0,this._gl=this._gl+g|0,this._hl=this._hl+w|0,this._ah=this._ah+n+G(this._al,f)|0,this._bh=this._bh+r+G(this._bl,l)|0,this._ch=this._ch+i+G(this._cl,p)|0,this._dh=this._dh+o+G(this._dl,h)|0,this._eh=this._eh+u+G(this._el,d)|0,this._fh=this._fh+s+G(this._fl,y)|0,this._gh=this._gh+a+G(this._gl,g)|0,this._hh=this._hh+c+G(this._hl,w)|0},s.prototype._hash=function(){var r=o.allocUnsafe(64);function t(t,e,n){r.writeInt32BE(t,n),r.writeInt32BE(e,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),r},t.exports=s},function(t,e){t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDA3IDExNiI+DQogIDxkZWZzPg0KICAgIDxzdHlsZT4NCiAgICAgIC5jbHMtMSB7DQogICAgICAgIGNsaXAtcGF0aDogdXJsKCNjbGlwLVNXX1RNLWxvZ28tb24tZGFyayk7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMiB7DQogICAgICAgIGZpbGw6ICNmZmY7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMyB7DQogICAgICAgIGZpbGw6ICM4NWVhMmQ7DQogICAgICB9DQoNCiAgICAgIC5jbHMtNCB7DQogICAgICAgIGZpbGw6ICMxNzM2NDc7DQogICAgICB9DQogICAgPC9zdHlsZT4NCiAgICA8Y2xpcFBhdGggaWQ9ImNsaXAtU1dfVE0tbG9nby1vbi1kYXJrIj4NCiAgICAgIDxyZWN0IHdpZHRoPSI0MDciIGhlaWdodD0iMTE2Ii8+DQogICAgPC9jbGlwUGF0aD4NCiAgPC9kZWZzPg0KICA8ZyBpZD0iU1dfVE0tbG9nby1vbi1kYXJrIiBjbGFzcz0iY2xzLTEiPg0KICAgIDxnIGlkPSJTV19Jbi1Qcm9kdWN0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC4zMDEpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzYiIGRhdGEtbmFtZT0iUGF0aCAyOTM2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNTkuMTUsNzAuNjc0aC0uN1Y2Ni45OTJoLTEuMjZ2LS42aDMuMjE5di42SDM1OS4xNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzciIGRhdGEtbmFtZT0iUGF0aCAyOTM3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNjMuMjE3LDcwLjY3NCwzNjEuOTc1LDY3LjFoLS4wMjNxLjA1LjguMDUsMS40OTR2Mi4wODNoLS42MzZWNjYuMzkxaC45ODdsMS4xOSwzLjQwN2guMDE3bDEuMjI1LTMuNDA3aC45OXY0LjI4M0gzNjUuMVY2OC41NTZjMC0uMjEzLjAwNi0uNDkuMDE2LS44MzJzLjAyLS41NDkuMDI4LS42MjFoLS4wMjNsLTEuMjg2LDMuNTcxWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjkzOCIgZGF0YS1uYW1lPSJQYXRoIDI5MzgiIGNsYXNzPSJjbHMtMyIgZD0iTTUwLjMyOCw5Ny42NjlBNDcuNjQyLDQ3LjY0MiwwLDEsMSw5Ny45NzEsNTAuMDI3LDQ3LjY0Miw0Ny42NDIsMCwwLDEsNTAuMzI4LDk3LjY2OVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzkiIGRhdGEtbmFtZT0iUGF0aCAyOTM5IiBjbGFzcz0iY2xzLTMiIGQ9Ik01MC4zMjgsNC43NjlBNDUuMjU4LDQ1LjI1OCwwLDEsMSw1LjA3LDUwLjAyNyw0NS4yNTgsNDUuMjU4LDAsMCwxLDUwLjMyOCw0Ljc2OW0wLTQuNzY5YTUwLjAyNyw1MC4wMjcsMCwxLDAsNTAuMDI3LDUwLjAyN0E1MC4wMjcsNTAuMDI3LDAsMCwwLDUwLjMyOCwwWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MCIgZGF0YS1uYW1lPSJQYXRoIDI5NDAiIGNsYXNzPSJjbHMtNCIgZD0iTTMxLjgsMzMuODU0Yy0uMTU0LDEuNzEyLjA1OCwzLjQ4Mi0uMDU3LDUuMjEzYTQyLjY2NSw0Mi42NjUsMCwwLDEtLjY5Myw1LjE1Niw5LjUzLDkuNTMsMCwwLDEtNC4xLDUuODI5YzQuMDc5LDIuNjU0LDQuNTQsNi43NzEsNC44MSwxMC45NDYuMTM1LDIuMjUuMDc3LDQuNTIuMzA4LDYuNzUyLjE3MywxLjczMS44NDYsMi4xNzQsMi42MzYsMi4yMzEuNzMuMDIsMS40OCwwLDIuMzI3LDBWNzUuMzNjLTUuMjkuOS05LjY1Ny0uNi0xMC43MzQtNS4wNzlhMzAuNzYsMzAuNzYsMCwwLDEtLjY1NC01Yy0uMTE3LTEuNzg5LjA3Ni0zLjU3OC0uMDU4LTUuMzY3LS4zODYtNC45MDYtMS4wMi02LjU2LTUuNzEzLTYuNzkxdi02LjFBOS4xOTEsOS4xOTEsMCwwLDEsMjAuOSw0Ni44MmMyLjU3Ny0uMTM1LDMuNjc0LS45MjQsNC4yMzEtMy40NjNhMjkuMywyOS4zLDAsMCwwLC40ODEtNC4zMjksODIuMSw4Mi4xLDAsMCwxLC42LTguNDA2Yy42NzMtMy45ODIsMy4xMzYtNS45MDYsNy4yMzQtNi4xMzcsMS4xNTQtLjA1NywyLjMyNywwLDMuNjU1LDB2NS40NjRjLS41NTguMDM4LTEuMDM5LjExNS0xLjUzOS4xMTVDMzIuMjI2LDI5Ljk0OSwzMi4wNTIsMzEuMDg0LDMxLjgsMzMuODU0Wm02LjQwNiwxMi42NThoLS4wNzdhMy41MTUsMy41MTUsMCwxLDAtLjM0Niw3LjAyMWguMjMxYTMuNDYxLDMuNDYxLDAsMCwwLDMuNjU1LTMuMjUxVjUwLjA5YTMuNTIzLDMuNTIzLDAsMCwwLTMuNDYxLTMuNTc4Wm0xMi4wNjIsMGEzLjM3MywzLjM3MywwLDAsMC0zLjQ4MiwzLjI1MSwxLjc5LDEuNzksMCwwLDAsLjAyLjMyNywzLjMsMy4zLDAsMCwwLDMuNTc4LDMuNDQzLDMuMjYzLDMuMjYzLDAsMCwwLDMuNDQzLTMuNTU4LDMuMzA4LDMuMzA4LDAsMCwwLTMuNTU3LTMuNDYzWm0xMi4zNTEsMGEzLjU5MiwzLjU5MiwwLDAsMC0zLjY1NSwzLjQ4MkEzLjUyOSwzLjUyOSwwLDAsMCw2Mi41LDUzLjUzM2guMDM5YzEuNzY5LjMwOSwzLjU1OS0xLjQsMy42NzQtMy40NjJhMy41NzEsMy41NzEsMCwwLDAtMy42LTMuNTU5Wm0xNi45NDguMjg4Yy0yLjIzMi0uMS0zLjM0OC0uODQ2LTMuOS0yLjk2MmEyMS40NDcsMjEuNDQ3LDAsMCwxLS42MzUtNC4xMzZjLS4xNTQtMi41NzgtLjEzNS01LjE3NS0uMzA4LTcuNzUzLS40LTYuMTE3LTQuODI4LTguMjUyLTExLjI1NC03LjE5NXY1LjMxYzEuMDE5LDAsMS44MDgsMCwyLjYuMDE5LDEuMzY2LjAxOSwyLjQuNTM5LDIuNTM5LDIuMDU5LjEzNSwxLjM4NS4xMzUsMi43ODkuMjcsNC4xOTMuMjY5LDIuNzkuNDIyLDUuNjE4LjksOC4zNjlBOC43MTUsOC43MTUsMCwwLDAsNzMuNyw1MC4wNTJjLTMuNCwyLjI4OS00LjQwNiw1LjU1OS00LjU3OCw5LjIzNC0uMSwyLjUyLS4xNTQsNS4wNTktLjI4OSw3LjYtLjExNSwyLjMwOC0uOTIzLDMuMDU4LTMuMjUxLDMuMTE2LS42NTQuMDE5LTEuMjg5LjA3Ny0yLjAxOS4xMTV2NS40NDVjMS4zNjUsMCwyLjYxNi4wNzcsMy44NjYsMCwzLjg4Ni0uMjMxLDYuMjMzLTIuMTE3LDctNS44ODdBNDkuMDc5LDQ5LjA3OSwwLDAsMCw3NSw2My40Yy4xMzUtMS45MjMuMTE2LTMuODY2LjMwOC01Ljc3MS4yODktMi45ODIsMS42NTUtNC4yMTMsNC42MzYtNC40YTQuMDM3LDQuMDM3LDAsMCwwLC44MjgtLjE5MnYtNi4xYy0uNS0uMDU4LS44NDMtLjExNS0xLjIwOC0uMTM1WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MSIgZGF0YS1uYW1lPSJQYXRoIDI5NDEiIGNsYXNzPSJjbHMtMiIgZD0iTTE1Mi4yNzMsNTguMTIyYTExLjIyOCwxMS4yMjgsMCwwLDEtNC4zODQsOS40MjRxLTQuMzgzLDMuMzgyLTExLjksMy4zODItOC4xNCwwLTEyLjUyNC0yLjFWNjMuN2EzMi45LDMyLjksMCwwLDAsNi4xMzcsMS44NzksMzIuMywzMi4zLDAsMCwwLDYuNTc1LjY4OXE1LjMyMiwwLDguMDE1LTIuMDJhNi42MjYsNi42MjYsMCwwLDAsMi42OTItNS42Miw3LjIyMiw3LjIyMiwwLDAsMC0uOTU0LTMuOSw4Ljg4NSw4Ljg4NSwwLDAsMC0zLjE5NC0yLjgsNDQuNjM0LDQ0LjYzNCwwLDAsMC02LjgxLTIuOTExcS02LjM4Ny0yLjI4Ni05LjEyNi01LjQxN2ExMS45NTUsMTEuOTU1LDAsMCwxLTIuNzQtOC4xNzJBMTAuMTY0LDEwLjE2NCwwLDAsMSwxMjguMDM5LDI3cTMuOTc3LTMuMTMxLDEwLjUyLTMuMTMxYTMxLDMxLDAsMCwxLDEyLjU1NSwyLjVMMTQ5LjQ1NSwzMWEyOC4zODIsMjguMzgyLDAsMCwwLTExLjAyMS0yLjM4LDEwLjY2OCwxMC42NjgsMCwwLDAtNi42MDYsMS44MTYsNS45ODQsNS45ODQsMCwwLDAtMi4zOCw1LjA0MSw3LjcyMiw3LjcyMiwwLDAsMCwuODc3LDMuOSw4LjI0Miw4LjI0MiwwLDAsMCwyLjk1OSwyLjc4NiwzNi43LDM2LjcsMCwwLDAsNi4zNzEsMi44cTcuMiwyLjU2Niw5LjkxLDUuNTFBMTAuODQsMTAuODQsMCwwLDEsMTUyLjI3Myw1OC4xMjJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQyIiBkYXRhLW5hbWU9IlBhdGggMjk0MiIgY2xhc3M9ImNscy0yIiBkPSJNMTg1LjI4OCw3MC4zLDE3OSw1MC4xN3EtLjU5NC0xLjg0OC0yLjIyMi04LjM5MWgtLjI1MXEtMS4yNTIsNS40NzktMi4xOTIsOC40NTNMMTY3Ljg0OSw3MC4zaC02LjAxMWwtOS4zNjEtMzQuMzE1aDUuNDQ3cTMuMzE4LDEyLjkzMSw1LjA1NywxOS42OTNhODAuMTEyLDgwLjExMiwwLDAsMSwxLjk4OCw5LjExMWguMjVxLjM0NS0xLjc4NSwxLjExMi00LjYxOHQxLjMzLTQuNDkzbDYuMjk0LTE5LjY5M2g1LjYzNWw2LjEzNywxOS42OTNhNjYuMzY5LDY2LjM2OSwwLDAsMSwyLjM3OSw5LjA0OGguMjUxYTMzLjE2MywzMy4xNjMsMCwwLDEsLjY3My0zLjQ3NXEuNTQ4LTIuMzQ3LDYuNTI4LTI1LjI2Nmg1LjM4NUwxOTEuNDU2LDcwLjNaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQzIiBkYXRhLW5hbWU9IlBhdGggMjk0MyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1LjExNSw3MC4zbC0xLjAzMy00Ljg4NWgtLjI1YTE0LjQ0NiwxNC40NDYsMCwwLDEtNS4xMTksNC4zNjgsMTUuNjA4LDE1LjYwOCwwLDAsMS02LjM3MiwxLjE0M3EtNS4xLDAtOC0yLjYzdC0yLjktNy40ODNxMC0xMC40LDE2LjYyNi0xMC45bDUuODIzLS4xODhWNDcuNnEwLTQuMDM4LTEuNzM4LTUuOTY0VDIxNi42LDM5LjcxM2EyMi42MzMsMjIuNjMzLDAsMCwwLTkuNzA2LDIuNjNsLTEuNi0zLjk3N2EyNC40MzcsMjQuNDM3LDAsMCwxLDUuNTU3LTIuMTYsMjQuMDU2LDI0LjA1NiwwLDAsMSw2LjA1OC0uNzgzcTYuMTM2LDAsOS4xLDIuNzI0dDIuOTU5LDguNzM1VjcwLjNabS0xMS43NDEtMy42NjNBMTAuNTQ5LDEwLjU0OSwwLDAsMCwyMjEsNjMuOTc3YTkuODQ1LDkuODQ1LDAsMCwwLDIuNzcxLTcuNDUxdi0zLjFsLTUuMi4yMTlxLTYuMi4yMTktOC45MzksMS45MjZhNS44LDUuOCwwLDAsMC0yLjc0LDUuMzA2LDUuMzU0LDUuMzU0LDAsMCwwLDEuNzA3LDQuMjksNy4wODEsNy4wODEsMCwwLDAsNC43NzUsMS40NzJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ0IiBkYXRhLW5hbWU9IlBhdGggMjk0NCIgY2xhc3M9ImNscy0yIiBkPSJNMjY0LjYsMzUuOTg3djMuMjg3bC02LjM1Ni43NTJhMTEuMTYsMTEuMTYsMCwwLDEsMi4yNTUsNi44NTYsMTAuMTQ4LDEwLjE0OCwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NiwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVRMjQxLjQsNTkuNDM4LDI0MS40LDYyLjFhMi4yNDIsMi4yNDIsMCwwLDAsMS4xNTksMi4wODIsOC40NTYsOC40NTYsMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTczLDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NzIsMi45ODktMTMuMzM4LDIuOTktNi43MzIsMC0xMC4zNzktMi41YTguMDg3LDguMDg3LDAsMCwxLTMuNjQ3LTcuMDc2LDcuOTQ2LDcuOTQ2LDAsMCwxLDItNS40MTcsMTAuMjExLDEwLjIxMSwwLDAsMSw1LjYzNi0zLjEsNS40MjksNS40MjksMCwwLDEtMi4yMDctMS44NDcsNC44OSw0Ljg5LDAsMCwxLS44OTMtMi45MTIsNS41Myw1LjUzLDAsMCwxLDEtMy4yODgsMTAuNTI5LDEwLjUyOSwwLDAsMSwzLjE2Mi0yLjcyMyw5LjI3NSw5LjI3NSwwLDAsMS00LjMzNi0zLjcyNiwxMC45NDUsMTAuOTQ1LDAsMCwxLTEuNjc1LTYuMDEycTAtNS42MzQsMy4zODItOC42ODh0OS41OC0zLjA1MmExNy40MzksMTcuNDM5LDAsMCwxLDQuODUzLjYyNlpNMjM3LjIzMyw3Ni4wNjJhNC42Niw0LjY2LDAsMCwwLDIuMzQ4LDQuMjI3LDEyLjk3MywxMi45NzMsMCwwLDAsNi43MzIsMS40NHE2LjU0MywwLDkuNjktMS45NTZhNS45OTIsNS45OTIsMCwwLDAsMy4xNDctNS4zMDdxMC0yLjc4Ny0xLjcyMy0zLjg2N3QtNi40ODEtMS4wOGgtNi4yM2E4LjIwNSw4LjIwNSwwLDAsMC01LjUxLDEuNjksNi4wNDMsNi4wNDMsMCwwLDAtMS45NzMsNC44NTNabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMyw4LjEyMywwLDAsMCw1LjY2NywxLjg0N3E3LjYwOCwwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI4LDcuNjI4LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NiwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDUiIGRhdGEtbmFtZT0iUGF0aCAyOTQ1IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yOTkuMTM2LDM1Ljk4N3YzLjI4N2wtNi4zNTYuNzUyYTExLjE2OCwxMS4xNjgsMCwwLDEsMi4yNTQsNi44NTYsMTAuMTQ1LDEwLjE0NSwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NSwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVxLTMuMzIsMS43NTQtMy4zMTksNC40MTVhMi4yNDMsMi4yNDMsMCwwLDAsMS4xNTgsMi4wODIsOC40NTksOC40NTksMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTc0LDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NywyLjk4OS0xMy4zMzcsMi45OS02LjczMiwwLTEwLjM3OS0yLjVhOC4wODgsOC4wODgsMCwwLDEtMy42NDgtNy4wNzYsNy45NDcsNy45NDcsMCwwLDEsMi01LjQxNywxMC4yMDcsMTAuMjA3LDAsMCwxLDUuNjM2LTMuMSw1LjQzMiw1LjQzMiwwLDAsMS0yLjIwOC0xLjg0Nyw0Ljg4OSw0Ljg4OSwwLDAsMS0uODkyLTIuOTEyLDUuNTMsNS41MywwLDAsMSwxLTMuMjg4LDEwLjUyOSwxMC41MjksMCwwLDEsMy4xNjItMi43MjMsOS4yNzEsOS4yNzEsMCwwLDEtNC4zMzYtMy43MjYsMTAuOTQ1LDEwLjk0NSwwLDAsMS0xLjY3NS02LjAxMnEwLTUuNjM0LDMuMzgxLTguNjg4dDkuNTgxLTMuMDUyYTE3LjQ0NCwxNy40NDQsMCwwLDEsNC44NTMuNjI2Wk0yNzEuNzcyLDc2LjA2MmE0LjY1OCw0LjY1OCwwLDAsMCwyLjM0OCw0LjIyNywxMi45NjksMTIuOTY5LDAsMCwwLDYuNzMxLDEuNDRxNi41NDQsMCw5LjY5MS0xLjk1NmE1Ljk5Myw1Ljk5MywwLDAsMCwzLjE0Ni01LjMwN3EwLTIuNzg3LTEuNzIyLTMuODY3dC02LjQ4MS0xLjA4aC02LjIzYTguMjA4LDguMjA4LDAsMCwwLTUuNTExLDEuNjlBNi4wNDIsNi4wNDIsMCwwLDAsMjcxLjc3Miw3Ni4wNjJabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMSw4LjEyMSwwLDAsMCw1LjY2NywxLjg0N3E3LjYwNywwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI5LDcuNjI5LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NSwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDYiIGRhdGEtbmFtZT0iUGF0aCAyOTQ2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMTYuNzc4LDcwLjkyOHEtNy42MDgsMC0xMi4wMDctNC42MzR0LTQuNC0xMi44NjhxMC04LjMsNC4wODYtMTMuMTgxYTEzLjU3MywxMy41NzMsMCwwLDEsMTAuOTc0LTQuODg0QTEyLjkzOCwxMi45MzgsMCwwLDEsMzI1LjYzOCwzOS42cTMuNzYyLDQuMjQ3LDMuNzYyLDExLjJ2My4yODdIMzA1Ljc1N3EuMTU2LDYuMDQ0LDMuMDUzLDkuMTc0dDguMTU2LDMuMTMxYTI3LjYzMywyNy42MzMsMCwwLDAsMTAuOTU4LTIuMzE3djQuNjM0YTI3LjUsMjcuNSwwLDAsMS01LjIxMywxLjcwNiwyOS4yNTEsMjkuMjUxLDAsMCwxLTUuOTMzLjUxM1ptLTEuNDA5LTMxLjIxNWE4LjQ4OSw4LjQ4OSwwLDAsMC02LjU5MSwyLjY5MiwxMi40MTYsMTIuNDE2LDAsMCwwLTIuOSw3LjQ1MmgxNy45NHEwLTQuOTE2LTIuMTkxLTcuNTNhNy43MTQsNy43MTQsMCwwLDAtNi4yNTgtMi42MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ3IiBkYXRhLW5hbWU9IlBhdGggMjk0NyIgY2xhc3M9ImNscy0yIiBkPSJNMzUwLjksMzUuMzYxYTIwLjM4LDIwLjM4LDAsMCwxLDQuMS4zNzVsLS43MjEsNC44MjJhMTcuNzEyLDE3LjcxMiwwLDAsMC0zLjc1Ny0uNDdBOS4xNDIsOS4xNDIsMCwwLDAsMzQzLjQsNDMuNDdhMTIuMzI3LDEyLjMyNywwLDAsMC0yLjk1OSw4LjQyMlY3MC4zaC01LjJWMzUuOTg3aDQuMjlsLjYsNi4zNTZoLjI1YTE1LjA3MiwxNS4wNzIsMCwwLDEsNC42LTUuMTY2LDEwLjM1NiwxMC4zNTYsMCwwLDEsNS45MTktMS44MTZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ4IiBkYXRhLW5hbWU9IlBhdGggMjk0OCIgY2xhc3M9ImNscy0yIiBkPSJNMjU1Ljg1Nyw5Ni42MzhzLTMuNDMtLjM5MS00Ljg1LS4zOTFjLTIuMDU4LDAtMy4xMTEuNzM1LTMuMTExLDIuMTgsMCwxLjU2OC44ODIsMS45MzUsMy43NDgsMi43MTksMy41MjcuOTgsNC44LDEuOTExLDQuOCw0Ljc3NywwLDMuNjc1LTIuMyw1LjI2Ny01LjYxLDUuMjY3YTM1LjY4NywzNS42ODcsMCwwLDEtNS40ODctLjY2MmwuMjctMi4xOHMzLjMwNi40NDEsNS4wNDYuNDQxYzIuMDgyLDAsMy4wMzctLjkzMSwzLjAzNy0yLjcsMC0xLjQyMS0uNzU5LTEuOTEtMy4zMzEtMi41MjMtMy42MjYtLjkzLTUuMTkzLTIuMDMzLTUuMTkzLTQuOTQ4LDAtMy4zODEsMi4yMjktNC43NzYsNS41ODUtNC43NzZhMzcuMiwzNy4yLDAsMCwxLDUuMzE1LjU4N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDkiIGRhdGEtbmFtZT0iUGF0aCAyOTQ5IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yNjIuOTY3LDk0LjE0SDI2Ny43bDMuNzQ4LDEzLjEwNkwyNzUuMiw5NC4xNGg0Ljc1MnYxNi43OEgyNzcuMlY5Ni40MmgtLjE0NWwtNC4xOTEsMTMuODE2aC0yLjg0MkwyNjUuODMxLDk2LjQyaC0uMTQ1djE0LjVoLTIuNzE5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1MCIgZGF0YS1uYW1lPSJQYXRoIDI5NTAiIGNsYXNzPSJjbHMtMiIgZD0iTTMyMi4wNTcsOTQuMTRIMzM0LjN2Mi40MjVoLTQuNzI4VjExMC45MmgtMi43NDNWOTYuNTY1aC00Ljc3N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTEiIGRhdGEtbmFtZT0iUGF0aCAyOTUxIiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNDYuMTM3LDk0LjE0YzMuMzMyLDAsNS4xMiwxLjI0OSw1LjEyLDQuMzYxLDAsMi4wMzMtLjYzNywzLjAzNy0xLjk4NCwzLjc3MiwxLjQ0NS41NjMsMi40LDEuNTkyLDIuNCwzLjksMCwzLjQzLTIuMDgxLDQuNzUyLTUuMzM5LDQuNzUyaC02LjU2NlY5NC4xNFptLTMuNjUsMi4zNTJ2NC44aDMuNmMxLjY2NiwwLDIuNC0uODMyLDIuNC0yLjQ3NCwwLTEuNjE3LS44MzMtMi4zMjctMi41LTIuMzI3Wm0wLDcuMXY0Ljk3M2gzLjdjMS42ODksMCwyLjY5NC0uNTM5LDIuNjk0LTIuNTQ4LDAtMS45MTEtMS40MjEtMi40MjUtMi43NDQtMi40MjVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUyIiBkYXRhLW5hbWU9IlBhdGggMjk1MiIgY2xhc3M9ImNscy0yIiBkPSJNMzU4LjQxNCw5NC4xNEgzNjl2Mi4zNzdoLTcuODY0djQuNzUxaDYuMzk0VjEwMy42aC02LjM5NHY0LjkyNEgzNjl2Mi40SDM1OC40MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUzIiBkYXRhLW5hbWU9IlBhdGggMjk1MyIgY2xhc3M9ImNscy0yIiBkPSJNMzc4Ljc0Nyw5NC4xNGg1LjQxNGw0LjE2NCwxNi43OGgtMi43NDRMMzg0LjM0MiwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDhsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTQiIGRhdGEtbmFtZT0iUGF0aCAyOTU0IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zOTcuMSwxMDUuOTQ3djQuOTczaC0yLjcxOVY5NC4xNGg2LjM3YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU2LDQuNTE5LTIuNzQ0LDUuMzUybDIuNzY5LDUuNTg1SDQwMy40N2wtMi40MjYtNC45NzNabTMuNjUxLTkuNDU1SDM5Ny4xdjcuMWgzLjdjMi4wNTcsMCwyLjg0MS0xLjg1LDIuODQxLTMuNTg5LDAtMS45LS45MzQtMy41MTEtMi44OTQtMy41MTFaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTU1IiBkYXRhLW5hbWU9IlBhdGggMjk1NSIgY2xhc3M9ImNscy0yIiBkPSJNMjkwLjAxMyw5NC4xNGg1LjQxM2w0LjE2NCwxNi43OGgtMi43NDNMMjk1LjYwOCwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDdsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTYiIGRhdGEtbmFtZT0iUGF0aCAyOTU2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMDguMzYyLDEwNS45NDd2NC45NzNoLTIuNzE5Vjk0LjE0aDYuMzY5YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU1LDQuNTE5LTIuNzQzLDUuMzUybDIuNzY4LDUuNTg1aC0yLjk4OWwtMi40MjUtNC45NzNabTMuNjUtOS40NTVoLTMuNjV2Ny4xaDMuN2MyLjA1OCwwLDIuODQxLTEuODUsMi44NDEtMy41ODlDMzE0LjksOTguMSwzMTMuOTcyLDk2LjQ5MiwzMTIuMDEyLDk2LjQ5MloiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTciIGRhdGEtbmFtZT0iUGF0aCAyOTU3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0xMzAuNjA2LDEwNy42NDNhMy4wMiwzLjAyLDAsMCwxLTEuMTgsMi41MzcsNS4xMTMsNS4xMTMsMCwwLDEtMy4yLjkxLDguMDMsOC4wMywwLDAsMS0zLjM3MS0uNTY0di0xLjM4M2E4Ljc5Myw4Ljc5MywwLDAsMCwxLjY1Mi41MDYsOC42NzIsOC42NzIsMCwwLDAsMS43Ny4xODYsMy41NjUsMy41NjUsMCwwLDAsMi4xNTctLjU0NCwxLjc4MywxLjc4MywwLDAsMCwuNzI1LTEuNTEyLDEuOTQ3LDEuOTQ3LDAsMCwwLS4yNTctMS4wNSwyLjM5MywyLjM5MywwLDAsMC0uODYtLjc1NCwxMi4xNzEsMTIuMTcxLDAsMCwwLTEuODMzLS43ODQsNS44NDIsNS44NDIsMCwwLDEtMi40NTYtMS40NTgsMy4yMTMsMy4yMTMsMCwwLDEtLjczOC0yLjIsMi43MzYsMi43MzYsMCwwLDEsMS4wNzEtMi4yNjcsNC40NDQsNC40NDQsMCwwLDEsMi44MzEtLjg0Myw4LjM0MSw4LjM0MSwwLDAsMSwzLjM4LjY3NWwtLjQ0NywxLjI0N2E3LjYzOSw3LjYzOSwwLDAsMC0yLjk2Ni0uNjQxLDIuODc4LDIuODc4LDAsMCwwLTEuNzc5LjQ4OSwxLjYxMiwxLjYxMiwwLDAsMC0uNjQsMS4zNTcsMi4wODEsMi4wODEsMCwwLDAsLjIzNiwxLjA0OSwyLjIzMSwyLjIzMSwwLDAsMCwuOC43NSw5Ljg3OCw5Ljg3OCwwLDAsMCwxLjcxNS43NTQsNi44LDYuOCwwLDAsMSwyLjY2NywxLjQ4MywyLjkxOSwyLjkxOSwwLDAsMSwuNzIzLDIuMDU3WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OCIgZGF0YS1uYW1lPSJQYXRoIDI5NTgiIGNsYXNzPSJjbHMtMiIgZD0iTTEzNC40NDcsMTAxLjY4NnY1Ljk5MWEyLjQxMSwyLjQxMSwwLDAsMCwuNTE1LDEuNjg2LDIuMDksMi4wOSwwLDAsMCwxLjYwOS41NTYsMi42MjksMi42MjksMCwwLDAsMi4xMi0uNzkyLDQsNCwwLDAsMCwuNjctMi41ODd2LTQuODU0aDEuNHY5LjIzNkgxMzkuNmwtLjItMS4yMzloLS4wNzVhMi43OTMsMi43OTMsMCwwLDEtMS4xOTMsMS4wNDUsNCw0LDAsMCwxLTEuNzQuMzYyLDMuNTI5LDMuNTI5LDAsMCwxLTIuNTI0LS44LDMuNDA5LDMuNDA5LDAsMCwxLS44MzktMi41NjJ2LTYuMDQyWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OSIgZGF0YS1uYW1lPSJQYXRoIDI5NTkiIGNsYXNzPSJjbHMtMiIgZD0iTTE0OC4yMDYsMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxNS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MCIgZGF0YS1uYW1lPSJQYXRoIDI5NjAiIGNsYXNzPSJjbHMtMiIgZD0iTTE1OS4wMzksMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxMS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MSIgZGF0YS1uYW1lPSJQYXRoIDI5NjEiIGNsYXNzPSJjbHMtMiIgZD0iTTE3My42MTIsMTA2LjNhNS4wOTMsNS4wOTMsMCwwLDEtMS4xMzcsMy41MjcsNC4wMDUsNC4wMDUsMCwwLDEtMy4xNDMsMS4yNjgsNC4xNzIsNC4xNzIsMCwwLDEtMi4yLS41ODEsMy44NCwzLjg0LDAsMCwxLTEuNDgzLTEuNjY5LDUuOCw1LjgsMCwwLDEtLjUyMi0yLjU0NSw1LjA4Nyw1LjA4NywwLDAsMSwxLjEyOS0zLjUxOCwzLjk5MSwzLjk5MSwwLDAsMSwzLjEzNS0xLjI2LDMuOTA3LDMuOTA3LDAsMCwxLDMuMDgsMS4yOSw1LjA3MSw1LjA3MSwwLDAsMSwxLjE0MSwzLjQ4OFptLTcuMDM2LDBhNC4zODQsNC4zODQsMCwwLDAsLjcwOCwyLjcsMi44MDksMi44MDksMCwwLDAsNC4xNjcsMCw0LjM2NSw0LjM2NSwwLDAsMCwuNzEyLTIuNyw0LjI5Myw0LjI5MywwLDAsMC0uNzEyLTIuNjc1LDIuNSwyLjUsMCwwLDAtMi4xLS45MTUsMi40NjEsMi40NjEsMCwwLDAtMi4wNzIuOSw0LjMzNCw0LjMzNCwwLDAsMC0uNywyLjY5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MiIgZGF0YS1uYW1lPSJQYXRoIDI5NjIiIGNsYXNzPSJjbHMtMiIgZD0iTTE4MC41MjUsMTAxLjUxN2E1LjUwNiw1LjUwNiwwLDAsMSwxLjEuMWwtLjE5NCwxLjNhNC43ODYsNC43ODYsMCwwLDAtMS4wMTEtLjEyNywyLjQ2LDIuNDYsMCwwLDAtMS45MTcuOTExLDMuMzE4LDMuMzE4LDAsMCwwLS44LDIuMjY3djQuOTU1aC0xLjR2LTkuMjM2aDEuMTU0bC4xNiwxLjcxaC4wNjhhNC4wNTQsNC4wNTQsMCwwLDEsMS4yMzgtMS4zOSwyLjc4NywyLjc4NywwLDAsMSwxLjYtLjQ5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MyIgZGF0YS1uYW1lPSJQYXRoIDI5NjMiIGNsYXNzPSJjbHMtMiIgZD0iTTE4Ny4zNjMsMTA5LjkzNmE0LjUwNiw0LjUwNiwwLDAsMCwuNzE2LS4wNTUsNC4zODcsNC4zODcsMCwwLDAsLjU0OC0uMTE0djEuMDdhMi41LDIuNSwwLDAsMS0uNjcuMTgxLDUsNSwwLDAsMS0uOC4wNzJxLTIuNjgsMC0yLjY4LTIuODIzdi01LjQ5NGgtMS4zMjNWMTAyLjFsMS4zMjMtLjU4Mi41OS0xLjk3MmguODA5djIuMTQxaDIuNjh2MS4wODdoLTIuNjh2NS40MzVhMS44NjksMS44NjksMCwwLDAsLjQsMS4yODFBMS4zNzcsMS4zNzcsMCwwLDAsMTg3LjM2MywxMDkuOTM2WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2NCIgZGF0YS1uYW1lPSJQYXRoIDI5NjQiIGNsYXNzPSJjbHMtMiIgZD0iTTE5NC41MzgsMTExLjA5YTQuMjM5LDQuMjM5LDAsMCwxLTMuMjMxLTEuMjQ3LDQuODI0LDQuODI0LDAsMCwxLTEuMTg0LTMuNDYzLDUuMzU1LDUuMzU1LDAsMCwxLDEuMS0zLjU0OCwzLjY1MiwzLjY1MiwwLDAsMSwyLjk1NC0xLjMxNSwzLjQ4NCwzLjQ4NCwwLDAsMSwyLjc0NywxLjE0Miw0LjM3OCw0LjM3OCwwLDAsMSwxLjAxMSwzLjAxM3YuODg1aC02LjM2MmEzLjY2LDMuNjYsMCwwLDAsLjgyMiwyLjQ2OSwyLjg0MywyLjg0MywwLDAsMCwyLjIuODQzLDcuNDMxLDcuNDMxLDAsMCwwLDIuOTQ5LS42MjR2MS4yNDdhNy4zNzcsNy4zNzcsMCwwLDEtMS40LjQ1OSw3Ljg2Myw3Ljg2MywwLDAsMS0xLjYuMTM5Wm0tLjM3OS04LjRhMi4yODYsMi4yODYsMCwwLDAtMS43NzQuNzI1LDMuMzM3LDMuMzM3LDAsMCwwLS43NzksMi4wMDZoNC44MjhhMy4wNzIsMy4wNzIsMCwwLDAtLjU5LTIuMDI3LDIuMDc2LDIuMDc2LDAsMCwwLTEuNjg1LS43MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY1IiBkYXRhLW5hbWU9IlBhdGggMjk2NSIgY2xhc3M9ImNscy0yIiBkPSJNMjA2Ljk1MSwxMDkuNjgzaC0uMDc2YTMuMjg3LDMuMjg3LDAsMCwxLTIuOSwxLjQwNywzLjQyNywzLjQyNywwLDAsMS0yLjgxOS0xLjIzOSw1LjQ1Miw1LjQ1MiwwLDAsMS0xLjAwNi0zLjUyMiw1LjU0Miw1LjU0MiwwLDAsMSwxLjAxMS0zLjU0OCwzLjQsMy40LDAsMCwxLDIuODE0LTEuMjY0LDMuMzYxLDMuMzYxLDAsMCwxLDIuODgzLDEuMzY1aC4xMDlsLS4wNTktLjY2NS0uMDM0LS42NDlWOTcuODA5aDEuNHYxMy4xMTNoLTEuMTM4Wm0tMi44LjIzNmEyLjU1MSwyLjU1MSwwLDAsMCwyLjA3OC0uNzc5LDMuOTQ3LDMuOTQ3LDAsMCwwLC42NDQtMi41MTZ2LS4zYTQuNjM4LDQuNjM4LDAsMCwwLS42NTMtMi44LDIuNDgxLDIuNDgxLDAsMCwwLTIuMDg2LS44MzksMi4xNCwyLjE0LDAsMCwwLTEuODgzLjk1Nyw0Ljc2LDQuNzYsMCwwLDAtLjY1MywyLjcsNC41NTQsNC41NTQsMCwwLDAsLjY0OSwyLjY3MSwyLjE5NCwyLjE5NCwwLDAsMCwxLjkwNi45MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY2IiBkYXRhLW5hbWU9IlBhdGggMjk2NiIgY2xhc3M9ImNscy0yIiBkPSJNMjIwLjcxMiwxMDEuNTM0YTMuNDM1LDMuNDM1LDAsMCwxLDIuODI3LDEuMjQzLDYuNjUzLDYuNjUzLDAsMCwxLS4wMDksNy4wNTMsMy40MTcsMy40MTcsMCwwLDEtMi44MTgsMS4yNiw0LDQsMCwwLDEtMS42NDgtLjMzMywzLjA5NCwzLjA5NCwwLDAsMS0xLjI1MS0xLjAyM2gtLjFsLS4yOTUsMS4xODhoLTFWOTcuODA5aDEuNFYxMDFxMCwxLjA2OS0uMDY4LDEuOTIxaC4wNjhhMy4zMjIsMy4zMjIsMCwwLDEsMi44OTQtMS4zODdabS0uMiwxLjE3MWEyLjQ0LDIuNDQsMCwwLDAtMi4wNjQuODIyLDYuMzM4LDYuMzM4LDAsMCwwLC4wMTcsNS41NTMsMi40NjQsMi40NjQsMCwwLDAsMi4wODEuODM5LDIuMTU4LDIuMTU4LDAsMCwwLDEuOTIyLS45NCw0LjgyOCw0LjgyOCwwLDAsMCwuNjMyLTIuNyw0LjY0NSw0LjY0NSwwLDAsMC0uNjMyLTIuNjg5LDIuMjQyLDIuMjQyLDAsMCwwLTEuOTU5LS44ODVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY3IiBkYXRhLW5hbWU9IlBhdGggMjk2NyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1Ljc1OCwxMDEuNjg2aDEuNWwyLjAyMyw1LjI2N2EyMC4xODgsMjAuMTg4LDAsMCwxLC44MjYsMi42aC4wNjdxLjEwOS0uNDMxLjQ1OS0xLjQ3MXQyLjI4OC02LjRoMS41TDIzMC40NTIsMTEyLjJhNS4yNTMsNS4yNTMsMCwwLDEtMS4zNzgsMi4yMTIsMi45MzIsMi45MzIsMCwwLDEtMS45MzQuNjUzLDUuNjU5LDUuNjU5LDAsMCwxLTEuMjY0LS4xNDNWMTEzLjhhNC45LDQuOSwwLDAsMCwxLjAzNy4xLDIuMTM2LDIuMTM2LDAsMCwwLDIuMDU2LTEuNjE4bC41MTQtMS4zMTRaIi8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg=="},function(t,e,n){var r=n(326),i=n(327),o=n(124),u=n(328);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||u()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){t.exports=n(340)},function(t,e,n){t.exports=n(354)},function(t,e,n){t.exports=n(385)},function(t,e,n){t.exports=n(389)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=void 0;var r=/^([^\w]*)(javascript|data|vbscript)/im,i=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,o=/^([^:]+):/gm,u=[".","/"];e.sanitizeUrl=function(t){if(!t)return"about:blank";var e=t.replace(i,"").trim();if(-1<u.indexOf(e[0]))return e;t=e.match(o);if(!t)return e;t=t[0];return r.test(t)?"about:blank":e}},function(t,e,n){var r=n(395),n=n(406)(function(t,e,n){return e=e.toLowerCase(),t+(n?r(e):e)});t.exports=n},function(t,e,n){n=n(436)(n(485));t.exports=n},function(t,e,n){!function(p){var f=n(499),h=n(500).Stream;function d(t,e,n){n=n||0;var r,i=(i=e,new Array(n||0).join(i||"")),o=t;if("object"==typeof t&&(o=t[r=Object.keys(t)[0]])&&o._elem)return o._elem.name=r,o._elem.icount=n,o._elem.indent=e,o._elem.indents=i,(o._elem.interrupt=o)._elem;var u,s=[],a=[];function c(n){Object.keys(n).forEach(function(t){var e;s.push((e=n[t],t+'="'+f(e)+'"'))})}switch(typeof o){case"object":if(null===o)break;o._attr&&c(o._attr),o._cdata&&a.push(("<![CDATA["+o._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),o.forEach&&(u=!1,a.push(""),o.forEach(function(t){"object"==typeof t?"_attr"==Object.keys(t)[0]?c(t._attr):a.push(d(t,e,n+1)):(a.pop(),u=!0,a.push(f(t)))}),u||a.push(""));break;default:a.push(f(o))}return{name:r,interrupt:!1,attributes:s,content:a,icount:n,indents:i,indent:e}}function y(e,n,r){if("object"!=typeof n)return e(!1,n);var i=n.interrupt?1:n.content.length;function o(){for(;n.content.length;){var t=n.content.shift();if(void 0!==t){if(u(t))return;y(e,t)}}e(!1,(1<i?n.indents:"")+(n.name?"</"+n.name+">":"")+(n.indent&&!r?"\n":"")),r&&r()}function u(t){return t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),1)}if(e(!1,n.indents+(n.name?"<"+n.name:"")+(n.attributes.length?" "+n.attributes.join(" "):"")+(i?n.name?">":"":n.name?"/>":"")+(n.indent&&1<i?"\n":"")),!i)return e(!1,n.indent?"\n":"");u(n)||o()}t.exports=function(r,t){var e,i=(t="object"!=typeof t?{indent:t}:t).stream?new h:null,o="",u=!1,n=t.indent?!0===t.indent?" ":t.indent:"",s=!0;function a(t){s?p.nextTick(t):t()}function c(t,e){var n;void 0!==e&&(o+=e),t&&!u&&(i=i||new h,u=!0),t&&u&&(n=o,a(function(){i.emit("data",n)}),o="")}function f(t,e){y(c,d(t,n,n?1:0),e)}function l(){var t;i&&(t=o,a(function(){i.emit("data",t),i.emit("end"),i.readable=!1,i.emit("close")}))}return a(function(){s=!1}),t.declaration&&(t={version:"1.0",encoding:(e=t.declaration).encoding||"UTF-8"},e.standalone&&(t.standalone=e.standalone),f({"?xml":{_attr:t}}),o=o.replace("/>","?>")),r&&r.forEach?r.forEach(function(t,e){var n;f(t,n=e+1===r.length?l:n)}):f(r,l),i?(i.readable=!0,i):o},t.exports.element=t.exports.Element=function(){return{_elem:d(Array.prototype.slice.call(arguments)),push:function(t){if(!this.append)throw new Error("not assigned to a parent!");var e=this,n=this._elem.indent;y(this.append,d(t,n,this._elem.icount+(n?1:0)),function(){e.append(!0)})},close:function(t){void 0!==t&&this.push(t),this.end&&this.end()}}}}.call(this,n(35))},function(e,t,n){!function(t){e.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;function e(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",u=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=1<=e&&e<=31||127==e||0==i&&48<=e&&e<=57||1==i&&48<=e&&e<=57&&45==u?"\\"+e.toString(16)+" ":0==i&&1==r&&45==e||!(128<=e||45==e||95==e||48<=e&&e<=57||65<=e&&e<=90||97<=e&&e<=122)?"\\"+n.charAt(i):n.charAt(i):o+="�";return o}return t.CSS||(t.CSS={}),t.CSS.escape=e}(void 0!==t?t:this)}.call(this,n(20))},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var e=n(26),r=n.n(e),e=n(41),i=n.n(e),e=n(0),o=n.n(e),u=o.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function s(t){var e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!o.a.Map.isMap(t))return{schema:o.a.Map(),parameterContentMediaType:null};if(!e)return"body"===t.get("in")?{schema:t.get("schema",o.a.Map()),parameterContentMediaType:null}:{schema:r()(t).call(t,function(t,e){return i()(u).call(u,e)}),parameterContentMediaType:null};if(t.get("content")){e=t.get("content",o.a.Map({})).keySeq().first();return{schema:t.getIn(["content",e,"schema"],o.a.Map()),parameterContentMediaType:e}}return{schema:t.get("schema",o.a.Map()),parameterContentMediaType:null}}},function(e,t,n){"use strict";!function(t,i){var o=n(17).Buffer,u=t.crypto||t.msCrypto;u&&u.getRandomValues?e.exports=function(t,e){if(4294967295<t)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(t);if(0<t)if(65536<t)for(var r=0;r<t;r+=65536)u.getRandomValues(n.slice(r,r+65536));else u.getRandomValues(n);return"function"==typeof e?i.nextTick(function(){e(null,n)}):n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}.call(this,n(20),n(35))},function(t,n,e){(n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=e(573),n.sha1=e(574),n.sha224=e(575),n.sha256=e(208),n.sha384=e(576),n.sha512=e(209)},function(t,e,n){t.exports=n(577)},function(t,e,n){n=n(226);t.exports=n},function(t,e,n){n(227);var r=n(10).Object,t=t.exports=function(t,e,n){return r.defineProperty(t,e,n)};r.defineProperty.sham&&(t.sham=!0)},function(t,e,n){var r=n(1),i=n(23);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:n(33).f})},function(t,e,n){var r=n(14),i=n(75),o=n(229),u=n(7)("toPrimitive");t.exports=function(t,e){if(!r(t)||i(t))return t;var n=t[u];if(void 0===n)return o(t,e=void 0===e?"number":e);if(e=n.call(t,e=void 0===e?"default":e),!r(e)||i(e))return e;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var i=n(14);t.exports=function(t,e){var n,r;if("string"===e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if("string"!==e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(13);t.exports=function(e,n){try{Object.defineProperty(r,e,{value:n,configurable:!0,writable:!0})}catch(t){r[e]=n}return n}},function(t,e,n){var r=n(6),i=/#|\.prototype\./,n=function(t,e){t=u[o(t)];return t==a||t!=s&&("function"==typeof e?r(e):!!e)},o=n.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=n.data={},s=n.NATIVE="N",a=n.POLYFILL="P";t.exports=n},function(t,e,n){t.exports=n(233)},function(t,e,n){n=n(234);t.exports=n},function(t,e,n){n(235);var r=n(10).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){n(1)({target:"Object",stat:!0,sham:!n(23)},{create:n(77)})},function(t,e,n){var r=n(23),u=n(33),s=n(29),a=n(78);t.exports=r?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),i=r.length,o=0;o<i;)u.f(t,n=r[o++],e[n]);return t}},function(t,e,n){n=n(44);t.exports=n("document","documentElement")},function(n,t,e){var r=e(154);function i(t,e){return n.exports=i=r||function(t,e){return t.__proto__=e,t},n.exports.default=n.exports,n.exports.__esModule=!0,i(t,e)}n.exports=i,n.exports.default=n.exports,n.exports.__esModule=!0},function(t,e,n){n=n(240);t.exports=n},function(t,e,n){n(241);n=n(10);t.exports=n.Object.setPrototypeOf},function(t,e,n){n(1)({target:"Object",stat:!0},{setPrototypeOf:n(155)})},function(t,e,n){var r=n(14);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){n=n(244);t.exports=n},function(t,e,n){n(245);n=n(10);t.exports=n.Reflect.construct},function(t,e,n){var r=n(1),i=n(44),o=n(59),u=n(29),s=n(14),a=n(77),c=n(157),n=n(6),f=i("Reflect","construct"),l=n(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),p=!n(function(){f(function(){})}),n=l||p;r({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(t,e){o(t),u(e);var n=arguments.length<3?t:o(arguments[2]);if(p&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}r=n.prototype,n=a(s(r)?r:Object.prototype),r=Function.apply.call(t,n,e);return s(r)?r:n}})},function(e,t,n){var r=n(154),i=n(247);function o(t){return e.exports=o=r?i:function(t){return t.__proto__||i(t)},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(t,e,n){t.exports=n(248)},function(t,e,n){n=n(249);t.exports=n},function(t,e,n){n(250);n=n(10);t.exports=n.Object.getPrototypeOf},function(t,e,n){var r=n(1),i=n(6),o=n(19),u=n(112),n=n(158);r({target:"Object",stat:!0,forced:i(function(){u(1)}),sham:!n},{getPrototypeOf:function(t){return u(o(t))}})},function(t,e,n){var r=n(156);t.exports=function(){if("undefined"==typeof Reflect||!r)return!1;if(r.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(r(Boolean,[],function(){})),!0}catch(t){return!1}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(18).default,i=n(25);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(254);n(277),n(278),n(279),n(280),n(281),n(282),n(283),t.exports=r},function(t,e,n){n(159),n(114),n(256),n(261),n(262),n(263),n(264),n(164),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276);n=n(10);t.exports=n.Symbol},function(t,e,n){var r=n(14),i=n(60),o=n(7)("species");t.exports=function(t){var e;return void 0===(e=i(t)&&("function"==typeof(e=t.constructor)&&(e===Array||i(e.prototype))||r(e)&&null===(e=e[o]))?void 0:e)?Array:e}},function(t,e,n){"use strict";function r(t,e){var n=nt[t]=b(V.prototype);return J(n,{type:q,tag:t,description:e}),p||(n.description=e),n}function i(t,e,n){return t===X&&i(rt,e,n),M(t),e=m(e),M(n),y(nt,e)?(n.enumerable?(y(t,W)&&t[W][e]&&(t[W][e]=!1),n=b(n,{enumerable:x(0,!1)})):(y(t,W)||$(t,W,x(1,{})),t[W][e]=!0),st(t,e,n)):$(t,e,n)}function o(e,t){M(e);var n=L(t),t=N(n).concat(s(n));return G(t,function(t){p&&!u.call(n,t)||i(e,t,n[t])}),e}function u(t){var e=m(t),t=et.call(this,e);return!(this===X&&y(nt,e)&&!y(rt,e))&&(!(t||!y(this,e)||!y(nt,e)||y(this,W)&&this[W][e])||t)}function s(t){var e=t===X,t=tt(e?rt:L(t)),n=[];return G(t,function(t){!y(nt,t)||e&&!y(X,t)||n.push(nt[t])}),n}var a=n(1),c=n(13),f=n(44),l=n(58),p=n(23),h=n(104),d=n(6),y=n(21),g=n(60),w=n(14),v=n(75),M=n(29),_=n(19),L=n(32),m=n(74),j=n(34),x=n(55),b=n(77),N=n(78),S=n(161),D=n(257),I=n(162),A=n(102),O=n(33),T=n(103),C=n(28),E=n(163),z=n(105),k=n(80),U=n(79),Y=n(107),P=n(7),R=n(115),Q=n(4),B=n(83),F=n(117),G=n(45).forEach,W=k("hidden"),q="Symbol",k=P("toPrimitive"),J=F.set,Z=F.getterFor(q),X=Object.prototype,V=c.Symbol,H=f("JSON","stringify"),K=A.f,$=O.f,tt=D.f,et=T.f,nt=z("symbols"),rt=z("op-symbols"),it=z("string-to-symbol-registry"),ot=z("symbol-to-string-registry"),f=z("wks"),z=c.QObject,ut=!z||!z.prototype||!z.prototype.findChild,st=p&&d(function(){return 7!=b($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=K(X,e);r&&delete X[e],$(t,e,n),r&&t!==X&&$(X,e,r)}:$,c=function(t,e){var n=L(t),t=m(e);if(n!==X||!y(nt,t)||y(rt,t)){e=K(n,t);return!e||!y(nt,t)||y(n,W)&&n[W][t]||(e.enumerable=!0),e}},z=function(t){var t=tt(L(t)),e=[];return G(t,function(t){y(nt,t)||y(U,t)||e.push(t)}),e};h||(E((V=function(){if(this instanceof V)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?j(arguments[0]):void 0,e=Y(t),n=function(t){this===X&&n.call(rt,t),y(this,W)&&y(this[W],e)&&(this[W][e]=!1),st(this,e,x(1,t))};return p&&ut&&st(X,e,{configurable:!0,set:n}),r(e,t)}).prototype,"toString",function(){return Z(this).tag}),E(V,"withoutSetter",function(t){return r(Y(t),t)}),T.f=u,O.f=i,A.f=c,S.f=D.f=z,I.f=s,R.f=function(t){return r(P(t),t)},p&&($(V.prototype,"description",{configurable:!0,get:function(){return Z(this).description}}),l||E(X,"propertyIsEnumerable",u,{unsafe:!0}))),a({global:!0,wrap:!0,forced:!h,sham:!h},{Symbol:V}),G(N(f),function(t){Q(t)}),a({target:q,stat:!0,forced:!h},{for:function(t){var e=j(t);if(y(it,e))return it[e];t=V(e);return it[e]=t,ot[t]=e,t},keyFor:function(t){if(!v(t))throw TypeError(t+" is not a symbol");if(y(ot,t))return ot[t]},useSetter:function(){ut=!0},useSimple:function(){ut=!1}}),a({target:"Object",stat:!0,forced:!h,sham:!p},{create:function(t,e){return void 0===e?b(t):o(b(t),e)},defineProperty:i,defineProperties:o,getOwnPropertyDescriptor:c}),a({target:"Object",stat:!0,forced:!h},{getOwnPropertyNames:z,getOwnPropertySymbols:s}),a({target:"Object",stat:!0,forced:d(function(){I.f(1)})},{getOwnPropertySymbols:function(t){return I.f(_(t))}}),H&&a({target:"JSON",stat:!0,forced:!h||d(function(){var t=V();return"[null]"!=H([t])||"{}"!=H({a:t})||"{}"!=H(Object(t))})},{stringify:function(t,e,n){for(var r,i=[t],o=1;o<arguments.length;)i.push(arguments[o++]);if((w(r=e)||void 0!==t)&&!v(t))return g(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!v(e))return e}),i[1]=e,H.apply(null,i)}}),V.prototype[k]||C(V.prototype,k,V.prototype.valueOf),B(V,q),U[W]=!0},function(t,e,n){var r=n(32),i=n(161).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(r(t))}},function(t,e,n){"use strict";var r=n(116),i=n(61);t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},function(t,e,n){var r=n(13),n=n(260),r=r.WeakMap;t.exports="function"==typeof r&&/native code/.test(n(r))},function(t,e,n){var n=n(106),r=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return r.call(t)}),t.exports=n.inspectSource},function(t,e,n){n(4)("asyncIterator")},function(t,e){},function(t,e,n){n(4)("hasInstance")},function(t,e,n){n(4)("isConcatSpreadable")},function(t,e,n){n(4)("match")},function(t,e,n){n(4)("matchAll")},function(t,e,n){n(4)("replace")},function(t,e,n){n(4)("search")},function(t,e,n){n(4)("species")},function(t,e,n){n(4)("split")},function(t,e,n){n(4)("toPrimitive")},function(t,e,n){n(4)("toStringTag")},function(t,e,n){n(4)("unscopables")},function(t,e,n){var r=n(13);n(83)(r.JSON,"JSON",!0)},function(t,e){},function(t,e){},function(t,e,n){n(4)("asyncDispose")},function(t,e,n){n(4)("dispose")},function(t,e,n){n(4)("matcher")},function(t,e,n){n(4)("metadata")},function(t,e,n){n(4)("observable")},function(t,e,n){n(4)("patternMatch")},function(t,e,n){n(4)("replaceAll")},function(t,e,n){t.exports=n(285)},function(t,e,n){n=n(286);t.exports=n},function(t,e,n){n(84),n(114),n(119),n(164);n=n(115);t.exports=n.f("iterator")},function(t,e,n){"use strict";function r(){return this}var i=n(166).IteratorPrototype,o=n(77),u=n(55),s=n(83),a=n(46);t.exports=function(t,e,n){e+=" Iterator";return t.prototype=o(i,{next:u(1,n)}),s(t,e,!1,!0),a[e]=r,t}},function(t,e,n){var u=n(110),s=n(34),a=n(43),n=function(o){return function(t,e){var n,r=s(a(t)),i=u(e),t=r.length;return i<0||t<=i?o?"":void 0:(e=r.charCodeAt(i))<55296||56319<e||i+1===t||(n=r.charCodeAt(i+1))<56320||57343<n?o?r.charAt(i):e:o?r.slice(i,i+2):n-56320+(e-55296<<10)+65536}};t.exports={codeAt:n(!1),charAt:n(!0)}},function(t,e,n){"use strict";var f=n(290),p=60103,h=60106;e.Fragment=60107,e.StrictMode=60108,e.Profiler=60114;var r=60109,i=60110,o=60112;e.Suspense=60113;var u=60115,s=60116;"function"==typeof Symbol&&Symbol.for&&(p=(v=Symbol.for)("react.element"),h=v("react.portal"),e.Fragment=v("react.fragment"),e.StrictMode=v("react.strict_mode"),e.Profiler=v("react.profiler"),r=v("react.provider"),i=v("react.context"),o=v("react.forward_ref"),e.Suspense=v("react.suspense"),u=v("react.memo"),s=v("react.lazy"));var d="function"==typeof Symbol&&Symbol.iterator;function y(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c={};function l(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||a}function g(){}function w(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||a}l.prototype.isReactComponent={},l.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(y(85));this.updater.enqueueSetState(this,t,e,"setState")},l.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},g.prototype=l.prototype;var v=w.prototype=new g;v.constructor=w,f(v,l.prototype),v.isPureReactComponent=!0;var M={current:null},_=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};function m(t,e,n){var r,i={},o=null,u=null;if(null!=e)for(r in void 0!==e.ref&&(u=e.ref),void 0!==e.key&&(o=""+e.key),e)_.call(e,r)&&!L.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var a=Array(s),c=0;c<s;c++)a[c]=arguments[c+2];i.children=a}if(t&&t.defaultProps)for(r in s=t.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:p,type:t,key:o,ref:u,props:i,_owner:M.current}}function j(t){return"object"==typeof t&&null!==t&&t.$$typeof===p}var x=/\/+/g;function b(t,e){return"object"==typeof t&&null!==t&&null!=t.key?(t=""+t.key,n={"=":"=0",":":"=2"},"$"+t.replace(/[=:]/g,function(t){return n[t]})):e.toString(36);var n}function N(t,e,n){if(null==t)return t;var r=[],i=0;return function t(e,n,r,i,o){var u,s,a=typeof e,c=!1;if(null===(e="undefined"===a||"boolean"===a?null:e))c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case p:case h:c=!0}}if(c)return o=o(c=e),e=""===i?"."+b(c,0):i,Array.isArray(o)?(r="",t(o,n,r=null!=e?e.replace(x,"$&/")+"/":r,"",function(t){return t})):null!=o&&(j(o)&&(u=r+(!(s=o).key||c&&c.key===o.key?"":(""+o.key).replace(x,"$&/")+"/")+e,o={$$typeof:p,type:s.type,key:u,ref:s.ref,props:s.props,_owner:s._owner}),n.push(o)),1;if(c=0,i=""===i?".":i+":",Array.isArray(e))for(var f=0;f<e.length;f++){var l=i+b(a=e[f],f);c+=t(a,n,r,l,o)}else if("function"==typeof(l=null!==(s=e)&&"object"==typeof s&&"function"==typeof(s=d&&s[d]||s["@@iterator"])?s:null))for(e=l.call(e),f=0;!(a=e.next()).done;)c+=t(a=a.value,n,r,l=i+b(a,f++),o);else if("object"===a)throw n=""+e,Error(y(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n));return c}(t,r,"","",function(t){return e.call(n,t,i++)}),r}function S(e){var t;if(-1===e._status&&(t=(t=e._result)(),e._status=0,(e._result=t).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)})),1===e._status)return e._result;throw e._result}var D={current:null};function I(){var t=D.current;if(null===t)throw Error(y(321));return t}v={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:M,IsSomeRendererActing:{current:!1},assign:f};e.Children={map:N,forEach:function(t,e,n){N(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return N(t,function(){e++}),e},toArray:function(t){return N(t,function(t){return t})||[]},only:function(t){if(!j(t))throw Error(y(143));return t}},e.Component=l,e.PureComponent=w,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v,e.cloneElement=function(t,e,n){if(null==t)throw Error(y(267,t));var r=f({},t.props),i=t.key,o=t.ref,u=t._owner;if(null!=e)for(s in void 0!==e.ref&&(o=e.ref,u=M.current),void 0!==e.key&&(i=""+e.key),t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)_.call(e,s)&&!L.hasOwnProperty(s)&&(r[s]=(void 0===e[s]&&void 0!==a?a:e)[s]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var a=Array(s),c=0;c<s;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:p,type:t.type,key:i,ref:o,props:r,_owner:u}},e.createContext=function(t,e){return(t={$$typeof:i,_calculateChangedBits:e=void 0===e?null:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:r,_context:t},t.Consumer=t},e.createElement=m,e.createFactory=function(t){var e=m.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:o,render:t}},e.isValidElement=j,e.lazy=function(t){return{$$typeof:s,_payload:{_status:-1,_result:t},_init:S}},e.memo=function(t,e){return{$$typeof:u,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return I().useCallback(t,e)},e.useContext=function(t,e){return I().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return I().useEffect(t,e)},e.useImperativeHandle=function(t,e,n){return I().useImperativeHandle(t,e,n)},e.useLayoutEffect=function(t,e){return I().useLayoutEffect(t,e)},e.useMemo=function(t,e){return I().useMemo(t,e)},e.useReducer=function(t,e,n){return I().useReducer(t,e,n)},e.useRef=function(t){return I().useRef(t)},e.useState=function(t){return I().useState(t)},e.version="17.0.2"},function(t,e,n){"use strict";var a=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return}}()?Object.assign:function(t,e){for(var n,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),i=1;i<arguments.length;i++){for(var o in n=Object(arguments[i]))c.call(n,o)&&(r[o]=n[o]);if(a)for(var u=a(n),s=0;s<u.length;s++)f.call(n,u[s])&&(r[u[s]]=n[u[s]])}return r}},function(t,e,n){"use strict";var u=n(292);function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function t(t,e,n,r,i,o){if(o!==u){o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){n=n(294);t.exports=n},function(t,e,n){var r=n(295),i=Array.prototype;t.exports=function(t){var e=t.concat;return t===i||t instanceof Array&&e===i.concat?r:e}},function(t,e,n){n(159);n=n(8);t.exports=n("Array").concat},function(t,e,n){n(120);var r=n(298),i=n(61),o=Array.prototype,u={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.forEach;return t===o||t instanceof Array&&e===o.forEach||u.hasOwnProperty(i(t))?r:e}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){n=n(299);t.exports=n},function(t,e,n){n(300);n=n(8);t.exports=n("Array").forEach},function(t,e,n){"use strict";var r=n(1),n=n(301);r({target:"Array",proto:!0,forced:[].forEach!=n},{forEach:n})},function(t,e,n){"use strict";var r=n(45).forEach,n=n(62)("forEach");t.exports=n?[].forEach:function(t){return r(this,t,1<arguments.length?arguments[1]:void 0)}},function(t,e,n){n=n(303);t.exports=n},function(t,e,n){var r=n(304),i=Array.prototype;t.exports=function(t){var e=t.map;return t===i||t instanceof Array&&e===i.map?r:e}},function(t,e,n){n(305);n=n(8);t.exports=n("Array").map},function(t,e,n){"use strict";var r=n(1),i=n(45).map;r({target:"Array",proto:!0,forced:!n(82)("map")},{map:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){"use strict";e.byteLength=function(t){var e=f(t),t=e[0],e=e[1];return 3*(t+e)/4-e},e.toByteArray=function(t){for(var e,n=f(t),r=n[0],n=n[1],i=new c(3*(r+n)/4-n),o=0,u=0<n?r-4:r,s=0;s<u;s+=4)e=a[t.charCodeAt(s)]<<18|a[t.charCodeAt(s+1)]<<12|a[t.charCodeAt(s+2)]<<6|a[t.charCodeAt(s+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=255&e;return 2===n&&(e=a[t.charCodeAt(s)]<<2|a[t.charCodeAt(s+1)]>>4,i[o++]=255&e),1===n&&(e=a[t.charCodeAt(s)]<<10|a[t.charCodeAt(s+1)]<<4|a[t.charCodeAt(s+2)]>>2,i[o++]=e>>8&255,i[o++]=255&e),i},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,i=[],o=0,u=n-r;o<u;o+=16383)i.push(function(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(s[(r=r)>>18&63]+s[r>>12&63]+s[r>>6&63]+s[63&r]);return i.join("")}(t,o,u<o+16383?u:o+16383));return 1==r?(e=t[n-1],i.push(s[e>>2]+s[e<<4&63]+"==")):2==r&&(e=(t[n-2]<<8)+t[n-1],i.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"=")),i.join("")};for(var s=[],a=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)s[i]=r[i],a[r.charCodeAt(i)]=i;function f(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,u,s=8*i-r-1,a=(1<<s)-1,c=a>>1,f=-7,l=n?i-1:0,p=n?-1:1,n=t[e+l];for(l+=p,o=n&(1<<-f)-1,n>>=-f,f+=s;0<f;o=256*o+t[e+l],l+=p,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=r;0<f;u=256*u+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===a)return u?NaN:1/0*(n?-1:1);u+=Math.pow(2,r),o-=c}return(n?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,s,a=8*o-i-1,c=(1<<a)-1,f=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=c):(u=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-u))<1&&(u--,r*=2),2<=(e+=1<=u+f?l/r:l*Math.pow(2,1-f))*r&&(u++,r/=2),c<=u+f?(s=0,u=c):1<=u+f?(s=(e*r-1)*Math.pow(2,i),u+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),u=0));8<=i;t[n+p]=255&s,p+=h,s/=256,i-=8);for(u=u<<i|s,a+=i;0<a;t[n+p]=255&u,p+=h,u/=256,a-=8);t[n+p-h]|=128*o}},function(t,e,n){var r=n(122),i=n(170);t.exports=function(t){if(r(t))return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){n=n(169);t.exports=n},function(t,e,n){n(1)({target:"Array",stat:!0},{isArray:n(60)})},function(t,e,n){var r=n(81),i=n(123),o=n(172);t.exports=function(t){if(void 0!==r&&null!=i(t)||null!=t["@@iterator"])return o(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){n(84),n(119),n(120);n=n(171);t.exports=n},function(t,e,n){n=n(314);t.exports=n},function(t,e,n){n(119),n(315);n=n(10);t.exports=n.Array.from},function(t,e,n){var r=n(1),i=n(316);r({target:"Array",stat:!0,forced:!n(320)(function(t){Array.from(t)})},{from:i})},function(t,e,n){"use strict";var h=n(108),d=n(19),y=n(317),g=n(319),w=n(30),v=n(113),M=n(171);t.exports=function(t){var e,n,r,i,o,u,s=d(t),a="function"==typeof this?this:Array,c=arguments.length,f=1<c?arguments[1]:void 0,l=void 0!==f,t=M(s),p=0;if(l&&(f=h(f,2<c?arguments[2]:void 0,2)),null==t||a==Array&&g(t))for(n=new a(e=w(s.length));p<e;p++)u=l?f(s[p],p):s[p],v(n,p,u);else for(o=(i=t.call(s)).next,n=new a;!(r=o.call(i)).done;p++)u=l?y(i,f,[r.value,p],!0):r.value,v(n,p,u);return n.length=p,n}},function(t,e,n){var i=n(29),o=n(318);t.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){throw o(t),e}}},function(t,e,n){var r=n(29);t.exports=function(t){var e=t.return;if(void 0!==e)return r(e.call(t)).value}},function(t,e,n){var r=n(7),i=n(46),o=r("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||u[o]===t)}},function(t,e,n){var i=n(7)("iterator"),o=!1;try{var r=0,u={next:function(){return{done:!!r++}},return:function(){o=!0}};u[i]=function(){return this},Array.from(u,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}},function(t,e,n){t.exports=n(322)},function(t,e,n){n=n(173);t.exports=n},function(t,e,n){n(324);n=n(8);t.exports=n("Array").slice},function(t,e,n){"use strict";var r=n(1),c=n(14),f=n(60),l=n(153),p=n(30),h=n(32),d=n(113),i=n(7),n=n(82)("slice"),y=i("species"),g=[].slice,w=Math.max;r({target:"Array",proto:!0,forced:!n},{slice:function(t,e){var n,r,i,o=h(this),u=p(o.length),s=l(t,u),a=l(void 0===e?u:e,u);if(f(o)&&((n="function"==typeof(n=o.constructor)&&(n===Array||f(n.prototype))||c(n)&&null===(n=n[y])?void 0:n)===Array||void 0===n))return g.call(o,s,a);for(r=new(void 0===n?Array:n)(w(a-s,0)),i=0;s<a;s++,i++)s in o&&d(r,i,o[s]);return r.length=i,r}})},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(122);t.exports=function(t){if(r(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var a=n(81),c=n(123);t.exports=function(t,e){var n=null==t?null:void 0!==a&&c(t)||t["@@iterator"];if(null!=n){var r,i,o=[],u=!0,s=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);u=!0);}catch(t){s=!0,i=t}finally{try{u||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){n=n(169);t.exports=n},function(t,e,n){n(120);var r=n(331),i=n(61),o=Array.prototype,u={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.entries;return t===o||t instanceof Array&&e===o.entries||u.hasOwnProperty(i(t))?r:e}},function(t,e,n){n=n(332);t.exports=n},function(t,e,n){n(84),n(114);n=n(8);t.exports=n("Array").entries},function(t,e,n){n=n(334);t.exports=n},function(t,e,n){var r=n(335),i=Array.prototype;t.exports=function(t){var e=t.filter;return t===i||t instanceof Array&&e===i.filter?r:e}},function(t,e,n){n(336);n=n(8);t.exports=n("Array").filter},function(t,e,n){"use strict";var r=n(1),i=n(45).filter;r({target:"Array",proto:!0,forced:!n(82)("filter")},{filter:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){n=n(338);t.exports=n},function(t,e,n){n(339);n=n(10);t.exports=n.Object.keys},function(t,e,n){var r=n(1),i=n(19),o=n(78);r({target:"Object",stat:!0,forced:n(6)(function(){o(1)})},{keys:function(t){return o(i(t))}})},function(t,e,n){n=n(341);t.exports=n},function(t,e,n){var r=n(342),i=Function.prototype;t.exports=function(t){var e=t.bind;return t===i||t instanceof Function&&e===i.bind?r:e}},function(t,e,n){n(343);n=n(8);t.exports=n("Function").bind},function(t,e,n){n(1)({target:"Function",proto:!0},{bind:n(157)})},function(t,e,n){n=n(345);t.exports=n},function(t,e,n){var r=n(346),i=Array.prototype;t.exports=function(t){var e=t.reduce;return t===i||t instanceof Array&&e===i.reduce?r:e}},function(t,e,n){n(347);n=n(8);t.exports=n("Array").reduce},function(t,e,n){"use strict";var r=n(1),i=n(348).left,o=n(62),u=n(57),n=n(349);r({target:"Array",proto:!0,forced:!o("reduce")||!n&&79<u&&u<83},{reduce:function(t){return i(this,t,arguments.length,1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){var f=n(59),l=n(19),p=n(73),h=n(30),n=function(c){return function(t,e,n,r){f(e);var i=l(t),o=p(i),u=h(i.length),s=c?u-1:0,a=c?-1:1;if(n<2)for(;;){if(s in o){r=o[s],s+=a;break}if(s+=a,c?s<0:u<=s)throw TypeError("Reduce of empty array with no initial value")}for(;c?0<=s:s<u;s+=a)s in o&&(r=e(r,o[s],s,i));return r}};t.exports={left:n(!1),right:n(!0)}},function(t,e,n){var r=n(56),n=n(13);t.exports="process"==r(n.process)},function(t,e,n){n=n(351);t.exports=n},function(t,e,n){n(352);n=n(10);t.exports=n.Object.assign},function(t,e,n){var r=n(1),n=n(353);r({target:"Object",stat:!0,forced:Object.assign!==n},{assign:n})},function(t,e,n){"use strict";var p=n(23),r=n(6),h=n(78),d=n(162),y=n(103),g=n(19),w=n(73),i=Object.assign,o=Object.defineProperty;t.exports=!i||r(function(){if(p&&1!==i({b:1},i(o({},"a",{enumerable:!0,get:function(){o(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=i({},t)[n]||h(i({},e)).join("")!=r})?function(t,e){for(var n=g(t),r=arguments.length,i=1,o=d.f,u=y.f;i<r;)for(var s,a=w(arguments[i++]),c=o?h(a).concat(o(a)):h(a),f=c.length,l=0;l<f;)s=c[l++],p&&!u.call(a,s)||(n[s]=a[s]);return n}:i},function(t,e,n){n=n(355);t.exports=n},function(t,e,n){var r=n(356),i=Array.prototype;t.exports=function(t){var e=t.sort;return t===i||t instanceof Array&&e===i.sort?r:e}},function(t,e,n){n(357);n=n(8);t.exports=n("Array").sort},function(t,e,n){"use strict";var r=n(1),s=n(59),a=n(19),c=n(30),f=n(34),i=n(6),l=n(358),o=n(62),u=n(359),p=n(360),h=n(57),d=n(361),y=[],g=y.sort,w=i(function(){y.sort(void 0)}),n=i(function(){y.sort(null)}),o=o("sort"),v=!i(function(){if(h)return h<70;if(!(u&&3<u)){if(p)return!0;if(d)return d<603;for(var t,e,n,r="",i=65;i<76;i++){switch(t=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)y.push({k:t+n,v:e})}for(y.sort(function(t,e){return e.v-t.v}),n=0;n<y.length;n++)t=y[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}});r({target:"Array",proto:!0,forced:w||!n||!o||!v},{sort:function(t){void 0!==t&&s(t);var e=a(this);if(v)return void 0===t?g.call(e):g.call(e,t);for(var n,r,i=[],o=c(e.length),u=0;u<o;u++)u in e&&i.push(e[u]);for(n=(i=l(i,(r=t,function(t,e){return void 0===e?-1:void 0===t?1:void 0!==r?+r(t,e)||0:f(t)>f(e)?1:-1}))).length,u=0;u<n;)e[u]=i[u++];for(;u<o;)delete e[u++];return e}})},function(t,e){function i(t,e){var n=t.length,r=o(n/2);return n<8?function(t,e){for(var n,r,i=t.length,o=1;o<i;){for(r=o,n=t[o];r&&e(t[r-1],n)>0;)t[r]=t[--r];r!==o++&&(t[r]=n)}return t}(t,e):function(t,e,n){for(var r=t.length,i=e.length,o=0,u=0,s=[];o<r||u<i;)o<r&&u<i?s.push(n(t[o],e[u])<=0?t[o++]:e[u++]):s.push(o<r?t[o++]:e[u++]);return s}(i(t.slice(0,r),e),i(t.slice(r),e),e)}var o=Math.floor;t.exports=i},function(t,e,n){n=n(76).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},function(t,e,n){n=n(76);t.exports=/MSIE|Trident/.test(n)},function(t,e,n){n=n(76).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},function(t,e,n){n=n(173);t.exports=n},function(t,e,n){n=n(364);t.exports=n},function(t,e,n){var r=n(365),i=Array.prototype;t.exports=function(t){var e=t.some;return t===i||t instanceof Array&&e===i.some?r:e}},function(t,e,n){n(366);n=n(8);t.exports=n("Array").some},function(t,e,n){"use strict";var r=n(1),i=n(45).some;r({target:"Array",proto:!0,forced:!n(62)("some")},{some:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){n=n(368);t.exports=n},function(t,e,n){var r=n(369),i=n(371),o=Array.prototype,u=String.prototype;t.exports=function(t){var e=t.includes;return t===o||t instanceof Array&&e===o.includes?r:"string"==typeof t||t===u||t instanceof String&&e===u.includes?i:e}},function(t,e,n){n(370);n=n(8);t.exports=n("Array").includes},function(t,e,n){"use strict";var r=n(1),i=n(109).includes,n=n(118);r({target:"Array",proto:!0},{includes:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),n("includes")},function(t,e,n){n(372);n=n(8);t.exports=n("String").includes},function(t,e,n){"use strict";var r=n(1),i=n(174),o=n(43),u=n(34);r({target:"String",proto:!0,forced:!n(175)("includes")},{includes:function(t){return!!~u(o(this)).indexOf(u(i(t)),1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){var r=n(14),i=n(56),o=n(7)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){n=n(375);t.exports=n},function(t,e,n){n(376);var r=n(10);r.JSON||(r.JSON={stringify:JSON.stringify}),t.exports=function(t,e,n){return r.JSON.stringify.apply(null,arguments)}},function(t,e,n){function i(t,e,n){var r=n.charAt(e-1),e=n.charAt(e+1);return a.test(t)&&!c.test(e)||c.test(t)&&!a.test(r)?"\\u"+t.charCodeAt(0).toString(16):t}var r=n(1),o=n(44),n=n(6),u=o("JSON","stringify"),s=/[\uD800-\uDFFF]/g,a=/^[\uD800-\uDBFF]$/,c=/^[\uDC00-\uDFFF]$/,n=n(function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")});u&&r({target:"JSON",stat:!0,forced:n},{stringify:function(t,e,n){var r=u.apply(null,arguments);return"string"==typeof r?r.replace(s,i):r}})},function(t,e,n){n=n(378);t.exports=n},function(t,e,n){var r=n(379),i=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===i||t instanceof Array&&e===i.indexOf?r:e}},function(t,e,n){n(380);n=n(8);t.exports=n("Array").indexOf},function(t,e,n){"use strict";var r=n(1),i=n(109).indexOf,n=n(62),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0,n=n("indexOf");r({target:"Array",proto:!0,forced:u||!n},{indexOf:function(t){return u?o.apply(this,arguments)||0:i(this,t,1<arguments.length?arguments[1]:void 0)}})},function(t,e,n){n=n(382);t.exports=n},function(t,e,n){var r=n(383),i=Array.prototype;t.exports=function(t){var e=t.find;return t===i||t instanceof Array&&e===i.find?r:e}},function(t,e,n){n(384);n=n(8);t.exports=n("Array").find},function(t,e,n){"use strict";var r=n(1),i=n(45).find,n=n(118),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),r({target:"Array",proto:!0,forced:o},{find:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),n("find")},function(t,e,n){n=n(386);t.exports=n},function(t,e,n){var r=n(387),i=String.prototype;t.exports=function(t){var e=t.startsWith;return"string"==typeof t||t===i||t instanceof String&&e===i.startsWith?r:e}},function(t,e,n){n(388);n=n(8);t.exports=n("String").startsWith},function(t,e,n){"use strict";var r=n(1),i=n(102).f,o=n(30),u=n(34),s=n(174),a=n(43),c=n(175),n=n(58),f="".startsWith,l=Math.min,c=c("startsWith");r({target:"String",proto:!0,forced:!(!n&&!c&&((i=i(String.prototype,"startsWith"))&&!i.writable)||c)},{startsWith:function(t){var e=u(a(this));s(t);var n=o(l(1<arguments.length?arguments[1]:void 0,e.length)),t=u(t);return f?f.call(e,t,n):e.slice(n,n+t.length)===t}})},function(t,e,n){n=n(390);t.exports=n},function(t,e,n){var r=n(391),i=String.prototype;t.exports=function(t){var e=t.trim;return"string"==typeof t||t===i||t instanceof String&&e===i.trim?r:e}},function(t,e,n){n(392);n=n(8);t.exports=n("String").trim},function(t,e,n){"use strict";var r=n(1),i=n(393).trim;r({target:"String",proto:!0,forced:n(394)("trim")},{trim:function(){return i(this)}})},function(t,e,n){var r=n(43),i=n(34),n="["+n(176)+"]",o=RegExp("^"+n+n+"*"),u=RegExp(n+n+"*$"),n=function(e){return function(t){t=i(r(t));return 1&e&&(t=t.replace(o,"")),t=2&e?t.replace(u,""):t}};t.exports={start:n(1),end:n(2),trim:n(3)}},function(t,e,n){var r=n(6),i=n(176);t.exports=function(t){return r(function(){return!!i[t]()||"​…᠎"!="​…᠎"[t]()||i[t].name!==t})}},function(t,e,n){var r=n(63),i=n(140);t.exports=function(t){return i(r(t).toLowerCase())}},function(t,e,n){var r=n(85),i=n(397),o=n(22),u=n(86),r=r?r.prototype:void 0,s=r?r.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(u(e))return s?s.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(85),n=Object.prototype,o=n.hasOwnProperty,u=n.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{var r=!(t[s]=void 0)}catch(t){}var i=u.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var i=n(401),o=n(178),u=n(403),s=n(63);t.exports=function(r){return function(t){t=s(t);var e=o(t)?u(t):void 0,n=e?e[0]:t.charAt(0),t=e?i(e,1).join(""):t.slice(1);return n[r]()+t}}},function(t,e,n){var i=n(402);t.exports=function(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&r<=n?t:i(t,e,n)}},function(t,e){t.exports=function(t,e,n){var r=-1,i=t.length;(n=i<n?i:n)<0&&(n+=i),i=n<(e=e<0?i<-e?0:i+e:e)?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}},function(t,e,n){var r=n(404),i=n(178),o=n(405);t.exports=function(t){return(i(t)?o:r)(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")?",a="[\\ufe0e\\ufe0f]?",s=a+s+"(?:\\u200d(?:"+[i,o,u].join("|")+")"+a+s+")*",u="(?:"+[i+n+"?",n,o,u,"[\\ud800-\\udfff]"].join("|")+")",c=RegExp(r+"(?="+r+")|"+u+s,"g");t.exports=function(t){return t.match(c)||[]}},function(t,e,n){var r=n(407),i=n(408),o=n(411),u=RegExp("['’]","g");t.exports=function(e){return function(t){return r(o(i(t).replace(u,"")),e,"")}}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e,n){var r=n(409),i=n(63),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,r).replace(u,"")}},function(t,e,n){n=n(410)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});t.exports=n},function(t,e){t.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(412),i=n(413),o=n(63),u=n(414);t.exports=function(t,e,n){return t=o(t),void 0===(e=n?void 0:e)?(i(t)?u:r)(t):t.match(e)||[]}},function(t,e){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=function(t){return t.match(n)||[]}},function(t,e){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=function(t){return n.test(t)}},function(t,e){var n="a-z\\xdf-\\xf6\\xf8-\\xff",r="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+i+"]",u="\\d+",s="["+n+"]",a="[^\\ud800-\\udfff"+i+u+"\\u2700-\\u27bf"+n+r+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",l="["+r+"]",p="(?:"+s+"|"+a+")",h="(?:"+l+"|"+a+")",i="(?:['’](?:d|ll|m|re|s|t|ve))?",n="(?:['’](?:D|LL|M|RE|S|T|VE))?",r="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",a="[\\ufe0e\\ufe0f]?",r=a+r+"(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,f].join("|")+")"+a+r+")*",r="(?:"+["[\\u2700-\\u27bf]",c,f].join("|")+")"+r,d=RegExp([l+"?"+s+"+"+i+"(?="+[o,l,"$"].join("|")+")",h+"+"+n+"(?="+[o,l+p,"$"].join("|")+")",l+"?"+p+"+"+i,l+"+"+n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",u,r].join("|"),"g");t.exports=function(t){return t.match(d)||[]}},function(t,e,n){var r=n(416),i=n(88),o=n(126);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(417),i=n(422),o=n(423),u=n(424),n=n(425);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=n,t.exports=s},function(t,e,n){var r=n(87);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(69),i=n(419),o=n(66),u=n(179),s=/^\[object .+?Constructor\]$/,a=Function.prototype,n=Object.prototype,a=a.toString,n=n.hasOwnProperty,c=RegExp("^"+a.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?c:s).test(u(t))}},function(t,e,n){var n=n(420),r=(n=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!r&&r in t}},function(t,e,n){n=n(24)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){t=this.has(t)&&delete this.__data__[t];return this.size-=t?1:0,t}},function(t,e,n){var r=n(87),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(87),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(87);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(89),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,t=r(e,t);return!(t<0||(t==e.length-1?e.pop():i.call(e,t,1),--this.size,0))}},function(t,e,n){var r=n(89);t.exports=function(t){var e=this.__data__,t=r(e,t);return t<0?void 0:e[t][1]}},function(t,e,n){var r=n(89);t.exports=function(t){return-1<r(this.__data__,t)}},function(t,e,n){var i=n(89);t.exports=function(t,e){var n=this.__data__,r=i(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}},function(t,e,n){var r=n(90);t.exports=function(t){t=r(this,t).delete(t);return this.size-=t?1:0,t}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(90);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(90);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var i=n(90);t.exports=function(t,e){var n=i(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}},function(t,e,n){var u=n(127),s=n(67),a=n(91);t.exports=function(o){return function(t,e,n){var r,i=Object(t);s(t)||(r=u(e,3),t=a(t),e=function(t){return r(i[t],t,i)});n=o(t,e,n);return-1<n?i[r?t[n]:n]:void 0}}},function(t,e,n){var r=n(438),i=n(473),o=n(189);t.exports=function(e){var n=i(e);return 1==n.length&&n[0][2]?o(n[0][0],n[0][1]):function(t){return t===e||r(t,e,n)}}},function(t,e,n){var h=n(180),d=n(181);t.exports=function(t,e,n,r){var i=n.length,o=i,u=!r;if(null==t)return!o;for(t=Object(t);i--;){var s=n[i];if(u&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var a=(s=n[i])[0],c=t[a],f=s[1];if(u&&s[2]){if(void 0===c&&!(a in t))return!1}else{var l,p=new h;if(!(void 0===(l=r?r(c,f,a,t,e,p):l)?d(f,c,3,r,p):l))return!1}}return!0}},function(t,e,n){var r=n(88);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var i=n(88),o=n(126),u=n(125);t.exports=function(t,e){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!o||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new u(r)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var l=n(180),p=n(182),h=n(449),d=n(453),y=n(187),g=n(22),w=n(129),v=n(131),M="[object Arguments]",_="[object Array]",L="[object Object]",m=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,r,i,o){var u=g(t),s=g(e),a=u?_:y(t),c=s?_:y(e),f=(a=a==M?L:a)==L,s=(c=c==M?L:c)==L,c=a==c;if(c&&w(t)){if(!w(e))return!1;f=!(u=!0)}if(c&&!f)return o=o||new l,u||v(t)?p(t,e,n,r,i,o):h(t,e,a,n,r,i,o);if(!(1&n)){f=f&&m.call(t,"__wrapped__"),s=s&&m.call(e,"__wrapped__");if(f||s)return i(f?t.value():t,s?e.value():e,n,r,o=o||new l)}return!!c&&(o=o||new l,d(t,e,n,r,i,o))}},function(t,e,n){var r=n(125),i=n(446),n=n(447);function o(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}o.prototype.add=o.prototype.push=i,o.prototype.has=n,t.exports=o},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(85),c=n(450),f=n(50),l=n(182),p=n(451),h=n(452),r=r?r.prototype:void 0,d=r?r.valueOf:void 0;t.exports=function(t,e,n,r,i,o,u){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new c(t),new c(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return f(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=p;case"[object Set]":s=s||h;if(t.size!=e.size&&!(1&r))return!1;var a=u.get(t);if(a)return a==e;r|=2,u.set(t,e);s=l(s(t),s(e),r,i,o,u);return u.delete(t),s;case"[object Symbol]":if(d)return d.call(t)==d.call(e)}return!1}},function(t,e,n){n=n(24).Uint8Array;t.exports=n},function(t,e){t.exports=function(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}},function(t,e,n){var v=n(454),M=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,r,i,o){var u=1&n,s=v(t),a=s.length;if(a!=v(e).length&&!u)return!1;for(var c=a;c--;){var f=s[c];if(!(u?f in e:M.call(e,f)))return!1}var l=o.get(t),p=o.get(e);if(l&&p)return l==e&&p==t;var h=!0;o.set(t,e),o.set(e,t);for(var d=u;++c<a;){var y,g=t[f=s[c]],w=e[f];if(!(void 0===(y=r?u?r(w,g,f,e,t,o):r(g,w,f,t,e,o):y)?g===w||i(g,w,n,r,o):y)){h=!1;break}d=d||"constructor"==f}return!h||d||(l=t.constructor)!=(p=e.constructor)&&"constructor"in t&&"constructor"in e&&!("function"==typeof l&&l instanceof l&&"function"==typeof p&&p instanceof p)&&(h=!1),o.delete(t),o.delete(e),h}},function(t,e,n){var r=n(455),i=n(457),o=n(91);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(456),i=n(22);t.exports=function(t,e,n){e=e(t);return i(t)?e:r(e,n(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(458),n=n(459),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,n=o?function(e){return null==e?[]:(e=Object(e),r(o(e),function(t){return i.call(e,t)}))}:n;t.exports=n},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var f=n(461),l=n(128),p=n(22),h=n(129),d=n(130),y=n(131),g=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n,r=p(t),i=!r&&l(t),o=!r&&!i&&h(t),u=!r&&!i&&!o&&y(t),s=r||i||o||u,a=s?f(t.length,String):[],c=a.length;for(n in t)!e&&!g.call(t,n)||s&&("length"==n||o&&("offset"==n||"parent"==n)||u&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||d(n,c))||a.push(n);return a}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(64),i=n(65);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(64),i=n(132),o=n(65),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!u[r(t)]}},function(t,e){t.exports=function(e){return function(t){return e(t)}}},function(t,o,u){!function(t){var e=u(177),n=o&&!o.nodeType&&o,r=n&&"object"==typeof t&&t&&!t.nodeType&&t,i=r&&r.exports===n&&e.process,e=function(){try{return r&&r.require&&r.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=e}.call(this,u(184)(t))},function(t,e,n){n=n(468)(Object.keys,Object);t.exports=n},function(t,e){t.exports=function(e,n){return function(t){return e(n(t))}}},function(t,e,n){n=n(47)(n(24),"DataView");t.exports=n},function(t,e,n){n=n(47)(n(24),"Promise");t.exports=n},function(t,e,n){n=n(47)(n(24),"Set");t.exports=n},function(t,e,n){n=n(47)(n(24),"WeakMap");t.exports=n},function(t,e,n){var o=n(188),u=n(91);t.exports=function(t){for(var e=u(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,o(i)]}return e}},function(t,e,n){var i=n(181),o=n(475),u=n(478),s=n(133),a=n(188),c=n(189),f=n(92);t.exports=function(n,r){return s(n)&&a(r)?c(f(n),r):function(t){var e=o(t,n);return void 0===e&&e===r?u(t,n):i(r,e,3)}}},function(t,e,n){var r=n(190);t.exports=function(t,e,n){e=null==t?void 0:r(t,e);return void 0===e?n:e}},function(t,e,n){var n=n(477),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,n=n(function(t){var i=[];return 46===t.charCodeAt(0)&&i.push(""),t.replace(r,function(t,e,n,r){i.push(n?r.replace(o,"$1"):e||t)}),i});t.exports=n},function(t,e,n){var r=n(141);t.exports=function(t){var t=r(t,function(t){return 500===e.size&&e.clear(),t}),e=t.cache;return t}},function(t,e,n){var r=n(479),i=n(480);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var s=n(191),a=n(128),c=n(22),f=n(130),l=n(132),p=n(92);t.exports=function(t,e,n){for(var r=-1,i=(e=s(e,t)).length,o=!1;++r<i;){var u=p(e[r]);if(!(o=null!=t&&n(t,u)))break;t=t[u]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&l(i)&&f(u,i)&&(c(t)||a(t))}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(483),i=n(484),o=n(133),u=n(92);t.exports=function(t){return o(t)?r(u(t)):i(t)}},function(t,e){t.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(190);t.exports=function(e){return function(t){return r(t,e)}}},function(t,e,n){var i=n(486),o=n(127),u=n(487),s=Math.max;t.exports=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;n=null==n?0:u(n);return n<0&&(n=s(r+n,0)),i(t,o(e,3),n)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(488);t.exports=function(t){var e=r(t),t=e%1;return e==e?t?e-t:e:0}},function(t,e,n){var r=n(489);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(490),i=n(66),o=n(86),u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)&&(e="function"==typeof t.valueOf?t.valueOf():t,t=i(e)?e+"":e),"string"!=typeof t)return 0===t?t:+t;t=r(t);var e=s.test(t);return e||a.test(t)?c(t.slice(2),e?2:8):u.test(t)?NaN:+t}},function(t,e,n){var r=n(491),i=/^\s+/;t.exports=function(t){return t&&t.slice(0,r(t)+1).replace(i,"")}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var o=n(493);t.exports=function(t,r){var i;return o(t,function(t,e,n){return!(i=r(t,e,n))}),!!i}},function(t,e,n){var r=n(494),r=n(497)(r);t.exports=r},function(t,e,n){var r=n(495),i=n(91);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){n=n(496)();t.exports=n},function(t,e){t.exports=function(a){return function(t,e,n){for(var r=-1,i=Object(t),o=n(t),u=o.length;u--;){var s=o[a?u:++r];if(!1===e(i[s],s,i))break}return t}}},function(t,e,n){var s=n(67);t.exports=function(o,u){return function(t,e){if(null==t)return t;if(!s(t))return o(t,e);for(var n=t.length,r=u?n:-1,i=Object(t);(u?r--:++r<n)&&!1!==e(i[r],r,i););return t}}},function(t,e,n){var i=n(50),o=n(67),u=n(130),s=n(66);t.exports=function(t,e,n){if(!s(n))return!1;var r=typeof e;return!!("number"==r?o(n)&&u(e,n.length):"string"==r&&e in n)&&i(n[e],t)}},function(t,e){var n={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;"};t.exports=function(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(t,e){return n[e]}):t}},function(t,e,n){t.exports=r;var f=n(134).EventEmitter;function r(){f.call(this)}n(16)(r,f),r.Readable=n(135),r.Writable=n(507),r.Duplex=n(508),r.Transform=n(509),r.PassThrough=n(510),(r.Stream=r).prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",u),n.on("close",s));var o=!1;function u(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function a(t){if(c(),0===f.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",a),e.removeListener("error",a),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",a),e.on("error",a),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(t,e){},function(t,e,n){"use strict";var o=n(17).Buffer,r=n(503);function i(){!function(t){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this),this.head=null,this.tail=null,this.length=0}t.exports=(i.prototype.push=function(t){t={data:t,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(t){t={data:t,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},i.prototype.concat=function(t){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var e,n=o.allocUnsafe(t>>>0),r=this.head,i=0;r;)e=i,r.data.copy(n,e),i+=r.data.length,r=r.next;return n},i),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){!function(t,h){!function(n){"use strict";var r,e,i,t,o,u,s,a,c,f;function l(t){delete u[t]}function p(t){if(s)setTimeout(p,0,t);else{var n=u[t];if(n){s=!0;try{!function(){var t=n.callback,e=n.args;switch(e.length){case 0:t();break;case 1:t(e[0]);break;case 2:t(e[0],e[1]);break;case 3:t(e[0],e[1],e[2]);break;default:t.apply(void 0,e)}}()}finally{l(t),s=!1}}}}n.setImmediate||(o=1,s=!(u={}),a=n.document,c=(c=Object.getPrototypeOf&&Object.getPrototypeOf(n))&&c.setTimeout?c:n,f="[object process]"==={}.toString.call(n.process)?function(t){h.nextTick(function(){p(t)})}:function(){if(n.postMessage&&!n.importScripts){var t=!0,e=n.onmessage;return n.onmessage=function(){t=!1},n.postMessage("","*"),n.onmessage=e,t}}()?(i="setImmediate$"+Math.random()+"$",t=function(t){t.source===n&&"string"==typeof t.data&&0===t.data.indexOf(i)&&p(+t.data.slice(i.length))},n.addEventListener?n.addEventListener("message",t,!1):n.attachEvent("onmessage",t),function(t){n.postMessage(i+t,"*")}):n.MessageChannel?((e=new MessageChannel).port1.onmessage=function(t){p(t.data)},function(t){e.port2.postMessage(t)}):a&&"onreadystatechange"in a.createElement("script")?(r=a.documentElement,function(t){var e=a.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):function(t){setTimeout(p,0,t)},c.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];return u[o]={callback:t,args:e},f(o),o++},c.clearImmediate=l)}("undefined"==typeof self?void 0===t?this:t:self)}.call(this,n(20),n(35))},function(t,e,n){!function(n){function r(t){try{if(!n.localStorage)return}catch(t){return}var e=n.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}.call(this,n(20))},function(t,e,n){"use strict";t.exports=i;var r=n(197),t=Object.create(n(68));function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}t.inherits=n(16),t.inherits(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(136)},function(t,e,n){t.exports=n(36)},function(t,e,n){t.exports=n(135).Transform},function(t,e,n){t.exports=n(135).PassThrough},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(513),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*o(i(t)):t}},function(t,e,n){"use strict";t.exports=n(514)()?Math.sign:n(515)},function(t,e,n){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},function(t,e,n){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:0<t?1:-1}},function(t,e,n){"use strict";var o=n(31),u=n(94),s=n(39),a=n(518),c=n(199);t.exports=function t(e){var n,r,i;if(o(e),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(e,"__memoized__")&&!n.force?e:(r=c(n.length,e.length,n.async&&s.async),i=a(e,r,n),u(s,function(t,e){n[e]&&t(n[e],i,n)}),t.__profiler__&&t.__profiler__(i),i.updateEnv(),i.memoized)}},function(t,e,n){"use strict";var s=n(31),a=n(48),c=Function.prototype.bind,f=Function.prototype.call,l=Object.keys,p=Object.prototype.propertyIsEnumerable;t.exports=function(o,u){return function(n,r){var t,i=arguments[2],e=arguments[3];return n=Object(a(n)),s(r),t=l(n),e&&t.sort("function"==typeof e?c.call(e,n):void 0),"function"!=typeof o&&(o=t[o]),f.call(o,t,function(t,e){return p.call(n,t)?f.call(r,i,n[t],t,n,e):u})}}},function(t,e,n){"use strict";var g=n(519),w=n(201),v=n(40),r=n(533).methods,M=n(534),_=n(550),L=Function.prototype.apply,m=Function.prototype.call,j=Object.create,x=Object.defineProperties,b=r.on,N=r.emit;t.exports=function(i,e,t){var o,u,s,n,r,a,c,f,l,p,h,d=j(null),y=!1!==e?e:isNaN(i.length)?1:i.length;return t.normalizer&&(a=_(t.normalizer),u=a.get,s=a.set,n=a.delete,r=a.clear),null!=t.resolvers&&(h=M(t.resolvers)),p=u?w(function(t){var e,n,r=arguments;if(h&&(r=h(r)),null!==(e=u(r))&&hasOwnProperty.call(d,e))return c&&o.emit("get",e,r,this),d[e];if(n=1===r.length?m.call(i,this,r[0]):L.call(i,this,r),null===e){if(null!==(e=u(r)))throw g("Circular invocation","CIRCULAR_INVOCATION");e=s(r)}else if(hasOwnProperty.call(d,e))throw g("Circular invocation","CIRCULAR_INVOCATION");return d[e]=n,f&&o.emit("set",e,null,n),n},y):0===e?function(){var t;if(hasOwnProperty.call(d,"data"))return c&&o.emit("get","data",arguments,this),d.data;if(t=arguments.length?L.call(i,this,arguments):m.call(i,this),hasOwnProperty.call(d,"data"))throw g("Circular invocation","CIRCULAR_INVOCATION");return d.data=t,f&&o.emit("set","data",null,t),t}:function(t){var e,n=arguments;if(h&&(n=h(arguments)),e=String(n[0]),hasOwnProperty.call(d,e))return c&&o.emit("get",e,n,this),d[e];if(n=1===n.length?m.call(i,this,n[0]):L.call(i,this,n),hasOwnProperty.call(d,e))throw g("Circular invocation","CIRCULAR_INVOCATION");return d[e]=n,f&&o.emit("set",e,null,n),n},o={original:i,memoized:p,profileName:t.profileName,get:function(t){return h&&(t=h(t)),u?u(t):String(t[0])},has:function(t){return hasOwnProperty.call(d,t)},delete:function(t){var e;hasOwnProperty.call(d,t)&&(n&&n(t),e=d[t],delete d[t],l&&o.emit("delete",t,e))},clear:function(){var t=d;r&&r(),d=j(null),o.emit("clear",t)},on:function(t,e){return"get"===t?c=!0:"set"===t?f=!0:"delete"===t&&(l=!0),b.call(this,t,e)},emit:N,updateEnv:function(){i=o.original}},a=u?w(function(t){var e=arguments;h&&(e=h(e)),null!==(e=u(e))&&o.delete(e)},y):0===e?function(){return o.delete("data")}:function(t){return h&&(t=h(arguments)[0]),o.delete(t)},t=w(function(){var t=arguments;return 0===e?d.data:(h&&(t=h(t)),t=u?u(t):String(t[0]),d[t])}),y=w(function(){var t=arguments;return 0===e?o.has("data"):(h&&(t=h(t)),null!==(t=u?u(t):String(t[0]))&&o.has(t))}),x(p,{__memoized__:v(!0),delete:v(a),clear:v(o.clear),_get:v(t),_has:v(y)}),o}},function(r,t,e){"use strict";var i=e(200),o=e(525),u=e(37),s=Error.captureStackTrace;r.exports=function(t){var e=new Error(t),n=arguments[1],t=arguments[2];return u(t)||o(n)&&(t=n,n=null),u(t)&&i(e,t),u(n)&&(e.code=n),s&&s(e,r.exports),e}},function(t,e,n){"use strict";t.exports=function(){var t=Object.assign;return"function"==typeof t&&(t(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var u=n(522),s=n(48),a=Math.max;t.exports=function(e,n){var r,t,i,o=a(arguments.length,2);for(e=Object(s(e)),i=function(t){try{e[t]=n[t]}catch(t){r=r||t}},t=1;t<o;++t)u(n=arguments[t]).forEach(i);if(void 0!==r)throw r;return e}},function(t,e,n){"use strict";t.exports=n(523)()?Object.keys:n(524)},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(37),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";var r=n(37),i={function:!0,object:!0};t.exports=function(t){return r(t)&&i[typeof t]||!1}},function(t,e,n){"use strict";var r=n(527),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},function(t,e,n){"use strict";var r=n(528);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}},function(t,e,n){"use strict";var r=n(529);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(203),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},function(t,e,n){"use strict";t.exports=n(531)()?String.prototype.contains:n(532)},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return-1<r.call(this,t,arguments[1])}},function(t,e,n){"use strict";var i,o,r,u=n(40),s=n(31),a=Function.prototype.apply,c=Function.prototype.call,f=Object.create,l=Object.defineProperty,p=Object.defineProperties,h=Object.prototype.hasOwnProperty,d={configurable:!0,enumerable:!1,writable:!0},y=function(t,e){var n,r;return s(e),r=this,i.call(this,t,n=function(){o.call(r,t,n),a.call(e,this,arguments)}),n.__eeOnceListener__=e,this},n={on:i=function(t,e){var n;return s(e),h.call(this,"__ee__")?n=this.__ee__:(n=d.value=f(null),l(this,"__ee__",d),d.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:y,off:o=function(t,e){var n,r,i,o;if(s(e),!h.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:r=function(t){var e,n,r,i,o;if(h.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)a.call(r,this,o)}else switch(arguments.length){case 1:c.call(i,this);break;case 2:c.call(i,this,arguments[1]);break;case 3:c.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];a.call(i,this,o)}}},g={on:u(i),once:u(y),off:u(o),emit:u(r)},w=p({},g);t.exports=e=function(t){return null==t?f(w):p(Object(t),g)},e.methods=n},function(t,e,n){"use strict";var r=n(535),i=n(37),o=n(31),u=Array.prototype.slice,s=function(n){return this.map(function(t,e){return t?t(n[e]):n[e]}).concat(u.call(n,this.length))};t.exports=function(t){return(t=r(t)).forEach(function(t){i(t)&&o(t)}),s.bind(t)}},function(t,e,n){"use strict";var r=n(137),i=Array.isArray;t.exports=function(t){return i(t)?t:r(t)}},function(t,e,n){"use strict";t.exports=function(){var t,e=Array.from;return"function"==typeof e&&(e=e(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){"use strict";var h=n(538).iterator,d=n(547),y=n(548),g=n(38),w=n(31),v=n(48),M=n(37),_=n(549),L=Array.isArray,m=Function.prototype.call,j={configurable:!0,enumerable:!0,writable:!0,value:null},x=Object.defineProperty;t.exports=function(t){var e,n,r,i,o,u,s,a,c,f,l=arguments[1],p=arguments[2];if(t=Object(v(t)),M(l)&&w(l),this&&this!==Array&&y(this))e=this;else{if(!l){if(d(t))return 1!==(o=t.length)?Array.apply(null,t):((i=new Array(1))[0]=t[0],i);if(L(t)){for(i=new Array(o=t.length),n=0;n<o;++n)i[n]=t[n];return i}}i=[]}if(!L(t))if(void 0!==(c=t[h])){for(s=w(c).call(t),e&&(i=new e),a=s.next(),n=0;!a.done;)f=l?m.call(l,p,a.value,n):a.value,e?(j.value=f,x(i,n,j)):i[n]=f,a=s.next(),++n;o=n}else if(_(t)){for(o=t.length,e&&(i=new e),r=n=0;n<o;++n)f=t[n],n+1<o&&55296<=(u=f.charCodeAt(0))&&u<=56319&&(f+=t[++n]),f=l?m.call(l,p,f,r):f,e?(j.value=f,x(i,r,j)):i[r]=f,++r;o=r}if(void 0===o)for(o=g(t.length),e&&(i=new e(o)),n=0;n<o;++n)f=l?m.call(l,p,t[n],n):t[n],e?(j.value=f,x(i,n,j)):i[n]=f;return e&&(j.value=null,i.length=o),i}},function(t,e,n){"use strict";t.exports=n(539)()?n(95).Symbol:n(542)},function(t,e,n){"use strict";var r=n(95),i={object:!0,symbol:!0};t.exports=function(){var t,e=r.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag]}},function(t,e,n){"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},function(t,e){function n(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")}t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},function(t,e,n){"use strict";var r,i,o,u=n(40),s=n(204),a=n(95).Symbol,c=n(544),f=n(545),l=n(546),p=Object.create,h=Object.defineProperties,n=Object.defineProperty;if("function"==typeof a)try{String(a()),o=!0}catch(t){}else a=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return r(t)},t.exports=r=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return o?a(e):(n=p(i.prototype),e=void 0===e?"":String(e),h(n,{__description__:u("",e),__name__:u("",c(e))}))},f(r),l(r),h(i.prototype,{constructor:u(r),toString:u("",function(){return this.__name__})}),h(r.prototype,{toString:u(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:u(function(){return s(this)})}),n(r.prototype,r.toPrimitive,u("",function(){var t=s(this);return"symbol"==typeof t?t:t.toString()})),n(r.prototype,r.toStringTag,u("c","Symbol")),n(i.prototype,r.toStringTag,u("c",r.prototype[r.toStringTag])),n(i.prototype,r.toPrimitive,u("c",r.prototype[r.toPrimitive]))},function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},function(t,e,n){"use strict";var i=n(40),n=Object.create,o=Object.defineProperty,u=Object.prototype,s=n(null);t.exports=function(t){for(var e,n,r=0;s[t+(r||"")];)++r;return s[t+=r||""]=!0,o(u,e="@@"+t,i.gs(null,function(t){n||(n=!0,o(this,e,i(t)),n=!1)})),e}},function(t,e,n){"use strict";var r=n(40),i=n(95).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",i&&i.hasInstance||t("hasInstance")),isConcatSpreadable:r("",i&&i.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",i&&i.iterator||t("iterator")),match:r("",i&&i.match||t("match")),replace:r("",i&&i.replace||t("replace")),search:r("",i&&i.search||t("search")),species:r("",i&&i.species||t("species")),split:r("",i&&i.split||t("split")),toPrimitive:r("",i&&i.toPrimitive||t("toPrimitive")),toStringTag:r("",i&&i.toStringTag||t("toStringTag")),unscopables:r("",i&&i.unscopables||t("unscopables"))})}},function(t,e,n){"use strict";var r=n(40),i=n(204),o=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:r(function(t){return o[t]||(o[t]=e(String(t)))}),keyFor:r(function(t){for(var e in i(t),o)if(o[e]===t)return e})})}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(t){return"function"==typeof t&&i(r.call(t))}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===i)||!1}},function(t,e,n){"use strict";var r=n(31);t.exports=function(t){var e;return"function"==typeof t?{set:t,get:t}:(e={get:r(t.get)},void 0!==t.set?(e.set=r(t.set),t.delete&&(e.delete=r(t.delete)),t.clear&&(e.clear=r(t.clear))):e.set=e.get,e)}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=t.length;if(!r)return"";for(e=String(t[n=0]);--r;)e+=""+t[++n];return e}},function(t,e,n){"use strict";t.exports=function(i){return i?function(t){for(var e=String(t[0]),n=0,r=i;--r;)e+=""+t[++n];return e}:function(){return""}}},function(t,e,n){"use strict";var c=n(138),r=Object.create;t.exports=function(){var o=0,s=[],a=r(null);return{get:function(t){var e,n=0,r=s,i=t.length;if(0===i)return r[i]||null;if(r=r[i]){for(;n<i-1;){if(-1===(e=c.call(r[0],t[n])))return null;r=r[1][e],++n}return-1!==(e=c.call(r[0],t[n]))&&r[1][e]||null}return null},set:function(t){var e,n=0,r=s,i=t.length;if(0===i)r[i]=++o;else{for(r[i]||(r[i]=[[],[]]),r=r[i];n<i-1;)-1===(e=c.call(r[0],t[n]))&&(e=r[0].push(t[n])-1,r[1].push([[],[]])),r=r[1][e],++n;-1===(e=c.call(r[0],t[n]))&&(e=r[0].push(t[n])-1),r[1][e]=++o}return a[o]=t,o},delete:function(t){var e,n=0,r=s,i=a[t],o=i.length,u=[];if(0===o)delete r[o];else if(r=r[o]){for(;n<o-1;){if(-1===(e=c.call(r[0],i[n])))return;u.push(r,e),r=r[1][e],++n}if(-1===(e=c.call(r[0],i[n])))return;for(t=r[1][e],r[0].splice(e,1),r[1].splice(e,1);!r[0].length&&u.length;)e=u.pop(),(r=u.pop())[0].splice(e,1),r[1].splice(e,1)}delete a[t]},clear:function(){s=[],a=r(null)}}}},function(t,e,n){"use strict";t.exports=n(555)()?Number.isNaN:n(556)},function(t,e,n){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&!t({})&&t(NaN)&&!t(34)}},function(t,e,n){"use strict";t.exports=function(t){return t!=t}},function(t,e,n){"use strict";var i=n(138);t.exports=function(){var e=0,n=[],r=[];return{get:function(t){t=i.call(n,t[0]);return-1===t?null:r[t]},set:function(t){return n.push(t[0]),r.push(++e),e},delete:function(t){t=i.call(r,t);-1!==t&&(n.splice(t,1),r.splice(t,1))},clear:function(){n=[],r=[]}}}},function(t,e,n){"use strict";var c=n(138),r=Object.create;t.exports=function(u){var i=0,s=[[],[]],a=r(null);return{get:function(t){for(var e,n=0,r=s;n<u-1;){if(-1===(e=c.call(r[0],t[n])))return null;r=r[1][e],++n}return-1!==(e=c.call(r[0],t[n]))&&r[1][e]||null},set:function(t){for(var e,n=0,r=s;n<u-1;)-1===(e=c.call(r[0],t[n]))&&(e=r[0].push(t[n])-1,r[1].push([[],[]])),r=r[1][e],++n;return-1===(e=c.call(r[0],t[n]))&&(e=r[0].push(t[n])-1),r[1][e]=++i,a[i]=t,i},delete:function(t){for(var e,n=0,r=s,i=[],o=a[t];n<u-1;){if(-1===(e=c.call(r[0],o[n])))return;i.push(r,e),r=r[1][e],++n}if(-1!==(e=c.call(r[0],o[n]))){for(t=r[1][e],r[0].splice(e,1),r[1].splice(e,1);!r[0].length&&i.length;)e=i.pop(),(r=i.pop())[0].splice(e,1),r[1].splice(e,1);delete a[t]}},clear:function(){s=[[],[]],a=r(null)}}}},function(t,e,n){"use strict";var p=n(137),i=n(205),h=n(202),d=n(201),y=n(139),g=Array.prototype.slice,w=Function.prototype.apply,v=Object.create;n(39).async=function(t,u){var s,a,c,f=v(null),l=v(null),o=u.memoized,r=u.original;u.memoized=d(function(t){var e=arguments,n=e[e.length-1];return"function"==typeof n&&(s=n,e=g.call(e,0,-1)),o.apply(a=this,c=e)},o);try{h(u.memoized,o)}catch(t){}u.on("get",function(e){var n,r,i;if(s){if(f[e])return"function"==typeof f[e]?f[e]=[f[e],s]:f[e].push(s),void(s=null);n=s,r=a,i=c,s=a=c=null,y(function(){var t;hasOwnProperty.call(l,e)?(t=l[e],u.emit("getasync",e,i,r),w.call(n,t.context,t.args)):(s=n,a=r,c=i,o.apply(r,i))})}}),u.original=function(){var t,e,n,o;return s?(t=p(arguments),e=function t(e){var n,r,i=t.id;if(null!=i){if(delete t.id,n=f[i],delete f[i],n)return r=p(arguments),u.has(i)&&(e?u.delete(i):(l[i]={context:this,args:r},u.emit("setasync",i,"function"==typeof n?1:n.length))),"function"==typeof n?o=w.call(n,this,r):n.forEach(function(t){o=w.call(t,this,r)},this),o}else y(w.bind(t,this,arguments))},n=s,s=a=c=null,t.push(e),o=w.call(r,this,t),e.cb=n,s=e,o):w.call(r,this,arguments)},u.on("set",function(t){s?(f[t]?"function"==typeof f[t]?f[t]=[f[t],s.cb]:f[t].push(s.cb):f[t]=s.cb,delete s.cb,s.id=t,s=null):u.delete(t)}),u.on("delete",function(t){var e;hasOwnProperty.call(f,t)||l[t]&&(e=l[t],delete l[t],u.emit("deleteasync",t,g.call(e.args,1)))}),u.on("clear",function(){var t=l;l=v(null),u.emit("clearasync",i(t,function(t){return g.call(t.args,1)}))})}},function(t,e,n){"use strict";var r=n(205),i=n(561),o=n(562),u=n(564),h=n(207),d=n(139),s=Object.create,y=i("then","then:finally","done","done:finally");n(39).promise=function(a,c){var f=s(null),l=s(null),p=s(null);if(!0===a)a=null;else if(a=o(a),!y[a])throw new TypeError("'"+u(a)+"' is not valid promise mode");c.on("set",function(n,t,e){var r=!1;if(!h(e))return l[n]=e,void c.emit("setasync",n,1);f[n]=1,p[n]=e;function i(t){var e=f[n];if(r)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");e&&(delete f[n],l[n]=t,c.emit("setasync",n,e))}function o(){r=!0,f[n]&&(delete f[n],delete p[n],c.delete(n))}var u=a;if("then"===(u=u||"then")){var s=function(){d(o)};"function"==typeof(e=e.then(function(t){d(i.bind(this,t))},s)).finally&&e.finally(s)}else if("done"===u){if("function"!=typeof e.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");e.done(i,o)}else if("done:finally"===u){if("function"!=typeof e.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof e.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");e.done(i),e.finally(o)}}),c.on("get",function(t,e,n){var r,i;f[t]?++f[t]:(r=p[t],i=function(){c.emit("getasync",t,e,n)},h(r)?"function"==typeof r.done?r.done(i):r.then(function(){d(i)}):i())}),c.on("delete",function(t){var e;delete p[t],f[t]?delete f[t]:hasOwnProperty.call(l,t)&&(e=l[t],delete l[t],c.emit("deleteasync",t,[e]))}),c.on("clear",function(){var t=l;l=s(null),f=s(null),p=s(null),c.emit("clearasync",r(t,function(t){return[t]}))})}},function(t,e,n){"use strict";var r=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return r.call(arguments,function(t){e[t]=!0}),e}},function(t,e,n){"use strict";var r=n(48),i=n(563);t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";var r=n(206);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){throw new TypeError("Passed argument cannot be stringifed")}}},function(t,e,n){"use strict";var r=n(565),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){t=r(t);return(t=100<t.length?t.slice(0,99)+"…":t).replace(i,function(t){return JSON.stringify(t).slice(1,-1)})}},function(t,e,n){"use strict";var r=n(206);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){return"<Non-coercible to string value>"}}},function(t,e,n){"use strict";var i=n(31),o=n(94),u=n(39),s=Function.prototype.apply;u.dispose=function(n,t,e){var r;if(i(n),e.async&&u.async||e.promise&&u.promise)return t.on("deleteasync",r=function(t,e){s.call(n,null,e)}),void t.on("clearasync",function(t){o(t,function(t,e){r(e,t)})});t.on("delete",r=function(t,e){n(e)}),t.on("clear",function(t){o(t,function(t,e){r(e,t)})})}},function(t,e,n){"use strict";var s=n(137),a=n(94),c=n(139),f=n(207),l=n(568),p=n(39),h=Function.prototype,d=Math.max,y=Math.min,g=Object.create;p.maxAge=function(e,i,o){var n,t,r,u;(e=l(e))&&(n=g(null),t=o.async&&p.async||o.promise&&p.promise?"async":"",i.on("set"+t,function(t){n[t]=setTimeout(function(){i.delete(t)},e),"function"==typeof n[t].unref&&n[t].unref(),u&&(u[t]&&"nextTick"!==u[t]&&clearTimeout(u[t]),u[t]=setTimeout(function(){delete u[t]},r),"function"==typeof u[t].unref&&u[t].unref())}),i.on("delete"+t,function(t){clearTimeout(n[t]),delete n[t],u&&("nextTick"!==u[t]&&clearTimeout(u[t]),delete u[t])}),o.preFetch&&(r=!0===o.preFetch||isNaN(o.preFetch)?.333:d(y(Number(o.preFetch),1),0))&&(u={},r=(1-r)*e,i.on("get"+t,function(e,n,r){u[e]||(u[e]="nextTick",c(function(){var t;"nextTick"===u[e]&&(delete u[e],i.delete(e),o.async&&(n=s(n)).push(h),t=i.memoized.apply(r,n),o.promise&&f(t)&&("function"==typeof t.done?t.done(h,h):t.then(h,h)))}))})),i.on("clear"+t,function(){a(n,function(t){clearTimeout(t)}),n={},u&&(a(u,function(t){"nextTick"!==t&&clearTimeout(t)}),u={})}))}},function(t,e,n){"use strict";var r=n(38),i=n(569);t.exports=function(t){if((t=r(t))>i)throw new TypeError(t+" exceeds maximum possible timeout");return t}},function(t,e,n){"use strict";t.exports=2147483647},function(t,e,n){"use strict";var i=n(38),o=n(571),u=n(39);u.max=function(t,e,n){var r;(t=i(t))&&(r=o(t),t=n.async&&u.async||n.promise&&u.promise?"async":"",e.on("set"+t,n=function(t){void 0!==(t=r.hit(t))&&e.delete(t)}),e.on("get"+t,n),e.on("delete"+t,r.delete),e.on("clear"+t,r.clear))}},function(t,e,n){"use strict";var f=n(38),l=Object.create,p=Object.prototype.hasOwnProperty;t.exports=function(r){var i,o=0,u=1,s=l(null),a=l(null),c=0;return r=f(r),{hit:function(t){var e=a[t],n=++c;if(s[n]=t,a[t]=n,!e)return++o<=r?void 0:(t=s[u],i(t),t);if(delete s[e],u===e)for(;!p.call(s,++u);)continue},delete:i=function(t){var e=a[t];if(e&&(delete s[e],delete a[t],--o,u===e)){if(!o)return c=0,void(u=1);for(;!p.call(s,++u);)continue}},clear:function(){o=0,u=1,s=l(null),a=l(null),c=0}}}},function(t,e,n){"use strict";var i=n(40),o=n(39),u=Object.create,s=Object.defineProperties;o.refCounter=function(t,e,n){var r=u(null),n=n.async&&o.async||n.promise&&o.promise?"async":"";e.on("set"+n,function(t,e){r[t]=e||1}),e.on("get"+n,function(t){++r[t]}),e.on("delete"+n,function(t){delete r[t]}),e.on("clear"+n,function(){r={}}),s(e.memoized,{deleteRef:i(function(){var t=e.get(arguments);return null!==t&&r[t]?!--r[t]&&(e.delete(t),!0):null}),getRefCount:i(function(){var t=e.get(arguments);return null!==t&&r[t]||0})})}},function(t,e,n){var r=n(16),i=n(49),o=n(17).Buffer,d=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,i.call(this,64,56)}r(s,i),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,u=0|this._e,s=0;s<16;++s)e[s]=t.readInt32BE(4*s);for(;s<80;++s)e[s]=e[s-3]^e[s-8]^e[s-14]^e[s-16];for(var a,c,f,l,p=0;p<80;++p)var h=~~(p/20),h=0|(n<<5|n>>>27)+(c=r,f=i,l=o,0===(a=h)?c&f|~c&l:2===a?c&f|c&l|f&l:c^f^l)+u+e[p]+d[h],u=o,o=i,i=r<<30|r>>>2,r=n,n=h;this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0},s.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=s},function(t,e,n){var r=n(16),i=n(49),o=n(17).Buffer,y=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,i.call(this,64,56)}r(s,i),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,u=0|this._d,s=0|this._e,a=0;a<16;++a)n[a]=t.readInt32BE(4*a);for(;a<80;++a)n[a]=(e=n[a-3]^n[a-8]^n[a-14]^n[a-16])<<1|e>>>31;for(var c,f,l,p,h=0;h<80;++h)var d=~~(h/20),d=0|(r<<5|r>>>27)+(f=i,l=o,p=u,0===(c=d)?f&l|~f&p:2===c?f&l|f&p|l&p:f^l^p)+s+n[h]+y[d],s=u,u=o,o=i<<30|i>>>2,i=r,r=d;this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=s},function(t,e,n){var r=n(16),i=n(208),o=n(49),u=n(17).Buffer,s=new Array(64);function a(){this.init(),this._w=s,o.call(this,64,56)}r(a,i),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var t=u.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=a},function(t,e,n){var r=n(16),i=n(209),o=n(49),u=n(17).Buffer,s=new Array(160);function a(){this.init(),this._w=s,o.call(this,128,112)}r(a,i),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var r=u.allocUnsafe(48);function t(t,e,n){r.writeInt32BE(t,n),r.writeInt32BE(e,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),r},t.exports=a},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"UPDATE_CONFIGS",function(){return x}),n.d(r,"TOGGLE_CONFIGS",function(){return b}),n.d(r,"update",function(){return N}),n.d(r,"toggle",function(){return S}),n.d(r,"loaded",function(){return D});var i={};n.r(i),n.d(i,"downloadConfig",function(){return I}),n.d(i,"getConfigByUrl",function(){return A});var o={};n.r(o),n.d(o,"get",function(){return T});function u(t,e){try{return j.a.load(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}}var s=n(96),a=n.n(s),s=n(97),c=n.n(s),s=n(98),f=n.n(s),s=n(99),l=n.n(s),p=n(2),h=n.n(p),d=(n(167),function(t){f()(n,t);var e=l()(n);function n(){return a()(this,n),e.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var t=this.props.getComponent,e=t("Container"),n=t("Row"),r=t("Col"),i=t("Topbar",!0),o=t("BaseLayout",!0),t=t("onlineValidatorBadge",!0);return h.a.createElement(e,{className:"swagger-ui"},i?h.a.createElement(i,null):null,h.a.createElement(o,null),h.a.createElement(n,null,h.a.createElement(r,null,h.a.createElement(t,null))))}}]),n}(h.a.Component)),s=n(25),y=n.n(s),s=n(15),g=n.n(s),s=n(3),w=n.n(s),s=n(9),v=n.n(s),s=n(11),M=n.n(s),s=n(210),_=n.n(s),L=n(12),m=function(t){f()(i,t);var n=l()(i);function i(t,e){var r;return a()(this,i),r=n.call(this,t,e),g()(y()(r),"onUrlChange",function(t){t=t.target.value;r.setState({url:t})}),g()(y()(r),"loadSpec",function(t){r.flushAuthData(),r.props.specActions.updateUrl(t),r.props.specActions.download(t)}),g()(y()(r),"onUrlSelect",function(t){var e=t.target.value||t.target.href;r.loadSpec(e),r.setSelectedUrl(e),t.preventDefault()}),g()(y()(r),"downloadUrl",function(t){r.loadSpec(r.state.url),t.preventDefault()}),g()(y()(r),"setSearch",function(t){var e=Object(L.e)();e["urls.primaryName"]=t.name;var t=w()(t=w()(t="".concat(window.location.protocol,"//")).call(t,window.location.host)).call(t,window.location.pathname);window&&window.history&&window.history.pushState&&window.history.replaceState(null,"",w()(t="".concat(t,"?")).call(t,Object(L.f)(e)))}),g()(y()(r),"setSelectedUrl",function(n){var t=r.props.getConfigs().urls||[];t&&t.length&&n&&v()(t).call(t,function(t,e){t.url===n&&(r.setState({selectedIndex:e}),r.setSearch(t))})}),g()(y()(r),"onFilterChange",function(t){t=t.target.value;r.props.layoutActions.updateFilter(t)}),r.state={url:t.specSelectors.url(),selectedIndex:0},r}return c()(i,[{key:"UNSAFE_componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"flushAuthData",value:function(){this.props.getConfigs().persistAuthorization||this.props.authActions.restoreAuthorization({authorized:{}})}},{key:"componentDidMount",value:function(){var n,r,i=this,t=this.props.getConfigs(),e=t.urls||[];e&&e.length&&(n=this.state.selectedIndex,(r=t["urls.primaryName"])&&v()(e).call(e,function(t,e){t.name===r&&(i.setState({selectedIndex:e}),n=e)}),this.loadSpec(e[n].url))}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),u="loading"===n.loadingStatus(),t=["download-url-input"];"failed"===n.loadingStatus()&&t.push("failed"),u&&t.push("loading");var s,e=r().urls,n=[],r=null;return e?(s=[],v()(e).call(e,function(t,e){s.push(h.a.createElement("option",{key:e,value:t.url},t.name))}),n.push(h.a.createElement("label",{className:"select-label",htmlFor:"select"},h.a.createElement("span",null,"Select a definition"),h.a.createElement("select",{id:"select",disabled:u,onChange:this.onUrlSelect,value:e[this.state.selectedIndex].url},s)))):(r=this.downloadUrl,n.push(h.a.createElement("input",{className:t.join(" "),type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:u})),n.push(h.a.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"))),h.a.createElement("div",{className:"topbar"},h.a.createElement("div",{className:"wrapper"},h.a.createElement("div",{className:"topbar-wrapper"},h.a.createElement(o,null,h.a.createElement("img",{height:"40",src:_.a,alt:"Swagger UI"})),h.a.createElement("form",{className:"download-url-wrapper",onSubmit:r},M()(n).call(n,function(t,e){return Object(p.cloneElement)(t,{key:e})})))))}}]),i}(h.a.Component),j=n(70),x="configs_update",b="configs_toggle";function N(t,e){return{type:x,payload:g()({},t,e)}}function S(t){return{type:b,payload:t}}var D=function(){return function(t){var e=t.getConfigs,t=t.authActions;!e().persistAuthorization||(e=localStorage.getItem("authorized"))&&t.restoreAuthorization({authorized:JSON.parse(e)})}},I=function(e){return function(t){return(0,t.fn.fetch)(e)}},A=function(r,i){return function(t){var e=t.specActions;if(r)return e.downloadConfig(r).then(n,n);function n(t){t instanceof Error||400<=t.status?(e.updateLoadingStatus("failedConfig"),e.updateLoadingStatus("failedConfig"),e.updateUrl(""),console.error(t.statusText+" "+r.url),i(null)):i(u(t.text))}}},s=n(5),O=n.n(s),T=function(t,e){return t.getIn(O()(e)?e:[e])},C=n(0),E=(n={},g()(n,x,function(t,e){return t.merge(Object(C.fromJS)(e.payload))}),g()(n,b,function(t,e){var n=e.payload,e=t.get(n);return t.set(n,!e)}),n),z={getLocalConfig:function(){return u('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};e.default=[function(){return{components:{Topbar:m}}},function(){return{statePlugins:{spec:{actions:i,selectors:z},configs:{reducers:E,actions:r,selectors:o}}}},function(){return{components:{StandaloneLayout:d}}}]}],r={},i.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist",i(i.s=224).default;function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var n,r});
examples/todomvc/index.js
bkniffler/redux-devtools
import React from 'react'; import App from './containers/App'; import 'todomvc-app-css/index.css'; React.render( <App />, document.getElementById('root') );
test/fixtures/memo/actual.js
layershifter/babel-plugin-transform-react-handled-props
import PropTypes from 'prop-types'; import React from 'react'; function Example() { return <div />; } Example.defaultProps = { active: true }; Example.propTypes = { children: PropTypes.node, className: PropTypes.string }; export default React.memo(Example);
src/containers/WorldPage/AddLocationDialog.js
ReactPoland/react-community
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import _isEmpty from 'lodash/isEmpty'; import _startsWith from 'lodash/startsWith'; import AddLocationForm from './AddLocationForm'; const getInitialState = () => ({ formData: { name: '', link: 'http://', description: '', location: {} }, validationErrors: { name: '', link: '', description: '', location: '' } }); class AddLocationDialog extends Component { static propTypes = { popupVisible: PropTypes.bool.isRequired, addMarker: PropTypes.func.isRequired, closePopup: PropTypes.func.isRequired, addingMarker: PropTypes.bool.isRequired, markerAdded: PropTypes.bool.isRequired } state = getInitialState() componentWillReceiveProps(nextProps) { // If we successfully got a new marker, close the dialog window if (!this.props.markerAdded && nextProps.markerAdded) { this.closePopup(); } } updateForm = (property, value) => { const newState = { ...this.state }; newState.formData[property] = value; // Hide existing validation error if (newState.validationErrors[property] && value) { newState.validationErrors[property] = ''; } this.setState(newState); } // Passes marker data to parent component if form is valid // and no request is pending addMarker = () => { if (this.validateForm() && !this.props.addingMarker) { this.props.addMarker(this.state.formData); } } // Clears state and closes dialog window closePopup = () => { this.setState(getInitialState()); this.props.closePopup(); } validateForm = () => { const { name, link, description, location } = this.state.formData; const validationErrors = {}; if (!name) validationErrors.name = 'Name is required'; if (!link || link === 'http://') validationErrors.link = 'Link is required'; if (!(_startsWith(link, 'http://') || _startsWith(link, 'https://'))) validationErrors.link = 'Link must start with "http://"'; if (!description) validationErrors.description = 'Description is required'; if (!location.description) validationErrors.location = 'Location is required'; this.setState({ validationErrors }); return _isEmpty(validationErrors); } render() { const { popupVisible, addingMarker } = this.props; const { formData, validationErrors } = this.state; const actions = [ <FlatButton label="Cancel" primary onTouchTap={this.closePopup} />, <FlatButton label={addingMarker ? 'Adding...' : 'Add'} style={{ marginLeft: 8 }} primary onTouchTap={this.addMarker} disabled={addingMarker} /> ]; return ( <Dialog contentStyle={{ maxWidth: 500 }} titleStyle={{ paddingBottom: 0 }} title="Add your location" actions={actions} open={popupVisible} onRequestClose={this.closePopup} autoScrollBodyContent > <AddLocationForm formData={formData} validationErrors={validationErrors} onChange={this.updateForm} /> </Dialog> ); } } export default AddLocationDialog;
packager/react-packager/src/Server/index.js
mrngoitall/react-native
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict'; const Activity = require('../Activity'); const AssetServer = require('../AssetServer'); const FileWatcher = require('../FileWatcher'); const Bundler = require('../Bundler'); const Promise = require('promise'); const _ = require('underscore'); const declareOpts = require('../lib/declareOpts'); const path = require('path'); const url = require('url'); const validateOpts = declareOpts({ projectRoots: { type: 'array', required: true, }, blacklistRE: { type: 'object', // typeof regex is object }, moduleFormat: { type: 'string', default: 'haste', }, polyfillModuleNames: { type: 'array', default: [], }, cacheVersion: { type: 'string', default: '1.0', }, resetCache: { type: 'boolean', default: false, }, transformModulePath: { type:'string', required: false, }, nonPersistent: { type: 'boolean', default: false, }, assetRoots: { type: 'array', required: false, }, assetExts: { type: 'array', default: ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp'], }, transformTimeoutInterval: { type: 'number', required: false, }, }); const bundleOpts = declareOpts({ sourceMapUrl: { type: 'string', required: false, }, entryFile: { type: 'string', required: true, }, dev: { type: 'boolean', default: true, }, minify: { type: 'boolean', default: false, }, runModule: { type: 'boolean', default: true, }, inlineSourceMap: { type: 'boolean', default: false, }, platform: { type: 'string', required: true, } }); const dependencyOpts = declareOpts({ platform: { type: 'string', required: true, }, dev: { type: 'boolean', default: true, }, entryFile: { type: 'string', required: true, }, }); class Server { constructor(options) { const opts = validateOpts(options); this._projectRoots = opts.projectRoots; this._bundles = Object.create(null); this._changeWatchers = []; const assetGlobs = opts.assetExts.map(ext => '**/*.' + ext); var watchRootConfigs = opts.projectRoots.map(dir => { return { dir: dir, globs: [ '**/*.js', '**/*.json', ].concat(assetGlobs), }; }); if (opts.assetRoots != null) { watchRootConfigs = watchRootConfigs.concat( opts.assetRoots.map(dir => { return { dir: dir, globs: assetGlobs, }; }) ); } this._fileWatcher = options.nonPersistent ? FileWatcher.createDummyWatcher() : new FileWatcher(watchRootConfigs); this._assetServer = new AssetServer({ projectRoots: opts.projectRoots, assetExts: opts.assetExts, }); const bundlerOpts = Object.create(opts); bundlerOpts.fileWatcher = this._fileWatcher; bundlerOpts.assetServer = this._assetServer; this._bundler = new Bundler(bundlerOpts); this._fileWatcher.on('all', this._onFileChange.bind(this)); this._debouncedFileChangeHandler = _.debounce(filePath => { this._rebuildBundles(filePath); this._informChangeWatchers(); }, 50); } end() { Promise.all([ this._fileWatcher.end(), this._bundler.kill(), ]); } buildBundle(options) { return Promise.resolve().then(() => { const opts = bundleOpts(options); return this._bundler.bundle( opts.entryFile, opts.runModule, opts.sourceMapUrl, opts.dev, opts.platform ); }); } buildBundleFromUrl(reqUrl) { const options = this._getOptionsFromUrl(reqUrl); return this.buildBundle(options); } getDependencies(options) { return Promise.resolve().then(() => { const opts = dependencyOpts(options); return this._bundler.getDependencies( opts.entryFile, opts.dev, opts.platform, ); }); } getOrderedDependencyPaths(options) { return Promise.resolve().then(() => { const opts = dependencyOpts(options); return this._bundler.getOrderedDependencyPaths(opts); }); } _onFileChange(type, filepath, root) { const absPath = path.join(root, filepath); this._bundler.invalidateFile(absPath); // Make sure the file watcher event runs through the system before // we rebuild the bundles. this._debouncedFileChangeHandler(absPath); } _rebuildBundles() { const buildBundle = this.buildBundle.bind(this); const bundles = this._bundles; Object.keys(bundles).forEach(function(optionsJson) { const options = JSON.parse(optionsJson); // Wait for a previous build (if exists) to finish. bundles[optionsJson] = (bundles[optionsJson] || Promise.resolve()).finally(function() { // With finally promise callback we can't change the state of the promise // so we need to reassign the promise. bundles[optionsJson] = buildBundle(options).then(function(p) { // Make a throwaway call to getSource to cache the source string. p.getSource({ inlineSourceMap: options.inlineSourceMap, minify: options.minify, }); return p; }); }); return bundles[optionsJson]; }); } _informChangeWatchers() { const watchers = this._changeWatchers; const headers = { 'Content-Type': 'application/json; charset=UTF-8', }; watchers.forEach(function(w) { w.res.writeHead(205, headers); w.res.end(JSON.stringify({ changed: true })); }); this._changeWatchers = []; } _processDebugRequest(reqUrl, res) { var ret = '<!doctype html>'; const pathname = url.parse(reqUrl).pathname; const parts = pathname.split('/').filter(Boolean); if (parts.length === 1) { ret += '<div><a href="/debug/bundles">Cached Bundles</a></div>'; ret += '<div><a href="/debug/graph">Dependency Graph</a></div>'; res.end(ret); } else if (parts[1] === 'bundles') { ret += '<h1> Cached Bundles </h1>'; Promise.all(Object.keys(this._bundles).map(optionsJson => this._bundles[optionsJson].then(p => { ret += '<div><h2>' + optionsJson + '</h2>'; ret += p.getDebugInfo(); }) )).then( () => res.end(ret), e => { res.writeHead(500); res.end('Internal Error'); console.log(e.stack); } ); } else if (parts[1] === 'graph'){ ret += '<h1> Dependency Graph </h2>'; ret += this._bundler.getGraphDebugInfo(); res.end(ret); } else { res.writeHead('404'); res.end('Invalid debug request'); return; } } _processOnChangeRequest(req, res) { const watchers = this._changeWatchers; watchers.push({ req: req, res: res, }); req.on('close', () => { for (let i = 0; i < watchers.length; i++) { if (watchers[i] && watchers[i].req === req) { watchers.splice(i, 1); break; } } }); } _processAssetsRequest(req, res) { const urlObj = url.parse(req.url, true); const assetPath = urlObj.pathname.match(/^\/assets\/(.+)$/); const assetEvent = Activity.startEvent(`processing asset request ${assetPath[1]}`); this._assetServer.get(assetPath[1], urlObj.query.platform) .then( data => res.end(data), error => { console.error(error.stack); res.writeHead('404'); res.end('Asset not found'); } ).done(() => Activity.endEvent(assetEvent)); } processRequest(req, res, next) { const urlObj = url.parse(req.url, true); var pathname = urlObj.pathname; var requestType; if (pathname.match(/\.bundle$/)) { requestType = 'bundle'; } else if (pathname.match(/\.map$/)) { requestType = 'map'; } else if (pathname.match(/\.assets$/)) { requestType = 'assets'; } else if (pathname.match(/^\/debug/)) { this._processDebugRequest(req.url, res); return; } else if (pathname.match(/^\/onchange\/?$/)) { this._processOnChangeRequest(req, res); return; } else if (pathname.match(/^\/assets\//)) { this._processAssetsRequest(req, res); return; } else { next(); return; } const startReqEventId = Activity.startEvent('request:' + req.url); const options = this._getOptionsFromUrl(req.url); const optionsJson = JSON.stringify(options); const building = this._bundles[optionsJson] || this.buildBundle(options); this._bundles[optionsJson] = building; building.then( p => { if (requestType === 'bundle') { var bundleSource = p.getSource({ inlineSourceMap: options.inlineSourceMap, minify: options.minify, }); res.setHeader('Content-Type', 'application/javascript'); res.end(bundleSource); Activity.endEvent(startReqEventId); } else if (requestType === 'map') { var sourceMap = p.getSourceMap({ minify: options.minify, }); if (typeof sourceMap !== 'string') { sourceMap = JSON.stringify(sourceMap); } res.setHeader('Content-Type', 'application/json'); res.end(sourceMap); Activity.endEvent(startReqEventId); } else if (requestType === 'assets') { var assetsList = JSON.stringify(p.getAssets()); res.setHeader('Content-Type', 'application/json'); res.end(assetsList); Activity.endEvent(startReqEventId); } }, this._handleError.bind(this, res, optionsJson) ).done(); } _handleError(res, bundleID, error) { res.writeHead(error.status || 500, { 'Content-Type': 'application/json; charset=UTF-8', }); if (error.type === 'TransformError' || error.type === 'NotFoundError' || error.type === 'UnableToResolveError') { error.errors = [{ description: error.description, filename: error.filename, lineNumber: error.lineNumber, }]; res.end(JSON.stringify(error)); if (error.type === 'NotFoundError') { delete this._bundles[bundleID]; } } else { console.error(error.stack || error); res.end(JSON.stringify({ type: 'InternalError', message: 'react-packager has encountered an internal error, ' + 'please check your terminal error output for more details', })); } } _getOptionsFromUrl(reqUrl) { // `true` to parse the query param as an object. const urlObj = url.parse(reqUrl, true); // node v0.11.14 bug see https://github.com/facebook/react-native/issues/218 urlObj.query = urlObj.query || {}; const pathname = decodeURIComponent(urlObj.pathname); // Backwards compatibility. Options used to be as added as '.' to the // entry module name. We can safely remove these options. const entryFile = pathname.replace(/^\//, '').split('.').filter(part => { if (part === 'includeRequire' || part === 'runModule' || part === 'bundle' || part === 'map' || part === 'assets') { return false; } return true; }).join('.') + '.js'; const sourceMapUrlObj = _.clone(urlObj); sourceMapUrlObj.pathname = pathname.replace(/\.bundle$/, '.map'); return { sourceMapUrl: url.format(sourceMapUrlObj), entryFile: entryFile, dev: this._getBoolOptionFromQuery(urlObj.query, 'dev', true), minify: this._getBoolOptionFromQuery(urlObj.query, 'minify'), runModule: this._getBoolOptionFromQuery(urlObj.query, 'runModule', true), inlineSourceMap: this._getBoolOptionFromQuery( urlObj.query, 'inlineSourceMap', false ), platform: urlObj.query.platform, }; } _getBoolOptionFromQuery(query, opt, defaultVal) { if (query[opt] == null && defaultVal != null) { return defaultVal; } return query[opt] === 'true' || query[opt] === '1'; } } module.exports = Server;
src/icons/font/WebIcon.js
skystebnicki/chamel
import React from 'react'; import PropTypes from 'prop-types'; import FontIcon from '../../FontIcon'; import ThemeService from '../../styles/ChamelThemeService'; /** * Web Icon button * * @param props * @param context * @returns {ReactDOM} * @constructor */ const WebIcon = (props, context) => { let theme = context.chamelTheme && context.chamelTheme.fontIcon ? context.chamelTheme.fontIcon : ThemeService.defaultTheme.fontIcon; return ( <FontIcon {...props} className={theme.iconWeb}> {'web'} </FontIcon> ); }; /** * An alternate theme may be passed down by a provider */ WebIcon.contextTypes = { chamelTheme: PropTypes.object, }; export default WebIcon;
7.4.0/examples/remoteSubmit/dist/bundle.js
erikras/redux-form-docs
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=625)}([function(e,t,n){var r=n(2),i=n(22),o=n(14),a=n(15),u=n(23),c=function(e,t,n){var s,l,f,p,d=e&c.F,h=e&c.G,v=e&c.S,y=e&c.P,m=e&c.B,g=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?i:i[t]||(i[t]={}),w=b.prototype||(b.prototype={});h&&(n=t);for(s in n)l=!d&&g&&void 0!==g[s],f=(l?g:n)[s],p=m&&l?u(f,r):y&&"function"==typeof f?u(Function.call,f):f,g&&a(g,s,f,e&c.U),b[s]!=f&&o(b,s,p),y&&w[s]!=f&&(w[s]=f)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(5);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";var r=n(614),i=n(611),o=n(613),a=n(609),u=n(610),c=n(612),s={allowsArrayErrors:!0,empty:{},emptyList:[],getIn:i.a,setIn:o.a,deepEqual:a.a,deleteIn:u.a,forEach:function(e,t){return e.forEach(t)},fromJS:function(e){return e},keys:c.a,size:function(e){return e?e.length:0},some:function(e,t){return e.some(t)},splice:r.a,toJS:function(e){return e}};t.a=s},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(76)("wks"),i=n(48),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){e.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),i=n(148),o=n(30),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(29),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){"use strict";e.exports=n(545)},function(e,t,n){var r=n(27);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=n(529)()},function(e,t,n){var r=n(8),i=n(44);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(2),i=n(14),o=n(17),a=n(48)("src"),u=Function.toString,c=(""+u).split("toString");n(22).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(s&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:u?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(e,t,n){var r=n(0),i=n(4),o=n(27),a=/"/g,u=function(e,t,n,r){var i=String(o(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),u+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(59),i=n(44),o=n(20),a=n(30),u=n(17),c=n(148),s=Object.getOwnPropertyDescriptor;t.f=n(7)?s:function(e,t){if(e=o(e),t=a(t,!0),c)try{return s(e,t)}catch(e){}if(u(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(17),i=n(11),o=n(113)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(58),i=n(27);e.exports=function(e){return r(i(e))}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(12);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){"use strict";var r=Array.isArray;t.a=r},function(e,t,n){var r=n(23),i=n(58),o=n(11),a=n(9),u=n(98);e.exports=function(e,t){var n=1==e,c=2==e,s=3==e,l=4==e,f=6==e,p=5==e||f,d=t||u;return function(t,u,h){for(var v,y,m=o(t),g=i(m),b=r(u,h,3),w=a(g.length),_=0,O=n?d(t,w):c?d(t,0):void 0;w>_;_++)if((p||_ in g)&&(v=g[_],y=b(v,_,m),e))if(n)O[_]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return _;case 2:O.push(v)}else if(l)return!1;return f?-1:s||l?l:O}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(0),i=n(22),o=n(4);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(5);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(186),i="object"==typeof self&&self&&self.Object===Object&&self,o=r.a||i||Function("return this")();t.a=o},function(e,t,n){var r=n(169),i=n(0),o=n(76)("metadata"),a=o.store||(o.store=new(n(172))),u=function(e,t,n){var i=a.get(e);if(!i){if(!n)return;a.set(e,i=new r)}var o=i.get(t);if(!o){if(!n)return;i.set(t,o=new r)}return o},c=function(e,t,n){var r=u(t,n,!1);return void 0!==r&&r.has(e)},s=function(e,t,n){var r=u(t,n,!1);return void 0===r?void 0:r.get(e)},l=function(e,t,n,r){u(n,r,!0).set(e,t)},f=function(e,t){var n=u(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},p=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},d=function(e){i(i.S,"Reflect",e)};e.exports={store:a,map:u,has:c,get:s,set:l,keys:f,key:p,exp:d}},function(e,t,n){"use strict";if(n(7)){var r=n(35),i=n(2),o=n(4),a=n(0),u=n(78),c=n(119),s=n(23),l=n(39),f=n(44),p=n(14),d=n(45),h=n(29),v=n(9),y=n(167),m=n(47),g=n(30),b=n(17),w=n(57),_=n(5),O=n(11),E=n(105),S=n(41),x=n(19),k=n(42).f,j=n(121),C=n(48),P=n(6),T=n(26),R=n(65),A=n(77),F=n(122),I=n(51),N=n(71),M=n(46),U=n(97),D=n(140),V=n(8),L=n(18),W=V.f,z=L.f,q=i.RangeError,B=i.TypeError,H=i.Uint8Array,Y=Array.prototype,$=c.ArrayBuffer,K=c.DataView,G=T(0),Q=T(2),J=T(3),X=T(4),Z=T(5),ee=T(6),te=R(!0),ne=R(!1),re=F.values,ie=F.keys,oe=F.entries,ae=Y.lastIndexOf,ue=Y.reduce,ce=Y.reduceRight,se=Y.join,le=Y.sort,fe=Y.slice,pe=Y.toString,de=Y.toLocaleString,he=P("iterator"),ve=P("toStringTag"),ye=C("typed_constructor"),me=C("def_constructor"),ge=u.CONSTR,be=u.TYPED,we=u.VIEW,_e=T(1,function(e,t){return ke(A(e,e[me]),t)}),Oe=o(function(){return 1===new H(new Uint16Array([1]).buffer)[0]}),Ee=!!H&&!!H.prototype.set&&o(function(){new H(1).set({})}),Se=function(e,t){var n=h(e);if(n<0||n%t)throw q("Wrong offset!");return n},xe=function(e){if(_(e)&&be in e)return e;throw B(e+" is not a typed array!")},ke=function(e,t){if(!(_(e)&&ye in e))throw B("It is not a typed array constructor!");return new e(t)},je=function(e,t){return Ce(A(e,e[me]),t)},Ce=function(e,t){for(var n=0,r=t.length,i=ke(e,r);r>n;)i[n]=t[n++];return i},Pe=function(e,t,n){W(e,t,{get:function(){return this._d[n]}})},Te=function(e){var t,n,r,i,o,a,u=O(e),c=arguments.length,l=c>1?arguments[1]:void 0,f=void 0!==l,p=j(u);if(void 0!=p&&!E(p)){for(a=p.call(u),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);u=r}for(f&&c>2&&(l=s(l,arguments[2],2)),t=0,n=v(u.length),i=ke(this,n);n>t;t++)i[t]=f?l(u[t],t):u[t];return i},Re=function(){for(var e=0,t=arguments.length,n=ke(this,t);t>e;)n[e]=arguments[e++];return n},Ae=!!H&&o(function(){de.call(new H(1))}),Fe=function(){return de.apply(Ae?fe.call(xe(this)):xe(this),arguments)},Ie={copyWithin:function(e,t){return D.call(xe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return X(xe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return U.apply(xe(this),arguments)},filter:function(e){return je(this,Q(xe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(xe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(xe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){G(xe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(xe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(xe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return se.apply(xe(this),arguments)},lastIndexOf:function(e){return ae.apply(xe(this),arguments)},map:function(e){return _e(xe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(xe(this),arguments)},reduceRight:function(e){return ce.apply(xe(this),arguments)},reverse:function(){for(var e,t=this,n=xe(t).length,r=Math.floor(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t},some:function(e){return J(xe(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return le.call(xe(this),e)},subarray:function(e,t){var n=xe(this),r=n.length,i=m(e,r);return new(A(n,n[me]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===t?r:m(t,r))-i))}},Ne=function(e,t){return je(this,fe.call(xe(this),e,t))},Me=function(e){xe(this);var t=Se(arguments[1],1),n=this.length,r=O(e),i=v(r.length),o=0;if(i+t>n)throw q("Wrong length!");for(;o<i;)this[t+o]=r[o++]},Ue={entries:function(){return oe.call(xe(this))},keys:function(){return ie.call(xe(this))},values:function(){return re.call(xe(this))}},De=function(e,t){return _(e)&&e[be]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Ve=function(e,t){return De(e,t=g(t,!0))?f(2,e[t]):z(e,t)},Le=function(e,t,n){return!(De(e,t=g(t,!0))&&_(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?W(e,t,n):(e[t]=n.value,e)};ge||(L.f=Ve,V.f=Le),a(a.S+a.F*!ge,"Object",{getOwnPropertyDescriptor:Ve,defineProperty:Le}),o(function(){pe.call({})})&&(pe=de=function(){return se.call(this)});var We=d({},Ie);d(We,Ue),p(We,he,Ue.values),d(We,{slice:Ne,set:Me,constructor:function(){},toString:pe,toLocaleString:Fe}),Pe(We,"buffer","b"),Pe(We,"byteOffset","o"),Pe(We,"byteLength","l"),Pe(We,"length","e"),W(We,ve,{get:function(){return this[be]}}),e.exports=function(e,t,n,c){c=!!c;var s=e+(c?"Clamped":"")+"Array",f="get"+e,d="set"+e,h=i[s],m=h||{},g=h&&x(h),b=!h||!u.ABV,O={},E=h&&h.prototype,j=function(e,n){var r=e._d;return r.v[f](n*t+r.o,Oe)},C=function(e,n,r){var i=e._d;c&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*t+i.o,r,Oe)},P=function(e,t){W(e,t,{get:function(){return j(this,t)},set:function(e){return C(this,t,e)},enumerable:!0})};b?(h=n(function(e,n,r,i){l(e,h,s,"_d");var o,a,u,c,f=0,d=0;if(_(n)){if(!(n instanceof $||"ArrayBuffer"==(c=w(n))||"SharedArrayBuffer"==c))return be in n?Ce(h,n):Te.call(h,n);o=n,d=Se(r,t);var m=n.byteLength;if(void 0===i){if(m%t)throw q("Wrong length!");if((a=m-d)<0)throw q("Wrong length!")}else if((a=v(i)*t)+d>m)throw q("Wrong length!");u=a/t}else u=y(n),a=u*t,o=new $(a);for(p(e,"_d",{b:o,o:d,l:a,e:u,v:new K(o)});f<u;)P(e,f++)}),E=h.prototype=S(We),p(E,"constructor",h)):o(function(){h(1)})&&o(function(){new h(-1)})&&N(function(e){new h,new h(null),new h(1.5),new h(e)},!0)||(h=n(function(e,n,r,i){l(e,h,s);var o;return _(n)?n instanceof $||"ArrayBuffer"==(o=w(n))||"SharedArrayBuffer"==o?void 0!==i?new m(n,Se(r,t),i):void 0!==r?new m(n,Se(r,t)):new m(n):be in n?Ce(h,n):Te.call(h,n):new m(y(n))}),G(g!==Function.prototype?k(m).concat(k(g)):k(m),function(e){e in h||p(h,e,m[e])}),h.prototype=E,r||(E.constructor=h));var T=E[he],R=!!T&&("values"==T.name||void 0==T.name),A=Ue.values;p(h,ye,!0),p(E,be,s),p(E,we,!0),p(E,me,h),(c?new h(1)[ve]==s:ve in E)||W(E,ve,{get:function(){return s}}),O[s]=h,a(a.G+a.W+a.F*(h!=m),O),a(a.S,s,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*o(function(){m.of.call(h,1)}),s,{from:Te,of:Re}),"BYTES_PER_ELEMENT"in E||p(E,"BYTES_PER_ELEMENT",t),a(a.P,s,Ie),M(s),a(a.P+a.F*Ee,s,{set:Me}),a(a.P+a.F*!R,s,Ue),r||E.toString==pe||(E.toString=pe),a(a.P+a.F*o(function(){new h(1).slice()}),s,{slice:Ne}),a(a.P+a.F*(o(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!o(function(){E.toLocaleString.call([1,2])})),s,{toLocaleString:Fe}),I[s]=R?T:A,r||R||p(E,he,A)}}else e.exports=function(){}},function(e,t,n){var r=n(6)("unscopables"),i=Array.prototype;void 0==i[r]&&n(14)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=!1},function(e,t,n){var r=n(48)("meta"),i=n(5),o=n(17),a=n(8).f,u=0,c=Object.isExtensible||function(){return!0},s=!n(4)(function(){return c(Object.preventExtensions({}))}),l=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},f=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},p=function(e,t){if(!o(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return s&&h.NEED&&c(e)&&!o(e,r)&&l(e),e},h=e.exports={KEY:r,NEED:!1,fastKey:f,getWeak:p,onFreeze:d}},function(e,t,n){"use strict";function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(536),i=n(199),o=n(537);n.d(t,"Provider",function(){return r.a}),n.d(t,"createProvider",function(){return r.b}),n.d(t,"connectAdvanced",function(){return i.a}),n.d(t,"connect",function(){return o.a})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(23),i=n(151),o=n(105),a=n(1),u=n(9),c=n(121),s={},l={},t=e.exports=function(e,t,n,f,p){var d,h,v,y,m=p?function(){return e}:c(e),g=r(n,f,t?2:1),b=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(d=u(e.length);d>b;b++)if((y=t?g(a(h=e[b])[0],h[1]):g(e[b]))===s||y===l)return y}else for(v=m.call(e);!(h=v.next()).done;)if((y=i(v,g,h.value,t))===s||y===l)return y};t.BREAK=s,t.RETURN=l},function(e,t,n){var r=n(1),i=n(157),o=n(101),a=n(113)("IE_PROTO"),u=function(){},c=function(){var e,t=n(100)("iframe"),r=o.length;for(t.style.display="none",n(103).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(159),i=n(101).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(159),i=n(101);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(15);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(7),a=n(6)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(29),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";function r(e,t){var r=n.i(o.a)(e,t);return n.i(i.a)(r)?r:void 0}var i=n(450),o=n(479);t.a=r},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t){e.exports={}},function(e,t,n){var r=n(8).f,i=n(17),o=n(6)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(0),i=n(27),o=n(4),a=n(117),u="["+a+"]",c="​…",s=RegExp("^"+u+u+"*"),l=RegExp(u+u+"*$"),f=function(e,t,n){var i={},u=o(function(){return!!a[e]()||c[e]()!=c}),s=i[e]=u?t(p):a[e];n&&(i[n]=s),r(r.P+r.F*u,"String",i)},p=f.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(s,"")),2&t&&(e=e.replace(l,"")),e};e.exports=f},function(e,t,n){var r=n(5);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r=function(e,t,n,r,i,o,a,u){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,i,o,a,u],l=0;c=new Error(t.replace(/%s/g,function(){return s[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};e.exports=r},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?c:u:s&&s in Object(e)?n.i(o.a)(e):n.i(a.a)(e)}var i=n(81),o=n(477),a=n(505),u="[object Null]",c="[object Undefined]",s=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){var r=n(21),i=n(6)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(u=r(t))&&"function"==typeof t.callee?"Arguments":u}},function(e,t,n){var r=n(21);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";function r(e){if("string"==typeof e||n.i(i.a)(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}var i=n(91),o=1/0;t.a=r},function(e,t,n){"use strict";function r(e,t){return e===t||e!==e&&t!==t}t.a=r},function(e,t,n){"use strict";function r(e){return null!=e&&n.i(o.a)(e.length)&&!n.i(i.a)(e)}var i=n(132),o=n(133);t.a=r},function(e,t,n){"use strict";var r=function(e,t){var n=e._reduxForm.sectionPrefix;return n?n+"."+t:t};t.a=r},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var r=n(20),i=n(9),o=n(47);e.exports=function(e){return function(t,n,a){var u,c=r(t),s=i(c.length),l=o(a,s);if(e&&n!=n){for(;s>l;)if((u=c[l++])!=u)return!0}else for(;s>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){"use strict";var r=n(2),i=n(0),o=n(15),a=n(45),u=n(36),c=n(40),s=n(39),l=n(5),f=n(4),p=n(71),d=n(52),h=n(104);e.exports=function(e,t,n,v,y,m){var g=r[e],b=g,w=y?"set":"add",_=b&&b.prototype,O={},E=function(e){var t=_[e];o(_,e,"delete"==e?function(e){return!(m&&!l(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(m||_.forEach&&!f(function(){(new b).entries().next()}))){var S=new b,x=S[w](m?{}:-0,1)!=S,k=f(function(){S.has(1)}),j=p(function(e){new b(e)}),C=!m&&f(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});j||(b=t(function(t,n){s(t,b,e);var r=h(new g,t,b);return void 0!=n&&c(n,y,r[w],r),r}),b.prototype=_,_.constructor=b),(k||C)&&(E("delete"),E("has"),y&&E("get")),(C||x)&&E(w),m&&_.clear&&delete _.clear}else b=v.getConstructor(t,e,y,w),a(b.prototype,n),u.NEED=!0;return d(b,e),O[e]=b,i(i.G+i.W+i.F*(b!=g),O),m||v.setStrong(b,e,y),b}},function(e,t,n){"use strict";var r=n(14),i=n(15),o=n(4),a=n(27),u=n(6);e.exports=function(e,t,n){var c=u(e),s=n(a,c,""[e]),l=s[0],f=s[1];o(function(){var t={};return t[c]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,c,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){"use strict";var r=n(1);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){var r=n(21);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(5),i=n(21),o=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(6)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";e.exports=n(35)||!n(4)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(2)[e]})},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";var r=n(0),i=n(12),o=n(23),a=n(40);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,u,c=arguments[1];return i(this),t=void 0!==c,t&&i(c),void 0==e?new this:(n=[],t?(r=0,u=o(c,arguments[2],2),a(e,!1,function(e){n.push(u(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){var r=n(22),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(35)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(1),i=n(12),o=n(6)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){for(var r,i=n(2),o=n(14),a=n(48),u=a("typed_array"),c=a("view"),s=!(!i.ArrayBuffer||!i.DataView),l=s,f=0,p="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[p[f++]])?(o(r.prototype,u,!0),o(r.prototype,c,!0)):l=!1;e.exports={ABV:s,CONSTR:l,TYPED:u,VIEW:c}},function(e,t,n){var r=n(2),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(490),o=n(491),a=n(492),u=n(493),c=n(494);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";var r=n(31),i=r.a.Symbol;t.a=i},function(e,t,n){"use strict";function r(e,t){for(var r=e.length;r--;)if(n.i(i.a)(e[r][0],t))return r;return-1}var i=n(61);t.a=r},function(e,t,n){"use strict";function r(e,t,r){"__proto__"==t&&i.a?n.i(i.a)(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var i=n(184);t.a=r},function(e,t,n){"use strict";function r(e,t,a,u,c){return e===t||(null==e||null==t||!n.i(o.a)(e)&&!n.i(o.a)(t)?e!==e&&t!==t:n.i(i.a)(e,t,a,u,r,c))}var i=n(448),o=n(50);t.a=r},function(e,t,n){"use strict";function r(e,t){var r=e.__data__;return n.i(i.a)(t)?r["string"==typeof t?"string":"hash"]:r.map}var i=n(488);t.a=r},function(e,t,n){"use strict";function r(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}var i=Object.prototype;t.a=r},function(e,t,n){"use strict";var r=n(49),i=n.i(r.a)(Object,"create");t.a=i},function(e,t,n){"use strict";var r=n(447),i=n(50),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable,c=n.i(r.a)(function(){return arguments}())?r.a:function(e){return n.i(i.a)(e)&&a.call(e,"callee")&&!u.call(e,"callee")};t.a=c},function(e,t,n){"use strict";(function(e){var r=n(31),i=n(527),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===o,c=u?r.a.Buffer:void 0,s=c?c.isBuffer:void 0,l=s||i.a;t.a=l}).call(t,n(64)(e))},function(e,t,n){"use strict";function r(e){if(!n.i(a.a)(e)||n.i(i.a)(e)!=u)return!1;var t=n.i(o.a)(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==p}var i=n(56),o=n(187),a=n(50),u="[object Object]",c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,p=l.call(Object);t.a=r},function(e,t,n){"use strict";function r(e){return"symbol"==typeof e||n.i(o.a)(e)&&n.i(i.a)(e)==a}var i=n(56),o=n(50),a="[object Symbol]";t.a=r},function(e,t,n){"use strict";var r=n(451),i=n(464),o=n(504),a=o.a&&o.a.isTypedArray,u=a?n.i(i.a)(a):r.a;t.a=u},function(e,t,n){"use strict";function r(e){return n.i(a.a)(e)?n.i(i.a)(e,s.a):n.i(u.a)(e)?[e]:n.i(o.a)(n.i(c.a)(n.i(l.a)(e)))}var i=n(177),o=n(183),a=n(25),u=n(91),c=n(193),s=n(60),l=n(197);t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"actionTypes",function(){return V}),n.d(t,"arrayInsert",function(){return L}),n.d(t,"arrayMove",function(){return W}),n.d(t,"arrayPop",function(){return z}),n.d(t,"arrayPush",function(){return q}),n.d(t,"arrayRemove",function(){return B}),n.d(t,"arrayRemoveAll",function(){return H}),n.d(t,"arrayShift",function(){return Y}),n.d(t,"arraySplice",function(){return $}),n.d(t,"arraySwap",function(){return K}),n.d(t,"arrayUnshift",function(){return G}),n.d(t,"autofill",function(){return Q}),n.d(t,"blur",function(){return J}),n.d(t,"change",function(){return X}),n.d(t,"clearAsyncError",function(){return Z}),n.d(t,"clearFields",function(){return ee}),n.d(t,"clearSubmitErrors",function(){return te}),n.d(t,"destroy",function(){return ne}),n.d(t,"focus",function(){return re}),n.d(t,"initialize",function(){return ie}),n.d(t,"registerField",function(){return oe}),n.d(t,"reset",function(){return ae}),n.d(t,"resetSection",function(){return ue}),n.d(t,"setSubmitFailed",function(){return ce}),n.d(t,"setSubmitSucceeded",function(){return se}),n.d(t,"startAsyncValidation",function(){return le}),n.d(t,"startSubmit",function(){return fe}),n.d(t,"stopAsyncValidation",function(){return pe}),n.d(t,"stopSubmit",function(){return de}),n.d(t,"submit",function(){return he}),n.d(t,"touch",function(){return ve}),n.d(t,"unregisterField",function(){return ye}),n.d(t,"untouch",function(){return me}),n.d(t,"updateSyncWarnings",function(){return ge});var r=n(204),i=n(137),o=n(206);n.d(t,"defaultShouldAsyncValidate",function(){return o.a});var a=n(208);n.d(t,"defaultShouldValidate",function(){return a.a});var u=n(207);n.d(t,"defaultShouldError",function(){return u.a});var c=n(209);n.d(t,"defaultShouldWarn",function(){return c.a});var s=n(553);n.d(t,"Form",function(){return s.a});var l=n(554);n.d(t,"FormName",function(){return l.a});var f=n(555);n.d(t,"FormSection",function(){return f.a});var p=n(203);n.d(t,"SubmissionError",function(){return p.a});var d=n(591);n.d(t,"propTypes",function(){return d.a}),n.d(t,"fieldInputPropTypes",function(){return d.b}),n.d(t,"fieldMetaPropTypes",function(){return d.c}),n.d(t,"fieldPropTypes",function(){return d.d}),n.d(t,"fieldArrayFieldsPropTypes",function(){return d.e}),n.d(t,"fieldArrayMetaPropTypes",function(){return d.f}),n.d(t,"fieldArrayPropTypes",function(){return d.g}),n.d(t,"formPropTypes",function(){return d.h});var h=n(550);n.d(t,"Field",function(){return h.a});var v=n(552);n.d(t,"Fields",function(){return v.a});var y=n(551);n.d(t,"FieldArray",function(){return y.a});var m=n(569);n.d(t,"formValueSelector",function(){return m.a});var g=n(570);n.d(t,"formValues",function(){return g.a});var b=n(573);n.d(t,"getFormError",function(){return b.a});var w=n(576);n.d(t,"getFormNames",function(){return w.a});var _=n(580);n.d(t,"getFormValues",function(){return _.a});var O=n(574);n.d(t,"getFormInitialValues",function(){return O.a});var E=n(578);n.d(t,"getFormSyncErrors",function(){return E.a});var S=n(575);n.d(t,"getFormMeta",function(){return S.a});var x=n(572);n.d(t,"getFormAsyncErrors",function(){return x.a});var k=n(579);n.d(t,"getFormSyncWarnings",function(){return k.a});var j=n(577);n.d(t,"getFormSubmitErrors",function(){return j.a});var C=n(585);n.d(t,"isAsyncValidating",function(){return C.a});var P=n(586);n.d(t,"isDirty",function(){return P.a});var T=n(587);n.d(t,"isInvalid",function(){return T.a});var R=n(588);n.d(t,"isPristine",function(){return R.a});var A=n(590);n.d(t,"isValid",function(){return A.a});var F=n(589);n.d(t,"isSubmitting",function(){return F.a});var I=n(584);n.d(t,"hasSubmitSucceeded",function(){return I.a});var N=n(583);n.d(t,"hasSubmitFailed",function(){return N.a});var M=n(593);n.d(t,"reduxForm",function(){return M.a});var U=n(592);n.d(t,"reducer",function(){return U.a});var D=n(618);n.d(t,"values",function(){return D.a});var V=i,L=r.a.arrayInsert,W=r.a.arrayMove,z=r.a.arrayPop,q=r.a.arrayPush,B=r.a.arrayRemove,H=r.a.arrayRemoveAll,Y=r.a.arrayShift,$=r.a.arraySplice,K=r.a.arraySwap,G=r.a.arrayUnshift,Q=r.a.autofill,J=r.a.blur,X=r.a.change,Z=r.a.clearAsyncError,ee=r.a.clearFields,te=r.a.clearSubmitErrors,ne=r.a.destroy,re=r.a.focus,ie=r.a.initialize,oe=r.a.registerField,ae=r.a.reset,ue=r.a.resetSection,ce=r.a.setSubmitFailed,se=r.a.setSubmitSucceeded,le=r.a.startAsyncValidation,fe=r.a.startSubmit,pe=r.a.stopAsyncValidation,de=r.a.stopSubmit,he=r.a.submit,ve=r.a.touch,ye=r.a.unregisterField,me=r.a.untouch,ge=r.a.updateSyncWarnings},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(217),i=n(621),o=n(620),a=n(619),u=n(216);n(218);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return i.a}),n.d(t,"bindActionCreators",function(){return o.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return u.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(11),i=n(47),o=n(9);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,s=void 0===c?n:i(c,n);s>u;)t[u++]=e;return t}},function(e,t,n){var r=n(225);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(8),i=n(44);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(5),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(5),i=n(112).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){var r=n(51),i=n(6)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){"use strict";var r=n(41),i=n(44),o=n(52),a={};n(14)(a,n(6)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(35),i=n(0),o=n(15),a=n(14),u=n(51),c=n(106),s=n(52),l=n(19),f=n(6)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,y,m){c(n,t,h);var g,b,w,_=function(e){if(!p&&e in x)return x[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},O=t+" Iterator",E="values"==v,S=!1,x=e.prototype,k=x[f]||x["@@iterator"]||v&&x[v],j=k||_(v),C=v?E?_("entries"):j:void 0,P="Array"==t?x.entries||k:k;if(P&&(w=l(P.call(new e)))!==Object.prototype&&w.next&&(s(w,O,!0),r||"function"==typeof w[f]||a(w,f,d)),E&&k&&"values"!==k.name&&(S=!0,j=function(){return k.call(this)}),r&&!m||!p&&!S&&x[f]||a(x,f,j),u[t]=j,u[O]=d,v)if(g={values:E?j:_("values"),keys:y?j:_("keys"),entries:C},m)for(b in g)b in x||o(x,b,g[b]);else i(i.P+i.F*(p||S),t,g);return g}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){var r=n(2),i=n(118).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,c="process"==n(21)(a);e.exports=function(){var e,t,n,s=function(){var r,i;for(c&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(s)};else if(!o||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var l=u.resolve(void 0);n=function(){l.then(s)}}else n=function(){i.call(r,s)};else{var f=!0,p=document.createTextNode("");new o(s).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(12);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(5),i=n(1),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(23)(Function.call,n(18).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(76)("keys"),i=n(48);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(29),i=n(27);e.exports=function(e){return function(t,n){var o,a,u=String(i(t)),c=r(n),s=u.length;return c<0||c>=s?e?"":void 0:(o=u.charCodeAt(c),o<55296||o>56319||c+1===s||(a=u.charCodeAt(c+1))<56320||a>57343?e?u.charAt(c):o:e?u.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){var r=n(70),i=n(27);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){"use strict";var r=n(29),i=n(27);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r,i,o,a=n(23),u=n(149),c=n(103),s=n(100),l=n(2),f=l.process,p=l.setImmediate,d=l.clearImmediate,h=l.MessageChannel,v=l.Dispatch,y=0,m={},g=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},b=function(e){g.call(e.data)};p&&d||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return m[++y]=function(){u("function"==typeof e?e:Function(e),t)},r(y),y},d=function(e){delete m[e]},"process"==n(21)(f)?r=function(e){f.nextTick(a(g,e,1))}:v&&v.now?r=function(e){v.now(a(g,e,1))}:h?(i=new h,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in s("script")?function(e){c.appendChild(s("script")).onreadystatechange=function(){c.removeChild(this),g.call(e)}}:function(e){setTimeout(a(g,e,1),0)}),e.exports={set:p,clear:d}},function(e,t,n){"use strict";function r(e,t,n){var r,i,o,a=new Array(n),u=8*n-t-1,c=(1<<u)-1,s=c>>1,l=23===t?D(2,-24)-D(2,-77):0,f=0,p=e<0||0===e&&1/e<0?1:0;for(e=U(e),e!=e||e===N?(i=e!=e?1:0,r=c):(r=V(L(e)/W),e*(o=D(2,-r))<1&&(r--,o*=2),e+=r+s>=1?l/o:l*D(2,1-s),e*o>=2&&(r++,o/=2),r+s>=c?(i=0,r=c):r+s>=1?(i=(e*o-1)*D(2,t),r+=s):(i=e*D(2,s-1)*D(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<<t|i,u+=t;u>0;a[f++]=255&r,r/=256,u-=8);return a[--f]|=128*p,a}function i(e,t,n){var r,i=8*n-t-1,o=(1<<i)-1,a=o>>1,u=i-7,c=n-1,s=e[c--],l=127&s;for(s>>=7;u>0;l=256*l+e[c],c--,u-=8);for(r=l&(1<<-u)-1,l>>=-u,u+=t;u>0;r=256*r+e[c],c--,u-=8);if(0===l)l=1-a;else{if(l===o)return r?NaN:s?-N:N;r+=D(2,t),l-=a}return(s?-1:1)*r*D(2,l-t)}function o(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return[255&e]}function u(e){return[255&e,e>>8&255]}function c(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return r(e,52,8)}function l(e){return r(e,23,4)}function f(e,t,n){k(e[P],t,{get:function(){return this[n]}})}function p(e,t,n,r){var i=+n,o=S(i);if(o+t>e[q])throw I(T);var a=e[z]._b,u=o+e[B],c=a.slice(u,u+t);return r?c:c.reverse()}function d(e,t,n,r,i,o){var a=+n,u=S(a);if(u+t>e[q])throw I(T);for(var c=e[z]._b,s=u+e[B],l=r(+i),f=0;f<t;f++)c[s+f]=l[o?f:t-f-1]}var h=n(2),v=n(7),y=n(35),m=n(78),g=n(14),b=n(45),w=n(4),_=n(39),O=n(29),E=n(9),S=n(167),x=n(42).f,k=n(8).f,j=n(97),C=n(52),P="prototype",T="Wrong index!",R=h.ArrayBuffer,A=h.DataView,F=h.Math,I=h.RangeError,N=h.Infinity,M=R,U=F.abs,D=F.pow,V=F.floor,L=F.log,W=F.LN2,z=v?"_b":"buffer",q=v?"_l":"byteLength",B=v?"_o":"byteOffset";if(m.ABV){if(!w(function(){R(1)})||!w(function(){new R(-1)})||w(function(){return new R,new R(1.5),new R(NaN),"ArrayBuffer"!=R.name})){R=function(e){return _(this,R),new M(S(e))};for(var H,Y=R[P]=M[P],$=x(M),K=0;$.length>K;)(H=$[K++])in R||g(R,H,M[H]);y||(Y.constructor=R)}var G=new A(new R(2)),Q=A[P].setInt8;G.setInt8(0,2147483648),G.setInt8(1,2147483649),!G.getInt8(0)&&G.getInt8(1)||b(A[P],{setInt8:function(e,t){Q.call(this,e,t<<24>>24)},setUint8:function(e,t){Q.call(this,e,t<<24>>24)}},!0)}else R=function(e){_(this,R,"ArrayBuffer");var t=S(e);this._b=j.call(new Array(t),0),this[q]=t},A=function(e,t,n){_(this,A,"DataView"),_(e,R,"DataView");var r=e[q],i=O(t);if(i<0||i>r)throw I("Wrong offset!");if(n=void 0===n?r-i:E(n),i+n>r)throw I("Wrong length!");this[z]=e,this[B]=i,this[q]=n},v&&(f(R,"byteLength","_l"),f(A,"buffer","_b"),f(A,"byteLength","_l"),f(A,"byteOffset","_o")),b(A[P],{getInt8:function(e){return p(this,1,e)[0]<<24>>24},getUint8:function(e){return p(this,1,e)[0]},getInt16:function(e){var t=p(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=p(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return o(p(this,4,e,arguments[1]))},getUint32:function(e){return o(p(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return i(p(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return i(p(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){d(this,1,e,a,t)},setUint8:function(e,t){d(this,1,e,a,t)},setInt16:function(e,t){d(this,2,e,u,t,arguments[2])},setUint16:function(e,t){d(this,2,e,u,t,arguments[2])},setInt32:function(e,t){d(this,4,e,c,t,arguments[2])},setUint32:function(e,t){d(this,4,e,c,t,arguments[2])},setFloat32:function(e,t){d(this,4,e,l,t,arguments[2])},setFloat64:function(e,t){d(this,8,e,s,t,arguments[2])}});C(R,"ArrayBuffer"),C(A,"DataView"),g(A[P],m.VIEW,!0),t.ArrayBuffer=R,t.DataView=A},function(e,t,n){var r=n(2),i=n(22),o=n(35),a=n(168),u=n(8).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(57),i=n(6)("iterator"),o=n(51);e.exports=n(22).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(34),i=n(152),o=n(51),a=n(20);e.exports=n(107)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){"use strict";function r(e,t,n,r,o,a,u,c){if(i(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,u,c],f=0;s=new Error(t.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var i=function(e){};e.exports=r},function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n},function(e,t,n){"use strict";var r=n(49),i=n(31),o=n.i(r.a)(i.a,"Map");t.a=o},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(495),o=n(496),a=n(497),u=n(498),c=n(499);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__=new i.a(e);this.size=t.size}var i=n(80),o=n(512),a=n(513),u=n(514),c=n(515),s=n(516);r.prototype.clear=o.a,r.prototype.delete=a.a,r.prototype.get=u.a,r.prototype.has=c.a,r.prototype.set=s.a,t.a=r},function(e,t,n){"use strict";function r(e,t){var n=typeof e;return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.a=r},function(e,t,n){"use strict";function r(e,t){if(n.i(i.a)(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!n.i(o.a)(e))||(u.test(e)||!a.test(e)||null!=t&&e in Object(t))}var i=n(25),o=n(91),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.a=r},function(e,t,n){"use strict";function r(e){return e}t.a=r},function(e,t,n){"use strict";function r(e){if(!n.i(o.a)(e))return!1;var t=n.i(i.a)(e);return t==u||t==c||t==a||t==s}var i=n(56),o=n(37),a="[object AsyncFunction]",u="[object Function]",c="[object GeneratorFunction]",s="[object Proxy]";t.a=r},function(e,t,n){"use strict";function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}var i=9007199254740991;t.a=r},function(e,t,n){"use strict";function r(e){return n.i(a.a)(e)?n.i(i.a)(e):n.i(o.a)(e)}var i=n(176),o=n(181),a=n(62);t.a=r},function(e,t,n){"use strict";function r(e,t){var r={};return t=n.i(a.a)(t,3),n.i(o.a)(e,function(e,o,a){n.i(i.a)(r,o,t(e,o,a))}),r}var i=n(83),o=n(444),a=n(452);t.a=r},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"prefix",function(){return r}),n.d(t,"ARRAY_INSERT",function(){return i}),n.d(t,"ARRAY_MOVE",function(){return o}),n.d(t,"ARRAY_POP",function(){return a}),n.d(t,"ARRAY_PUSH",function(){return u}),n.d(t,"ARRAY_REMOVE",function(){return c}),n.d(t,"ARRAY_REMOVE_ALL",function(){return s}),n.d(t,"ARRAY_SHIFT",function(){return l}),n.d(t,"ARRAY_SPLICE",function(){return f}),n.d(t,"ARRAY_UNSHIFT",function(){return p}),n.d(t,"ARRAY_SWAP",function(){return d}),n.d(t,"AUTOFILL",function(){return h}),n.d(t,"BLUR",function(){return v}),n.d(t,"CHANGE",function(){return y}),n.d(t,"CLEAR_FIELDS",function(){return m}),n.d(t,"CLEAR_SUBMIT",function(){return g}),n.d(t,"CLEAR_SUBMIT_ERRORS",function(){return b}),n.d(t,"CLEAR_ASYNC_ERROR",function(){return w}),n.d(t,"DESTROY",function(){return _}),n.d(t,"FOCUS",function(){return O}),n.d(t,"INITIALIZE",function(){return E}),n.d(t,"REGISTER_FIELD",function(){return S}),n.d(t,"RESET",function(){return x}),n.d(t,"RESET_SECTION",function(){return k}),n.d(t,"SET_SUBMIT_FAILED",function(){return j}),n.d(t,"SET_SUBMIT_SUCCEEDED",function(){return C}),n.d(t,"START_ASYNC_VALIDATION",function(){return P}),n.d(t,"START_SUBMIT",function(){return T}),n.d(t,"STOP_ASYNC_VALIDATION",function(){return R}),n.d(t,"STOP_SUBMIT",function(){return A}),n.d(t,"SUBMIT",function(){return F}),n.d(t,"TOUCH",function(){return I}),n.d(t,"UNREGISTER_FIELD",function(){return N}),n.d(t,"UNTOUCH",function(){return M}),n.d(t,"UPDATE_SYNC_ERRORS",function(){return U}),n.d(t,"UPDATE_SYNC_WARNINGS",function(){return D});var r="@@redux-form/",i=r+"ARRAY_INSERT",o=r+"ARRAY_MOVE",a=r+"ARRAY_POP",u=r+"ARRAY_PUSH",c=r+"ARRAY_REMOVE",s=r+"ARRAY_REMOVE_ALL",l=r+"ARRAY_SHIFT",f=r+"ARRAY_SPLICE",p=r+"ARRAY_UNSHIFT",d=r+"ARRAY_SWAP",h=r+"AUTOFILL",v=r+"BLUR",y=r+"CHANGE",m=r+"CLEAR_FIELDS",g=r+"CLEAR_SUBMIT",b=r+"CLEAR_SUBMIT_ERRORS",w=r+"CLEAR_ASYNC_ERROR",_=r+"DESTROY",O=r+"FOCUS",E=r+"INITIALIZE",S=r+"REGISTER_FIELD",x=r+"RESET",k=r+"RESET_SECTION",j=r+"SET_SUBMIT_FAILED",C=r+"SET_SUBMIT_SUCCEEDED",P=r+"START_ASYNC_VALIDATION",T=r+"START_SUBMIT",R=r+"STOP_ASYNC_VALIDATION",A=r+"STOP_SUBMIT",F=r+"SUBMIT",I=r+"TOUCH",N=r+"UNREGISTER_FIELD",M=r+"UNTOUCH",U=r+"UPDATE_SYNC_ERRORS",D=r+"UPDATE_SYNC_WARNINGS"},function(e,t,n){"use strict";var r=n(582),i=function(e){var t=e.getIn,i=e.keys,o=n.i(r.a)(e);return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(a){var u=n||function(e){return t(e,"form")},c=u(a);if(t(c,e+".syncError"))return!1;if(!r){if(t(c,e+".error"))return!1}var s=t(c,e+".syncErrors"),l=t(c,e+".asyncErrors"),f=r?void 0:t(c,e+".submitErrors");if(!s&&!l&&!f)return!0;var p=t(c,e+".registeredFields");return!p||!i(p).filter(function(e){return t(p,"['"+e+"'].count")>0}).some(function(e){return o(t(p,"['"+e+"']"),s,l,f)})}}};t.a=i},function(e,t,n){var r=n(21);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){"use strict";var r=n(11),i=n(47),o=n(9);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),u=i(e,a),c=i(t,a),s=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===s?a:i(s,a))-c,a-u),f=1;for(c<u&&u<c+l&&(f=-1,c+=l-1,u+=l-1);l-- >0;)c in n?n[u]=n[c]:delete n[u],u+=f,c+=f;return n}},function(e,t,n){var r=n(40);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){var r=n(12),i=n(11),o=n(58),a=n(9);e.exports=function(e,t,n,u,c){r(t);var s=i(e),l=o(s),f=a(s.length),p=c?f-1:0,d=c?-1:1;if(n<2)for(;;){if(p in l){u=l[p],p+=d;break}if(p+=d,c?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;c?p>=0:f>p;p+=d)p in l&&(u=t(u,l[p],p,s));return u}},function(e,t,n){"use strict";var r=n(12),i=n(5),o=n(149),a=[].slice,u={},c=function(e,t,n){if(!(t in u)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";u[t]=Function("F,a","return new F("+r.join(",")+")")}return u[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?c(t,r.length,r):o(t,r,e)};return i(t.prototype)&&(u.prototype=t.prototype),u}},function(e,t,n){"use strict";var r=n(8).f,i=n(41),o=n(45),a=n(23),u=n(39),c=n(40),s=n(107),l=n(152),f=n(46),p=n(7),d=n(36).fastKey,h=n(54),v=p?"_s":"size",y=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,s){var l=e(function(e,r){u(e,l,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,void 0!=r&&c(r,n,e[s],e)});return o(l.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=h(this,t),r=y(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!y(h(this,t),e)}}),p&&r(l.prototype,"size",{get:function(){return h(this,t)[v]}}),l},def:function(e,t,n){var r,i,o=y(e,t);return o?o.v=n:(e._l=o={i:i=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[v]++,"F"!==i&&(e._i[i]=o)),e},getEntry:y,setStrong:function(e,t,n){s(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?l(0,n.k):"values"==t?l(0,n.v):l(0,[n.k,n.v]):(e._t=void 0,l(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){var r=n(57),i=n(141);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){"use strict";var r=n(45),i=n(36).getWeak,o=n(1),a=n(5),u=n(39),c=n(40),s=n(26),l=n(17),f=n(54),p=s(5),d=s(6),h=0,v=function(e){return e._l||(e._l=new y)},y=function(){this.a=[]},m=function(e,t){return p(e.a,function(e){return e[0]===t})};y.prototype={get:function(e){var t=m(this,e);if(t)return t[1]},has:function(e){return!!m(this,e)},set:function(e,t){var n=m(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var s=e(function(e,r){u(e,s,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=r&&c(r,n,e[o],e)});return r(s.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(f(this,t)).has(e):n&&l(n,this._i)}}),s},def:function(e,t,n){var r=i(o(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){"use strict";function r(e,t,n,s,l,f,p,d){for(var h,v,y=l,m=0,g=!!p&&u(p,d,3);m<s;){if(m in n){if(h=g?g(n[m],m,t):n[m],v=!1,o(h)&&(v=h[c],v=void 0!==v?!!v:i(h)),v&&f>0)y=r(e,t,h,a(h.length),y,f-1)-1;else{if(y>=9007199254740991)throw TypeError();e[y]=h}y++}m++}return y}var i=n(69),o=n(5),a=n(9),u=n(23),c=n(6)("isConcatSpreadable");e.exports=r},function(e,t,n){e.exports=!n(7)&&!n(4)(function(){return 7!=Object.defineProperty(n(100)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){var r=n(1);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(109),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),c=i(2,-126),s=function(e){return e+1/o-1/o};e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),l=r(e);return i<c?l*s(i/c/a)*c*a:(t=(1+a/o)*i,n=t-(t-i),n>u||n!=n?l*(1/0):l*n)}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){"use strict";var r=n(43),i=n(73),o=n(59),a=n(11),u=n(58),c=Object.assign;e.exports=!c||n(4)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r})?function(e,t){for(var n=a(e),c=arguments.length,s=1,l=i.f,f=o.f;c>s;)for(var p,d=u(arguments[s++]),h=l?r(d).concat(l(d)):r(d),v=h.length,y=0;v>y;)f.call(d,p=h[y++])&&(n[p]=d[p]);return n}:c},function(e,t,n){var r=n(8),i=n(1),o=n(43);e.exports=n(7)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),u=a.length,c=0;u>c;)r.f(e,n=a[c++],t[n]);return e}},function(e,t,n){var r=n(20),i=n(42).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(e){try{return i(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?u(e):i(r(e))}},function(e,t,n){var r=n(17),i=n(20),o=n(65)(!1),a=n(113)("IE_PROTO");e.exports=function(e,t){var n,u=i(e),c=0,s=[];for(n in u)n!=a&&r(u,n)&&s.push(n);for(;t.length>c;)r(u,n=t[c++])&&(~o(s,n)||s.push(n));return s}},function(e,t,n){var r=n(43),i=n(20),o=n(59).f;e.exports=function(e){return function(t){for(var n,a=i(t),u=r(a),c=u.length,s=0,l=[];c>s;)o.call(a,n=u[s++])&&l.push(e?[n,a[n]]:a[n]);return l}}},function(e,t,n){var r=n(42),i=n(73),o=n(1),a=n(2).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){var r=n(2).parseFloat,i=n(53).trim;e.exports=1/r(n(117)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(2).parseInt,i=n(53).trim,o=n(117),a=/^[-+]?0[xX]/;e.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(a.test(n)?16:10))}:r},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(1),i=n(5),o=n(111);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(9),i=n(116),o=n(27);e.exports=function(e,t,n,a){var u=String(o(e)),c=u.length,s=void 0===n?" ":String(n),l=r(t);if(l<=c||""==s)return u;var f=l-c,p=i.call(s,Math.ceil(f/s.length));return p.length>f&&(p=p.slice(0,f)),a?p+u:u+p}},function(e,t,n){var r=n(29),i=n(9);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){t.f=n(6)},function(e,t,n){"use strict";var r=n(144),i=n(54);e.exports=n(66)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){n(7)&&"g"!=/./g.flags&&n(8).f(RegExp.prototype,"flags",{configurable:!0,get:n(68)})},function(e,t,n){"use strict";var r=n(144),i=n(54);e.exports=n(66)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(26)(0),o=n(15),a=n(36),u=n(156),c=n(146),s=n(5),l=n(4),f=n(54),p=a.getWeak,d=Object.isExtensible,h=c.ufstore,v={},y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(e){if(s(e)){var t=p(e);return!0===t?h(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(f(this,"WeakMap"),e,t)}},g=e.exports=n(66)("WeakMap",y,m,c,!0,!0);l(function(){return 7!=(new g).set((Object.freeze||Object)(v),7).get(v)})&&(r=c.getConstructor(y,"WeakMap"),u(r.prototype,m),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=g.prototype,n=t[e];o(t,e,function(t,i){if(s(t)&&!d(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";function r(e,t,n){if("string"!=typeof t){if(f){var p=l(t);p&&p!==f&&r(e,p,n)}var d=u(t);c&&(d=d.concat(c(t)));for(var h=0;h<d.length;++h){var v=d[h];if(!(i[v]||o[v]||n&&n[v])){var y=s(t,v);try{a(e,v,y)}catch(e){}}}return e}return e}var i={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,f=l&&l(Object);e.exports=r},function(e,t,n){"use strict";var r=n(31),i=r.a.Uint8Array;t.a=i},function(e,t,n){"use strict";function r(e,t){var r=n.i(a.a)(e),l=!r&&n.i(o.a)(e),p=!r&&!l&&n.i(u.a)(e),d=!r&&!l&&!p&&n.i(s.a)(e),h=r||l||p||d,v=h?n.i(i.a)(e.length,String):[],y=v.length;for(var m in e)!t&&!f.call(e,m)||h&&("length"==m||p&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||n.i(c.a)(m,y))||v.push(m);return v}var i=n(462),o=n(88),a=n(25),u=n(89),c=n(129),s=n(92),l=Object.prototype,f=l.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.a=r},function(e,t,n){"use strict";function r(e,t,r){(void 0===r||n.i(o.a)(e[t],r))&&(void 0!==r||t in e)||n.i(i.a)(e,t,r)}var i=n(83),o=n(61);t.a=r},function(e,t,n){"use strict";var r=n(472),i=n.i(r.a)();t.a=i},function(e,t,n){"use strict";function r(e,t){t=n.i(i.a)(t,e);for(var r=0,a=t.length;null!=e&&r<a;)e=e[n.i(o.a)(t[r++])];return r&&r==a?e:void 0}var i=n(182),o=n(60);t.a=r},function(e,t,n){"use strict";function r(e){if(!n.i(i.a)(e))return n.i(o.a)(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}var i=n(86),o=n(502),a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t){return n.i(i.a)(e)?e:n.i(o.a)(e,t)?[e]:n.i(a.a)(n.i(u.a)(e))}var i=n(25),o=n(130),a=n(193),u=n(197);t.a=r},function(e,t,n){"use strict";function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.a=r},function(e,t,n){"use strict";var r=n(49),i=function(){try{var e=n.i(r.a)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.a=i},function(e,t,n){"use strict";function r(e,t,r,s,l,f){var p=r&u,d=e.length,h=t.length;if(d!=h&&!(p&&h>d))return!1;var v=f.get(e);if(v&&f.get(t))return v==t;var y=-1,m=!0,g=r&c?new i.a:void 0;for(f.set(e,t),f.set(t,e);++y<d;){var b=e[y],w=t[y];if(s)var _=p?s(w,b,y,t,e,f):s(b,w,y,e,t,f);if(void 0!==_){if(_)continue;m=!1;break}if(g){if(!n.i(o.a)(t,function(e,t){if(!n.i(a.a)(g,t)&&(b===e||l(b,e,r,s,f)))return g.push(t)})){m=!1;break}}else if(b!==w&&!l(b,w,r,s,f)){m=!1;break}}return f.delete(e),f.delete(t),m}var i=n(436),o=n(441),a=n(465),u=1,c=2;t.a=r},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(96))},function(e,t,n){"use strict";var r=n(191),i=n.i(r.a)(Object.getPrototypeOf,Object);t.a=i},function(e,t,n){"use strict";var r=n(432),i=n(126),o=n(434),a=n(435),u=n(437),c=n(56),s=n(194),l=n.i(s.a)(r.a),f=n.i(s.a)(i.a),p=n.i(s.a)(o.a),d=n.i(s.a)(a.a),h=n.i(s.a)(u.a),v=c.a;(r.a&&"[object DataView]"!=v(new r.a(new ArrayBuffer(1)))||i.a&&"[object Map]"!=v(new i.a)||o.a&&"[object Promise]"!=v(o.a.resolve())||a.a&&"[object Set]"!=v(new a.a)||u.a&&"[object WeakMap]"!=v(new u.a))&&(v=function(e){var t=n.i(c.a)(e),r="[object Object]"==t?e.constructor:void 0,i=r?n.i(s.a)(r):"";if(i)switch(i){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),t.a=v},function(e,t,n){"use strict";function r(e){return e===e&&!n.i(i.a)(e)}var i=n(37);t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";function r(e,t){return"__proto__"==t?void 0:e[t]}t.a=r},function(e,t,n){"use strict";var r=n(501),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n.i(r.a)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t});t.a=a},function(e,t,n){"use strict";function r(e){if(null!=e){try{return o.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var i=Function.prototype,o=i.toString;t.a=r},function(e,t,n){"use strict";function r(e,t,r){r="function"==typeof r?r:void 0;var o=r?r(e,t):void 0;return void 0===o?n.i(i.a)(e,t,void 0,r):!!o}var i=n(84);t.a=r},function(e,t,n){"use strict";function r(e){return n.i(a.a)(e)?n.i(i.a)(e,!0):n.i(o.a)(e)}var i=n(176),o=n(453),a=n(62);t.a=r},function(e,t,n){"use strict";function r(e){return null==e?"":n.i(i.a)(e)}var i=n(463);t.a=r},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* object-assign (c) Sindre Sorhus @license MIT */ var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,c=r(e),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var l in n)o.call(n,l)&&(c[l]=n[l]);if(i){u=i(n);for(var f=0;f<u.length;f++)a.call(n,u[f])&&(c[u[f]]=n[u[f]])}}return c}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function u(){}function c(e,t){var n={run:function(r){try{var i=e(t.getState(),r);(i!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=i,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}function s(e){var t,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},p=l.getDisplayName,w=void 0===p?function(e){return"ConnectAdvanced("+e+")"}:p,_=l.methodName,O=void 0===_?"connectAdvanced":_,E=l.renderCountProp,S=void 0===E?void 0:E,x=l.shouldHandleStateChanges,k=void 0===x||x,j=l.storeKey,C=void 0===j?"store":j,P=l.withRef,T=void 0!==P&&P,R=a(l,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),A=C+"Subscription",F=g++,I=(t={},t[C]=y.a,t[A]=y.b,t),N=(s={},s[A]=y.b,s);return function(t){d()("function"==typeof t,"You must pass a component to the function returned by "+O+". Instead received "+JSON.stringify(t));var a=t.displayName||t.name||"Component",s=w(a),l=m({},R,{getDisplayName:w,methodName:O,renderCountProp:S,shouldHandleStateChanges:k,storeKey:C,withRef:T,displayName:s,wrappedComponentName:a,WrappedComponent:t}),p=function(a){function f(e,t){r(this,f);var n=i(this,a.call(this,e,t));return n.version=F,n.state={},n.renderCount=0,n.store=e[C]||t[C],n.propsMode=Boolean(e[C]),n.setWrappedInstance=n.setWrappedInstance.bind(n),d()(n.store,'Could not find "'+C+'" in either the context or props of "'+s+'". Either wrap the root component in a <Provider>, or explicitly pass "'+C+'" as a prop to "'+s+'".'),n.initSelector(),n.initSubscription(),n}return o(f,a),f.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return e={},e[A]=t||this.context[A],e},f.prototype.componentDidMount=function(){k&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},f.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},f.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},f.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=u,this.store=null,this.selector.run=u,this.selector.shouldComponentUpdate=!1},f.prototype.getWrappedInstance=function(){return d()(T,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+O+"() call."),this.wrappedInstance},f.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},f.prototype.initSelector=function(){var t=e(this.store.dispatch,l);this.selector=c(t,this.store),this.selector.run(this.props)},f.prototype.initSubscription=function(){if(k){var e=(this.propsMode?this.props:this.context)[A];this.subscription=new v.a(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},f.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(b)):this.notifyNestedSubs()},f.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},f.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},f.prototype.addExtraProps=function(e){if(!(T||S||this.propsMode&&this.subscription))return e;var t=m({},e);return T&&(t.ref=this.setWrappedInstance),S&&(t[S]=this.renderCount++),this.propsMode&&this.subscription&&(t[A]=this.subscription),t},f.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return n.i(h.createElement)(t,this.addExtraProps(e.props))},f}(h.Component);return p.WrappedComponent=t,p.displayName=s,p.childContextTypes=N,p.contextTypes=I,p.propTypes=I,f()(p,t)}}t.a=s;var l=n(174),f=n.n(l),p=n(55),d=n.n(p),h=n(10),v=(n.n(h),n(543)),y=n(201),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g=0,b={}},function(e,t,n){"use strict";function r(e){return function(t,n){function r(){return i}var i=e(t,n);return r.dependsOnOwnProps=!1,r}}function i(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function o(e,t){return function(t,n){var r=(n.displayName,function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)});return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=i(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=i(o),o=r(t,n)),o},r}}t.b=r,t.a=o;n(202)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a});var r=n(13),i=n.n(r),o=i.a.shape({trySubscribe:i.a.func.isRequired,tryUnsubscribe:i.a.func.isRequired,notifyNestedSubs:i.a.func.isRequired,isSubscribed:i.a.func.isRequired}),a=i.a.shape({subscribe:i.a.func.isRequired,dispatch:i.a.func.isRequired,getState:i.a.func.isRequired})},function(e,t,n){"use strict";n(90),n(136)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(424),u=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Submit Validation Failed"));return n.errors=e,n}return o(t,e),t}(a.a);t.a=u},function(e,t,n){"use strict";var r=n(137),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t,n,i){return{type:r.ARRAY_INSERT,meta:{form:e,field:t,index:n},payload:i}},a=function(e,t,n,i){return{type:r.ARRAY_MOVE,meta:{form:e,field:t,from:n,to:i}}},u=function(e,t){return{type:r.ARRAY_POP,meta:{form:e,field:t}}},c=function(e,t,n){return{type:r.ARRAY_PUSH,meta:{form:e,field:t},payload:n}},s=function(e,t,n){return{type:r.ARRAY_REMOVE,meta:{form:e,field:t,index:n}}},l=function(e,t){return{type:r.ARRAY_REMOVE_ALL,meta:{form:e,field:t}}},f=function(e,t){return{type:r.ARRAY_SHIFT,meta:{form:e,field:t}}},p=function(e,t,n,i,o){var a={type:r.ARRAY_SPLICE,meta:{form:e,field:t,index:n,removeNum:i}};return void 0!==o&&(a.payload=o),a},d=function(e,t,n,i){if(n===i)throw new Error("Swap indices cannot be equal");if(n<0||i<0)throw new Error("Swap indices cannot be negative");return{type:r.ARRAY_SWAP,meta:{form:e,field:t,indexA:n,indexB:i}}},h=function(e,t,n){return{type:r.ARRAY_UNSHIFT,meta:{form:e,field:t},payload:n}},v=function(e,t,n){return{type:r.AUTOFILL,meta:{form:e,field:t},payload:n}},y=function(e,t,n,i){return{type:r.BLUR,meta:{form:e,field:t,touch:i},payload:n}},m=function(e,t,n,i,o){return{type:r.CHANGE,meta:{form:e,field:t,touch:i,persistentSubmitErrors:o},payload:n}},g=function(e){return{type:r.CLEAR_SUBMIT,meta:{form:e}}},b=function(e){return{type:r.CLEAR_SUBMIT_ERRORS,meta:{form:e}}},w=function(e,t){return{type:r.CLEAR_ASYNC_ERROR,meta:{form:e,field:t}}},_=function(e,t,n){for(var i=arguments.length,o=Array(i>3?i-3:0),a=3;a<i;a++)o[a-3]=arguments[a];return{type:r.CLEAR_FIELDS,meta:{form:e,keepTouched:t,persistentSubmitErrors:n,fields:o}}},O=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return{type:r.DESTROY,meta:{form:t}}},E=function(e,t){return{type:r.FOCUS,meta:{form:e,field:t}}},S=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n instanceof Object&&(o=n,n=!1),{type:r.INITIALIZE,meta:i({form:e,keepDirty:n},o),payload:t}},x=function(e,t,n){return{type:r.REGISTER_FIELD,meta:{form:e},payload:{name:t,type:n}}},k=function(e){return{type:r.RESET,meta:{form:e}}},j=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return{type:r.RESET_SECTION,meta:{form:e,sections:n}}},C=function(e,t){return{type:r.START_ASYNC_VALIDATION,meta:{form:e,field:t}}},P=function(e){return{type:r.START_SUBMIT,meta:{form:e}}},T=function(e,t){return{type:r.STOP_ASYNC_VALIDATION,meta:{form:e},payload:t,error:!(!t||!Object.keys(t).length)}},R=function(e,t){return{type:r.STOP_SUBMIT,meta:{form:e},payload:t,error:!(!t||!Object.keys(t).length)}},A=function(e){return{type:r.SUBMIT,meta:{form:e}}},F=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return{type:r.SET_SUBMIT_FAILED,meta:{form:e,fields:n},error:!0}},I=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return{type:r.SET_SUBMIT_SUCCEEDED,meta:{form:e,fields:n},error:!1}},N=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return{type:r.TOUCH,meta:{form:e,fields:n}}},M=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return{type:r.UNREGISTER_FIELD,meta:{form:e},payload:{name:t,destroyOnUnmount:n}}},U=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return{type:r.UNTOUCH,meta:{form:e,fields:n}}},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];return{type:r.UPDATE_SYNC_ERRORS,meta:{form:e},payload:{syncErrors:t,error:n}}},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];return{type:r.UPDATE_SYNC_WARNINGS,meta:{form:e},payload:{syncWarnings:t,warning:n}}},L={arrayInsert:o,arrayMove:a,arrayPop:u,arrayPush:c,arrayRemove:s,arrayRemoveAll:l,arrayShift:f,arraySplice:p,arraySwap:d,arrayUnshift:h,autofill:v,blur:y,change:m,clearFields:_,clearSubmit:g,clearSubmitErrors:b,clearAsyncError:w,destroy:O,focus:E,initialize:S,registerField:x,reset:k,resetSection:j,startAsyncValidation:C,startSubmit:P,stopAsyncValidation:T,stopSubmit:R,submit:A,setSubmitFailed:F,setSubmitSucceeded:I,touch:N,unregisterField:M,untouch:U,updateSyncErrors:D,updateSyncWarnings:V};t.a=L},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t,n,r){var o=t.value;return"checkbox"===e?i({},t,{checked:!!o}):"radio"===e?i({},t,{checked:r(o,n),value:n}):"select-multiple"===e?i({},t,{value:o||[]}):"file"===e?i({},t,{value:o||void 0}):t},a=function(e,t,n){var a=e.getIn,u=e.toJS,c=e.deepEqual,s=n.asyncError,l=n.asyncValidating,f=n.onBlur,p=n.onChange,d=n.onDrop,h=n.onDragStart,v=n.dirty,y=n.dispatch,m=n.onFocus,g=n.form,b=n.format,w=n.initial,_=(n.parse,n.pristine),O=n.props,E=n.state,S=n.submitError,x=n.submitFailed,k=n.submitting,j=n.syncError,C=n.syncWarning,P=(n.validate,n.value),T=n._value,R=(n.warn,r(n,["asyncError","asyncValidating","onBlur","onChange","onDrop","onDragStart","dirty","dispatch","onFocus","form","format","initial","parse","pristine","props","state","submitError","submitFailed","submitting","syncError","syncWarning","validate","value","_value","warn"])),A=j||s||S,F=C,I=function(e,n){if(null===n)return e;var r=null==e?"":e;return n?n(e,t):r}(P,b);return{input:o(R.type,{name:t,onBlur:f,onChange:p,onDragStart:h,onDrop:d,onFocus:m,value:I},T,c),meta:i({},u(E),{active:!(!E||!a(E,"active")),asyncValidating:l,autofilled:!(!E||!a(E,"autofilled")),dirty:v,dispatch:y,error:A,form:g,initial:w,warning:F,invalid:!!A,pristine:_,submitting:!!k,submitFailed:!!x,touched:!(!E||!a(E,"touched")),valid:!A,visited:!(!E||!a(E,"visited"))}),custom:i({},R,O)}};t.a=a},function(e,t,n){"use strict";var r=function(e){var t=e.initialized,n=e.trigger,r=e.pristine;if(!e.syncValidationPasses)return!1;switch(n){case"blur":case"change":return!0;case"submit":return!r||!t;default:return!1}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||(!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o))};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||(!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o))};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||(!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o))};t.a=r},function(e,t,n){"use strict";var r=function(e){return!!(e&&e.stopPropagation&&e.preventDefault)};t.a=r},function(e,t,n){"use strict";var r=n(567),i=n(213),o=function(e,t){var o=t.name,a=t.parse,u=t.normalize,c=n.i(r.a)(e,i.a);return a&&(c=a(c,o)),u&&(c=u(o,c)),c};t.a=o},function(e,t,n){"use strict";var r=n(210),i=function(e){var t=n.i(r.a)(e);return t&&e.preventDefault(),t};t.a=i},function(e,t,n){"use strict";var r="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product;t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.deepEqual,n=e.empty,r=e.getIn;return function(e,i){return function(o){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c<a;c++)u[c-1]=arguments[c];var s=i||function(e){return r(e,"form")},l=s(o);if(u&&u.length)return u.every(function(n){var i=r(l,e+".initial."+n),o=r(l,e+".values."+n);return t(i,o)});var f=r(l,e+".initial")||n,p=r(l,e+".values")||f;return t(f,p)}}};t.a=r},function(e,t,n){"use strict";var r=n(195),i=function(e,t,n,r,i,o){if(o)return e===t},o=function(e,t,o){var a=n.i(r.a)(e.props,t,i),u=n.i(r.a)(e.state,o,i);return!a||!u};t.a=o},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e,t,u){function c(){g===m&&(g=m.slice())}function s(){return y}function l(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),g.push(e),function(){if(t){t=!1,c();var n=g.indexOf(e);g.splice(n,1)}}}function f(e){if(!n.i(i.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(b)throw new Error("Reducers may not dispatch actions.");try{b=!0,y=v(y,e)}finally{b=!1}for(var t=m=g,r=0;r<t.length;r++){(0,t[r])()}return e}function p(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");v=e,f({type:a.INIT})}function d(){var e,t=l;return e={subscribe:function(e){function n(){e.next&&e.next(s())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[o.a]=function(){return this},e}var h;if("function"==typeof t&&void 0===u&&(u=t,t=void 0),void 0!==u){if("function"!=typeof u)throw new Error("Expected the enhancer to be a function.");return u(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var v=e,y=t,m=[],g=m,b=!1;return f({type:a.INIT}),h={dispatch:f,subscribe:l,getState:s,replaceReducer:p},h[o.a]=d,h}n.d(t,"b",function(){return a}),t.a=r;var i=n(90),o=n(623),a={INIT:"@@redux/INIT"}},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(10),o=r(i),a=n(535),u=r(a),c=n(38),s=n(95),l=n(94),f=n(546),p=document.getElementById("content"),d=(0,s.combineReducers)({form:l.reducer}),h=(window.devToolsExtension?window.devToolsExtension()(s.createStore):s.createStore)(d),v=function(){var e=n(222).default,t=n(221).default,r=n(431),i=n(532),a=n(531),s=n(533);u.default.hydrate(o.default.createElement(c.Provider,{store:h},o.default.createElement(f.App,{version:"7.4.0",path:"/examples/remoteSubmit",breadcrumbs:(0,f.generateExampleBreadcrumbs)("remoteSubmit","Remote Submit Example","7.4.0")},o.default.createElement(f.Markdown,{content:r}),o.default.createElement("div",{style:{textAlign:"center"}},o.default.createElement("a",{href:"https://codesandbox.io/s/ElYvJR21K",target:"_blank",rel:"noopener noreferrer",style:{fontSize:"1.5em"}},o.default.createElement("i",{className:"fa fa-codepen"})," Open in Sandbox")),o.default.createElement("h2",null,"Form"),o.default.createElement(e,null),o.default.createElement(t,null),o.default.createElement(f.Values,{form:"remoteSubmit"}),o.default.createElement("h2",null,"Code"),o.default.createElement("h4",null,"submit.js"),o.default.createElement(f.Code,{source:s}),o.default.createElement("h4",null,"RemoteSubmitForm.js"),o.default.createElement(f.Code,{source:i}),o.default.createElement("h4",null,"RemoteSubmitButton.js"),o.default.createElement(f.Code,{source:a}))),p)};v()},function(e,t,n){"use strict";(function(e){function t(e,t,n){e[t]||Object[r](e,t,{writable:!0,configurable:!0,value:n})}if(n(423),n(622),n(224),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;var r="defineProperty";t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&t(Array,e,Function.call.bind([][e]))})}).call(t,n(96))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(38),a=n(94),u={padding:"10px 20px",width:140,display:"block",margin:"20px auto",fontSize:"16px"},c=function(e){var t=e.dispatch;return i.default.createElement("button",{type:"button",style:u,onClick:function(){return t((0,a.submit)("remoteSubmit"))}},"Submit")};t.default=(0,o.connect)()(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(10),a=r(o),u=n(94),c=n(223),s=r(c),l=function(e){var t=e.input,n=e.label,r=e.type,o=e.meta,u=o.touched,c=o.error;return a.default.createElement("div",null,a.default.createElement("label",null,n),a.default.createElement("div",null,a.default.createElement("input",i({},t,{placeholder:n,type:r})),u&&c&&a.default.createElement("span",null,c)))},f=function(e){var t=e.error,n=e.handleSubmit;return a.default.createElement("form",{onSubmit:n},a.default.createElement(u.Field,{name:"username",type:"text",component:l,label:"Username"}),a.default.createElement(u.Field,{name:"password",type:"password",component:l,label:"Password"}),t&&a.default.createElement("strong",null,t),a.default.createElement("div",null,"No submit button in the form. The submit button below is a separate unlinked component."))};t.default=(0,u.reduxForm)({form:"remoteSubmit",onSubmit:s.default})(f)},function(e,t,n){"use strict";function r(e){return o(1e3).then(function(){if(!["john","paul","george","ringo"].includes(e.username))throw new i.SubmissionError({username:"User does not exist",_error:"Login failed!"});if("redux-form"!==e.password)throw new i.SubmissionError({password:"Wrong password",_error:"Login failed!"});window.alert("You submitted:\n\n"+JSON.stringify(e,null,2))})}Object.defineProperty(t,"__esModule",{value:!0});var i=n(94),o=function(e){return new Promise(function(t){return setTimeout(t,e)})};t.default=r},function(e,t,n){n(231),e.exports=n(22).RegExp.escape},function(e,t,n){var r=n(5),i=n(69),o=n(6)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(4),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!r(function(){o.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(e,t,n){"use strict";var r=n(1),i=n(30);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),"number"!=e)}},function(e,t,n){var r=n(43),i=n(73),o=n(59);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,u=n(e),c=o.f,s=0;u.length>s;)c.call(e,a=u[s++])&&t.push(a);return t}},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){var r=n(0),i=n(229)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(140)}),n(34)("copyWithin")},function(e,t,n){"use strict";var r=n(0),i=n(26)(4);r(r.P+r.F*!n(24)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(97)}),n(34)("fill")},function(e,t,n){"use strict";var r=n(0),i=n(26)(2);r(r.P+r.F*!n(24)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(26)(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)(o)},function(e,t,n){"use strict";var r=n(0),i=n(26)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)("find")},function(e,t,n){"use strict";var r=n(0),i=n(26)(0),o=n(24)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(23),i=n(0),o=n(11),a=n(151),u=n(105),c=n(9),s=n(99),l=n(121);i(i.S+i.F*!n(71)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,f,p=o(e),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,y=void 0!==v,m=0,g=l(p);if(y&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==g||d==Array&&u(g))for(t=c(p.length),n=new d(t);t>m;m++)s(n,m,y?v(p[m],m):p[m]);else for(f=g.call(p),n=new d;!(i=f.next()).done;m++)s(n,m,y?a(f,v,[i.value,m],!0):i.value);return n.length=m,n}})},function(e,t,n){"use strict";var r=n(0),i=n(65)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(24)(o)),"Array",{indexOf:function(e){return a?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(69)})},function(e,t,n){"use strict";var r=n(0),i=n(20),o=[].join;r(r.P+r.F*(n(58)!=Object||!n(24)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),i=n(20),o=n(29),a=n(9),u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(c||!n(24)(u)),"Array",{lastIndexOf:function(e){if(c)return u.apply(this,arguments)||0;var t=i(this),n=a(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){"use strict";var r=n(0),i=n(26)(1);r(r.P+r.F*!n(24)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(99);r(r.S+r.F*n(4)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),i=n(142);r(r.P+r.F*!n(24)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(0),i=n(142);r(r.P+r.F*!n(24)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,n){"use strict";var r=n(0),i=n(103),o=n(21),a=n(47),u=n(9),c=[].slice;r(r.P+r.F*n(4)(function(){i&&c.call(i)}),"Array",{slice:function(e,t){var n=u(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),s=a(t,n),l=u(s-i),f=new Array(l),p=0;p<l;p++)f[p]="String"==r?this.charAt(i+p):this[i+p];return f}})},function(e,t,n){"use strict";var r=n(0),i=n(26)(3);r(r.P+r.F*!n(24)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(12),o=n(11),a=n(4),u=[].sort,c=[1,2,3];r(r.P+r.F*(a(function(){c.sort(void 0)})||!a(function(){c.sort(null)})||!n(24)(u)),"Array",{sort:function(e){return void 0===e?u.call(o(this)):u.call(o(this),i(e))}})},function(e,t,n){n(46)("Array")},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){var r=n(0),i=n(226);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(30);r(r.P+r.F*n(4)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(6)("toPrimitive"),i=Date.prototype;r in i||n(14)(i,r,n(227))},function(e,t,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(15)(r,"toString",function(){var e=o.call(this);return e===e?i.call(this):"Invalid Date"})},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(143)})},function(e,t,n){"use strict";var r=n(5),i=n(19),o=n(6)("hasInstance"),a=Function.prototype;o in a||n(8).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(8).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(7)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){var r=n(0),i=n(154),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},function(e,t,n){function r(e){return isFinite(e=+e)&&0!=e?e<0?-r(-e):Math.log(e+Math.sqrt(e*e+1)):e}var i=n(0),o=Math.asinh;i(i.S+i.F*!(o&&1/o(0)>0),"Math",{asinh:r})},function(e,t,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),i=n(109);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0),i=n(108);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(153)})},function(e,t,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,u=arguments.length,c=0;a<u;)n=i(arguments[a++]),c<n?(r=c/n,o=o*r*r+1,c=n):n>0?(r=n/c,o+=r*r):o+=n;return c===1/0?1/0:c*Math.sqrt(o)}})},function(e,t,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(4)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(154)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(109)})},function(e,t,n){var r=n(0),i=n(108),o=Math.exp;r(r.S+r.F*n(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),i=n(108),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){"use strict";var r=n(2),i=n(17),o=n(21),a=n(104),u=n(30),c=n(4),s=n(42).f,l=n(18).f,f=n(8).f,p=n(53).trim,d=r.Number,h=d,v=d.prototype,y="Number"==o(n(41)(v)),m="trim"in String.prototype,g=function(e){var t=u(e,!1);if("string"==typeof t&&t.length>2){t=m?t.trim():p(t,3);var n,r,i,o=t.charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),s=0,l=c.length;s<l;s++)if((a=c.charCodeAt(s))<48||a>i)return NaN;return parseInt(c,r)}}return+t};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof d&&(y?c(function(){v.valueOf.call(n)}):"Number"!=o(n))?a(new h(g(t)),n,d):g(t)};for(var b,w=n(7)?s(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),_=0;w.length>_;_++)i(h,b=w[_])&&!i(d,b)&&f(d,b,l(h,b));d.prototype=v,v.constructor=d,n(15)(r,"Number",d)}},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),i=n(2).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(150)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),i=n(150),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),i=n(162);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0),i=n(163);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){"use strict";var r=n(0),i=n(29),o=n(139),a=n(116),u=1..toFixed,c=Math.floor,s=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",f=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*s[n],s[n]=r%1e7,r=c(r/1e7)},p=function(e){for(var t=6,n=0;--t>=0;)n+=s[t],s[t]=c(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var n=String(s[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},h=function(e,t,n){return 0===t?n:t%2==1?h(e,t-1,n*e):h(e*e,t/2,n)},v=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(4)(function(){u.call({})})),"Number",{toFixed:function(e){var t,n,r,u,c=o(this,l),s=i(e),y="",m="0";if(s<0||s>20)throw RangeError(l);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(y="-",c=-c),c>1e-21)if(t=v(c*h(2,69,1))-69,n=t<0?c*h(2,-t,1):c/h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(f(0,n),r=s;r>=7;)f(1e7,0),r-=7;for(f(h(10,r,1),0),r=t-1;r>=23;)p(1<<23),r-=23;p(1<<r),f(1,1),p(2),m=d()}else f(0,n),f(1<<-t,0),m=d()+a.call("0",s);return s>0?(u=m.length,m=y+(u<=s?"0."+a.call("0",s-u)+m:m.slice(0,u-s)+"."+m.slice(u-s))):m=y+m,m}})},function(e,t,n){"use strict";var r=n(0),i=n(4),o=n(139),a=1..toPrecision;r(r.P+r.F*(i(function(){return"1"!==a.call(1,void 0)})||!i(function(){a.call({})})),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(156)})},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(41)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperties:n(157)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperty:n(8).f})},function(e,t,n){var r=n(5),i=n(36).onFreeze;n(28)("freeze",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r=n(20),i=n(18).f;n(28)("getOwnPropertyDescriptor",function(){return function(e,t){return i(r(e),t)}})},function(e,t,n){n(28)("getOwnPropertyNames",function(){return n(158).f})},function(e,t,n){var r=n(11),i=n(19);n(28)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(5);n(28)("isExtensible",function(e){return function(t){return!!r(t)&&(!e||e(t))}})},function(e,t,n){var r=n(5);n(28)("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(5);n(28)("isSealed",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(230)})},function(e,t,n){var r=n(11),i=n(43);n(28)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(5),i=n(36).onFreeze;n(28)("preventExtensions",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r=n(5),i=n(36).onFreeze;n(28)("seal",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(112).set})},function(e,t,n){"use strict";var r=n(57),i={};i[n(6)("toStringTag")]="z",i+""!="[object z]"&&n(15)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(0),i=n(162);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){var r=n(0),i=n(163);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){"use strict";var r,i,o,a,u=n(35),c=n(2),s=n(23),l=n(57),f=n(0),p=n(5),d=n(12),h=n(39),v=n(40),y=n(77),m=n(118).set,g=n(110)(),b=n(111),w=n(164),_=n(79),O=n(165),E=c.TypeError,S=c.process,x=S&&S.versions,k=x&&x.v8||"",j=c.Promise,C="process"==l(S),P=function(){},T=i=b.f,R=!!function(){try{var e=j.resolve(1),t=(e.constructor={})[n(6)("species")]=function(e){e(P,P)};return(C||"function"==typeof PromiseRejectionEvent)&&e.then(P)instanceof t&&0!==k.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(e){}}(),A=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},F=function(e,t){if(!e._n){e._n=!0;var n=e._c;g(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a,u=i?t.ok:t.fail,c=t.resolve,s=t.reject,l=t.domain;try{u?(i||(2==e._h&&M(e),e._h=1),!0===u?n=r:(l&&l.enter(),n=u(r),l&&(l.exit(),a=!0)),n===t.promise?s(E("Promise-chain cycle")):(o=A(n))?o.call(n,c,s):c(n)):s(r)}catch(e){l&&!a&&l.exit(),s(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&I(e)})}},I=function(e){m.call(c,function(){var t,n,r,i=e._v,o=N(e);if(o&&(t=w(function(){C?S.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=C||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){m.call(c,function(){var t;C?S.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})})},U=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),F(t,!0))},D=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=A(e))?g(function(){var r={_w:n,_d:!1};try{t.call(e,s(D,r,1),s(U,r,1))}catch(e){U.call(r,e)}}):(n._v=e,n._s=1,F(n,!1))}catch(e){U.call({_w:n,_d:!1},e)}}};R||(j=function(e){h(this,j,"Promise","_h"),d(e),r.call(this);try{e(s(D,this,1),s(U,this,1))}catch(e){U.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(45)(j.prototype,{then:function(e,t){var n=T(y(this,j));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=C?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&F(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=s(D,e,1),this.reject=s(U,e,1)},b.f=T=function(e){return e===j||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!R,{Promise:j}),n(52)(j,"Promise"),n(46)("Promise"),a=n(22).Promise,f(f.S+f.F*!R,"Promise",{reject:function(e){var t=T(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!R),"Promise",{resolve:function(e){return O(u&&this===a?j:this,e)}}),f(f.S+f.F*!(R&&n(71)(function(e){j.all(e).catch(P)})),"Promise",{all:function(e){var t=this,n=T(t),r=n.resolve,i=n.reject,o=w(function(){var n=[],o=0,a=1;v(e,!1,function(e){var u=o++,c=!1;n.push(void 0),a++,t.resolve(e).then(function(e){c||(c=!0,n[u]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=T(t),r=n.reject,i=w(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){var r=n(0),i=n(12),o=n(1),a=(n(2).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(4)(function(){a(function(){})}),"Reflect",{apply:function(e,t,n){var r=i(e),c=o(n);return a?a(r,t,c):u.call(r,t,c)}})},function(e,t,n){var r=n(0),i=n(41),o=n(12),a=n(1),u=n(5),c=n(4),s=n(143),l=(n(2).Reflect||{}).construct,f=c(function(){function e(){}return!(l(function(){},[],e)instanceof e)}),p=!c(function(){l(function(){})});r(r.S+r.F*(f||p),"Reflect",{construct:function(e,t){o(e),a(t);var n=arguments.length<3?e:o(arguments[2]);if(p&&!f)return l(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(s.apply(e,r))}var c=n.prototype,d=i(u(c)?c:Object.prototype),h=Function.apply.call(e,d,t);return u(h)?h:d}})},function(e,t,n){var r=n(8),i=n(0),o=n(1),a=n(30);i(i.S+i.F*n(4)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){o(e),t=a(t,!0),o(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),i=n(18).f,o=n(1);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(o(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){"use strict";var r=n(0),i=n(1),o=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(106)(o,"Object",function(){var e,t=this,n=t._k;do{if(t._i>=n.length)return{value:void 0,done:!0}}while(!((e=n[t._i++])in t._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(18),i=n(0),o=n(1);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(0),i=n(19),o=n(1);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){function r(e,t){var n,u,l=arguments.length<3?e:arguments[2];return s(e)===l?e[t]:(n=i.f(e,t))?a(n,"value")?n.value:void 0!==n.get?n.get.call(l):void 0:c(u=o(e))?r(u,t,l):void 0}var i=n(18),o=n(19),a=n(17),u=n(0),c=n(5),s=n(1);u(u.S,"Reflect",{get:r})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(1),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(161)})},function(e,t,n){var r=n(0),i=n(1),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),i=n(112);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){function r(e,t,n){var c,p,d=arguments.length<4?e:arguments[3],h=o.f(l(e),t);if(!h){if(f(p=a(e)))return r(p,t,n,d);h=s(0)}if(u(h,"value")){if(!1===h.writable||!f(d))return!1;if(c=o.f(d,t)){if(c.get||c.set||!1===c.writable)return!1;c.value=n,i.f(d,t,c)}else i.f(d,t,s(0,n));return!0}return void 0!==h.set&&(h.set.call(d,n),!0)}var i=n(8),o=n(18),a=n(19),u=n(17),c=n(0),s=n(44),l=n(1),f=n(5);c(c.S,"Reflect",{set:r})},function(e,t,n){var r=n(2),i=n(104),o=n(8).f,a=n(42).f,u=n(70),c=n(68),s=r.RegExp,l=s,f=s.prototype,p=/a/g,d=/a/g,h=new s(p)!==p;if(n(7)&&(!h||n(4)(function(){return d[n(6)("match")]=!1,s(p)!=p||s(d)==d||"/a/i"!=s(p,"i")}))){s=function(e,t){var n=this instanceof s,r=u(e),o=void 0===t;return!n&&r&&e.constructor===s&&o?e:i(h?new l(r&&!o?e.source:e,t):l((r=e instanceof s)?e.source:e,r&&o?c.call(e):t),n?this:f,s)};for(var v=a(l),y=0;v.length>y;)!function(e){e in s||o(s,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})}(v[y++]);f.constructor=s,s.prototype=f,n(15)(r,"RegExp",s)}n(46)("RegExp")},function(e,t,n){n(67)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(67)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},n]})},function(e,t,n){n(67)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(67)("split",2,function(e,t,r){"use strict";var i=n(70),o=r,a=[].push,u="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[u]||2!="ab".split(/(?:ab)*/)[u]||4!=".".split(/(.?)(.?)/)[u]||".".split(/()()/)[u]>1||"".split(/.?/)[u]){var c=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,s,l,f,p,d=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,y=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,h+"g");for(c||(r=new RegExp("^"+m.source+"$(?!\\s)",h));(s=m.exec(n))&&!((l=s.index+s[0][u])>v&&(d.push(n.slice(v,s.index)),!c&&s[u]>1&&s[0].replace(r,function(){for(p=1;p<arguments[u]-2;p++)void 0===arguments[p]&&(s[p]=void 0)}),s[u]>1&&s.index<n[u]&&a.apply(d,s.slice(1)),f=s[0][u],v=l,d[u]>=y));)m.lastIndex===s.index&&m.lastIndex++;return v===n[u]?!f&&m.test("")||d.push(""):d.push(n.slice(v)),d[u]>y?d.slice(0,y):d}}else"0".split(void 0,0)[u]&&(r=function(e,t){return void 0===e&&0===t?[]:o.call(this,e,t)});return[function(n,i){var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]})},function(e,t,n){"use strict";n(170);var r=n(1),i=n(68),o=n(7),a=/./.toString,u=function(e){n(15)(RegExp.prototype,"toString",e,!0)};n(4)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?u(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)}):"toString"!=a.name&&u(function(){return a.call(this)})},function(e,t,n){"use strict";n(16)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(16)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(16)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(16)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";var r=n(0),i=n(114)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(115),a="".endsWith;r(r.P+r.F*n(102)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),u=void 0===n?r:Math.min(i(n),r),c=String(e);return a?a.call(t,c,u):t.slice(u-c.length,u)===c}})},function(e,t,n){"use strict";n(16)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(16)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(16)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){var r=n(0),i=n(47),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){"use strict";var r=n(0),i=n(115);r(r.P+r.F*n(102)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";n(16)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";var r=n(114)(!0);n(107)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";n(16)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){var r=n(0),i=n(20),o=n(9);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(t[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(116)})},function(e,t,n){"use strict";n(16)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(115),a="".startsWith;r(r.P+r.F*n(102)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(16)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(16)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(16)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";n(53)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){"use strict";var r=n(2),i=n(17),o=n(7),a=n(0),u=n(15),c=n(36).KEY,s=n(4),l=n(76),f=n(52),p=n(48),d=n(6),h=n(168),v=n(120),y=n(228),m=n(69),g=n(1),b=n(5),w=n(20),_=n(30),O=n(44),E=n(41),S=n(158),x=n(18),k=n(8),j=n(43),C=x.f,P=k.f,T=S.f,R=r.Symbol,A=r.JSON,F=A&&A.stringify,I=d("_hidden"),N=d("toPrimitive"),M={}.propertyIsEnumerable,U=l("symbol-registry"),D=l("symbols"),V=l("op-symbols"),L=Object.prototype,W="function"==typeof R,z=r.QObject,q=!z||!z.prototype||!z.prototype.findChild,B=o&&s(function(){return 7!=E(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=C(L,t);r&&delete L[t],P(e,t,n),r&&e!==L&&P(L,t,r)}:P,H=function(e){var t=D[e]=E(R.prototype);return t._k=e,t},Y=W&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},$=function(e,t,n){return e===L&&$(V,t,n),g(e),t=_(t,!0),g(n),i(D,t)?(n.enumerable?(i(e,I)&&e[I][t]&&(e[I][t]=!1),n=E(n,{enumerable:O(0,!1)})):(i(e,I)||P(e,I,O(1,{})),e[I][t]=!0),B(e,t,n)):P(e,t,n)},K=function(e,t){g(e);for(var n,r=y(t=w(t)),i=0,o=r.length;o>i;)$(e,n=r[i++],t[n]);return e},G=function(e,t){return void 0===t?E(e):K(E(e),t)},Q=function(e){var t=M.call(this,e=_(e,!0));return!(this===L&&i(D,e)&&!i(V,e))&&(!(t||!i(this,e)||!i(D,e)||i(this,I)&&this[I][e])||t)},J=function(e,t){if(e=w(e),t=_(t,!0),e!==L||!i(D,t)||i(V,t)){var n=C(e,t);return!n||!i(D,t)||i(e,I)&&e[I][t]||(n.enumerable=!0),n}},X=function(e){for(var t,n=T(w(e)),r=[],o=0;n.length>o;)i(D,t=n[o++])||t==I||t==c||r.push(t);return r},Z=function(e){for(var t,n=e===L,r=T(n?V:w(e)),o=[],a=0;r.length>a;)!i(D,t=r[a++])||n&&!i(L,t)||o.push(D[t]);return o};W||(R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===L&&t.call(V,n),i(this,I)&&i(this[I],e)&&(this[I][e]=!1),B(this,e,O(1,n))};return o&&q&&B(L,e,{configurable:!0,set:t}),H(e)},u(R.prototype,"toString",function(){return this._k}),x.f=J,k.f=$,n(42).f=S.f=X,n(59).f=Q,n(73).f=Z,o&&!n(35)&&u(L,"propertyIsEnumerable",Q,!0),h.f=function(e){return H(d(e))}),a(a.G+a.W+a.F*!W,{Symbol:R});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;ee.length>te;)d(ee[te++]);for(var ne=j(d.store),re=0;ne.length>re;)v(ne[re++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=R(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){q=!0},useSimple:function(){q=!1}}),a(a.S+a.F*!W,"Object",{create:G,defineProperty:$,defineProperties:K,getOwnPropertyDescriptor:J,getOwnPropertyNames:X,getOwnPropertySymbols:Z}),A&&a(a.S+a.F*(!W||s(function(){var e=R();return"[null]"!=F([e])||"{}"!=F({a:e})||"{}"!=F(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!Y(e))return m(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,F.apply(A,r)}}),R.prototype[N]||n(14)(R.prototype,N,R.prototype.valueOf),f(R,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){"use strict";var r=n(0),i=n(78),o=n(119),a=n(1),u=n(47),c=n(9),s=n(5),l=n(2).ArrayBuffer,f=n(77),p=o.ArrayBuffer,d=o.DataView,h=i.ABV&&l.isView,v=p.prototype.slice,y=i.VIEW;r(r.G+r.W+r.F*(l!==p),{ArrayBuffer:p}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return h&&h(e)||s(e)&&y in e}}),r(r.P+r.U+r.F*n(4)(function(){return!new p(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(a(this),e);for(var n=a(this).byteLength,r=u(e,n),i=u(void 0===t?n:t,n),o=new(f(this,p))(c(i-r)),s=new d(this),l=new d(o),h=0;r<i;)l.setUint8(h++,s.getUint8(r++));return o}}),n(46)("ArrayBuffer")},function(e,t,n){var r=n(0);r(r.G+r.W+r.F*!n(78).ABV,{DataView:n(119).DataView})},function(e,t,n){n(33)("Float32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Float64",8,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Int16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Int32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Uint16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(33)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}},!0)},function(e,t,n){"use strict";var r=n(146),i=n(54);n(66)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),i=n(147),o=n(11),a=n(9),u=n(12),c=n(98);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return u(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(34)("flatMap")},function(e,t,n){"use strict";var r=n(0),i=n(147),o=n(11),a=n(9),u=n(29),c=n(98);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=o(this),n=a(t.length),r=c(t,0);return i(r,t,t,n,0,void 0===e?1:u(e)),r}}),n(34)("flatten")},function(e,t,n){"use strict";var r=n(0),i=n(65)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)("includes")},function(e,t,n){var r=n(0),i=n(110)(),o=n(2).process,a="process"==n(21)(o);r(r.G,{asap:function(e){var t=a&&o.domain;i(t?t.bind(e):e)}})},function(e,t,n){var r=n(0),i=n(21);r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},function(e,t,n){var r=n(0);r(r.G,{global:n(2)})},function(e,t,n){n(74)("Map")},function(e,t,n){n(75)("Map")},function(e,t,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(145)("Map")})},function(e,t,n){var r=n(0);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(0),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},function(e,t,n){var r=n(0),i=n(155),o=n(153);r(r.S,"Math",{fscale:function(e,t,n,r,a){return o(i(e,t,n,r,a))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,o=t>>>0,a=n>>>0;return o+(r>>>0)+((i&a|(i|a)&~(i+a>>>0))>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>16,u=r>>16,c=(a*o>>>0)+(i*o>>>16);return a*u+(c>>16)+((i*u>>>0)+(65535&c)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,o=t>>>0,a=n>>>0;return o-(r>>>0)-((~i&a|~(i^a)&i-a>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(155)})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{umulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>>16,u=r>>>16,c=(a*o>>>0)+(i*o>>>16);return a*u+(c>>>16)+((i*u>>>0)+(65535&c)>>>16)}})},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(12),a=n(8);n(7)&&r(r.P+n(72),"Object",{__defineGetter__:function(e,t){a.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(12),a=n(8);n(7)&&r(r.P+n(72),"Object",{__defineSetter__:function(e,t){a.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){var r=n(0),i=n(160)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){var r=n(0),i=n(161),o=n(20),a=n(18),u=n(99);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,s=i(r),l={},f=0;s.length>f;)void 0!==(n=c(r,t=s[f++]))&&u(l,t,n);return l}})},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(30),a=n(19),u=n(18).f;n(7)&&r(r.P+n(72),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=u(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(30),a=n(19),u=n(18).f;n(7)&&r(r.P+n(72),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=u(n,r))return t.set}while(n=a(n))}})},function(e,t,n){var r=n(0),i=n(160)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(22),a=n(110)(),u=n(6)("observable"),c=n(12),s=n(1),l=n(39),f=n(45),p=n(14),d=n(40),h=d.RETURN,v=function(e){return null==e?void 0:c(e)},y=function(e){var t=e._c;t&&(e._c=void 0,t())},m=function(e){return void 0===e._o},g=function(e){m(e)||(e._o=void 0,y(e))},b=function(e,t){s(e),this._c=void 0,this._o=e,e=new w(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:c(n),this._c=n)}catch(t){return void e.error(t)}m(this)&&y(this)};b.prototype=f({},{unsubscribe:function(){g(this)}});var w=function(e){this._s=e};w.prototype=f({},{next:function(e){var t=this._s;if(!m(t)){var n=t._o;try{var r=v(n.next);if(r)return r.call(n,e)}catch(e){try{g(t)}finally{throw e}}}},error:function(e){var t=this._s;if(m(t))throw e;var n=t._o;t._o=void 0;try{var r=v(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{y(t)}finally{throw e}}return y(t),e},complete:function(e){var t=this._s;if(!m(t)){var n=t._o;t._o=void 0;try{var r=v(n.complete);e=r?r.call(n,e):void 0}catch(e){try{y(t)}finally{throw e}}return y(t),e}}});var _=function(e){l(this,_,"Observable","_f")._f=c(e)};f(_.prototype,{subscribe:function(e){return new b(e,this._f)},forEach:function(e){var t=this;return new(o.Promise||i.Promise)(function(n,r){c(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})})}}),f(_,{from:function(e){var t="function"==typeof this?this:_,n=v(s(e)[u]);if(n){var r=s(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return a(function(){if(!n){try{if(d(e,!1,function(e){if(t.next(e),n)return h})===h)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e<t;)n[e]=arguments[e++];return new("function"==typeof this?this:_)(function(e){var t=!1;return a(function(){if(!t){for(var r=0;r<n.length;++r)if(e.next(n[r]),t)return;e.complete()}}),function(){t=!0}})}}),p(_.prototype,u,function(){return this}),r(r.G,{Observable:_}),n(46)("Observable")},function(e,t,n){"use strict";var r=n(0),i=n(22),o=n(2),a=n(77),u=n(165);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then(function(){return n})}:e,n?function(n){return u(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(0),i=n(111),o=n(164);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=n(32),i=n(1),o=r.key,a=r.set;r.exp({defineMetadata:function(e,t,n,r){a(e,t,i(n),o(r))}})},function(e,t,n){var r=n(32),i=n(1),o=r.key,a=r.map,u=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:o(arguments[2]),r=a(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var c=u.get(t);return c.delete(n),!!c.size||u.delete(t)}})},function(e,t,n){var r=n(171),i=n(141),o=n(32),a=n(1),u=n(19),c=o.keys,s=o.key,l=function(e,t){var n=c(e,t),o=u(e);if(null===o)return n;var a=l(o,t);return a.length?n.length?i(new r(n.concat(a))):a:n};o.exp({getMetadataKeys:function(e){return l(a(e),arguments.length<2?void 0:s(arguments[1]))}})},function(e,t,n){var r=n(32),i=n(1),o=n(19),a=r.has,u=r.get,c=r.key,s=function(e,t,n){if(a(e,t,n))return u(e,t,n);var r=o(t);return null!==r?s(e,r,n):void 0};r.exp({getMetadata:function(e,t){return s(e,i(t),arguments.length<3?void 0:c(arguments[2]))}})},function(e,t,n){var r=n(32),i=n(1),o=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(e){return o(i(e),arguments.length<2?void 0:a(arguments[1]))}})},function(e,t,n){var r=n(32),i=n(1),o=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(32),i=n(1),o=n(19),a=r.has,u=r.key,c=function(e,t,n){if(a(e,t,n))return!0;var r=o(t);return null!==r&&c(e,r,n)};r.exp({hasMetadata:function(e,t){return c(e,i(t),arguments.length<3?void 0:u(arguments[2]))}})},function(e,t,n){var r=n(32),i=n(1),o=r.has,a=r.key;r.exp({hasOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(32),i=n(1),o=n(12),a=r.key,u=r.set;r.exp({metadata:function(e,t){return function(n,r){u(e,t,(void 0!==r?i:o)(n),a(r))}}})},function(e,t,n){n(74)("Set")},function(e,t,n){n(75)("Set")},function(e,t,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(145)("Set")})},function(e,t,n){"use strict";var r=n(0),i=n(114)(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(27),o=n(9),a=n(70),u=n(68),c=RegExp.prototype,s=function(e,t){this._r=e,this._s=t};n(106)(s,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(i(this),!a(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in c?String(e.flags):u.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=o(e.lastIndex),new s(r,t)}})},function(e,t,n){"use strict";var r=n(0),i=n(166),o=n(79);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";var r=n(0),i=n(166),o=n(79);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){"use strict";n(53)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";n(53)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){n(120)("asyncIterator")},function(e,t,n){n(120)("observable")},function(e,t,n){var r=n(0);r(r.S,"System",{global:n(2)})},function(e,t,n){n(74)("WeakMap")},function(e,t,n){n(75)("WeakMap")},function(e,t,n){n(74)("WeakSet")},function(e,t,n){n(75)("WeakSet")},function(e,t,n){for(var r=n(122),i=n(43),o=n(15),a=n(2),u=n(14),c=n(51),s=n(6),l=s("iterator"),f=s("toStringTag"),p=c.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;v<h.length;v++){var y,m=h[v],g=d[m],b=a[m],w=b&&b.prototype;if(w&&(w[l]||u(w,l,p),w[f]||u(w,f,m),c[m]=p,g))for(y in r)w[y]||o(w,y,r[y],!0)}},function(e,t,n){var r=n(0),i=n(118);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){var r=n(2),i=n(0),o=n(79),a=[].slice,u=/MSIE .\./.test(o),c=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*u,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(e,t,n){n(351),n(290),n(292),n(291),n(294),n(296),n(301),n(295),n(293),n(303),n(302),n(298),n(299),n(297),n(289),n(300),n(304),n(305),n(257),n(259),n(258),n(307),n(306),n(277),n(287),n(288),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(338),n(343),n(350),n(341),n(333),n(334),n(339),n(344),n(346),n(329),n(330),n(331),n(332),n(335),n(336),n(337),n(340),n(342),n(345),n(347),n(348),n(349),n(252),n(254),n(253),n(256),n(255),n(241),n(239),n(245),n(242),n(248),n(250),n(238),n(244),n(235),n(249),n(233),n(247),n(246),n(240),n(243),n(232),n(234),n(237),n(236),n(251),n(122),n(323),n(328),n(170),n(324),n(325),n(326),n(327),n(308),n(169),n(171),n(172),n(363),n(352),n(353),n(358),n(361),n(362),n(356),n(359),n(357),n(360),n(354),n(355),n(309),n(310),n(311),n(312),n(313),n(316),n(314),n(315),n(317),n(318),n(319),n(320),n(322),n(321),n(366),n(364),n(365),n(407),n(410),n(409),n(411),n(412),n(408),n(413),n(414),n(388),n(391),n(387),n(385),n(386),n(389),n(390),n(372),n(406),n(371),n(405),n(417),n(419),n(370),n(404),n(416),n(418),n(369),n(415),n(368),n(373),n(374),n(375),n(376),n(377),n(379),n(378),n(380),n(381),n(382),n(384),n(383),n(393),n(394),n(395),n(396),n(398),n(397),n(400),n(399),n(401),n(402),n(403),n(367),n(392),n(422),n(421),n(420),e.exports=n(22)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:n.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(n,n.constructor),i(n)):(Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,value:new Error(e).stack,writable:!0}),n)}return o(t,e),t}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));t.a=a},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!i(e)&&(i(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var i=n(429);e.exports=r},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=n(428);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!o.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var o=Object.prototype.hasOwnProperty;e.exports=i},function(e,t){e.exports='<h1 id="remote-submit-example">Remote Submit Example</h1>\n<p>This example demonstrates how a form may be submitted by dispatching a <code>SUBMIT</code> action from an\nunrelated component or middleware.</p>\n<p>The &quot;Submit&quot; button you see here is not connected to the form component in any way; it only \ndispatches an action via Redux.</p>\n<p>Notice that for this to work, the submit function must be given to the form component via either \na config value passed to <code>reduxForm()</code> or via a prop.</p>\n<h2 id="running-this-example-locally">Running this example locally</h2>\n<p>To run this example locally on your machine clone the <code>redux-form</code> repository,\nthen <code>cd redux-form</code> to change to the repo directory, and run <code>npm install</code>.</p>\n<p>Then run <code>npm run example:remoteSubmit</code> or manually run the\nfollowing commands:</p>\n<pre><code>cd ./examples/remoteSubmit\nnpm install\nnpm start\n</code></pre><h2 id="how-to-use-the-form-below-">How to use the form below:</h2>\n<ul>\n<li>Usernames that will pass validation: <code>john</code>, <code>paul</code>, <code>george</code>, or <code>ringo</code>.</li>\n<li>Valid password for all users: <code>redux-form</code>.</li>\n</ul>\n'},function(e,t,n){"use strict";var r=n(49),i=n(31),o=n.i(r.a)(i.a,"DataView");t.a=o},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(481),o=n(482),a=n(483),u=n(484),c=n(485);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";var r=n(49),i=n(31),o=n.i(r.a)(i.a,"Promise");t.a=o},function(e,t,n){"use strict";var r=n(49),i=n(31),o=n.i(r.a)(i.a,"Set");t.a=o},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i.a;++t<n;)this.add(e[t])}var i=n(127),o=n(507),a=n(508);r.prototype.add=r.prototype.push=o.a,r.prototype.has=a.a,t.a=r},function(e,t,n){"use strict";var r=n(49),i=n(31),o=n.i(r.a)(i.a,"WeakMap");t.a=o},function(e,t,n){"use strict";function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.a=r},function(e,t,n){"use strict";function r(e,t,r){var a=e[t];u.call(e,t)&&n.i(o.a)(a,r)&&(void 0!==r||t in e)||n.i(i.a)(e,t,r)}var i=n(83),o=n(61),a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";var r=n(37),i=Object.create,o=function(){function e(){}return function(t){if(!n.i(r.a)(t))return{};if(i)return i(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();t.a=o},function(e,t,n){"use strict";function r(e,t){return e&&n.i(i.a)(e,t,o.a)}var i=n(179),o=n(134);t.a=r},function(e,t,n){"use strict";function r(e,t,r){var a=t(e);return n.i(o.a)(e)?a:n.i(i.a)(a,r(e))}var i=n(440),o=n(25);t.a=r},function(e,t,n){"use strict";function r(e,t){return null!=e&&t in Object(e)}t.a=r},function(e,t,n){"use strict";function r(e){return n.i(o.a)(e)&&n.i(i.a)(e)==a}var i=n(56),o=n(50),a="[object Arguments]";t.a=r},function(e,t,n){"use strict";function r(e,t,r,y,g,b){var w=n.i(s.a)(e),_=n.i(s.a)(t),O=w?h:n.i(c.a)(e),E=_?h:n.i(c.a)(t);O=O==d?v:O,E=E==d?v:E;var S=O==v,x=E==v,k=O==E;if(k&&n.i(l.a)(e)){if(!n.i(l.a)(t))return!1;w=!0,S=!1}if(k&&!S)return b||(b=new i.a),w||n.i(f.a)(e)?n.i(o.a)(e,t,r,y,g,b):n.i(a.a)(e,t,O,r,y,g,b);if(!(r&p)){var j=S&&m.call(e,"__wrapped__"),C=x&&m.call(t,"__wrapped__");if(j||C){var P=j?e.value():e,T=C?t.value():t;return b||(b=new i.a),g(P,T,r,y,b)}}return!!k&&(b||(b=new i.a),n.i(u.a)(e,t,r,y,g,b))}var i=n(128),o=n(185),a=n(473),u=n(474),c=n(188),s=n(25),l=n(89),f=n(92),p=1,d="[object Arguments]",h="[object Array]",v="[object Object]",y=Object.prototype,m=y.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t,r,c){var s=r.length,l=s,f=!c;if(null==e)return!l;for(e=Object(e);s--;){var p=r[s];if(f&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++s<l;){p=r[s];var d=p[0],h=e[d],v=p[1];if(f&&p[2]){if(void 0===h&&!(d in e))return!1}else{var y=new i.a;if(c)var m=c(h,v,d,e,t,y);if(!(void 0===m?n.i(o.a)(v,h,a|u,c,y):m))return!1}}return!0}var i=n(128),o=n(84),a=1,u=2;t.a=r},function(e,t,n){"use strict";function r(e){return!(!n.i(a.a)(e)||n.i(o.a)(e))&&(n.i(i.a)(e)?h:s).test(n.i(u.a)(e))}var i=n(132),o=n(489),a=n(37),u=n(194),c=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,p=l.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.a=r},function(e,t,n){"use strict";function r(e){return n.i(a.a)(e)&&n.i(o.a)(e.length)&&!!u[n.i(i.a)(e)]}var i=n(56),o=n(133),a=n(50),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.a=r},function(e,t,n){"use strict";function r(e){return"function"==typeof e?e:null==e?a.a:"object"==typeof e?n.i(u.a)(e)?n.i(o.a)(e[0],e[1]):n.i(i.a)(e):n.i(c.a)(e)}var i=n(454),o=n(455),a=n(131),u=n(25),c=n(525);t.a=r},function(e,t,n){"use strict";function r(e){if(!n.i(i.a)(e))return n.i(a.a)(e);var t=n.i(o.a)(e),r=[];for(var u in e)("constructor"!=u||!t&&c.call(e,u))&&r.push(u);return r}var i=n(37),o=n(86),a=n(503),u=Object.prototype,c=u.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){var t=n.i(o.a)(e);return 1==t.length&&t[0][2]?n.i(a.a)(t[0][0],t[0][1]):function(r){return r===e||n.i(i.a)(r,e,t)}}var i=n(449),o=n(476),a=n(190);t.a=r},function(e,t,n){"use strict";function r(e,t){return n.i(u.a)(e)&&n.i(c.a)(t)?n.i(s.a)(n.i(l.a)(e),t):function(r){var u=n.i(o.a)(r,e);return void 0===u&&u===t?n.i(a.a)(r,e):n.i(i.a)(t,u,f|p)}}var i=n(84),o=n(518),a=n(519),u=n(130),c=n(189),s=n(190),l=n(60),f=1,p=2;t.a=r},function(e,t,n){"use strict";function r(e,t,f,p,d){e!==t&&n.i(a.a)(t,function(a,s){if(n.i(c.a)(a))d||(d=new i.a),n.i(u.a)(e,t,s,f,r,p,d);else{var h=p?p(n.i(l.a)(e,s),a,s+"",e,t,d):void 0;void 0===h&&(h=a),n.i(o.a)(e,s,h)}},s.a)}var i=n(128),o=n(178),a=n(179),u=n(457),c=n(37),s=n(196),l=n(192);t.a=r},function(e,t,n){"use strict";function r(e,t,r,b,w,_,O){var E=n.i(m.a)(e,r),S=n.i(m.a)(t,r),x=O.get(S);if(x)return void n.i(i.a)(e,r,x);var k=_?_(E,S,r+"",e,t,O):void 0,j=void 0===k;if(j){var C=n.i(l.a)(S),P=!C&&n.i(p.a)(S),T=!C&&!P&&n.i(y.a)(S);k=S,C||P||T?n.i(l.a)(E)?k=E:n.i(f.a)(E)?k=n.i(u.a)(E):P?(j=!1,k=n.i(o.a)(S,!0)):T?(j=!1,k=n.i(a.a)(S,!0)):k=[]:n.i(v.a)(S)||n.i(s.a)(S)?(k=E,n.i(s.a)(E)?k=n.i(g.a)(E):(!n.i(h.a)(E)||b&&n.i(d.a)(E))&&(k=n.i(c.a)(S))):j=!1}j&&(O.set(S,k),w(k,S,b,_,O),O.delete(S)),n.i(i.a)(e,r,k)}var i=n(178),o=n(467),a=n(468),u=n(183),c=n(486),s=n(88),l=n(25),f=n(520),p=n(89),d=n(132),h=n(37),v=n(90),y=n(92),m=n(192),g=n(528);t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return null==t?void 0:t[e]}}t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return n.i(i.a)(t,e)}}var i=n(180);t.a=r},function(e,t,n){"use strict";function r(e,t){return n.i(a.a)(n.i(o.a)(e,t,i.a),e+"")}var i=n(131),o=n(506),a=n(510);t.a=r},function(e,t,n){"use strict";var r=n(517),i=n(184),o=n(131),a=i.a?function(e,t){return n.i(i.a)(e,"toString",{configurable:!0,enumerable:!1,value:n.i(r.a)(t),writable:!0})}:o.a;t.a=a},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.a=r},function(e,t,n){"use strict";function r(e){if("string"==typeof e)return e;if(n.i(a.a)(e))return n.i(o.a)(e,r)+"";if(n.i(u.a)(e))return l?l.call(e):"";var t=e+"";return"0"==t&&1/e==-c?"-0":t}var i=n(81),o=n(177),a=n(25),u=n(91),c=1/0,s=i.a?i.a.prototype:void 0,l=s?s.toString:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return e(t)}}t.a=r},function(e,t,n){"use strict";function r(e,t){return e.has(t)}t.a=r},function(e,t,n){"use strict";function r(e){var t=new e.constructor(e.byteLength);return new i.a(t).set(new i.a(e)),t}var i=n(175);t.a=r},function(e,t,n){"use strict";(function(e){function r(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}var i=n(31),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===o,c=u?i.a.Buffer:void 0,s=c?c.allocUnsafe:void 0;t.a=r}).call(t,n(64)(e))},function(e,t,n){"use strict";function r(e,t){var r=t?n.i(i.a)(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var i=n(466);t.a=r},function(e,t,n){"use strict";function r(e,t,r,a){var u=!r;r||(r={});for(var c=-1,s=t.length;++c<s;){var l=t[c],f=a?a(r[l],e[l],l,r,e):void 0;void 0===f&&(f=e[l]),u?n.i(o.a)(r,l,f):n.i(i.a)(r,l,f)}return r}var i=n(442),o=n(83);t.a=r},function(e,t,n){"use strict";var r=n(31),i=r.a["__core-js_shared__"];t.a=i},function(e,t,n){"use strict";function r(e){return n.i(i.a)(function(t,r){var i=-1,a=r.length,u=a>1?r[a-1]:void 0,c=a>2?r[2]:void 0;for(u=e.length>3&&"function"==typeof u?(a--,u):void 0,c&&n.i(o.a)(r[0],r[1],c)&&(u=a<3?void 0:u,a=1),t=Object(t);++i<a;){var s=r[i];s&&e(t,s,i,u)}return t})}var i=n(460),o=n(487);t.a=r},function(e,t,n){"use strict";function r(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),u=a.length;u--;){var c=a[e?u:++i];if(!1===n(o[c],c,o))break}return t}}t.a=r},function(e,t,n){"use strict";function r(e,t,r,i,E,x,k){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!x(new o.a(e),new o.a(t)));case p:case d:case y:return n.i(a.a)(+e,+t);case h:return e.name==t.name&&e.message==t.message;case m:case b:return e==t+"";case v:var j=c.a;case g:var C=i&l;if(j||(j=s.a),e.size!=t.size&&!C)return!1;var P=k.get(e);if(P)return P==t;i|=f,k.set(e,t);var T=n.i(u.a)(j(e),j(t),i,E,x,k);return k.delete(e),T;case w:if(S)return S.call(e)==S.call(t)}return!1}var i=n(81),o=n(175),a=n(61),u=n(185),c=n(500),s=n(509),l=1,f=2,p="[object Boolean]",d="[object Date]",h="[object Error]",v="[object Map]",y="[object Number]",m="[object RegExp]",g="[object Set]",b="[object String]",w="[object Symbol]",_="[object ArrayBuffer]",O="[object DataView]",E=i.a?i.a.prototype:void 0,S=E?E.valueOf:void 0;t.a=r},function(e,t,n){"use strict";function r(e,t,r,a,c,s){var l=r&o,f=n.i(i.a)(e),p=f.length;if(p!=n.i(i.a)(t).length&&!l)return!1;for(var d=p;d--;){var h=f[d];if(!(l?h in t:u.call(t,h)))return!1}var v=s.get(e);if(v&&s.get(t))return v==t;var y=!0;s.set(e,t),s.set(t,e);for(var m=l;++d<p;){h=f[d];var g=e[h],b=t[h];if(a)var w=l?a(b,g,h,t,e,s):a(g,b,h,e,t,s);if(!(void 0===w?g===b||c(g,b,r,a,s):w)){y=!1;break}m||(m="constructor"==h)}if(y&&!m){var _=e.constructor,O=t.constructor;_!=O&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof O&&O instanceof O)&&(y=!1)}return s.delete(e),s.delete(t),y}var i=n(475),o=1,a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){return n.i(i.a)(e,a.a,o.a)}var i=n(445),o=n(478),a=n(134);t.a=r},function(e,t,n){"use strict";function r(e){for(var t=n.i(o.a)(e),r=t.length;r--;){var a=t[r],u=e[a];t[r]=[a,u,n.i(i.a)(u)]}return t}var i=n(189),o=n(134);t.a=r},function(e,t,n){"use strict";function r(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var i=u.call(e);return r&&(t?e[c]=n:delete e[c]),i}var i=n(81),o=Object.prototype,a=o.hasOwnProperty,u=o.toString,c=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";var r=n(439),i=n(526),o=Object.prototype,a=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols,c=u?function(e){return null==e?[]:(e=Object(e),n.i(r.a)(u(e),function(t){return a.call(e,t)}))}:i.a;t.a=c},function(e,t,n){"use strict";function r(e,t){return null==e?void 0:e[t]}t.a=r},function(e,t,n){"use strict";function r(e,t,r){t=n.i(i.a)(t,e);for(var l=-1,f=t.length,p=!1;++l<f;){var d=n.i(s.a)(t[l]);if(!(p=null!=e&&r(e,d)))break;e=e[d]}return p||++l!=f?p:!!(f=null==e?0:e.length)&&n.i(c.a)(f)&&n.i(u.a)(d,f)&&(n.i(a.a)(e)||n.i(o.a)(e))}var i=n(182),o=n(88),a=n(25),u=n(129),c=n(133),s=n(60);t.a=r},function(e,t,n){"use strict";function r(){this.__data__=i.a?n.i(i.a)(null):{},this.size=0}var i=n(87);t.a=r},function(e,t,n){"use strict";function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__;if(i.a){var n=t[e];return n===o?void 0:n}return u.call(t,e)?t[e]:void 0}var i=n(87),o="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__;return i.a?void 0!==t[e]:a.call(t,e)}var i=n(87),o=Object.prototype,a=o.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i.a&&void 0===t?o:t,this}var i=n(87),o="__lodash_hash_undefined__";t.a=r},function(e,t,n){"use strict";function r(e){return"function"!=typeof e.constructor||n.i(a.a)(e)?{}:n.i(i.a)(n.i(o.a)(e))}var i=n(443),o=n(187),a=n(86);t.a=r},function(e,t,n){"use strict";function r(e,t,r){if(!n.i(u.a)(r))return!1;var c=typeof t;return!!("number"==c?n.i(o.a)(r)&&n.i(a.a)(t,r.length):"string"==c&&t in r)&&n.i(i.a)(r[t],e)}var i=n(61),o=n(62),a=n(129),u=n(37);t.a=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.a=r},function(e,t,n){"use strict";function r(e){return!!o&&o in e}var i=n(470),o=function(){var e=/[^.]+$/.exec(i.a&&i.a.keys&&i.a.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.a=r},function(e,t,n){"use strict";function r(){this.__data__=[],this.size=0}t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,r=n.i(i.a)(t,e);return!(r<0)&&(r==t.length-1?t.pop():a.call(t,r,1),--this.size,!0)}var i=n(82),o=Array.prototype,a=o.splice;t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,r=n.i(i.a)(t,e);return r<0?void 0:t[r][1]}var i=n(82);t.a=r},function(e,t,n){"use strict";function r(e){return n.i(i.a)(this.__data__,e)>-1}var i=n(82);t.a=r},function(e,t,n){"use strict";function r(e,t){var r=this.__data__,o=n.i(i.a)(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}var i=n(82);t.a=r},function(e,t,n){"use strict";function r(){this.size=0,this.__data__={hash:new i.a,map:new(a.a||o.a),string:new i.a}}var i=n(433),o=n(80),a=n(126);t.a=r},function(e,t,n){"use strict";function r(e){var t=n.i(i.a)(this,e).delete(e);return this.size-=t?1:0,t}var i=n(85);t.a=r},function(e,t,n){"use strict";function r(e){return n.i(i.a)(this,e).get(e)}var i=n(85);t.a=r},function(e,t,n){"use strict";function r(e){return n.i(i.a)(this,e).has(e)}var i=n(85);t.a=r},function(e,t,n){"use strict";function r(e,t){var r=n.i(i.a)(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}var i=n(85);t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.a=r},function(e,t,n){"use strict";function r(e){var t=n.i(i.a)(e,function(e){return r.size===o&&r.clear(),e}),r=t.cache;return t}var i=n(523),o=500;t.a=r},function(e,t,n){"use strict";var r=n(191),i=n.i(r.a)(Object.keys,Object);t.a=i},function(e,t,n){"use strict";function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.a=r},function(e,t,n){"use strict";(function(e){var r=n(186),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i,u=a&&r.a.process,c=function(){try{var e=o&&o.require&&o.require("util").types;return e||u&&u.binding&&u.binding("util")}catch(e){}}();t.a=c}).call(t,n(64)(e))},function(e,t,n){"use strict";function r(e){return o.call(e)}var i=Object.prototype,o=i.toString;t.a=r},function(e,t,n){"use strict";function r(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,u=-1,c=o(a.length-t,0),s=Array(c);++u<c;)s[u]=a[t+u];u=-1;for(var l=Array(t+1);++u<t;)l[u]=a[u];return l[t]=r(s),n.i(i.a)(e,this,l)}}var i=n(438),o=Math.max;t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.set(e,i),this}var i="__lodash_hash_undefined__";t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.has(e)}t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.a=r},function(e,t,n){"use strict";var r=n(461),i=n(511),o=n.i(i.a)(r.a);t.a=o},function(e,t,n){"use strict";function r(e){var t=0,n=0;return function(){var r=a(),u=o-(r-n);if(n=r,u>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var i=800,o=16,a=Date.now;t.a=r},function(e,t,n){"use strict";function r(){this.__data__=new i.a,this.size=0}var i=n(80);t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.get(e)}t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.has(e)}t.a=r},function(e,t,n){"use strict";function r(e,t){var n=this.__data__;if(n instanceof i.a){var r=n.__data__;if(!o.a||r.length<u-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new a.a(r)}return n.set(e,t),this.size=n.size,this}var i=n(80),o=n(126),a=n(127),u=200;t.a=r},function(e,t,n){"use strict";function r(e){return function(){return e}}t.a=r},function(e,t,n){"use strict";function r(e,t,r){var o=null==e?void 0:n.i(i.a)(e,t);return void 0===o?r:o}var i=n(180);t.a=r},function(e,t,n){"use strict";function r(e,t){return null!=e&&n.i(o.a)(e,t,i.a)}var i=n(446),o=n(480);t.a=r},function(e,t,n){"use strict";function r(e){return n.i(o.a)(e)&&n.i(i.a)(e)}var i=n(62),o=n(50);t.a=r},function(e,t,n){"use strict";function r(e){if(null==e)return!0;if(n.i(c.a)(e)&&(n.i(u.a)(e)||"string"==typeof e||"function"==typeof e.splice||n.i(s.a)(e)||n.i(f.a)(e)||n.i(a.a)(e)))return!e.length;var t=n.i(o.a)(e);if(t==p||t==d)return!e.size;if(n.i(l.a)(e))return!n.i(i.a)(e).length;for(var r in e)if(v.call(e,r))return!1;return!0}var i=n(181),o=n(188),a=n(88),u=n(25),c=n(62),s=n(89),l=n(86),f=n(92),p="[object Map]",d="[object Set]",h=Object.prototype,v=h.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t){return n.i(i.a)(e,t)}var i=n(84);t.a=r},function(e,t,n){"use strict";function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(r.Cache||i.a),n}var i=n(127),o="Expected a function";r.Cache=i.a,t.a=r},function(e,t,n){"use strict";var r=n(456),i=n(471),o=n.i(i.a)(function(e,t,i){n.i(r.a)(e,t,i)});t.a=o},function(e,t,n){"use strict";function r(e){return n.i(a.a)(e)?n.i(i.a)(n.i(u.a)(e)):n.i(o.a)(e)}var i=n(458),o=n(459),a=n(130),u=n(60);t.a=r},function(e,t,n){"use strict";function r(){return[]}t.a=r},function(e,t,n){"use strict";function r(){return!1}t.a=r},function(e,t,n){"use strict";function r(e){return n.i(i.a)(e,n.i(o.a)(e))}var i=n(469),o=n(196);t.a=r},function(e,t,n){"use strict";var r=n(123),i=n(124),o=n(530);e.exports=function(){function e(e,t,n,r,a,u){u!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports="import React from 'react'\nimport { connect } from 'react-redux'\nimport { submit } from 'redux-form'\n\nconst style = {\n padding: '10px 20px',\n width: 140,\n display: 'block',\n margin: '20px auto',\n fontSize: '16px'\n}\n\nconst RemoteSubmitButton = ({ dispatch }) => (\n <button\n type=\"button\"\n style={style}\n onClick={() => dispatch(submit('remoteSubmit'))}\n >\n Submit\n </button>\n)\n// ^^^^^^^^^^^^ name of the form\n\nexport default connect()(RemoteSubmitButton)\n"},function(e,t){e.exports='import React from \'react\'\nimport { Field, reduxForm } from \'redux-form\'\nimport submit from \'./submit\'\n\nconst renderField = ({ input, label, type, meta: { touched, error } }) => (\n <div>\n <label>{label}</label>\n <div>\n <input {...input} placeholder={label} type={type} />\n {touched && error && <span>{error}</span>}\n </div>\n </div>\n)\n\nconst RemoteSubmitForm = props => {\n const { error, handleSubmit } = props\n return (\n <form onSubmit={handleSubmit}>\n <Field\n name="username"\n type="text"\n component={renderField}\n label="Username"\n />\n <Field\n name="password"\n type="password"\n component={renderField}\n label="Password"\n />\n {error && <strong>{error}</strong>}\n <div>\n No submit button in the form. The submit button below is a separate\n unlinked component.\n </div>\n </form>\n )\n}\n\nexport default reduxForm({\n form: \'remoteSubmit\', // a unique identifier for this form\n onSubmit: submit // submit function must be passed to onSubmit\n})(RemoteSubmitForm)\n'},function(e,t){e.exports="import { SubmissionError } from 'redux-form'\n\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms))\n\nfunction submit(values) {\n return sleep(1000).then(() => {\n // simulate server latency\n if (!['john', 'paul', 'george', 'ringo'].includes(values.username)) {\n throw new SubmissionError({\n username: 'User does not exist',\n _error: 'Login failed!'\n })\n } else if (values.password !== 'redux-form') {\n throw new SubmissionError({\n password: 'Wrong password',\n _error: 'Login failed!'\n })\n } else {\n window.alert(`You submitted:\\n\\n${JSON.stringify(values, null, 2)}`)\n }\n })\n}\n\nexport default submit\n"},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);Fr(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function i(e,t,n,r,i,o,a,u,c){this._hasCaughtError=!1,this._caughtError=null;var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}function o(){if(zr._hasRethrowError){var e=zr._rethrowError;throw zr._rethrowError=null,zr._hasRethrowError=!1,e}}function a(){if(qr)for(var e in Br){var t=Br[e],n=qr.indexOf(e);if(-1<n||r("96",e),!Hr[n]){t.extractEvents||r("97",e),Hr[n]=t,n=t.eventTypes;for(var i in n){var o=void 0,a=n[i],c=t,s=i;Yr.hasOwnProperty(s)&&r("99",s),Yr[s]=a;var l=a.phasedRegistrationNames;if(l){for(o in l)l.hasOwnProperty(o)&&u(l[o],c,s);o=!0}else a.registrationName?(u(a.registrationName,c,s),o=!0):o=!1;o||r("98",i,e)}}}}function u(e,t,n){$r[e]&&r("100",e),$r[e]=t,Kr[e]=t.eventTypes[n].dependencies}function c(e){qr&&r("101"),qr=Array.prototype.slice.call(e),a()}function s(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var i=e[t];Br.hasOwnProperty(t)&&Br[t]===i||(Br[t]&&r("102",t),Br[t]=i,n=!0)}n&&a()}function l(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=Xr(r),zr.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function f(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function p(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function d(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;i<n.length&&!e.isPropagationStopped();i++)l(e,t,n[i],r[i]);else n&&l(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function h(e){return d(e,!0)}function v(e){return d(e,!1)}function y(e,t){var n=e.stateNode;if(!n)return null;var i=Qr(n);if(!i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(i=!i.disabled)||(e=e.type,i=!("button"===e||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function m(e,t){null!==e&&(Zr=f(Zr,e)),e=Zr,Zr=null,e&&(t?p(e,h):p(e,v),Zr&&r("95"),zr.rethrowCaughtError())}function g(e,t,n,r){for(var i=null,o=0;o<Hr.length;o++){var a=Hr[o];a&&(a=a.extractEvents(e,t,n,r))&&(i=f(i,a))}m(i,!1)}function b(e){if(e[ri])return e[ri];for(;!e[ri];){if(!e.parentNode)return null;e=e.parentNode}return e=e[ri],5===e.tag||6===e.tag?e:null}function w(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function _(e){return e[ii]||null}function O(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function E(e,t,n){for(var r=[];e;)r.push(e),e=O(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function S(e,t,n){(t=y(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=f(n._dispatchListeners,t),n._dispatchInstances=f(n._dispatchInstances,e))}function x(e){e&&e.dispatchConfig.phasedRegistrationNames&&E(e._targetInst,S,e)}function k(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;t=t?O(t):null,E(t,S,e)}}function j(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=y(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=f(n._dispatchListeners,t),n._dispatchInstances=f(n._dispatchInstances,e))}function C(e){e&&e.dispatchConfig.registrationName&&j(e._targetInst,null,e)}function P(e){p(e,x)}function T(e,t,n,r){if(n&&r)e:{for(var i=n,o=r,a=0,u=i;u;u=O(u))a++;u=0;for(var c=o;c;c=O(c))u++;for(;0<a-u;)i=O(i),a--;for(;0<u-a;)o=O(o),u--;for(;a--;){if(i===o||i===o.alternate)break e;i=O(i),o=O(o)}i=null}else i=null;for(o=i,i=[];n&&n!==o&&(null===(a=n.alternate)||a!==o);)i.push(n),n=O(n);for(n=[];r&&r!==o&&(null===(a=r.alternate)||a!==o);)n.push(r),r=O(r);for(r=0;r<i.length;r++)j(i[r],"bubbled",e);for(e=n.length;0<e--;)j(n[e],"captured",t)}function R(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function A(e){if(ci[e])return ci[e];if(!ui[e])return e;var t,n=ui[e];for(t in n)if(n.hasOwnProperty(t)&&t in si)return ci[e]=n[t];return e}function F(){return!vi&&Nr.canUseDOM&&(vi="textContent"in document.documentElement?"textContent":"innerText"),vi}function I(){if(yi._fallbackText)return yi._fallbackText;var e,t,n=yi._startText,r=n.length,i=N(),o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return yi._fallbackText=i.slice(e,1<t?1-t:void 0),yi._fallbackText}function N(){return"value"in yi._root?yi._root.value:yi._root[F()]}function M(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface;for(var i in e)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Ur.thatReturnsTrue:Ur.thatReturnsFalse,this.isPropagationStopped=Ur.thatReturnsFalse,this}function U(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function D(e){e instanceof this||r("223"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function V(e){e.eventPool=[],e.getPooled=U,e.release=D}function L(e,t){switch(e){case"keyup":return-1!==_i.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function W(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function z(e,t){switch(e){case"compositionend":return W(t);case"keypress":return 32!==t.which?null:(Ci=!0,ki);case"textInput":return e=t.data,e===ki&&Ci?null:e;default:return null}}function q(e,t){if(Pi)return"compositionend"===e||!Oi&&L(e,t)?(e=I(),yi._root=null,yi._startText=null,yi._fallbackText=null,Pi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return xi?null:t.data;default:return null}}function B(e){if(e=Jr(e)){Ri&&"function"==typeof Ri.restoreControlledState||r("194");var t=Qr(e.stateNode);Ri.restoreControlledState(e.stateNode,e.type,t)}}function H(e){Fi?Ii?Ii.push(e):Ii=[e]:Fi=e}function Y(){return null!==Fi||null!==Ii}function $(){if(Fi){var e=Fi,t=Ii;if(Ii=Fi=null,B(e),t)for(e=0;e<t.length;e++)B(t[e])}}function K(e,t){return e(t)}function G(e,t,n){return e(t,n)}function Q(){}function J(e,t){if(Mi)return e(t);Mi=!0;try{return K(e,t)}finally{Mi=!1,Y()&&(Q(),$())}}function X(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ui[e.type]:"textarea"===t}function Z(e){return e=e.target||window,e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ee(e,t){return!(!Nr.canUseDOM||t&&!("addEventListener"in document))&&(e="on"+e,t=e in document,t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t="function"==typeof t[e]),t)}function te(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ne(e){var t=te(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function re(e){e._valueTracker||(e._valueTracker=ne(e))}function ie(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=te(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function oe(e){return null===e||void 0===e?null:(e=Qi&&e[Qi]||e["@@iterator"],"function"==typeof e?e:null)}function ae(e){var t=e.type;if("function"==typeof t)return t.displayName||t.name;if("string"==typeof t)return t;switch(t){case $i:return"AsyncMode";case Yi:return"Context.Consumer";case zi:return"ReactFragment";case Wi:return"ReactPortal";case Bi:return"Profiler("+e.pendingProps.id+")";case Hi:return"Context.Provider";case qi:return"StrictMode";case Gi:return"Timeout"}if("object"==typeof t&&null!==t)switch(t.$$typeof){case Ki:return e=t.render.displayName||t.render.name||"",""!==e?"ForwardRef("+e+")":"ForwardRef"}return null}function ue(e){var t="";do{e:switch(e.tag){case 0:case 1:case 2:case 5:var n=e._debugOwner,r=e._debugSource,i=ae(e),o=null;n&&(o=ae(n)),n=r,i="\n in "+(i||"Unknown")+(n?" (at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+")":o?" (created by "+o+")":"");break e;default:i=""}t+=i,e=e.return}while(e);return t}function ce(e){return!!Zi.hasOwnProperty(e)||!Xi.hasOwnProperty(e)&&(Ji.test(e)?Zi[e]=!0:(Xi[e]=!0,!1))}function se(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function le(e,t,n,r){if(null===t||void 0===t||se(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fe(e,t,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t}function pe(e){return e[1].toUpperCase()}function de(e,t,n,r){var i=eo.hasOwnProperty(t)?eo[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(le(t,n,i,r)&&(n=null),r||null===i?ce(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(i=i.type,n=3===i||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function he(e,t){var n=t.checked;return Mr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ve(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=we(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ye(e,t){null!=(t=t.checked)&&de(e,"checked",t,!1)}function me(e,t){ye(e,t);var n=we(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?be(e,t.type,n):t.hasOwnProperty("defaultValue")&&be(e,t.type,we(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ge(e,t){(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue"))&&(""===e.value&&(e.value=""+e._wrapperState.initialValue),e.defaultValue=""+e._wrapperState.initialValue),t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)}function be(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function we(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function _e(e,t,n){return e=M.getPooled(no.change,e,t,n),e.type="change",H(n),P(e),e}function Oe(e){m(e,!1)}function Ee(e){if(ie(w(e)))return e}function Se(e,t){if("change"===e)return t}function xe(){ro&&(ro.detachEvent("onpropertychange",ke),io=ro=null)}function ke(e){"value"===e.propertyName&&Ee(io)&&(e=_e(io,e,Z(e)),J(Oe,e))}function je(e,t,n){"focus"===e?(xe(),ro=t,io=n,ro.attachEvent("onpropertychange",ke)):"blur"===e&&xe()}function Ce(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Ee(io)}function Pe(e,t){if("click"===e)return Ee(t)}function Te(e,t){if("input"===e||"change"===e)return Ee(t)}function Re(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=co[e])&&!!t[e]}function Ae(){return Re}function Fe(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(t=t.return,0!=(2&t.effectTag))return 1}return 3===t.tag?2:3}function Ie(e){2!==Fe(e)&&r("188")}function Ne(e){var t=e.alternate;if(!t)return t=Fe(e),3===t&&r("188"),1===t?null:e;for(var n=e,i=t;;){var o=n.return,a=o?o.alternate:null;if(!o||!a)break;if(o.child===a.child){for(var u=o.child;u;){if(u===n)return Ie(o),e;if(u===i)return Ie(o),t;u=u.sibling}r("188")}if(n.return!==i.return)n=o,i=a;else{u=!1;for(var c=o.child;c;){if(c===n){u=!0,n=o,i=a;break}if(c===i){u=!0,i=o,n=a;break}c=c.sibling}if(!u){for(c=a.child;c;){if(c===n){u=!0,n=a,i=o;break}if(c===i){u=!0,i=a,n=o;break}c=c.sibling}u||r("189")}}n.alternate!==i&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}function Me(e){if(!(e=Ne(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ue(e){if(!(e=Ne(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function De(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Ve(e,t){var n=e[0];e=e[1];var r="on"+(e[0].toUpperCase()+e.slice(1));t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},xo[e]=t,ko[n]=t}function Le(e){var t=e.targetInst;do{if(!t){e.ancestors.push(t);break}var n;for(n=t;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(t),t=b(n)}while(t);for(n=0;n<e.ancestors.length;n++)t=e.ancestors[n],g(e.topLevelType,t,e.nativeEvent,Z(e.nativeEvent))}function We(e){To=!!e}function ze(e,t){if(!t)return null;var n=(Co(e)?Be:He).bind(null,e);t.addEventListener(e,n,!1)}function qe(e,t){if(!t)return null;var n=(Co(e)?Be:He).bind(null,e);t.addEventListener(e,n,!0)}function Be(e,t){G(He,e,t)}function He(e,t){if(To){var n=Z(t);if(n=b(n),null===n||"number"!=typeof n.tag||2===Fe(n)||(n=null),Po.length){var r=Po.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{J(Le,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>Po.length&&Po.push(e)}}}function Ye(e){return Object.prototype.hasOwnProperty.call(e,Io)||(e[Io]=Fo++,Ao[e[Io]]={}),Ao[e[Io]]}function $e(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ke(e,t){var n=$e(e);e=0;for(var r;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$e(n)}}function Ge(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}function Qe(e,t){if(Lo||null==Uo||Uo!==Dr())return null;var n=Uo;return"selectionStart"in n&&Ge(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,Vo&&Vr(Vo,n)?null:(Vo=n,e=M.getPooled(Mo.select,Do,e,t),e.type="select",e.target=Uo,P(e),e)}function Je(e){var t="";return Ir.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}function Xe(e,t){return e=Mr({children:void 0},t),(t=Je(t.children))&&(e.children=t),e}function Ze(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+n,t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function et(e,t){var n=t.value;e._wrapperState={initialValue:null!=n?n:t.defaultValue,wasMultiple:!!t.multiple}}function tt(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),Mr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nt(e,t){var n=t.value;null==n&&(n=t.defaultValue,t=t.children,null!=t&&(null!=n&&r("92"),Array.isArray(t)&&(1>=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function rt(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function it(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function ot(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function at(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ot(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function ct(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=n,o=t[n];i=null==o||"boolean"==typeof o||""===o?"":r||"number"!=typeof o||0===o||sa.hasOwnProperty(i)&&sa[i]?(""+o).trim():o+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}function st(e,t,n){t&&(fa[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function lt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function ft(e,t){e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument;var n=Ye(e);t=Kr[t];for(var r=0;r<t.length;r++){var i=t[r];if(!n.hasOwnProperty(i)||!n[i]){switch(i){case"scroll":qe("scroll",e);break;case"focus":case"blur":qe("focus",e),qe("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":ee(i,!0)&&qe(i,e);break;case"invalid":case"submit":case"reset":break;default:-1===hi.indexOf(i)&&ze(i,e)}n[i]=!0}}}function pt(e,t,n,r){return n=9===n.nodeType?n:n.ownerDocument,r===aa.html&&(r=ot(e)),r===aa.html?"script"===e?(e=n.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function dt(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function ht(e,t,n,r){var i=lt(t,n);switch(t){case"iframe":case"object":ze("load",e);var o=n;break;case"video":case"audio":for(o=0;o<hi.length;o++)ze(hi[o],e);o=n;break;case"source":ze("error",e),o=n;break;case"img":case"image":case"link":ze("error",e),ze("load",e),o=n;break;case"form":ze("reset",e),ze("submit",e),o=n;break;case"details":ze("toggle",e),o=n;break;case"input":ve(e,n),o=he(e,n),ze("invalid",e),ft(r,"onChange");break;case"option":o=Xe(e,n);break;case"select":et(e,n),o=Mr({},n,{value:void 0}),ze("invalid",e),ft(r,"onChange");break;case"textarea":nt(e,n),o=tt(e,n),ze("invalid",e),ft(r,"onChange");break;default:o=n}st(t,o,pa);var a,u=o;for(a in u)if(u.hasOwnProperty(a)){var c=u[a];"style"===a?ct(e,c,pa):"dangerouslySetInnerHTML"===a?null!=(c=c?c.__html:void 0)&&ca(e,c):"children"===a?"string"==typeof c?("textarea"!==t||""!==c)&&ut(e,c):"number"==typeof c&&ut(e,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&($r.hasOwnProperty(a)?null!=c&&ft(r,a):null!=c&&de(e,a,c,i))}switch(t){case"input":re(e),ge(e,n);break;case"textarea":re(e),it(e,n);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,t=n.value,null!=t?Ze(e,!!n.multiple,t,!1):null!=n.defaultValue&&Ze(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ur)}}function vt(e,t,n,r,i){var o=null;switch(t){case"input":n=he(e,n),r=he(e,r),o=[];break;case"option":n=Xe(e,n),r=Xe(e,r),o=[];break;case"select":n=Mr({},n,{value:void 0}),r=Mr({},r,{value:void 0}),o=[];break;case"textarea":n=tt(e,n),r=tt(e,r),o=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=Ur)}st(t,r,pa),t=e=void 0;var a=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var u=n[e];for(t in u)u.hasOwnProperty(t)&&(a||(a={}),a[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&($r.hasOwnProperty(e)?o||(o=[]):(o=o||[]).push(e,null));for(e in r){var c=r[e];if(u=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&c!==u&&(null!=c||null!=u))if("style"===e)if(u){for(t in u)!u.hasOwnProperty(t)||c&&c.hasOwnProperty(t)||(a||(a={}),a[t]="");for(t in c)c.hasOwnProperty(t)&&u[t]!==c[t]&&(a||(a={}),a[t]=c[t])}else a||(o||(o=[]),o.push(e,a)),a=c;else"dangerouslySetInnerHTML"===e?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(o=o||[]).push(e,""+c)):"children"===e?u===c||"string"!=typeof c&&"number"!=typeof c||(o=o||[]).push(e,""+c):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&($r.hasOwnProperty(e)?(null!=c&&ft(i,e),o||u===c||(o=[])):(o=o||[]).push(e,c))}return a&&(o=o||[]).push("style",a),o}function yt(e,t,n,r,i){"input"===n&&"radio"===i.type&&null!=i.name&&ye(e,i),lt(n,r),r=lt(n,i);for(var o=0;o<t.length;o+=2){var a=t[o],u=t[o+1];"style"===a?ct(e,u,pa):"dangerouslySetInnerHTML"===a?ca(e,u):"children"===a?ut(e,u):de(e,a,u,r)}switch(n){case"input":me(e,i);break;case"textarea":rt(e,i);break;case"select":e._wrapperState.initialValue=void 0,t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!i.multiple,n=i.value,null!=n?Ze(e,!!i.multiple,n,!1):t!==!!i.multiple&&(null!=i.defaultValue?Ze(e,!!i.multiple,i.defaultValue,!0):Ze(e,!!i.multiple,i.multiple?[]:"",!1))}}function mt(e,t,n,r,i){switch(t){case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(r=0;r<hi.length;r++)ze(hi[r],e);break;case"source":ze("error",e);break;case"img":case"image":case"link":ze("error",e),ze("load",e);break;case"form":ze("reset",e),ze("submit",e);break;case"details":ze("toggle",e);break;case"input":ve(e,n),ze("invalid",e),ft(i,"onChange");break;case"select":et(e,n),ze("invalid",e),ft(i,"onChange");break;case"textarea":nt(e,n),ze("invalid",e),ft(i,"onChange")}st(t,n,pa),r=null;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];"children"===o?"string"==typeof a?e.textContent!==a&&(r=["children",a]):"number"==typeof a&&e.textContent!==""+a&&(r=["children",""+a]):$r.hasOwnProperty(o)&&null!=a&&ft(i,o)}switch(t){case"input":re(e),ge(e,n);break;case"textarea":re(e),it(e,n);break;case"select":case"option":break;default:"function"==typeof n.onClick&&(e.onclick=Ur)}return r}function gt(e,t){return e.nodeValue!==t}function bt(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function wt(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html}function _t(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function Ot(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function Et(e){return{current:e}}function St(e){0>wa||(e.current=ba[wa],ba[wa]=null,wa--)}function xt(e,t){wa++,ba[wa]=e.current,e.current=t}function kt(e){return Ct(e)?Ea:_a.current}function jt(e,t){var n=e.type.contextTypes;if(!n)return Wr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ct(e){return 2===e.tag&&null!=e.type.childContextTypes}function Pt(e){Ct(e)&&(St(Oa,e),St(_a,e))}function Tt(e){St(Oa,e),St(_a,e)}function Rt(e,t,n){_a.current!==Wr&&r("168"),xt(_a,t,e),xt(Oa,n,e)}function At(e,t){var n=e.stateNode,i=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var o in n)o in i||r("108",ae(e)||"Unknown",o);return Mr({},t,n)}function Ft(e){if(!Ct(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Wr,Ea=_a.current,xt(_a,t,e),xt(Oa,Oa.current,e),!0}function It(e,t){var n=e.stateNode;if(n||r("169"),t){var i=At(e,Ea);n.__reactInternalMemoizedMergedChildContext=i,St(Oa,e),St(_a,e),xt(_a,i,e)}else St(Oa,e);xt(Oa,t,e)}function Nt(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function Mt(e,t,n){var r=e.alternate;return null===r?(r=new Nt(e.tag,t,e.key,e.mode),r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ut(e,t,n){var i=e.type,o=e.key;if(e=e.props,"function"==typeof i)var a=i.prototype&&i.prototype.isReactComponent?2:0;else if("string"==typeof i)a=5;else switch(i){case zi:return Dt(e.children,t,n,o);case $i:a=11,t|=3;break;case qi:a=11,t|=2;break;case Bi:return i=new Nt(15,e,o,4|t),i.type=Bi,i.expirationTime=n,i;case Gi:a=16,t|=2;break;default:e:{switch("object"==typeof i&&null!==i?i.$$typeof:null){case Hi:a=13;break e;case Yi:a=12;break e;case Ki:a=14;break e;default:r("130",null==i?i:typeof i,"")}a=void 0}}return t=new Nt(a,e,o,t),t.type=i,t.expirationTime=n,t}function Dt(e,t,n,r){return e=new Nt(10,e,r,t),e.expirationTime=n,e}function Vt(e,t,n){return e=new Nt(6,e,null,t),e.expirationTime=n,e}function Lt(e,t,n){return t=new Nt(4,null!==e.children?e.children:[],e.key,t),t.expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wt(e,t,n){return t=new Nt(3,null,null,t?3:0),e={current:t,containerInfo:e,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e}function zt(e){return function(t){try{return e(t)}catch(e){}}}function qt(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Sa=zt(function(e){return t.onCommitFiberRoot(n,e)}),xa=zt(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function Bt(e){"function"==typeof Sa&&Sa(e)}function Ht(e){"function"==typeof xa&&xa(e)}function Yt(e){return{expirationTime:0,baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function $t(e){return{expirationTime:e.expirationTime,baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Kt(e){return{expirationTime:e,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Gt(e,t,n){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t),(0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n)}function Qt(e,t,n){var r=e.alternate;if(null===r){var i=e.updateQueue,o=null;null===i&&(i=e.updateQueue=Yt(e.memoizedState))}else i=e.updateQueue,o=r.updateQueue,null===i?null===o?(i=e.updateQueue=Yt(e.memoizedState),o=r.updateQueue=Yt(r.memoizedState)):i=e.updateQueue=$t(o):null===o&&(o=r.updateQueue=$t(i));null===o||i===o?Gt(i,t,n):null===i.lastUpdate||null===o.lastUpdate?(Gt(i,t,n),Gt(o,t,n)):(Gt(i,t,n),o.lastUpdate=t)}function Jt(e,t,n){var r=e.updateQueue;r=null===r?e.updateQueue=Yt(e.memoizedState):Xt(e,r),null===r.lastCapturedUpdate?r.firstCapturedUpdate=r.lastCapturedUpdate=t:(r.lastCapturedUpdate.next=t,r.lastCapturedUpdate=t),(0===r.expirationTime||r.expirationTime>n)&&(r.expirationTime=n)}function Xt(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=$t(t)),t}function Zt(e,t,n,r,i,o){switch(n.tag){case 1:return e=n.payload,"function"==typeof e?e.call(o,r,i):e;case 3:e.effectTag=-1025&e.effectTag|64;case 0:if(e=n.payload,null===(i="function"==typeof e?e.call(o,r,i):e)||void 0===i)break;return Mr({},r,i);case 2:ka=!0}return r}function en(e,t,n,r,i){if(ka=!1,!(0===t.expirationTime||t.expirationTime>i)){t=Xt(e,t);for(var o=t.baseState,a=null,u=0,c=t.firstUpdate,s=o;null!==c;){var l=c.expirationTime;l>i?(null===a&&(a=c,o=s),(0===u||u>l)&&(u=l)):(s=Zt(e,t,c,s,n,r),null!==c.callback&&(e.effectTag|=32,c.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=c:(t.lastEffect.nextEffect=c,t.lastEffect=c))),c=c.next}for(l=null,c=t.firstCapturedUpdate;null!==c;){var f=c.expirationTime;f>i?(null===l&&(l=c,null===a&&(o=s)),(0===u||u>f)&&(u=f)):(s=Zt(e,t,c,s,n,r),null!==c.callback&&(e.effectTag|=32,c.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=c:(t.lastCapturedEffect.nextEffect=c,t.lastCapturedEffect=c))),c=c.next}null===a&&(t.lastUpdate=null),null===l?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===l&&(o=s),t.baseState=o,t.firstUpdate=a,t.firstCapturedUpdate=l,t.expirationTime=u,e.memoizedState=s}}function tn(e,t){"function"!=typeof e&&r("191",e),e.call(t)}function nn(e,t,n){for(null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),e=t.firstEffect,t.firstEffect=t.lastEffect=null;null!==e;){var r=e.callback;null!==r&&(e.callback=null,tn(r,n)),e=e.nextEffect}for(e=t.firstCapturedEffect,t.firstCapturedEffect=t.lastCapturedEffect=null;null!==e;)t=e.callback,null!==t&&(e.callback=null,tn(t,n)),e=e.nextEffect}function rn(e,t){return{value:e,source:t,stack:ue(t)}}function on(e){var t=e.type._context;xt(Pa,t._changedBits,e),xt(Ca,t._currentValue,e),xt(ja,e,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode}function an(e){var t=Pa.current,n=Ca.current;St(ja,e),St(Ca,e),St(Pa,e),e=e.type._context,e._currentValue=n,e._changedBits=t}function un(e){return e===Ta&&r("174"),e}function cn(e,t){xt(Fa,t,e),xt(Aa,e,e),xt(Ra,Ta,e);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:at(null,"");break;default:n=8===n?t.parentNode:t,t=n.namespaceURI||null,n=n.tagName,t=at(t,n)}St(Ra,e),xt(Ra,t,e)}function sn(e){St(Ra,e),St(Aa,e),St(Fa,e)}function ln(e){Aa.current===e&&(St(Ra,e),St(Aa,e))}function fn(e,t,n){var r=e.memoizedState;t=t(n,r),r=null===t||void 0===t?r:Mr({},r,t),e.memoizedState=r,null!==(e=e.updateQueue)&&0===e.expirationTime&&(e.baseState=r)}function pn(e,t,n,r,i,o){var a=e.stateNode;return e=e.type,"function"==typeof a.shouldComponentUpdate?a.shouldComponentUpdate(n,i,o):!e.prototype||!e.prototype.isPureReactComponent||(!Vr(t,n)||!Vr(r,i))}function dn(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ia.enqueueReplaceState(t,t.state,null)}function hn(e,t){var n=e.type,r=e.stateNode,i=e.pendingProps,o=kt(e);r.props=i,r.state=e.memoizedState,r.refs=Wr,r.context=jt(e,o),o=e.updateQueue,null!==o&&(en(e,o,i,r,t),r.state=e.memoizedState),o=e.type.getDerivedStateFromProps,"function"==typeof o&&(fn(e,o,i),r.state=e.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(n=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),n!==r.state&&Ia.enqueueReplaceState(r,r.state,null),null!==(o=e.updateQueue)&&(en(e,o,i,r,t),r.state=e.memoizedState)),"function"==typeof r.componentDidMount&&(e.effectTag|=4)}function vn(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){n=n._owner;var i=void 0;n&&(2!==n.tag&&r("110"),i=n.stateNode),i||r("147",e);var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs===Wr?i.refs={}:i.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}"string"!=typeof e&&r("148"),n._owner||r("254",e)}return e}function yn(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function mn(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t,n){return e=Mt(e,t,n),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index,r<n?(t.effectTag=2,n):r):(t.effectTag=2,n):n}function u(t){return e&&null===t.alternate&&(t.effectTag=2),t}function c(e,t,n,r){return null===t||6!==t.tag?(t=Vt(n,e.mode,r),t.return=e,t):(t=o(t,n,r),t.return=e,t)}function s(e,t,n,r){return null!==t&&t.type===n.type?(r=o(t,n.props,r),r.ref=vn(e,t,n),r.return=e,r):(r=Ut(n,e.mode,r),r.ref=vn(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Lt(n,e.mode,r),t.return=e,t):(t=o(t,n.children||[],r),t.return=e,t)}function f(e,t,n,r,i){return null===t||10!==t.tag?(t=Dt(n,e.mode,r,i),t.return=e,t):(t=o(t,n,r),t.return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return t=Vt(""+t,e.mode,n),t.return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Li:return n=Ut(t,e.mode,n),n.ref=vn(e,null,t),n.return=e,n;case Wi:return t=Lt(t,e.mode,n),t.return=e,t}if(Na(t)||oe(t))return t=Dt(t,e.mode,n,null),t.return=e,t;yn(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Li:return n.key===i?n.type===zi?f(e,t,n.props.children,r,i):s(e,t,n,r):null;case Wi:return n.key===i?l(e,t,n,r):null}if(Na(n)||oe(n))return null!==i?null:f(e,t,n,r,null);yn(e,n)}return null}function h(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return e=e.get(n)||null,c(t,e,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case Li:return e=e.get(null===r.key?n:r.key)||null,r.type===zi?f(t,e,r.props.children,i,r.key):s(t,e,r,i);case Wi:return e=e.get(null===r.key?n:r.key)||null,l(t,e,r,i)}if(Na(r)||oe(r))return e=e.get(n)||null,f(t,e,r,i,null);yn(t,r)}return null}function v(r,o,u,c){for(var s=null,l=null,f=o,v=o=0,y=null;null!==f&&v<u.length;v++){f.index>v?(y=f,f=null):y=f.sibling;var m=d(r,f,u[v],c);if(null===m){null===f&&(f=y);break}e&&f&&null===m.alternate&&t(r,f),o=a(m,o,v),null===l?s=m:l.sibling=m,l=m,f=y}if(v===u.length)return n(r,f),s;if(null===f){for(;v<u.length;v++)(f=p(r,u[v],c))&&(o=a(f,o,v),null===l?s=f:l.sibling=f,l=f);return s}for(f=i(r,f);v<u.length;v++)(y=h(f,r,v,u[v],c))&&(e&&null!==y.alternate&&f.delete(null===y.key?v:y.key),o=a(y,o,v),null===l?s=y:l.sibling=y,l=y);return e&&f.forEach(function(e){return t(r,e)}),s}function y(o,u,c,s){var l=oe(c);"function"!=typeof l&&r("150"),null==(c=l.call(c))&&r("151");for(var f=l=null,v=u,y=u=0,m=null,g=c.next();null!==v&&!g.done;y++,g=c.next()){v.index>y?(m=v,v=null):m=v.sibling;var b=d(o,v,g.value,s);if(null===b){v||(v=m);break}e&&v&&null===b.alternate&&t(o,v),u=a(b,u,y),null===f?l=b:f.sibling=b,f=b,v=m}if(g.done)return n(o,v),l;if(null===v){for(;!g.done;y++,g=c.next())null!==(g=p(o,g.value,s))&&(u=a(g,u,y),null===f?l=g:f.sibling=g,f=g);return l}for(v=i(o,v);!g.done;y++,g=c.next())null!==(g=h(v,o,y,g.value,s))&&(e&&null!==g.alternate&&v.delete(null===g.key?y:g.key),u=a(g,u,y),null===f?l=g:f.sibling=g,f=g);return e&&v.forEach(function(e){return t(o,e)}),l}return function(e,i,a,c){"object"==typeof a&&null!==a&&a.type===zi&&null===a.key&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case Li:e:{var l=a.key;for(s=i;null!==s;){if(s.key===l){if(10===s.tag?a.type===zi:s.type===a.type){n(e,s.sibling),i=o(s,a.type===zi?a.props.children:a.props,c),i.ref=vn(e,s,a),i.return=e,e=i;break e}n(e,s);break}t(e,s),s=s.sibling}a.type===zi?(i=Dt(a.props.children,e.mode,c,a.key),i.return=e,e=i):(c=Ut(a,e.mode,c),c.ref=vn(e,i,a),c.return=e,e=c)}return u(e);case Wi:e:{for(s=a.key;null!==i;){if(i.key===s){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(e,i.sibling),i=o(i,a.children||[],c),i.return=e,e=i;break e}n(e,i);break}t(e,i),i=i.sibling}i=Lt(a,e.mode,c),i.return=e,e=i}return u(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==i&&6===i.tag?(n(e,i.sibling),i=o(i,a,c),i.return=e,e=i):(n(e,i),i=Vt(a,e.mode,c),i.return=e,e=i),u(e);if(Na(a))return v(e,i,a,c);if(oe(a))return y(e,i,a,c);if(s&&yn(e,a),void 0===a)switch(e.tag){case 2:case 1:c=e.type,r("152",c.displayName||c.name||"Component")}return n(e,i)}}function gn(e,t){var n=new Nt(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function bn(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function wn(e){if(La){var t=Va;if(t){var n=t;if(!bn(e,t)){if(!(t=_t(n))||!bn(e,t))return e.effectTag|=2,La=!1,void(Da=e);gn(Da,n)}Da=e,Va=Ot(t)}else e.effectTag|=2,La=!1,Da=e}}function _n(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;Da=e}function On(e){if(e!==Da)return!1;if(!La)return _n(e),La=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!wt(t,e.memoizedProps))for(t=Va;t;)gn(e,t),t=_t(t);return _n(e),Va=Da?_t(e.stateNode):null,!0}function En(){Va=Da=null,La=!1}function Sn(e,t,n){xn(e,t,n,t.expirationTime)}function xn(e,t,n,r){t.child=null===e?Ua(t,null,n,r):Ma(t,e.child,n,r)}function kn(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function jn(e,t,n,r,i){kn(e,t);var o=0!=(64&t.effectTag);if(!n&&!o)return r&&It(t,!1),Rn(e,t);n=t.stateNode,Di.current=t;var a=o?null:n.render();return t.effectTag|=1,o&&(xn(e,t,null,i),t.child=null),xn(e,t,a,i),t.memoizedState=n.state,t.memoizedProps=n.props,r&&It(t,!0),t.child}function Cn(e){var t=e.stateNode;t.pendingContext?Rt(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Rt(e,t.context,!1),cn(e,t.containerInfo)}function Pn(e,t,n,r){var i=e.child;for(null!==i&&(i.return=e);null!==i;){switch(i.tag){case 12:var o=0|i.stateNode;if(i.type===t&&0!=(o&n)){for(o=i;null!==o;){var a=o.alternate;if(0===o.expirationTime||o.expirationTime>r)o.expirationTime=r,null!==a&&(0===a.expirationTime||a.expirationTime>r)&&(a.expirationTime=r);else{if(null===a||!(0===a.expirationTime||a.expirationTime>r))break;a.expirationTime=r}o=o.return}o=null}else o=i.child;break;case 13:o=i.type===e.type?null:i.child;break;default:o=i.child}if(null!==o)o.return=i;else for(o=i;null!==o;){if(o===e){o=null;break}if(null!==(i=o.sibling)){i.return=o.return,o=i;break}o=o.return}i=o}}function Tn(e,t,n){var r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=!0;if(Oa.current)a=!1;else if(o===i)return t.stateNode=0,on(t),Rn(e,t);var u=i.value;if(t.memoizedProps=i,null===o)u=1073741823;else if(o.value===i.value){if(o.children===i.children&&a)return t.stateNode=0,on(t),Rn(e,t);u=0}else{var c=o.value;if(c===u&&(0!==c||1/c==1/u)||c!==c&&u!==u){if(o.children===i.children&&a)return t.stateNode=0,on(t),Rn(e,t);u=0}else if(u="function"==typeof r._calculateChangedBits?r._calculateChangedBits(c,u):1073741823,0===(u|=0)){if(o.children===i.children&&a)return t.stateNode=0,on(t),Rn(e,t)}else Pn(t,r,u,n)}return t.stateNode=u,on(t),Sn(e,t,i.children),t.child}function Rn(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){e=t.child;var n=Mt(e,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,n=n.sibling=Mt(e,e.pendingProps,e.expirationTime),n.return=t;n.sibling=null}return t.child}function An(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:Cn(t);break;case 2:Ft(t);break;case 4:cn(t,t.stateNode.containerInfo);break;case 13:on(t)}return null}switch(t.tag){case 0:null!==e&&r("155");var i=t.type,o=t.pendingProps,a=kt(t);return a=jt(t,a),i=i(o,a),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(a=t.type,t.tag=2,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,a=a.getDerivedStateFromProps,"function"==typeof a&&fn(t,a,o),o=Ft(t),i.updater=Ia,t.stateNode=i,i._reactInternalFiber=t,hn(t,n),e=jn(e,t,!0,o,n)):(t.tag=1,Sn(e,t,i),t.memoizedProps=o,e=t.child),e;case 1:return o=t.type,n=t.pendingProps,Oa.current||t.memoizedProps!==n?(i=kt(t),i=jt(t,i),o=o(n,i),t.effectTag|=1,Sn(e,t,o),t.memoizedProps=n,e=t.child):e=Rn(e,t),e;case 2:if(o=Ft(t),null===e)if(null===t.stateNode){var u=t.pendingProps,c=t.type;i=kt(t);var s=2===t.tag&&null!=t.type.contextTypes;a=s?jt(t,i):Wr,u=new c(u,a),t.memoizedState=null!==u.state&&void 0!==u.state?u.state:null,u.updater=Ia,t.stateNode=u,u._reactInternalFiber=t,s&&(s=t.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=i,s.__reactInternalMemoizedMaskedChildContext=a),hn(t,n),i=!0}else{c=t.type,i=t.stateNode,s=t.memoizedProps,a=t.pendingProps,i.props=s;var l=i.context;u=kt(t),u=jt(t,u);var f=c.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==a||l!==u)&&dn(t,i,a,u),ka=!1;var p=t.memoizedState;l=i.state=p;var d=t.updateQueue;null!==d&&(en(t,d,a,i,n),l=t.memoizedState),s!==a||p!==l||Oa.current||ka?("function"==typeof f&&(fn(t,f,a),l=t.memoizedState),(s=ka||pn(t,s,a,p,l,u))?(c||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.effectTag|=4)):("function"==typeof i.componentDidMount&&(t.effectTag|=4),t.memoizedProps=a,t.memoizedState=l),i.props=a,i.state=l,i.context=u,i=s):("function"==typeof i.componentDidMount&&(t.effectTag|=4),i=!1)}else c=t.type,i=t.stateNode,a=t.memoizedProps,s=t.pendingProps,i.props=a,l=i.context,u=kt(t),u=jt(t,u),f=c.getDerivedStateFromProps,(c="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(a!==s||l!==u)&&dn(t,i,s,u),ka=!1,l=t.memoizedState,p=i.state=l,d=t.updateQueue,null!==d&&(en(t,d,s,i,n),p=t.memoizedState),a!==s||l!==p||Oa.current||ka?("function"==typeof f&&(fn(t,f,s),p=t.memoizedState),(f=ka||pn(t,a,s,l,p,u))?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(s,p,u),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(s,p,u)),"function"==typeof i.componentDidUpdate&&(t.effectTag|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=s,t.memoizedState=p),i.props=s,i.state=p,i.context=u,i=f):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),i=!1);return jn(e,t,i,o,n);case 3:return Cn(t),o=t.updateQueue,null!==o?(i=t.memoizedState,i=null!==i?i.element:null,en(t,o,t.pendingProps,null,n),(o=t.memoizedState.element)===i?(En(),e=Rn(e,t)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(Va=Ot(t.stateNode.containerInfo),Da=t,i=La=!0),i?(t.effectTag|=2,t.child=Ua(t,null,o,n)):(En(),Sn(e,t,o)),e=t.child)):(En(),e=Rn(e,t)),e;case 5:return un(Fa.current),o=un(Ra.current),i=at(o,t.type),o!==i&&(xt(Aa,t,t),xt(Ra,i,t)),null===e&&wn(t),o=t.type,s=t.memoizedProps,i=t.pendingProps,a=null!==e?e.memoizedProps:null,Oa.current||s!==i||((s=1&t.mode&&!!i.hidden)&&(t.expirationTime=1073741823),s&&1073741823===n)?(s=i.children,wt(o,i)?s=null:a&&wt(o,a)&&(t.effectTag|=16),kn(e,t),1073741823!==n&&1&t.mode&&i.hidden?(t.expirationTime=1073741823,t.memoizedProps=i,e=null):(Sn(e,t,s),t.memoizedProps=i,e=t.child)):e=Rn(e,t),e;case 6:return null===e&&wn(t),t.memoizedProps=t.pendingProps,null;case 16:return null;case 4:return cn(t,t.stateNode.containerInfo),o=t.pendingProps,Oa.current||t.memoizedProps!==o?(null===e?t.child=Ma(t,null,o,n):Sn(e,t,o),t.memoizedProps=o,e=t.child):e=Rn(e,t),e;case 14:return o=t.type.render,n=t.pendingProps,i=t.ref,Oa.current||t.memoizedProps!==n||i!==(null!==e?e.ref:null)?(o=o(n,i),Sn(e,t,o),t.memoizedProps=n,e=t.child):e=Rn(e,t),e;case 10:return n=t.pendingProps,Oa.current||t.memoizedProps!==n?(Sn(e,t,n),t.memoizedProps=n,e=t.child):e=Rn(e,t),e;case 11:return n=t.pendingProps.children,Oa.current||null!==n&&t.memoizedProps!==n?(Sn(e,t,n),t.memoizedProps=n,e=t.child):e=Rn(e,t),e;case 15:return n=t.pendingProps,t.memoizedProps===n?e=Rn(e,t):(Sn(e,t,n.children),t.memoizedProps=n,e=t.child),e;case 13:return Tn(e,t,n);case 12:e:if(i=t.type,a=t.pendingProps,s=t.memoizedProps,o=i._currentValue,u=i._changedBits,Oa.current||0!==u||s!==a){if(t.memoizedProps=a,c=a.unstable_observedBits,void 0!==c&&null!==c||(c=1073741823),t.stateNode=c,0!=(u&c))Pn(t,i,u,n);else if(s===a){e=Rn(e,t);break e}n=a.children,n=n(o),t.effectTag|=1,Sn(e,t,n),e=t.child}else e=Rn(e,t);return e;default:r("156")}}function Fn(e){e.effectTag|=4}function In(e,t){var n=t.pendingProps;switch(t.tag){case 1:return null;case 2:return Pt(t),null;case 3:sn(t),Tt(t);var i=t.stateNode;return i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(On(t),t.effectTag&=-3),Wa(t),null;case 5:ln(t),i=un(Fa.current);var o=t.type;if(null!==e&&null!=t.stateNode){var a=e.memoizedProps,u=t.stateNode,c=un(Ra.current);u=vt(u,o,a,n,i),za(e,t,u,o,a,n,i,c),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!n)return null===t.stateNode&&r("166"),null;if(e=un(Ra.current),On(t))n=t.stateNode,o=t.type,a=t.memoizedProps,n[ri]=t,n[ii]=a,i=mt(n,o,a,e,i),t.updateQueue=i,null!==i&&Fn(t);else{e=pt(o,n,i,e),e[ri]=t,e[ii]=n;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)e.appendChild(a.stateNode);else if(4!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}ht(e,o,n,i),bt(o,n)&&Fn(t),t.stateNode=e}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)qa(e,t,e.memoizedProps,n);else{if("string"!=typeof n)return null===t.stateNode&&r("166"),null;i=un(Fa.current),un(Ra.current),On(t)?(i=t.stateNode,n=t.memoizedProps,i[ri]=t,gt(i,n)&&Fn(t)):(i=dt(n,i),i[ri]=t,t.stateNode=i)}return null;case 14:case 16:case 10:case 11:case 15:return null;case 4:return sn(t),Wa(t),null;case 13:return an(t),null;case 12:return null;case 0:r("167");default:r("156")}}function Nn(e,t){var n=t.source;null===t.stack&&null!==n&&ue(n),null!==n&&ae(n),t=t.value,null!==e&&2===e.tag&&ae(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}function Mn(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Qn(e,t)}else t.current=null}function Un(e){switch("function"==typeof Ht&&Ht(e),e.tag){case 2:Mn(e);var t=e.stateNode;if("function"==typeof t.componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){Qn(e,t)}break;case 5:Mn(e);break;case 4:Ln(e)}}function Dn(e){return 5===e.tag||3===e.tag||4===e.tag}function Vn(e){e:{for(var t=e.return;null!==t;){if(Dn(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var i=t=void 0;switch(n.tag){case 5:t=n.stateNode,i=!1;break;case 3:case 4:t=n.stateNode.containerInfo,i=!0;break;default:r("161")}16&n.effectTag&&(ut(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Dn(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var o=e;;){if(5===o.tag||6===o.tag)if(n)if(i){var a=t,u=o.stateNode,c=n;8===a.nodeType?a.parentNode.insertBefore(u,c):a.insertBefore(u,c)}else t.insertBefore(o.stateNode,n);else i?(a=t,u=o.stateNode,8===a.nodeType?a.parentNode.insertBefore(u,a):a.appendChild(u)):t.appendChild(o.stateNode);else if(4!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}}function Ln(e){for(var t=e,n=!1,i=void 0,o=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:i=n.stateNode,o=!1;break e;case 3:case 4:i=n.stateNode.containerInfo,o=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var a=t,u=a;;)if(Un(u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===a)break;for(;null===u.sibling;){if(null===u.return||u.return===a)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}o?(a=i,u=t.stateNode,8===a.nodeType?a.parentNode.removeChild(u):a.removeChild(u)):i.removeChild(t.stateNode)}else if(4===t.tag?i=t.stateNode.containerInfo:Un(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,4===t.tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function Wn(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var i=t.memoizedProps;e=null!==e?e.memoizedProps:i;var o=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&(n[ii]=i,yt(n,a,o,e,i))}break;case 6:null===t.stateNode&&r("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 15:case 16:break;default:r("163")}}function zn(e,t,n){n=Kt(n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hr(r),Nn(e,t)},n}function qn(e,t,n){n=Kt(n),n.tag=3;var r=e.stateNode;return null!==r&&"function"==typeof r.componentDidCatch&&(n.callback=function(){null===iu?iu=new Set([this]):iu.add(this);var n=t.value,r=t.stack;Nn(e,t),this.componentDidCatch(n,{componentStack:null!==r?r:""})}),n}function Bn(e,t,n,r,i,o){n.effectTag|=512,n.firstEffect=n.lastEffect=null,r=rn(r,n),e=t;do{switch(e.tag){case 3:return e.effectTag|=1024,r=zn(e,r,o),void Jt(e,r,o);case 2:if(t=r,n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&(null===iu||!iu.has(n)))return e.effectTag|=1024,r=qn(e,t,o),void Jt(e,r,o)}e=e.return}while(null!==e)}function Hn(e){switch(e.tag){case 2:Pt(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return sn(e),Tt(e),t=e.effectTag,1024&t?(e.effectTag=-1025&t|64,e):null;case 5:return ln(e),null;case 16:return t=e.effectTag,1024&t?(e.effectTag=-1025&t|64,e):null;case 4:return sn(e),null;case 13:return an(e),null;default:return null}}function Yn(){if(null!==Qa)for(var e=Qa.return;null!==e;){var t=e;switch(t.tag){case 2:Pt(t);break;case 3:sn(t),Tt(t);break;case 5:ln(t);break;case 4:sn(t);break;case 13:an(t)}e=e.return}Ja=null,Xa=0,Za=-1,eu=!1,Qa=null,ru=!1}function $n(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=In(t,e,Xa);var i=e;if(1073741823===Xa||1073741823!==i.expirationTime){var o=0;switch(i.tag){case 3:case 2:var a=i.updateQueue;null!==a&&(o=a.expirationTime)}for(a=i.child;null!==a;)0!==a.expirationTime&&(0===o||o>a.expirationTime)&&(o=a.expirationTime),a=a.sibling;i.expirationTime=o}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){ru=!0;break}e=n}else{if(null!==(e=Hn(e,eu,Xa)))return e.effectTag&=511,e;if(null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=512),null!==r)return r;if(null===n)break;e=n}}return null}function Kn(e){var t=An(e.alternate,e,Xa);return null===t&&(t=$n(e)),Di.current=null,t}function Gn(e,t,n){Ga&&r("243"),Ga=!0,t===Xa&&e===Ja&&null!==Qa||(Yn(),Ja=e,Xa=t,Za=-1,Qa=Mt(Ja.current,null,Xa),e.pendingCommitExpirationTime=0);var i=!1;for(eu=!n||Xa<=Ha;;){try{if(n)for(;null!==Qa&&!dr();)Qa=Kn(Qa);else for(;null!==Qa;)Qa=Kn(Qa)}catch(t){if(null===Qa)i=!0,hr(t);else{null===Qa&&r("271"),n=Qa;var o=n.return;if(null===o){i=!0,hr(t);break}Bn(e,o,n,t,eu,Xa,Ya),Qa=$n(n)}}break}if(Ga=!1,i)return null;if(null===Qa){if(ru)return e.pendingCommitExpirationTime=t,e.current.alternate;eu&&r("262"),0<=Za&&setTimeout(function(){var t=e.current.expirationTime;0!==t&&(0===e.remainingExpirationTime||e.remainingExpirationTime<t)&&ir(e,t)},Za),vr(e.current.expirationTime)}return null}function Qn(e,t){var n;e:{for(Ga&&!nu&&r("263"),n=e.return;null!==n;){switch(n.tag){case 2:var i=n.stateNode;if("function"==typeof n.type.getDerivedStateFromCatch||"function"==typeof i.componentDidCatch&&(null===iu||!iu.has(i))){e=rn(t,e),e=qn(n,e,1),Qt(n,e,1),Zn(n,1),n=void 0;break e}break;case 3:e=rn(t,e),e=zn(n,e,1),Qt(n,e,1),Zn(n,1),n=void 0;break e}n=n.return}3===e.tag&&(n=rn(t,e),n=zn(e,n,1),Qt(e,n,1),Zn(e,1)),n=void 0}return n}function Jn(){var e=2+25*(1+((er()-2+500)/25|0));return e<=$a&&(e=$a+1),$a=e}function Xn(e,t){return e=0!==Ka?Ka:Ga?nu?1:Xa:1&t.mode?bu?2+10*(1+((e-2+15)/10|0)):2+25*(1+((e-2+500)/25|0)):1,bu&&(0===pu||e>pu)&&(pu=e),e}function Zn(e,t){for(;null!==e;){if((0===e.expirationTime||e.expirationTime>t)&&(e.expirationTime=t),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>t)&&(e.alternate.expirationTime=t),null===e.return){if(3!==e.tag)break;var n=e.stateNode;!Ga&&0!==Xa&&t<Xa&&Yn();var i=n.current.expirationTime;Ga&&!nu&&Ja===n||ir(n,i),Ou>_u&&r("185")}e=e.return}}function er(){return Ya=ya()-Ba,Ha=2+(Ya/10|0)}function tr(e){var t=Ka;Ka=2+25*(1+((er()-2+500)/25|0));try{return e()}finally{Ka=t}}function nr(e,t,n,r,i){var o=Ka;Ka=1;try{return e(t,n,r,i)}finally{Ka=o}}function rr(e){if(0!==uu){if(e>uu)return;ga(cu)}var t=ya()-Ba;uu=e,cu=ma(ar,{timeout:10*(e-2)-t})}function ir(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===au?(ou=au=e,e.nextScheduledRoot=e):(au=au.nextScheduledRoot=e,au.nextScheduledRoot=ou);else{var n=e.remainingExpirationTime;(0===n||t<n)&&(e.remainingExpirationTime=t)}su||(mu?gu&&(lu=e,fu=1,fr(e,1,!1)):1===t?ur():rr(t))}function or(){var e=0,t=null;if(null!==au)for(var n=au,i=ou;null!==i;){var o=i.remainingExpirationTime;if(0===o){if((null===n||null===au)&&r("244"),i===i.nextScheduledRoot){ou=au=i.nextScheduledRoot=null;break}if(i===ou)ou=o=i.nextScheduledRoot,au.nextScheduledRoot=o,i.nextScheduledRoot=null;else{if(i===au){au=n,au.nextScheduledRoot=ou,i.nextScheduledRoot=null;break}n.nextScheduledRoot=i.nextScheduledRoot,i.nextScheduledRoot=null}i=n.nextScheduledRoot}else{if((0===e||o<e)&&(e=o,t=i),i===au)break;n=i,i=i.nextScheduledRoot}}n=lu,null!==n&&n===t&&1===e?Ou++:Ou=0,lu=t,fu=e}function ar(e){cr(0,!0,e)}function ur(){cr(1,!1,null)}function cr(e,t,n){if(yu=n,or(),t)for(;null!==lu&&0!==fu&&(0===e||e>=fu)&&(!du||er()>=fu);)er(),fr(lu,fu,!du),or();else for(;null!==lu&&0!==fu&&(0===e||e>=fu);)fr(lu,fu,!1),or();null!==yu&&(uu=0,cu=-1),0!==fu&&rr(fu),yu=null,du=!1,lr()}function sr(e,t){su&&r("253"),lu=e,fu=t,fr(e,t,!1),ur(),lr()}function lr(){if(Ou=0,null!==wu){var e=wu;wu=null;for(var t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(e){hu||(hu=!0,vu=e)}}}if(hu)throw e=vu,vu=null,hu=!1,e}function fr(e,t,n){su&&r("245"),su=!0,n?(n=e.finishedWork,null!==n?pr(e,n,t):(e.finishedWork=null,null!==(n=Gn(e,t,!0))&&(dr()?e.finishedWork=n:pr(e,n,t)))):(n=e.finishedWork,null!==n?pr(e,n,t):(e.finishedWork=null,null!==(n=Gn(e,t,!1))&&pr(e,n,t))),su=!1}function pr(e,t,n){var i=e.firstBatch;if(null!==i&&i._expirationTime<=n&&(null===wu?wu=[i]:wu.push(i),i._defer))return e.finishedWork=t,void(e.remainingExpirationTime=0);if(e.finishedWork=null,nu=Ga=!0,n=t.stateNode,n.current===t&&r("177"),i=n.pendingCommitExpirationTime,0===i&&r("261"),n.pendingCommitExpirationTime=0,er(),Di.current=null,1<t.effectTag)if(null!==t.lastEffect){t.lastEffect.nextEffect=t;var o=t.firstEffect}else o=t;else o=t.firstEffect;ha=To;var a=Dr();if(Ge(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{var c=window.getSelection&&window.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var s=c.anchorOffset,l=c.focusNode;c=c.focusOffset;try{u.nodeType,l.nodeType}catch(e){u=null;break e}var f=0,p=-1,d=-1,h=0,v=0,y=a,m=null;t:for(;;){for(var g;y!==u||0!==s&&3!==y.nodeType||(p=f+s),y!==l||0!==c&&3!==y.nodeType||(d=f+c),3===y.nodeType&&(f+=y.nodeValue.length),null!==(g=y.firstChild);)m=y,y=g;for(;;){if(y===a)break t;if(m===u&&++h===s&&(p=f),m===l&&++v===c&&(d=f),null!==(g=y.nextSibling))break;y=m,m=y.parentNode}y=g}u=-1===p||-1===d?null:{start:p,end:d}}else u=null}u=u||{start:0,end:0}}else u=null;for(va={focusedElem:a,selectionRange:u},We(!1),tu=o;null!==tu;){a=!1,u=void 0;try{for(;null!==tu;){if(256&tu.effectTag){var b=tu.alternate;switch(s=tu,s.tag){case 2:if(256&s.effectTag&&null!==b){var w=b.memoizedProps,_=b.memoizedState,O=s.stateNode;O.props=s.memoizedProps,O.state=s.memoizedState;var E=O.getSnapshotBeforeUpdate(w,_);O.__reactInternalSnapshotBeforeUpdate=E}break;case 3:case 5:case 6:case 4:break;default:r("163")}}tu=tu.nextEffect}}catch(e){a=!0,u=e}a&&(null===tu&&r("178"),Qn(tu,u),null!==tu&&(tu=tu.nextEffect))}for(tu=o;null!==tu;){b=!1,w=void 0;try{for(;null!==tu;){var S=tu.effectTag;if(16&S&&ut(tu.stateNode,""),128&S){var x=tu.alternate;if(null!==x){var k=x.ref;null!==k&&("function"==typeof k?k(null):k.current=null)}}switch(14&S){case 2:Vn(tu),tu.effectTag&=-3;break;case 6:Vn(tu),tu.effectTag&=-3,Wn(tu.alternate,tu);break;case 4:Wn(tu.alternate,tu);break;case 8:_=tu,Ln(_),_.return=null,_.child=null,_.alternate&&(_.alternate.child=null,_.alternate.return=null)}tu=tu.nextEffect}}catch(e){b=!0,w=e}b&&(null===tu&&r("178"),Qn(tu,w),null!==tu&&(tu=tu.nextEffect))}if(k=va,x=Dr(),S=k.focusedElem,b=k.selectionRange,x!==S&&Lr(document.documentElement,S)){Ge(S)&&(x=b.start,k=b.end,void 0===k&&(k=x),"selectionStart"in S?(S.selectionStart=x,S.selectionEnd=Math.min(k,S.value.length)):window.getSelection&&(x=window.getSelection(),w=S[F()].length,k=Math.min(b.start,w),b=void 0===b.end?k:Math.min(b.end,w),!x.extend&&k>b&&(w=b,b=k,k=w),w=Ke(S,k),_=Ke(S,b),w&&_&&(1!==x.rangeCount||x.anchorNode!==w.node||x.anchorOffset!==w.offset||x.focusNode!==_.node||x.focusOffset!==_.offset)&&(O=document.createRange(),O.setStart(w.node,w.offset),x.removeAllRanges(),k>b?(x.addRange(O),x.extend(_.node,_.offset)):(O.setEnd(_.node,_.offset),x.addRange(O))))),x=[];for(k=S;k=k.parentNode;)1===k.nodeType&&x.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(S.focus(),S=0;S<x.length;S++)k=x[S],k.element.scrollLeft=k.left,k.element.scrollTop=k.top}for(va=null,We(ha),ha=null,n.current=t,tu=o;null!==tu;){o=!1,S=void 0;try{for(x=i;null!==tu;){var j=tu.effectTag;if(36&j){var C=tu.alternate;switch(k=tu,b=x,k.tag){case 2:var P=k.stateNode;if(4&k.effectTag)if(null===C)P.props=k.memoizedProps,P.state=k.memoizedState,P.componentDidMount();else{var T=C.memoizedProps,R=C.memoizedState;P.props=k.memoizedProps,P.state=k.memoizedState,P.componentDidUpdate(T,R,P.__reactInternalSnapshotBeforeUpdate)}var A=k.updateQueue;null!==A&&(P.props=k.memoizedProps,P.state=k.memoizedState,nn(k,A,P,b));break;case 3:var I=k.updateQueue;if(null!==I){if(w=null,null!==k.child)switch(k.child.tag){case 5:w=k.child.stateNode;break;case 2:w=k.child.stateNode}nn(k,I,w,b)}break;case 5:var N=k.stateNode;null===C&&4&k.effectTag&&bt(k.type,k.memoizedProps)&&N.focus();break;case 6:case 4:case 15:case 16:break;default:r("163")}}if(128&j){k=void 0;var M=tu.ref;if(null!==M){var U=tu.stateNode;switch(tu.tag){case 5:k=U;break;default:k=U}"function"==typeof M?M(k):M.current=k}}var D=tu.nextEffect;tu.nextEffect=null,tu=D}}catch(e){o=!0,S=e}o&&(null===tu&&r("178"),Qn(tu,S),null!==tu&&(tu=tu.nextEffect))}Ga=nu=!1,"function"==typeof Bt&&Bt(t.stateNode),t=n.current.expirationTime,0===t&&(iu=null),e.remainingExpirationTime=t}function dr(){return!(null===yu||yu.timeRemaining()>Eu)&&(du=!0)}function hr(e){null===lu&&r("246"),lu.remainingExpirationTime=0,hu||(hu=!0,vu=e)}function vr(e){null===lu&&r("246"),lu.remainingExpirationTime=e}function yr(e,t){var n=mu;mu=!0;try{return e(t)}finally{(mu=n)||su||ur()}}function mr(e,t){if(mu&&!gu){gu=!0;try{return e(t)}finally{gu=!1}}return e(t)}function gr(e,t){su&&r("187");var n=mu;mu=!0;try{return nr(e,t)}finally{mu=n,ur()}}function br(e){var t=mu;mu=!0;try{nr(e)}finally{(mu=t)||su||cr(1,!1,null)}}function wr(e,t,n,i,o){var a=t.current;if(n){n=n._reactInternalFiber;var u;e:{for(2===Fe(n)&&2===n.tag||r("170"),u=n;3!==u.tag;){if(Ct(u)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}(u=u.return)||r("171")}u=u.stateNode.context}n=Ct(n)?At(n,u):u}else n=Wr;return null===t.context?t.context=n:t.pendingContext=n,t=o,o=Kt(i),o.payload={element:e},t=void 0===t?null:t,null!==t&&(o.callback=t),Qt(a,o,i),Zn(a,i),i}function _r(e){var t=e._reactInternalFiber;return void 0===t&&("function"==typeof e.render?r("188"):r("268",Object.keys(e))),e=Me(t),null===e?null:e.stateNode}function Or(e,t,n,r){var i=t.current;return i=Xn(er(),i),wr(e,t,n,i,r)}function Er(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Sr(e){var t=e.findFiberByHostInstance;return qt(Mr({},e,{findHostInstanceByFiber:function(e){return e=Me(e),null===e?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}function xr(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Wi,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function kr(e){this._expirationTime=Jn(),this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function jr(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function Cr(e,t,n){this._internalRoot=Wt(e,t,n)}function Pr(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Tr(e,t){if(t||(t=e?9===e.nodeType?e.documentElement:e.firstChild:null,t=!(!t||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Cr(e,!1,t)}function Rr(e,t,n,i,o){Pr(n)||r("200");var a=n._reactRootContainer;if(a){if("function"==typeof o){var u=o;o=function(){var e=Er(a._internalRoot);u.call(e)}}null!=e?a.legacy_renderSubtreeIntoContainer(e,t,o):a.render(t,o)}else{if(a=n._reactRootContainer=Tr(n,i),"function"==typeof o){var c=o;o=function(){var e=Er(a._internalRoot);c.call(e)}}mr(function(){null!=e?a.legacy_renderSubtreeIntoContainer(e,t,o):a.render(t,o)})}return Er(a._internalRoot)}function Ar(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return Pr(t)||r("200"),xr(e,t,null,n)}/** @license React v16.4.0 * react-dom.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Fr=n(124),Ir=n(10),Nr=n(425),Mr=n(198),Ur=n(123),Dr=n(427),Vr=n(430),Lr=n(426),Wr=n(173);Ir||r("227");var zr={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,o,a,u,c,s){i.apply(zr,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,i,o,a,u,c){if(zr.invokeGuardedCallback.apply(this,arguments),zr.hasCaughtError()){var s=zr.clearCaughtError();zr._hasRethrowError||(zr._hasRethrowError=!0,zr._rethrowError=s)}},rethrowCaughtError:function(){return o.apply(zr,arguments)},hasCaughtError:function(){return zr._hasCaughtError},clearCaughtError:function(){if(zr._hasCaughtError){var e=zr._caughtError;return zr._caughtError=null,zr._hasCaughtError=!1,e}r("198")}},qr=null,Br={},Hr=[],Yr={},$r={},Kr={},Gr={plugins:Hr,eventNameDispatchConfigs:Yr,registrationNameModules:$r,registrationNameDependencies:Kr,possibleRegistrationNames:null,injectEventPluginOrder:c,injectEventPluginsByName:s},Qr=null,Jr=null,Xr=null,Zr=null,ei={injectEventPluginOrder:c,injectEventPluginsByName:s},ti={injection:ei,getListener:y,runEventsInBatch:m,runExtractedEventsInBatch:g},ni=Math.random().toString(36).slice(2),ri="__reactInternalInstance$"+ni,ii="__reactEventHandlers$"+ni,oi={precacheFiberNode:function(e,t){t[ri]=e},getClosestInstanceFromNode:b,getInstanceFromNode:function(e){return e=e[ri],!e||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:w,getFiberCurrentPropsFromNode:_,updateFiberProps:function(e,t){e[ii]=t}},ai={accumulateTwoPhaseDispatches:P,accumulateTwoPhaseDispatchesSkipTarget:function(e){p(e,k)},accumulateEnterLeaveDispatches:T,accumulateDirectDispatches:function(e){p(e,C)}},ui={animationend:R("Animation","AnimationEnd"),animationiteration:R("Animation","AnimationIteration"),animationstart:R("Animation","AnimationStart"),transitionend:R("Transition","TransitionEnd")},ci={},si={};Nr.canUseDOM&&(si=document.createElement("div").style,"AnimationEvent"in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),"TransitionEvent"in window||delete ui.transitionend.transition);var li=A("animationend"),fi=A("animationiteration"),pi=A("animationstart"),di=A("transitionend"),hi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vi=null,yi={_root:null,_startText:null,_fallbackText:null},mi="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),gi={type:null,target:null,currentTarget:Ur.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};Mr(M.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ur.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ur.thatReturnsTrue)},persist:function(){this.isPersistent=Ur.thatReturnsTrue},isPersistent:Ur.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t<mi.length;t++)this[mi[t]]=null}}),M.Interface=gi,M.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return Mr(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=Mr({},r.Interface,e),n.extend=r.extend,V(n),n},V(M);var bi=M.extend({data:null}),wi=M.extend({data:null}),_i=[9,13,27,32],Oi=Nr.canUseDOM&&"CompositionEvent"in window,Ei=null;Nr.canUseDOM&&"documentMode"in document&&(Ei=document.documentMode);var Si=Nr.canUseDOM&&"TextEvent"in window&&!Ei,xi=Nr.canUseDOM&&(!Oi||Ei&&8<Ei&&11>=Ei),ki=String.fromCharCode(32),ji={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Ci=!1,Pi=!1,Ti={eventTypes:ji,extractEvents:function(e,t,n,r){var i=void 0,o=void 0;if(Oi)e:{switch(e){case"compositionstart":i=ji.compositionStart;break e;case"compositionend":i=ji.compositionEnd;break e;case"compositionupdate":i=ji.compositionUpdate;break e}i=void 0}else Pi?L(e,n)&&(i=ji.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=ji.compositionStart);return i?(xi&&(Pi||i!==ji.compositionStart?i===ji.compositionEnd&&Pi&&(o=I()):(yi._root=r,yi._startText=N(),Pi=!0)),i=bi.getPooled(i,t,n,r),o?i.data=o:null!==(o=W(n))&&(i.data=o),P(i),o=i):o=null,(e=Si?z(e,n):q(e,n))?(t=wi.getPooled(ji.beforeInput,t,n,r),t.data=e,P(t)):t=null,null===o?t:null===t?o:[o,t]}},Ri=null,Ai={injectFiberControlledHostComponent:function(e){Ri=e}},Fi=null,Ii=null,Ni={injection:Ai,enqueueStateRestore:H,needsStateRestore:Y,restoreStateIfNeeded:$},Mi=!1,Ui={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Di=Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Vi="function"==typeof Symbol&&Symbol.for,Li=Vi?Symbol.for("react.element"):60103,Wi=Vi?Symbol.for("react.portal"):60106,zi=Vi?Symbol.for("react.fragment"):60107,qi=Vi?Symbol.for("react.strict_mode"):60108,Bi=Vi?Symbol.for("react.profiler"):60114,Hi=Vi?Symbol.for("react.provider"):60109,Yi=Vi?Symbol.for("react.context"):60110,$i=Vi?Symbol.for("react.async_mode"):60111,Ki=Vi?Symbol.for("react.forward_ref"):60112,Gi=Vi?Symbol.for("react.timeout"):60113,Qi="function"==typeof Symbol&&Symbol.iterator,Ji=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Xi={},Zi={},eo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){eo[e]=new fe(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];eo[t]=new fe(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){eo[e]=new fe(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(e){eo[e]=new fe(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){eo[e]=new fe(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){eo[e]=new fe(e,3,!0,e.toLowerCase(),null)}),["capture","download"].forEach(function(e){eo[e]=new fe(e,4,!1,e.toLowerCase(),null)}),["cols","rows","size","span"].forEach(function(e){eo[e]=new fe(e,6,!1,e.toLowerCase(),null)}),["rowSpan","start"].forEach(function(e){eo[e]=new fe(e,5,!1,e.toLowerCase(),null)});var to=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(to,pe);eo[t]=new fe(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(to,pe);eo[t]=new fe(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(to,pe);eo[t]=new fe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),eo.tabIndex=new fe("tabIndex",1,!1,"tabindex",null);var no={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},ro=null,io=null,oo=!1;Nr.canUseDOM&&(oo=ee("input")&&(!document.documentMode||9<document.documentMode));var ao={eventTypes:no,_isInputEventSupported:oo,extractEvents:function(e,t,n,r){var i=t?w(t):window,o=void 0,a=void 0,u=i.nodeName&&i.nodeName.toLowerCase();if("select"===u||"input"===u&&"file"===i.type?o=Se:X(i)?oo?o=Te:(o=Ce,a=je):(u=i.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=Pe),o&&(o=o(e,t)))return _e(o,n,r);a&&a(e,i,t),"blur"===e&&null!=t&&(e=t._wrapperState||i._wrapperState)&&e.controlled&&"number"===i.type&&be(i,"number",i.value)}},uo=M.extend({view:null,detail:null}),co={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},so=uo.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Ae,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}}),lo=so.extend({pointerId:null,width:null,height:null,pressure:null,tiltX:null,tiltY:null,pointerType:null,isPrimary:null}),fo={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},po={eventTypes:fo,extractEvents:function(e,t,n,r){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;if(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o?(o=t,t=(t=n.relatedTarget||n.toElement)?b(t):null):o=null,o===t)return null;var a=void 0,u=void 0,c=void 0,s=void 0;return"mouseout"===e||"mouseover"===e?(a=so,u=fo.mouseLeave,c=fo.mouseEnter,s="mouse"):"pointerout"!==e&&"pointerover"!==e||(a=lo,u=fo.pointerLeave,c=fo.pointerEnter,s="pointer"),e=null==o?i:w(o),i=null==t?i:w(t),u=a.getPooled(u,o,n,r),u.type=s+"leave",u.target=e,u.relatedTarget=i,n=a.getPooled(c,t,n,r),n.type=s+"enter",n.target=i,n.relatedTarget=e,T(u,n,o,t),[u,n]}},ho=M.extend({animationName:null,elapsedTime:null,pseudoElement:null}),vo=M.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yo=uo.extend({relatedTarget:null}),mo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},go={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bo=uo.extend({key:function(e){if(e.key){var t=mo[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=De(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?go[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Ae,charCode:function(e){return"keypress"===e.type?De(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?De(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),wo=so.extend({dataTransfer:null}),_o=uo.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Ae}),Oo=M.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Eo=so.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),So=[["abort","abort"],[li,"animationEnd"],[fi,"animationIteration"],[pi,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[di,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],xo={},ko={};[["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(e){Ve(e,!0)}),So.forEach(function(e){Ve(e,!1)});var jo={eventTypes:xo,isInteractiveTopLevelEventType:function(e){return void 0!==(e=ko[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var i=ko[e];if(!i)return null;switch(e){case"keypress":if(0===De(n))return null;case"keydown":case"keyup":e=bo;break;case"blur":case"focus":e=yo;break;case"click":if(2===n.button)return null;case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=so;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=wo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=_o;break;case li:case fi:case pi:e=ho;break;case di:e=Oo;break;case"scroll":e=uo;break;case"wheel":e=Eo;break;case"copy":case"cut":case"paste":e=vo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=lo;break;default:e=M}return t=e.getPooled(i,t,n,r),P(t),t}},Co=jo.isInteractiveTopLevelEventType,Po=[],To=!0,Ro={get _enabled(){return To},setEnabled:We,isEnabled:function(){return To},trapBubbledEvent:ze,trapCapturedEvent:qe,dispatchEvent:He},Ao={},Fo=0,Io="_reactListenersID"+(""+Math.random()).slice(2),No=Nr.canUseDOM&&"documentMode"in document&&11>=document.documentMode,Mo={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Uo=null,Do=null,Vo=null,Lo=!1,Wo={eventTypes:Mo,extractEvents:function(e,t,n,r){var i,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!o)){e:{o=Ye(o),i=Kr.onSelect;for(var a=0;a<i.length;a++){var u=i[a];if(!o.hasOwnProperty(u)||!o[u]){o=!1;break e}}o=!0}i=!o}if(i)return null;switch(o=t?w(t):window,e){case"focus":(X(o)||"true"===o.contentEditable)&&(Uo=o,Do=t,Vo=null);break;case"blur":Vo=Do=Uo=null;break;case"mousedown":Lo=!0;break;case"contextmenu":case"mouseup":return Lo=!1,Qe(n,r);case"selectionchange":if(No)break;case"keydown":case"keyup":return Qe(n,r)}return null}};ei.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),Qr=oi.getFiberCurrentPropsFromNode,Jr=oi.getInstanceFromNode,Xr=oi.getNodeFromInstance,ei.injectEventPluginsByName({SimpleEventPlugin:jo,EnterLeaveEventPlugin:po,ChangeEventPlugin:ao,SelectEventPlugin:Wo,BeforeInputEventPlugin:Ti});var zo=void 0;zo="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};var qo=void 0,Bo=void 0;if(Nr.canUseDOM){var Ho=[],Yo=0,$o={},Ko=-1,Go=!1,Qo=!1,Jo=0,Xo=33,Zo=33,ea={didTimeout:!1,timeRemaining:function(){var e=Jo-zo();return 0<e?e:0}},ta=function(e,t){if($o[t])try{e(ea)}finally{delete $o[t]}},na="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(e){if(e.source===window&&e.data===na&&(Go=!1,0!==Ho.length)){if(0!==Ho.length&&(e=zo(),!(-1===Ko||Ko>e))){Ko=-1,ea.didTimeout=!0;for(var t=0,n=Ho.length;t<n;t++){var r=Ho[t],i=r.timeoutTime;-1!==i&&i<=e?ta(r.scheduledCallback,r.callbackId):-1!==i&&(-1===Ko||i<Ko)&&(Ko=i)}}for(e=zo();0<Jo-e&&0<Ho.length;)e=Ho.shift(),ea.didTimeout=!1,ta(e.scheduledCallback,e.callbackId),e=zo();0<Ho.length&&!Qo&&(Qo=!0,requestAnimationFrame(ra))}},!1);var ra=function(e){Qo=!1;var t=e-Jo+Zo;t<Zo&&Xo<Zo?(8>t&&(t=8),Zo=t<Xo?Xo:t):Xo=t,Jo=e+Zo,Go||(Go=!0,window.postMessage(na,"*"))};qo=function(e,t){var n=-1;return null!=t&&"number"==typeof t.timeout&&(n=zo()+t.timeout),(-1===Ko||-1!==n&&n<Ko)&&(Ko=n),Yo++,t=Yo,Ho.push({scheduledCallback:e,callbackId:t,timeoutTime:n}),$o[t]=!0,Qo||(Qo=!0,requestAnimationFrame(ra)),t},Bo=function(e){delete $o[e]}}else{var ia=0,oa={};qo=function(e){var t=ia++,n=setTimeout(function(){e({timeRemaining:function(){return 1/0},didTimeout:!1})});return oa[t]=n,t},Bo=function(e){var t=oa[e];delete oa[e],clearTimeout(t)}}var aa={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},ua=void 0,ca=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==aa.svg||"innerHTML"in e)e.innerHTML=t;else{for(ua=ua||document.createElement("div"),ua.innerHTML="<svg>"+t+"</svg>",t=ua.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}),sa={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},la=["Webkit","ms","Moz","O"];Object.keys(sa).forEach(function(e){la.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sa[t]=sa[e]})});var fa=Mr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),pa=Ur.thatReturns(""),da={createElement:pt,createTextNode:dt,setInitialProperties:ht,diffProperties:vt,updateProperties:yt,diffHydratedProperties:mt,diffHydratedText:gt,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(me(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var o=_(i);o||r("90"),ie(i),me(i,o)}}}break;case"textarea":rt(e,n);break;case"select":null!=(t=n.value)&&Ze(e,!!n.multiple,t,!1)}}},ha=null,va=null,ya=zo,ma=qo,ga=Bo;new Set;var ba=[],wa=-1,_a=Et(Wr),Oa=Et(!1),Ea=Wr,Sa=null,xa=null,ka=!1,ja=Et(null),Ca=Et(null),Pa=Et(0),Ta={},Ra=Et(Ta),Aa=Et(Ta),Fa=Et(Ta),Ia={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===Fe(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=er();r=Xn(r,e);var i=Kt(r);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Qt(e,i,r),Zn(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=er();r=Xn(r,e);var i=Kt(r);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Qt(e,i,r),Zn(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=er();n=Xn(n,e);var r=Kt(n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),Qt(e,r,n),Zn(e,n)}},Na=Array.isArray,Ma=mn(!0),Ua=mn(!1),Da=null,Va=null,La=!1,Wa=void 0,za=void 0,qa=void 0;Wa=function(){},za=function(e,t,n){(t.updateQueue=n)&&Fn(t)},qa=function(e,t,n,r){n!==r&&Fn(t)};var Ba=ya(),Ha=2,Ya=Ba,$a=0,Ka=0,Ga=!1,Qa=null,Ja=null,Xa=0,Za=-1,eu=!1,tu=null,nu=!1,ru=!1,iu=null,ou=null,au=null,uu=0,cu=-1,su=!1,lu=null,fu=0,pu=0,du=!1,hu=!1,vu=null,yu=null,mu=!1,gu=!1,bu=!1,wu=null,_u=1e3,Ou=0,Eu=1,Su={updateContainerAtExpirationTime:wr,createContainer:function(e,t,n){return Wt(e,t,n)},updateContainer:Or,flushRoot:sr,requestWork:ir,computeUniqueAsyncExpiration:Jn,batchedUpdates:yr,unbatchedUpdates:mr,deferredUpdates:tr,syncUpdates:nr,interactiveUpdates:function(e,t,n){if(bu)return e(t,n);mu||su||0===pu||(cr(pu,!1,null),pu=0);var r=bu,i=mu;mu=bu=!0;try{return e(t,n)}finally{bu=r,(mu=i)||su||ur()}},flushInteractiveUpdates:function(){su||0===pu||(cr(pu,!1,null),pu=0)},flushControlled:br,flushSync:gr,getPublicRootInstance:Er,findHostInstance:_r,findHostInstanceWithNoPortals:function(e){return e=Ue(e),null===e?null:e.stateNode},injectIntoDevTools:Sr};Ai.injectFiberControlledHostComponent(da),kr.prototype.render=function(e){this._defer||r("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,i=new jr;return wr(e,t,null,n,i._onCommit),i},kr.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},kr.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||r("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var i=null,o=t;o!==this;)i=o,o=o._next;null===i&&r("251"),i._next=o._next,this._next=t,e.firstBatch=this}this._defer=!1,sr(e,n),t=this._next,this._next=null,t=e.firstBatch=t,null!==t&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},kr.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},jr.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},jr.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!=typeof n&&r("191",n),n()}}},Cr.prototype.render=function(e,t){var n=this._internalRoot,r=new jr;return t=void 0===t?null:t,null!==t&&r.then(t),Or(e,n,null,r._onCommit),r},Cr.prototype.unmount=function(e){var t=this._internalRoot,n=new jr;return e=void 0===e?null:e,null!==e&&n.then(e),Or(null,t,null,n._onCommit),n},Cr.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,i=new jr;return n=void 0===n?null:n,null!==n&&i.then(n),Or(t,r,e,i._onCommit),i},Cr.prototype.createBatch=function(){var e=new kr(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime<=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},K=Su.batchedUpdates,G=Su.interactiveUpdates,Q=Su.flushInteractiveUpdates;var xu={createPortal:Ar,findDOMNode:function(e){return null==e?null:1===e.nodeType?e:_r(e)},hydrate:function(e,t,n){return Rr(null,e,t,!0,n)},render:function(e,t,n){return Rr(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,i){return(null==e||void 0===e._reactInternalFiber)&&r("38"),Rr(e,t,n,!1,i)},unmountComponentAtNode:function(e){return Pr(e)||r("40"),!!e._reactRootContainer&&(mr(function(){Rr(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return Ar.apply(void 0,arguments)},unstable_batchedUpdates:yr,unstable_deferredUpdates:tr,flushSync:gr,unstable_flushControlled:br,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:ti,EventPluginRegistry:Gr,EventPropagators:ai,ReactControlledComponent:Ni,ReactDOMComponentTree:oi,ReactDOMEventListener:Ro},unstable_createRoot:function(e,t){return new Cr(e,!0,null!=t&&!0===t.hydrate)}};Sr({findFiberByHostInstance:b,bundleType:0,version:"16.4.0",rendererPackageName:"react-dom"});var ku={default:xu},ju=ku&&xu||ku;e.exports=ju.default?ju.default:ju},function(e,t,n){"use strict";function r(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),e.exports=n(534)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1],a=n||t+"Subscription",c=function(e){function n(o,a){r(this,n);var u=i(this,e.call(this,o,a));return u[t]=o.store,u}return o(n,e),n.prototype.getChildContext=function(){var e;return e={},e[t]=this[t],e[a]=null,e},n.prototype.render=function(){return u.Children.only(this.props.children)},n}(u.Component);return c.propTypes={store:l.a.isRequired,children:s.a.element.isRequired},c.childContextTypes=(e={},e[t]=l.a.isRequired,e[a]=l.b,e),c}t.b=a;var u=n(10),c=(n.n(u),n(13)),s=n.n(c),l=n(201);n(136);t.a=a()},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function o(e,t){return e===t}var a=n(199),u=n(544),c=n(538),s=n(539),l=n(540),f=n(541),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?a.a:t,d=e.mapStateToPropsFactories,h=void 0===d?s.a:d,v=e.mapDispatchToPropsFactories,y=void 0===v?c.a:v,m=e.mergePropsFactories,g=void 0===m?l.a:m,b=e.selectorFactory,w=void 0===b?f.a:b;return function(e,t,a){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=c.pure,l=void 0===s||s,f=c.areStatesEqual,d=void 0===f?o:f,v=c.areOwnPropsEqual,m=void 0===v?u.a:v,b=c.areStatePropsEqual,_=void 0===b?u.a:b,O=c.areMergedPropsEqual,E=void 0===O?u.a:O,S=r(c,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),x=i(e,h,"mapStateToProps"),k=i(t,y,"mapDispatchToProps"),j=i(a,g,"mergeProps");return n(w,p({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:x,initMapDispatchToProps:k,initMergeProps:j,pure:l,areStatesEqual:d,areOwnPropsEqual:m,areStatePropsEqual:_,areMergedPropsEqual:E},S))}}()},function(e,t,n){"use strict";function r(e){return"function"==typeof e?n.i(u.a)(e,"mapDispatchToProps"):void 0}function i(e){return e?void 0:n.i(u.b)(function(e){return{dispatch:e}})}function o(e){return e&&"object"==typeof e?n.i(u.b)(function(t){return n.i(a.bindActionCreators)(e,t)}):void 0}var a=n(95),u=n(200);t.a=[r,i,o]},function(e,t,n){"use strict";function r(e){return"function"==typeof e?n.i(o.a)(e,"mapStateToProps"):void 0}function i(e){return e?void 0:n.i(o.b)(function(){return{}})}var o=n(200);t.a=[r,i]},function(e,t,n){"use strict";function r(e,t,n){return u({},n,e,t)}function i(e){return function(t,n){var r=(n.displayName,n.pure),i=n.areMergedPropsEqual,o=!1,a=void 0;return function(t,n,u){var c=e(t,n,u);return o?r&&i(c,a)||(a=c):(o=!0,a=c),a}}}function o(e){return"function"==typeof e?i(e):void 0}function a(e){return e?void 0:function(){return r}}var u=(n(202),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});t.a=[o,a]},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function o(e,t,n,r,i){function o(i,o){return h=i,v=o,y=e(h,v),m=t(r,v),g=n(y,m,v),d=!0,g}function a(){return y=e(h,v),t.dependsOnOwnProps&&(m=t(r,v)),g=n(y,m,v)}function u(){return e.dependsOnOwnProps&&(y=e(h,v)),t.dependsOnOwnProps&&(m=t(r,v)),g=n(y,m,v)}function c(){var t=e(h,v),r=!p(t,y);return y=t,r&&(g=n(y,m,v)),g}function s(e,t){var n=!f(t,v),r=!l(e,h);return h=e,v=t,n&&r?a():n?u():r?c():g}var l=i.areStatesEqual,f=i.areOwnPropsEqual,p=i.areStatePropsEqual,d=!1,h=void 0,v=void 0,y=void 0,m=void 0,g=void 0;return function(e,t){return d?s(e,t):o(e,t)}}function a(e,t){var n=t.initMapStateToProps,a=t.initMapDispatchToProps,u=t.initMergeProps,c=r(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(e,c),l=a(e,c),f=u(e,c);return(c.pure?o:i)(s,l,f,e,c)}t.a=a;n(542)},function(e,t,n){"use strict";n(136)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){var e=[],t=[];return{clear:function(){t=o,e=o},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==o&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}}n.d(t,"a",function(){return u});var o=null,a={notify:function(){}},u=function(){function e(t,n,i){r(this,e),this.store=t,this.parentSub=n,this.onStateChange=i,this.unsubscribe=null,this.listeners=a}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=i())},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=a)},e}()},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!o.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}t.a=i;var o=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);g(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function i(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||A}function o(){}function a(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||A}function u(e,t,n){var r=void 0,i={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)N.call(t,r)&&!M.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];i.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:O,type:e,key:o,ref:a,props:i,_owner:I.current}}function c(e){return"object"==typeof e&&null!==e&&e.$$typeof===O}function s(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function l(e,t,n,r){if(D.length){var i=D.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function f(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>D.length&&D.push(e)}function p(e,t,n,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case O:case E:a=!0}}if(a)return n(i,e,""===t?"."+d(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u<e.length;u++){o=e[u];var c=t+d(o,u);a+=p(o,c,n,i)}else if(null===e||void 0===e?c=null:(c=R&&e[R]||e["@@iterator"],c="function"==typeof c?c:null),"function"==typeof c)for(e=c.call(e),u=0;!(o=e.next()).done;)o=o.value,c=t+d(o,u++),a+=p(o,c,n,i);else"object"===o&&(n=""+e,r("31","[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function d(e,t){return"object"==typeof e&&null!==e&&null!=e.key?s(e.key):t.toString(36)}function h(e,t){e.func.call(e.context,t,e.count++)}function v(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?y(e,r,n,w.thatReturnsArgument):null!=e&&(c(e)&&(t=i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(U,"$&/")+"/")+n,e={$$typeof:O,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function y(e,t,n,r,i){var o="";null!=n&&(o=(""+n).replace(U,"$&/")+"/"),t=l(t,o,r,i),null==e||p(e,"",v,t),f(t)}/** @license React v16.4.0 * react.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var m=n(198),g=n(124),b=n(173),w=n(123),_="function"==typeof Symbol&&Symbol.for,O=_?Symbol.for("react.element"):60103,E=_?Symbol.for("react.portal"):60106,S=_?Symbol.for("react.fragment"):60107,x=_?Symbol.for("react.strict_mode"):60108,k=_?Symbol.for("react.profiler"):60114,j=_?Symbol.for("react.provider"):60109,C=_?Symbol.for("react.context"):60110,P=_?Symbol.for("react.async_mode"):60111,T=_?Symbol.for("react.forward_ref"):60112;_&&Symbol.for("react.timeout");var R="function"==typeof Symbol&&Symbol.iterator,A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};i.prototype.isReactComponent={},i.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e,t,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=i.prototype;var F=a.prototype=new o;F.constructor=a,m(F,i.prototype),F.isPureReactComponent=!0;var I={current:null},N=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0},U=/\/+/g,D=[],V={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return y(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=l(null,null,t,n),null==e||p(e,"",h,t),f(t)},count:function(e){return null==e?0:p(e,"",w.thatReturnsNull,null)},toArray:function(e){var t=[];return y(e,t,null,w.thatReturnsArgument),t},only:function(e){return c(e)||r("143"),e}},createRef:function(){return{current:null}},Component:i,PureComponent:a,createContext:function(e,t){return void 0===t&&(t=null),e={$$typeof:C,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null},e.Provider={$$typeof:j,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:T,render:e}},Fragment:S,StrictMode:x,unstable_AsyncMode:P,unstable_Profiler:k,createElement:u,cloneElement:function(e,t,n){(null===e||void 0===e)&&r("267",e);var i=void 0,o=m({},e.props),a=e.key,u=e.ref,c=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,c=I.current),void 0!==t.key&&(a=""+t.key);var s=void 0;e.type&&e.type.defaultProps&&(s=e.type.defaultProps);for(i in t)N.call(t,i)&&!M.hasOwnProperty(i)&&(o[i]=void 0===t[i]&&void 0!==s?s[i]:t[i])}if(1===(i=arguments.length-2))o.children=n;else if(1<i){s=Array(i);for(var l=0;l<i;l++)s[l]=arguments[l+2];o.children=s}return{$$typeof:O,type:e.type,key:a,ref:u,props:o,_owner:c}},createFactory:function(e){var t=u.bind(null,e);return t.type=e,t},isValidElement:c,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:I,assign:m}},L={default:V},W=L&&V||L;e.exports=W.default?W.default:W},function(e,t,n){!function(t,n){e.exports=n()}("undefined"!=typeof self&&self,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=96)}([function(e,t,n){"use strict";var r=n(160),i=n(161),o=n(186),a=n(187),u=n(222),c=n(223);t.a={allowsArrayErrors:!0,empty:{},emptyList:[],getIn:i.a,setIn:o.a,deepEqual:a.a,deleteIn:u.a,forEach:function(e,t){return e.forEach(t)},fromJS:function(e){return e},keys:c.a,size:function(e){return e?e.length:0},some:function(e,t){return e.some(t)},splice:r.a,toJS:function(e){return e}}},function(e,t,n){"use strict";e.exports=n(98)},function(e,t,n){e.exports=n(112)()},function(e,t,n){"use strict";var r=n(64),i="object"==typeof self&&self&&self.Object===Object&&self;t.a=r.a||i||Function("return this")()},function(e,t,n){"use strict";t.a=Array.isArray},function(e,t,n){"use strict";function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.a=r},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t,n){"use strict";function r(e,t){var n=Object(o.a)(e,t);return Object(i.a)(n)?n:void 0}var i=n(167),o=n(170);t.a=r},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,u){if(!e){var c;if(void 0===t)c=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,i,o,a,u],l=0;c=Error(t.replace(/%s/g,function(){return s[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=(n(140),n(61),n(142));n.d(t,"a",function(){return r.a})},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?c:u:s&&s in Object(e)?Object(o.a)(e):Object(a.a)(e)}var i=n(17),o=n(145),a=n(146),u="[object Null]",c="[object Undefined]",s=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){"use strict";t.a=function(e,t){var n=e._reduxForm.sectionPrefix;return n?n+"."+t:t}},function(e,t,n){"use strict";function r(e,t){return e===t||e!==e&&t!==t}t.a=r},function(e,t,n){"use strict";function r(e){if("string"==typeof e||Object(i.a)(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}var i=n(19),o=1/0;t.a=r},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){if(!Object(a.a)(e)||Object(i.a)(e)!=u)return!1;var t=Object(o.a)(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==p}var i=n(10),o=n(65),a=n(6),u="[object Object]",c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,p=l.call(Object);t.a=r},function(e,t,n){"use strict";t.a=n(3).a.Symbol},function(e,t,n){"use strict";function r(e){return Object(a.a)(e)?Object(i.a)(e,s.a):Object(u.a)(e)?[e]:Object(o.a)(Object(c.a)(Object(l.a)(e)))}var i=n(75),o=n(76),a=n(4),u=n(19),c=n(77),s=n(14),l=n(79);t.a=r},function(e,t,n){"use strict";function r(e){return"symbol"==typeof e||Object(o.a)(e)&&Object(i.a)(e)==a}var i=n(10),o=n(6),a="[object Symbol]";t.a=r},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)(Object,"create")},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(175),o=n(176),a=n(177),u=n(178),c=n(179);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=e.length;n--;)if(Object(i.a)(e[n][0],t))return n;return-1}var i=n(13);t.a=r},function(e,t,n){"use strict";function r(e,t){var n=e.__data__;return Object(i.a)(t)?n["string"==typeof t?"string":"hash"]:n.map}var i=n(181);t.a=r},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";function r(e){return null!=e&&Object(o.a)(e.length)&&!Object(i.a)(e)}var i=n(35),o=n(44);t.a=r},function(e,t,n){"use strict";function r(e,t,n){"__proto__"==t&&i.a?Object(i.a)(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var i=n(86);t.a=r},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* object-assign (c) Sindre Sorhus @license MIT */ var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;10>n;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,c=r(e),s=1;arguments.length>s;s++){n=Object(arguments[s]);for(var l in n)o.call(n,l)&&(c[l]=n[l]);if(i){u=i(n);for(var f=0;u.length>f;f++)a.call(n,u[f])&&(c[u[f]]=n[u[f]])}}return c}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=r(o),u=n(109),c=r(u),s=n(110),l=r(s),f=n(116),p=r(f),d=n(118),h=r(d),v=n(120),y=r(v),m=n(51),g=r(m);t.default=function(e){var t=e.children,n=e.path,r=e.version,o=e.breadcrumbs,u="/"===n,s="https://redux-form.com/"+r;return a.default.createElement("div",{className:(0,g.default)(c.default.app,i({},c.default.hasNav,!u))},!u&&a.default.createElement(p.default,{path:n,url:s}),a.default.createElement("div",{className:c.default.contentAndFooter},a.default.createElement("div",{className:c.default.topNav},a.default.createElement("a",{href:"https://redux-form.com",className:c.default.brand}),a.default.createElement("a",{className:c.default.github,href:"https://github.com/erikras/redux-form",title:"Github",target:"_blank"},a.default.createElement("i",{className:"fa fa-fw fa-github"}))),a.default.createElement("div",{className:(0,g.default)(c.default.content,i({},c.default.home,u))},u?a.default.createElement(l.default,{version:r}):a.default.createElement("div",null,a.default.createElement(h.default,{items:o}),t)),a.default.createElement("div",{className:c.default.footer},a.default.createElement("div",null,"Created by Erik Rasmussen"),a.default.createElement("div",null,"Got questions? Ask for help:",a.default.createElement("a",{className:c.default.help,href:"https://stackoverflow.com/questions/ask?tags=redux-form",title:"Stack Overflow",target:"_blank"},a.default.createElement("i",{className:"fa fa-fw fa-stack-overflow"})),a.default.createElement("a",{className:c.default.help,href:"https://github.com/erikras/redux-form/issues/new",title:"Github",target:"_blank"},a.default.createElement("i",{className:"fa fa-fw fa-github"}))),a.default.createElement("div",null,a.default.createElement(y.default,{username:"erikras",showUsername:!0,large:!0}),a.default.createElement(y.default,{username:"ReduxForm",showUsername:!0,large:!0})))))}},function(e,t,n){(function(t){(function(){"use strict";function t(e){this.tokens=[],this.tokens.links={},this.options=e||f.defaults,this.rules=p.normal,this.options.gfm&&(this.rules=this.options.tables?p.tables:p.gfm)}function n(e,t){if(this.options=t||f.defaults,this.links=e,this.rules=d.normal,this.renderer=this.options.renderer||new r,this.renderer.options=this.options,!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?d.breaks:d.gfm:this.options.pedantic&&(this.rules=d.pedantic)}function r(e){this.options=e||{}}function i(e){this.tokens=[],this.token=null,this.options=e||f.defaults,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options}function o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function a(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function u(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):RegExp(e,t)}}function c(e,t){return h[" "+e]||(h[" "+e]=/^[^:]+:\/*[^\/]*$/.test(e)?e+"/":e.replace(/[^\/]*$/,"")),e=h[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function s(){}function l(e){for(var t,n,r=1;arguments.length>r;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function f(e,n,r){if(r||"function"==typeof n){r||(r=n,n=null),n=l({},f.defaults,n||{});var a,u,c=n.highlight,s=0;try{a=t.lex(e,n)}catch(e){return r(e)}u=a.length;var p=function(e){if(e)return n.highlight=c,r(e);var t;try{t=i.parse(a,n)}catch(t){e=t}return n.highlight=c,e?r(e):r(null,t)};if(!c||3>c.length)return p();if(delete n.highlight,!u)return p();for(;a.length>s;s++)!function(e){"code"!==e.type?--u||p():c(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--u||p():(e.text=n,e.escaped=!0,void(--u||p()))})}(a[s])}else try{return n&&(n=l({},f.defaults,n)),i.parse(t.lex(e,n),n)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(n||f.defaults).silent)return"<p>An error occurred:</p><pre>"+o(e.message+"",!0)+"</pre>";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:s,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:s,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:s,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=u(p.item,"gm")(/bull/g,p.bullet)(),p.list=u(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=u(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=u(p.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,p._tag)(),p.paragraph=u(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=l({},p),p.gfm=l({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=u(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=l({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=p,t.lex=function(e,n){return new t(n).lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,u,c,s,l,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),c={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},l=0;c.align.length>l;l++)c.align[l]=/^ *-+: *$/.test(c.align[l])?"right":/^ *:-+: *$/.test(c.align[l])?"center":/^ *:-+ *$/.test(c.align[l])?"left":null;for(l=0;c.cells.length>l;l++)c.cells[l]=c.cells[l].split(/ *\| */);this.tokens.push(c)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,f=o.length,l=0;f>l;l++)c=o[l],s=c.length,c=c.replace(/^ *([*+-]|\d+\.) +/,""),~c.indexOf("\n ")&&(s-=c.length,c=this.options.pedantic?c.replace(/^ {1,4}/gm,""):c.replace(RegExp("^ {1,"+s+"}","gm"),"")),this.options.smartLists&&l!==f-1&&(u=p.bullet.exec(o[l+1])[0],a===u||a.length>1&&u.length>1||(e=o.slice(l+1).join("\n")+e,l=f-1)),i=r||/\n\n(?!\s*$)/.test(c),l!==f-1&&(r="\n"===c.charAt(c.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(c,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),c={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},l=0;c.align.length>l;l++)c.align[l]=/^ *-+: *$/.test(c.align[l])?"right":/^ *:-+: *$/.test(c.align[l])?"center":/^ *:-+ *$/.test(c.align[l])?"left":null;for(l=0;c.cells.length>l;l++)c.cells[l]=c.cells[l].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(c)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var d={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:s,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:s,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};d._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,d._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,d.link=u(d.link)("inside",d._inside)("href",d._href)(),d.reflink=u(d.reflink)("inside",d._inside)(),d.normal=l({},d),d.pedantic=l({},d.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),d.gfm=l({},d.normal,{escape:u(d.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:u(d.text)("]|","~]|")("|","|https?://|")()}),d.breaks=l({},d.gfm,{br:u(d.br)("{2,}","*")(),text:u(d.gfm.text)("{2,}","*")()}),n.rules=d,n.output=function(e,t,r){return new n(t,r).output(e)},n.prototype.output=function(e){for(var t,n,r,i,a="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),a+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=o(this.mangle(":"===i[1].charAt(6)?i[1].substring(7):i[1])),r=this.mangle("mailto:")+n):(n=o(i[1]),r=n),a+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):o(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,a+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){a+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),a+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),a+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),a+=this.renderer.codespan(o(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),a+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),a+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),a+=this.renderer.text(o(this.smartypants(i[0])));else if(e)throw Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=o(i[1]),r=n,a+=this.renderer.link(r,null,n);return a},n.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},n.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},r.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+o(t,!0)+'">'+(n?e:o(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:o(e,!0))+"\n</code></pre>"},r.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},r.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},r.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},r.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},r.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},r.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},r.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},r.prototype.strong=function(e){return"<strong>"+e+"</strong>"},r.prototype.em=function(e){return"<em>"+e+"</em>"},r.prototype.codespan=function(e){return"<code>"+e+"</code>"},r.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},r.prototype.del=function(e){return"<del>"+e+"</del>"},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!v.test(e)&&(e=c(this.options.baseUrl,e));var i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>"},r.prototype.image=function(e,t,n){this.options.baseUrl&&!v.test(e)&&(e=c(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},r.prototype.text=function(e){return e},i.parse=function(e,t,n){return new i(t,n).parse(e)},i.prototype.parse=function(e){this.inline=new n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},i.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;this.token.header.length>e;e++)this.token.align[e],n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;this.token.cells.length>e;e++){for(t=this.token.cells[e],n="",r=0;t.length>r;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});o+=this.renderer.tablerow(n)}return this.renderer.table(i,o);case"blockquote_start":for(var o="";"blockquote_end"!==this.next().type;)o+=this.tok();return this.renderer.blockquote(o);case"list_start":for(var o="",a=this.token.ordered;"list_end"!==this.next().type;)o+=this.tok();return this.renderer.list(o,a);case"list_item_start":for(var o="";"list_item_end"!==this.next().type;)o+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(o);case"loose_item_start":for(var o="";"list_item_end"!==this.next().type;)o+=this.tok();return this.renderer.listitem(o);case"html":return this.renderer.html(this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text));case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var h={},v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;s.exec=s,f.options=f.setOptions=function(e){return l(f.defaults,e),f},f.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new r,xhtml:!1,baseUrl:null},f.Parser=i,f.parser=i.parse,f.Renderer=r,f.Lexer=t,f.lexer=t.lex,f.InlineLexer=n,f.inlineLexer=n.output,f.parse=f,e.exports=f}).call(function(){return this||("undefined"!=typeof window?window:t)}())}).call(t,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"prefix",function(){return r}),n.d(t,"ARRAY_INSERT",function(){return i}),n.d(t,"ARRAY_MOVE",function(){return o}),n.d(t,"ARRAY_POP",function(){return a}),n.d(t,"ARRAY_PUSH",function(){return u}),n.d(t,"ARRAY_REMOVE",function(){return c}),n.d(t,"ARRAY_REMOVE_ALL",function(){return s}),n.d(t,"ARRAY_SHIFT",function(){return l}),n.d(t,"ARRAY_SPLICE",function(){return f}),n.d(t,"ARRAY_UNSHIFT",function(){return p}),n.d(t,"ARRAY_SWAP",function(){return d}),n.d(t,"AUTOFILL",function(){return h}),n.d(t,"BLUR",function(){return v}),n.d(t,"CHANGE",function(){return y}),n.d(t,"CLEAR_FIELDS",function(){return m}),n.d(t,"CLEAR_SUBMIT",function(){return g}),n.d(t,"CLEAR_SUBMIT_ERRORS",function(){return b}),n.d(t,"CLEAR_ASYNC_ERROR",function(){return w}),n.d(t,"DESTROY",function(){return _}),n.d(t,"FOCUS",function(){return O}),n.d(t,"INITIALIZE",function(){return E}),n.d(t,"REGISTER_FIELD",function(){return S}),n.d(t,"RESET",function(){return x}),n.d(t,"SET_SUBMIT_FAILED",function(){return k}),n.d(t,"SET_SUBMIT_SUCCEEDED",function(){return j}),n.d(t,"START_ASYNC_VALIDATION",function(){return C}),n.d(t,"START_SUBMIT",function(){return P}),n.d(t,"STOP_ASYNC_VALIDATION",function(){return T}),n.d(t,"STOP_SUBMIT",function(){return R}),n.d(t,"SUBMIT",function(){return A}),n.d(t,"TOUCH",function(){return F}),n.d(t,"UNREGISTER_FIELD",function(){return I}),n.d(t,"UNTOUCH",function(){return N}),n.d(t,"UPDATE_SYNC_ERRORS",function(){return M}),n.d(t,"UPDATE_SYNC_WARNINGS",function(){return U});var r="@@redux-form/",i=r+"ARRAY_INSERT",o=r+"ARRAY_MOVE",a=r+"ARRAY_POP",u=r+"ARRAY_PUSH",c=r+"ARRAY_REMOVE",s=r+"ARRAY_REMOVE_ALL",l=r+"ARRAY_SHIFT",f=r+"ARRAY_SPLICE",p=r+"ARRAY_UNSHIFT",d=r+"ARRAY_SWAP",h=r+"AUTOFILL",v=r+"BLUR",y=r+"CHANGE",m=r+"CLEAR_FIELDS",g=r+"CLEAR_SUBMIT",b=r+"CLEAR_SUBMIT_ERRORS",w=r+"CLEAR_ASYNC_ERROR",_=r+"DESTROY",O=r+"FOCUS",E=r+"INITIALIZE",S=r+"REGISTER_FIELD",x=r+"RESET",k=r+"SET_SUBMIT_FAILED",j=r+"SET_SUBMIT_SUCCEEDED",C=r+"START_ASYNC_VALIDATION",P=r+"START_SUBMIT",T=r+"STOP_ASYNC_VALIDATION",R=r+"STOP_SUBMIT",A=r+"SUBMIT",F=r+"TOUCH",I=r+"UNREGISTER_FIELD",N=r+"UNTOUCH",M=r+"UPDATE_SYNC_ERRORS",U=r+"UPDATE_SYNC_WARNINGS"},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";var r=(n(63),n(151),n(152));n(153),n(68),n(67),n.d(t,"a",function(){return r.a})},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(164),o=n(180),a=n(182),u=n(183),c=n(184);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";function r(e){if(!Object(o.a)(e))return!1;var t=Object(i.a)(e);return t==u||t==c||t==a||t==s}var i=n(10),o=n(5),a="[object AsyncFunction]",u="[object Function]",c="[object GeneratorFunction]",s="[object Proxy]";t.a=r},function(e,t,n){"use strict";var r=n(7),i=n(3);t.a=Object(r.a)(i.a,"Map")},function(e,t,n){"use strict";function r(e,t,n,a,u){return e===t||(null==e||null==t||!Object(o.a)(e)&&!Object(o.a)(t)?e!==e&&t!==t:Object(i.a)(e,t,n,a,r,u))}var i=n(188),o=n(6);t.a=r},function(e,t,n){"use strict";function r(e){this.size=(this.__data__=new i.a(e)).size}var i=n(21),o=n(189),a=n(190),u=n(191),c=n(192),s=n(193);r.prototype.clear=o.a,r.prototype.delete=a.a,r.prototype.get=u.a,r.prototype.has=c.a,r.prototype.set=s.a,t.a=r},function(e,t,n){"use strict";function r(e){return Object(a.a)(e)?Object(i.a)(e):Object(o.a)(e)}var i=n(83),o=n(215),a=n(25);t.a=r},function(e,t,n){"use strict";var r=n(210),i=n(6),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable;t.a=Object(r.a)(function(){return arguments}())?r.a:function(e){return Object(i.a)(e)&&a.call(e,"callee")&&!u.call(e,"callee")}},function(e,n,r){"use strict";(function(e){var i=r(3),o=r(211),a="object"==typeof t&&t&&!t.nodeType&&t,u=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=u&&u.exports===a,s=c?i.a.Buffer:void 0;n.a=(s?s.isBuffer:void 0)||o.a}).call(n,r(24)(e))},function(e,t,n){"use strict";function r(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&t>e}var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.a=r},function(e,t,n){"use strict";var r=n(212),i=n(213),o=n(214),a=o.a&&o.a.isTypedArray;t.a=a?Object(i.a)(a):r.a},function(e,t,n){"use strict";function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.a=r},function(e,t,n){"use strict";function r(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}var i=Object.prototype;t.a=r},function(e,t,n){"use strict";function r(e,t){if(Object(i.a)(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Object(o.a)(e))||u.test(e)||!a.test(e)||null!=t&&e in Object(t)}var i=n(4),o=n(19),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.a=r},function(e,t,n){"use strict";function r(e){return e}t.a=r},function(e,t,n){"use strict";var r=n(271);t.a=function(e){var t=e.getIn,n=e.keys,i=Object(r.a)(e);return function(e,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(a){var u=r||function(e){return t(e,"form")},c=u(a);if(t(c,e+".syncError"))return!1;if(!o&&t(c,e+".error"))return!1;var s=t(c,e+".syncErrors"),l=t(c,e+".asyncErrors"),f=o?void 0:t(c,e+".submitErrors");if(!s&&!l&&!f)return!0;var p=t(c,e+".registeredFields");return!p||!n(p).filter(function(e){return t(p,"['"+e+"'].count")>0}).some(function(e){return i(t(p,"['"+e+"']"),s,l,f)})}}}},function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=function(e){return e&&e.__esModule?e:{default:e}}(u),s={"image-only":211,default:130},l=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),a(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentDidMount",value:function(){var e=this.props.template,t=document.createElement("script");t.src="https://codefund.io/scripts/4f9aabe5-1dda-413e-b01e-3174c48e4762/embed.js?template="+e+"&theme=dark",document.body.appendChild(t)}},{key:"render",value:function(){var e=this.props.template;return c.default.createElement("div",null,c.default.createElement("div",{id:"codefund_ad",className:"benevolent-sponsor template-"+e,style:{minHeight:(s[e]||150)+"px"}}))}}]),t}(c.default.Component);t.default=l,l.defaultProps={template:"default"}},function(e,t,n){var r,i;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";function n(){for(var e=[],t=0;arguments.length>t;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===i)for(var a in r)o.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(53),u=r(a),c=function(e){return o.default.createElement(u.default,{content:"```"+e.language+e.source+"```"})};c.defaultProps={language:"js"},t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(30),u=r(a),c=n(129),s=r(c),l=n(130),f=r(l),p=function(e){return e.replace(/```(?:javascript|jsx?)([\s\S]+?)```/g,function(e,t){return'<pre class="language-jsx"><code class="language-jsx">'+s.default.highlight(t,s.default.languages.jsx)+"</code></pre>"})},d=new u.default.Renderer;d.heading=function(e,t){var n=e.toLowerCase().replace(/[^\w]+/g,"-");return"<h"+t+' class="'+f.default.heading+'" id="'+n+'">'+e+' <a href="#'+n+'" class="'+f.default.anchor+'">#</a></h'+t+">"},t.default=function(e){return o.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,u.default)(p(e.content),{renderer:d})}})}},function(e,t,n){"use strict";var r=n(31),i=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t,n,i){return{type:r.ARRAY_INSERT,meta:{form:e,field:t,index:n},payload:i}},a=function(e,t,n,i){return{type:r.ARRAY_MOVE,meta:{form:e,field:t,from:n,to:i}}},u=function(e,t){return{type:r.ARRAY_POP,meta:{form:e,field:t}}},c=function(e,t,n){return{type:r.ARRAY_PUSH,meta:{form:e,field:t},payload:n}},s=function(e,t,n){return{type:r.ARRAY_REMOVE,meta:{form:e,field:t,index:n}}},l=function(e,t){return{type:r.ARRAY_REMOVE_ALL,meta:{form:e,field:t}}},f=function(e,t){return{type:r.ARRAY_SHIFT,meta:{form:e,field:t}}},p=function(e,t,n,i,o){var a={type:r.ARRAY_SPLICE,meta:{form:e,field:t,index:n,removeNum:i}};return void 0!==o&&(a.payload=o),a},d=function(e,t,n,i){if(n===i)throw Error("Swap indices cannot be equal");if(0>n||0>i)throw Error("Swap indices cannot be negative");return{type:r.ARRAY_SWAP,meta:{form:e,field:t,indexA:n,indexB:i}}},h=function(e,t,n){return{type:r.ARRAY_UNSHIFT,meta:{form:e,field:t},payload:n}},v=function(e,t,n){return{type:r.AUTOFILL,meta:{form:e,field:t},payload:n}},y=function(e,t,n,i){return{type:r.BLUR,meta:{form:e,field:t,touch:i},payload:n}},m=function(e,t,n,i,o){return{type:r.CHANGE,meta:{form:e,field:t,touch:i,persistentSubmitErrors:o},payload:n}},g=function(e){return{type:r.CLEAR_SUBMIT,meta:{form:e}}},b=function(e){return{type:r.CLEAR_SUBMIT_ERRORS,meta:{form:e}}},w=function(e,t){return{type:r.CLEAR_ASYNC_ERROR,meta:{form:e,field:t}}};t.a={arrayInsert:o,arrayMove:a,arrayPop:u,arrayPush:c,arrayRemove:s,arrayRemoveAll:l,arrayShift:f,arraySplice:p,arraySwap:d,arrayUnshift:h,autofill:v,blur:y,change:m,clearFields:function(e,t,n){for(var i=arguments.length,o=Array(i>3?i-3:0),a=3;i>a;a++)o[a-3]=arguments[a];return{type:r.CLEAR_FIELDS,meta:{form:e,keepTouched:t,persistentSubmitErrors:n,fields:o}}},clearSubmit:g,clearSubmitErrors:b,clearAsyncError:w,destroy:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return{type:r.DESTROY,meta:{form:t}}},focus:function(e,t){return{type:r.FOCUS,meta:{form:e,field:t}}},initialize:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n instanceof Object&&(o=n,n=!1),{type:r.INITIALIZE,meta:i({form:e,keepDirty:n},o),payload:t}},registerField:function(e,t,n){return{type:r.REGISTER_FIELD,meta:{form:e},payload:{name:t,type:n}}},reset:function(e){return{type:r.RESET,meta:{form:e}}},startAsyncValidation:function(e,t){return{type:r.START_ASYNC_VALIDATION,meta:{form:e,field:t}}},startSubmit:function(e){return{type:r.START_SUBMIT,meta:{form:e}}},stopAsyncValidation:function(e,t){return{type:r.STOP_ASYNC_VALIDATION,meta:{form:e},payload:t,error:!(!t||!Object.keys(t).length)}},stopSubmit:function(e,t){return{type:r.STOP_SUBMIT,meta:{form:e},payload:t,error:!(!t||!Object.keys(t).length)}},submit:function(e){return{type:r.SUBMIT,meta:{form:e}}},setSubmitFailed:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return{type:r.SET_SUBMIT_FAILED,meta:{form:e,fields:n},error:!0}},setSubmitSucceeded:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return{type:r.SET_SUBMIT_SUCCEEDED,meta:{form:e,fields:n},error:!1}},touch:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return{type:r.TOUCH,meta:{form:e,fields:n}}},unregisterField:function(e,t){return{type:r.UNREGISTER_FIELD,meta:{form:e},payload:{name:t,destroyOnUnmount:2>=arguments.length||void 0===arguments[2]||arguments[2]}}},untouch:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return{type:r.UNTOUCH,meta:{form:e,fields:n}}},updateSyncErrors:function(e){return{type:r.UPDATE_SYNC_ERRORS,meta:{form:e},payload:{syncErrors:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},error:arguments[2]}}},updateSyncWarnings:function(e){return{type:r.UPDATE_SYNC_WARNINGS,meta:{form:e},payload:{syncWarnings:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},warning:arguments[2]}}}}},function(e,t,n){"use strict";t.a=function(e){var t=e.initialized,n=e.trigger,r=e.pristine;if(!e.syncValidationPasses)return!1;switch(n){case"blur":case"change":return!0;case"submit":return!r||!t;default:return!1}}},function(e,t,n){"use strict";t.a=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o)}},function(e,t,n){"use strict";t.a=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o)}},function(e,t,n){"use strict";t.a=function(e){var t=e.values,n=e.nextProps,r=e.initialRender,i=e.lastFieldValidatorKeys,o=e.fieldValidatorKeys,a=e.structure;return!!r||!a.deepEqual(t,n&&n.values)||!a.deepEqual(i,o)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(135);t.a=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Submit Validation Failed"));return n.errors=e,n}return o(t,e),t}(a.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a});var r=n(2),i=n.n(r),o=i.a.shape({trySubscribe:i.a.func.isRequired,tryUnsubscribe:i.a.func.isRequired,notifyNestedSubs:i.a.func.isRequired,isSubscribed:i.a.func.isRequired}),a=i.a.shape({subscribe:i.a.func.isRequired,dispatch:i.a.func.isRequired,getState:i.a.func.isRequired})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function u(){}function c(e,t){var n={run:function(r){try{var i=e(t.getState(),r);(i!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=i,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}function s(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=s.getDisplayName,p=void 0===l?function(e){return"ConnectAdvanced("+e+")"}:l,w=s.methodName,_=void 0===w?"connectAdvanced":w,O=s.renderCountProp,E=void 0===O?void 0:O,S=s.shouldHandleStateChanges,x=void 0===S||S,k=s.storeKey,j=void 0===k?"store":k,C=s.withRef,P=void 0!==C&&C,T=a(s,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),R=j+"Subscription",A=g++,F=(t={},t[j]=y.a,t[R]=y.b,t),I=(n={},n[R]=y.b,n);return function(t){d()("function"==typeof t,"You must pass a component to the function returned by connect. Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",a=p(n),s=m({},T,{getDisplayName:p,methodName:_,renderCountProp:E,shouldHandleStateChanges:x,storeKey:j,withRef:P,displayName:a,wrappedComponentName:n,WrappedComponent:t}),l=function(n){function l(e,t){r(this,l);var o=i(this,n.call(this,e,t));return o.version=A,o.state={},o.renderCount=0,o.store=e[j]||t[j],o.propsMode=!!e[j],o.setWrappedInstance=o.setWrappedInstance.bind(o),d()(o.store,'Could not find "'+j+'" in either the context or props of "'+a+'". Either wrap the root component in a <Provider>, or explicitly pass "'+j+'" as a prop to "'+a+'".'),o.initSelector(),o.initSubscription(),o}return o(l,n),l.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return e={},e[R]=t||this.context[R],e},l.prototype.componentDidMount=function(){x&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},l.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},l.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},l.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=u,this.store=null,this.selector.run=u,this.selector.shouldComponentUpdate=!1},l.prototype.getWrappedInstance=function(){return d()(P,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+_+"() call."),this.wrappedInstance},l.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},l.prototype.initSelector=function(){this.selector=c(e(this.store.dispatch,s),this.store),this.selector.run(this.props)},l.prototype.initSubscription=function(){x&&(this.subscription=new v.a(this.store,(this.propsMode?this.props:this.context)[R],this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription))},l.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(b)):this.notifyNestedSubs()},l.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},l.prototype.isSubscribed=function(){return!!this.subscription&&this.subscription.isSubscribed()},l.prototype.addExtraProps=function(e){if(!(P||E||this.propsMode&&this.subscription))return e;var t=m({},e);return P&&(t.ref=this.setWrappedInstance),E&&(t[E]=this.renderCount++),this.propsMode&&this.subscription&&(t[R]=this.subscription),t},l.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(h.createElement)(t,this.addExtraProps(e.props))},l}(h.Component);return l.WrappedComponent=t,l.displayName=a,l.childContextTypes=I,l.contextTypes=F,l.propTypes=F,f()(l,t)}}t.a=s;var l=n(62),f=n.n(l),p=n(8),d=n.n(p),h=n(1),v=(n.n(h),n(141)),y=n(60),m=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g=0,b={}},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,l=s&&s(Object);e.exports=function e(t,n,f){if("string"!=typeof n){if(l){var p=s(n);p&&p!==l&&e(t,p,f)}var d=a(n);u&&(d=d.concat(u(n)));for(var h=0;d.length>h;++h){var v=d[h];if(!(r[v]||i[v]||f&&f[v])){var y=c(n,v);try{o(t,v,y)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=(n(16),n(147)),i=(n.n(r),{INIT:"@@redux/INIT"})},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(15))},function(e,t,n){"use strict";var r=n(66);t.a=Object(r.a)(Object.getPrototypeOf,Object)},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e){return function(t,n){function r(){return i}var i=e(t,n);return r.dependsOnOwnProps=!1,r}}function i(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function o(e,t){return function(t,n){var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=i(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=i(o),o=r(t,n)),o},r}}t.a=r,t.b=o,n(70)},function(e,t,n){"use strict";n(16),n(32)},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var i=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t,n,r){var o=t.value;return"checkbox"===e?i({},t,{checked:!!o}):"radio"===e?i({},t,{checked:r(o,n),value:n}):"select-multiple"===e?i({},t,{value:o||[]}):"file"===e?i({},t,{value:o||void 0}):t};t.a=function(e,t,n){var a=e.getIn,u=e.toJS,c=e.deepEqual,s=n.asyncError,l=n.asyncValidating,f=n.onBlur,p=n.onChange,d=n.onDrop,h=n.onDragStart,v=n.dirty,y=n.dispatch,m=n.onFocus,g=n.form,b=n.format,w=n.initial,_=n.pristine,O=n.props,E=n.state,S=n.submitError,x=n.submitFailed,k=n.submitting,j=n.syncError,C=n.syncWarning,P=n.value,T=n._value,R=r(n,["asyncError","asyncValidating","onBlur","onChange","onDrop","onDragStart","dirty","dispatch","onFocus","form","format","initial","parse","pristine","props","state","submitError","submitFailed","submitting","syncError","syncWarning","validate","value","_value","warn"]),A=j||s||S,F=C,I=function(e,n){if(null===n)return e;var r=null==e?"":e;return n?n(e,t):r}(P,b);return{input:o(R.type,{name:t,onBlur:f,onChange:p,onDragStart:h,onDrop:d,onFocus:m,value:I},T,c),meta:i({},u(E),{active:!(!E||!a(E,"active")),asyncValidating:l,autofilled:!(!E||!a(E,"autofilled")),dirty:v,dispatch:y,error:A,form:g,initial:w,warning:F,invalid:!!A,pristine:_,submitting:!!k,submitFailed:!!x,touched:!(!E||!a(E,"touched")),valid:!A,visited:!(!E||!a(E,"visited"))}),custom:i({},R,O)}}},function(e,t,n){"use strict";var r=n(158),i=n(74);t.a=function(e,t){var n=t.name,o=t.parse,a=t.normalize,u=Object(r.a)(e,i.a);return o&&(u=o(u,n)),a&&(u=a(n,u)),u}},function(e,t,n){"use strict";t.a=function(e){return!!(e&&e.stopPropagation&&e.preventDefault)}},function(e,t,n){"use strict";t.a="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.a=r},function(e,t,n){"use strict";function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.a=r},function(e,t,n){"use strict";var r=n(162),i=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g;t.a=Object(r.a)(function(e){var t=[];return i.test(e)&&t.push(""),e.replace(o,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t})},function(e,t,n){"use strict";function r(e){if(null!=e){try{return o.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var i=Function.prototype,o=i.toString;t.a=r},function(e,t,n){"use strict";function r(e){return null==e?"":Object(i.a)(e)}var i=n(185);t.a=r},function(e,t,n){"use strict";function r(e,t,n){n="function"==typeof n?n:void 0;var r=n?n(e,t):void 0;return void 0===r?Object(i.a)(e,t,void 0,n):!!r}var i=n(37);t.a=r},function(e,t,n){"use strict";function r(e,t,n,r,s,l){var f=n&u,p=e.length,d=t.length;if(!(p==d||f&&d>p))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var v=-1,y=!0,m=n&c?new i.a:void 0;for(l.set(e,t),l.set(t,e);++v<p;){var g=e[v],b=t[v];if(r)var w=f?r(b,g,v,t,e,l):r(g,b,v,e,t,l);if(void 0!==w){if(w)continue;y=!1;break}if(m){if(!Object(o.a)(t,function(e,t){if(!Object(a.a)(m,t)&&(g===e||s(g,e,n,r,l)))return m.push(t)})){y=!1;break}}else if(g!==b&&!s(g,b,n,r,l)){y=!1;break}}return l.delete(e),l.delete(t),y}var i=n(194),o=n(197),a=n(198),u=1,c=2;t.a=r},function(e,t,n){"use strict";t.a=n(3).a.Uint8Array},function(e,t,n){"use strict";function r(e,t){var n=Object(a.a)(e),r=!n&&Object(o.a)(e),l=!n&&!r&&Object(u.a)(e),p=!n&&!r&&!l&&Object(s.a)(e),d=n||r||l||p,h=d?Object(i.a)(e.length,String):[],v=h.length;for(var y in e)!t&&!f.call(e,y)||d&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||Object(c.a)(y,v))||h.push(y);return h}var i=n(209),o=n(40),a=n(4),u=n(41),c=n(42),s=n(43),l=Object.prototype,f=l.hasOwnProperty;t.a=r},function(e,t,n){"use strict";var r=n(80),i=function(e,t,n,r,i,o){if(o)return e===t};t.a=function(e,t,n){var o=Object(r.a)(e.props,t,i),a=Object(r.a)(e.state,n,i);return!o||!a}},function(e,t,n){"use strict";function r(e,t){var n={};return t=Object(a.a)(t,3),Object(o.a)(e,function(e,r,o){Object(i.a)(n,r,t(e,r,o))}),n}var i=n(26),o=n(230),a=n(232);t.a=r},function(e,t,n){"use strict";var r=n(7);t.a=function(){try{var e=Object(r.a)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},function(e,t,n){"use strict";var r=n(231);t.a=Object(r.a)()},function(e,t,n){"use strict";function r(e){return e===e&&!Object(i.a)(e)}var i=n(5);t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}t.a=r},function(e,t,n){"use strict";function r(e,t){t=Object(i.a)(t,e);for(var n=0,r=t.length;null!=e&&r>n;)e=e[Object(o.a)(t[n++])];return n&&n==r?e:void 0}var i=n(91),o=n(14);t.a=r},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(e)?e:Object(o.a)(e,t)?[e]:Object(a.a)(Object(u.a)(e))}var i=n(4),o=n(46),a=n(77),u=n(79);t.a=r},function(e,t,n){"use strict";t.a=function(e){var t=e.deepEqual,n=e.empty,r=e.getIn;return function(e,i){return function(o){var a=i||function(e){return r(e,"form")},u=a(o),c=r(u,e+".initial")||n,s=r(u,e+".values")||c;return t(c,s)}}}},function(e,t,n){"use strict";function r(e,t,n){(void 0===n||Object(o.a)(e[t],n))&&(void 0!==n||t in e)||Object(i.a)(e,t,n)}var i=n(26),o=n(13);t.a=r},function(e,t,n){"use strict";function r(e){return Object(a.a)(e)?Object(i.a)(e,!0):Object(o.a)(e)}var i=n(83),o=n(294),a=n(25);t.a=r},function(e,t,n){"use strict";var r=n(73);t.a=function(e){var t=Object(r.a)(e);return t&&e.preventDefault(),t}},function(e,t,n){n(97),e.exports=n(121)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(99),u=r(a),c=n(29),s=r(c);if("undefined"!=typeof window){var l=document.getElementById("content");window.initReact=function(e){return u.default.hydrate(o.default.createElement(s.default,e,o.default.createElement("div",{dangerouslySetInnerHTML:{__html:l.innerHTML}})),l)}}},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;t>r;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."),t.name="Invariant Violation",t.framesToPop=1,t}function i(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||C}function o(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||C}function a(){}function u(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||C}function c(e,t,n){var r,i={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)A.call(t,r)&&!F.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(u>1){for(var c=Array(u),s=0;u>s;s++)c[s]=arguments[s+2];i.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:O,type:e,key:o,ref:a,props:i,_owner:R.current}}function s(e){return"object"==typeof e&&null!==e&&e.$$typeof===O}function l(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function f(e,t,n,r){if(N.length){var i=N.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function p(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>N.length&&N.push(e)}function d(e,t,n,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case O:case E:case S:case x:a=!0}}if(a)return n(i,e,""===t?"."+h(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;e.length>u;u++){o=e[u];var c=t+h(o,u);a+=d(o,c,n,i)}else if(null===e||void 0===e?c=null:(c=j&&e[j]||e["@@iterator"],c="function"==typeof c?c:null),"function"==typeof c)for(e=c.call(e),u=0;!(o=e.next()).done;)o=o.value,c=t+h(o,u++),a+=d(o,c,n,i);else"object"===o&&(n=""+e,r("31","[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function h(e,t){return"object"==typeof e&&null!==e&&null!=e.key?l(e.key):t.toString(36)}function v(e,t){e.func.call(e.context,t,e.count++)}function y(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?m(e,r,n,w.thatReturnsArgument):null!=e&&(s(e)&&(t=i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(I,"$&/")+"/")+n,e={$$typeof:O,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function m(e,t,n,r,i){var o="";null!=n&&(o=(""+n).replace(I,"$&/")+"/"),t=f(t,o,r,i),null==e||d(e,"",y,t),p(t)}/** @license React v16.2.0 * react.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var g=n(27),b=n(28),w=n(11),_="function"==typeof Symbol&&Symbol.for,O=_?Symbol.for("react.element"):60103,E=_?Symbol.for("react.call"):60104,S=_?Symbol.for("react.return"):60105,x=_?Symbol.for("react.portal"):60106,k=_?Symbol.for("react.fragment"):60107,j="function"==typeof Symbol&&Symbol.iterator,C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};i.prototype.isReactComponent={},i.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e,t,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},a.prototype=i.prototype;var P=o.prototype=new a;P.constructor=o,g(P,i.prototype),P.isPureReactComponent=!0;var T=u.prototype=new a;T.constructor=u,g(T,i.prototype),T.unstable_isAsyncReactComponent=!0,T.render=function(){return this.props.children};var R={current:null},A=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0},I=/\/+/g,N=[],M={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return m(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=f(null,null,t,n),null==e||d(e,"",v,t),p(t)},count:function(e){return null==e?0:d(e,"",w.thatReturnsNull,null)},toArray:function(e){var t=[];return m(e,t,null,w.thatReturnsArgument),t},only:function(e){return s(e)||r("143"),e}},Component:i,PureComponent:o,unstable_AsyncComponent:u,Fragment:k,createElement:c,cloneElement:function(e,t,n){var r=g({},e.props),i=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=R.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)A.call(t,c)&&!F.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(c>1){u=Array(c);for(var s=0;c>s;s++)u[s]=arguments[s+2];r.children=u}return{$$typeof:O,type:e.type,key:i,ref:o,props:r,_owner:a}},createFactory:function(e){var t=c.bind(null,e);return t.type=e,t},isValidElement:s,version:"16.2.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:R,assign:g}},U=Object.freeze({default:M}),D=U&&M||U;e.exports=D.default?D.default:D},function(e,t,n){"use strict";function r(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),e.exports=n(100)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;t>r;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."),t.name="Invariant Violation",t.framesToPop=1,t}function i(e,t){return(e&t)===t}function o(e,t){if(Pn.hasOwnProperty(e)||e.length>2&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1]))return!1;if(null===t)return!0;switch(typeof t){case"boolean":return Pn.hasOwnProperty(e)?e=!0:(t=a(e))?e=t.hasBooleanValue||t.hasStringBooleanValue||t.hasOverloadedBooleanValue:(e=e.toLowerCase().slice(0,5),e="data-"===e||"aria-"===e),e;case"undefined":case"number":case"string":case"object":return!0;default:return!1}}function a(e){return Rn.hasOwnProperty(e)?Rn[e]:null}function u(e){return e[1].toUpperCase()}function c(e,t,n,r,i,o,a,u,c){Bn._hasCaughtError=!1,Bn._caughtError=null;var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){Bn._caughtError=e,Bn._hasCaughtError=!0}}function s(){if(Bn._hasRethrowError){var e=Bn._rethrowError;throw Bn._rethrowError=null,Bn._hasRethrowError=!1,e}}function l(){if(Hn)for(var e in Yn){var t=Yn[e],n=Hn.indexOf(e);if(n>-1||r("96",e),!$n[n]){t.extractEvents||r("97",e),$n[n]=t,n=t.eventTypes;for(var i in n){var o=void 0,a=n[i],u=t,c=i;Kn.hasOwnProperty(c)&&r("99",c),Kn[c]=a;var s=a.phasedRegistrationNames;if(s){for(o in s)s.hasOwnProperty(o)&&f(s[o],u,c);o=!0}else a.registrationName?(f(a.registrationName,u,c),o=!0):o=!1;o||r("98",i,e)}}}}function f(e,t,n){Gn[e]&&r("100",e),Gn[e]=t,Qn[e]=t.eventTypes[n].dependencies}function p(e){Hn&&r("101"),Hn=Array.prototype.slice.call(e),l()}function d(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var i=e[t];Yn.hasOwnProperty(t)&&Yn[t]===i||(Yn[t]&&r("102",t),Yn[t]=i,n=!0)}n&&l()}function h(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=er(r),Bn.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function v(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function y(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function m(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;n.length>i&&!e.isPropagationStopped();i++)h(e,t,n[i],r[i]);else n&&h(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function g(e){return m(e,!0)}function b(e){return m(e,!1)}function w(e,t){var n=e.stateNode;if(!n)return null;var i=Xn(n);if(!i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(i=!i.disabled)||(e=e.type,i=!("button"===e||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function _(e,t,n,r){for(var i,o=0;$n.length>o;o++){var a=$n[o];a&&(a=a.extractEvents(e,t,n,r))&&(i=v(i,a))}return i}function O(e){e&&(tr=v(tr,e))}function E(e){var t=tr;tr=null,t&&(e?y(t,g):y(t,b),tr&&r("95"),Bn.rethrowCaughtError())}function S(e){if(e[or])return e[or];for(var t=[];!e[or];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}var n=void 0,r=e[or];if(5===r.tag||6===r.tag)return r;for(;e&&(r=e[or]);e=t.pop())n=r;return n}function x(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function k(e){return e[ar]||null}function j(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function C(e,t,n){for(var r=[];e;)r.push(e),e=j(e);for(e=r.length;e-- >0;)t(r[e],"captured",n);for(e=0;r.length>e;e++)t(r[e],"bubbled",n)}function P(e,t,n){(t=w(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=v(n._dispatchListeners,t),n._dispatchInstances=v(n._dispatchInstances,e))}function T(e){e&&e.dispatchConfig.phasedRegistrationNames&&C(e._targetInst,P,e)}function R(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;t=t?j(t):null,C(t,P,e)}}function A(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=w(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=v(n._dispatchListeners,t),n._dispatchInstances=v(n._dispatchInstances,e))}function F(e){e&&e.dispatchConfig.registrationName&&A(e._targetInst,null,e)}function I(e){y(e,T)}function N(e,t,n,r){if(n&&r)e:{for(var i=n,o=r,a=0,u=i;u;u=j(u))a++;u=0;for(var c=o;c;c=j(c))u++;for(;a-u>0;)i=j(i),a--;for(;u-a>0;)o=j(o),u--;for(;a--;){if(i===o||i===o.alternate)break e;i=j(i),o=j(o)}i=null}else i=null;for(o=i,i=[];n&&n!==o&&(null===(a=n.alternate)||a!==o);)i.push(n),n=j(n);for(n=[];r&&r!==o&&(null===(a=r.alternate)||a!==o);)n.push(r),r=j(r);for(r=0;i.length>r;r++)A(i[r],"bubbled",e);for(e=n.length;e-- >0;)A(n[e],"captured",t)}function M(){return!sr&&wn.canUseDOM&&(sr="textContent"in document.documentElement?"textContent":"innerText"),sr}function U(){if(lr._fallbackText)return lr._fallbackText;var e,t,n=lr._startText,r=n.length,i=D(),o=i.length;for(e=0;r>e&&n[e]===i[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===i[o-t];t++);return lr._fallbackText=i.slice(e,t>1?1-t:void 0)}function D(){return"value"in lr._root?lr._root.value:lr._root[M()]}function V(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface;for(var i in e)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?On.thatReturnsTrue:On.thatReturnsFalse,this.isPropagationStopped=On.thatReturnsFalse,this}function L(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function W(e){e instanceof this||r("223"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function z(e){e.eventPool=[],e.getPooled=L,e.release=W}function q(e,t,n,r){return V.call(this,e,t,n,r)}function B(e,t,n,r){return V.call(this,e,t,n,r)}function H(e,t){switch(e){case"topKeyUp":return-1!==dr.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function Y(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function $(e,t){switch(e){case"topCompositionEnd":return Y(t);case"topKeyPress":return 32!==t.which?null:(Er=!0,_r);case"topTextInput":return e=t.data,e===_r&&Er?null:e;default:return null}}function K(e,t){if(Sr)return"topCompositionEnd"===e||!hr&&H(e,t)?(e=U(),lr._root=null,lr._startText=null,lr._fallbackText=null,Sr=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&t.char.length>1)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"topCompositionEnd":return wr?null:t.data;default:return null}}function G(e){if(e=Zn(e)){kr&&"function"==typeof kr.restoreControlledState||r("194");var t=Xn(e.stateNode);kr.restoreControlledState(e.stateNode,e.type,t)}}function Q(e){jr?Cr?Cr.push(e):Cr=[e]:jr=e}function J(){if(jr){var e=jr,t=Cr;if(Cr=jr=null,G(e),t)for(e=0;t.length>e;e++)G(t[e])}}function X(e,t){return e(t)}function Z(e,t){if(Rr)return X(e,t);Rr=!0;try{return X(e,t)}finally{Rr=!1,J()}}function ee(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ar[e.type]:"textarea"===t}function te(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ne(e,t){if(!wn.canUseDOM||t&&!("addEventListener"in document))return!1;t="on"+e;var n=t in document;return n||(n=document.createElement("div"),n.setAttribute(t,"return;"),n="function"==typeof n[t]),!n&&gr&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}function re(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ie(e){var t=re(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"function"==typeof n.get&&"function"==typeof n.set)return Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:!0,get:function(){return n.get.call(this)},set:function(e){r=""+e,n.set.call(this,e)}}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}function oe(e){e._valueTracker||(e._valueTracker=ie(e))}function ae(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=re(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ue(e,t,n){return e=V.getPooled(Fr.change,e,t,n),e.type="change",Q(n),I(e),e}function ce(e){O(e),E(!1)}function se(e){if(ae(x(e)))return e}function le(e,t){if("topChange"===e)return t}function fe(){Ir&&(Ir.detachEvent("onpropertychange",pe),Nr=Ir=null)}function pe(e){"value"===e.propertyName&&se(Nr)&&(e=ue(Nr,e,te(e)),Z(ce,e))}function de(e,t,n){"topFocus"===e?(fe(),Ir=t,Nr=n,Ir.attachEvent("onpropertychange",pe)):"topBlur"===e&&fe()}function he(e){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return se(Nr)}function ve(e,t){if("topClick"===e)return se(t)}function ye(e,t){if("topInput"===e||"topChange"===e)return se(t)}function me(e,t,n,r){return V.call(this,e,t,n,r)}function ge(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Dr[e])&&!!t[e]}function be(){return ge}function we(e,t,n,r){return V.call(this,e,t,n,r)}function _e(e){return e=e.type,"string"==typeof e?e:"function"==typeof e?e.displayName||e.name:null}function Oe(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(t=t.return,0!=(2&t.effectTag))return 1}return 3===t.tag?2:3}function Ee(e){return!!(e=e._reactInternalFiber)&&2===Oe(e)}function Se(e){2!==Oe(e)&&r("188")}function xe(e){var t=e.alternate;if(!t)return t=Oe(e),3===t&&r("188"),1===t?null:e;for(var n=e,i=t;;){var o=n.return,a=o?o.alternate:null;if(!o||!a)break;if(o.child===a.child){for(var u=o.child;u;){if(u===n)return Se(o),e;if(u===i)return Se(o),t;u=u.sibling}r("188")}if(n.return!==i.return)n=o,i=a;else{u=!1;for(var c=o.child;c;){if(c===n){u=!0,n=o,i=a;break}if(c===i){u=!0,i=o,n=a;break}c=c.sibling}if(!u){for(c=a.child;c;){if(c===n){u=!0,n=a,i=o;break}if(c===i){u=!0,i=a,n=o;break}c=c.sibling}u||r("189")}}n.alternate!==i&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}function ke(e){if(!(e=xe(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function je(e){if(!(e=xe(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ce(e){var t=e.targetInst;do{if(!t){e.ancestors.push(t);break}var n;for(n=t;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(t),t=S(n)}while(t);for(n=0;e.ancestors.length>n;n++)t=e.ancestors[n],Br(e.topLevelType,t,e.nativeEvent,te(e.nativeEvent))}function Pe(e){qr=!!e}function Te(e,t,n){return n?En.listen(n,t,Ae.bind(null,e)):null}function Re(e,t,n){return n?En.capture(n,t,Ae.bind(null,e)):null}function Ae(e,t){if(qr){var n=te(t);if(n=S(n),null===n||"number"!=typeof n.tag||2===Oe(n)||(n=null),zr.length){var r=zr.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{Z(Ce,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>zr.length&&zr.push(e)}}}function Fe(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function Ie(e){if($r[e])return $r[e];if(!Yr[e])return e;var t,n=Yr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Kr)return $r[e]=n[t];return""}function Ne(e){return Object.prototype.hasOwnProperty.call(e,Xr)||(e[Xr]=Jr++,Qr[e[Xr]]={}),Qr[e[Xr]]}function Me(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ue(e,t){var n=Me(e);e=0;for(var r;n;){if(3===n.nodeType){if(r=e+n.textContent.length,t>=e&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Me(n)}}function De(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}function Ve(e,t){if(ii||null==ti||ti!==Sn())return null;var n=ti;return"selectionStart"in n&&De(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,ri&&xn(ri,n)?null:(ri=n,e=V.getPooled(ei.select,ni,e,t),e.type="select",e.target=ti,I(e),e)}function Le(e,t,n,r){return V.call(this,e,t,n,r)}function We(e,t,n,r){return V.call(this,e,t,n,r)}function ze(e,t,n,r){return V.call(this,e,t,n,r)}function qe(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,32>e&&13!==e?0:e}function Be(e,t,n,r){return V.call(this,e,t,n,r)}function He(e,t,n,r){return V.call(this,e,t,n,r)}function Ye(e,t,n,r){return V.call(this,e,t,n,r)}function $e(e,t,n,r){return V.call(this,e,t,n,r)}function Ke(e,t,n,r){return V.call(this,e,t,n,r)}function Ge(e){0>pi||(e.current=fi[pi],fi[pi]=null,pi--)}function Qe(e,t){pi++,fi[pi]=e.current,e.current=t}function Je(e){return Ze(e)?vi:di.current}function Xe(e,t){var n=e.type.contextTypes;if(!n)return Cn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ze(e){return 2===e.tag&&null!=e.type.childContextTypes}function et(e){Ze(e)&&(Ge(hi,e),Ge(di,e))}function tt(e,t,n){null!=di.cursor&&r("168"),Qe(di,t,e),Qe(hi,n,e)}function nt(e,t){var n=e.stateNode,i=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var o in n)o in i||r("108",_e(e)||"Unknown",o);return _n({},t,n)}function rt(e){if(!Ze(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Cn,vi=di.current,Qe(di,t,e),Qe(hi,hi.current,e),!0}function it(e,t){var n=e.stateNode;if(n||r("169"),t){var i=nt(e,vi);n.__reactInternalMemoizedMergedChildContext=i,Ge(hi,e),Ge(di,e),Qe(di,i,e)}else Ge(hi,e);Qe(hi,t,e)}function ot(e,t,n){this.tag=e,this.key=t,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null,this.internalContextTag=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function at(e,t,n){var r=e.alternate;return null===r?(r=new ot(e.tag,e.key,e.internalContextTag),r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.pendingProps=t,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ut(e,t,n){var i=void 0,o=e.type,a=e.key;return"function"==typeof o?(i=o.prototype&&o.prototype.isReactComponent?new ot(2,a,t):new ot(0,a,t),i.type=o,i.pendingProps=e.props):"string"==typeof o?(i=new ot(5,a,t),i.type=o,i.pendingProps=e.props):"object"==typeof o&&null!==o&&"number"==typeof o.tag?(i=o,i.pendingProps=e.props):r("130",null==o?o:typeof o,""),i.expirationTime=n,i}function ct(e,t,n,r){return t=new ot(10,r,t),t.pendingProps=e,t.expirationTime=n,t}function st(e,t,n){return t=new ot(6,null,t),t.pendingProps=e,t.expirationTime=n,t}function lt(e,t,n){return t=new ot(7,e.key,t),t.type=e.handler,t.pendingProps=e,t.expirationTime=n,t}function ft(e,t,n){return e=new ot(9,null,t),e.expirationTime=n,e}function pt(e,t,n){return t=new ot(4,e.key,t),t.pendingProps=e.children||[],t.expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dt(e){return function(t){try{return e(t)}catch(e){}}}function ht(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);yi=dt(function(e){return t.onCommitFiberRoot(n,e)}),mi=dt(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function vt(e){"function"==typeof yi&&yi(e)}function yt(e){"function"==typeof mi&&mi(e)}function mt(e){return{baseState:e,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1}}function gt(e,t){null===e.last?e.first=e.last=t:(e.last.next=t,e.last=t),(0===e.expirationTime||e.expirationTime>t.expirationTime)&&(e.expirationTime=t.expirationTime)}function bt(e,t){var n=e.alternate,r=e.updateQueue;null===r&&(r=e.updateQueue=mt(null)),null!==n?null===(e=n.updateQueue)&&(e=n.updateQueue=mt(null)):e=null,e=e!==r?e:null,null===e?gt(r,t):null===r.last||null===e.last?(gt(r,t),gt(e,t)):(gt(r,t),e.last=t)}function wt(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function _t(e,t,n,r,i,o){null!==e&&e.updateQueue===n&&(n=t.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?e=n.baseState:(e=n.baseState=t.memoizedState,n.isInitialized=!0);for(var a=!0,u=n.first,c=!1;null!==u;){var s=u.expirationTime;if(s>o){var l=n.expirationTime;(0===l||l>s)&&(n.expirationTime=s),c||(c=!0,n.baseState=e)}else c||null===(n.first=u.next)&&(n.last=null),u.isReplace?(e=wt(u,r,e,i),a=!0):(s=wt(u,r,e,i))&&(e=a?_n({},e,s):_n(e,s),a=!1),u.isForced&&(n.hasForceUpdate=!0),null!==u.callback&&(s=n.callbackList,null===s&&(s=n.callbackList=[]),s.push(u));u=u.next}return null!==n.callbackList?t.effectTag|=32:null!==n.first||n.hasForceUpdate||(t.updateQueue=null),c||(n.baseState=e),e}function Ot(e,t){var n=e.callbackList;if(null!==n)for(e.callbackList=null,e=0;n.length>e;e++){var i=n[e],o=i.callback;i.callback=null,"function"!=typeof o&&r("191",o),o.call(t)}}function Et(e,t,n,i){function o(e,t){t.updater=a,e.stateNode=t,t._reactInternalFiber=e}var a={isMounted:Ee,enqueueSetState:function(n,r,i){n=n._reactInternalFiber,i=void 0===i?null:i;var o=t(n);bt(n,{expirationTime:o,partialState:r,callback:i,isReplace:!1,isForced:!1,nextCallback:null,next:null}),e(n,o)},enqueueReplaceState:function(n,r,i){n=n._reactInternalFiber,i=void 0===i?null:i;var o=t(n);bt(n,{expirationTime:o,partialState:r,callback:i,isReplace:!0,isForced:!1,nextCallback:null,next:null}),e(n,o)},enqueueForceUpdate:function(n,r){n=n._reactInternalFiber,r=void 0===r?null:r;var i=t(n);bt(n,{expirationTime:i,partialState:null,callback:r,isReplace:!1,isForced:!0,nextCallback:null,next:null}),e(n,i)}};return{adoptClassInstance:o,constructClassInstance:function(e,t){var n=e.type,r=Je(e),i=2===e.tag&&null!=e.type.contextTypes,a=i?Xe(e,r):Cn;return t=new n(t,a),o(e,t),i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t},mountClassInstance:function(e,t){var n=e.alternate,i=e.stateNode,o=i.state||null,u=e.pendingProps;u||r("158");var c=Je(e);i.props=u,i.state=e.memoizedState=o,i.refs=Cn,i.context=Xe(e,c),null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent&&(e.internalContextTag|=1),"function"==typeof i.componentWillMount&&(o=i.state,i.componentWillMount(),o!==i.state&&a.enqueueReplaceState(i,i.state,null),null!==(o=e.updateQueue)&&(i.state=_t(n,e,o,i,u,t))),"function"==typeof i.componentDidMount&&(e.effectTag|=4)},updateClassInstance:function(e,t,o){var u=t.stateNode;u.props=t.memoizedProps,u.state=t.memoizedState;var c=t.memoizedProps,s=t.pendingProps;s||null==(s=c)&&r("159");var l=u.context,f=Je(t);if(f=Xe(t,f),"function"!=typeof u.componentWillReceiveProps||c===s&&l===f||(l=u.state,u.componentWillReceiveProps(s,f),u.state!==l&&a.enqueueReplaceState(u,u.state,null)),l=t.memoizedState,o=null!==t.updateQueue?_t(e,t,t.updateQueue,u,s,o):l,!(c!==s||l!==o||hi.current||null!==t.updateQueue&&t.updateQueue.hasForceUpdate))return"function"!=typeof u.componentDidUpdate||c===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),!1;var p=s;if(null===c||null!==t.updateQueue&&t.updateQueue.hasForceUpdate)p=!0;else{var d=t.stateNode,h=t.type;p="function"==typeof d.shouldComponentUpdate?d.shouldComponentUpdate(p,o,f):!(h.prototype&&h.prototype.isPureReactComponent&&xn(c,p)&&xn(l,o))}return p?("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(s,o,f),"function"==typeof u.componentDidUpdate&&(t.effectTag|=4)):("function"!=typeof u.componentDidUpdate||c===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),n(t,s),i(t,o)),u.props=s,u.state=o,u.context=f,p}}}function St(e){return null===e||void 0===e?null:(e=Si&&e[Si]||e["@@iterator"],"function"==typeof e?e:null)}function xt(e,t){var n=t.ref;if(null!==n&&"function"!=typeof n){if(t._owner){t=t._owner;var i=void 0;t&&(2!==t.tag&&r("110"),i=t.stateNode),i||r("147",n);var o=""+n;return null!==e&&null!==e.ref&&e.ref._stringRef===o?e.ref:(e=function(e){var t=i.refs===Cn?i.refs={}:i.refs;null===e?delete t[o]:t[o]=e},e._stringRef=o,e)}"string"!=typeof n&&r("148"),t._owner||r("149",n)}return n}function kt(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function jt(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t,n){return e=at(e,t,n),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index,n>r?(t.effectTag=2,n):r):(t.effectTag=2,n):n}function u(t){return e&&null===t.alternate&&(t.effectTag=2),t}function c(e,t,n,r){return null===t||6!==t.tag?(t=st(n,e.internalContextTag,r),t.return=e,t):(t=o(t,n,r),t.return=e,t)}function s(e,t,n,r){return null!==t&&t.type===n.type?(r=o(t,n.props,r),r.ref=xt(t,n),r.return=e,r):(r=ut(n,e.internalContextTag,r),r.ref=xt(t,n),r.return=e,r)}function l(e,t,n,r){return null===t||7!==t.tag?(t=lt(n,e.internalContextTag,r),t.return=e,t):(t=o(t,n,r),t.return=e,t)}function f(e,t,n,r){return null===t||9!==t.tag?(t=ft(n,e.internalContextTag,r),t.type=n.value,t.return=e,t):(t=o(t,null,r),t.type=n.value,t.return=e,t)}function p(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pt(n,e.internalContextTag,r),t.return=e,t):(t=o(t,n.children||[],r),t.return=e,t)}function d(e,t,n,r,i){return null===t||10!==t.tag?(t=ct(n,e.internalContextTag,r,i),t.return=e,t):(t=o(t,n,r),t.return=e,t)}function h(e,t,n){if("string"==typeof t||"number"==typeof t)return t=st(""+t,e.internalContextTag,n),t.return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case bi:return t.type===Ei?(t=ct(t.props.children,e.internalContextTag,n,t.key),t.return=e,t):(n=ut(t,e.internalContextTag,n),n.ref=xt(null,t),n.return=e,n);case wi:return t=lt(t,e.internalContextTag,n),t.return=e,t;case _i:return n=ft(t,e.internalContextTag,n),n.type=t.value,n.return=e,n;case Oi:return t=pt(t,e.internalContextTag,n),t.return=e,t}if(xi(t)||St(t))return t=ct(t,e.internalContextTag,n,null),t.return=e,t;kt(e,t)}return null}function v(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:c(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case bi:return n.key===i?n.type===Ei?d(e,t,n.props.children,r,i):s(e,t,n,r):null;case wi:return n.key===i?l(e,t,n,r):null;case _i:return null===i?f(e,t,n,r):null;case Oi:return n.key===i?p(e,t,n,r):null}if(xi(n)||St(n))return null!==i?null:d(e,t,n,r,null);kt(e,n)}return null}function y(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return e=e.get(n)||null,c(t,e,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case bi:return e=e.get(null===r.key?n:r.key)||null,r.type===Ei?d(t,e,r.props.children,i,r.key):s(t,e,r,i);case wi:return e=e.get(null===r.key?n:r.key)||null,l(t,e,r,i);case _i:return e=e.get(n)||null,f(t,e,r,i);case Oi:return e=e.get(null===r.key?n:r.key)||null,p(t,e,r,i)}if(xi(r)||St(r))return e=e.get(n)||null,d(t,e,r,i,null);kt(t,r)}return null}function m(r,o,u,c){for(var s=null,l=null,f=o,p=o=0,d=null;null!==f&&u.length>p;p++){f.index>p?(d=f,f=null):d=f.sibling;var m=v(r,f,u[p],c);if(null===m){null===f&&(f=d);break}e&&f&&null===m.alternate&&t(r,f),o=a(m,o,p),null===l?s=m:l.sibling=m,l=m,f=d}if(p===u.length)return n(r,f),s;if(null===f){for(;u.length>p;p++)(f=h(r,u[p],c))&&(o=a(f,o,p),null===l?s=f:l.sibling=f,l=f);return s}for(f=i(r,f);u.length>p;p++)(d=y(f,r,p,u[p],c))&&(e&&null!==d.alternate&&f.delete(null===d.key?p:d.key),o=a(d,o,p),null===l?s=d:l.sibling=d,l=d);return e&&f.forEach(function(e){return t(r,e)}),s}function g(o,u,c,s){var l=St(c);"function"!=typeof l&&r("150"),null==(c=l.call(c))&&r("151");for(var f=l=null,p=u,d=u=0,m=null,g=c.next();null!==p&&!g.done;d++,g=c.next()){p.index>d?(m=p,p=null):m=p.sibling;var b=v(o,p,g.value,s);if(null===b){p||(p=m);break}e&&p&&null===b.alternate&&t(o,p),u=a(b,u,d),null===f?l=b:f.sibling=b,f=b,p=m}if(g.done)return n(o,p),l;if(null===p){for(;!g.done;d++,g=c.next())null!==(g=h(o,g.value,s))&&(u=a(g,u,d),null===f?l=g:f.sibling=g,f=g);return l}for(p=i(o,p);!g.done;d++,g=c.next())null!==(g=y(p,o,d,g.value,s))&&(e&&null!==g.alternate&&p.delete(null===g.key?d:g.key),u=a(g,u,d),null===f?l=g:f.sibling=g,f=g);return e&&p.forEach(function(e){return t(o,e)}),l}return function(e,i,a,c){"object"==typeof a&&null!==a&&a.type===Ei&&null===a.key&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case bi:e:{var l=a.key;for(s=i;null!==s;){if(s.key===l){if(10===s.tag?a.type===Ei:s.type===a.type){n(e,s.sibling),i=o(s,a.type===Ei?a.props.children:a.props,c),i.ref=xt(s,a),i.return=e,e=i;break e}n(e,s);break}t(e,s),s=s.sibling}a.type===Ei?(i=ct(a.props.children,e.internalContextTag,c,a.key),i.return=e,e=i):(c=ut(a,e.internalContextTag,c),c.ref=xt(i,a),c.return=e,e=c)}return u(e);case wi:e:{for(s=a.key;null!==i;){if(i.key===s){if(7===i.tag){n(e,i.sibling),i=o(i,a,c),i.return=e,e=i;break e}n(e,i);break}t(e,i),i=i.sibling}i=lt(a,e.internalContextTag,c),i.return=e,e=i}return u(e);case _i:e:{if(null!==i){if(9===i.tag){n(e,i.sibling),i=o(i,null,c),i.type=a.value,i.return=e,e=i;break e}n(e,i)}i=ft(a,e.internalContextTag,c),i.type=a.value,i.return=e,e=i}return u(e);case Oi:e:{for(s=a.key;null!==i;){if(i.key===s){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(e,i.sibling),i=o(i,a.children||[],c),i.return=e,e=i;break e}n(e,i);break}t(e,i),i=i.sibling}i=pt(a,e.internalContextTag,c),i.return=e,e=i}return u(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==i&&6===i.tag?(n(e,i.sibling),i=o(i,a,c)):(n(e,i),i=st(a,e.internalContextTag,c)),i.return=e,e=i,u(e);if(xi(a))return m(e,i,a,c);if(St(a))return g(e,i,a,c);if(s&&kt(e,a),void 0===a)switch(e.tag){case 2:case 1:c=e.type,r("152",c.displayName||c.name||"Component")}return n(e,i)}}function Ct(e,t,n,i,o){function a(e,t,n){var r=t.expirationTime;t.child=null===e?ji(t,null,n,r):ki(t,e.child,n,r)}function u(e,t){var n=t.ref;null===n||e&&e.ref===n||(t.effectTag|=128)}function c(e,t,n,r){if(u(e,t),!n)return r&&it(t,!1),l(e,t);n=t.stateNode,Wr.current=t;var i=n.render();return t.effectTag|=1,a(e,t,i),t.memoizedState=n.state,t.memoizedProps=n.props,r&&it(t,!0),t.child}function s(e){var t=e.stateNode;t.pendingContext?tt(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tt(e,t.context,!1),y(e,t.containerInfo)}function l(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){e=t.child;var n=at(e,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,n=n.sibling=at(e,e.pendingProps,e.expirationTime),n.return=t;n.sibling=null}return t.child}function f(e,t){switch(t.tag){case 3:s(t);break;case 2:rt(t);break;case 4:y(t,t.stateNode.containerInfo)}return null}var p=e.shouldSetTextContent,d=e.useSyncScheduling,h=e.shouldDeprioritizeSubtree,v=t.pushHostContext,y=t.pushHostContainer,m=n.enterHydrationState,g=n.resetHydrationState,b=n.tryToClaimNextHydratableInstance;e=Et(i,o,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var w=e.adoptClassInstance,_=e.constructClassInstance,O=e.mountClassInstance,E=e.updateClassInstance;return{beginWork:function(e,t,n){if(0===t.expirationTime||t.expirationTime>n)return f(e,t);switch(t.tag){case 0:null!==e&&r("155");var i=t.type,o=t.pendingProps,S=Je(t);return S=Xe(t,S),i=i(o,S),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render?(t.tag=2,o=rt(t),w(t,i),O(t,n),t=c(e,t,!0,o)):(t.tag=1,a(e,t,i),t.memoizedProps=o,t=t.child),t;case 1:e:{if(o=t.type,n=t.pendingProps,i=t.memoizedProps,hi.current)null===n&&(n=i);else if(null===n||i===n){t=l(e,t);break e}i=Je(t),i=Xe(t,i),o=o(n,i),t.effectTag|=1,a(e,t,o),t.memoizedProps=n,t=t.child}return t;case 2:return o=rt(t),i=void 0,null===e?t.stateNode?r("153"):(_(t,t.pendingProps),O(t,n),i=!0):i=E(e,t,n),c(e,t,i,o);case 3:return s(t),o=t.updateQueue,null!==o?(i=t.memoizedState,o=_t(e,t,o,null,null,n),i===o?(g(),t=l(e,t)):(i=o.element,S=t.stateNode,(null===e||null===e.child)&&S.hydrate&&m(t)?(t.effectTag|=2,t.child=ji(t,null,i,n)):(g(),a(e,t,i)),t.memoizedState=o,t=t.child)):(g(),t=l(e,t)),t;case 5:v(t),null===e&&b(t),o=t.type;var x=t.memoizedProps;return i=t.pendingProps,null===i&&null===(i=x)&&r("154"),S=null!==e?e.memoizedProps:null,hi.current||null!==i&&x!==i?(x=i.children,p(o,i)?x=null:S&&p(o,S)&&(t.effectTag|=16),u(e,t),2147483647!==n&&!d&&h(o,i)?(t.expirationTime=2147483647,t=null):(a(e,t,x),t.memoizedProps=i,t=t.child)):t=l(e,t),t;case 6:return null===e&&b(t),e=t.pendingProps,null===e&&(e=t.memoizedProps),t.memoizedProps=e,null;case 8:t.tag=7;case 7:return o=t.pendingProps,hi.current?null===o&&null===(o=e&&e.memoizedProps)&&r("154"):null!==o&&t.memoizedProps!==o||(o=t.memoizedProps),i=o.children,t.stateNode=null===e?ji(t,t.stateNode,i,n):ki(t,t.stateNode,i,n),t.memoizedProps=o,t.stateNode;case 9:return null;case 4:e:{if(y(t,t.stateNode.containerInfo),o=t.pendingProps,hi.current)null===o&&null==(o=e&&e.memoizedProps)&&r("154");else if(null===o||t.memoizedProps===o){t=l(e,t);break e}null===e?t.child=ki(t,null,o,n):a(e,t,o),t.memoizedProps=o,t=t.child}return t;case 10:e:{if(n=t.pendingProps,hi.current)null===n&&(n=t.memoizedProps);else if(null===n||t.memoizedProps===n){t=l(e,t);break e}a(e,t,n),t.memoizedProps=n,t=t.child}return t;default:r("156")}},beginFailedWork:function(e,t,n){switch(t.tag){case 2:rt(t);break;case 3:s(t);break;default:r("157")}return t.effectTag|=64,null===e?t.child=null:t.child!==e.child&&(t.child=e.child),0===t.expirationTime||t.expirationTime>n?f(e,t):(t.firstEffect=null,t.lastEffect=null,t.child=null===e?ji(t,null,null,n):ki(t,e.child,null,n),2===t.tag&&(e=t.stateNode,t.memoizedProps=e.props,t.memoizedState=e.state),t.child)}}}function Pt(e,t,n){function i(e){e.effectTag|=4}var o=e.createInstance,a=e.createTextInstance,u=e.appendInitialChild,c=e.finalizeInitialChildren,s=e.prepareUpdate,l=e.persistence,f=t.getRootHostContainer,p=t.popHostContext,d=t.getHostContext,h=t.popHostContainer,v=n.prepareToHydrateHostInstance,y=n.prepareToHydrateHostTextInstance,m=n.popHydrationState,g=void 0,b=void 0,w=void 0;return e.mutation?(g=function(){},b=function(e,t,n){(t.updateQueue=n)&&i(t)},w=function(e,t,n,r){n!==r&&i(t)}):r(l?"235":"236"),{completeWork:function(e,t,n){var l=t.pendingProps;switch(null===l?l=t.memoizedProps:2147483647===t.expirationTime&&2147483647!==n||(t.pendingProps=null),t.tag){case 1:return null;case 2:return et(t),null;case 3:return h(t),Ge(hi,t),Ge(di,t),l=t.stateNode,l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),null!==e&&null!==e.child||(m(t),t.effectTag&=-3),g(t),null;case 5:p(t),n=f();var _=t.type;if(null!==e&&null!=t.stateNode){var O=e.memoizedProps,E=t.stateNode,S=d();E=s(E,_,O,l,n,S),b(e,t,E,_,O,l,n),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!l)return null===t.stateNode&&r("166"),null;if(e=d(),m(t))v(t,n,e)&&i(t);else{e=o(_,l,n,e,t);e:for(O=t.child;null!==O;){if(5===O.tag||6===O.tag)u(e,O.stateNode);else if(4!==O.tag&&null!==O.child){O.child.return=O,O=O.child;continue}if(O===t)break;for(;null===O.sibling;){if(null===O.return||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}c(e,_,l,n)&&i(t),t.stateNode=e}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)w(e,t,e.memoizedProps,l);else{if("string"!=typeof l)return null===t.stateNode&&r("166"),null;e=f(),n=d(),m(t)?y(t)&&i(t):t.stateNode=a(l,e,n,t)}return null;case 7:(l=t.memoizedProps)||r("165"),t.tag=8,_=[];e:for((O=t.stateNode)&&(O.return=t);null!==O;){if(5===O.tag||6===O.tag||4===O.tag)r("247");else if(9===O.tag)_.push(O.type);else if(null!==O.child){O.child.return=O,O=O.child;continue}for(;null===O.sibling;){if(null===O.return||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}return O=l.handler,l=O(l.props,_),t.child=ki(t,null!==e?e.child:null,l,n);case 8:return t.tag=7,null;case 9:case 10:return null;case 4:return h(t),g(t),null;case 0:r("167");default:r("156")}}}}function Tt(e,t){function n(e){var n=e.ref;if(null!==n)try{n(null)}catch(n){t(e,n)}}function i(e){switch("function"==typeof yt&&yt(e),e.tag){case 2:n(e);var r=e.stateNode;if("function"==typeof r.componentWillUnmount)try{r.props=e.memoizedProps,r.state=e.memoizedState,r.componentWillUnmount()}catch(n){t(e,n)}break;case 5:n(e);break;case 7:o(e.stateNode);break;case 4:s&&u(e)}}function o(e){for(var t=e;;)if(i(t),null===t.child||s&&4===t.tag){if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function a(e){return 5===e.tag||3===e.tag||4===e.tag}function u(e){for(var t=e,n=!1,a=void 0,u=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:a=n.stateNode,u=!1;break e;case 3:case 4:a=n.stateNode.containerInfo,u=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag)o(t),u?b(a,t.stateNode):g(a,t.stateNode);else if(4===t.tag?a=t.stateNode.containerInfo:i(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,4===t.tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}var c=e.getPublicInstance,s=e.mutation;e=e.persistence,s||r(e?"235":"236");var l=s.commitMount,f=s.commitUpdate,p=s.resetTextContent,d=s.commitTextUpdate,h=s.appendChild,v=s.appendChildToContainer,y=s.insertBefore,m=s.insertInContainerBefore,g=s.removeChild,b=s.removeChildFromContainer;return{commitResetTextContent:function(e){p(e.stateNode)},commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(a(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var i=t=void 0;switch(n.tag){case 5:t=n.stateNode,i=!1;break;case 3:case 4:t=n.stateNode.containerInfo,i=!0;break;default:r("161")}16&n.effectTag&&(p(t),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||a(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var o=e;;){if(5===o.tag||6===o.tag)n?i?m(t,o.stateNode,n):y(t,o.stateNode,n):i?v(t,o.stateNode):h(t,o.stateNode);else if(4!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},commitDeletion:function(e){u(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var i=t.memoizedProps;e=null!==e?e.memoizedProps:i;var o=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&f(n,a,o,e,i,t)}break;case 6:null===t.stateNode&&r("162"),n=t.memoizedProps,d(t.stateNode,null!==e?e.memoizedProps:n,n);break;case 3:break;default:r("163")}},commitLifeCycles:function(e,t){switch(t.tag){case 2:var n=t.stateNode;if(4&t.effectTag)if(null===e)n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidMount();else{var i=e.memoizedProps;e=e.memoizedState,n.props=t.memoizedProps,n.state=t.memoizedState,n.componentDidUpdate(i,e)}null!==(t=t.updateQueue)&&Ot(t,n);break;case 3:null!==(n=t.updateQueue)&&Ot(n,null!==t.child?t.child.stateNode:null);break;case 5:n=t.stateNode,null===e&&4&t.effectTag&&l(n,t.type,t.memoizedProps,t);break;case 6:case 4:break;default:r("163")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case 5:t(c(n));break;default:t(n)}}},commitDetachRef:function(e){null!==(e=e.ref)&&e(null)}}}function Rt(e){function t(e){return e===Ci&&r("174"),e}var n=e.getChildHostContext,i=e.getRootHostContext,o={current:Ci},a={current:Ci},u={current:Ci};return{getHostContext:function(){return t(o.current)},getRootHostContainer:function(){return t(u.current)},popHostContainer:function(e){Ge(o,e),Ge(a,e),Ge(u,e)},popHostContext:function(e){a.current===e&&(Ge(o,e),Ge(a,e))},pushHostContainer:function(e,t){Qe(u,t,e),t=i(t),Qe(a,e,e),Qe(o,t,e)},pushHostContext:function(e){var r=t(u.current),i=t(o.current);r=n(i,e.type,r),i!==r&&(Qe(a,e,e),Qe(o,r,e))},resetHostContainer:function(){o.current=Ci,u.current=Ci}}}function At(e){function t(e,t){var n=new ot(5,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case 5:return null!==(t=a(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=u(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function i(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;p=e}var o=e.shouldSetTextContent;if(!(e=e.hydration))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var a=e.canHydrateInstance,u=e.canHydrateTextInstance,c=e.getNextHydratableSibling,s=e.getFirstHydratableChild,l=e.hydrateInstance,f=e.hydrateTextInstance,p=null,d=null,h=!1;return{enterHydrationState:function(e){return d=s(e.stateNode.containerInfo),p=e,h=!0},resetHydrationState:function(){d=p=null,h=!1},tryToClaimNextHydratableInstance:function(e){if(h){var r=d;if(r){if(!n(e,r)){if(!(r=c(r))||!n(e,r))return e.effectTag|=2,h=!1,void(p=e);t(p,d)}p=e,d=s(r)}else e.effectTag|=2,h=!1,p=e}},prepareToHydrateHostInstance:function(e,t,n){return t=l(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return f(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==p)return!1;if(!h)return i(e),h=!0,!1;var n=e.type;if(5!==e.tag||"head"!==n&&"body"!==n&&!o(n,e.memoizedProps))for(n=d;n;)t(e,n),n=c(n);return i(e),d=p?c(e.stateNode):null,!0}}}function Ft(e){function t(e){oe=G=!0;var t=e.stateNode;if(t.current===e&&r("177"),t.isReadyForCommit=!1,Wr.current=null,e.effectTag>1)if(null!==e.lastEffect){e.lastEffect.nextEffect=e;var n=e.firstEffect}else n=e;else n=e.firstEffect;for(B(),Z=n;null!==Z;){var i=!1,o=void 0;try{for(;null!==Z;){var a=Z.effectTag;if(16&a&&F(Z),128&a){var u=Z.alternate;null!==u&&V(u)}switch(-242&a){case 2:I(Z),Z.effectTag&=-3;break;case 6:I(Z),Z.effectTag&=-3,M(Z.alternate,Z);break;case 4:M(Z.alternate,Z);break;case 8:ae=!0,N(Z),ae=!1}Z=Z.nextEffect}}catch(e){i=!0,o=e}i&&(null===Z&&r("178"),c(Z,o),null!==Z&&(Z=Z.nextEffect))}for(H(),t.current=e,Z=n;null!==Z;){n=!1,i=void 0;try{for(;null!==Z;){var s=Z.effectTag;if(36&s&&U(Z.alternate,Z),128&s&&D(Z),64&s)switch(o=Z,a=void 0,null!==ee&&(a=ee.get(o),ee.delete(o),null==a&&null!==o.alternate&&(o=o.alternate,a=ee.get(o),ee.delete(o))),null==a&&r("184"),o.tag){case 2:o.stateNode.componentDidCatch(a.error,{componentStack:a.componentStack});break;case 3:null===re&&(re=a.error);break;default:r("157")}var l=Z.nextEffect;Z.nextEffect=null,Z=l}}catch(e){n=!0,i=e}n&&(null===Z&&r("178"),c(Z,i),null!==Z&&(Z=Z.nextEffect))}return G=oe=!1,"function"==typeof vt&&vt(e.stateNode),ne&&(ne.forEach(v),ne=null),null!==re&&(e=re,re=null,E(e)),t=t.current.expirationTime,0===t&&(te=ee=null),t}function n(e){for(;;){var t=A(e.alternate,e,X),n=e.return,r=e.sibling,i=e;if(2147483647===X||2147483647!==i.expirationTime){if(2!==i.tag&&3!==i.tag)var o=0;else o=i.updateQueue,o=null===o?0:o.expirationTime;for(var a=i.child;null!==a;)0!==a.expirationTime&&(0===o||o>a.expirationTime)&&(o=a.expirationTime),a=a.sibling;i.expirationTime=o}if(null!==t)return t;if(null!==n&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),e.effectTag>1&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){e.stateNode.isReadyForCommit=!0;break}e=n}return null}function i(e){var t=T(e.alternate,e,X);return null===t&&(t=n(e)),Wr.current=null,t}function o(e){var t=R(e.alternate,e,X);return null===t&&(t=n(e)),Wr.current=null,t}function a(e){if(null!==ee){if(0!==X&&e>=X)if($<X)for(;null!==Q&&!O();)Q=s(Q)?o(Q):i(Q);else for(;null!==Q;)Q=s(Q)?o(Q):i(Q)}else if(0!==X&&e>=X)if($<X)for(;null!==Q&&!O();)Q=i(Q);else for(;null!==Q;)Q=i(Q)}function u(e,t){if(G&&r("243"),G=!0,e.isReadyForCommit=!1,e!==J||t!==X||null===Q){for(;pi>-1;)fi[pi]=null,pi--;vi=Cn,di.current=Cn,hi.current=!1,C(),J=e,X=t,Q=at(J.current,null,t)}var n=!1,i=null;try{a(t)}catch(e){n=!0,i=e}for(;n;){if(ie){re=i;break}var u=Q;if(null===u)ie=!0;else{var s=c(u,i);if(null===s&&r("183"),!ie){try{for(n=s,i=t,s=n;null!==u;){switch(u.tag){case 2:et(u);break;case 5:j(u);break;case 3:k(u);break;case 4:k(u)}if(u===s||u.alternate===s)break;u=u.return}Q=o(n),a(i)}catch(e){n=!0,i=e;continue}break}}}return t=re,ie=G=!1,re=null,null!==t&&E(t),e.isReadyForCommit?e.current.alternate:null}function c(e,t){var n=Wr.current=null,r=!1,i=!1,o=null;if(3===e.tag)n=e,l(e)&&(ie=!0);else for(var a=e.return;null!==a&&null===n;){if(2===a.tag?"function"==typeof a.stateNode.componentDidCatch&&(r=!0,o=_e(a),n=a,i=!0):3===a.tag&&(n=a),l(a)){if(ae||null!==ne&&(ne.has(a)||null!==a.alternate&&ne.has(a.alternate)))return null;n=null,i=!1}a=a.return}if(null!==n){null===te&&(te=new Set),te.add(n);var u="";a=e;do{e:switch(a.tag){case 0:case 1:case 2:case 5:var c=a._debugOwner,s=a._debugSource,f=_e(a),p=null;c&&(p=_e(c)),c=s,f="\n in "+(f||"Unknown")+(c?" (at "+c.fileName.replace(/^.*[\\\/]/,"")+":"+c.lineNumber+")":p?" (created by "+p+")":"");break e;default:f=""}u+=f,a=a.return}while(a);a=u,e=_e(e),null===ee&&(ee=new Map),t={componentName:e,componentStack:a,error:t,errorBoundary:r?n.stateNode:null,errorBoundaryFound:r,errorBoundaryName:o,willRetry:i},ee.set(n,t);try{var d=t.error;d&&d.suppressReactErrorLogging||console.error(d)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}return oe?(null===ne&&(ne=new Set),ne.add(n)):v(n),n}return null===re&&(re=t),null}function s(e){return null!==ee&&(ee.has(e)||null!==e.alternate&&ee.has(e.alternate))}function l(e){return null!==te&&(te.has(e)||null!==e.alternate&&te.has(e.alternate))}function f(){return 20*(1+((y()+100)/20|0))}function p(e){return 0!==K?K:G?oe?1:X:!q||1&e.internalContextTag?f():1}function d(e,t){return h(e,t,!1)}function h(e,t){for(;null!==e;){if((0===e.expirationTime||e.expirationTime>t)&&(e.expirationTime=t),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>t)&&(e.alternate.expirationTime=t),null===e.return){if(3!==e.tag)break;var n=e.stateNode;!G&&n===J&&X>t&&(Q=J=null,X=0);var i=n,o=t;if(Oe>we&&r("185"),null===i.nextScheduledRoot)i.remainingExpirationTime=o,null===ce?(ue=ce=i,i.nextScheduledRoot=i):(ce=ce.nextScheduledRoot=i,ce.nextScheduledRoot=ue);else{var a=i.remainingExpirationTime;(0===a||a>o)&&(i.remainingExpirationTime=o)}fe||(ge?be&&(pe=i,de=1,_(pe,de)):1===o?w(1,null):m(o)),!G&&n===J&&X>t&&(Q=J=null,X=0)}e=e.return}}function v(e){h(e,1,!0)}function y(){return $=2+((L()-Y)/10|0)}function m(e){if(0!==se){if(e>se)return;z(le)}var t=L()-Y;se=e,le=W(b,{timeout:10*(e-2)-t})}function g(){var e=0,t=null;if(null!==ce)for(var n=ce,i=ue;null!==i;){var o=i.remainingExpirationTime;if(0===o){if((null===n||null===ce)&&r("244"),i===i.nextScheduledRoot){ue=ce=i.nextScheduledRoot=null;break}if(i===ue)ue=o=i.nextScheduledRoot,ce.nextScheduledRoot=o,i.nextScheduledRoot=null;else{if(i===ce){ce=n,ce.nextScheduledRoot=ue,i.nextScheduledRoot=null;break}n.nextScheduledRoot=i.nextScheduledRoot,i.nextScheduledRoot=null}i=n.nextScheduledRoot}else{if((0===e||e>o)&&(e=o,t=i),i===ce)break;n=i,i=i.nextScheduledRoot}}n=pe,null!==n&&n===t?Oe++:Oe=0,pe=t,de=e}function b(e){w(0,e)}function w(e,t){for(me=t,g();!(null===pe||0===de||0!==e&&de>e||he);)_(pe,de),g();if(null!==me&&(se=0,le=-1),0!==de&&m(de),me=null,he=!1,Oe=0,ve)throw e=ye,ye=null,ve=!1,e}function _(e,n){if(fe&&r("245"),fe=!0,n>y())i=e.finishedWork,null!==i?(e.finishedWork=null,e.remainingExpirationTime=t(i)):(e.finishedWork=null,null!==(i=u(e,n))&&(O()?e.finishedWork=i:e.remainingExpirationTime=t(i)));else{var i=e.finishedWork;null!==i?(e.finishedWork=null,e.remainingExpirationTime=t(i)):(e.finishedWork=null,null!==(i=u(e,n))&&(e.remainingExpirationTime=t(i)))}fe=!1}function O(){return null!==me&&me.timeRemaining()<=Ee&&(he=!0)}function E(e){null===pe&&r("246"),pe.remainingExpirationTime=0,ve||(ve=!0,ye=e)}var S=Rt(e),x=At(e),k=S.popHostContainer,j=S.popHostContext,C=S.resetHostContainer,P=Ct(e,S,x,d,p),T=P.beginWork,R=P.beginFailedWork,A=Pt(e,S,x).completeWork;S=Tt(e,c);var F=S.commitResetTextContent,I=S.commitPlacement,N=S.commitDeletion,M=S.commitWork,U=S.commitLifeCycles,D=S.commitAttachRef,V=S.commitDetachRef,L=e.now,W=e.scheduleDeferredCallback,z=e.cancelDeferredCallback,q=e.useSyncScheduling,B=e.prepareForCommit,H=e.resetAfterCommit,Y=L(),$=2,K=0,G=!1,Q=null,J=null,X=0,Z=null,ee=null,te=null,ne=null,re=null,ie=!1,oe=!1,ae=!1,ue=null,ce=null,se=0,le=-1,fe=!1,pe=null,de=0,he=!1,ve=!1,ye=null,me=null,ge=!1,be=!1,we=1e3,Oe=0,Ee=1;return{computeAsyncExpiration:f,computeExpirationForFiber:p,scheduleWork:d,batchedUpdates:function(e,t){var n=ge;ge=!0;try{return e(t)}finally{(ge=n)||fe||w(1,null)}},unbatchedUpdates:function(e){if(ge&&!be){be=!0;try{return e()}finally{be=!1}}return e()},flushSync:function(e){var t=ge;ge=!0;try{e:{var n=K;K=1;try{var i=e();break e}finally{K=n}i=void 0}return i}finally{ge=t,fe&&r("187"),w(1,null)}},deferredUpdates:function(e){var t=K;K=f();try{return e()}finally{K=t}}}}function It(e){function t(e){return e=ke(e),null===e?null:e.stateNode}var n=e.getPublicInstance;e=Ft(e);var i=e.computeAsyncExpiration,o=e.computeExpirationForFiber,a=e.scheduleWork;return{createContainer:function(e,t){var n=new ot(3,null,0);return e={current:n,containerInfo:e,pendingChildren:null,remainingExpirationTime:0,isReadyForCommit:!1,finishedWork:null,context:null,pendingContext:null,hydrate:t,nextScheduledRoot:null},n.stateNode=e},updateContainer:function(e,t,n,u){var c=t.current;if(n){n=n._reactInternalFiber;var s;e:{for(2===Oe(n)&&2===n.tag||r("170"),s=n;3!==s.tag;){if(Ze(s)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}(s=s.return)||r("171")}s=s.stateNode.context}n=Ze(n)?nt(n,s):s}else n=Cn;null===t.context?t.context=n:t.pendingContext=n,t=u,t=void 0===t?null:t,u=null!=e&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent?i():o(c),bt(c,{expirationTime:u,partialState:{element:e},callback:t,isReplace:!1,isForced:!1,nextCallback:null,next:null}),a(c,u)},batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return n(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:t,findHostInstanceWithNoPortals:function(e){return e=je(e),null===e?null:e.stateNode},injectIntoDevTools:function(e){var n=e.findFiberByHostInstance;return ht(_n({},e,{findHostInstanceByFiber:function(e){return t(e)},findFiberByHostInstance:function(e){return n?n(e):null}}))}}}function Nt(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Oi,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Mt(e){return!!Ki.hasOwnProperty(e)||!$i.hasOwnProperty(e)&&(Yi.test(e)?Ki[e]=!0:($i[e]=!0,!1))}function Ut(e,t,n){var r=a(t);if(r&&o(t,n)){var i=r.mutationMethod;i?i(e,n):null==n||r.hasBooleanValue&&!n||r.hasNumericValue&&isNaN(n)||r.hasPositiveNumericValue&&1>n||r.hasOverloadedBooleanValue&&!1===n?Vt(e,t):r.mustUseProperty?e[r.propertyName]=n:(t=r.attributeName,(i=r.attributeNamespace)?e.setAttributeNS(i,t,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(t,""):e.setAttribute(t,""+n))}else Dt(e,t,o(t,n)?n:null)}function Dt(e,t,n){Mt(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))}function Vt(e,t){var n=a(t);n?(t=n.mutationMethod)?t(e,void 0):n.mustUseProperty?e[n.propertyName]=!n.hasBooleanValue&&"":e.removeAttribute(n.attributeName):e.removeAttribute(t)}function Lt(e,t){var n=t.value,r=t.checked;return _n({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked})}function Wt(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function zt(e,t){null!=(t=t.checked)&&Ut(e,"checked",t)}function qt(e,t){zt(e,t);var n=t.value;null!=n?0===n&&""===e.value?e.value="0":"number"===t.type?(t=parseFloat(e.value)||0,(n!=t||n==t&&e.value!=n)&&(e.value=""+n)):e.value!==""+n&&(e.value=""+n):(null==t.value&&null!=t.defaultValue&&e.defaultValue!==""+t.defaultValue&&(e.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked))}function Bt(e,t){switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":e.value="",e.value=e.defaultValue;break;default:e.value=e.value}t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)}function Ht(e){var t="";return bn.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}function Yt(e,t){return e=_n({children:void 0},t),(t=Ht(t.children))&&(e.children=t),e}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;n.length>i;i++)t["$"+n[i]]=!0;for(n=0;e.length>n;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+n,t=null,i=0;e.length>i;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function Kt(e,t){var n=t.value;e._wrapperState={initialValue:null!=n?n:t.defaultValue,wasMultiple:!!t.multiple}}function Gt(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),_n({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qt(e,t){var n=t.value;null==n&&(n=t.defaultValue,t=t.children,null!=t&&(null!=n&&r("92"),Array.isArray(t)&&(t.length>1&&r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function Jt(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Xt(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function Zt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function en(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Zt(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function tn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function nn(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=n,o=t[n];i=null==o||"boolean"==typeof o||""===o?"":r||"number"!=typeof o||0===o||Xi.hasOwnProperty(i)&&Xi[i]?(""+o).trim():o+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}function rn(e,t,n){t&&(eo[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function on(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function an(e,t){e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument;var n=Ne(e);t=Qn[t];for(var r=0;t.length>r;r++){var i=t[r];n.hasOwnProperty(i)&&n[i]||("topScroll"===i?Re("topScroll","scroll",e):"topFocus"===i||"topBlur"===i?(Re("topFocus","focus",e),Re("topBlur","blur",e),n.topBlur=!0,n.topFocus=!0):"topCancel"===i?(ne("cancel",!0)&&Re("topCancel","cancel",e),n.topCancel=!0):"topClose"===i?(ne("close",!0)&&Re("topClose","close",e),n.topClose=!0):Gr.hasOwnProperty(i)&&Te(i,Gr[i],e),n[i]=!0)}}function un(e,t,n,r){return n=9===n.nodeType?n:n.ownerDocument,r===to&&(r=Zt(e)),r===to?"script"===e?(e=n.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function cn(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function sn(e,t,n,r){var i=on(t,n);switch(t){case"iframe":case"object":Te("topLoad","load",e);var o=n;break;case"video":case"audio":for(o in ro)ro.hasOwnProperty(o)&&Te(o,ro[o],e);o=n;break;case"source":Te("topError","error",e),o=n;break;case"img":case"image":Te("topError","error",e),Te("topLoad","load",e),o=n;break;case"form":Te("topReset","reset",e),Te("topSubmit","submit",e),o=n;break;case"details":Te("topToggle","toggle",e),o=n;break;case"input":Wt(e,n),o=Lt(e,n),Te("topInvalid","invalid",e),an(r,"onChange");break;case"option":o=Yt(e,n);break;case"select":Kt(e,n),o=_n({},n,{value:void 0}),Te("topInvalid","invalid",e),an(r,"onChange");break;case"textarea":Qt(e,n),o=Gt(e,n),Te("topInvalid","invalid",e),an(r,"onChange");break;default:o=n}rn(t,o,no);var a,u=o;for(a in u)if(u.hasOwnProperty(a)){var c=u[a];"style"===a?nn(e,c,no):"dangerouslySetInnerHTML"===a?null!=(c=c?c.__html:void 0)&&Ji(e,c):"children"===a?"string"==typeof c?("textarea"!==t||""!==c)&&tn(e,c):"number"==typeof c&&tn(e,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(Gn.hasOwnProperty(a)?null!=c&&an(r,a):i?Dt(e,a,c):null!=c&&Ut(e,a,c))}switch(t){case"input":oe(e),Bt(e,n);break;case"textarea":oe(e),Xt(e,n);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,t=n.value,null!=t?$t(e,!!n.multiple,t,!1):null!=n.defaultValue&&$t(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=On)}}function ln(e,t,n,r,i){var o=null;switch(t){case"input":n=Lt(e,n),r=Lt(e,r),o=[];break;case"option":n=Yt(e,n),r=Yt(e,r),o=[];break;case"select":n=_n({},n,{value:void 0}),r=_n({},r,{value:void 0}),o=[];break;case"textarea":n=Gt(e,n),r=Gt(e,r),o=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=On)}rn(t,r,no);var a,u;e=null;for(a in n)if(!r.hasOwnProperty(a)&&n.hasOwnProperty(a)&&null!=n[a])if("style"===a)for(u in t=n[a])t.hasOwnProperty(u)&&(e||(e={}),e[u]="");else"dangerouslySetInnerHTML"!==a&&"children"!==a&&"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(Gn.hasOwnProperty(a)?o||(o=[]):(o=o||[]).push(a,null));for(a in r){var c=r[a];if(t=null!=n?n[a]:void 0,r.hasOwnProperty(a)&&c!==t&&(null!=c||null!=t))if("style"===a)if(t){for(u in t)!t.hasOwnProperty(u)||c&&c.hasOwnProperty(u)||(e||(e={}),e[u]="");for(u in c)c.hasOwnProperty(u)&&t[u]!==c[u]&&(e||(e={}),e[u]=c[u])}else e||(o||(o=[]),o.push(a,e)),e=c;else"dangerouslySetInnerHTML"===a?(c=c?c.__html:void 0,t=t?t.__html:void 0,null!=c&&t!==c&&(o=o||[]).push(a,""+c)):"children"===a?t===c||"string"!=typeof c&&"number"!=typeof c||(o=o||[]).push(a,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&(Gn.hasOwnProperty(a)?(null!=c&&an(i,a),o||t===c||(o=[])):(o=o||[]).push(a,c))}return e&&(o=o||[]).push("style",e),o}function fn(e,t,n,r,i){"input"===n&&"radio"===i.type&&null!=i.name&&zt(e,i),on(n,r),r=on(n,i);for(var o=0;t.length>o;o+=2){var a=t[o],u=t[o+1];"style"===a?nn(e,u,no):"dangerouslySetInnerHTML"===a?Ji(e,u):"children"===a?tn(e,u):r?null!=u?Dt(e,a,u):e.removeAttribute(a):null!=u?Ut(e,a,u):Vt(e,a)}switch(n){case"input":qt(e,i);break;case"textarea":Jt(e,i);break;case"select":e._wrapperState.initialValue=void 0,t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!i.multiple,n=i.value,null!=n?$t(e,!!i.multiple,n,!1):t!==!!i.multiple&&(null!=i.defaultValue?$t(e,!!i.multiple,i.defaultValue,!0):$t(e,!!i.multiple,i.multiple?[]:"",!1))}}function pn(e,t,n,r,i){switch(t){case"iframe":case"object":Te("topLoad","load",e);break;case"video":case"audio":for(var o in ro)ro.hasOwnProperty(o)&&Te(o,ro[o],e);break;case"source":Te("topError","error",e);break;case"img":case"image":Te("topError","error",e),Te("topLoad","load",e);break;case"form":Te("topReset","reset",e),Te("topSubmit","submit",e);break;case"details":Te("topToggle","toggle",e);break;case"input":Wt(e,n),Te("topInvalid","invalid",e),an(i,"onChange");break;case"select":Kt(e,n),Te("topInvalid","invalid",e),an(i,"onChange");break;case"textarea":Qt(e,n),Te("topInvalid","invalid",e),an(i,"onChange")}rn(t,n,no),r=null;for(var a in n)n.hasOwnProperty(a)&&(o=n[a],"children"===a?"string"==typeof o?e.textContent!==o&&(r=["children",o]):"number"==typeof o&&e.textContent!==""+o&&(r=["children",""+o]):Gn.hasOwnProperty(a)&&null!=o&&an(i,a));switch(t){case"input":oe(e),Bt(e,n);break;case"textarea":oe(e),Xt(e,n);break;case"select":case"option":break;default:"function"==typeof n.onClick&&(e.onclick=On)}return r}function dn(e,t){return e.nodeValue!==t}function hn(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function vn(e){return!(!(e=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==e.nodeType||!e.hasAttribute("data-reactroot"))}function yn(e,t,n,i,o){hn(n)||r("200");var a=n._reactRootContainer;if(a)ao.updateContainer(t,a,e,o);else{if(!(i=i||vn(n)))for(a=void 0;a=n.lastChild;)n.removeChild(a);var u=ao.createContainer(n,i);a=n._reactRootContainer=u,ao.unbatchedUpdates(function(){ao.updateContainer(t,u,e,o)})}return ao.getPublicRootInstance(a)}function mn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return hn(t)||r("200"),Nt(e,t,null,n)}function gn(e,t){this._reactRootContainer=ao.createContainer(e,t)}/** @license React v16.2.0 * react-dom.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var bn=n(1),wn=n(101),_n=n(27),On=n(11),En=n(102),Sn=n(103),xn=n(104),kn=n(105),jn=n(108),Cn=n(28);bn||r("227");var Pn={children:!0,dangerouslySetInnerHTML:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,style:!0},Tn={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,HAS_STRING_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=Tn,n=e.Properties||{},o=e.DOMAttributeNamespaces||{},a=e.DOMAttributeNames||{};e=e.DOMMutationMethods||{};for(var u in n){Rn.hasOwnProperty(u)&&r("48",u);var c=u.toLowerCase(),s=n[u];c={attributeName:c,attributeNamespace:null,propertyName:u,mutationMethod:null,mustUseProperty:i(s,t.MUST_USE_PROPERTY),hasBooleanValue:i(s,t.HAS_BOOLEAN_VALUE),hasNumericValue:i(s,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:i(s,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:i(s,t.HAS_OVERLOADED_BOOLEAN_VALUE),hasStringBooleanValue:i(s,t.HAS_STRING_BOOLEAN_VALUE)},c.hasBooleanValue+c.hasNumericValue+c.hasOverloadedBooleanValue>1&&r("50",u),a.hasOwnProperty(u)&&(c.attributeName=a[u]),o.hasOwnProperty(u)&&(c.attributeNamespace=o[u]),e.hasOwnProperty(u)&&(c.mutationMethod=e[u]),Rn[u]=c}}},Rn={},An=Tn,Fn=An.MUST_USE_PROPERTY,In=An.HAS_BOOLEAN_VALUE,Nn=An.HAS_NUMERIC_VALUE,Mn=An.HAS_POSITIVE_NUMERIC_VALUE,Un=An.HAS_OVERLOADED_BOOLEAN_VALUE,Dn=An.HAS_STRING_BOOLEAN_VALUE,Vn={Properties:{allowFullScreen:In,async:In,autoFocus:In,autoPlay:In,capture:Un,checked:Fn|In,cols:Mn,contentEditable:Dn,controls:In,default:In,defer:In,disabled:In,download:Un,draggable:Dn,formNoValidate:In,hidden:In,loop:In,multiple:Fn|In,muted:Fn|In,noValidate:In,open:In,playsInline:In,readOnly:In,required:In,reversed:In,rows:Mn,rowSpan:Nn,scoped:In,seamless:In,selected:Fn|In,size:Mn,start:Nn,span:Mn,spellCheck:Dn,style:0,tabIndex:0,itemScope:In,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:Dn},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}},Ln=An.HAS_STRING_BOOLEAN_VALUE,Wn={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},zn={Properties:{autoReverse:Ln,externalResourcesRequired:Ln,preserveAlpha:Ln},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:Wn.xlink,xlinkArcrole:Wn.xlink,xlinkHref:Wn.xlink,xlinkRole:Wn.xlink,xlinkShow:Wn.xlink,xlinkTitle:Wn.xlink,xlinkType:Wn.xlink,xmlBase:Wn.xml,xmlLang:Wn.xml,xmlSpace:Wn.xml}},qn=/[\-\:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(e){var t=e.replace(qn,u);zn.Properties[t]=0,zn.DOMAttributeNames[t]=e}),An.injectDOMPropertyConfig(Vn),An.injectDOMPropertyConfig(zn);var Bn={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(e){"function"!=typeof e.invokeGuardedCallback&&r("197"),c=e.invokeGuardedCallback}},invokeGuardedCallback:function(e,t,n,r,i,o,a,u,s){c.apply(Bn,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,i,o,a,u,c){if(Bn.invokeGuardedCallback.apply(this,arguments),Bn.hasCaughtError()){var s=Bn.clearCaughtError();Bn._hasRethrowError||(Bn._hasRethrowError=!0,Bn._rethrowError=s)}},rethrowCaughtError:function(){return s.apply(Bn,arguments)},hasCaughtError:function(){return Bn._hasCaughtError},clearCaughtError:function(){if(Bn._hasCaughtError){var e=Bn._caughtError;return Bn._caughtError=null,Bn._hasCaughtError=!1,e}r("198")}},Hn=null,Yn={},$n=[],Kn={},Gn={},Qn={},Jn=Object.freeze({plugins:$n,eventNameDispatchConfigs:Kn,registrationNameModules:Gn,registrationNameDependencies:Qn,possibleRegistrationNames:null,injectEventPluginOrder:p,injectEventPluginsByName:d}),Xn=null,Zn=null,er=null,tr=null,nr={injectEventPluginOrder:p,injectEventPluginsByName:d},rr=Object.freeze({injection:nr,getListener:w,extractEvents:_,enqueueEvents:O,processEventQueue:E}),ir=Math.random().toString(36).slice(2),or="__reactInternalInstance$"+ir,ar="__reactEventHandlers$"+ir,ur=Object.freeze({precacheFiberNode:function(e,t){t[or]=e},getClosestInstanceFromNode:S,getInstanceFromNode:function(e){return e=e[or],!e||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:x,getFiberCurrentPropsFromNode:k,updateFiberProps:function(e,t){e[ar]=t}}),cr=Object.freeze({accumulateTwoPhaseDispatches:I,accumulateTwoPhaseDispatchesSkipTarget:function(e){y(e,R)},accumulateEnterLeaveDispatches:N,accumulateDirectDispatches:function(e){y(e,F)}}),sr=null,lr={_root:null,_startText:null,_fallbackText:null},fr="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),pr={type:null,target:null,currentTarget:On.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};_n(V.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=On.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=On.thatReturnsTrue)},persist:function(){this.isPersistent=On.thatReturnsTrue},isPersistent:On.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;fr.length>t;t++)this[fr[t]]=null}}),V.Interface=pr,V.augmentClass=function(e,t){function n(){}n.prototype=this.prototype;var r=new n;_n(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=_n({},this.Interface,t),e.augmentClass=this.augmentClass,z(e)},z(V),V.augmentClass(q,{data:null}),V.augmentClass(B,{data:null});var dr=[9,13,27,32],hr=wn.canUseDOM&&"CompositionEvent"in window,vr=null;wn.canUseDOM&&"documentMode"in document&&(vr=document.documentMode);var yr;if(yr=wn.canUseDOM&&"TextEvent"in window&&!vr){var mr=window.opera;yr=!("object"==typeof mr&&"function"==typeof mr.version&&12>=parseInt(mr.version(),10))}var gr,br=yr,wr=wn.canUseDOM&&(!hr||vr&&vr>8&&11>=vr),_r=String.fromCharCode(32),Or={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Er=!1,Sr=!1,xr={eventTypes:Or,extractEvents:function(e,t,n,r){var i;if(hr)e:{switch(e){case"topCompositionStart":var o=Or.compositionStart;break e;case"topCompositionEnd":o=Or.compositionEnd;break e;case"topCompositionUpdate":o=Or.compositionUpdate;break e}o=void 0}else Sr?H(e,n)&&(o=Or.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(o=Or.compositionStart);return o?(wr&&(Sr||o!==Or.compositionStart?o===Or.compositionEnd&&Sr&&(i=U()):(lr._root=r,lr._startText=D(),Sr=!0)),o=q.getPooled(o,t,n,r),i?o.data=i:null!==(i=Y(n))&&(o.data=i),I(o),i=o):i=null,(e=br?$(e,n):K(e,n))?(t=B.getPooled(Or.beforeInput,t,n,r),t.data=e,I(t)):t=null,[i,t]}},kr=null,jr=null,Cr=null,Pr={injectFiberControlledHostComponent:function(e){kr=e}},Tr=Object.freeze({injection:Pr,enqueueStateRestore:Q,restoreStateIfNeeded:J}),Rr=!1,Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};wn.canUseDOM&&(gr=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var Fr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},Ir=null,Nr=null,Mr=!1;wn.canUseDOM&&(Mr=ne("input")&&(!document.documentMode||document.documentMode>9));var Ur={eventTypes:Fr,_isInputEventSupported:Mr,extractEvents:function(e,t,n,r){var i=t?x(t):window,o=i.nodeName&&i.nodeName.toLowerCase();if("select"===o||"input"===o&&"file"===i.type)var a=le;else if(ee(i))if(Mr)a=ye;else{a=he;var u=de}else!(o=i.nodeName)||"input"!==o.toLowerCase()||"checkbox"!==i.type&&"radio"!==i.type||(a=ve);if(a&&(a=a(e,t)))return ue(a,n,r);u&&u(e,i,t),"topBlur"===e&&null!=t&&(e=t._wrapperState||i._wrapperState)&&e.controlled&&"number"===i.type&&(e=""+i.value,i.getAttribute("value")!==e&&i.setAttribute("value",e))}};V.augmentClass(me,{view:null,detail:null});var Dr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};me.augmentClass(we,{screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:be,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}});var Vr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},Lr={eventTypes:Vr,extractEvents:function(e,t,n,r){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement)||"topMouseOut"!==e&&"topMouseOver"!==e)return null;var i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window;if("topMouseOut"===e?(e=t,t=(t=n.relatedTarget||n.toElement)?S(t):null):e=null,e===t)return null;var o=null==e?i:x(e);i=null==t?i:x(t);var a=we.getPooled(Vr.mouseLeave,e,n,r);return a.type="mouseleave",a.target=o,a.relatedTarget=i,n=we.getPooled(Vr.mouseEnter,t,n,r),n.type="mouseenter",n.target=i,n.relatedTarget=o,N(a,n,e,t),[a,n]}},Wr=bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zr=[],qr=!0,Br=void 0,Hr=Object.freeze({get _enabled(){return qr},get _handleTopLevel(){return Br},setHandleTopLevel:function(e){Br=e},setEnabled:Pe,isEnabled:function(){return qr},trapBubbledEvent:Te,trapCapturedEvent:Re,dispatchEvent:Ae}),Yr={animationend:Fe("Animation","AnimationEnd"),animationiteration:Fe("Animation","AnimationIteration"),animationstart:Fe("Animation","AnimationStart"),transitionend:Fe("Transition","TransitionEnd")},$r={},Kr={};wn.canUseDOM&&(Kr=document.createElement("div").style,"AnimationEvent"in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),"TransitionEvent"in window||delete Yr.transitionend.transition);var Gr={topAbort:"abort",topAnimationEnd:Ie("animationend")||"animationend",topAnimationIteration:Ie("animationiteration")||"animationiteration",topAnimationStart:Ie("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:Ie("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},Qr={},Jr=0,Xr="_reactListenersID"+(""+Math.random()).slice(2),Zr=wn.canUseDOM&&"documentMode"in document&&11>=document.documentMode,ei={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},ti=null,ni=null,ri=null,ii=!1,oi={eventTypes:ei,extractEvents:function(e,t,n,r){var i,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!o)){e:{o=Ne(o),i=Qn.onSelect;for(var a=0;i.length>a;a++){var u=i[a];if(!o.hasOwnProperty(u)||!o[u]){o=!1;break e}}o=!0}i=!o}if(i)return null;switch(o=t?x(t):window,e){case"topFocus":(ee(o)||"true"===o.contentEditable)&&(ti=o,ni=t,ri=null);break;case"topBlur":ri=ni=ti=null;break;case"topMouseDown":ii=!0;break;case"topContextMenu":case"topMouseUp":return ii=!1,Ve(n,r);case"topSelectionChange":if(Zr)break;case"topKeyDown":case"topKeyUp":return Ve(n,r)}return null}};V.augmentClass(Le,{animationName:null,elapsedTime:null,pseudoElement:null}),V.augmentClass(We,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),me.augmentClass(ze,{relatedTarget:null});var ai={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ui={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};me.augmentClass(Be,{key:function(e){if(e.key){var t=ai[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=qe(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?ui[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:be,charCode:function(e){return"keypress"===e.type?qe(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?qe(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),we.augmentClass(He,{dataTransfer:null}),me.augmentClass(Ye,{touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:be}),V.augmentClass($e,{propertyName:null,elapsedTime:null,pseudoElement:null}),we.augmentClass(Ke,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null});var ci={},si={};"abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel".split(" ").forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t;t="top"+t,n={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[t]},ci[e]=n,si[t]=n});var li={eventTypes:ci,extractEvents:function(e,t,n,r){var i=si[e];if(!i)return null;switch(e){case"topKeyPress":if(0===qe(n))return null;case"topKeyDown":case"topKeyUp":e=Be;break;case"topBlur":case"topFocus":e=ze;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":e=we;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":e=He;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":e=Ye;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":e=Le;break;case"topTransitionEnd":e=$e;break;case"topScroll":e=me;break;case"topWheel":e=Ke;break;case"topCopy":case"topCut":case"topPaste":e=We;break;default:e=V}return t=e.getPooled(i,t,n,r),I(t),t}};Br=function(e,t,n,r){e=_(e,t,n,r),O(e),E(!1)},nr.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),Xn=ur.getFiberCurrentPropsFromNode,Zn=ur.getInstanceFromNode,er=ur.getNodeFromInstance,nr.injectEventPluginsByName({SimpleEventPlugin:li,EnterLeaveEventPlugin:Lr,ChangeEventPlugin:Ur,SelectEventPlugin:oi,BeforeInputEventPlugin:xr});var fi=[],pi=-1;new Set;var di={current:Cn},hi={current:!1},vi=Cn,yi=null,mi=null,gi="function"==typeof Symbol&&Symbol.for,bi=gi?Symbol.for("react.element"):60103,wi=gi?Symbol.for("react.call"):60104,_i=gi?Symbol.for("react.return"):60105,Oi=gi?Symbol.for("react.portal"):60106,Ei=gi?Symbol.for("react.fragment"):60107,Si="function"==typeof Symbol&&Symbol.iterator,xi=Array.isArray,ki=jt(!0),ji=jt(!1),Ci={},Pi=Object.freeze({default:It}),Ti=Pi&&It||Pi,Ri=Ti.default?Ti.default:Ti,Ai="object"==typeof performance&&"function"==typeof performance.now,Fi=void 0;Fi=Ai?function(){return performance.now()}:function(){return Date.now()};var Ii=void 0,Ni=void 0;if(wn.canUseDOM)if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var Mi,Ui=null,Di=!1,Vi=-1,Li=!1,Wi=0,zi=33,qi=33;Mi=Ai?{didTimeout:!1,timeRemaining:function(){var e=Wi-performance.now();return e>0?e:0}}:{didTimeout:!1,timeRemaining:function(){var e=Wi-Date.now();return e>0?e:0}};var Bi="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(e){if(e.source===window&&e.data===Bi){if(Di=!1,e=Fi(),Wi-e>0)Mi.didTimeout=!1;else{if(-1===Vi||Vi>e)return void(Li||(Li=!0,requestAnimationFrame(Hi)));Mi.didTimeout=!0}Vi=-1,e=Ui,Ui=null,null!==e&&e(Mi)}},!1);var Hi=function(e){Li=!1;var t=e-Wi+qi;qi>t&&qi>zi?(8>t&&(t=8),qi=zi>t?zi:t):zi=t,Wi=e+qi,Di||(Di=!0,window.postMessage(Bi,"*"))};Ii=function(e,t){return Ui=e,null!=t&&"number"==typeof t.timeout&&(Vi=Fi()+t.timeout),Li||(Li=!0,requestAnimationFrame(Hi)),0},Ni=function(){Ui=null,Di=!1,Vi=-1}}else Ii=window.requestIdleCallback,Ni=window.cancelIdleCallback;else Ii=function(e){return setTimeout(function(){e({timeRemaining:function(){return 1/0}})})},Ni=function(e){clearTimeout(e)};var Yi=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$i={},Ki={},Gi={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},Qi=void 0,Ji=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==Gi.svg||"innerHTML"in e)e.innerHTML=t;else{for(Qi=Qi||document.createElement("div"),Qi.innerHTML="<svg>"+t+"</svg>",t=Qi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}),Xi={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zi=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){Zi.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});var eo=_n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),to=Gi.html,no=On.thatReturns(""),ro={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};Pr.injectFiberControlledHostComponent(Object.freeze({createElement:un,createTextNode:cn,setInitialProperties:sn,diffProperties:ln,updateProperties:fn,diffHydratedProperties:pn,diffHydratedText:dn,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(qt(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;n.length>t;t++){var i=n[t];if(i!==e&&i.form===e.form){var o=k(i);o||r("90"),ae(i),qt(i,o)}}}break;case"textarea":Jt(e,n);break;case"select":null!=(t=n.value)&&$t(e,!!n.multiple,t,!1)}}}));var io=null,oo=null,ao=Ri({getRootHostContext:function(e){var t=e.nodeType;switch(t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:en(null,"");break;default:t=8===t?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=en(e,t)}return e},getChildHostContext:function(e,t){return en(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){io=qr;var e=Sn();if(De(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else{var n=window.getSelection&&window.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;var o=0,a=-1,u=-1,c=0,s=0,l=e,f=null;e:for(;;){for(var p;l!==t||0!==r&&3!==l.nodeType||(a=o+r),l!==i||0!==n&&3!==l.nodeType||(u=o+n),3===l.nodeType&&(o+=l.nodeValue.length),null!==(p=l.firstChild);)f=l,l=p;for(;;){if(l===e)break e;if(f===t&&++c===r&&(a=o),f===i&&++s===n&&(u=o),null!==(p=l.nextSibling))break;l=f,f=l.parentNode}l=p}t=-1===a||-1===u?null:{start:a,end:u}}else t=null}t=t||{start:0,end:0}}else t=null;oo={focusedElem:e,selectionRange:t},Pe(!1)},resetAfterCommit:function(){var e=oo,t=Sn(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&kn(document.documentElement,n)){if(De(n))if(t=r.start,e=r.end,void 0===e&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(window.getSelection){t=window.getSelection();var i=n[M()].length;e=Math.min(r.start,i),r=void 0===r.end?e:Math.min(r.end,i),!t.extend&&e>r&&(i=r,r=e,e=i),i=Ue(n,e);var o=Ue(n,r);if(i&&o&&(1!==t.rangeCount||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)){var a=document.createRange();a.setStart(i.node,i.offset),t.removeAllRanges(),e>r?(t.addRange(a),t.extend(o.node,o.offset)):(a.setEnd(o.node,o.offset),t.addRange(a))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(jn(n),n=0;t.length>n;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}oo=null,Pe(io),io=null},createInstance:function(e,t,n,r,i){return e=un(e,t,n,r),e[or]=i,e[ar]=t,e},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){sn(e,t,n,r);e:{switch(t){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e}e=!1}return e},prepareUpdate:function(e,t,n,r,i){return ln(e,t,n,r,i)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){return e=cn(e,t),e[or]=r,e},now:Fi,mutation:{commitMount:function(e){e.focus()},commitUpdate:function(e,t,n,r,i){e[ar]=i,fn(e,t,n,r,i)},resetTextContent:function(e){e.textContent=""},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){8===e.nodeType?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)}},hydration:{canHydrateInstance:function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e},canHydrateTextInstance:function(e,t){return""===t||3!==e.nodeType?null:e},getNextHydratableSibling:function(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},getFirstHydratableChild:function(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},hydrateInstance:function(e,t,n,r,i,o){return e[or]=o,e[ar]=n,pn(e,t,n,i,r)},hydrateTextInstance:function(e,t,n){return e[or]=n,dn(e,t)},didNotMatchHydratedContainerTextInstance:function(){},didNotMatchHydratedTextInstance:function(){},didNotHydrateContainerInstance:function(){},didNotHydrateInstance:function(){},didNotFindHydratableContainerInstance:function(){},didNotFindHydratableContainerTextInstance:function(){},didNotFindHydratableInstance:function(){},didNotFindHydratableTextInstance:function(){}},scheduleDeferredCallback:Ii,cancelDeferredCallback:Ni,useSyncScheduling:!0});X=ao.batchedUpdates,gn.prototype.render=function(e,t){ao.updateContainer(e,this._reactRootContainer,null,t)},gn.prototype.unmount=function(e){ao.updateContainer(null,this._reactRootContainer,null,e)};var uo={createPortal:mn,findDOMNode:function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(t)return ao.findHostInstance(t);"function"==typeof e.render?r("188"):r("213",Object.keys(e))},hydrate:function(e,t,n){return yn(null,e,t,!0,n)},render:function(e,t,n){return yn(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,i){return(null==e||void 0===e._reactInternalFiber)&&r("38"),yn(e,t,n,!1,i)},unmountComponentAtNode:function(e){return hn(e)||r("40"),!!e._reactRootContainer&&(ao.unbatchedUpdates(function(){yn(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:mn,unstable_batchedUpdates:Z,unstable_deferredUpdates:ao.deferredUpdates,flushSync:ao.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:rr,EventPluginRegistry:Jn,EventPropagators:cr,ReactControlledComponent:Tr,ReactDOMComponentTree:ur,ReactDOMEventListener:Hr}};ao.injectIntoDevTools({findFiberByHostInstance:S,bundleType:0,version:"16.2.0",rendererPackageName:"react-dom"});var co=Object.freeze({default:uo}),so=co&&uo||co;e.exports=so.default?so.default:so},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r}},function(e,t,n){"use strict";var r=n(11);e.exports={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}}},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(var i=0;n.length>i;i++)if(!o.call(t,n[i])||!r(e[n[i]],t[n[i]]))return!1;return!0}var o=Object.prototype.hasOwnProperty;e.exports=i},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!i(e)&&(i(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var i=n(106);e.exports=r},function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=n(107);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){try{e.focus()}catch(e){}}e.exports=r},function(e,t){e.exports={app:"app___3P8ep",topNav:"topNav___sBW8S",brand:"brand___YAZl-",github:"github___3-vRv",contentAndFooter:"contentAndFooter___kE2nt",content:"content___3TVHp",home:"home___2XyPG",hasNav:"hasNav___1KF_W",footer:"footer___1oh0h",help:"help___3OayI",cf_ad:"cf_ad___1Rnwi","cf-wrapper":"cf-wrapper___oXef8","cf-header":"cf-header___2k4yV","cf-image-wrapper":"cf-image-wrapper___1qsrZ","cf-text":"cf-text___2RqSn","cf-powered-by":"cf-powered-by___3vyVN"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(111),u=r(a),c=n(50),s=r(c);t.default=function(e){var t=e.version,r=n(115);return o.default.createElement("div",{className:r.home},o.default.createElement("div",{className:r.masthead},o.default.createElement("div",{className:r.logo}),o.default.createElement("h1",null,"Redux Form"),o.default.createElement("div",{className:r.version},"v",t),o.default.createElement("h2",null,"The best way to manage your form state in Redux."),o.default.createElement(u.default,{user:"erikras",repo:"redux-form",type:"star",width:160,height:30,count:!0,large:!0}),o.default.createElement(u.default,{user:"erikras",repo:"redux-form",type:"fork",width:160,height:30,count:!0,large:!0}),o.default.createElement("div",{style:{textAlign:"center"}},o.default.createElement("hr",null),o.default.createElement(s.default,null))),o.default.createElement("div",{className:r.options},o.default.createElement("a",{href:"docs/GettingStarted.md"},o.default.createElement("i",{className:r.start}),"Start Here"),o.default.createElement("a",{href:"docs/api"},o.default.createElement("i",{className:r.api}),"API"),o.default.createElement("a",{href:"examples"},o.default.createElement("i",{className:r.examples}),"Examples"),o.default.createElement("a",{href:"docs/faq"},o.default.createElement("i",{className:r.faq}),"FAQ")))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),c=function(e){var t=e.user,n=e.repo,r=e.type,i=e.width,a=e.height,u=e.count,c=e.large,s="https://ghbtns.com/github-btn.html?user="+t+"&repo="+n+"&type="+r;return u&&(s+="&count=true"),c&&(s+="&size=large"),o.default.createElement("iframe",{src:s,title:"GitHub Buttons",frameBorder:"0",allowTransparency:"true",scrolling:"0",width:i,height:a,style:{border:"none",width:i,height:a}})};c.propTypes={user:u.default.string.isRequired,repo:u.default.string.isRequired,type:u.default.oneOf(["star","watch","fork","follow"]).isRequired,width:u.default.number.isRequired,height:u.default.number.isRequired,count:u.default.bool,large:u.default.bool},t.default=c},function(e,t,n){"use strict";var r=n(11),i=n(113),o=n(114);e.exports=function(){function e(e,t,n,r,a,u){u!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e,t,n,r,o,a,u,c){if(i(t),!e){var s;if(void 0===t)s=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,u,c],f=0;s=Error(t.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var i=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports={home:"home___381a9",masthead:"masthead___MGNF0",logo:"logo___hP7wi",content:"content___2vYdp",version:"version___2mbZo",github:"github___mrRv3",options:"options___2Tyc4",start:"start___1WlUb",api:"api___1hCrr",examples:"examples___2H_mp",faq:"faq___2mIT0"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),l=r(s),f=n(2),p=r(f),d=n(51),h=r(d),v=n(30),y=r(v),m=n(50),g=r(m),b=n(117),w=r(b),_=function(e){return/<p>(.+)<\/p>/.exec((0,y.default)(e))[1]},O=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.open=n.open.bind(n),n.close=n.close.bind(n),n.state={open:!1},n}return u(t,e),c(t,[{key:"renderItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.props,o=r.path;return l.default.createElement("a",{href:""+(r.url||"")+e,className:(0,h.default)(w.default["indent"+n],i({},w.default.active,e===o)),dangerouslySetInnerHTML:{__html:_(t)}})}},{key:"open",value:function(){this.setState({open:!0})}},{key:"close",value:function(){this.setState({open:!1})}},{key:"render",value:function(){var e=this.state.open,t=this.props.url;return l.default.createElement("div",{className:(0,h.default)(w.default.nav,i({},w.default.open,e))},l.default.createElement("button",{type:"button",onClick:this.open}),l.default.createElement("div",{className:w.default.overlay,onClick:this.close},l.default.createElement("i",{className:"fa fa-times"})," Close"),l.default.createElement("div",{className:w.default.placeholder}),l.default.createElement("nav",{className:w.default.menu},l.default.createElement("a",{href:t,className:w.default.brand},"Redux Form"),l.default.createElement(g.default,{template:"image-only"}),this.renderItem("/docs/GettingStarted.md","Getting Started"),this.renderItem("/docs/MigrationGuide.md","`v6` Migration Guide"),this.renderItem("/docs/ValueLifecycle.md","Value Lifecycle"),this.renderItem("/docs/Flow.md","Flow"),this.renderItem("/docs/api","API"),this.renderItem("/docs/api/ReduxForm.md","`reduxForm()`",1),this.renderItem("/docs/api/Props.md","`props`",1),this.renderItem("/docs/api/Field.md","`Field`",1),this.renderItem("/docs/api/Fields.md","`Fields`",1),this.renderItem("/docs/api/FieldArray.md","`FieldArray`",1),this.renderItem("/docs/api/Form.md","`Form`",1),this.renderItem("/docs/api/FormName.md","`FormName`",1),this.renderItem("/docs/api/FormSection.md","`FormSection`",1),this.renderItem("/docs/api/FormValues.md","`formValues()`",1),this.renderItem("/docs/api/FormValueSelector.md","`formValueSelector()`",1),this.renderItem("/docs/api/Reducer.md","`reducer`",1),this.renderItem("/docs/api/ReducerPlugin.md","`reducer.plugin()`",2),this.renderItem("/docs/api/SubmissionError.md","`SubmissionError`",1),this.renderItem("/docs/api/ActionCreators.md","Action Creators",1),this.renderItem("/docs/api/Selectors.md","Selectors",1),this.renderItem("/docs/faq","FAQ"),this.renderItem("/examples","Examples"),this.renderItem("/examples/simple","Simple Form",1),this.renderItem("/examples/syncValidation","Sync Validation",1),this.renderItem("/examples/fieldLevelValidation","Field-Level Validation",1),this.renderItem("/examples/submitValidation","Submit Validation",1),this.renderItem("/examples/asyncValidation","Async Blur Validation",1),this.renderItem("/examples/asyncChangeValidation","Async Change Validation",1),this.renderItem("/examples/initializeFromState","Initializing from State",1),this.renderItem("/examples/selectingFormValues","Selecting Form Values",1),this.renderItem("/examples/fieldArrays","Field Arrays",1),this.renderItem("/examples/remoteSubmit","Remote Submit",1),this.renderItem("/examples/normalizing","Normalizing",1),this.renderItem("/examples/immutable","Immutable JS",1),this.renderItem("/examples/wizard","Wizard Form",1),this.renderItem("/examples/material-ui","Material UI",1),this.renderItem("/examples/react-widgets","React Widgets",1),this.renderItem("/docs/DocumentationVersions.md","Older Versions")))}}]),t}(s.Component);O.propTypes={path:p.default.string.isRequired,url:p.default.string.isRequired},t.default=O},function(e,t){e.exports={nav:"nav___11xa5",placeholder:"placeholder___TzF1K",overlay:"overlay___1GMox",menu:"menu___12xDU",active:"active___2eU59",brand:"brand___1qRUu",indent1:"indent1___4iVnL",indent2:"indent2___2PiOO",open:"open___3Bk_k"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(30),u=r(a),c=n(119),s=r(c),l=function(e){return/<p>(.+)<\/p>/.exec((0,u.default)(e))[1]};t.default=function(e){var t=e.items;return!(!t||!t.length)&&o.default.createElement("ol",{className:s.default.breadcrumbs},t.map(function(e,n){var r=e.path,i=e.title;return n===t.length-1?o.default.createElement("li",{key:n,dangerouslySetInnerHTML:{__html:l(i)}}):o.default.createElement("li",{key:n},o.default.createElement("a",{href:r,dangerouslySetInnerHTML:{__html:l(i)}}))}))}},function(e,t){e.exports={breadcrumbs:"breadcrumbs___1BHo6"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),a=r(o),u=n(2),c=r(u),s=function(e){var t=e.username,n=e.showUsername,r=e.showCount,o=e.large,u={};return n||(u["data-show-screen-name"]="false"),r||(u["data-show-count"]="false"),o&&(u["data-size"]="large"),a.default.createElement("a",i({href:"https://twitter.com/"+t,className:"twitter-follow-button"},u),"Follow @",t)};s.propTypes={username:c.default.string.isRequired,showUserName:c.default.bool,showCount:c.default.bool,large:c.default.bool},t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Values=t.Sponsor=t.Markdown=t.Code=t.App=t.generateExampleBreadcrumbs=t.render=void 0;var i=n(122),o=r(i),a=n(128),u=r(a),c=n(29),s=r(c),l=n(52),f=r(l),p=n(53),d=r(p),h=n(131),v=r(h),y=n(316),m=r(y);t.render=o.default,t.generateExampleBreadcrumbs=u.default,t.App=s.default,t.Code=f.default,t.Markdown=d.default,t.Sponsor=m.default,t.Values=v.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(123),u=r(a),c=n(29),s=r(c);t.default=function(e){var t=e.component,n=e.title,r=e.path,i=e.version,a=e.breadcrumbs;return'<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charSet="utf-8"/>\n <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>\n <title>Redux Form'+(n&&" - "+n)+'</title>\n <link href="https://unpkg.com/redux-form-website-template/dist/bundle.css"\n media="screen, projection" rel="stylesheet" type="text/css"/>\n <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css"\n media="screen, projection" rel="stylesheet" type="text/css"/>\n <meta itemprop="name" content="Redux Form"/>\n <meta property="og:type" content="website"/>\n <meta property="og:title" content="Redux Form"/>\n <meta property="og:site_name" content="Redux Form"/>\n <meta property="og:description" content="The best way to manage your form state in Redux."/>\n <meta property="og:image" content="logo.png"/>\n <meta property="twitter:site" content="@erikras"/>\n <meta property="twitter:creator" content="@erikras"/>\n <style type="text/css">\n body {\n margin: 0;\n }\n </style>\n </head>\n <body>\n <div id="content">\n '+u.default.renderToStaticMarkup(o.default.createElement(s.default,{version:i,path:r,breadcrumbs:a},t))+'\n </div>\n <script src="https://unpkg.com/react@15.6.1/dist/react.min.js" integrity="sha384-u/3By6KAUETM5AnedAbB9xV0qLxlsRyVBi8mEekTeqD468SBVx2FXEm+1lf85M7c" crossorigin="anonymous"><\/script>\n <script src="https://unpkg.com/react-dom@15.6.1/dist/react-dom.min.js" integrity="sha384-GfT+iyYg21YqdPMH/FWlWLugDiK/neASGRCN8yWPB2Hlam+uP7J0lIgPcbCeHoVG" crossorigin="anonymous"><\/script>\n <script src="https://unpkg.com/redux-form-doc-version-checker/dist/doc-check.umd.min.js"><\/script>\n <script src="https://unpkg.com/redux-form-website-template/dist/bundle.js"><\/script>\n <script>\n (function(){\n if(typeof _bsa !== \'undefined\' && _bsa) {\n _bsa.init(\'default\', \'CKYDV5QM\', \'placement:reduxformcom\', {\n target: \'.bsa-cpc\',\n align: \'horizontal\',\n disable_css: \'true\'\n })\n }\n })()\n <\/script>\n <script>initReact('+JSON.stringify({version:i,path:r,breadcrumbs:a})+")<\/script>\n <script>\n (function(i,s,o,g,r,a,m){i[ 'GoogleAnalyticsObject' ] = r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n ga('create', 'UA-69298417-1', 'auto');\n ga('send', 'pageview');\n <\/script>\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');<\/script>\n </body>\n </html>"}},function(e,t,n){"use strict";e.exports=n(124)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;t>r;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."),t.name="Invariant Violation",t.framesToPop=1,t}function i(e,t){return(e&t)===t}function o(e,t){if(S.hasOwnProperty(e)||e.length>2&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1]))return!1;if(null===t)return!0;switch(typeof t){case"boolean":return u(e);case"undefined":case"number":case"string":case"object":return!0;default:return!1}}function a(e){return k.hasOwnProperty(e)?k[e]:null}function u(e){if(S.hasOwnProperty(e))return!0;var t=a(e);return t?t.hasBooleanValue||t.hasStringBooleanValue||t.hasOverloadedBooleanValue:"data-"===(e=e.toLowerCase().slice(0,5))||"aria-"===e}function c(e){return e[1].toUpperCase()}function s(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=L.exec(e);if(t){var n,r="",i=0;for(n=t.index;e.length>n;n++){switch(e.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==n&&(r+=e.substring(i,n)),i=n+1,r+=t}e=i!==n?r+e.substring(i,n):r}return e}function l(e){return!!q.hasOwnProperty(e)||!z.hasOwnProperty(e)&&(W.test(e)?q[e]=!0:(z[e]=!0,!1))}function f(e,t){var n=a(e);if(n){if(null==t||n.hasBooleanValue&&!t||n.hasNumericValue&&isNaN(t)||n.hasPositiveNumericValue&&1>t||n.hasOverloadedBooleanValue&&!1===t)return"";var r=n.attributeName;if(n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t)return r+'=""';if("boolean"!=typeof t||u(e))return r+'="'+s(t)+'"'}else if(o(e,t))return null==t?"":e+'="'+s(t)+'"';return null}function p(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function d(e){return"string"==typeof e?e:"function"==typeof e?e.displayName||e.name:null}function h(e){var t="";return b.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}function v(e,t){if(e=e.contextTypes){var n,r={};for(n in e)r[n]=t[n];t=r}else t=_;return t}function y(e,t){void 0===e&&r("152",d(t)||"Component")}function m(e,t){for(;b.isValidElement(e);){var n=e,i=n.type;if("function"!=typeof i)break;e=v(i,t);var o=[],a=!1,u={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===o)return null},enqueueReplaceState:function(e,t){a=!0,o=[t]},enqueueSetState:function(e,t){if(null===o)return null;o.push(t)}};if(i.prototype&&i.prototype.isReactComponent)var c=new i(n.props,e,u);else if(null==(c=i(n.props,e,u))||null==c.render){e=c,y(e,i);continue}if(c.props=n.props,c.context=e,c.updater=u,u=c.state,void 0===u&&(c.state=u=null),c.componentWillMount)if(c.componentWillMount(),o.length){u=o;var s=a;if(o=null,a=!1,s&&1===u.length)c.state=u[0];else{var l=s?u[0]:c.state,f=!0;for(s=s?1:0;u.length>s;s++){var p=u[s];(p="function"==typeof p?p.call(c,l,n.props,e):p)&&(f?(f=!1,l=g({},l,p)):g(l,p))}c.state=l}}else o=null;if(e=c.render(),y(e,i),"function"==typeof c.getChildContext&&"object"==typeof(n=i.childContextTypes)){var h=c.getChildContext();for(var m in h)m in n||r("108",d(i)||"Unknown",m)}h&&(t=g({},t,h))}return{child:e,context:t}}/** @license React v16.2.0 * react-dom-server.browser.production.min.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var g=n(27),b=n(1),w=n(11),_=n(28),O=n(125),E=n(127),S={children:!0,dangerouslySetInnerHTML:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,style:!0},x={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,HAS_STRING_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=x,n=e.Properties||{},o=e.DOMAttributeNamespaces||{},a=e.DOMAttributeNames||{};e=e.DOMMutationMethods||{};for(var u in n){k.hasOwnProperty(u)&&r("48",u);var c=u.toLowerCase(),s=n[u];c={attributeName:c,attributeNamespace:null,propertyName:u,mutationMethod:null,mustUseProperty:i(s,t.MUST_USE_PROPERTY),hasBooleanValue:i(s,t.HAS_BOOLEAN_VALUE),hasNumericValue:i(s,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:i(s,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:i(s,t.HAS_OVERLOADED_BOOLEAN_VALUE),hasStringBooleanValue:i(s,t.HAS_STRING_BOOLEAN_VALUE)},c.hasBooleanValue+c.hasNumericValue+c.hasOverloadedBooleanValue>1&&r("50",u),a.hasOwnProperty(u)&&(c.attributeName=a[u]),o.hasOwnProperty(u)&&(c.attributeNamespace=o[u]),e.hasOwnProperty(u)&&(c.mutationMethod=e[u]),k[u]=c}}},k={},j=x,C=j.MUST_USE_PROPERTY,P=j.HAS_BOOLEAN_VALUE,T=j.HAS_NUMERIC_VALUE,R=j.HAS_POSITIVE_NUMERIC_VALUE,A=j.HAS_OVERLOADED_BOOLEAN_VALUE,F=j.HAS_STRING_BOOLEAN_VALUE,I={Properties:{allowFullScreen:P,async:P,autoFocus:P,autoPlay:P,capture:A,checked:C|P,cols:R,contentEditable:F,controls:P,default:P,defer:P,disabled:P,download:A,draggable:F,formNoValidate:P,hidden:P,loop:P,multiple:C|P,muted:C|P,noValidate:P,open:P,playsInline:P,readOnly:P,required:P,reversed:P,rows:R,rowSpan:T,scoped:P,seamless:P,selected:C|P,size:R,start:T,span:R,spellCheck:F,style:0,tabIndex:0,itemScope:P,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:F},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}},N=j.HAS_STRING_BOOLEAN_VALUE,M={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},U={Properties:{autoReverse:N,externalResourcesRequired:N,preserveAlpha:N},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:M.xlink,xlinkArcrole:M.xlink,xlinkHref:M.xlink,xlinkRole:M.xlink,xlinkShow:M.xlink,xlinkTitle:M.xlink,xlinkType:M.xlink,xmlBase:M.xml,xmlLang:M.xml,xmlSpace:M.xml}},D=/[\-\:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(e){var t=e.replace(D,c);U.Properties[t]=0,U.DOMAttributeNames[t]=e}),j.injectDOMPropertyConfig(I),j.injectDOMPropertyConfig(U);var V="function"==typeof Symbol&&Symbol.for?Symbol.for("react.fragment"):60107,L=/["'&<>]/,W=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,z={},q={},B={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},H={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Y=g({menuitem:!0},H),$={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},K=["Webkit","ms","Moz","O"];Object.keys($).forEach(function(e){K.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$[t]=$[e]})});var G=b.Children.toArray,Q=w.thatReturns(""),J={listing:!0,pre:!0,textarea:!0},X=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Z={},ee=E(function(e){return O(e)}),te={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},ne=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");b.isValidElement(t)?t.type!==V?t=[t]:(t=t.props.children,t=b.isValidElement(t)?[t]:G(t)):t=G(t),this.stack=[{domNamespace:B.html,children:t,childIndex:0,context:_,footer:""}],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=n}return e.prototype.read=function(e){if(this.exhausted)return null;for(var t="";e>t.length;){if(0===this.stack.length){this.exhausted=!0;break}var n=this.stack[this.stack.length-1];if(n.childIndex<n.children.length)r=n.children[n.childIndex++],t+=this.render(r,n.context,n.domNamespace);else{var r=n.footer;t+=r,""!==r&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===n.tag&&(this.currentSelectValue=null)}}return t},e.prototype.render=function(e,t,n){return"string"==typeof e||"number"==typeof e?""==(n=""+e)?"":this.makeStaticMarkup?s(n):this.previousWasTextNode?"\x3c!-- --\x3e"+s(n):(this.previousWasTextNode=!0,s(n)):(t=m(e,t),e=t.child,t=t.context,null===e||!1===e?"":b.isValidElement(e)?e.type===V?(e=G(e.props.children),this.stack.push({domNamespace:n,children:e,childIndex:0,context:t,footer:""}),""):this.renderDOM(e,t,n):(e=G(e),this.stack.push({domNamespace:n,children:e,childIndex:0,context:t,footer:""}),""))},e.prototype.renderDOM=function(e,t,n){var i=e.type.toLowerCase();n===B.html&&p(i),Z.hasOwnProperty(i)||(X.test(i)||r("65",i),Z[i]=!0);var o=e.props;if("input"===i)o=g({type:void 0},o,{defaultChecked:void 0,defaultValue:void 0,value:null!=o.value?o.value:o.defaultValue,checked:null!=o.checked?o.checked:o.defaultChecked});else if("textarea"===i){var a=o.value;if(null==a){a=o.defaultValue;var u=o.children;null!=u&&(null!=a&&r("92"),Array.isArray(u)&&(u.length>1&&r("93"),u=u[0]),a=""+u),null==a&&(a="")}o=g({},o,{value:void 0,children:""+a})}else if("select"===i)this.currentSelectValue=null!=o.value?o.value:o.defaultValue,o=g({},o,{value:void 0});else if("option"===i){u=this.currentSelectValue;var c=h(o.children);if(null!=u){var d=null!=o.value?o.value+"":c;if(a=!1,Array.isArray(u)){for(var v=0;u.length>v;v++)if(""+u[v]===d){a=!0;break}}else a=""+u===d;o=g({selected:void 0,children:void 0},o,{selected:a,children:c})}}(a=o)&&(Y[i]&&(null!=a.children||null!=a.dangerouslySetInnerHTML)&&r("137",i,Q()),null!=a.dangerouslySetInnerHTML&&(null!=a.children&&r("60"),"object"==typeof a.dangerouslySetInnerHTML&&"__html"in a.dangerouslySetInnerHTML||r("61")),null!=a.style&&"object"!=typeof a.style&&r("62",Q())),a=o,u=this.makeStaticMarkup,c=1===this.stack.length,d="<"+e.type;for(O in a)if(a.hasOwnProperty(O)){var y=a[O];if(null!=y){if("style"===O){v=void 0;var m="",b="";for(v in y)if(y.hasOwnProperty(v)){var w=0===v.indexOf("--"),_=y[v];null!=_&&(m+=b+ee(v)+":",b=v,w=null==_||"boolean"==typeof _||""===_?"":w||"number"!=typeof _||0===_||$.hasOwnProperty(b)&&$[b]?(""+_).trim():_+"px",m+=w,b=";")}y=m||null}v=null;e:if(w=i,_=a,-1===w.indexOf("-"))w="string"==typeof _.is;else switch(w){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":w=!1;break e;default:w=!0}w?te.hasOwnProperty(O)||(v=O,v=l(v)&&null!=y?v+'="'+s(y)+'"':""):v=f(O,y),v&&(d+=" "+v)}}u||c&&(d+=' data-reactroot=""');var O=d;a="",H.hasOwnProperty(i)?O+="/>":(O+=">",a="</"+e.type+">");e:{if(null!=(u=o.dangerouslySetInnerHTML)){if(null!=u.__html){u=u.__html;break e}}else if("string"==typeof(u=o.children)||"number"==typeof u){u=s(u);break e}u=null}return null!=u?(o=[],J[i]&&"\n"===u.charAt(0)&&(O+="\n"),O+=u):o=G(o.children),e=e.type,n=null==n||"http://www.w3.org/1999/xhtml"===n?p(e):"http://www.w3.org/2000/svg"===n&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":n,this.stack.push({domNamespace:n,tag:i,children:o,childIndex:0,context:t,footer:a}),this.previousWasTextNode=!1,O},e}(),re={renderToString:function(e){return new ne(e,!1).read(1/0)},renderToStaticMarkup:function(e){return new ne(e,!0).read(1/0)},renderToNodeStream:function(){r("207")},renderToStaticNodeStream:function(){r("208")},version:"16.2.0"},ie=Object.freeze({default:re}),oe=ie&&re||ie;e.exports=oe.default?oe.default:oe},function(e,t,n){"use strict";function r(e){return i(e).replace(o,"-ms-")}var i=n(126),o=/^ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){return e.replace(i,"-$1").toLowerCase()}var i=/([A-Z])/g;e.exports=r},function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){return[{path:"https://redux-form.com/"+n+"/",title:"Redux Form"},{path:"https://redux-form.com/"+n+"/examples",title:"Examples"},{path:"https://redux-form.com/"+n+"/examples/"+e,title:t}]}},function(e,t,n){"use strict";(function(t){var n="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},r=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,r=n.Prism={util:{encode:function(e){return e instanceof i?new i(e.type,r.util.encode(e.content),e.alias):"Array"===r.util.type(e)?e.map(r.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){switch(r.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=r.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return r.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i=i||r.languages;var o=i[e];if(2==arguments.length){n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);return o}var u={};for(var c in o)if(o.hasOwnProperty(c)){if(c==t)for(var a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u[c]=o[c]}return r.languages.DFS(r.languages,function(t,n){n===i[e]&&t!=e&&(this[t]=u)}),i[e]=u},DFS:function(e,t,n,i){i=i||{};for(var o in e)e.hasOwnProperty(o)&&(t.call(e,o,e[o],n||o),"Object"!==r.util.type(e[o])||i[r.util.objId(e[o])]?"Array"!==r.util.type(e[o])||i[r.util.objId(e[o])]||(i[r.util.objId(e[o])]=!0,r.languages.DFS(e[o],t,o,i)):(i[r.util.objId(e[o])]=!0,r.languages.DFS(e[o],t,null,i)))}},plugins:{},highlightAll:function(e,t){var n={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",n);for(var i,o=n.elements||document.querySelectorAll(n.selector),a=0;i=o[a++];)r.highlightElement(i,!0===e,n.callback)},highlightElement:function(t,i,o){for(var a,u,c=t;c&&!e.test(c.className);)c=c.parentNode;c&&(a=(c.className.match(e)||[,""])[1],u=r.languages[a]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+a,c=t.parentNode,/pre/i.test(c.nodeName)&&(c.className=c.className.replace(e,"").replace(/\s+/g," ")+" language-"+a);var s=t.textContent,l={element:t,language:a,grammar:u,code:s};if(!s||!u)return void r.hooks.run("complete",l);if(r.hooks.run("before-highlight",l),i&&n.Worker){var f=new Worker(r.filename);f.onmessage=function(e){l.highlightedCode=e.data,r.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,o&&o.call(l.element),r.hooks.run("after-highlight",l),r.hooks.run("complete",l)},f.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else l.highlightedCode=r.highlight(l.code,l.grammar,l.language),r.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,o&&o.call(t),r.hooks.run("after-highlight",l),r.hooks.run("complete",l)},highlight:function(e,t,n){var o=r.tokenize(e,t);return i.stringify(r.util.encode(o),n)},tokenize:function(e,t){var n=r.Token,i=[e],o=t.rest;if(o){for(var a in o)t[a]=o[a];delete t.rest}e:for(var a in t)if(t.hasOwnProperty(a)&&t[a]){var u=t[a];u="Array"===r.util.type(u)?u:[u];for(var c=0;u.length>c;++c){var s=u[c],l=s.inside,f=!!s.lookbehind,p=!!s.greedy,d=0,h=s.alias;s=s.pattern||s;for(var v=0;i.length>v;v++){var y=i[v];if(i.length>e.length)break e;if(!(y instanceof n)){s.lastIndex=0;var m=s.exec(y),g=1;if(!m&&p&&v!=i.length-1){var b=i[v+1].matchedStr||i[v+1],w=y+b;if(i.length-2>v&&(w+=i[v+2].matchedStr||i[v+2]),s.lastIndex=0,!(m=s.exec(w)))continue;var _=m.index+(f?m[1].length:0);if(_>=y.length)continue;var O=m.index+m[0].length,E=y.length+b.length;g=3,E>=O&&(g=2,w=w.slice(0,E)),y=w}if(m){f&&(d=m[1].length);var _=m.index+d,m=m[0].slice(d),O=_+m.length,S=y.slice(0,_),x=y.slice(O),k=[v,g];S&&k.push(S);var j=new n(a,l?r.tokenize(m,l):m,h,m);k.push(j),x&&k.push(x),Array.prototype.splice.apply(i,k)}}}}}return i},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,o=0;i=n[o++];)i(t)}}},i=r.Token=function(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=r||null};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var o={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==o.type&&(o.attributes.spellcheck="true"),e.alias){var a="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(o.classes,a)}r.hooks.run("wrap",o);var u="";for(var c in o.attributes)u+=(u?" ":"")+c+'="'+(o.attributes[c]||"")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'" '+u+">"+o.content+"</"+o.tag+">"},!n.document)return n.addEventListener?(n.addEventListener("message",function(e){var t=JSON.parse(e.data),i=t.language,o=t.code,a=t.immediateClose;n.postMessage(r.highlight(o,r.languages[i],i)),a&&n.close()},!1),n.Prism):n.Prism;var o=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return o&&(r.filename=o.src,document.addEventListener&&!o.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",r.highlightAll)),n.Prism}();void 0!==e&&e.exports&&(e.exports=r),void 0!==t&&(t.Prism=r),r.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},r.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),r.languages.xml=r.languages.markup,r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},r.languages.css.atrule.inside.rest=r.util.clone(r.languages.css),r.languages.markup&&(r.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:r.languages.css,alias:"language-css"}}),r.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:r.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:r.languages.css}},alias:"language-css"}},r.languages.markup.tag)),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,function:/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),r.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),r.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}}}),r.languages.markup&&r.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:r.languages.javascript,alias:"language-javascript"}}),r.languages.js=r.languages.javascript,r.languages.json={property:/".*?"(?=\s*:)/gi,string:/"(?!:)(\\?[^"])*?"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,punctuation:/[{}[\]);,]/g,operator:/:/g,boolean:/\b(true|false)\b/gi,null:/\bnull\b/gi},r.languages.jsonp=r.languages.json,function(e){e.languages.jsx=e.languages.extend("markup",e.util.clone(e.languages.javascript)),e.languages.jsx.tag.pattern=/<\/?[\w\.:-]+\s*(?:\s+[\w\.:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i;var t=e.util.clone(e.languages.jsx);delete t.punctuation,t=e.languages.insertBefore("jsx","operator",{punctuation:/=(?={)|[{}[\];(),.:]/},{jsx:t}),e.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{[^}]*\}|[^}])+\})/i,inside:t,alias:"language-javascript"}},e.languages.jsx.tag)}(r)}).call(t,n(15))},function(e,t){e.exports={heading:"heading___2W8-L",anchor:"anchor___j3LpN"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(132),u=n(52),c=r(u);t.default=function(e){var t=e.form,n=e.format,r=void 0===n?function(e){return JSON.stringify(e,null,2)}:n,i=(0,a.values)({form:t}),u=function(e){var t=e.values;return o.default.createElement("div",null,o.default.createElement("h2",null,"Values"),o.default.createElement(c.default,{source:r(t)}))},s=i(u);return o.default.createElement(s,null)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"actionTypes",function(){return U}),n.d(t,"arrayInsert",function(){return D}),n.d(t,"arrayMove",function(){return V}),n.d(t,"arrayPop",function(){return L}),n.d(t,"arrayPush",function(){return W}),n.d(t,"arrayRemove",function(){return z}),n.d(t,"arrayRemoveAll",function(){return q}),n.d(t,"arrayShift",function(){return B}),n.d(t,"arraySplice",function(){return H}),n.d(t,"arraySwap",function(){return Y}),n.d(t,"arrayUnshift",function(){return $}),n.d(t,"autofill",function(){return K}),n.d(t,"blur",function(){return G}),n.d(t,"change",function(){return Q}),n.d(t,"clearAsyncError",function(){return J}),n.d(t,"clearFields",function(){return X}),n.d(t,"clearSubmitErrors",function(){return Z}),n.d(t,"destroy",function(){return ee}),n.d(t,"focus",function(){return te}),n.d(t,"initialize",function(){return ne}),n.d(t,"registerField",function(){return re}),n.d(t,"reset",function(){return ie}),n.d(t,"setSubmitFailed",function(){return oe}),n.d(t,"setSubmitSucceeded",function(){return ae}),n.d(t,"startAsyncValidation",function(){return ue}),n.d(t,"startSubmit",function(){return ce}),n.d(t,"stopAsyncValidation",function(){return se}),n.d(t,"stopSubmit",function(){return le}),n.d(t,"submit",function(){return fe}),n.d(t,"touch",function(){return pe}),n.d(t,"unregisterField",function(){return de}),n.d(t,"untouch",function(){return he}),n.d(t,"updateSyncWarnings",function(){return ve});var r=n(54),i=n(31),o=n(55);n.d(t,"defaultShouldAsyncValidate",function(){return o.a});var a=n(56);n.d(t,"defaultShouldValidate",function(){return a.a});var u=n(57);n.d(t,"defaultShouldError",function(){return u.a});var c=n(58);n.d(t,"defaultShouldWarn",function(){return c.a});var s=n(133);n.d(t,"Form",function(){return s.a});var l=n(134);n.d(t,"FormSection",function(){return l.a});var f=n(59);n.d(t,"SubmissionError",function(){return f.a});var p=n(136);n.d(t,"propTypes",function(){return p.a}),n.d(t,"fieldInputPropTypes",function(){return p.e}),n.d(t,"fieldMetaPropTypes",function(){return p.f}),n.d(t,"fieldPropTypes",function(){return p.g}),n.d(t,"fieldArrayFieldsPropTypes",function(){return p.b}),n.d(t,"fieldArrayMetaPropTypes",function(){return p.c}),n.d(t,"fieldArrayPropTypes",function(){return p.d}),n.d(t,"formPropTypes",function(){return p.h});var d=n(137);n.d(t,"Field",function(){return d.a});var h=n(224);n.d(t,"Fields",function(){return h.a});var v=n(227);n.d(t,"FieldArray",function(){return v.a});var y=n(245);n.d(t,"formValueSelector",function(){return y.a});var m=n(247);n.d(t,"formValues",function(){return m.a});var g=n(249);n.d(t,"getFormError",function(){return g.a});var b=n(251);n.d(t,"getFormNames",function(){return b.a});var w=n(253);n.d(t,"getFormValues",function(){return w.a});var _=n(255);n.d(t,"getFormInitialValues",function(){return _.a});var O=n(257);n.d(t,"getFormSyncErrors",function(){return O.a});var E=n(259);n.d(t,"getFormMeta",function(){return E.a});var S=n(261);n.d(t,"getFormAsyncErrors",function(){return S.a});var x=n(263);n.d(t,"getFormSyncWarnings",function(){return x.a});var k=n(265);n.d(t,"getFormSubmitErrors",function(){return k.a});var j=n(267);n.d(t,"isDirty",function(){return j.a});var C=n(269);n.d(t,"isInvalid",function(){return C.a});var P=n(272);n.d(t,"isPristine",function(){return P.a});var T=n(273);n.d(t,"isValid",function(){return T.a});var R=n(274);n.d(t,"isSubmitting",function(){return R.a});var A=n(276);n.d(t,"hasSubmitSucceeded",function(){return A.a});var F=n(278);n.d(t,"hasSubmitFailed",function(){return F.a});var I=n(280);n.d(t,"reduxForm",function(){return I.a});var N=n(311);n.d(t,"reducer",function(){return N.a});var M=n(314);n.d(t,"values",function(){return M.a});var U=i,D=r.a.arrayInsert,V=r.a.arrayMove,L=r.a.arrayPop,W=r.a.arrayPush,z=r.a.arrayRemove,q=r.a.arrayRemoveAll,B=r.a.arrayShift,H=r.a.arraySplice,Y=r.a.arraySwap,$=r.a.arrayUnshift,K=r.a.autofill,G=r.a.blur,Q=r.a.change,J=r.a.clearAsyncError,X=r.a.clearFields,Z=r.a.clearSubmitErrors,ee=r.a.destroy,te=r.a.focus,ne=r.a.initialize,re=r.a.registerField,ie=r.a.reset,oe=r.a.setSubmitFailed,ae=r.a.setSubmitSucceeded,ue=r.a.startAsyncValidation,ce=r.a.startSubmit,se=r.a.stopAsyncValidation,le=r.a.stopSubmit,fe=r.a.submit,pe=r.a.touch,de=r.a.unregisterField,he=r.a.untouch,ve=r.a.updateSyncWarnings},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),u=n.n(a),c=n(2),s=n.n(c),l=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(!n._reduxForm)throw Error("Form must be inside a component decorated with reduxForm()");return o}return o(t,e),l(t,[{key:"componentWillMount",value:function(){this.context._reduxForm.registerInnerOnSubmit(this.props.onSubmit)}},{key:"render",value:function(){return u.a.createElement("form",this.props)}}]),t}(a.Component);f.propTypes={onSubmit:s.a.func.isRequired},f.contextTypes={_reduxForm:s.a.object},t.a=f},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),c=n.n(u),s=n(2),l=n.n(s),f=n(12),p=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(!n._reduxForm)throw Error("FormSection must be inside a component decorated with reduxForm()");return r}return a(t,e),d(t,[{key:"getChildContext",value:function(){var e=this.context,t=this.props.name;return{_reduxForm:p({},e._reduxForm,{sectionPrefix:Object(f.a)(e,t)})}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.component,i=r(e,["children","name","component"]);return c.a.isValidElement(t)?t:Object(u.createElement)(n,p({},i,{children:t}))}}]),t}(u.Component);h.propTypes={name:l.a.string.isRequired,component:l.a.oneOfType([l.a.func,l.a.string])},h.defaultProps={component:"div"},h.childContextTypes={_reduxForm:l.a.object.isRequired},h.contextTypes={_reduxForm:l.a.object},t.a=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.a=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:n.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(n,n.constructor),i(n)):(Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,value:Error(e).stack,writable:!0}),n)}return o(t,e),t}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error))},function(e,t,n){"use strict";n.d(t,"h",function(){return d}),n.d(t,"e",function(){return h}),n.d(t,"f",function(){return v}),n.d(t,"c",function(){return y}),n.d(t,"b",function(){return m}),n.d(t,"g",function(){return g}),n.d(t,"d",function(){return b});var r=n(2),i=n.n(r),o=i.a.any,a=i.a.bool,u=i.a.func,c=i.a.shape,s=i.a.string,l=i.a.oneOfType,f=i.a.object,p=i.a.number,d={anyTouched:a.isRequired,asyncValidating:l([a,s]).isRequired,dirty:a.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,initialized:a.isRequired,initialValues:f,pristine:a.isRequired,pure:a.isRequired,submitting:a.isRequired,submitFailed:a.isRequired,submitSucceeded:a.isRequired,valid:a.isRequired,warning:o,array:c({insert:u.isRequired,move:u.isRequired,pop:u.isRequired,push:u.isRequired,remove:u.isRequired,removeAll:u.isRequired,shift:u.isRequired,splice:u.isRequired,swap:u.isRequired,unshift:u.isRequired}),asyncValidate:u.isRequired,autofill:u.isRequired,blur:u.isRequired,change:u.isRequired,clearAsyncError:u.isRequired,destroy:u.isRequired,dispatch:u.isRequired,handleSubmit:u.isRequired,initialize:u.isRequired,reset:u.isRequired,touch:u.isRequired,submit:u.isRequired,untouch:u.isRequired,triggerSubmit:a,clearSubmit:u.isRequired},h={checked:a,name:s.isRequired,onBlur:u.isRequired,onChange:u.isRequired,onDragStart:u.isRequired,onDrop:u.isRequired,onFocus:u.isRequired,value:o},v={active:a.isRequired,asyncValidating:a.isRequired,autofilled:a.isRequired,dirty:a.isRequired,dispatch:u.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,pristine:a.isRequired,submitting:a.isRequired,submitFailed:a.isRequired,touched:a.isRequired,valid:a.isRequired,visited:a.isRequired,warning:s},y={dirty:a.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,pristine:a.isRequired,submitFailed:a,submitting:a,valid:a.isRequired,warning:s},m={name:s.isRequired,forEach:u.isRequired,get:u.isRequired,getAll:u.isRequired,insert:u.isRequired,length:p.isRequired,map:u.isRequired,move:u.isRequired,pop:u.isRequired,push:u.isRequired,reduce:u.isRequired,remove:u.isRequired,removeAll:u.isRequired,shift:u.isRequired,swap:u.isRequired,unshift:u.isRequired},g={input:c(h).isRequired,meta:c(v).isRequired},b={fields:c(m).isRequired,meta:c(y).isRequired};t.a=d},function(e,t,n){"use strict";var r=n(138),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),u=(n.n(a),n(2)),c=n.n(u),s=n(8),l=n.n(s),f=n(139),p=n(84),d=n(12),h=n(0),v=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.a=function(e){var t=Object(f.a)(e),n=e.setIn,u=function(e){function u(e,t){r(this,u);var o=i(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e,t));if(o.saveRef=function(e){return o.ref=e},o.normalize=function(e,t){var r=o.props.normalize;if(!r)return t;var i=o.context._reduxForm.getValues();return r(t,o.value,n(i,e,t),i)},!t._reduxForm)throw Error("Field must be inside a component decorated with reduxForm()");return o}return o(u,e),y(u,[{key:"shouldComponentUpdate",value:function(e,t){return Object(p.a)(this,e,t)}},{key:"componentWillMount",value:function(){var e=this;this.context._reduxForm.register(this.name,"Field",function(){return e.props.validate},function(){return e.props.warn})}},{key:"componentWillReceiveProps",value:function(e,t){var n=Object(d.a)(this.context,this.props.name),r=Object(d.a)(t,e.name);n===r&&h.a.deepEqual(this.props.validate,e.validate)&&h.a.deepEqual(this.props.warn,e.warn)||(this.context._reduxForm.unregister(n),this.context._reduxForm.register(r,"Field",function(){return e.validate},function(){return e.warn}))}},{key:"componentWillUnmount",value:function(){this.context._reduxForm.unregister(this.name)}},{key:"getRenderedComponent",value:function(){return l()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to Field"),this.ref?this.ref.getWrappedInstance().getRenderedComponent():void 0}},{key:"render",value:function(){return Object(a.createElement)(t,v({},this.props,{name:this.name,normalize:this.normalize,_reduxForm:this.context._reduxForm,ref:this.saveRef}))}},{key:"name",get:function(){return Object(d.a)(this.context,this.props.name)}},{key:"dirty",get:function(){return!this.pristine}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isPristine())}},{key:"value",get:function(){return this.ref&&this.ref.getWrappedInstance().getValue()}}]),u}(a.Component);return u.propTypes={name:c.a.string.isRequired,component:c.a.oneOfType([c.a.func,c.a.string]).isRequired,format:c.a.func,normalize:c.a.func,onBlur:c.a.func,onChange:c.a.func,onFocus:c.a.func,onDragStart:c.a.func,onDrop:c.a.func,parse:c.a.func,props:c.a.object,validate:c.a.oneOfType([c.a.func,c.a.arrayOf(c.a.func)]),warn:c.a.oneOfType([c.a.func,c.a.arrayOf(c.a.func)]),withRef:c.a.bool},u.contextTypes={_reduxForm:c.a.object},u}},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),c=(n.n(u),n(2)),s=n.n(c),l=n(9),f=n(71),p=n(72),d=n(159),h=n(0),v=n(74),y=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b=["_reduxForm"],w=function(e){return e&&"object"===(void 0===e?"undefined":g(e))},_=function(e){return e&&"function"==typeof e},O=function(e){w(e)&&_(e.preventDefault)&&e.preventDefault()},E=function(e,t){if(w(e)&&w(e.dataTransfer)&&_(e.dataTransfer.getData))return e.dataTransfer.getData(t)},S=function(e,t,n){w(e)&&w(e.dataTransfer)&&_(e.dataTransfer.setData)&&e.dataTransfer.setData(t,n)};t.a=function(e){var t=e.deepEqual,n=e.getIn,c=function(e,t){var n=h.a.getIn(e,t);return n&&n._error?n._error:n},g=function(e,t){var r=n(e,t);return r&&r._warning?r._warning:r},w=function(n){function c(){var e,t,n,r;i(this,c);for(var a=arguments.length,u=Array(a),s=0;a>s;s++)u[s]=arguments[s];return t=n=o(this,(e=c.__proto__||Object.getPrototypeOf(c)).call.apply(e,[this].concat(u))),n.saveRef=function(e){return n.ref=e},n.isPristine=function(){return n.props.pristine},n.getValue=function(){return n.props.value},n.handleChange=function(e){var t=n.props,r=t.name,i=t.dispatch,o=t.parse,a=t.normalize,u=t.onChange,c=t._reduxForm,s=t.value,l=Object(p.a)(e,{name:r,parse:o,normalize:a}),f=!1;u&&(v.a?u(e,l,s):u(y({},e,{preventDefault:function(){return f=!0,O(e)}}),l,s)),f||(i(c.change(r,l)),c.asyncValidate&&c.asyncValidate(r,l,"change"))},n.handleFocus=function(e){var t=n.props,r=t.name,i=t.dispatch,o=t.onFocus,a=t._reduxForm,u=!1;o&&o(v.a?e:y({},e,{preventDefault:function(){return u=!0,O(e)}})),u||i(a.focus(r))},n.handleBlur=function(e){var t=n.props,r=t.name,i=t.dispatch,o=t.parse,a=t.normalize,u=t.onBlur,c=t._reduxForm,s=t._value,l=t.value,f=Object(p.a)(e,{name:r,parse:o,normalize:a});f===s&&void 0!==s&&(f=l);var d=!1;u&&(v.a?u(e,f,l):u(y({},e,{preventDefault:function(){return d=!0,O(e)}}),f,l)),d||(i(c.blur(r,f)),c.asyncValidate&&c.asyncValidate(r,f,"blur"))},n.handleDragStart=function(e){var t=n.props,r=t.onDragStart,i=t.value;S(e,d.a,null==i?"":i),r&&r(e)},n.handleDrop=function(e){var t=n.props,r=t.name,i=t.dispatch,o=t.onDrop,a=t._reduxForm,u=t.value,c=E(e,d.a),s=!1;o&&o(y({},e,{preventDefault:function(){return s=!0,O(e)}}),c,u),s||(i(a.change(r,c)),O(e))},r=t,o(n,r)}return a(c,n),m(c,[{key:"shouldComponentUpdate",value:function(e){var n=this,r=Object.keys(e),i=Object.keys(this.props);return!!(this.props.children||e.children||r.length!==i.length||r.some(function(r){return!~b.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"getRenderedComponent",value:function(){return this.ref}},{key:"render",value:function(){var t=this.props,n=t.component,i=t.withRef,o=t.name,a=t._reduxForm,c=r(t,["component","withRef","name","_reduxForm","normalize","onBlur","onChange","onFocus","onDragStart","onDrop"]),s=Object(f.a)(e,o,y({},c,{form:a.form,onBlur:this.handleBlur,onChange:this.handleChange,onDrop:this.handleDrop,onDragStart:this.handleDragStart,onFocus:this.handleFocus})),l=s.custom,p=r(s,["custom"]);if(i&&(l.ref=this.saveRef),"string"==typeof n){var d=p.input;return Object(u.createElement)(n,y({},d,l))}return Object(u.createElement)(n,y({},p,l))}}]),c}(u.Component);return w.propTypes={component:s.a.oneOfType([s.a.func,s.a.string]).isRequired,props:s.a.object},Object(l.a)(function(e,r){var i=r.name,o=r._reduxForm,a=o.initialValues,u=o.getFormState,s=u(e),l=n(s,"initial."+i),f=void 0!==l?l:a&&n(a,i),p=n(s,"values."+i),d=n(s,"submitting"),h=c(n(s,"syncErrors"),i),v=g(n(s,"syncWarnings"),i),y=t(p,f);return{asyncError:n(s,"asyncErrors['"+i+"']"),asyncValidating:n(s,"asyncValidating")===i,dirty:!y,pristine:y,state:n(s,"fields."+i),submitError:n(s,"submitErrors['"+i+"']"),submitFailed:n(s,"submitFailed"),submitting:d,syncError:h,syncWarning:v,initial:f,value:p,_value:r.value}},void 0,void 0,{withRef:!0})(w)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),u=(n.n(a),n(2)),c=n.n(u),s=n(60);n(32),function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1],u=n||t+"Subscription",l=function(e){function n(o,a){r(this,n);var u=i(this,e.call(this,o,a));return u[t]=o.store,u}return o(n,e),n.prototype.getChildContext=function(){var e;return e={},e[t]=this[t],e[u]=null,e},n.prototype.render=function(){return a.Children.only(this.props.children)},n}(a.Component);l.propTypes={store:s.a.isRequired,children:c.a.element.isRequired},l.childContextTypes=(e={},e[t]=s.a.isRequired,e[u]=s.b,e)}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){var e=[],t=[];return{clear:function(){t=o,e=o},notify:function(){for(var n=e=t,r=0;n.length>r;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==o&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}}n.d(t,"a",function(){return u});var o=null,a={notify:function(){}},u=function(){function e(t,n,i){r(this,e),this.store=t,this.parentSub=n,this.onStateChange=i,this.unsubscribe=null,this.listeners=a}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return!!this.unsubscribe},e.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=i())},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=a)},e}()},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function o(e,t){return e===t}var a=n(61),u=n(143),c=n(144),s=n(154),l=n(155),f=n(156),p=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?a.a:t,d=e.mapStateToPropsFactories,h=void 0===d?s.a:d,v=e.mapDispatchToPropsFactories,y=void 0===v?c.a:v,m=e.mergePropsFactories,g=void 0===m?l.a:m,b=e.selectorFactory,w=void 0===b?f.a:b;return function(e,t,a){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=c.pure,l=void 0===s||s,f=c.areStatesEqual,d=void 0===f?o:f,v=c.areOwnPropsEqual,m=void 0===v?u.a:v,b=c.areStatePropsEqual,_=void 0===b?u.a:b,O=c.areMergedPropsEqual,E=void 0===O?u.a:O,S=r(c,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),x=i(e,h,"mapStateToProps"),k=i(t,y,"mapDispatchToProps"),j=i(a,g,"mergeProps");return n(w,p({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:x,initMapDispatchToProps:k,initMergeProps:j,pure:l,areStatesEqual:d,areOwnPropsEqual:m,areStatePropsEqual:_,areMergedPropsEqual:E},S))}}()},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(var i=0;n.length>i;i++)if(!o.call(t,n[i])||!r(e[n[i]],t[n[i]]))return!1;return!0}t.a=i;var o=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";function r(e){return"function"==typeof e?Object(u.b)(e,"mapDispatchToProps"):void 0}function i(e){return e?void 0:Object(u.a)(function(e){return{dispatch:e}})}function o(e){return e&&"object"==typeof e?Object(u.a)(function(t){return Object(a.a)(e,t)}):void 0}var a=n(33),u=n(69);t.a=[r,i,o]},function(e,t,n){"use strict";function r(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var i=u.call(e);return r&&(t?e[c]=n:delete e[c]),i}var i=n(17),o=Object.prototype,a=o.hasOwnProperty,u=o.toString,c=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return o.call(e)}var i=Object.prototype,o=i.toString;t.a=r},function(e,t,n){e.exports=n(148)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(150),a=function(e){return e&&e.__esModule?e:{default:e}}(o);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var u=(0,a.default)(i);t.default=u}).call(t,n(15),n(149)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";n(63),n(16),n(67)},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;n.length>o;o++){var a=n[o],u=e[a];"function"==typeof u&&(i[a]=r(u,t))}return i}t.a=i},function(e,t,n){"use strict";n(68),Object},function(e,t,n){"use strict";function r(e){return"function"==typeof e?Object(o.b)(e,"mapStateToProps"):void 0}function i(e){return e?void 0:Object(o.a)(function(){return{}})}var o=n(69);t.a=[r,i]},function(e,t,n){"use strict";function r(e,t,n){return u({},n,e,t)}function i(e){return function(t,n){var r=n.pure,i=n.areMergedPropsEqual,o=!1,a=void 0;return function(t,n,u){var c=e(t,n,u);return o?r&&i(c,a)||(a=c):(o=!0,a=c),a}}}function o(e){return"function"==typeof e?i(e):void 0}function a(e){return e?void 0:function(){return r}}var u=(n(70),Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});t.a=[o,a]},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t,n,r){return function(i,o){return n(e(i,o),t(r,o),o)}}function o(e,t,n,r,i){function o(i,o){return h=i,v=o,y=e(h,v),m=t(r,v),g=n(y,m,v),d=!0,g}function a(){return y=e(h,v),t.dependsOnOwnProps&&(m=t(r,v)),g=n(y,m,v)}function u(){return e.dependsOnOwnProps&&(y=e(h,v)),t.dependsOnOwnProps&&(m=t(r,v)),g=n(y,m,v)}function c(){var t=e(h,v),r=!p(t,y);return y=t,r&&(g=n(y,m,v)),g}function s(e,t){var n=!f(t,v),r=!l(e,h);return h=e,v=t,n&&r?a():n?u():r?c():g}var l=i.areStatesEqual,f=i.areOwnPropsEqual,p=i.areStatePropsEqual,d=!1,h=void 0,v=void 0,y=void 0,m=void 0,g=void 0;return function(e,t){return d?s(e,t):o(e,t)}}function a(e,t){var n=t.initMapStateToProps,a=t.initMapDispatchToProps,u=t.initMergeProps,c=r(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(e,c),l=a(e,c),f=u(e,c);return(c.pure?o:i)(s,l,f,e,c)}t.a=a,n(157)},function(e,t,n){"use strict";n(32)},function(e,t,n){"use strict";var r=n(73),i=function(e){var t=[];if(e)for(var n=0;e.length>n;n++){var r=e[n];r.selected&&t.push(r.value)}return t};t.a=function(e,t){if(Object(r.a)(e)){if(!t&&e.nativeEvent&&void 0!==e.nativeEvent.text)return e.nativeEvent.text;if(t&&void 0!==e.nativeEvent)return e.nativeEvent.text;var n=e,o=n.target,a=o.type,u=o.value,c=o.checked,s=o.files,l=n.dataTransfer;return"checkbox"===a?!!c:"file"===a?s||l&&l.files:"select-multiple"===a?i(e.target.options):u}return e}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r="text"},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}t.a=function(e,t,n,i){if(e=e||[],e.length>t){if(void 0===i&&!n){var o=[].concat(r(e));return o.splice(t,0,!0),o[t]=void 0,o}if(null!=i){var a=[].concat(r(e));return a.splice(t,n,i),a}var u=[].concat(r(e));return u.splice(t,n),u}if(n)return e;var c=[].concat(r(e));return c[t]=i,c}},function(e,t,n){"use strict";var r=n(18);t.a=function(e,t){if(!e)return e;var n=Object(r.a)(t),i=n.length;if(i){for(var o=e,a=0;i>a&&o;++a)o=o[n[a]];return o}}},function(e,t,n){"use strict";function r(e){var t=Object(i.a)(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}var i=n(163),o=500;t.a=r},function(e,t,n){"use strict";function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(r.Cache||i.a),n}var i=n(34),o="Expected a function";r.Cache=i.a,t.a=r},function(e,t,n){"use strict";function r(){this.size=0,this.__data__={hash:new i.a,map:new(a.a||o.a),string:new i.a}}var i=n(165),o=n(21),a=n(36);t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(166),o=n(171),a=n(172),u=n(173),c=n(174);r.prototype.clear=i.a,r.prototype.delete=o.a,r.prototype.get=a.a,r.prototype.has=u.a,r.prototype.set=c.a,t.a=r},function(e,t,n){"use strict";function r(){this.__data__=i.a?Object(i.a)(null):{},this.size=0}var i=n(20);t.a=r},function(e,t,n){"use strict";function r(e){return!(!Object(a.a)(e)||Object(o.a)(e))&&(Object(i.a)(e)?h:s).test(Object(u.a)(e))}var i=n(35),o=n(168),a=n(5),u=n(78),c=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,p=l.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.a=r},function(e,t,n){"use strict";function r(e){return!!o&&o in e}var i=n(169),o=function(){var e=/[^.]+$/.exec(i.a&&i.a.keys&&i.a.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.a=r},function(e,t,n){"use strict";t.a=n(3).a["__core-js_shared__"]},function(e,t,n){"use strict";function r(e,t){return null==e?void 0:e[t]}t.a=r},function(e,t,n){"use strict";function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__;if(i.a){var n=t[e];return n===o?void 0:n}return u.call(t,e)?t[e]:void 0}var i=n(20),o="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__;return i.a?void 0!==t[e]:a.call(t,e)}var i=n(20),o=Object.prototype,a=o.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i.a&&void 0===t?o:t,this}var i=n(20),o="__lodash_hash_undefined__";t.a=r},function(e,t,n){"use strict";function r(){this.__data__=[],this.size=0}t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,n=Object(i.a)(t,e);return n>=0&&(n==t.length-1?t.pop():a.call(t,n,1),--this.size,!0)}var i=n(22),o=Array.prototype,a=o.splice;t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,n=Object(i.a)(t,e);return 0>n?void 0:t[n][1]}var i=n(22);t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(this.__data__,e)>-1}var i=n(22);t.a=r},function(e,t,n){"use strict";function r(e,t){var n=this.__data__,r=Object(i.a)(n,e);return 0>r?(++this.size,n.push([e,t])):n[r][1]=t,this}var i=n(22);t.a=r},function(e,t,n){"use strict";function r(e){var t=Object(i.a)(this,e).delete(e);return this.size-=t?1:0,t}var i=n(23);t.a=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(this,e).get(e)}var i=n(23);t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(this,e).has(e)}var i=n(23);t.a=r},function(e,t,n){"use strict";function r(e,t){var n=Object(i.a)(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var i=n(23);t.a=r},function(e,t,n){"use strict";function r(e){if("string"==typeof e)return e;if(Object(a.a)(e))return Object(o.a)(e,r)+"";if(Object(u.a)(e))return l?l.call(e):"";var t=e+"";return"0"==t&&1/e==-c?"-0":t}var i=n(17),o=n(75),a=n(4),u=n(19),c=1/0,s=i.a?i.a.prototype:void 0,l=s?s.toString:void 0;t.a=r},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(18),o=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function e(t,n,i,a){if(a>=i.length)return n;var u=i[a],c=t&&(Array.isArray(t)?t[+u]:t[u]),s=e(c,n,i,a+1);if(!t){if(isNaN(u))return r({},u,s);var l=[];return l[parseInt(u,10)]=s,l}if(Array.isArray(t)){var f=[].concat(t);return f[parseInt(u,10)]=s,f}return o({},t,r({},u,s))};t.a=function(e,t,n){return a(e,n,Object(i.a)(t),0)}},function(e,t,n){"use strict";var r=n(80),i=n(1),o=n.n(i),a=function(e,t){return e===t||(e||t?(!e||!t||e._error===t._error)&&(!e||!t||e._warning===t._warning)&&!o.a.isValidElement(e)&&!o.a.isValidElement(t)&&void 0:(null===e||void 0===e||""===e)==(null===t||void 0===t||""===t))};t.a=function(e,t){return Object(r.a)(e,t,a)}},function(e,t,n){"use strict";function r(e,t,n,r,y,g){var b=Object(s.a)(e),w=Object(s.a)(t),_=b?h:Object(c.a)(e),O=w?h:Object(c.a)(t);_=_==d?v:_,O=O==d?v:O;var E=_==v,S=O==v,x=_==O;if(x&&Object(l.a)(e)){if(!Object(l.a)(t))return!1;b=!0,E=!1}if(x&&!E)return g||(g=new i.a),b||Object(f.a)(e)?Object(o.a)(e,t,n,r,y,g):Object(a.a)(e,t,_,n,r,y,g);if(!(n&p)){var k=E&&m.call(e,"__wrapped__"),j=S&&m.call(t,"__wrapped__");if(k||j){var C=k?e.value():e,P=j?t.value():t;return g||(g=new i.a),y(C,P,n,r,g)}}return!!x&&(g||(g=new i.a),Object(u.a)(e,t,n,r,y,g))}var i=n(38),o=n(81),a=n(199),u=n(202),c=n(217),s=n(4),l=n(41),f=n(43),p=1,d="[object Arguments]",h="[object Array]",v="[object Object]",y=Object.prototype,m=y.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(){this.__data__=new i.a,this.size=0}var i=n(21);t.a=r},function(e,t,n){"use strict";function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.get(e)}t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.has(e)}t.a=r},function(e,t,n){"use strict";function r(e,t){var n=this.__data__;if(n instanceof i.a){var r=n.__data__;if(!o.a||u-1>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new a.a(r)}return n.set(e,t),this.size=n.size,this}var i=n(21),o=n(36),a=n(34),u=200;t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i.a;++t<n;)this.add(e[t])}var i=n(34),o=n(195),a=n(196);r.prototype.add=r.prototype.push=o.a,r.prototype.has=a.a,t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.set(e,i),this}var i="__lodash_hash_undefined__";t.a=r},function(e,t,n){"use strict";function r(e){return this.__data__.has(e)}t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.a=r},function(e,t,n){"use strict";function r(e,t){return e.has(t)}t.a=r},function(e,t,n){"use strict";function r(e,t,n,r,i,E,x){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!E(new o.a(e),new o.a(t)));case p:case d:case y:return Object(a.a)(+e,+t);case h:return e.name==t.name&&e.message==t.message;case m:case b:return e==t+"";case v:var k=c.a;case g:var j=r&l;if(k||(k=s.a),e.size!=t.size&&!j)return!1;var C=x.get(e);if(C)return C==t;r|=f,x.set(e,t);var P=Object(u.a)(k(e),k(t),r,i,E,x);return x.delete(e),P;case w:if(S)return S.call(e)==S.call(t)}return!1}var i=n(17),o=n(82),a=n(13),u=n(81),c=n(200),s=n(201),l=1,f=2,p="[object Boolean]",d="[object Date]",h="[object Error]",v="[object Map]",y="[object Number]",m="[object RegExp]",g="[object Set]",b="[object String]",w="[object Symbol]",_="[object ArrayBuffer]",O="[object DataView]",E=i.a?i.a.prototype:void 0,S=E?E.valueOf:void 0;t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.a=r},function(e,t,n){"use strict";function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.a=r},function(e,t,n){"use strict";function r(e,t,n,r,a,c){var s=n&o,l=Object(i.a)(e),f=l.length;if(f!=Object(i.a)(t).length&&!s)return!1;for(var p=f;p--;){var d=l[p];if(!(s?d in t:u.call(t,d)))return!1}var h=c.get(e);if(h&&c.get(t))return h==t;var v=!0;c.set(e,t),c.set(t,e);for(var y=s;++p<f;){d=l[p];var m=e[d],g=t[d];if(r)var b=s?r(g,m,d,t,e,c):r(m,g,d,e,t,c);if(!(void 0===b?m===g||a(m,g,n,r,c):b)){v=!1;break}y||(y="constructor"==d)}if(v&&!y){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _)&&(v=!1)}return c.delete(e),c.delete(t),v}var i=n(203),o=1,a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(e,a.a,o.a)}var i=n(204),o=n(206),a=n(39);t.a=r},function(e,t,n){"use strict";function r(e,t,n){var r=t(e);return Object(o.a)(e)?r:Object(i.a)(r,n(e))}var i=n(205),o=n(4);t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.a=r},function(e,t,n){"use strict";var r=n(207),i=n(208),o=Object.prototype,a=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols;t.a=u?function(e){return null==e?[]:(e=Object(e),Object(r.a)(u(e),function(t){return a.call(e,t)}))}:i.a},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}t.a=r},function(e,t,n){"use strict";function r(){return[]}t.a=r},function(e,t,n){"use strict";function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.a=r},function(e,t,n){"use strict";function r(e){return Object(o.a)(e)&&Object(i.a)(e)==a}var i=n(10),o=n(6),a="[object Arguments]";t.a=r},function(e,t,n){"use strict";function r(){return!1}t.a=r},function(e,t,n){"use strict";function r(e){return Object(a.a)(e)&&Object(o.a)(e.length)&&!!u[Object(i.a)(e)]}var i=n(10),o=n(44),a=n(6),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return e(t)}}t.a=r},function(e,n,r){"use strict";(function(e){var i=r(64),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===o,c=u&&i.a.process,s=function(){try{return c&&c.binding&&c.binding("util")}catch(e){}}();n.a=s}).call(n,r(24)(e))},function(e,t,n){"use strict";function r(e){if(!Object(i.a)(e))return Object(o.a)(e);var t=[];for(var n in Object(e))u.call(e,n)&&"constructor"!=n&&t.push(n);return t}var i=n(45),o=n(216),a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";var r=n(66);t.a=Object(r.a)(Object.keys,Object)},function(e,t,n){"use strict";var r=n(218),i=n(36),o=n(219),a=n(220),u=n(221),c=n(10),s=n(78),l=Object(s.a)(r.a),f=Object(s.a)(i.a),p=Object(s.a)(o.a),d=Object(s.a)(a.a),h=Object(s.a)(u.a),v=c.a;(r.a&&"[object DataView]"!=v(new r.a(new ArrayBuffer(1)))||i.a&&"[object Map]"!=v(new i.a)||o.a&&"[object Promise]"!=v(o.a.resolve())||a.a&&"[object Set]"!=v(new a.a)||u.a&&"[object WeakMap]"!=v(new u.a))&&(v=function(e){var t=Object(c.a)(e),n="[object Object]"==t?e.constructor:void 0,r=n?Object(s.a)(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),t.a=v},function(e,t,n){"use strict";var r=n(7),i=n(3);t.a=Object(r.a)(i.a,"DataView")},function(e,t,n){"use strict";var r=n(7),i=n(3);t.a=Object(r.a)(i.a,"Promise")},function(e,t,n){"use strict";var r=n(7),i=n(3);t.a=Object(r.a)(i.a,"Set")},function(e,t,n){"use strict";var r=n(7),i=n(3);t.a=Object(r.a)(i.a,"WeakMap")},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(void 0===e||null===e||void 0===t||null===t)return e;for(var n=arguments.length,a=Array(n>2?n-2:0),c=2;n>c;c++)a[c-2]=arguments[c];if(a.length){if(Array.isArray(e)){if(isNaN(t))throw Error('Must access array elements with a number, not "'+t+'".');var s=+t;if(e.length>s){var l=o.apply(void 0,[e&&e[s]].concat(i(a)));if(l!==e[s]){var f=[].concat(i(e));return f[s]=l,f}}return e}if(t in e){var p=o.apply(void 0,[e&&e[t]].concat(i(a)));return e[t]===p?e:u({},e,r({},t,p))}return e}if(Array.isArray(e)){if(isNaN(t))throw Error('Cannot delete non-numerical index from an array. Given: "'+t);var d=+t;if(e.length>d){var h=[].concat(i(e));return h.splice(d,1),h}return e}if(t in e){var v=u({},e);return delete v[t],v}return e}var a=n(18),u=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(e,t){return o.apply(void 0,[e].concat(i(Object(a.a)(t))))}},function(e,t,n){"use strict";function r(e){return e?Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e):[]}t.a=r},function(e,t,n){"use strict";var r=n(225),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),u=(n.n(a),n(2)),c=n.n(u),s=n(8),l=n.n(s),f=n(226),p=n(84),d=n(0),h=n(12),v=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=function(e){return e?Array.isArray(e)||e._isFieldArray?void 0:Error('Invalid prop "names" supplied to <Fields/>. Must be either an array of strings or the fields array generated by FieldArray.'):Error('No "names" prop was specified <Fields/>')};t.a=function(e){var t=Object(f.a)(e),n=function(e){function n(e,t){r(this,n);var o=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));if(!t._reduxForm)throw Error("Fields must be inside a component decorated with reduxForm()");return o}return o(n,e),y(n,[{key:"shouldComponentUpdate",value:function(e){return Object(p.a)(this,e)}},{key:"componentWillMount",value:function(){var e=m(this.props.names);if(e)throw e;var t=this.context,n=t._reduxForm.register;this.names.forEach(function(e){return n(e,"Field")})}},{key:"componentWillReceiveProps",value:function(e){if(!d.a.deepEqual(this.props.names,e.names)){var t=this.context,n=t._reduxForm,r=n.register,i=n.unregister;this.props.names.forEach(function(e){return i(Object(h.a)(t,e))}),e.names.forEach(function(e){return r(Object(h.a)(t,e),"Field")})}}},{key:"componentWillUnmount",value:function(){var e=this.context,t=e._reduxForm.unregister;this.props.names.forEach(function(n){return t(Object(h.a)(e,n))})}},{key:"getRenderedComponent",value:function(){return l()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to Fields"),this.refs.connected.getWrappedInstance().getRenderedComponent()}},{key:"render",value:function(){var e=this.context;return Object(a.createElement)(t,v({},this.props,{names:this.props.names.map(function(t){return Object(h.a)(e,t)}),_reduxForm:this.context._reduxForm,ref:"connected"}))}},{key:"names",get:function(){var e=this.context;return this.props.names.map(function(t){return Object(h.a)(e,t)})}},{key:"dirty",get:function(){return this.refs.connected.getWrappedInstance().isDirty()}},{key:"pristine",get:function(){return!this.dirty}},{key:"values",get:function(){return this.refs.connected&&this.refs.connected.getWrappedInstance().getValues()}}]),n}(a.Component);return n.propTypes={names:function(e,t){return m(e[t])},component:c.a.oneOfType([c.a.func,c.a.string]).isRequired,format:c.a.func,parse:c.a.func,props:c.a.object,withRef:c.a.bool},n.contextTypes={_reduxForm:c.a.object},n}},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),c=(n.n(u),n(2)),s=n.n(c),l=n(9),f=n(71),p=n(0),d=n(72),h=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=["_reduxForm"];t.a=function(e){var t=e.deepEqual,n=e.getIn,c=e.size,m=function(e,t){return p.a.getIn(e,t+"._error")||p.a.getIn(e,t)},g=function(e,t){var r=n(e,t);return r&&r._warning?r._warning:r},b=function(n){function s(e){i(this,s);var t=o(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,e));return t.onChangeFns={},t.onFocusFns={},t.onBlurFns={},t.prepareEventHandlers=function(e){return e.names.forEach(function(e){t.onChangeFns[e]=function(n){return t.handleChange(e,n)},t.onFocusFns[e]=function(){return t.handleFocus(e)},t.onBlurFns[e]=function(n){return t.handleBlur(e,n)}})},t.handleChange=function(e,n){var r=t.props,i=r.dispatch,o=r.parse,a=r._reduxForm,u=Object(d.a)(n,{name:e,parse:o});i(a.change(e,u)),a.asyncValidate&&a.asyncValidate(e,u,"change")},t.handleFocus=function(e){var n=t.props;(0,n.dispatch)(n._reduxForm.focus(e))},t.handleBlur=function(e,n){var r=t.props,i=r.dispatch,o=r.parse,a=r._reduxForm,u=Object(d.a)(n,{name:e,parse:o});i(a.blur(e,u)),a.asyncValidate&&a.asyncValidate(e,u,"blur")},t.prepareEventHandlers(e),t}return a(s,n),v(s,[{key:"componentWillReceiveProps",value:function(e){var t=this;this.props.names===e.names||c(this.props.names)===c(e.names)&&!e.names.some(function(e){return!t.props._fields[e]})||this.prepareEventHandlers(e)}},{key:"shouldComponentUpdate",value:function(e){var n=this,r=Object.keys(e),i=Object.keys(this.props);return!!(this.props.children||e.children||r.length!==i.length||r.some(function(r){return!~y.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"isDirty",value:function(){var e=this.props._fields;return Object.keys(e).some(function(t){return e[t].dirty})}},{key:"getValues",value:function(){var e=this.props._fields;return Object.keys(e).reduce(function(t,n){return p.a.setIn(t,n,e[n].value)},{})}},{key:"getRenderedComponent",value:function(){return this.refs.renderedComponent}},{key:"render",value:function(){var t=this,n=this.props,i=n.component,o=n.withRef,a=n._fields,c=n._reduxForm,s=r(n,["component","withRef","_fields","_reduxForm"]),l=c.sectionPrefix,d=c.form,v=Object.keys(a).reduce(function(n,i){var o=a[i],u=Object(f.a)(e,i,h({},o,s,{form:d,onBlur:t.onBlurFns[i],onChange:t.onChangeFns[i],onFocus:t.onFocusFns[i]})),c=u.custom,v=r(u,["custom"]);n.custom=c;var y=l?i.replace(l+".",""):i;return p.a.setIn(n,y,v)},{}),y=v.custom,m=r(v,["custom"]);return o&&(m.ref="renderedComponent"),Object(u.createElement)(i,h({},m,y))}}]),s}(u.Component);return b.propTypes={component:s.a.oneOfType([s.a.func,s.a.string]).isRequired,_fields:s.a.object.isRequired,props:s.a.object},Object(l.a)(function(e,t){var r=t.names,i=t._reduxForm,o=i.initialValues,a=i.getFormState,u=a(e);return{_fields:r.reduce(function(e,r){var i=n(u,"initial."+r),a=void 0!==i?i:o&&n(o,r),c=n(u,"values."+r),s=m(n(u,"syncErrors"),r),l=g(n(u,"syncWarnings"),r),f=n(u,"submitting"),p=c===a;return e[r]={asyncError:n(u,"asyncErrors."+r),asyncValidating:n(u,"asyncValidating")===r,dirty:!p,initial:a,pristine:p,state:n(u,"fields."+r),submitError:n(u,"submitErrors."+r),submitFailed:n(u,"submitFailed"),submitting:f,syncError:s,syncWarning:l,value:c,_value:t.value},e},{})}},void 0,void 0,{withRef:!0})(b)}},function(e,t,n){"use strict";var r=n(228),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=n(1),c=(n.n(u),n(2)),s=n.n(c),l=n(8),f=n.n(l),p=n(229),d=n(12),h=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=function(e){return Array.isArray(e)?e:[e]},m=function(e,t){return e&&function(){for(var n=y(e),r=0;n.length>r;r++){var i=n[r].apply(n,arguments);if(i)return a({},t,i)}}};t.a=function(e){var t=Object(p.a)(e),n=function(e){function n(e,t){r(this,n);var o=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));if(o.saveRef=function(e){o.ref=e},!t._reduxForm)throw Error("FieldArray must be inside a component decorated with reduxForm()");return o}return o(n,e),v(n,[{key:"componentWillMount",value:function(){var e=this;this.context._reduxForm.register(this.name,"FieldArray",function(){return m(e.props.validate,"_error")},function(){return m(e.props.warn,"_warning")})}},{key:"componentWillReceiveProps",value:function(e,t){var n=Object(d.a)(this.context,this.props.name),r=Object(d.a)(t,e.name);n!==r&&(this.context._reduxForm.unregister(n),this.context._reduxForm.register(r,"FieldArray"))}},{key:"componentWillUnmount",value:function(){this.context._reduxForm.unregister(this.name)}},{key:"getRenderedComponent",value:function(){return f()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to FieldArray"),this.ref&&this.ref.getWrappedInstance().getRenderedComponent()}},{key:"render",value:function(){return Object(u.createElement)(t,h({},this.props,{name:this.name,_reduxForm:this.context._reduxForm,ref:this.saveRef}))}},{key:"name",get:function(){return Object(d.a)(this.context,this.props.name)}},{key:"dirty",get:function(){return!this.ref||this.ref.getWrappedInstance().dirty}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().pristine)}},{key:"value",get:function(){return this.ref?this.ref.getWrappedInstance().value:void 0}}]),n}(u.Component);return n.propTypes={name:s.a.string.isRequired,component:s.a.func.isRequired,props:s.a.object,validate:s.a.oneOfType([s.a.func,s.a.arrayOf(s.a.func)]),warn:s.a.oneOfType([s.a.func,s.a.arrayOf(s.a.func)]),withRef:s.a.bool},n.contextTypes={_reduxForm:s.a.object},n}},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(85),c=n(1),s=(n.n(c),n(2)),l=n.n(s),f=n(9),p=n(33),d=n(244),h=n(0),v=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=["_reduxForm","value"];t.a=function(e){var t=e.deepEqual,n=e.getIn,s=e.size,m=function(e,t){return h.a.getIn(e,t+"._error")},g=function(e,t){return n(e,t+"._warning")},b=function(u){function s(){var e,t,r,a;i(this,s);for(var u=arguments.length,c=Array(u),l=0;u>l;l++)c[l]=arguments[l];return t=r=o(this,(e=s.__proto__||Object.getPrototypeOf(s)).call.apply(e,[this].concat(c))),r.saveRef=function(e){r.ref=e},r.getValue=function(e){return r.props.value&&n(r.props.value,e+"")},a=t,o(r,a)}return a(s,u),v(s,[{key:"shouldComponentUpdate",value:function(e){var n=this,r=this.props.value,i=e.value;if(r&&i){var o=i.every(function(e){return~r.indexOf(e)}),a=i.some(function(e,t){return e!==r[t]});if(r.length!==i.length||o&&a||e.rerenderOnEveryChange&&r.some(function(e,n){return!t(e,i[n])}))return!0}var u=Object.keys(e),c=Object.keys(this.props);return!!(this.props.children||e.children||u.length!==c.length||u.some(function(r){return!~y.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"getRenderedComponent",value:function(){return this.ref}},{key:"render",value:function(){var t=this.props,n=t.component,i=t.withRef,o=t.name,a=t._reduxForm,u=r(t,["component","withRef","name","_reduxForm","validate","warn","rerenderOnEveryChange"]),s=Object(d.a)(e,o,a.form,a.sectionPrefix,this.getValue,u);return i&&(s.ref=this.saveRef),Object(c.createElement)(n,s)}},{key:"dirty",get:function(){return this.props.dirty}},{key:"pristine",get:function(){return this.props.pristine}},{key:"value",get:function(){return this.props.value}}]),s}(c.Component);return b.propTypes={component:l.a.oneOfType([l.a.func,l.a.string]).isRequired,props:l.a.object,rerenderOnEveryChange:l.a.bool},b.defaultProps={rerenderOnEveryChange:!1},b.contextTypes={_reduxForm:l.a.object},Object(f.a)(function(e,r){var i=r.name,o=r._reduxForm,a=o.initialValues,u=o.getFormState,c=u(e),l=n(c,"initial."+i)||a&&n(a,i),f=n(c,"values."+i),p=n(c,"submitting"),d=m(n(c,"syncErrors"),i),h=g(n(c,"syncWarnings"),i),v=t(f,l);return{asyncError:n(c,"asyncErrors."+i+"._error"),dirty:!v,pristine:v,state:n(c,"fields."+i),submitError:n(c,"submitErrors."+i+"._error"),submitFailed:n(c,"submitFailed"),submitting:p,syncError:d,syncWarning:h,value:f,length:s(f)}},function(e,t){var n=t.name,r=t._reduxForm,i=r.arrayInsert,o=r.arrayMove,a=r.arrayPop,c=r.arrayPush,s=r.arrayRemove,l=r.arrayRemoveAll,f=r.arrayShift,d=r.arraySplice,h=r.arraySwap,v=r.arrayUnshift;return Object(u.a)({arrayInsert:i,arrayMove:o,arrayPop:a,arrayPush:c,arrayRemove:s,arrayRemoveAll:l,arrayShift:f,arraySplice:d,arraySwap:h,arrayUnshift:v},function(t){return Object(p.a)(t.bind(null,n),e)})},void 0,{withRef:!0})(b)}},function(e,t,n){"use strict";function r(e,t){return e&&Object(i.a)(e,t,o.a)}var i=n(87),o=n(39);t.a=r},function(e,t,n){"use strict";function r(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),u=a.length;u--;){var c=a[e?u:++i];if(!1===n(o[c],c,o))break}return t}}t.a=r},function(e,t,n){"use strict";function r(e){return"function"==typeof e?e:null==e?a.a:"object"==typeof e?Object(u.a)(e)?Object(o.a)(e[0],e[1]):Object(i.a)(e):Object(c.a)(e)}var i=n(233),o=n(236),a=n(47),u=n(4),c=n(241);t.a=r},function(e,t,n){"use strict";function r(e){var t=Object(o.a)(e);return 1==t.length&&t[0][2]?Object(a.a)(t[0][0],t[0][1]):function(n){return n===e||Object(i.a)(n,e,t)}}var i=n(234),o=n(235),a=n(89);t.a=r},function(e,t,n){"use strict";function r(e,t,n,r){var c=n.length,s=c,l=!r;if(null==e)return!s;for(e=Object(e);c--;){var f=n[c];if(l&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++c<s;){f=n[c];var p=f[0],d=e[p],h=f[1];if(l&&f[2]){if(void 0===d&&!(p in e))return!1}else{var v=new i.a;if(r)var y=r(d,h,p,e,t,v);if(!(void 0===y?Object(o.a)(h,d,a|u,r,v):y))return!1}}return!0}var i=n(38),o=n(37),a=1,u=2;t.a=r},function(e,t,n){"use strict";function r(e){for(var t=Object(o.a)(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,Object(i.a)(a)]}return t}var i=n(88),o=n(39);t.a=r},function(e,t,n){"use strict";function r(e,t){return Object(u.a)(e)&&Object(c.a)(t)?Object(s.a)(Object(l.a)(e),t):function(n){var r=Object(o.a)(n,e);return void 0===r&&r===t?Object(a.a)(n,e):Object(i.a)(t,r,f|p)}}var i=n(37),o=n(237),a=n(238),u=n(46),c=n(88),s=n(89),l=n(14),f=1,p=2;t.a=r},function(e,t,n){"use strict";function r(e,t,n){var r=null==e?void 0:Object(i.a)(e,t);return void 0===r?n:r}var i=n(90);t.a=r},function(e,t,n){"use strict";function r(e,t){return null!=e&&Object(o.a)(e,t,i.a)}var i=n(239),o=n(240);t.a=r},function(e,t,n){"use strict";function r(e,t){return null!=e&&t in Object(e)}t.a=r},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,e);for(var r=-1,l=t.length,f=!1;++r<l;){var p=Object(s.a)(t[r]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++r!=l?f:!!(l=null==e?0:e.length)&&Object(c.a)(l)&&Object(u.a)(p,l)&&(Object(a.a)(e)||Object(o.a)(e))}var i=n(91),o=n(40),a=n(4),u=n(42),c=n(44),s=n(14);t.a=r},function(e,t,n){"use strict";function r(e){return Object(a.a)(e)?Object(i.a)(Object(u.a)(e)):Object(o.a)(e)}var i=n(242),o=n(243),a=n(46),u=n(14);t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return null==t?void 0:t[e]}}t.a=r},function(e,t,n){"use strict";function r(e){return function(t){return Object(i.a)(t,e)}}var i=n(90);t.a=r},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var i=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(e,t,n,o,a,u){var c=e.getIn,s=u.arrayInsert,l=u.arrayMove,f=u.arrayPop,p=u.arrayPush,d=u.arrayRemove,h=u.arrayRemoveAll,v=u.arrayShift,y=u.arraySwap,m=u.arrayUnshift,g=u.asyncError,b=u.dirty,w=u.length,_=u.pristine,O=u.submitError,E=u.submitFailed,S=u.submitting,x=u.syncError,k=u.syncWarning,j=u.value,C=u.props,P=r(u,["arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","asyncError","dirty","length","pristine","submitError","state","submitFailed","submitting","syncError","syncWarning","value","props"]),T=x||g||O,R=k,A=o?t.replace(o+".",""):t,F=i({fields:{_isFieldArray:!0,forEach:function(e){return(j||[]).forEach(function(t,n){return e(A+"["+n+"]",n,F.fields)})},get:a,getAll:function(){return j},insert:s,length:w,map:function(e){return(j||[]).map(function(t,n){return e(A+"["+n+"]",n,F.fields)})},move:l,name:t,pop:function(){return f(),c(j,w-1+"")},push:p,reduce:function(e,t){return(j||[]).reduce(function(t,n,r){return e(t,A+"["+r+"]",r,F.fields)},t)},remove:d,removeAll:h,shift:function(){return v(),c(j,"0")},swap:y,unshift:m},meta:{dirty:b,error:T,form:n,warning:R,invalid:!!T,pristine:_,submitting:S,submitFailed:E,valid:!T}},C,P);return F}},function(e,t,n){"use strict";var r=n(246),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(8),i=n.n(r),o=n(0);t.a=function(e){var t=e.getIn;return function(e,n){i()(e,"Form value must be specified");var r=n||function(e){return t(e,"form")};return function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];return i()(u.length,"No fields specified"),1===u.length?t(r(n),e+".values."+u[0]):u.reduce(function(i,a){var u=t(r(n),e+".values."+a);return void 0===u?i:o.a.setIn(i,a,u)},{})}}}},function(e,t,n){"use strict";var r=n(248),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=n(1),s=n.n(c),l=n(2),f=n.n(l),p=n(9),d=n(12),h=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.a=function(e){var t=e.getIn;return function(e){for(var n=arguments.length,c=Array(n>1?n-1:0),l=1;n>l;l++)c[l-1]=arguments[l];return function(n){var l=function(l){function f(u,l){o(this,f);var h=a(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,u,l));if(!l._reduxForm)throw Error("formValues() must be used inside a React tree decorated with reduxForm()");var v=void 0,y="function"==typeof e?e(u):e;if("string"==typeof y)v=[y].concat(i(c)).map(function(e){return{prop:e,path:e}});else{var m=y;v=Object.keys(m).map(function(e){return{prop:e,path:m[e]}})}if(!v.length)throw Error("formValues(): You must specify values to get as formValues(name1, name2, ...) or formValues({propName1: propPath1, ...}) or formValues((props) => name) or formValues((props) => ({propName1: propPath1, ...}))");var g=function(e,n){var r=h.context._reduxForm.getValues,i={},o=r();return v.forEach(function(e){var n=e.prop,r=e.path;return i[n]=t(o,Object(d.a)(h.context,r))}),i};return h.Component=Object(p.a)(g,function(){return{}})(function(e){var t=r(e,["sectionPrefix"]);return s.a.createElement(n,t)}),h}return u(f,l),v(f,[{key:"render",value:function(){return s.a.createElement(this.Component,h({sectionPrefix:this.context._reduxForm.sectionPrefix},this.props))}}]),f}(s.a.Component);return l.contextTypes={_reduxForm:f.a.object},l}}}},function(e,t,n){"use strict";var r=n(250),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".error")}}}},function(e,t,n){"use strict";var r=n(252),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e){var t=e.getIn,n=e.keys;return function(e){return function(r){return n((e||function(e){return t(e,"form")})(r))}}}t.a=r},function(e,t,n){"use strict";var r=n(254),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".values")}}}},function(e,t,n){"use strict";var r=n(256),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".initial")}}}},function(e,t,n){"use strict";var r=n(258),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".syncErrors")||n}}}},function(e,t,n){"use strict";var r=n(260),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".fields")||n}}}},function(e,t,n){"use strict";var r=n(262),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".asyncErrors")}}}},function(e,t,n){"use strict";var r=n(264),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".syncWarnings")||n}}}},function(e,t,n){"use strict";var r=n(266),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".submitErrors")||n}}}},function(e,t,n){"use strict";var r=n(268),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(92);t.a=function(e){return function(t,n){var i=Object(r.a)(e)(t,n);return function(e){return!i(e)}}}},function(e,t,n){"use strict";var r=n(270),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(48);t.a=function(e){return function(t,n){var i=Object(r.a)(e)(t,n);return function(e){return!i(e)}}}},function(e,t,n){"use strict";var r=function(e,t){switch(t){case"Field":return[e,e+"._error"];case"FieldArray":return[e+"._error"];default:throw Error("Unknown field type")}};t.a=function(e){var t=e.getIn;return function(e,n,i,o){if(!n&&!i&&!o)return!1;var a=t(e,"name"),u=t(e,"type");return r(a,u).some(function(e){return t(n,e)||t(i,e)||t(o,e)})}}},function(e,t,n){"use strict";var r=n(92),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(48),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(275),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitting")}}}},function(e,t,n){"use strict";var r=n(277),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitSucceeded")}}}},function(e,t,n){"use strict";var r=n(279),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";t.a=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitFailed")}}}},function(e,t,n){"use strict";var r=n(281),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var c=n(282),s=n(85),l=n(62),f=n.n(l),p=n(8),d=n.n(p),h=n(49),v=n.n(h),y=n(2),m=n.n(y),g=n(1),b=(n.n(g),n(9)),w=n(33),_=n(54),O=n(305),E=n(55),S=n(56),x=n(57),k=n(58),j=n(95),C=n(306),P=n(307),T=n(308),R=n(48),A=n(0),F=n(309),I=n(310),N=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D=function(e){return!(!e||!e.prototype||"object"!==U(e.prototype.isReactComponent))},V=_.a.arrayInsert,L=_.a.arrayMove,W=_.a.arrayPop,z=_.a.arrayPush,q=_.a.arrayRemove,B=_.a.arrayRemoveAll,H=_.a.arrayShift,Y=_.a.arraySplice,$=_.a.arraySwap,K=_.a.arrayUnshift,G=_.a.blur,Q=_.a.change,J=_.a.focus,X=u(_.a,["arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","blur","change","focus"]),Z={arrayInsert:V,arrayMove:L,arrayPop:W,arrayPush:z,arrayRemove:q,arrayRemoveAll:B,arrayShift:H,arraySplice:Y,arraySwap:$,arrayUnshift:K},ee=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}(Object.keys(_.a)),["array","asyncErrors","initialValues","syncErrors","syncWarnings","values","registeredFields"]),te=function(e){if(!e||"function"!=typeof e)throw Error("You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop");return e};t.a=function(e){var t=e.deepEqual,n=e.empty,l=e.getIn,p=e.setIn,h=e.keys,y=e.fromJS,_=Object(R.a)(e);return function(R){var U=M({touchOnBlur:!0,touchOnChange:!1,persistentSubmitErrors:!1,destroyOnUnmount:!0,shouldAsyncValidate:E.a,shouldValidate:S.a,shouldError:x.a,shouldWarn:k.a,enableReinitialize:!1,keepDirtyOnReinitialize:!1,updateUnregisteredFields:!1,getFormState:function(e){return l(e,"form")},pure:!0,forceUnregisterOnUnmount:!1},R);return function(E){var S=function(n){function s(){var t,n,r,a;i(this,s);for(var u=arguments.length,c=Array(u),f=0;u>f;f++)c[f]=arguments[f];return n=r=o(this,(t=s.__proto__||Object.getPrototypeOf(s)).call.apply(t,[this].concat(c))),r.destroyed=!1,r.fieldCounts={},r.fieldValidators={},r.lastFieldValidatorKeys=[],r.fieldWarners={},r.lastFieldWarnerKeys=[],r.innerOnSubmit=void 0,r.submitPromise=void 0,r.getValues=function(){return r.props.values},r.isValid=function(){return r.props.valid},r.isPristine=function(){return r.props.pristine},r.register=function(e,t,n,i){r.fieldCounts[e]=(r.fieldCounts[e]||0)+1,r.props.registerField(e,t),n&&(r.fieldValidators[e]=n),i&&(r.fieldWarners[e]=i)},r.unregister=function(e){var t=r.fieldCounts[e];if(1===t?delete r.fieldCounts[e]:null!=t&&(r.fieldCounts[e]=t-1),!r.destroyed){var n=r.props,i=n.destroyOnUnmount,o=n.forceUnregisterOnUnmount,a=n.unregisterField;i||o?(a(e,i),r.fieldCounts[e]||(delete r.fieldValidators[e],delete r.fieldWarners[e])):a(e,!1)}},r.getFieldList=function(e){var t=r.props.registeredFields,n=[];if(!t)return n;var i=h(t);return e&&e.excludeFieldArray&&(i=i.filter(function(e){return"FieldArray"!==l(t,"['"+e+"'].type")})),y(i.reduce(function(e,t){return e.push(t),e},n))},r.getValidators=function(){var e={};return Object.keys(r.fieldValidators).forEach(function(t){var n=r.fieldValidators[t]();n&&(e[t]=n)}),e},r.generateValidator=function(){var t=r.getValidators();return Object.keys(t).length?Object(P.a)(t,e):void 0},r.getWarners=function(){var e={};return Object.keys(r.fieldWarners).forEach(function(t){var n=r.fieldWarners[t]();n&&(e[t]=n)}),e},r.generateWarner=function(){var t=r.getWarners();return Object.keys(t).length?Object(P.a)(t,e):void 0},r.asyncValidate=function(e,t,n){var i=r.props,o=i.asyncBlurFields,a=i.asyncChangeFields,u=i.asyncErrors,c=i.asyncValidate,s=i.dispatch,f=i.initialized,d=i.pristine,h=i.shouldAsyncValidate,v=i.startAsyncValidation,y=i.stopAsyncValidation,m=i.syncErrors,g=i.values,b=!e;if(c){var w=b?g:p(g,e,t),_=b||!l(m,e);if(function(){var t=o&&e&&~o.indexOf(e.replace(/\[[0-9]+\]/g,"[]")),r=a&&e&&~a.indexOf(e.replace(/\[[0-9]+\]/g,"[]")),i=!(o||a);return b||i||("blur"===n?t:r)}()&&h({asyncErrors:u,initialized:f,trigger:b?"submit":n,blurredField:e,pristine:d,syncValidationPasses:_}))return Object(O.a)(function(){return c(w,s,r.props,e)},v,y,e)}},r.submitCompleted=function(e){return delete r.submitPromise,e},r.submitFailed=function(e){throw delete r.submitPromise,e},r.listenToSubmit=function(e){return v()(e)?(r.submitPromise=e,e.then(r.submitCompleted,r.submitFailed)):e},r.submit=function(e){var t=r.props,n=t.onSubmit,i=t.blur,o=t.change,a=t.dispatch;return e&&!Object(j.a)(e)?Object(C.a)(function(){return!r.submitPromise&&r.listenToSubmit(Object(T.a)(te(e),M({},r.props,Object(w.a)({blur:i,change:o},a)),r.props.validExceptSubmit,r.asyncValidate,r.getFieldList({excludeFieldArray:!0})))}):r.submitPromise?void 0:r.innerOnSubmit&&r.innerOnSubmit!==r.submit?r.innerOnSubmit():r.listenToSubmit(Object(T.a)(te(n),M({},r.props,Object(w.a)({blur:i,change:o},a)),r.props.validExceptSubmit,r.asyncValidate,r.getFieldList({excludeFieldArray:!0})))},r.reset=function(){return r.props.reset()},a=n,o(r,a)}return a(s,n),N(s,[{key:"getChildContext",value:function(){var e=this;return{_reduxForm:M({},this.props,{getFormState:function(t){return l(e.props.getFormState(t),e.props.form)},asyncValidate:this.asyncValidate,getValues:this.getValues,sectionPrefix:void 0,register:this.register,unregister:this.unregister,registerInnerOnSubmit:function(t){return e.innerOnSubmit=t}})}}},{key:"initIfNeeded",value:function(e){var n=this.props.enableReinitialize;if(e){if((n||!e.initialized)&&!t(this.props.initialValues,e.initialValues)){var r=e.initialized&&this.props.keepDirtyOnReinitialize;this.props.initialize(e.initialValues,r,{lastInitialValues:this.props.initialValues,updateUnregisteredFields:e.updateUnregisteredFields})}}else!this.props.initialValues||this.props.initialized&&!n||this.props.initialize(this.props.initialValues,this.props.keepDirtyOnReinitialize,{updateUnregisteredFields:this.props.updateUnregisteredFields})}},{key:"updateSyncErrorsIfNeeded",value:function(e,t,n){var r=this.props,i=r.error,o=r.updateSyncErrors,a=!(n&&Object.keys(n).length||i),u=!(e&&Object.keys(e).length||t);a&&u||A.a.deepEqual(n,e)&&A.a.deepEqual(i,t)||o(e,t)}},{key:"clearSubmitPromiseIfNeeded",value:function(e){var t=this.props.submitting;this.submitPromise&&t&&!e.submitting&&delete this.submitPromise}},{key:"submitIfNeeded",value:function(e){var t=this.props,n=t.clearSubmit;!t.triggerSubmit&&e.triggerSubmit&&(n(),this.submit())}},{key:"validateIfNeeded",value:function(t){var n=this.props,r=n.shouldValidate,i=n.shouldError,o=n.validate,a=n.values,s=this.generateValidator();if(o||s){var l=void 0===t,f=Object.keys(this.getValidators()),p={values:a,nextProps:t,props:this.props,initialRender:l,lastFieldValidatorKeys:this.lastFieldValidatorKeys,fieldValidatorKeys:f,structure:e},d=r(p),h=i(p);if(d||h){var v=l||!t?this.props:t,y=Object(c.a)(o?o(v.values,v)||{}:{},s?s(v.values,v)||{}:{}),m=y._error,g=u(y,["_error"]);this.lastFieldValidatorKeys=f,this.updateSyncErrorsIfNeeded(g,m,v.syncErrors)}}else this.lastFieldValidatorKeys=[]}},{key:"updateSyncWarningsIfNeeded",value:function(e,t,n){var r=this.props,i=r.warning,o=r.syncWarnings,a=r.updateSyncWarnings,u=!(o&&Object.keys(o).length||i),c=!(e&&Object.keys(e).length||t);u&&c||A.a.deepEqual(n,e)&&A.a.deepEqual(i,t)||a(e,t)}},{key:"warnIfNeeded",value:function(t){var n=this.props,r=n.shouldValidate,i=n.shouldWarn,o=n.warn,a=n.values,s=this.generateWarner();if(o||s){var l=void 0===t,f=Object.keys(this.getWarners()),p={values:a,nextProps:t,props:this.props,initialRender:l,lastFieldValidatorKeys:this.lastFieldWarnerKeys,fieldValidatorKeys:f,structure:e},d=i(p);if(r(p)||d){var h=l||!t?this.props:t,v=Object(c.a)(o?o(h.values,h):{},s?s(h.values,h):{}),y=v._warning,m=u(v,["_warning"]);this.lastFieldWarnerKeys=f,this.updateSyncWarningsIfNeeded(m,y,h.syncWarnings)}}}},{key:"componentWillMount",value:function(){Object(I.a)()||(this.initIfNeeded(),this.validateIfNeeded(),this.warnIfNeeded()),d()(this.props.shouldValidate,"shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.")}},{key:"componentWillReceiveProps",value:function(e){this.initIfNeeded(e),this.validateIfNeeded(e),this.warnIfNeeded(e),this.clearSubmitPromiseIfNeeded(e),this.submitIfNeeded(e);var n=e.onChange,r=e.values,i=e.dispatch;n&&!t(r,this.props.values)&&n(r,i,e,this.props.values)}},{key:"shouldComponentUpdate",value:function(e){var n=this;if(!this.props.pure)return!0;var r=U.immutableProps,i=void 0===r?[]:r;return!!(this.props.children||e.children||Object.keys(e).some(function(r){return~i.indexOf(r)?n.props[r]!==e[r]:!~ee.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"componentDidMount",value:function(){Object(I.a)()||(this.initIfNeeded(),this.validateIfNeeded(),this.warnIfNeeded()),d()(this.props.shouldValidate,"shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.")}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.destroyOnUnmount,n=e.destroy;t&&!Object(I.a)()&&(this.destroyed=!0,n())}},{key:"render",value:function(){var e=this.props,t=e.anyTouched,n=e.array,i=e.asyncValidating,o=e.blur,a=e.change,c=e.clearSubmit,s=e.destroy,l=e.dirty,f=e.dispatch,p=e.error,d=e.form,h=e.initialize,v=e.initialized,y=e.initialValues,m=e.invalid,b=e.pristine,_=e.propNamespace,O=e.reset,S=e.submitting,x=e.submitFailed,k=e.submitSucceeded,j=e.touch,C=e.untouch,P=e.valid,T=e.warning,R=u(e,["anyTouched","array","arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","asyncErrors","asyncValidate","asyncValidating","blur","change","clearSubmit","destroy","destroyOnUnmount","forceUnregisterOnUnmount","dirty","dispatch","enableReinitialize","error","focus","form","getFormState","initialize","initialized","initialValues","invalid","keepDirtyOnReinitialize","updateUnregisteredFields","pristine","propNamespace","registeredFields","registerField","reset","setSubmitFailed","setSubmitSucceeded","shouldAsyncValidate","shouldValidate","shouldError","shouldWarn","startAsyncValidation","startSubmit","stopAsyncValidation","stopSubmit","submitting","submitFailed","submitSucceeded","touch","touchOnBlur","touchOnChange","persistentSubmitErrors","syncErrors","syncWarnings","unregisterField","untouch","updateSyncErrors","updateSyncWarnings","valid","validExceptSubmit","values","warning"]),A=M({array:n,anyTouched:t,asyncValidate:this.asyncValidate,asyncValidating:i},Object(w.a)({blur:o,change:a},f),{clearSubmit:c,destroy:s,dirty:l,dispatch:f,error:p,form:d,handleSubmit:this.submit,initialize:h,initialized:v,initialValues:y,invalid:m,pristine:b,reset:O,submitting:S,submitFailed:x,submitSucceeded:k,touch:j,untouch:C,valid:P,warning:T}),F=M({},_?r({},_,A):A,R);return D(E)&&(F.ref="wrapped"),Object(g.createElement)(E,F)}}]),s}(g.Component);S.displayName="Form("+Object(F.a)(E)+")",S.WrappedComponent=E,S.childContextTypes={_reduxForm:m.a.object.isRequired},S.propTypes={destroyOnUnmount:m.a.bool,forceUnregisterOnUnmount:m.a.bool,form:m.a.string.isRequired,initialValues:m.a.oneOfType([m.a.array,m.a.object]),getFormState:m.a.func,onSubmitFail:m.a.func,onSubmitSuccess:m.a.func,propNamespace:m.a.string,validate:m.a.func,warn:m.a.func,touchOnBlur:m.a.bool,touchOnChange:m.a.bool,triggerSubmit:m.a.bool,persistentSubmitErrors:m.a.bool,registeredFields:m.a.any};var x=Object(b.a)(function(e,r){var i=r.form,o=r.getFormState,a=r.initialValues,u=r.enableReinitialize,c=r.keepDirtyOnReinitialize,s=l(o(e)||n,i)||n,f=l(s,"initial"),p=!!f,d=u&&p&&!t(a,f),h=d&&!c,v=a||f||n;d&&(v=f||n);var y=l(s,"values")||v;h&&(y=v);var m=h||t(v,y),g=l(s,"asyncErrors"),b=l(s,"syncErrors")||{},w=l(s,"syncWarnings")||{},O=l(s,"registeredFields"),E=_(i,o,!1)(e),S=_(i,o,!0)(e),x=!!l(s,"anyTouched"),k=!!l(s,"submitting"),j=!!l(s,"submitFailed"),C=!!l(s,"submitSucceeded"),P=l(s,"error"),T=l(s,"warning"),R=l(s,"triggerSubmit");return{anyTouched:x,asyncErrors:g,asyncValidating:l(s,"asyncValidating")||!1,dirty:!m,error:P,initialized:p,invalid:!E,pristine:m,registeredFields:O,submitting:k,submitFailed:j,submitSucceeded:C,syncErrors:b,syncWarnings:w,triggerSubmit:R,values:y,valid:E,validExceptSubmit:S,warning:T}},function(e,t){var n=function(e){return e.bind(null,t.form)},r=Object(s.a)(X,n),i=Object(s.a)(Z,n),o=function(e,n){return G(t.form,e,n,!!t.touchOnBlur)},a=function(e,n){return Q(t.form,e,n,!!t.touchOnChange,!!t.persistentSubmitErrors)},u=n(J),c=Object(w.a)(r,e),l={insert:Object(w.a)(i.arrayInsert,e),move:Object(w.a)(i.arrayMove,e),pop:Object(w.a)(i.arrayPop,e),push:Object(w.a)(i.arrayPush,e),remove:Object(w.a)(i.arrayRemove,e),removeAll:Object(w.a)(i.arrayRemoveAll,e),shift:Object(w.a)(i.arrayShift,e),splice:Object(w.a)(i.arraySplice,e),swap:Object(w.a)(i.arraySwap,e),unshift:Object(w.a)(i.arrayUnshift,e)},f=M({},c,i,{blur:o,change:a,array:l,focus:u,dispatch:e});return function(){return f}},void 0,{withRef:!0}),k=f()(x(S),E);k.defaultProps=U;var R=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),N(t,[{key:"submit",value:function(){return this.ref&&this.ref.getWrappedInstance().submit()}},{key:"reset",value:function(){this.ref&&this.ref.getWrappedInstance().reset()}},{key:"render",value:function(){var e=this,t=this.props,n=t.initialValues,r=u(t,["initialValues"]);return Object(g.createElement)(k,M({},r,{ref:function(t){return e.ref=t},initialValues:y(n)}))}},{key:"valid",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isValid())}},{key:"invalid",get:function(){return!this.valid}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isPristine())}},{key:"dirty",get:function(){return!this.pristine}},{key:"values",get:function(){return this.ref?this.ref.getWrappedInstance().getValues():n}},{key:"fieldList",get:function(){return this.ref?this.ref.getWrappedInstance().getFieldList():[]}},{key:"wrappedInstance",get:function(){return this.ref&&this.ref.getWrappedInstance().refs.wrapped}}]),t}(g.Component);return f()(R,E)}}}},function(e,t,n){"use strict";var r=n(283),i=n(296);t.a=Object(i.a)(function(e,t,n){Object(r.a)(e,t,n)})},function(e,t,n){"use strict";function r(e,t,n,l,f){e!==t&&Object(a.a)(t,function(a,s){if(Object(c.a)(a))f||(f=new i.a),Object(u.a)(e,t,s,n,r,l,f);else{var p=l?l(e[s],a,s+"",e,t,f):void 0;void 0===p&&(p=a),Object(o.a)(e,s,p)}},s.a)}var i=n(38),o=n(93),a=n(87),u=n(284),c=n(5),s=n(94);t.a=r},function(e,t,n){"use strict";function r(e,t,n,r,g,b,w){var _=e[n],O=t[n],E=w.get(O);if(E)return void Object(i.a)(e,n,E);var S=b?b(_,O,n+"",e,t,w):void 0,x=void 0===S;if(x){var k=Object(l.a)(O),j=!k&&Object(p.a)(O),C=!k&&!j&&Object(y.a)(O);S=O,k||j||C?Object(l.a)(_)?S=_:Object(f.a)(_)?S=Object(u.a)(_):j?(x=!1,S=Object(o.a)(O,!0)):C?(x=!1,S=Object(a.a)(O,!0)):S=[]:Object(v.a)(O)||Object(s.a)(O)?(S=_,Object(s.a)(_)?S=Object(m.a)(_):(!Object(h.a)(_)||r&&Object(d.a)(_))&&(S=Object(c.a)(O))):x=!1}x&&(w.set(O,S),g(S,O,r,b,w),w.delete(O)),Object(i.a)(e,n,S)}var i=n(93),o=n(285),a=n(286),u=n(76),c=n(288),s=n(40),l=n(4),f=n(290),p=n(41),d=n(35),h=n(5),v=n(16),y=n(43),m=n(291);t.a=r},function(e,n,r){"use strict";(function(e){function i(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}var o=r(3),a="object"==typeof t&&t&&!t.nodeType&&t,u=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=u&&u.exports===a,s=c?o.a.Buffer:void 0,l=s?s.allocUnsafe:void 0;n.a=i}).call(n,r(24)(e))},function(e,t,n){"use strict";function r(e,t){return new e.constructor(t?Object(i.a)(e.buffer):e.buffer,e.byteOffset,e.length)}var i=n(287);t.a=r},function(e,t,n){"use strict";function r(e){var t=new e.constructor(e.byteLength);return new i.a(t).set(new i.a(e)),t}var i=n(82);t.a=r},function(e,t,n){"use strict";function r(e){return"function"!=typeof e.constructor||Object(a.a)(e)?{}:Object(i.a)(Object(o.a)(e))}var i=n(289),o=n(65),a=n(45);t.a=r},function(e,t,n){"use strict";var r=n(5),i=Object.create;t.a=function(){function e(){}return function(t){if(!Object(r.a)(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()},function(e,t,n){"use strict";function r(e){return Object(o.a)(e)&&Object(i.a)(e)}var i=n(25),o=n(6);t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(e,Object(o.a)(e))}var i=n(292),o=n(94);t.a=r},function(e,t,n){"use strict";function r(e,t,n,r){var a=!n;n||(n={});for(var u=-1,c=t.length;++u<c;){var s=t[u],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?Object(o.a)(n,s,l):Object(i.a)(n,s,l)}return n}var i=n(293),o=n(26);t.a=r},function(e,t,n){"use strict";function r(e,t,n){var r=e[t];u.call(e,t)&&Object(o.a)(r,n)&&(void 0!==n||t in e)||Object(i.a)(e,t,n)}var i=n(26),o=n(13),a=Object.prototype,u=a.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){if(!Object(i.a)(e))return Object(a.a)(e);var t=Object(o.a)(e),n=[];for(var r in e)("constructor"!=r||!t&&c.call(e,r))&&n.push(r);return n}var i=n(5),o=n(45),a=n(295),u=Object.prototype,c=u.hasOwnProperty;t.a=r},function(e,t,n){"use strict";function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.a=r},function(e,t,n){"use strict";function r(e){return Object(i.a)(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,u&&Object(o.a)(n[0],n[1],u)&&(a=3>i?void 0:a,i=1),t=Object(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t})}var i=n(297),o=n(304);t.a=r},function(e,t,n){"use strict";function r(e,t){return Object(a.a)(Object(o.a)(e,t,i.a),e+"")}var i=n(47),o=n(298),a=n(300);t.a=r},function(e,t,n){"use strict";function r(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,u=o(r.length-t,0),c=Array(u);++a<u;)c[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(c),Object(i.a)(e,this,s)}}var i=n(299),o=Math.max;t.a=r},function(e,t,n){"use strict";function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.a=r},function(e,t,n){"use strict";var r=n(301),i=n(303);t.a=Object(i.a)(r.a)},function(e,t,n){"use strict";var r=n(302),i=n(86),o=n(47);t.a=i.a?function(e,t){return Object(i.a)(e,"toString",{configurable:!0,enumerable:!1,value:Object(r.a)(t),writable:!0})}:o.a},function(e,t,n){"use strict";function r(e){return function(){return e}}t.a=r},function(e,t,n){"use strict";function r(e){var t=0,n=0;return function(){var r=a(),u=o-(r-n);if(n=r,u>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var i=800,o=16,a=Date.now;t.a=r},function(e,t,n){"use strict";function r(e,t,n){if(!Object(u.a)(n))return!1;var r=typeof t;return!!("number"==r?Object(o.a)(n)&&Object(a.a)(t,n.length):"string"==r&&t in n)&&Object(i.a)(n[t],e)}var i=n(13),o=n(25),a=n(42),u=n(5);t.a=r},function(e,t,n){"use strict";var r=n(49),i=n.n(r);t.a=function(e,t,n,r){t(r);var o=e();if(!i()(o))throw Error("asyncValidate function passed to reduxForm must return a promise");var a=function(e){return function(t){if(t&&Object.keys(t).length)return n(t),t;if(e)throw n(),Error("Asynchronous validation promise was rejected without errors.");return n(),Promise.resolve()}};return o.then(a(!1),a(!0))}},function(e,t,n){"use strict";var r=n(95);t.a=function(e){return function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;n>o;o++)i[o-1]=arguments[o];return Object(r.a)(t)?e.apply(void 0,i):e.apply(void 0,[t].concat(i))}}},function(e,t,n){"use strict";var r=n(0),i=function(e){return Array.isArray(e)?e:[e]},o=function(e,t,n,r,o){for(var a=i(r),u=0;a.length>u;u++){var c=a[u](e,t,n,o);if(c)return c}};t.a=function(e,t){var n=t.getIn;return function(t,i){var a={};return Object.keys(e).forEach(function(u){var c=n(t,u),s=o(c,t,i,e[u],u);s&&(a=r.a.setIn(a,u,s))}),a}}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(49),o=n.n(i),a=n(59),u=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(e,t,n,i,c){var s=t.dispatch,l=t.onSubmitFail,f=t.onSubmitSuccess,p=t.startSubmit,d=t.stopSubmit,h=t.setSubmitFailed,v=t.setSubmitSucceeded,y=t.syncErrors,m=t.asyncErrors,g=t.touch,b=t.values,w=t.persistentSubmitErrors;if(g.apply(void 0,r(c)),n||w){var _=function(){var n=void 0;try{n=e(b,s,t)}catch(e){var i=e instanceof a.a?e.errors:void 0;if(d(i),h.apply(void 0,r(c)),l&&l(i,s,e,t),i||l)return i;throw e}return o()(n)?(p(),n.then(function(e){try{return d(),v(),f&&f(e,s,t),e}catch(e){throw e}}).catch(function(e){var n=e instanceof a.a?e.errors:void 0;if(d(n),h.apply(void 0,r(c)),n&&l?l(n,s,e,t):void 0===n&&console.error(e),n||l)return n;throw e})):(v(),f&&f(n,s,t),n)},O=i&&i();return O?O.then(function(e){if(e)throw e;return _()}).catch(function(e){return h.apply(void 0,r(c)),l&&l(e,s,null,t),Promise.reject(e)}):_()}h.apply(void 0,r(c));var E=u({},m,y);return l&&l(E,s,null,t),E}},function(e,t,n){"use strict";t.a=function(e){return e.displayName||e.name||"Component"}},function(e,t,n){"use strict";(function(e){t.a=function(){return!(void 0===e||!e.hot||"function"!=typeof e.hot.status||"apply"!==e.hot.status())}}).call(t,n(24)(e))},function(e,t,n){"use strict";var r=n(312),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){function t(e){return e.plugin=function(e){var n=this;return t(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"NONE"},i=function(n,i){var o=p(n,i),a=e[i](o,r,p(t,i));return a!==o?d(n,i,a):n},o=n(t,r),a=r&&r.meta&&r.meta.form;return a?e[a]?i(o,a):o:Object.keys(e).reduce(i,o)})},e}var n,o=e.deepEqual,l=e.empty,f=e.forEach,p=e.getIn,d=e.setIn,h=e.deleteIn,v=e.fromJS,y=e.keys,m=e.size,g=e.some,b=e.splice,w=Object(u.a)(e),_=Object(u.a)(c.a),O=function(e,t,n,r,i,o,a){var u=p(e,t+"."+n);return u||a?d(e,t+"."+n,b(u,r,i,o)):e},E=function(e,t,n,r,i,o,a){var u=p(e,t),s=c.a.getIn(u,n);return s||a?d(e,t,c.a.setIn(u,n,c.a.splice(s,r,i,o))):e},S=["values","fields","submitErrors","asyncErrors"],x=function(e,t,n,r,i){var o=e,a=null!=i?l:void 0;return o=O(o,"values",t,n,r,i,!0),o=O(o,"fields",t,n,r,a),o=E(o,"syncErrors",t,n,r,void 0),o=E(o,"syncWarnings",t,n,r,void 0),o=O(o,"submitErrors",t,n,r,void 0),o=O(o,"asyncErrors",t,n,r,void 0)},k=(n={},r(n,a.ARRAY_INSERT,function(e,t){var n=t.meta;return x(e,n.field,n.index,0,t.payload)}),r(n,a.ARRAY_MOVE,function(e,t){var n=t.meta,r=n.field,i=n.from,o=n.to,a=p(e,"values."+r),u=a?m(a):0,c=e;return u&&S.forEach(function(e){var t=e+"."+r;if(p(c,t)){var n=p(c,t+"["+i+"]");c=d(c,t,b(p(c,t),i,1)),c=d(c,t,b(p(c,t),o,0,n))}}),c}),r(n,a.ARRAY_POP,function(e,t){var n=t.meta.field,r=p(e,"values."+n),i=r?m(r):0;return i?x(e,n,i-1,1):e}),r(n,a.ARRAY_PUSH,function(e,t){var n=t.meta.field,r=t.payload,i=p(e,"values."+n),o=i?m(i):0;return x(e,n,o,0,r)}),r(n,a.ARRAY_REMOVE,function(e,t){var n=t.meta;return x(e,n.field,n.index,1)}),r(n,a.ARRAY_REMOVE_ALL,function(e,t){var n=t.meta.field,r=p(e,"values."+n),i=r?m(r):0;return i?x(e,n,0,i):e}),r(n,a.ARRAY_SHIFT,function(e,t){return x(e,t.meta.field,0,1)}),r(n,a.ARRAY_SPLICE,function(e,t){var n=t.meta;return x(e,n.field,n.index,n.removeNum,t.payload)}),r(n,a.ARRAY_SWAP,function(e,t){var n=t.meta,r=n.field,i=n.indexA,o=n.indexB,a=e;return S.forEach(function(e){var t=p(a,e+"."+r+"["+i+"]"),n=p(a,e+"."+r+"["+o+"]");void 0===t&&void 0===n||(a=d(a,e+"."+r+"["+i+"]",n),a=d(a,e+"."+r+"["+o+"]",t))}),a}),r(n,a.ARRAY_UNSHIFT,function(e,t){return x(e,t.meta.field,0,0,t.payload)}),r(n,a.AUTOFILL,function(e,t){var n=t.meta.field,r=t.payload,i=e;return i=w(i,"asyncErrors."+n),i=w(i,"submitErrors."+n),i=d(i,"fields."+n+".autofilled",!0),i=d(i,"values."+n,r)}),r(n,a.BLUR,function(e,t){var n=t.meta,r=n.field,i=n.touch,o=t.payload,a=e;return void 0===p(a,"initial."+r)&&""===o?a=w(a,"values."+r):void 0!==o&&(a=d(a,"values."+r,o)),r===p(a,"active")&&(a=h(a,"active")),a=h(a,"fields."+r+".active"),i&&(a=d(a,"fields."+r+".touched",!0),a=d(a,"anyTouched",!0)),a}),r(n,a.CHANGE,function(e,t){var n=t.meta,r=n.field,i=n.touch,o=n.persistentSubmitErrors,a=t.payload,u=e;return void 0===p(u,"initial."+r)&&""===a?u=w(u,"values."+r):void 0!==a&&(u=d(u,"values."+r,a)),u=w(u,"asyncErrors."+r),o||(u=w(u,"submitErrors."+r)),u=w(u,"fields."+r+".autofilled"),i&&(u=d(u,"fields."+r+".touched",!0),u=d(u,"anyTouched",!0)),u}),r(n,a.CLEAR_SUBMIT,function(e){return h(e,"triggerSubmit")}),r(n,a.CLEAR_SUBMIT_ERRORS,function(e){var t=e;return t=w(t,"submitErrors"),t=h(t,"error")}),r(n,a.CLEAR_ASYNC_ERROR,function(e,t){return h(e,"asyncErrors."+t.meta.field)}),r(n,a.CLEAR_FIELDS,function(e,t){var n=t.meta,r=n.keepTouched,i=n.persistentSubmitErrors,o=n.fields,a=e;o.forEach(function(e){a=w(a,"values."+e),a=w(a,"asyncErrors."+e),i||(a=w(a,"submitErrors."+e)),a=w(a,"fields."+e+".autofilled"),r||(a=h(a,"fields."+e+".touched"))});var u=g(y(p(a,"registeredFields")),function(e){return p(a,"fields."+e+".touched")});return a=u?d(a,"anyTouched",!0):h(a,"anyTouched")}),r(n,a.FOCUS,function(e,t){var n=t.meta.field,r=e,i=p(e,"active");return r=h(r,"fields."+i+".active"),r=d(r,"fields."+n+".visited",!0),r=d(r,"fields."+n+".active",!0),r=d(r,"active",n)}),r(n,a.INITIALIZE,function(e,t){var n=t.payload,r=t.meta,i=r.keepDirty,a=r.keepSubmitSucceeded,u=r.updateUnregisteredFields,c=v(n),s=l,h=p(e,"warning");h&&(s=d(s,"warning",h));var m=p(e,"syncWarnings");m&&(s=d(s,"syncWarnings",m));var g=p(e,"error");g&&(s=d(s,"error",g));var b=p(e,"syncErrors");b&&(s=d(s,"syncErrors",b));var w=p(e,"registeredFields");w&&(s=d(s,"registeredFields",w));var _=p(e,"values"),O=p(e,"initial"),E=c,S=_;if(i&&w){if(!o(E,O)){var x=function(e){var t=p(O,e),n=p(_,e);if(o(n,t)){var r=p(E,e);p(S,e)!==r&&(S=d(S,e,r))}};u||f(y(w),function(e){return x(e)}),f(y(E),function(e){if(void 0===p(O,e)){var t=p(E,e);S=d(S,e,t)}u&&x(e)})}}else S=E;return a&&p(e,"submitSucceeded")&&(s=d(s,"submitSucceeded",!0)),s=d(s,"values",S),s=d(s,"initial",E)}),r(n,a.REGISTER_FIELD,function(e,t){var n=t.payload,r=n.name,i=n.type,o="registeredFields['"+r+"']",a=p(e,o);if(a){var u=p(a,"count")+1;a=d(a,"count",u)}else a=v({name:r,type:i,count:1});return d(e,o,a)}),r(n,a.RESET,function(e){var t=l,n=p(e,"registeredFields");n&&(t=d(t,"registeredFields",n));var r=p(e,"initial");return r&&(t=d(t,"values",r),t=d(t,"initial",r)),t}),r(n,a.SUBMIT,function(e){return d(e,"triggerSubmit",!0)}),r(n,a.START_ASYNC_VALIDATION,function(e,t){return d(e,"asyncValidating",t.meta.field||!0)}),r(n,a.START_SUBMIT,function(e){return d(e,"submitting",!0)}),r(n,a.STOP_ASYNC_VALIDATION,function(e,t){var n=t.payload,r=e;if(r=h(r,"asyncValidating"),n&&Object.keys(n).length){var o=n._error,a=i(n,["_error"]);o&&(r=d(r,"error",o)),Object.keys(a).length&&(r=d(r,"asyncErrors",v(a)))}else r=h(r,"error");return r}),r(n,a.STOP_SUBMIT,function(e,t){var n=t.payload,r=e;if(r=h(r,"submitting"),r=h(r,"submitFailed"),r=h(r,"submitSucceeded"),n&&Object.keys(n).length){var o=n._error,a=i(n,["_error"]);r=o?d(r,"error",o):h(r,"error"),r=Object.keys(a).length?d(r,"submitErrors",v(a)):h(r,"submitErrors"),r=d(r,"submitFailed",!0)}else r=d(r,"submitSucceeded",!0),r=h(r,"error"),r=h(r,"submitErrors");return r}),r(n,a.SET_SUBMIT_FAILED,function(e,t){var n=t.meta.fields,r=e;return r=d(r,"submitFailed",!0),r=h(r,"submitSucceeded"),r=h(r,"submitting"),n.forEach(function(e){return r=d(r,"fields."+e+".touched",!0)}),n.length&&(r=d(r,"anyTouched",!0)),r}),r(n,a.SET_SUBMIT_SUCCEEDED,function(e){var t=e;return t=h(t,"submitFailed"),t=d(t,"submitSucceeded",!0)}),r(n,a.TOUCH,function(e,t){var n=t.meta.fields,r=e;return n.forEach(function(e){return r=d(r,"fields."+e+".touched",!0)}),r=d(r,"anyTouched",!0)}),r(n,a.UNREGISTER_FIELD,function(e,t){var n=t.payload,r=n.name,i=n.destroyOnUnmount,a=e,u="registeredFields['"+r+"']",s=p(a,u);if(!s)return a;var f=p(s,"count")-1;if(0>=f&&i){a=h(a,u),o(p(a,"registeredFields"),l)&&(a=h(a,"registeredFields"));var v=p(a,"syncErrors");v&&(v=_(v,r),a=c.a.deepEqual(v,c.a.empty)?h(a,"syncErrors"):d(a,"syncErrors",v));var y=p(a,"syncWarnings");y&&(y=_(y,r),a=c.a.deepEqual(y,c.a.empty)?h(a,"syncWarnings"):d(a,"syncWarnings",y)),a=w(a,"submitErrors."+r),a=w(a,"asyncErrors."+r)}else s=d(s,"count",f),a=d(a,u,s);return a}),r(n,a.UNTOUCH,function(e,t){var n=t.meta.fields,r=e;n.forEach(function(e){return r=h(r,"fields."+e+".touched")});var i=g(y(p(r,"registeredFields")),function(e){return p(r,"fields."+e+".touched")});return r=i?d(r,"anyTouched",!0):h(r,"anyTouched")}),r(n,a.UPDATE_SYNC_ERRORS,function(e,t){var n=t.payload,r=n.syncErrors,i=n.error,o=e;return i?(o=d(o,"error",i),o=d(o,"syncError",!0)):(o=h(o,"error"),o=h(o,"syncError")),o=Object.keys(r).length?d(o,"syncErrors",r):h(o,"syncErrors")}),r(n,a.UPDATE_SYNC_WARNINGS,function(e,t){var n=t.payload,r=n.syncWarnings,i=n.warning,o=e;return o=i?d(o,"warning",i):h(o,"warning"),o=Object.keys(r).length?d(o,"syncWarnings",r):h(o,"syncWarnings")}),n),j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments[1],n=k[t.type];return n?n(e,t):e};return t(function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"NONE"},r=n&&n.meta&&n.meta.form;if(!r||!s(n))return t;if(n.type===a.DESTROY&&n.meta&&n.meta.form)return n.meta.form.reduce(function(e,t){return w(e,t)},t);var i=p(t,r),o=e(i,n);return o===i?t:d(t,r,o)}}(j))}var a=n(31),u=n(313),c=n(0),s=function(e){return e&&e.type&&e.type.length>a.prefix.length&&e.type.substring(0,a.prefix.length)===a.prefix};t.a=o},function(e,t,n){"use strict";function r(e){var t=e.deepEqual,n=e.empty,r=e.getIn,o=e.deleteIn,a=e.setIn;return function e(u,c){if("]"===c[c.length-1]){var s=Object(i.a)(c);return s.pop(),r(u,s.join("."))?a(u,c):u}var l=u;void 0!==r(u,c)&&(l=o(u,c));var f=c.lastIndexOf(".");if(f>0){var p=c.substring(0,f);if("]"!==p[p.length-1]){var d=r(l,p);if(t(d,n))return e(l,p)}}return l}}var i=n(18);t.a=r},function(e,t,n){"use strict";var r=n(315),i=n(0);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(9),o=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.a=function(e){var t=e.getIn;return function(e){var n=o({prop:"values",getFormState:function(e){return t(e,"form")}},e),a=n.form,u=n.prop,c=n.getFormState;return Object(i.a)(function(e){return r({},u,t(c(e),a+".values"))})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(){var e=p.default.getJSON(d);return e?Promise.resolve(e):new Promise(function(e){fetch("https://raw.githubusercontent.com/erikras/redux-form/master/docs/sponsor.json").then(function(t){t.json().then(function(t){e(t),p.default.set(d,t,{expires:.04,path:"/"})})})})}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),l=r(s),f=n(317),p=r(f),d="$$$$$$$$";t.default=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={loaded:!1},e}return a(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this;u().then(function(t){e.setState({loaded:!0,id:t.id,copy:t.copy})})}},{key:"render",value:function(){var e=this.state,t=e.loaded,n=e.id,r=e.copy;return t?l.default.createElement("div",{className:"benevolent-sponsor"},l.default.createElement("img",{src:"https://codesponsor.io/t/l/"+n+"/pixel.png",style:{position:"absolute",bottom:0,right:0},alt:"pixel",width:"1",height:"1"}),l.default.createElement("a",{target:"_blank",href:"https://codesponsor.io/t/c/"+n+"/",dangerouslySetInnerHTML:{__html:r}})):l.default.createElement("div",null)}}]),t}(l.default.Component)},function(e,t,n){var r,i;!function(o){if(r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i),!0,e.exports=o(),!!0){var a=window.Cookies,u=window.Cookies=o();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function e(){for(var e=0,t={};arguments.length>e;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(n){function r(t,i,o){var a;if("undefined"!=typeof document){if(arguments.length>1){if(o=e({path:"/"},r.defaults,o),"number"==typeof o.expires){var u=new Date;u.setMilliseconds(u.getMilliseconds()+864e5*o.expires),o.expires=u}o.expires=o.expires?o.expires.toUTCString():"";try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(i+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(t+""),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape);var c="";for(var s in o)o[s]&&(c+="; "+s,!0!==o[s]&&(c+="="+o[s]));return document.cookie=t+"="+i+c}t||(a={});for(var l=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,p=0;l.length>p;p++){var d=l[p].split("="),h=d.slice(1).join("=");this.json||'"'!==h.charAt(0)||(h=h.slice(1,-1));try{var v=d[0].replace(f,decodeURIComponent);if(h=n.read?n.read(h,v):n(h,v)||h.replace(f,decodeURIComponent),this.json)try{h=JSON.parse(h)}catch(e){}if(t===v){a=h;break}t||(a[v]=h)}catch(e){}}return a}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}return t(function(){})})}])})},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(10),c=(n.n(u),n(13)),s=n.n(c),l=n(38),f=n(205),p=n(211),d=n(615),h=n(3),v=n(213),y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b=["_reduxForm"],w=function(e){return e&&"object"===(void 0===e?"undefined":g(e))},_=function(e){return e&&"function"==typeof e},O=function(e){w(e)&&_(e.preventDefault)&&e.preventDefault()},E=function(e,t){if(w(e)&&w(e.dataTransfer)&&_(e.dataTransfer.getData))return e.dataTransfer.getData(t)},S=function(e,t,n){w(e)&&w(e.dataTransfer)&&_(e.dataTransfer.setData)&&e.dataTransfer.setData(t,n)},x=function(e){var t=e.deepEqual,c=e.getIn,g=function(e,t){var n=h.a.getIn(e,t);return n&&n._error?n._error:n},w=function(e,t){var n=c(e,t);return n&&n._warning?n._warning:n},_=function(c){function s(){var e,t,r,a;i(this,s);for(var u=arguments.length,c=Array(u),l=0;l<u;l++)c[l]=arguments[l];return t=r=o(this,(e=s.__proto__||Object.getPrototypeOf(s)).call.apply(e,[this].concat(c))),r.saveRef=function(e){return r.ref=e},r.isPristine=function(){return r.props.pristine},r.getValue=function(){return r.props.value},r.handleChange=function(e){var t=r.props,i=t.name,o=t.dispatch,a=t.parse,u=t.normalize,c=t.onChange,s=t._reduxForm,l=t.value,f=n.i(p.a)(e,{name:i,parse:a,normalize:u}),d=!1;c&&(v.a?c(e,f,l,i):c(y({},e,{preventDefault:function(){return d=!0,O(e)}}),f,l,i)),d||(o(s.change(i,f)),s.asyncValidate&&s.asyncValidate(i,f,"change"))},r.handleFocus=function(e){var t=r.props,n=t.name,i=t.dispatch,o=t.onFocus,a=t._reduxForm,u=!1;o&&(v.a?o(e,n):o(y({},e,{preventDefault:function(){return u=!0,O(e)}}),n)),u||i(a.focus(n))},r.handleBlur=function(e){var t=r.props,i=t.name,o=t.dispatch,a=t.parse,u=t.normalize,c=t.onBlur,s=t._reduxForm,l=t._value,f=t.value,d=n.i(p.a)(e,{name:i,parse:a,normalize:u});d===l&&void 0!==l&&(d=f);var h=!1;c&&(v.a?c(e,d,f,i):c(y({},e,{preventDefault:function(){return h=!0,O(e)}}),d,f,i)),h||(o(s.blur(i,d)),s.asyncValidate&&s.asyncValidate(i,d,"blur"))},r.handleDragStart=function(e){var t=r.props,n=t.name,i=t.onDragStart,o=t.value;S(e,d.a,null==o?"":o),i&&i(e,n)},r.handleDrop=function(e){var t=r.props,n=t.name,i=t.dispatch,o=t.onDrop,a=t._reduxForm,u=t.value,c=E(e,d.a),s=!1;o&&o(y({},e,{preventDefault:function(){return s=!0,O(e)}}),c,u,n),s||(i(a.change(n,c)),O(e))},a=t,o(r,a)}return a(s,c),m(s,[{key:"shouldComponentUpdate",value:function(e){var n=this,r=Object.keys(e),i=Object.keys(this.props);return!!(this.props.children||e.children||r.length!==i.length||r.some(function(r){return~(e.immutableProps||[]).indexOf(r)?n.props[r]!==e[r]:!~b.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"getRenderedComponent",value:function(){return this.ref}},{key:"render",value:function(){var t=this.props,i=t.component,o=t.withRef,a=t.name,c=t._reduxForm,s=(t.normalize,t.onBlur,t.onChange,t.onFocus,t.onDragStart,t.onDrop,t.immutableProps,r(t,["component","withRef","name","_reduxForm","normalize","onBlur","onChange","onFocus","onDragStart","onDrop","immutableProps"])),l=n.i(f.a)(e,a,y({},s,{form:c.form,onBlur:this.handleBlur,onChange:this.handleChange,onDrop:this.handleDrop,onDragStart:this.handleDragStart,onFocus:this.handleFocus})),p=l.custom,d=r(l,["custom"]);if(o&&(p.ref=this.saveRef),"string"==typeof i){var h=d.input;d.meta;return n.i(u.createElement)(i,y({},h,p))}return n.i(u.createElement)(i,y({},d,p))}}]),s}(u.Component);return _.propTypes={component:s.a.oneOfType([s.a.func,s.a.string,s.a.node]).isRequired,props:s.a.object},n.i(l.connect)(function(e,n){var r=n.name,i=n._reduxForm,o=i.initialValues,a=i.getFormState,u=a(e),s=c(u,"initial."+r),l=void 0!==s?s:o&&c(o,r),f=c(u,"values."+r),p=c(u,"submitting"),d=g(c(u,"syncErrors"),r),h=w(c(u,"syncWarnings"),r),v=t(f,l);return{asyncError:c(u,"asyncErrors."+r),asyncValidating:c(u,"asyncValidating")===r,dirty:!v,pristine:v,state:c(u,"fields."+r),submitError:c(u,"submitErrors."+r),submitFailed:c(u,"submitFailed"),submitting:p,syncError:d,syncWarning:h,initial:l,value:f,_value:n.value}},void 0,void 0,{withRef:!0})(_)};t.a=x},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(135),c=n(10),s=(n.n(c),n(13)),l=n.n(s),f=n(38),p=n(95),d=n(559),h=n(3),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=["_reduxForm","value"],m=function(e){var t=e.deepEqual,s=e.getIn,m=e.size,g=function(e,t){return h.a.getIn(e,t+"._error")},b=function(e,t){return s(e,t+"._warning")},w=function(u){function l(){var e,t,n,r;i(this,l);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return t=n=o(this,(e=l.__proto__||Object.getPrototypeOf(l)).call.apply(e,[this].concat(u))),n.saveRef=function(e){n.ref=e},n.getValue=function(e){return n.props.value&&s(n.props.value,String(e))},r=t,o(n,r)}return a(l,u),v(l,[{key:"shouldComponentUpdate",value:function(e){var n=this,r=this.props.value,i=e.value;if(r&&i){var o=i.every(function(e){return~r.indexOf(e)}),a=i.some(function(e,t){return e!==r[t]});if(r.length!==i.length||o&&a||e.rerenderOnEveryChange&&r.some(function(e,n){return!t(e,i[n])}))return!0}var u=Object.keys(e),c=Object.keys(this.props);return!!(this.props.children||e.children||u.length!==c.length||u.some(function(r){return!~y.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"getRenderedComponent",value:function(){return this.ref}},{key:"render",value:function(){var t=this.props,i=t.component,o=t.withRef,a=t.name,u=t._reduxForm,s=(t.validate,t.warn,t.rerenderOnEveryChange,r(t,["component","withRef","name","_reduxForm","validate","warn","rerenderOnEveryChange"])),l=n.i(d.a)(e,a,u.form,u.sectionPrefix,this.getValue,s);return o&&(l.ref=this.saveRef),c.createElement(i,l)}},{key:"dirty",get:function(){return this.props.dirty}},{key:"pristine",get:function(){return this.props.pristine}},{key:"value",get:function(){return this.props.value}}]),l}(c.Component);return w.propTypes={component:l.a.oneOfType([l.a.func,l.a.string,l.a.node]).isRequired,props:l.a.object,rerenderOnEveryChange:l.a.bool},w.defaultProps={rerenderOnEveryChange:!1},w.contextTypes={_reduxForm:l.a.object},n.i(f.connect)(function(e,n){var r=n.name,i=n._reduxForm,o=i.initialValues,a=i.getFormState,u=a(e),c=s(u,"initial."+r)||o&&s(o,r),l=s(u,"values."+r),f=s(u,"submitting"),p=g(s(u,"syncErrors"),r),d=b(s(u,"syncWarnings"),r),h=t(l,c);return{asyncError:s(u,"asyncErrors."+r+"._error"),dirty:!h,pristine:h,state:s(u,"fields."+r),submitError:s(u,"submitErrors."+r+"._error"),submitFailed:s(u,"submitFailed"),submitting:f,syncError:p,syncWarning:d,value:l,length:m(l)}},function(e,t){var r=t.name,i=t._reduxForm,o=i.arrayInsert,a=i.arrayMove,c=i.arrayPop,s=i.arrayPush,l=i.arrayRemove,f=i.arrayRemoveAll,d=i.arrayShift,h=i.arraySplice,v=i.arraySwap,y=i.arrayUnshift;return n.i(u.a)({arrayInsert:o,arrayMove:a,arrayPop:c,arrayPush:s,arrayRemove:l,arrayRemoveAll:f,arrayShift:d,arraySplice:h,arraySwap:v,arrayUnshift:y},function(t){return n.i(p.bindActionCreators)(t.bind(null,r),e)})},void 0,{withRef:!0})(w)};t.a=m},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(10),c=(n.n(u),n(13)),s=n.n(c),l=n(38),f=n(205),p=n(3),d=n(211),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=["_reduxForm"],m=function(e){var t=e.deepEqual,c=e.getIn,m=e.size,g=function(e,t){return p.a.getIn(e,t+"._error")||p.a.getIn(e,t)},b=function(e,t){var n=c(e,t);return n&&n._warning?n._warning:n},w=function(c){function s(e){i(this,s);var t=o(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,e));return t.onChangeFns={},t.onFocusFns={},t.onBlurFns={},t.prepareEventHandlers=function(e){return e.names.forEach(function(e){t.onChangeFns[e]=function(n){return t.handleChange(e,n)},t.onFocusFns[e]=function(){return t.handleFocus(e)},t.onBlurFns[e]=function(n){return t.handleBlur(e,n)}})},t.handleChange=function(e,r){var i=t.props,o=i.dispatch,a=i.parse,u=i._reduxForm,c=n.i(d.a)(r,{name:e,parse:a});o(u.change(e,c)),u.asyncValidate&&u.asyncValidate(e,c,"change")},t.handleFocus=function(e){var n=t.props;(0,n.dispatch)(n._reduxForm.focus(e))},t.handleBlur=function(e,r){var i=t.props,o=i.dispatch,a=i.parse,u=i._reduxForm,c=n.i(d.a)(r,{name:e,parse:a});o(u.blur(e,c)),u.asyncValidate&&u.asyncValidate(e,c,"blur")},t.saveRef=function(e){t.ref=e},t.prepareEventHandlers(e),t}return a(s,c),v(s,[{key:"componentWillReceiveProps",value:function(e){var t=this;this.props.names===e.names||m(this.props.names)===m(e.names)&&!e.names.some(function(e){return!t.props._fields[e]})||this.prepareEventHandlers(e)}},{key:"shouldComponentUpdate",value:function(e){var n=this,r=Object.keys(e),i=Object.keys(this.props);return!!(this.props.children||e.children||r.length!==i.length||r.some(function(r){return!~y.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"isDirty",value:function(){var e=this.props._fields;return Object.keys(e).some(function(t){return e[t].dirty})}},{key:"getValues",value:function(){var e=this.props._fields;return Object.keys(e).reduce(function(t,n){return p.a.setIn(t,n,e[n].value)},{})}},{key:"getRenderedComponent",value:function(){return this.ref}},{key:"render",value:function(){var t=this,i=this.props,o=i.component,a=i.withRef,c=i._fields,s=i._reduxForm,l=r(i,["component","withRef","_fields","_reduxForm"]),d=s.sectionPrefix,v=s.form,y=Object.keys(c).reduce(function(i,o){var a=c[o],u=n.i(f.a)(e,o,h({},a,l,{form:v,onBlur:t.onBlurFns[o],onChange:t.onChangeFns[o],onFocus:t.onFocusFns[o]})),s=u.custom,y=r(u,["custom"]);i.custom=s;var m=d?o.replace(d+".",""):o;return p.a.setIn(i,m,y)},{}),m=y.custom,g=r(y,["custom"]);return a&&(g.ref=this.saveRef),u.createElement(o,h({},g,m))}}]),s}(u.Component);return w.propTypes={component:s.a.oneOfType([s.a.func,s.a.string,s.a.node]).isRequired,_fields:s.a.object.isRequired,props:s.a.object},n.i(l.connect)(function(e,t){var n=t.names,r=t._reduxForm,i=r.initialValues,o=r.getFormState,a=o(e);return{_fields:n.reduce(function(e,n){var r=c(a,"initial."+n),o=void 0!==r?r:i&&c(i,n),u=c(a,"values."+n),s=g(c(a,"syncErrors"),n),l=b(c(a,"syncWarnings"),n),f=c(a,"submitting"),p=u===o;return e[n]={asyncError:c(a,"asyncErrors."+n),asyncValidating:c(a,"asyncValidating")===n,dirty:!p,initial:o,pristine:p,state:c(a,"fields."+n),submitError:c(a,"submitErrors."+n),submitFailed:c(a,"submitFailed"),submitting:f,syncError:s,syncWarning:l,value:u,_value:t.value},e},{})}},void 0,void 0,{withRef:!0})(w)};t.a=m},function(e,t,n){"use strict";var r=n(557),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(558),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(560),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(10),u=n.n(a),c=n(13),s=n.n(c),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=function(e){function t(e,n){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(!n._reduxForm)throw new Error("Form must be inside a component decorated with reduxForm()");return o}return o(t,e),l(t,[{key:"UNSAFE_componentWillMount",value:function(){this.context._reduxForm.registerInnerOnSubmit(this.props.onSubmit)}},{key:"render",value:function(){return u.a.createElement("form",this.props)}}]),t}(a.Component);f.propTypes={onSubmit:s.a.func.isRequired},f.contextTypes={_reduxForm:s.a.object},t.a=f},function(e,t,n){"use strict";var r=n(10),i=(n.n(r),n(13)),o=n.n(i),a=function(e,t){var n=e.children,r=t._reduxForm;return n({form:r&&r.form})};a.contextTypes={_reduxForm:o.a.shape({form:o.a.string.isRequired}).isRequired},t.a=a},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(10),c=n.n(u),s=n(13),l=n.n(s),f=n(63),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(!n._reduxForm)throw new Error("FormSection must be inside a component decorated with reduxForm()");return r}return a(t,e),d(t,[{key:"getChildContext",value:function(){var e=this.context,t=this.props.name;return{_reduxForm:p({},e._reduxForm,{sectionPrefix:n.i(f.a)(e,t)})}}},{key:"render",value:function(){var e=this.props,t=e.children,i=(e.name,e.component),o=r(e,["children","name","component"]);return c.a.isValidElement(t)?t:n.i(u.createElement)(i,p({},o,{children:t}))}}]),t}(u.Component);h.propTypes={name:l.a.string.isRequired,component:l.a.oneOfType([l.a.func,l.a.string,l.a.node])},h.defaultProps={component:"div"},h.childContextTypes={_reduxForm:l.a.object.isRequired},h.contextTypes={_reduxForm:l.a.object},t.a=h},function(e,t,n){"use strict";var r=n(125),i=n.n(r),o=function(e,t,n,r){t(r);var o=e();if(!i()(o))throw new Error("asyncValidate function passed to reduxForm must return a promise");var a=function(e){return function(t){if(e){if(t&&Object.keys(t).length)return n(t),t;throw n(),new Error("Asynchronous validation promise was rejected without errors.")}return n(),Promise.resolve()}};return o.then(a(!1),a(!0))};t.a=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(10),u=(n.n(a),n(13)),c=n.n(u),s=n(55),l=n.n(s),f=n(547),p=n(215),d=n(63),h=n(3),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=function(e){var t=n.i(f.a)(e),u=e.setIn,s=function(e){function c(e,t){r(this,c);var n=i(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,e,t));if(n.saveRef=function(e){return n.ref=e},n.normalize=function(e,t){var r=n.props.normalize;if(!r)return t;var i=n.context._reduxForm.getValues();return r(t,n.value,u(i,e,t),i)},!t._reduxForm)throw new Error("Field must be inside a component decorated with reduxForm()");return n}return o(c,e),y(c,[{key:"shouldComponentUpdate",value:function(e,t){return n.i(p.a)(this,e,t)}},{key:"UNSAFE_componentWillMount",value:function(){var e=this;this.context._reduxForm.register(this.name,"Field",function(){return e.props.validate},function(){return e.props.warn})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e,t){var r=n.i(d.a)(this.context,this.props.name),i=n.i(d.a)(t,e.name);r===i&&h.a.deepEqual(this.props.validate,e.validate)&&h.a.deepEqual(this.props.warn,e.warn)||(this.context._reduxForm.unregister(r),this.context._reduxForm.register(i,"Field",function(){return e.validate},function(){return e.warn}))}},{key:"componentWillUnmount",value:function(){this.context._reduxForm.unregister(this.name)}},{key:"getRenderedComponent",value:function(){return l()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to Field"),this.ref?this.ref.getWrappedInstance().getRenderedComponent():void 0}},{key:"render",value:function(){return n.i(a.createElement)(t,v({},this.props,{name:this.name,normalize:this.normalize,_reduxForm:this.context._reduxForm,ref:this.saveRef}))}},{key:"name",get:function(){return n.i(d.a)(this.context,this.props.name)}},{key:"dirty",get:function(){return!this.pristine}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isPristine())}},{key:"value",get:function(){return this.ref&&this.ref.getWrappedInstance().getValue()}}]),c}(a.Component);return s.propTypes={name:c.a.string.isRequired,component:c.a.oneOfType([c.a.func,c.a.string,c.a.node]).isRequired,format:c.a.func,normalize:c.a.func,onBlur:c.a.func,onChange:c.a.func,onFocus:c.a.func,onDragStart:c.a.func,onDrop:c.a.func,parse:c.a.func,props:c.a.object,validate:c.a.oneOfType([c.a.func,c.a.arrayOf(c.a.func)]),warn:c.a.oneOfType([c.a.func,c.a.arrayOf(c.a.func)]),withRef:c.a.bool,immutableProps:c.a.arrayOf(c.a.string)},s.contextTypes={_reduxForm:c.a.object},s};t.a=m},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=n(10),c=(n.n(u),n(13)),s=n.n(c),l=n(55),f=n.n(l),p=n(548),d=n(63),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=function(e){return Array.isArray(e)?e:[e]},m=function(e,t){return e&&function(){for(var n=y(e),r=0;r<n.length;r++){var i=n[r].apply(n,arguments);if(i)return a({},t,i)}}},g=function(e){var t=n.i(p.a)(e),a=function(e){function a(e,t){r(this,a);var n=i(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e,t));if(n.saveRef=function(e){n.ref=e},!t._reduxForm)throw new Error("FieldArray must be inside a component decorated with reduxForm()");return n}return o(a,e),v(a,[{key:"UNSAFE_componentWillMount",value:function(){var e=this;this.context._reduxForm.register(this.name,"FieldArray",function(){return m(e.props.validate,"_error")},function(){return m(e.props.warn,"_warning")})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e,t){var r=n.i(d.a)(this.context,this.props.name),i=n.i(d.a)(t,e.name);r!==i&&(this.context._reduxForm.unregister(r),this.context._reduxForm.register(i,"FieldArray"))}},{key:"componentWillUnmount",value:function(){this.context._reduxForm.unregister(this.name)}},{key:"getRenderedComponent",value:function(){return f()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to FieldArray"),this.ref&&this.ref.getWrappedInstance().getRenderedComponent()}},{key:"render",value:function(){return n.i(u.createElement)(t,h({},this.props,{name:this.name,_reduxForm:this.context._reduxForm,ref:this.saveRef}))}},{key:"name",get:function(){return n.i(d.a)(this.context,this.props.name)}},{key:"dirty",get:function(){return!this.ref||this.ref.getWrappedInstance().dirty}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().pristine)}},{key:"value",get:function(){return this.ref?this.ref.getWrappedInstance().value:void 0}}]),a}(u.Component);return a.propTypes={name:s.a.string.isRequired,component:s.a.oneOfType([s.a.func,s.a.string,s.a.node]).isRequired,props:s.a.object,validate:s.a.oneOfType([s.a.func,s.a.arrayOf(s.a.func)]),warn:s.a.oneOfType([s.a.func,s.a.arrayOf(s.a.func)]),withRef:s.a.bool},a.contextTypes={_reduxForm:s.a.object},a};t.a=g},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t,n,o,a,u){var c=e.getIn,s=u.arrayInsert,l=u.arrayMove,f=u.arrayPop,p=u.arrayPush,d=u.arrayRemove,h=u.arrayRemoveAll,v=u.arrayShift,y=(u.arraySplice,u.arraySwap),m=u.arrayUnshift,g=u.asyncError,b=u.dirty,w=u.length,_=u.pristine,O=u.submitError,E=(u.state,u.submitFailed),S=u.submitting,x=u.syncError,k=u.syncWarning,j=u.value,C=u.props,P=r(u,["arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","asyncError","dirty","length","pristine","submitError","state","submitFailed","submitting","syncError","syncWarning","value","props"]),T=x||g||O,R=k,A=o?t.replace(o+".",""):t,F=i({fields:{_isFieldArray:!0,forEach:function(e){return(j||[]).forEach(function(t,n){return e(A+"["+n+"]",n,F.fields)})},get:a,getAll:function(){return j},insert:s,length:w,map:function(e){return(j||[]).map(function(t,n){return e(A+"["+n+"]",n,F.fields)})},move:l,name:t,pop:function(){return f(),c(j,String(w-1))},push:p,reduce:function(e,t){return(j||[]).reduce(function(t,n,r){return e(t,A+"["+r+"]",r,F.fields)},t)},remove:d,removeAll:h,shift:function(){return v(),c(j,"0")},swap:y,unshift:m},meta:{dirty:b,error:T,form:n,warning:R,invalid:!!T,pristine:_,submitting:S,submitFailed:E,valid:!T}},C,P);return F};t.a=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(10),u=(n.n(a),n(13)),c=n.n(u),s=n(55),l=n.n(s),f=n(549),p=n(215),d=n(3),h=n(63),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=function(e){return e?Array.isArray(e)||e._isFieldArray?void 0:new Error('Invalid prop "names" supplied to <Fields/>. Must be either an array of strings or the fields array generated by FieldArray.'):new Error('No "names" prop was specified <Fields/>')},g=function(e){var t=n.i(f.a)(e),u=function(e){function u(e,t){r(this,u);var n=i(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e,t));if(!t._reduxForm)throw new Error("Fields must be inside a component decorated with reduxForm()");return n}return o(u,e),y(u,[{key:"shouldComponentUpdate",value:function(e){return n.i(p.a)(this,e)}},{key:"UNSAFE_componentWillMount",value:function(){var e=m(this.props.names);if(e)throw e;var t=this.context,n=t._reduxForm.register;this.names.forEach(function(e){return n(e,"Field")})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(!d.a.deepEqual(this.props.names,e.names)){var t=this.context,r=t._reduxForm,i=r.register,o=r.unregister;this.props.names.forEach(function(e){return o(n.i(h.a)(t,e))}),e.names.forEach(function(e){return i(n.i(h.a)(t,e),"Field")})}}},{key:"componentWillUnmount",value:function(){var e=this.context,t=e._reduxForm.unregister;this.props.names.forEach(function(r){return t(n.i(h.a)(e,r))})}},{key:"getRenderedComponent",value:function(){return l()(this.props.withRef,"If you want to access getRenderedComponent(), you must specify a withRef prop to Fields"),this.refs.connected.getWrappedInstance().getRenderedComponent()}},{key:"render",value:function(){var e=this.context;return n.i(a.createElement)(t,v({},this.props,{names:this.props.names.map(function(t){return n.i(h.a)(e,t)}),_reduxForm:this.context._reduxForm,ref:"connected"}))}},{key:"names",get:function(){var e=this.context;return this.props.names.map(function(t){return n.i(h.a)(e,t)})}},{key:"dirty",get:function(){return this.refs.connected.getWrappedInstance().isDirty()}},{key:"pristine",get:function(){return!this.dirty}},{key:"values",get:function(){return this.refs.connected&&this.refs.connected.getWrappedInstance().getValues()}}]),u}(a.Component);return u.propTypes={names:function(e,t){return m(e[t])},component:c.a.oneOfType([c.a.func,c.a.string,c.a.node]).isRequired,format:c.a.func,parse:c.a.func,props:c.a.object,withRef:c.a.bool},u.contextTypes={_reduxForm:c.a.object},u};t.a=g},function(e,t,n){"use strict";var r=n(55),i=n.n(r),o=n(3),a=function(e){var t=e.getIn;return function(e,n){i()(e,"Form value must be specified");var r=n||function(e){return t(e,"form")};return function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),c=1;c<a;c++)u[c-1]=arguments[c];return i()(u.length,"No fields specified"),1===u.length?t(r(n),e+".values."+u[0]):u.reduce(function(i,a){var u=t(r(n),e+".values."+a);return void 0===u?i:o.a.setIn(i,a,u)},{})}}};t.a=a},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=n(135),s=n(522),l=n(521),f=n(10),p=n.n(f),d=n(13),h=n.n(d),v=n(38),y=n(63),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),b=function(e){var t=e.getIn;return function(e){for(var f=arguments.length,d=Array(f>1?f-1:0),b=1;b<f;b++)d[b-1]=arguments[b];return function(f){var b=function(h){function b(e,t){o(this,b);var n=a(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,e,t));if(!t._reduxForm)throw new Error("formValues() must be used inside a React tree decorated with reduxForm()");return n.updateComponent(e),n}return u(b,h),g(b,[{key:"componentWillReceiveProps",value:function(t){"function"==typeof e&&this.updateComponent(t)}},{key:"render",value:function(){var e=this.Component;return p.a.createElement(e,m({sectionPrefix:this.context._reduxForm.sectionPrefix},this.props))}},{key:"updateComponent",value:function(t){var r=void 0,o="function"==typeof e?e(t):e;if(r="string"==typeof o?d.reduce(function(e,t){return e[t]=t,e},i({},o,o)):o,n.i(l.a)(r))throw new Error("formValues(): You must specify values to get as formValues(name1, name2, ...) or formValues({propName1: propPath1, ...}) or formValues((props) => name) or formValues((props) => ({propName1: propPath1, ...}))");n.i(s.a)(r,this._valuesMap)||(this._valuesMap=r,this.setComponent())}},{key:"setComponent",value:function(){var e=this,i=function(r,i){var o=(i.sectionPrefix,e.context._reduxForm.getValues),a=o();return n.i(c.a)(e._valuesMap,function(r){return t(a,n.i(y.a)(e.context,r))})};this.Component=n.i(v.connect)(i,function(){return{}})(function(e){var t=(e.sectionPrefix,r(e,["sectionPrefix"]));return p.a.createElement(f,t)})}}]),b}(p.a.Component);return b.contextTypes={_reduxForm:h.a.object},b}}};t.a=b},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){function t(e){return e.plugin=function(e){var n=this;return t(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"NONE"},i=function(n,i){var o=h(n,i),a=e[i](o,r,h(t,i));return a!==o?v(n,i,a):n},o=n(t,r),a=r&&r.meta&&r.meta.form;return a?e[a]?i(o,a):o:Object.keys(e).reduce(i,o)})},e}var o,f=e.deepEqual,p=e.empty,d=e.forEach,h=e.getIn,v=e.setIn,y=e.deleteIn,m=e.fromJS,g=e.keys,b=e.size,w=e.some,_=e.splice,O=n.i(u.a)(e)(s),E=n.i(u.a)(c.a)(s),S=function(e,t,n,r,i,o,a){var u=h(e,t+"."+n);return u||a?v(e,t+"."+n,_(u,r,i,o)):e},x=function(e,t,n,r,i,o,a){var u=h(e,t),s=c.a.getIn(u,n);return s||a?v(e,t,c.a.setIn(u,n,c.a.splice(s,r,i,o))):e},k=["values","fields","submitErrors","asyncErrors"],j=function(e,t,n,r,i){var o=e,a=null!=i?p:void 0;return o=S(o,"values",t,n,r,i,!0),o=S(o,"fields",t,n,r,a),o=x(o,"syncErrors",t,n,r,void 0),o=x(o,"syncWarnings",t,n,r,void 0),o=S(o,"submitErrors",t,n,r,void 0),o=S(o,"asyncErrors",t,n,r,void 0)},C=(o={},r(o,a.ARRAY_INSERT,function(e,t){var n=t.meta,r=n.field,i=n.index,o=t.payload;return j(e,r,i,0,o)}),r(o,a.ARRAY_MOVE,function(e,t){var n=t.meta,r=n.field,i=n.from,o=n.to,a=h(e,"values."+r),u=a?b(a):0,c=e;return u&&k.forEach(function(e){var t=e+"."+r;if(h(c,t)){var n=h(c,t+"["+i+"]");c=v(c,t,_(h(c,t),i,1)),c=v(c,t,_(h(c,t),o,0,n))}}),c}),r(o,a.ARRAY_POP,function(e,t){var n=t.meta.field,r=h(e,"values."+n),i=r?b(r):0;return i?j(e,n,i-1,1):e}),r(o,a.ARRAY_PUSH,function(e,t){var n=t.meta.field,r=t.payload,i=h(e,"values."+n),o=i?b(i):0;return j(e,n,o,0,r)}),r(o,a.ARRAY_REMOVE,function(e,t){var n=t.meta,r=n.field,i=n.index;return j(e,r,i,1)}),r(o,a.ARRAY_REMOVE_ALL,function(e,t){var n=t.meta.field,r=h(e,"values."+n),i=r?b(r):0;return i?j(e,n,0,i):e}),r(o,a.ARRAY_SHIFT,function(e,t){var n=t.meta.field;return j(e,n,0,1)}),r(o,a.ARRAY_SPLICE,function(e,t){var n=t.meta,r=n.field,i=n.index,o=n.removeNum,a=t.payload;return j(e,r,i,o,a)}),r(o,a.ARRAY_SWAP,function(e,t){var n=t.meta,r=n.field,i=n.indexA,o=n.indexB,a=e;return k.forEach(function(e){var t=h(a,e+"."+r+"["+i+"]"),n=h(a,e+"."+r+"["+o+"]");void 0===t&&void 0===n||(a=v(a,e+"."+r+"["+i+"]",n),a=v(a,e+"."+r+"["+o+"]",t))}),a}),r(o,a.ARRAY_UNSHIFT,function(e,t){var n=t.meta.field,r=t.payload;return j(e,n,0,0,r)}),r(o,a.AUTOFILL,function(e,t){var n=t.meta.field,r=t.payload,i=e;return i=O(i,"asyncErrors."+n),i=O(i,"submitErrors."+n),i=v(i,"fields."+n+".autofilled",!0),i=v(i,"values."+n,r)}),r(o,a.BLUR,function(e,t){var n=t.meta,r=n.field,i=n.touch,o=t.payload,a=e;return void 0===h(a,"initial."+r)&&""===o?a=O(a,"values."+r):void 0!==o&&(a=v(a,"values."+r,o)),r===h(a,"active")&&(a=y(a,"active")),a=y(a,"fields."+r+".active"),i&&(a=v(a,"fields."+r+".touched",!0),a=v(a,"anyTouched",!0)),a}),r(o,a.CHANGE,function(e,t){var n=t.meta,r=n.field,i=n.touch,o=n.persistentSubmitErrors,a=t.payload,u=e;return void 0===h(u,"initial."+r)&&""===a?u=O(u,"values."+r):void 0!==a&&(u=v(u,"values."+r,a)),u=O(u,"asyncErrors."+r),o||(u=O(u,"submitErrors."+r)),u=O(u,"fields."+r+".autofilled"),i&&(u=v(u,"fields."+r+".touched",!0),u=v(u,"anyTouched",!0)),u}),r(o,a.CLEAR_SUBMIT,function(e){return y(e,"triggerSubmit")}),r(o,a.CLEAR_SUBMIT_ERRORS,function(e){var t=e;return t=O(t,"submitErrors"),t=y(t,"error")}),r(o,a.CLEAR_ASYNC_ERROR,function(e,t){var n=t.meta.field;return y(e,"asyncErrors."+n)}),r(o,a.CLEAR_FIELDS,function(e,t){var n=t.meta,r=n.keepTouched,i=n.persistentSubmitErrors,o=n.fields,a=e;o.forEach(function(e){a=O(a,"values."+e),a=O(a,"asyncErrors."+e),i||(a=O(a,"submitErrors."+e)),a=O(a,"fields."+e+".autofilled"),r||(a=y(a,"fields."+e+".touched"))});var u=w(g(h(a,"registeredFields")),function(e){return h(a,"fields."+e+".touched")});return a=u?v(a,"anyTouched",!0):y(a,"anyTouched")}),r(o,a.FOCUS,function(e,t){var n=t.meta.field,r=e,i=h(e,"active");return r=y(r,"fields."+i+".active"),r=v(r,"fields."+n+".visited",!0),r=v(r,"fields."+n+".active",!0),r=v(r,"active",n)}),r(o,a.INITIALIZE,function(e,t){var n=t.payload,r=t.meta,i=r.keepDirty,o=r.keepSubmitSucceeded,a=r.updateUnregisteredFields,u=r.keepValues,c=m(n),s=p,l=h(e,"warning");l&&(s=v(s,"warning",l));var y=h(e,"syncWarnings");y&&(s=v(s,"syncWarnings",y));var b=h(e,"error");b&&(s=v(s,"error",b));var w=h(e,"syncErrors");w&&(s=v(s,"syncErrors",w));var _=h(e,"registeredFields");_&&(s=v(s,"registeredFields",_));var O=h(e,"values"),E=h(e,"initial"),S=c,x=O;if(i&&_){if(!f(S,E)){var k=function(e){var t=h(E,e),n=h(O,e);if(f(n,t)){var r=h(S,e);h(x,e)!==r&&(x=v(x,e,r))}};a||d(g(_),function(e){return k(e)}),d(g(S),function(e){if(void 0===h(E,e)){var t=h(S,e);x=v(x,e,t)}a&&k(e)})}}else x=S;return u&&(d(g(O),function(e){var t=h(O,e);x=v(x,e,t)}),d(g(E),function(e){var t=h(E,e);S=v(S,e,t)})),o&&h(e,"submitSucceeded")&&(s=v(s,"submitSucceeded",!0)),s=v(s,"values",x),s=v(s,"initial",S)}),r(o,a.REGISTER_FIELD,function(e,t){var n=t.payload,r=n.name,i=n.type,o="registeredFields['"+r+"']",a=h(e,o);if(a){var u=h(a,"count")+1;a=v(a,"count",u)}else a=m({name:r,type:i,count:1});return v(e,o,a)}),r(o,a.RESET,function(e){var t=p,n=h(e,"registeredFields");n&&(t=v(t,"registeredFields",n));var r=h(e,"initial");return r&&(t=v(t,"values",r),t=v(t,"initial",r)),t}),r(o,a.RESET_SECTION,function(e,t){var n=t.meta.sections,r=e;n.forEach(function(t){r=O(r,"asyncErrors."+t),r=O(r,"submitErrors."+t),r=O(r,"fields."+t);var n=h(e,"initial."+t);r=n?v(r,"values."+t,n):O(r,"values."+t)});var i=w(g(h(r,"registeredFields")),function(e){return h(r,"fields."+e+".touched")});return r=i?v(r,"anyTouched",!0):y(r,"anyTouched")}),r(o,a.SUBMIT,function(e){return v(e,"triggerSubmit",!0)}),r(o,a.START_ASYNC_VALIDATION,function(e,t){var n=t.meta.field;return v(e,"asyncValidating",n||!0)}),r(o,a.START_SUBMIT,function(e){return v(e,"submitting",!0)}),r(o,a.STOP_ASYNC_VALIDATION,function(e,t){var n=t.payload,r=e;if(r=y(r,"asyncValidating"),n&&Object.keys(n).length){var o=n._error,a=i(n,["_error"]);o&&(r=v(r,"error",o)),Object.keys(a).length&&(r=v(r,"asyncErrors",m(a)))}else r=y(r,"error"),r=y(r,"asyncErrors");return r}),r(o,a.STOP_SUBMIT,function(e,t){var n=t.payload,r=e;if(r=y(r,"submitting"),r=y(r,"submitFailed"),r=y(r,"submitSucceeded"),n&&Object.keys(n).length){var o=n._error,a=i(n,["_error"]);r=o?v(r,"error",o):y(r,"error"),r=Object.keys(a).length?v(r,"submitErrors",m(a)):y(r,"submitErrors"),r=v(r,"submitFailed",!0)}else r=y(r,"error"),r=y(r,"submitErrors");return r}),r(o,a.SET_SUBMIT_FAILED,function(e,t){var n=t.meta.fields,r=e;return r=v(r,"submitFailed",!0),r=y(r,"submitSucceeded"),r=y(r,"submitting"),n.forEach(function(e){return r=v(r,"fields."+e+".touched",!0)}),n.length&&(r=v(r,"anyTouched",!0)),r}),r(o,a.SET_SUBMIT_SUCCEEDED,function(e){var t=e;return t=y(t,"submitFailed"),t=v(t,"submitSucceeded",!0)}),r(o,a.TOUCH,function(e,t){var n=t.meta.fields,r=e;return n.forEach(function(e){return r=v(r,"fields."+e+".touched",!0)}),r=v(r,"anyTouched",!0)}),r(o,a.UNREGISTER_FIELD,function(e,t){var n=t.payload,r=n.name,i=n.destroyOnUnmount,o=e,a="registeredFields['"+r+"']",u=h(o,a);if(!u)return o;var s=h(u,"count")-1;if(s<=0&&i){o=y(o,a),f(h(o,"registeredFields"),p)&&(o=y(o,"registeredFields"));var l=h(o,"syncErrors");l&&(l=E(l,r),o=c.a.deepEqual(l,c.a.empty)?y(o,"syncErrors"):v(o,"syncErrors",l));var d=h(o,"syncWarnings");d&&(d=E(d,r),o=c.a.deepEqual(d,c.a.empty)?y(o,"syncWarnings"):v(o,"syncWarnings",d)),o=O(o,"submitErrors."+r),o=O(o,"asyncErrors."+r)}else u=v(u,"count",s),o=v(o,a,u);return o}),r(o,a.UNTOUCH,function(e,t){var n=t.meta.fields,r=e;n.forEach(function(e){return r=y(r,"fields."+e+".touched")});var i=w(g(h(r,"registeredFields")),function(e){return h(r,"fields."+e+".touched")});return r=i?v(r,"anyTouched",!0):y(r,"anyTouched")}),r(o,a.UPDATE_SYNC_ERRORS,function(e,t){var n=t.payload,r=n.syncErrors,i=n.error,o=e;return i?(o=v(o,"error",i),o=v(o,"syncError",!0)):(o=y(o,"error"),o=y(o,"syncError")),o=Object.keys(r).length?v(o,"syncErrors",r):y(o,"syncErrors")}),r(o,a.UPDATE_SYNC_WARNINGS,function(e,t){var n=t.payload,r=n.syncWarnings,i=n.warning,o=e;return o=i?v(o,"warning",i):y(o,"warning"),o=Object.keys(r).length?v(o,"syncWarnings",r):y(o,"syncWarnings")}),o),P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments[1],n=C[t.type];return n?n(e,t):e};return t(function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"NONE"},r=n&&n.meta&&n.meta.form;if(!r||!l(n))return t;if(n.type===a.DESTROY&&n.meta&&n.meta.form)return n.meta.form.reduce(function(e,t){return O(e,t)},t);var i=h(t,r),o=e(i,n);return o===i?t:v(t,r,o)}}(P))}var a=n(137),u=n(566),c=n(3),s=function(e){var t=e.getIn;return function(e,n){var r=null;n.startsWith("values")&&(r=n.replace("values","initial"));var i=!r||void 0===t(e,r);return void 0!==t(e,n)&&i}},l=function(e){return e&&e.type&&e.type.length>a.prefix.length&&e.type.substring(0,a.prefix.length)===a.prefix};t.a=o},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var c=n(524),s=n(135),l=n(10),f=(n.n(l),n(174)),p=n.n(f),d=n(55),h=n.n(d),v=n(125),y=n.n(v),m=n(13),g=n.n(m),b=n(38),w=n(95),_=n(204),O=n(556),E=n(206),S=n(208),x=n(207),k=n(209),j=n(212),C=n(568),P=n(571),T=n(581),R=n(138),A=n(3),F=n(616),I=n(617),N=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D=function(e){return Boolean(e&&e.prototype&&"object"===U(e.prototype.isReactComponent))},V=_.a.arrayInsert,L=_.a.arrayMove,W=_.a.arrayPop,z=_.a.arrayPush,q=_.a.arrayRemove,B=_.a.arrayRemoveAll,H=_.a.arrayShift,Y=_.a.arraySplice,$=_.a.arraySwap,K=_.a.arrayUnshift,G=_.a.blur,Q=_.a.change,J=_.a.focus,X=u(_.a,["arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","blur","change","focus"]),Z={arrayInsert:V,arrayMove:L,arrayPop:W,arrayPush:z,arrayRemove:q,arrayRemoveAll:B,arrayShift:H,arraySplice:Y,arraySwap:$,arrayUnshift:K},ee=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Object.keys(_.a)),["array","asyncErrors","initialValues","syncErrors","syncWarnings","values","registeredFields"]),te=function(e){if(!e||"function"!=typeof e)throw new Error("You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop");return e},ne=function(e){var t=e.deepEqual,f=e.empty,d=e.getIn,v=e.setIn,m=e.keys,_=e.fromJS,U=n.i(R.a)(e);return function(R){var V=M({touchOnBlur:!0,touchOnChange:!1,persistentSubmitErrors:!1,destroyOnUnmount:!0,shouldAsyncValidate:E.a,shouldValidate:S.a,shouldError:x.a,shouldWarn:k.a,enableReinitialize:!1,keepDirtyOnReinitialize:!1,updateUnregisteredFields:!1,getFormState:function(e){return d(e,"form")},pure:!0,forceUnregisterOnUnmount:!1},R);return function(E){var R=function(s){function f(){var t,r,a,u;i(this,f);for(var c=arguments.length,s=Array(c),l=0;l<c;l++)s[l]=arguments[l];return r=a=o(this,(t=f.__proto__||Object.getPrototypeOf(f)).call.apply(t,[this].concat(s))),a.destroyed=!1,a.fieldCounts={},a.fieldValidators={},a.lastFieldValidatorKeys=[],a.fieldWarners={},a.lastFieldWarnerKeys=[],a.innerOnSubmit=void 0,a.submitPromise=void 0,a.getValues=function(){return a.props.values},a.isValid=function(){return a.props.valid},a.isPristine=function(){return a.props.pristine},a.register=function(e,t,n,r){var i=a.fieldCounts[e],o=(i||0)+1;a.fieldCounts[e]=o,a.props.registerField(e,t),n&&(a.fieldValidators[e]=n),r&&(a.fieldWarners[e]=r)},a.unregister=function(e){var t=a.fieldCounts[e];if(1===t?delete a.fieldCounts[e]:null!=t&&(a.fieldCounts[e]=t-1),!a.destroyed){var n=a.props,r=n.destroyOnUnmount,i=n.forceUnregisterOnUnmount,o=n.unregisterField;r||i?(o(e,r),a.fieldCounts[e]||(delete a.fieldValidators[e],delete a.fieldWarners[e],a.lastFieldValidatorKeys=a.lastFieldValidatorKeys.filter(function(t){return t!==e}))):o(e,!1)}},a.getFieldList=function(e){var t=a.props.registeredFields,n=[];if(!t)return n;var r=m(t);return e&&e.excludeFieldArray&&(r=r.filter(function(e){return"FieldArray"!==d(t,"['"+e+"'].type")})),_(r.reduce(function(e,t){return e.push(t),e},n))},a.getValidators=function(){var e={};return Object.keys(a.fieldValidators).forEach(function(t){var n=a.fieldValidators[t]();n&&(e[t]=n)}),e},a.generateValidator=function(){var t=a.getValidators();return Object.keys(t).length?n.i(P.a)(t,e):void 0},a.getWarners=function(){var e={};return Object.keys(a.fieldWarners).forEach(function(t){var n=a.fieldWarners[t]();n&&(e[t]=n)}),e},a.generateWarner=function(){var t=a.getWarners();return Object.keys(t).length?n.i(P.a)(t,e):void 0},a.asyncValidate=function(e,t,r){var i=a.props,o=i.asyncBlurFields,u=i.asyncChangeFields,c=i.asyncErrors,s=i.asyncValidate,l=i.dispatch,f=i.initialized,p=i.pristine,h=i.shouldAsyncValidate,y=i.startAsyncValidation,m=i.stopAsyncValidation,g=i.syncErrors,b=i.values,w=!e;if(s){var _=w?b:v(b,e,t),E=w||!d(g,e);if(function(){var t=o&&e&&~o.indexOf(e.replace(/\[[0-9]+\]/g,"[]")),n=u&&e&&~u.indexOf(e.replace(/\[[0-9]+\]/g,"[]")),i=!(o||u);return w||i||("blur"===r?t:n)}()&&h({asyncErrors:c,initialized:f,trigger:w?"submit":r,blurredField:e,pristine:p,syncValidationPasses:E}))return n.i(O.a)(function(){return s(_,l,a.props,e)},y,m,e)}},a.submitCompleted=function(e){return delete a.submitPromise,e},a.submitFailed=function(e){throw delete a.submitPromise,e},a.listenToSubmit=function(e){return y()(e)?(a.submitPromise=e,e.then(a.submitCompleted,a.submitFailed)):e},a.submit=function(e){var t=a.props,r=t.onSubmit,i=t.blur,o=t.change,u=t.dispatch;return e&&!n.i(j.a)(e)?n.i(C.a)(function(){return!a.submitPromise&&a.listenToSubmit(n.i(T.a)(te(e),M({},a.props,n.i(w.bindActionCreators)({blur:i,change:o},u)),a.props.validExceptSubmit,a.asyncValidate,a.getFieldList({excludeFieldArray:!0})))}):a.submitPromise?void 0:a.innerOnSubmit&&a.innerOnSubmit!==a.submit?a.innerOnSubmit():a.listenToSubmit(n.i(T.a)(te(r),M({},a.props,n.i(w.bindActionCreators)({blur:i,change:o},u)),a.props.validExceptSubmit,a.asyncValidate,a.getFieldList({excludeFieldArray:!0})))},a.reset=function(){return a.props.reset()},a.saveRef=function(e){a.wrapped=e},u=r,o(a,u)}return a(f,s),N(f,[{key:"getChildContext",value:function(){var e=this;return{_reduxForm:M({},this.props,{getFormState:function(t){return d(e.props.getFormState(t),e.props.form)},asyncValidate:this.asyncValidate,getValues:this.getValues,sectionPrefix:void 0,register:this.register,unregister:this.unregister,registerInnerOnSubmit:function(t){return e.innerOnSubmit=t}})}}},{key:"initIfNeeded",value:function(e){var n=this.props.enableReinitialize;if(e){if((n||!e.initialized)&&!t(this.props.initialValues,e.initialValues)){var r=e.initialized&&this.props.keepDirtyOnReinitialize;this.props.initialize(e.initialValues,r,{lastInitialValues:this.props.initialValues,updateUnregisteredFields:e.updateUnregisteredFields})}}else!this.props.initialValues||this.props.initialized&&!n||this.props.initialize(this.props.initialValues,this.props.keepDirtyOnReinitialize,{updateUnregisteredFields:this.props.updateUnregisteredFields})}},{key:"updateSyncErrorsIfNeeded",value:function(e,t,n){var r=this.props,i=r.error,o=r.updateSyncErrors,a=!(n&&Object.keys(n).length||i),u=!(e&&Object.keys(e).length||t);a&&u||A.a.deepEqual(n,e)&&A.a.deepEqual(i,t)||o(e,t)}},{key:"clearSubmitPromiseIfNeeded",value:function(e){var t=this.props.submitting;this.submitPromise&&t&&!e.submitting&&delete this.submitPromise}},{key:"submitIfNeeded",value:function(e){var t=this.props,n=t.clearSubmit;!t.triggerSubmit&&e.triggerSubmit&&(n(),this.submit())}},{key:"shouldErrorFunction",value:function(){var e=this.props,t=e.shouldValidate,n=e.shouldError,r=t!==S.a,i=n!==x.a;return r&&!i?t:n}},{key:"validateIfNeeded",value:function(t){var r=this.props,i=r.validate,o=r.values,a=this.shouldErrorFunction(),s=this.generateValidator();if(i||s){var l=void 0===t,f=Object.keys(this.getValidators());if(a({values:o,nextProps:t,props:this.props,initialRender:l,lastFieldValidatorKeys:this.lastFieldValidatorKeys,fieldValidatorKeys:f,structure:e})){var p=l||!t?this.props:t,d=n.i(c.a)(i?i(p.values,p)||{}:{},s?s(p.values,p)||{}:{}),h=d._error,v=u(d,["_error"]);this.lastFieldValidatorKeys=f,this.updateSyncErrorsIfNeeded(v,h,p.syncErrors)}}else this.lastFieldValidatorKeys=[]}},{key:"updateSyncWarningsIfNeeded",value:function(e,t,n){var r=this.props,i=r.warning,o=r.syncWarnings,a=r.updateSyncWarnings,u=!(o&&Object.keys(o).length||i),c=!(e&&Object.keys(e).length||t);u&&c||A.a.deepEqual(n,e)&&A.a.deepEqual(i,t)||a(e,t)}},{key:"shouldWarnFunction",value:function(){var e=this.props,t=e.shouldValidate,n=e.shouldWarn,r=t!==S.a,i=n!==k.a;return r&&!i?t:n}},{key:"warnIfNeeded",value:function(t){var r=this.props,i=r.warn,o=r.values,a=this.shouldWarnFunction(),s=this.generateWarner();if(i||s){var l=void 0===t,f=Object.keys(this.getWarners());if(a({values:o,nextProps:t,props:this.props,initialRender:l,lastFieldValidatorKeys:this.lastFieldWarnerKeys,fieldValidatorKeys:f,structure:e})){var p=l||!t?this.props:t,d=n.i(c.a)(i?i(p.values,p):{},s?s(p.values,p):{}),h=d._warning,v=u(d,["_warning"]);this.lastFieldWarnerKeys=f,this.updateSyncWarningsIfNeeded(v,h,p.syncWarnings)}}}},{key:"UNSAFE_componentWillMount",value:function(){n.i(I.a)()||(this.initIfNeeded(),this.validateIfNeeded(),this.warnIfNeeded()),h()(this.props.shouldValidate,"shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.")}},{key:"componentWillReceiveProps",value:function(e){this.initIfNeeded(e),this.validateIfNeeded(e),this.warnIfNeeded(e),this.clearSubmitPromiseIfNeeded(e),this.submitIfNeeded(e);var n=e.onChange,r=e.values,i=e.dispatch;n&&!t(r,this.props.values)&&n(r,i,e,this.props.values)}},{key:"shouldComponentUpdate",value:function(e){var n=this;if(!this.props.pure)return!0;var r=V.immutableProps,i=void 0===r?[]:r;return!!(this.props.children||e.children||Object.keys(e).some(function(r){return~i.indexOf(r)?n.props[r]!==e[r]:!~ee.indexOf(r)&&!t(n.props[r],e[r])}))}},{key:"componentDidMount",value:function(){n.i(I.a)()||(this.initIfNeeded(this.props),this.validateIfNeeded(),this.warnIfNeeded()),h()(this.props.shouldValidate,"shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.")}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.destroyOnUnmount,r=e.destroy;t&&!n.i(I.a)()&&(this.destroyed=!0,r())}},{key:"render",value:function(){var e=this.props,t=e.anyTouched,i=e.array,o=(e.arrayInsert,e.arrayMove,e.arrayPop,e.arrayPush,e.arrayRemove,e.arrayRemoveAll,e.arrayShift,e.arraySplice,e.arraySwap,e.arrayUnshift,e.asyncErrors,e.asyncValidate,e.asyncValidating),a=e.blur,c=e.change,s=e.clearSubmit,f=e.destroy,p=(e.destroyOnUnmount,e.forceUnregisterOnUnmount,e.dirty),d=e.dispatch,h=(e.enableReinitialize,e.error),v=(e.focus,e.form),y=(e.getFormState,e.immutableProps,e.initialize),m=e.initialized,g=e.initialValues,b=e.invalid,_=(e.keepDirtyOnReinitialize,e.updateUnregisteredFields,e.pristine),O=e.propNamespace,S=(e.registeredFields,e.registerField,e.reset),x=e.resetSection,k=(e.setSubmitFailed,e.setSubmitSucceeded,e.shouldAsyncValidate,e.shouldValidate,e.shouldError,e.shouldWarn,e.startAsyncValidation,e.startSubmit,e.stopAsyncValidation,e.stopSubmit,e.submitting),j=e.submitFailed,C=e.submitSucceeded,P=e.touch,T=(e.touchOnBlur,e.touchOnChange,e.persistentSubmitErrors,e.syncErrors,e.syncWarnings,e.unregisterField,e.untouch),R=(e.updateSyncErrors,e.updateSyncWarnings,e.valid),A=(e.validExceptSubmit,e.values,e.warning),F=u(e,["anyTouched","array","arrayInsert","arrayMove","arrayPop","arrayPush","arrayRemove","arrayRemoveAll","arrayShift","arraySplice","arraySwap","arrayUnshift","asyncErrors","asyncValidate","asyncValidating","blur","change","clearSubmit","destroy","destroyOnUnmount","forceUnregisterOnUnmount","dirty","dispatch","enableReinitialize","error","focus","form","getFormState","immutableProps","initialize","initialized","initialValues","invalid","keepDirtyOnReinitialize","updateUnregisteredFields","pristine","propNamespace","registeredFields","registerField","reset","resetSection","setSubmitFailed","setSubmitSucceeded","shouldAsyncValidate","shouldValidate","shouldError","shouldWarn","startAsyncValidation","startSubmit","stopAsyncValidation","stopSubmit","submitting","submitFailed","submitSucceeded","touch","touchOnBlur","touchOnChange","persistentSubmitErrors","syncErrors","syncWarnings","unregisterField","untouch","updateSyncErrors","updateSyncWarnings","valid","validExceptSubmit","values","warning"]),I=M({array:i,anyTouched:t,asyncValidate:this.asyncValidate,asyncValidating:o},n.i(w.bindActionCreators)({blur:a,change:c},d),{clearSubmit:s,destroy:f,dirty:p,dispatch:d,error:h,form:v,handleSubmit:this.submit,initialize:y,initialized:m,initialValues:g,invalid:b,pristine:_,reset:S,resetSection:x,submitting:k,submitFailed:j,submitSucceeded:C,touch:P,untouch:T,valid:R,warning:A}),N=M({},O?r({},O,I):I,F);return D(E)&&(N.ref=this.saveRef),n.i(l.createElement)(E,N)}}]),f}(l.Component);R.displayName="Form("+n.i(F.a)(E)+")",R.WrappedComponent=E,R.childContextTypes={_reduxForm:g.a.object.isRequired},R.propTypes={destroyOnUnmount:g.a.bool,forceUnregisterOnUnmount:g.a.bool,form:g.a.string.isRequired,immutableProps:g.a.arrayOf(g.a.string),initialValues:g.a.oneOfType([g.a.array,g.a.object]),getFormState:g.a.func,onSubmitFail:g.a.func,onSubmitSuccess:g.a.func,propNamespace:g.a.string,validate:g.a.func,warn:g.a.func,touchOnBlur:g.a.bool,touchOnChange:g.a.bool,triggerSubmit:g.a.bool,persistentSubmitErrors:g.a.bool,registeredFields:g.a.any};var L=n.i(b.connect)(function(e,n){var r=n.form,i=n.getFormState,o=n.initialValues,a=n.enableReinitialize,u=n.keepDirtyOnReinitialize,c=d(i(e)||f,r)||f,s=d(c,"initial"),l=!!s,p=a&&l&&!t(o,s),h=p&&!u,v=o||s||f;p&&(v=s||f);var y=d(c,"values")||v;h&&(y=v);var m=h||t(v,y),g=d(c,"asyncErrors"),b=d(c,"syncErrors")||A.a.empty,w=d(c,"syncWarnings")||A.a.empty,_=d(c,"registeredFields"),O=U(r,i,!1)(e),E=U(r,i,!0)(e),S=!!d(c,"anyTouched"),x=!!d(c,"submitting"),k=!!d(c,"submitFailed"),j=!!d(c,"submitSucceeded"),C=d(c,"error"),P=d(c,"warning"),T=d(c,"triggerSubmit");return{anyTouched:S,asyncErrors:g,asyncValidating:d(c,"asyncValidating")||!1,dirty:!m,error:C,initialized:l,invalid:!O,pristine:m,registeredFields:_,submitting:x,submitFailed:k,submitSucceeded:j,syncErrors:b,syncWarnings:w,triggerSubmit:T,values:y,valid:O,validExceptSubmit:E,warning:P}},function(e,t){var r=function(e){return e.bind(null,t.form)},i=n.i(s.a)(X,r),o=n.i(s.a)(Z,r),a=function(e,n){return G(t.form,e,n,!!t.touchOnBlur)},u=function(e,n){return Q(t.form,e,n,!!t.touchOnChange,!!t.persistentSubmitErrors)},c=r(J),l=n.i(w.bindActionCreators)(i,e),f={insert:n.i(w.bindActionCreators)(o.arrayInsert,e),move:n.i(w.bindActionCreators)(o.arrayMove,e),pop:n.i(w.bindActionCreators)(o.arrayPop,e),push:n.i(w.bindActionCreators)(o.arrayPush,e),remove:n.i(w.bindActionCreators)(o.arrayRemove,e),removeAll:n.i(w.bindActionCreators)(o.arrayRemoveAll,e),shift:n.i(w.bindActionCreators)(o.arrayShift,e),splice:n.i(w.bindActionCreators)(o.arraySplice,e),swap:n.i(w.bindActionCreators)(o.arraySwap,e),unshift:n.i(w.bindActionCreators)(o.arrayUnshift,e)},p=M({},l,o,{blur:a,change:u,array:f,focus:c,dispatch:e});return function(){return p}},void 0,{withRef:!0}),W=p()(L(R),E);W.defaultProps=V;var z=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),N(t,[{key:"submit",value:function(){return this.ref&&this.ref.getWrappedInstance().submit()}},{key:"reset",value:function(){this.ref&&this.ref.getWrappedInstance().reset()}},{key:"render",value:function(){var e=this,t=this.props,r=t.initialValues,i=u(t,["initialValues"]);return n.i(l.createElement)(W,M({},i,{ref:function(t){e.ref=t},initialValues:_(r)}))}},{key:"valid",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isValid())}},{key:"invalid",get:function(){return!this.valid}},{key:"pristine",get:function(){return!(!this.ref||!this.ref.getWrappedInstance().isPristine())}},{key:"dirty",get:function(){return!this.pristine}},{key:"values",get:function(){return this.ref?this.ref.getWrappedInstance().getValues():f}},{key:"fieldList",get:function(){return this.ref?this.ref.getWrappedInstance().getFieldList():[]}},{key:"wrappedInstance",get:function(){return this.ref&&this.ref.getWrappedInstance().wrapped}}]),t}(l.Component);return p()(z,E)}}};t.a=ne},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(38),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(e){var t=e.getIn;return function(e){var a=o({prop:"values",getFormState:function(e){return t(e,"form")}},e),u=a.form,c=a.prop,s=a.getFormState;return n.i(i.connect)(function(e){return r({},c,t(s(e),u+".values"))})}};t.a=a},function(e,t,n){"use strict";function r(e){var t=function(e){return function(t,n){return void 0!==e.getIn(t,n)}},r=e.deepEqual,o=e.empty,a=e.getIn,u=e.deleteIn,c=e.setIn;return function(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;return function t(l,f){if("]"===f[f.length-1]){var p=n.i(i.a)(f);p.pop();return a(l,p.join("."))?c(l,f):l}var d=l;s(e)(l,f)&&(d=u(l,f));var h=f.lastIndexOf(".");if(h>0){var v=f.substring(0,h);if("]"!==v[v.length-1]){var y=a(d,v);if(r(y,o))return t(d,v)}}return d}}}var i=n(93);t.a=r},function(e,t,n){"use strict";var r=n(210),i=function(e){var t=[];if(e)for(var n=0;n<e.length;n++){var r=e[n];r.selected&&t.push(r.value)}return t},o=function(e,t){if(n.i(r.a)(e)){if(!t&&e.nativeEvent&&void 0!==e.nativeEvent.text)return e.nativeEvent.text;if(t&&void 0!==e.nativeEvent)return e.nativeEvent.text;var o=e,a=o.target,u=a.type,c=a.value,s=a.checked,l=a.files,f=o.dataTransfer;return"checkbox"===u?!!s:"file"===u?l||f&&f.files:"select-multiple"===u?i(e.target.options):c}return e};t.a=o},function(e,t,n){"use strict";var r=n(212),i=function(e){return function(t){for(var i=arguments.length,o=Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return n.i(r.a)(t)?e.apply(void 0,o):e.apply(void 0,[t].concat(o))}};t.a=i},function(e,t,n){"use strict";var r=n(561),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(562),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(3),i=function(e){return Array.isArray(e)?e:[e]},o=function(e,t,n,r,o){for(var a=i(r),u=0;u<a.length;u++){var c=a[u](e,t,n,o);if(c)return c}},a=function(e,t){var n=t.getIn;return function(t,i){var a={};return Object.keys(e).forEach(function(u){var c=n(t,u),s=o(c,t,i,e[u],u);s&&(a=r.a.setIn(a,u,s))}),a}};t.a=a},function(e,t,n){"use strict";var r=n(594),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(595),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(596),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(597),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(598),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(599),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(600),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(601),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(602),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(125),o=n.n(i),a=n(203),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(e,t,n,i,c){var s=t.dispatch,l=t.onSubmitFail,f=t.onSubmitSuccess,p=t.startSubmit,d=t.stopSubmit,h=t.setSubmitFailed,v=t.setSubmitSucceeded,y=t.syncErrors,m=t.asyncErrors,g=t.touch,b=t.values,w=t.persistentSubmitErrors;if(g.apply(void 0,r(c)),n||w){var _=function(){var n=void 0;try{n=e(b,s,t)}catch(e){var i=e instanceof a.a?e.errors:void 0;if(d(i),h.apply(void 0,r(c)),l&&l(i,s,e,t),i||l)return i;throw e}return o()(n)?(p(),n.then(function(e){return d(),v(),f&&f(e,s,t),e},function(e){var n=e instanceof a.a?e.errors:void 0;if(d(n),h.apply(void 0,r(c)),l&&l(n,s,e,t),n||l)return n;throw e})):(v(),f&&f(n,s,t),n)},O=i&&i();return O?O.then(function(e){if(e)throw e;return _()}).catch(function(e){return h.apply(void 0,r(c)),l&&l(e,s,null,t),Promise.reject(e)}):_()}h.apply(void 0,r(c));var E=u({},m,y);return l&&l(E,s,null,t),E};t.a=c},function(e,t,n){"use strict";var r=function(e,t){switch(t){case"Field":return[e,e+"._error"];case"FieldArray":return[e+"._error"];default:throw new Error("Unknown field type")}},i=function(e){var t=e.getIn;return function(e,n,i,o){if(!n&&!i&&!o)return!1;var a=t(e,"name"),u=t(e,"type");return r(a,u).some(function(e){return t(n,e)||t(i,e)||t(o,e)})}};t.a=i},function(e,t,n){"use strict";var r=n(603),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(604),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(605),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(606),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(607),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(214),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(608),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(138),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";n.d(t,"h",function(){return d}),n.d(t,"b",function(){return h}),n.d(t,"c",function(){return v}),n.d(t,"f",function(){return y}),n.d(t,"e",function(){return m}),n.d(t,"d",function(){return g}),n.d(t,"g",function(){return b});var r=n(13),i=n.n(r),o=i.a.any,a=i.a.bool,u=i.a.func,c=i.a.shape,s=i.a.string,l=i.a.oneOfType,f=i.a.object,p=i.a.number,d={anyTouched:a.isRequired,asyncValidating:l([a,s]).isRequired,dirty:a.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,initialized:a.isRequired,initialValues:f,pristine:a.isRequired,pure:a.isRequired,submitting:a.isRequired,submitFailed:a.isRequired,submitSucceeded:a.isRequired,valid:a.isRequired,warning:o,array:c({insert:u.isRequired,move:u.isRequired,pop:u.isRequired,push:u.isRequired,remove:u.isRequired,removeAll:u.isRequired,shift:u.isRequired,splice:u.isRequired,swap:u.isRequired,unshift:u.isRequired}),asyncValidate:u.isRequired,autofill:u.isRequired,blur:u.isRequired,change:u.isRequired,clearAsyncError:u.isRequired,clearFields:u.isRequired,clearSubmitErrors:u.isRequired,destroy:u.isRequired,dispatch:u.isRequired,handleSubmit:u.isRequired,initialize:u.isRequired,reset:u.isRequired,resetSection:u.isRequired,touch:u.isRequired,submit:u.isRequired,untouch:u.isRequired,triggerSubmit:a,clearSubmit:u.isRequired},h={checked:a,name:s.isRequired,onBlur:u.isRequired,onChange:u.isRequired,onDragStart:u.isRequired,onDrop:u.isRequired,onFocus:u.isRequired,value:o},v={active:a.isRequired,asyncValidating:a.isRequired,autofilled:a.isRequired,dirty:a.isRequired,dispatch:u.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,pristine:a.isRequired,submitting:a.isRequired,submitFailed:a.isRequired,touched:a.isRequired,valid:a.isRequired,visited:a.isRequired,warning:s},y={dirty:a.isRequired,error:o,form:s.isRequired,invalid:a.isRequired,pristine:a.isRequired,submitFailed:a,submitting:a,valid:a.isRequired,warning:s},m={name:s.isRequired,forEach:u.isRequired,get:u.isRequired,getAll:u.isRequired,insert:u.isRequired,length:p.isRequired,map:u.isRequired,move:u.isRequired,pop:u.isRequired,push:u.isRequired,reduce:u.isRequired,remove:u.isRequired,removeAll:u.isRequired,shift:u.isRequired,swap:u.isRequired,unshift:u.isRequired},g={input:c(h).isRequired,meta:c(v).isRequired},b={fields:c(m).isRequired,meta:c(y).isRequired};t.a=d},function(e,t,n){"use strict";var r=n(563),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=n(564),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".asyncErrors")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".error")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".initial")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".fields")||n}}};t.a=r},function(e,t,n){"use strict";function r(e){var t=e.getIn,n=e.keys;return function(e){return function(r){return n((e||function(e){return t(e,"form")})(r))}}}t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".submitErrors")||n}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".syncErrors")||n}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn,n=e.empty;return function(e,r){return function(i){return t((r||function(e){return t(e,"form")})(i),e+".syncWarnings")||n}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return t((n||function(e){return t(e,"form")})(r),e+".values")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitFailed")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitSucceeded")}}};t.a=r},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".asyncValidating")}}};t.a=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(214),o=function(e){return function(t,o){var a=n.i(i.a)(e)(t,o);return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return!a.apply(void 0,[e].concat(r(n)))}}};t.a=o},function(e,t,n){"use strict";var r=n(138),i=function(e){return function(t,i){var o=n.i(r.a)(e)(t,i);return function(e){return!o(e)}}};t.a=i},function(e,t,n){"use strict";var r=function(e){var t=e.getIn;return function(e,n){return function(r){return!!t((n||function(e){return t(e,"form")})(r),e+".submitting")}}};t.a=r},function(e,t,n){"use strict";var r=n(195),i=n(10),o=n.n(i),a=function(e,t){if(e===t)return!0;if(!e&&!t){return(null===e||void 0===e||""===e)===(null===t||void 0===t||""===t)}return(!e||!t||e._error===t._error)&&((!e||!t||e._warning===t._warning)&&(!o.a.isValidElement(e)&&!o.a.isValidElement(t)&&void 0))},u=function(e,t){return n.i(r.a)(e,t,a)};t.a=u},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(void 0===e||null===e||void 0===t||null===t)return e;for(var n=arguments.length,a=Array(n>2?n-2:0),c=2;c<n;c++)a[c-2]=arguments[c];if(a.length){if(Array.isArray(e)){if(isNaN(t))throw new Error('Must access array elements with a number, not "'+String(t)+'".');var s=Number(t);if(s<e.length){var l=o.apply(void 0,[e&&e[s]].concat(i(a)));if(l!==e[s]){var f=[].concat(i(e));return f[s]=l,f}}return e}if(t in e){var p=o.apply(void 0,[e&&e[t]].concat(i(a)));return e[t]===p?e:u({},e,r({},t,p))}return e}if(Array.isArray(e)){if(isNaN(t))throw new Error('Cannot delete non-numerical index from an array. Given: "'+String(t));var d=Number(t);if(d<e.length){var h=[].concat(i(e));return h.splice(d,1),h}return e}if(t in e){var v=u({},e);return delete v[t],v}return e}var a=n(93),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(e,t){return o.apply(void 0,[e].concat(i(n.i(a.a)(t))))};t.a=c},function(e,t,n){"use strict";var r=n(93),i=function(e,t){if(!e)return e;var i=n.i(r.a)(t),o=i.length;if(o){for(var a=e,u=0;u<o&&a;++u)a=a[i[u]];return a}};t.a=i},function(e,t,n){"use strict";function r(e){return e?Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e):[]}t.a=r},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(93),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function e(t,n,i,a){if(a>=i.length)return n;var u=i[a],c=t&&(Array.isArray(t)?t[Number(u)]:t[u]),s=e(c,n,i,a+1);if(!t){if(isNaN(u))return r({},u,s);var l=[];return l[parseInt(u,10)]=s,l}if(Array.isArray(t)){var f=[].concat(t);return f[parseInt(u,10)]=s,f}return o({},t,r({},u,s))},u=function(e,t,r){return a(e,r,n.i(i.a)(t),0)};t.a=u},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=function(e,t,n,i){if(e=e||[],t<e.length){if(void 0===i&&!n){var o=[].concat(r(e));return o.splice(t,0,!0),o[t]=void 0,o}if(null!=i){var a=[].concat(r(e));return a.splice(t,n,i),a}var u=[].concat(r(e));return u.splice(t,n),u}if(n)return e;var c=[].concat(r(e));return c[t]=i,c};t.a=i},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r="text"},function(e,t,n){"use strict";var r=function(e){return e.displayName||e.name||"Component"};t.a=r},function(e,t,n){"use strict";(function(e){var n=function(){return!(void 0===e||!e.hot||"function"!=typeof e.hot.status||"apply"!==e.hot.status())};t.a=n}).call(t,n(64)(e))},function(e,t,n){"use strict";var r=n(565),i=n(3);t.a=n.i(r.a)(i.a)},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var u=e(n,r,a),c=u.dispatch,s=[],l={getState:u.getState,dispatch:function(e){return c(e)}};return s=t.map(function(e){return e(l)}),c=i.a.apply(void 0,s)(u.dispatch),o({},u,{dispatch:c})}}}t.a=r;var i=n(216),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;o<n.length;o++){var a=n[o],u=e[a];"function"==typeof u&&(i[a]=r(u,t))}return i}t.a=i},function(e,t,n){"use strict";function r(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:a.b.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.b.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function o(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];"function"==typeof e[a]&&(n[a]=e[a])}var u=Object.keys(n),c=void 0;try{i(n)}catch(e){c=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(c)throw c;for(var i=!1,o={},a=0;a<u.length;a++){var s=u[a],l=n[s],f=e[s],p=l(f,t);if(void 0===p){var d=r(s,t);throw new Error(d)}o[s]=p,i=i||p!==f}return i?o:e}}t.a=o;var a=n(217);n(90),n(218)},function(e,t,n){(function(t){!function(t){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),u=new d(r||[]);return a._invoke=s(e,n,u),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function c(e){function n(t,i,o,a){var u=r(e[t],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&g.call(s,"__await")?Promise.resolve(s.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):Promise.resolve(s).then(function(e){c.value=e,o(c)},a)}a(u.arg)}function i(e,t){function r(){return new Promise(function(r,i){n(e,t,r,i)})}return o=o?o.then(r,r):r()}"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n));var o;this._invoke=i}function s(e,t,n){var i=x;return function(o,a){if(i===j)throw new Error("Generator is already running");if(i===C){if("throw"===o)throw a;return v()}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=l(u,n);if(c){if(c===P)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===x)throw i=C,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=j;var s=r(e,t,n);if("normal"===s.type){if(i=n.done?C:k,s.arg===P)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=C,n.method="throw",n.arg=s.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===y){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=y,l(e,t),"throw"===t.method))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,P;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=y),t.delegate=null,P):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function h(e){if(e){var t=e[w];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(g.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=y,t.done=!0,t};return r.next=r}}return{next:v}}function v(){return{value:y,done:!0}}var y,m=Object.prototype,g=m.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",_=b.asyncIterator||"@@asyncIterator",O=b.toStringTag||"@@toStringTag",E="object"==typeof e,S=t.regeneratorRuntime;if(S)return void(E&&(e.exports=S));S=t.regeneratorRuntime=E?e.exports:{},S.wrap=n;var x="suspendedStart",k="suspendedYield",j="executing",C="completed",P={},T={};T[w]=function(){return this};var R=Object.getPrototypeOf,A=R&&R(R(h([])));A&&A!==m&&g.call(A,w)&&(T=A);var F=a.prototype=i.prototype=Object.create(T);o.prototype=F.constructor=a,a.constructor=o,a[O]=o.displayName="GeneratorFunction",S.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},S.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,O in e||(e[O]="GeneratorFunction")),e.prototype=Object.create(F),e},S.awrap=function(e){return{__await:e}},u(c.prototype),c.prototype[_]=function(){return this},S.AsyncIterator=c,S.async=function(e,t,r,i){var o=new c(n(e,t,r,i));return S.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},u(F),F[O]="Generator",F[w]=function(){return this},F.toString=function(){return"[object Generator]"},S.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},S.values=h,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(p),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=y)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=y),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=g.call(i,"catchLoc"),u=g.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,P):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),P},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),P}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=y),P}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,n(96))},function(e,t,n){"use strict";(function(e,r){var i,o=n(624);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=n.i(o.a)(i);t.a=a}).call(t,n(96),n(64)(e))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}t.a=r},function(e,t,n){n(220),e.exports=n(219)}]);
src/icons/SecurityIcon.js
kiloe/ui
import React from 'react'; import Icon from '../Icon'; export default class SecurityIcon extends Icon { getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 2L6 10v12c0 11.11 7.67 21.47 18 24 10.33-2.53 18-12.89 18-24V10L24 2zm0 21.98h14c-1.06 8.24-6.55 15.58-14 17.87V24H10V12.6l14-6.22v17.6z"/></svg>;} };
wp-content/plugins/front-end-editor/lib/aloha-editor/plugins/common/undo/lib/undo-plugin.js
edpittol/collaborate-blog
/* undo-plugin.js is part of Aloha Editor project http://aloha-editor.org * * Aloha Editor is a WYSIWYG HTML5 inline editing library and editor. * Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria. * Contributors http://aloha-editor.org/contribution.php * * Aloha Editor is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * Aloha Editor is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * As an additional permission to the GNU GPL version 2, you may distribute * non-source (e.g., minimized or compacted) forms of the Aloha-Editor * source code without the copy of the GNU GPL normally required, * provided you include this license notice and a URL through which * recipients can access the Corresponding Source. */ define( ['aloha', 'jquery', 'aloha/plugin', 'undo/vendor/undo', 'undo/vendor/diff_match_patch_uncompressed'], function( Aloha, jQuery, Plugin) { var dmp = new diff_match_patch, resetFlag = false; function reversePatch(patch) { var reversed = dmp.patch_deepCopy(patch); for (var i = 0; i < reversed.length; i++) { for (var j = 0; j < reversed[i].diffs.length; j++) { reversed[i].diffs[j][0] = -(reversed[i].diffs[j][0]); } } return reversed; } /** * register the plugin with unique name */ return Plugin.create('undo', { /** * Initialize the plugin and set initialize flag on true */ init: function () { this.stack = new Undo.Stack(); var that = this; var EditCommand = Undo.Command.extend({ constructor: function(editable, patch) { this.editable = editable; this.patch = patch; }, execute: function() { //command object is created after execution. }, undo: function() { this.phase(reversePatch(this.patch)); }, redo: function() { this.phase(this.patch); }, phase: function(patch) { var contents = this.editable.getContents(), applied = dmp.patch_apply(patch, contents), newValue = applied[0], didNotApply = applied[1]; if (didNotApply.length) { //error } this.reset(newValue); }, reset: function(val) { //we have to trigger a smartContentChange event //after doing an undo or redo, but we mustn't //push new commands on the stack, because there //are no new commands, just the old commands on //the stack that are undone or redone. resetFlag = true; var reactivate = null; if (Aloha.getActiveEditable() === this.editable) { Aloha.deactivateEditable(); reactivate = this.editable; } this.editable.obj.html(val); if (null !== reactivate) { reactivate.activate(); } //TODO: this is a call to an internal //function. There should be an API to generate //new smartContentChangeEvents. this.editable.smartContentChange({type : 'blur'}); resetFlag = false; } }); this.stack.changed = function() { // update UI }; Aloha.bind('aloha-editable-created', function(e, editable){ editable.obj.bind('keydown', 'ctrl+z shift+ctrl+z', function(event){ event.preventDefault(); if (event.shiftKey) { that.redo(); } else { that.undo(); } }); }); Aloha.bind('aloha-smart-content-changed', function(jevent, aevent) { // The editable only actually makes a snapshot when // getSnapshotContent is called, so we need to call it now // to ensure such a snapshot is made at all times, even when // resetFlag===true, otherwise the snapshot grows stale. var oldValue = aevent.getSnapshotContent(); if (resetFlag) { return; } var newValue = aevent.editable.getContents(), patch = dmp.patch_make(oldValue, newValue); // only push an EditCommand if something actually changed. if (0 !== patch.length) { that.stack.execute( new EditCommand( aevent.editable, patch ) ); } }); }, /** * toString method * @return string */ toString: function () { return 'undo'; }, undo: function () { if ( null !== Aloha.getActiveEditable() ) { Aloha.getActiveEditable().smartContentChange({type : 'blur'}); } this.stack.canUndo() && this.stack.undo(); }, redo: function () { if ( null !== Aloha.getActiveEditable() ) { Aloha.getActiveEditable().smartContentChange({type : 'blur'}); } this.stack.canRedo() && this.stack.redo(); }, stack: undefined // Defined in init above }); });
packages/material-ui-icons/src/PersonOutlined.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" /></g></React.Fragment> , 'PersonOutlined');