path
stringlengths 5
304
| repo_name
stringlengths 6
79
| content
stringlengths 27
1.05M
|
---|---|---|
src/FlatButton/FlatButton.spec.js | pradel/material-ui | /* eslint-env mocha */
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import FlatButton from './FlatButton';
import getMuiTheme from '../styles/getMuiTheme';
describe('<FlatButton />', () => {
const muiTheme = getMuiTheme();
const shallowWithContext = (node) => shallow(node, {context: {muiTheme}});
const flatButtonTheme = muiTheme.flatButton;
const testChildren = <div className="unique">Hello World</div>;
it('renders an enhanced button', () => {
const wrapper = shallowWithContext(
<FlatButton>Button</FlatButton>
);
assert.ok(wrapper.is('EnhancedButton'));
});
it('renders children', () => {
const wrapper = shallowWithContext(
<FlatButton>{testChildren}</FlatButton>
);
assert.ok(wrapper.contains(testChildren), 'should contain the children');
});
it('passes props to the enhanced button', () => {
const props = {
ariaLabel: 'Say hello world',
disabled: true,
href: 'http://google.com',
linkButton: true,
name: 'Hello World',
};
const wrapper = shallowWithContext(
<FlatButton {...props}>Button</FlatButton>
);
assert.ok(wrapper.is('EnhancedButton'));
assert.ok(wrapper.is(props));
});
it('renders a label with an icon before', () => {
const wrapper = shallowWithContext(
<FlatButton
icon={<span className="test-icon" />}
label="Hello"
/>
);
const icon = wrapper.children().at(0);
const label = wrapper.children().at(1);
assert.ok(icon.is('span'), );
assert.ok(icon.hasClass('test-icon'));
assert.ok(label.is('FlatButtonLabel'));
assert.strictEqual(label.node.props.label, 'Hello', 'says hello');
});
it('renders a label with an icon after', () => {
const wrapper = shallowWithContext(
<FlatButton
icon={<span className="test-icon" />}
label="Hello"
labelPosition="before"
/>
);
const icon = wrapper.children().at(1);
const label = wrapper.children().at(0);
assert.ok(icon.is('span'), );
assert.ok(icon.hasClass('test-icon'));
assert.ok(label.is('FlatButtonLabel'));
assert.strictEqual(label.node.props.label, 'Hello', 'says hello');
});
it('colors the button the primary theme color', () => {
const wrapper = shallowWithContext(
<FlatButton
label="Button"
icon={<span className="test-icon" />}
primary={true}
/>
);
const icon = wrapper.children().at(0);
assert.ok(wrapper.is('EnhancedButton'));
assert.ok(wrapper.is({
style: {
color: flatButtonTheme.primaryTextColor,
},
}));
assert.ok(icon.is('span'));
assert.ok(icon.is({color: flatButtonTheme.primaryTextColor}));
});
it('colors the button the secondary theme color', () => {
const wrapper = shallowWithContext(
<FlatButton secondary={true} icon={<span className="test-icon" />}>Button</FlatButton>
);
assert.ok(wrapper.is('EnhancedButton'));
assert.ok(wrapper.is({
style: {
color: flatButtonTheme.secondaryTextColor,
},
}));
});
it('overrides hover and background color styles via props', () => {
const wrapper = shallowWithContext(
<FlatButton
backgroundColor="rgba(159,159,159)"
hoverColor="yellow"
label="Button"
/>
);
assert.ok(wrapper.is({
style: {
backgroundColor: 'rgba(159,159,159)',
},
}), 'should have the custom background color');
wrapper.setState({hovered: true});
assert.ok(wrapper.is({
style: {
backgroundColor: 'yellow',
},
}), 'should have the custom hover background color');
});
it('overrides the ripple color via props', () => {
const wrapper = shallowWithContext(
<FlatButton rippleColor="yellow" label="Button" />
);
assert.strictEqual(wrapper.node.props.focusRippleColor, 'yellow', 'should be yellow');
assert.strictEqual(wrapper.node.props.touchRippleColor, 'yellow', 'should be yellow');
});
});
|
ajax/libs/primereact/7.0.0-rc.2/speeddial/speeddial.esm.js | cdnjs/cdnjs | import React, { Component } from 'react';
import { Button } from 'primereact/button';
import { DomHandler, classNames, ObjectUtils, Ripple } from 'primereact/core';
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 _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
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 _typeof(obj) {
"@babel/helpers - typeof";
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 _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
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;
}
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var SpeedDial = /*#__PURE__*/function (_Component) {
_inherits(SpeedDial, _Component);
var _super = _createSuper(SpeedDial);
function SpeedDial(props) {
var _this;
_classCallCheck(this, SpeedDial);
_this = _super.call(this, props);
_this.state = {
visible: false
};
_this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
_this.onItemClick = _this.onItemClick.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(SpeedDial, [{
key: "isVisible",
value: function isVisible() {
return this.props.onVisibleChange ? this.props.visible : this.state.visible;
}
}, {
key: "show",
value: function show() {
if (this.props.onVisibleChange) {
this.props.onVisibleChange(true);
} else {
this.setState({
visible: true
});
}
this.props.onShow && this.props.onShow();
}
}, {
key: "hide",
value: function hide() {
if (this.props.onVisibleChange) {
this.props.onVisibleChange(false);
} else {
this.setState({
visible: false
});
}
this.props.onHide && this.props.onHide();
}
}, {
key: "onClick",
value: function onClick(e) {
this.isVisible() ? this.hide() : this.show();
this.props.onClick && this.props.onClick(e);
this.isItemClicked = true;
}
}, {
key: "onItemClick",
value: function onItemClick(e, item) {
if (item.command) {
item.command({
originalEvent: e,
item: item
});
}
this.hide();
this.isItemClicked = true;
e.preventDefault();
}
}, {
key: "bindDocumentClickListener",
value: function bindDocumentClickListener() {
var _this2 = this;
if (!this.documentClickListener) {
this.documentClickListener = function (event) {
if (_this2.isVisible() && _this2.isOutsideClicked(event)) {
_this2.hide();
}
_this2.isItemClicked = false;
};
document.addEventListener('click', this.documentClickListener);
}
}
}, {
key: "unbindDocumentClickListener",
value: function unbindDocumentClickListener() {
if (this.documentClickListener) {
document.removeEventListener('click', this.documentClickListener);
this.documentClickListener = null;
}
}
}, {
key: "isOutsideClicked",
value: function isOutsideClicked(event) {
return this.container && !(this.container.isSameNode(event.target) || this.container.contains(event.target) || this.isItemClicked);
}
}, {
key: "calculateTransitionDelay",
value: function calculateTransitionDelay(index) {
var length = this.props.model.length;
var visible = this.isVisible();
return (visible ? index : length - index - 1) * this.props.transitionDelay;
}
}, {
key: "calculatePointStyle",
value: function calculatePointStyle(index) {
var type = this.props.type;
if (type !== 'linear') {
var length = this.props.model.length;
var radius = this.props.radius || length * 20;
if (type === 'circle') {
var step = 2 * Math.PI / length;
return {
left: "calc(".concat(radius * Math.cos(step * index), "px + var(--item-diff-x, 0px))"),
top: "calc(".concat(radius * Math.sin(step * index), "px + var(--item-diff-y, 0px))")
};
} else if (type === 'semi-circle') {
var direction = this.props.direction;
var _step = Math.PI / (length - 1);
var x = "calc(".concat(radius * Math.cos(_step * index), "px + var(--item-diff-x, 0px))");
var y = "calc(".concat(radius * Math.sin(_step * index), "px + var(--item-diff-y, 0px))");
if (direction === 'up') {
return {
left: x,
bottom: y
};
} else if (direction === 'down') {
return {
left: x,
top: y
};
} else if (direction === 'left') {
return {
right: y,
top: x
};
} else if (direction === 'right') {
return {
left: y,
top: x
};
}
} else if (type === 'quarter-circle') {
var _direction = this.props.direction;
var _step2 = Math.PI / (2 * (length - 1));
var _x = "calc(".concat(radius * Math.cos(_step2 * index), "px + var(--item-diff-x, 0px))");
var _y = "calc(".concat(radius * Math.sin(_step2 * index), "px + var(--item-diff-y, 0px))");
if (_direction === 'up-left') {
return {
right: _x,
bottom: _y
};
} else if (_direction === 'up-right') {
return {
left: _x,
bottom: _y
};
} else if (_direction === 'down-left') {
return {
right: _y,
top: _x
};
} else if (_direction === 'down-right') {
return {
left: _y,
top: _x
};
}
}
}
return {};
}
}, {
key: "getItemStyle",
value: function getItemStyle(index) {
var transitionDelay = this.calculateTransitionDelay(index);
var pointStyle = this.calculatePointStyle(index);
return _objectSpread({
transitionDelay: "".concat(transitionDelay, "ms")
}, pointStyle);
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
if (this.props.type !== 'linear') {
var button = DomHandler.findSingle(this.container, '.p-speeddial-button');
var firstItem = DomHandler.findSingle(this.list, '.p-speeddial-item');
if (button && firstItem) {
var wDiff = Math.abs(button.offsetWidth - firstItem.offsetWidth);
var hDiff = Math.abs(button.offsetHeight - firstItem.offsetHeight);
this.list.style.setProperty('--item-diff-x', "".concat(wDiff / 2, "px"));
this.list.style.setProperty('--item-diff-y', "".concat(hDiff / 2, "px"));
}
}
if (this.props.hideOnClickOutside) {
this.bindDocumentClickListener();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.props.hideOnClickOutside) {
this.unbindDocumentClickListener();
}
}
}, {
key: "renderItem",
value: function renderItem(item, index) {
var _this3 = this;
var style = this.getItemStyle(index);
var disabled = item.disabled,
_icon = item.icon,
label = item.label,
template = item.template,
url = item.url,
target = item.target;
var contentClassName = classNames('p-speeddial-action', {
'p-disabled': disabled
});
var iconClassName = classNames('p-speeddial-action-icon', _icon);
var icon = _icon && /*#__PURE__*/React.createElement("span", {
className: iconClassName
});
var content = /*#__PURE__*/React.createElement("a", {
href: url || '#',
role: "menuitem",
className: contentClassName,
target: target,
"data-pr-tooltip": label,
onClick: function onClick(e) {
return _this3.onItemClick(e, item);
}
}, icon, /*#__PURE__*/React.createElement(Ripple, null));
if (template) {
var defaultContentOptions = {
onClick: function onClick(e) {
return _this3.onItemClick(e, item);
},
className: contentClassName,
iconClassName: iconClassName,
element: content,
props: this.props,
visible: this.isVisible()
};
content = ObjectUtils.getJSXElement(template, item, defaultContentOptions);
}
return /*#__PURE__*/React.createElement("li", {
key: index,
className: "p-speeddial-item",
style: style,
role: "none"
}, content);
}
}, {
key: "renderItems",
value: function renderItems() {
var _this4 = this;
if (this.props.model) {
return this.props.model.map(function (item, index) {
return _this4.renderItem(item, index);
});
}
return null;
}
}, {
key: "renderList",
value: function renderList() {
var _this5 = this;
var items = this.renderItems();
return /*#__PURE__*/React.createElement("ul", {
ref: function ref(el) {
return _this5.list = el;
},
className: "p-speeddial-list",
role: "menu"
}, items);
}
}, {
key: "renderButton",
value: function renderButton() {
var _classNames,
_this6 = this;
var visible = this.isVisible();
var className = classNames('p-speeddial-button p-button-rounded', {
'p-speeddial-rotate': this.props.rotateAnimation && !this.props.hideIcon
}, this.props.buttonClassName);
var iconClassName = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(this.props.showIcon), !visible && !!this.props.showIcon || !this.props.hideIcon), _defineProperty(_classNames, "".concat(this.props.hideIcon), visible && !!this.props.hideIcon), _classNames));
var content = /*#__PURE__*/React.createElement(Button, {
type: "button",
style: this.props.buttonStyle,
className: className,
icon: iconClassName,
onClick: this.onClick,
disabled: this.props.disabled
});
if (this.props.buttonTemplate) {
var defaultContentOptions = {
onClick: function onClick(event) {
return _this6.onClick(event);
},
className: className,
iconClassName: iconClassName,
element: content,
props: this.props,
visible: visible
};
return ObjectUtils.getJSXElement(this.props.buttonTemplate, defaultContentOptions);
}
return content;
}
}, {
key: "renderMask",
value: function renderMask() {
if (this.props.mask) {
var visible = this.isVisible();
var className = classNames('p-speeddial-mask', {
'p-speeddial-mask-visible': visible
}, this.props.maskClassName);
return /*#__PURE__*/React.createElement("div", {
className: className,
style: this.props.maskStyle
});
}
return null;
}
}, {
key: "render",
value: function render() {
var _classNames2,
_this7 = this;
var className = classNames("p-speeddial p-component p-speeddial-".concat(this.props.type), (_classNames2 = {}, _defineProperty(_classNames2, "p-speeddial-direction-".concat(this.props.direction), this.props.type !== 'circle'), _defineProperty(_classNames2, 'p-speeddial-opened', this.isVisible()), _defineProperty(_classNames2, 'p-disabled', this.props.disabled), _classNames2), this.props.className);
var button = this.renderButton();
var list = this.renderList();
var mask = this.renderMask();
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
ref: function ref(el) {
return _this7.container = el;
},
id: this.props.id,
className: className,
style: this.props.style
}, button, list), mask);
}
}]);
return SpeedDial;
}(Component);
_defineProperty(SpeedDial, "defaultProps", {
id: null,
model: null,
visible: false,
style: null,
className: null,
direction: 'up',
transitionDelay: 30,
type: 'linear',
radius: 0,
mask: false,
disabled: false,
hideOnClickOutside: true,
buttonStyle: null,
buttonClassName: null,
buttonTemplate: null,
maskStyle: null,
maskClassName: null,
showIcon: 'pi pi-plus',
hideIcon: null,
rotateAnimation: true,
onVisibleChange: null,
onClick: null,
onShow: null,
onHide: null
});
export { SpeedDial };
|
Server/app/assets/javascripts/components/PageToolbarComponent.js | codemeow5/InstFlow | import React from 'react';
export default React.createClass({
render: function(){
return (
<div className="page-toolbar">
<div className="btn-group btn-theme-panel">
<a href="javascript:;" className="btn dropdown-toggle" data-toggle="dropdown">
<i className="icon-settings"></i>
</a>
<div className="dropdown-menu theme-panel pull-right dropdown-custom hold-on-click">
<div className="row">
<div className="col-md-4 col-sm-4 col-xs-12">
<h3>HEADER</h3>
<ul className="theme-colors">
<li className="theme-color theme-color-default active" data-theme="default">
<span className="theme-color-view"></span>
<span className="theme-color-name">Dark Header</span>
</li>
<li className="theme-color theme-color-light " data-theme="light">
<span className="theme-color-view"></span>
<span className="theme-color-name">Light Header</span>
</li>
</ul>
</div>
<div className="col-md-8 col-sm-8 col-xs-12 seperator">
<h3>LAYOUT</h3>
<ul className="theme-settings">
<li> Layout
<select className="layout-option form-control input-small input-sm" defaultValue="fluid">
<option value="fluid">Fluid</option>
<option value="boxed">Boxed</option>
</select>
</li>
<li> Header
<select className="page-header-option form-control input-small input-sm" defaultValue="fixed">
<option value="fixed">Fixed</option>
<option value="default">Default</option>
</select>
</li>
<li> Top Dropdowns
<select className="page-header-top-dropdown-style-option form-control input-small input-sm" defaultValue="dark">
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
</li>
<li> Sidebar Mode
<select className="sidebar-option form-control input-small input-sm" defaultValue="default">
<option value="fixed">Fixed</option>
<option value="default">Default</option>
</select>
</li>
<li> Sidebar Menu
<select className="sidebar-menu-option form-control input-small input-sm" defaultValue="accordion">
<option value="accordion">Accordion</option>
<option value="hover">Hover</option>
</select>
</li>
<li> Sidebar Position
<select className="sidebar-pos-option form-control input-small input-sm" defaultValue="left">
<option value="left">Left</option>
<option value="right">Right</option>
</select>
</li>
<li> Footer
<select className="page-footer-option form-control input-small input-sm" defaultValue="default">
<option value="fixed">Fixed</option>
<option value="default">Default</option>
</select>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
);
}
}); |
Libraries/Image/Image.ios.js | salanki/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.
*
* @providesModule Image
* @flow
*/
'use strict';
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const ImageResizeMode = require('ImageResizeMode');
const ImageSourcePropType = require('ImageSourcePropType');
const ImageStylePropTypes = require('ImageStylePropTypes');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeModules = require('NativeModules');
const React = require('React');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
const StyleSheet = require('StyleSheet');
const StyleSheetPropType = require('StyleSheetPropType');
const flattenStyle = require('flattenStyle');
const requireNativeComponent = require('requireNativeComponent');
const resolveAssetSource = require('resolveAssetSource');
const PropTypes = React.PropTypes;
const ImageViewManager = NativeModules.ImageViewManager;
/**
* A React component for displaying different types of images,
* including network images, static resources, temporary local images, and
* images from local disk, such as the camera roll.
*
* This example shows both fetching and displaying an image from local storage as well as on from
* network.
*
* ```ReactNativeWebPlayer
* import React, { Component } from 'react';
* import { AppRegistry, View, Image } from 'react-native';
*
* class DisplayAnImage extends Component {
* render() {
* return (
* <View>
* <Image
* source={require('./img/favicon.png')}
* />
* <Image
* style={{width: 50, height: 50}}
* source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
* />
* </View>
* );
* }
* }
*
* // App registration and rendering
* AppRegistry.registerComponent('DisplayAnImage', () => DisplayAnImage);
* ```
*
* You can also add `style` to an image:
*
* ```ReactNativeWebPlayer
* import React, { Component } from 'react';
* import { AppRegistry, View, Image, StyleSheet } from 'react-native';
*
* const styles = StyleSheet.create({
* stretch: {
* width: 50,
* height: 200
* }
* });
*
* class DisplayAnImageWithStyle extends Component {
* render() {
* return (
* <View>
* <Image
* style={styles.stretch}
* source={require('./img/favicon.png')}
* />
* </View>
* );
* }
* }
*
* // App registration and rendering
* AppRegistry.registerComponent(
* 'DisplayAnImageWithStyle',
* () => DisplayAnImageWithStyle
* );
* ```
*
* ### GIF and WebP support on Android
*
* By default, GIF and WebP are not supported on Android.
*
* You will need to add some optional modules in `android/app/build.gradle`, depending on the needs of your app.
*
* ```
* dependencies {
* // If your app supports Android versions before Ice Cream Sandwich (API level 14)
* compile 'com.facebook.fresco:animated-base-support:0.11.0'
*
* // For animated GIF support
* compile 'com.facebook.fresco:animated-gif:0.11.0'
*
* // For WebP support, including animated WebP
* compile 'com.facebook.fresco:animated-webp:0.11.0'
* compile 'com.facebook.fresco:webpsupport:0.11.0'
*
* // For WebP support, without animations
* compile 'com.facebook.fresco:webpsupport:0.11.0'
* }
* ```
*
* Also, if you use GIF with ProGuard, you will need to add this rule in `proguard-rules.pro` :
* ```
* -keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl {
* public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier);
* }
* ```
*
*/
const Image = React.createClass({
propTypes: {
/**
* > `ImageResizeMode` is an `Enum` for different image resizing modes, set via the
* > `resizeMode` style property on `Image` components. The values are `contain`, `cover`,
* > `stretch`, `center`, `repeat`.
*/
style: StyleSheetPropType(ImageStylePropTypes),
/**
* The image source (either a remote URL or a local file resource).
*
* This prop can also contain several remote URLs, specified together with
* their width and height and potentially with scale/other URI arguments.
* The native side will then choose the best `uri` to display based on the
* measured size of the image container. A `cache` property can be added to
* control how networked request interacts with the local cache.
*/
source: ImageSourcePropType,
/**
* A static image to display while loading the image source.
*
* - `uri` - a string representing the resource identifier for the image, which
* should be either a local file path or the name of a static image resource
* (which should be wrapped in the `require('./path/to/image.png')` function).
* - `width`, `height` - can be specified if known at build time, in which case
* these will be used to set the default `<Image/>` component dimensions.
* - `scale` - used to indicate the scale factor of the image. Defaults to 1.0 if
* unspecified, meaning that one image pixel equates to one display point / DIP.
* - `number` - Opaque type returned by something like `require('./image.jpg')`.
*
* @platform ios
*/
defaultSource: PropTypes.oneOfType([
// TODO: Tooling to support documenting these directly and having them display in the docs.
PropTypes.shape({
uri: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number,
scale: PropTypes.number,
}),
PropTypes.number,
]),
/**
* When true, indicates the image is an accessibility element.
* @platform ios
*/
accessible: PropTypes.bool,
/**
* The text that's read by the screen reader when the user interacts with
* the image.
* @platform ios
*/
accessibilityLabel: PropTypes.string,
/**
* blurRadius: the blur radius of the blur filter added to the image
* @platform ios
*/
blurRadius: PropTypes.number,
/**
* When the image is resized, the corners of the size specified
* by `capInsets` will stay a fixed size, but the center content and borders
* of the image will be stretched. This is useful for creating resizable
* rounded buttons, shadows, and other resizable assets. More info in the
* [official Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/occ/instm/UIImage/resizableImageWithCapInsets).
*
* @platform ios
*/
capInsets: EdgeInsetsPropType,
/**
* The mechanism that should be used to resize the image when the image's dimensions
* differ from the image view's dimensions. Defaults to `auto`.
*
* - `auto`: Use heuristics to pick between `resize` and `scale`.
*
* - `resize`: A software operation which changes the encoded image in memory before it
* gets decoded. This should be used instead of `scale` when the image is much larger
* than the view.
*
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
* faster (usually hardware accelerated) and produces higher quality images. This
* should be used if the image is smaller than the view. It should also be used if the
* image is slightly bigger than the view.
*
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
*
* @platform android
*/
resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']),
/**
* Determines how to resize the image when the frame doesn't match the raw
* image dimensions.
*
* - `cover`: Scale the image uniformly (maintain the image's aspect ratio)
* so that both dimensions (width and height) of the image will be equal
* to or larger than the corresponding dimension of the view (minus padding).
*
* - `contain`: Scale the image uniformly (maintain the image's aspect ratio)
* so that both dimensions (width and height) of the image will be equal to
* or less than the corresponding dimension of the view (minus padding).
*
* - `stretch`: Scale width and height independently, This may change the
* aspect ratio of the src.
*
* - `repeat`: Repeat the image to cover the frame of the view. The
* image will keep it's size and aspect ratio. (iOS only)
*/
resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']),
/**
* A unique identifier for this element to be used in UI Automation
* testing scripts.
*/
testID: PropTypes.string,
/**
* Invoked on mount and layout changes with
* `{nativeEvent: {layout: {x, y, width, height}}}`.
*/
onLayout: PropTypes.func,
/**
* Invoked on load start.
*
* e.g., `onLoadStart={(e) => this.setState({loading: true})}`
*/
onLoadStart: PropTypes.func,
/**
* Invoked on download progress with `{nativeEvent: {loaded, total}}`.
* @platform ios
*/
onProgress: PropTypes.func,
/**
* Invoked on load error with `{nativeEvent: {error}}`.
*/
onError: PropTypes.func,
/**
* Invoked when a partial load of the image is complete. The definition of
* what constitutes a "partial load" is loader specific though this is meant
* for progressive JPEG loads.
* @platform ios
*/
onPartialLoad: PropTypes.func,
/**
* Invoked when load completes successfully.
*/
onLoad: PropTypes.func,
/**
* Invoked when load either succeeds or fails.
*/
onLoadEnd: PropTypes.func,
},
statics: {
resizeMode: ImageResizeMode,
/**
* Retrieve the width and height (in pixels) of an image prior to displaying it.
* This method can fail if the image cannot be found, or fails to download.
*
* In order to retrieve the image dimensions, the image may first need to be
* loaded or downloaded, after which it will be cached. This means that in
* principle you could use this method to preload images, however it is not
* optimized for that purpose, and may in future be implemented in a way that
* does not fully load/download the image data. A proper, supported way to
* preload images will be provided as a separate API.
*
* @param uri The location of the image.
* @param success The function that will be called if the image was sucessfully found and width
* and height retrieved.
* @param failure The function that will be called if there was an error, such as failing to
* to retrieve the image.
*
* @returns void
*
* @platform ios
*/
getSize: function(
uri: string,
success: (width: number, height: number) => void,
failure: (error: any) => void,
) {
ImageViewManager.getSize(uri, success, failure || function() {
console.warn('Failed to get size for image: ' + uri);
});
},
/**
* Prefetches a remote image for later use by downloading it to the disk
* cache
*
* @param url The remote location of the image.
*
* @return The prefetched image.
*/
prefetch(url: string) {
return ImageViewManager.prefetchImage(url);
},
/**
* Resolves an asset reference into an object which has the properties `uri`, `width`,
* and `height`. The input may either be a number (opaque type returned by
* require('./foo.png')) or an `ImageSource` like { uri: '<http location || file path>' }
*/
resolveAssetSource: resolveAssetSource,
},
mixins: [NativeMethodsMixin],
/**
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
* make `this` look like an actual native component class.
*/
viewConfig: {
uiViewClassName: 'UIView',
validAttributes: ReactNativeViewAttributes.UIView
},
render: function() {
const source = resolveAssetSource(this.props.source) || { uri: undefined, width: undefined, height: undefined };
let sources;
let style;
if (Array.isArray(source)) {
style = flattenStyle([styles.base, this.props.style]) || {};
sources = source;
} else {
const {width, height, uri} = source;
style = flattenStyle([{width, height}, styles.base, this.props.style]) || {};
sources = [source];
if (uri === '') {
console.warn('source.uri should not be an empty string');
}
}
const resizeMode = this.props.resizeMode || (style || {}).resizeMode || 'cover'; // Workaround for flow bug t7737108
const tintColor = (style || {}).tintColor; // Workaround for flow bug t7737108
if (this.props.src) {
console.warn('The <Image> component requires a `source` property rather than `src`.');
}
return (
<RCTImageView
{...this.props}
style={style}
resizeMode={resizeMode}
tintColor={tintColor}
source={sources}
/>
);
},
});
const styles = StyleSheet.create({
base: {
overflow: 'hidden',
},
});
const RCTImageView = requireNativeComponent('RCTImageView', Image);
module.exports = Image;
|
node_modules/react-icons/ti/th-large-outline.js | bairrada97/festival |
import React from 'react'
import Icon from 'react-icon-base'
const TiThLargeOutline = props => (
<Icon viewBox="0 0 40 40" {...props}>
<g><path d="m15 3.3h-8.3c-1.9 0-3.4 1.5-3.4 3.4v8.3c0 1.8 1.5 3.3 3.4 3.3h8.3c1.8 0 3.3-1.5 3.3-3.3v-8.3c0-1.9-1.5-3.4-3.3-3.4z m0 11.7h-8.3v-8.3h8.3v8.3z m18.3-11.7h-8.3c-1.8 0-3.3 1.5-3.3 3.4v8.3c0 1.8 1.5 3.3 3.3 3.3h8.3c1.9 0 3.4-1.5 3.4-3.3v-8.3c0-1.9-1.5-3.4-3.4-3.4z m0 11.7h-8.3v-8.3h8.3v8.3z m-18.3 6.7h-8.3c-1.9 0-3.4 1.5-3.4 3.3v8.3c0 1.9 1.5 3.4 3.4 3.4h8.3c1.8 0 3.3-1.5 3.3-3.4v-8.3c0-1.8-1.5-3.3-3.3-3.3z m0 11.6h-8.3v-8.3h8.3v8.3z m18.3-11.6h-8.3c-1.8 0-3.3 1.5-3.3 3.3v8.3c0 1.9 1.5 3.4 3.3 3.4h8.3c1.9 0 3.4-1.5 3.4-3.4v-8.3c0-1.8-1.5-3.3-3.4-3.3z m0 11.6h-8.3v-8.3h8.3v8.3z"/></g>
</Icon>
)
export default TiThLargeOutline
|
packages/idyll-cli/test/custom-ast/src/components/functional-component.js | idyll-lang/idyll | import React from 'react';
export default () => {
return <div>Let's put the fun back in functional!</div>;
};
|
generators/route/templates/component/_main-hooks.js | prescottprue/generator-react-firebase | import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import styles from './<%= componentName %>.styles'<% if (addStyle && styleType === 'scss') { %>
import classes from './<%= componentName %>.scss'<%}%>
const useStyles = makeStyles(styles)
function <%= componentName %>() {
const classes = useStyles()<% if (includeHook) { %>
const {} = use<%= startCaseName %>()<% } %>
return (
<% if (addStyle) { %><div className={classes.root}><% } else { %><div className="<%= name %>"><%}%>
<span><%= name %> Component</span><% if (includeEnhancer) { %>
<pre>{JSON.stringify(<%= camelName %>, null, 2)}</pre><%}%>
</div>
)
}
export default <%= componentName %>
|
ajax/libs/x-editable/1.4.4/jqueryui-editable/js/jqueryui-editable.js | DeuxHuitHuit/cdnjs | /*! X-editable - v1.4.4
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@uses text
@uses textarea
**/
(function ($) {
"use strict";
var EditableForm = function (div, options) {
this.options = $.extend({}, $.fn.editableform.defaults, options);
this.$div = $(div); //div, containing form. Not form tag. Not editable-element.
if(!this.options.scope) {
this.options.scope = this;
}
//nothing shown after init
};
EditableForm.prototype = {
constructor: EditableForm,
initInput: function() { //called once
//take input from options (as it is created in editable-element)
this.input = this.options.input;
//set initial value
//todo: may be add check: typeof str === 'string' ?
this.value = this.input.str2value(this.options.value);
},
initTemplate: function() {
this.$form = $($.fn.editableform.template);
},
initButtons: function() {
var $btn = this.$form.find('.editable-buttons');
$btn.append($.fn.editableform.buttons);
if(this.options.showbuttons === 'bottom') {
$btn.addClass('editable-buttons-bottom');
}
},
/**
Renders editableform
@method render
**/
render: function() {
//init loader
this.$loading = $($.fn.editableform.loading);
this.$div.empty().append(this.$loading);
//init form template and buttons
this.initTemplate();
if(this.options.showbuttons) {
this.initButtons();
} else {
this.$form.find('.editable-buttons').remove();
}
//show loading state
this.showLoading();
/**
Fired when rendering starts
@event rendering
@param {Object} event event object
**/
this.$div.triggerHandler('rendering');
//init input
this.initInput();
//append input to form
this.input.prerender();
this.$form.find('div.editable-input').append(this.input.$tpl);
//append form to container
this.$div.append(this.$form);
//render input
$.when(this.input.render())
.then($.proxy(function () {
//setup input to submit automatically when no buttons shown
if(!this.options.showbuttons) {
this.input.autosubmit();
}
//attach 'cancel' handler
this.$form.find('.editable-cancel').click($.proxy(this.cancel, this));
if(this.input.error) {
this.error(this.input.error);
this.$form.find('.editable-submit').attr('disabled', true);
this.input.$input.attr('disabled', true);
//prevent form from submitting
this.$form.submit(function(e){ e.preventDefault(); });
} else {
this.error(false);
this.input.$input.removeAttr('disabled');
this.$form.find('.editable-submit').removeAttr('disabled');
this.input.value2input(this.value);
//attach submit handler
this.$form.submit($.proxy(this.submit, this));
}
/**
Fired when form is rendered
@event rendered
@param {Object} event event object
**/
this.$div.triggerHandler('rendered');
this.showForm();
//call postrender method to perform actions required visibility of form
if(this.input.postrender) {
this.input.postrender();
}
}, this));
},
cancel: function() {
/**
Fired when form was cancelled by user
@event cancel
@param {Object} event event object
**/
this.$div.triggerHandler('cancel');
},
showLoading: function() {
var w, h;
if(this.$form) {
//set loading size equal to form
w = this.$form.outerWidth();
h = this.$form.outerHeight();
if(w) {
this.$loading.width(w);
}
if(h) {
this.$loading.height(h);
}
this.$form.hide();
} else {
//stretch loading to fill container width
w = this.$loading.parent().width();
if(w) {
this.$loading.width(w);
}
}
this.$loading.show();
},
showForm: function(activate) {
this.$loading.hide();
this.$form.show();
if(activate !== false) {
this.input.activate();
}
/**
Fired when form is shown
@event show
@param {Object} event event object
**/
this.$div.triggerHandler('show');
},
error: function(msg) {
var $group = this.$form.find('.control-group'),
$block = this.$form.find('.editable-error-block'),
lines;
if(msg === false) {
$group.removeClass($.fn.editableform.errorGroupClass);
$block.removeClass($.fn.editableform.errorBlockClass).empty().hide();
} else {
//convert newline to <br> for more pretty error display
if(msg) {
lines = msg.split("\n");
for (var i = 0; i < lines.length; i++) {
lines[i] = $('<div>').text(lines[i]).html();
}
msg = lines.join('<br>');
}
$group.addClass($.fn.editableform.errorGroupClass);
$block.addClass($.fn.editableform.errorBlockClass).html(msg).show();
}
},
submit: function(e) {
e.stopPropagation();
e.preventDefault();
var error,
newValue = this.input.input2value(); //get new value from input
//validation
if (error = this.validate(newValue)) {
this.error(error);
this.showForm();
return;
}
//if value not changed --> trigger 'nochange' event and return
/*jslint eqeq: true*/
if (!this.options.savenochange && this.input.value2str(newValue) == this.input.value2str(this.value)) {
/*jslint eqeq: false*/
/**
Fired when value not changed but form is submitted. Requires savenochange = false.
@event nochange
@param {Object} event event object
**/
this.$div.triggerHandler('nochange');
return;
}
//sending data to server
$.when(this.save(newValue))
.done($.proxy(function(response) {
//run success callback
var res = typeof this.options.success === 'function' ? this.options.success.call(this.options.scope, response, newValue) : null;
//if success callback returns false --> keep form open and do not activate input
if(res === false) {
this.error(false);
this.showForm(false);
return;
}
//if success callback returns string --> keep form open, show error and activate input
if(typeof res === 'string') {
this.error(res);
this.showForm();
return;
}
//if success callback returns object like {newValue: <something>} --> use that value instead of submitted
//it is usefull if you want to chnage value in url-function
if(res && typeof res === 'object' && res.hasOwnProperty('newValue')) {
newValue = res.newValue;
}
//clear error message
this.error(false);
this.value = newValue;
/**
Fired when form is submitted
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue submitted value
@param {Object} params.response ajax response
@example
$('#form-div').on('save'), function(e, params){
if(params.newValue === 'username') {...}
});
**/
this.$div.triggerHandler('save', {newValue: newValue, response: response});
}, this))
.fail($.proxy(function(xhr) {
var msg;
if(typeof this.options.error === 'function') {
msg = this.options.error.call(this.options.scope, xhr, newValue);
} else {
msg = typeof xhr === 'string' ? xhr : xhr.responseText || xhr.statusText || 'Unknown error!';
}
this.error(msg);
this.showForm();
}, this));
},
save: function(newValue) {
//convert value for submitting to server
var submitValue = this.input.value2submit(newValue);
//try parse composite pk defined as json string in data-pk
this.options.pk = $.fn.editableutils.tryParseJson(this.options.pk, true);
var pk = (typeof this.options.pk === 'function') ? this.options.pk.call(this.options.scope) : this.options.pk,
send = !!(typeof this.options.url === 'function' || (this.options.url && ((this.options.send === 'always') || (this.options.send === 'auto' && pk !== null && pk !== undefined)))),
params;
if (send) { //send to server
this.showLoading();
//standard params
params = {
name: this.options.name || '',
value: submitValue,
pk: pk
};
//additional params
if(typeof this.options.params === 'function') {
params = this.options.params.call(this.options.scope, params);
} else {
//try parse json in single quotes (from data-params attribute)
this.options.params = $.fn.editableutils.tryParseJson(this.options.params, true);
$.extend(params, this.options.params);
}
if(typeof this.options.url === 'function') { //user's function
return this.options.url.call(this.options.scope, params);
} else {
//send ajax to server and return deferred object
return $.ajax($.extend({
url : this.options.url,
data : params,
type : 'POST'
}, this.options.ajaxOptions));
}
}
},
validate: function (value) {
if (value === undefined) {
value = this.value;
}
if (typeof this.options.validate === 'function') {
return this.options.validate.call(this.options.scope, value);
}
},
option: function(key, value) {
if(key in this.options) {
this.options[key] = value;
}
if(key === 'value') {
this.setValue(value);
}
//do not pass option to input as it is passed in editable-element
},
setValue: function(value, convertStr) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
//if form is visible, update input
if(this.$form && this.$form.is(':visible')) {
this.input.value2input(this.value);
}
}
};
/*
Initialize editableform. Applied to jQuery object.
@method $().editableform(options)
@params {Object} options
@example
var $form = $('<div>').editableform({
type: 'text',
name: 'username',
url: '/post',
value: 'vitaliy'
});
//to display form you should call 'render' method
$form.editableform('render');
*/
$.fn.editableform = function (option) {
var args = arguments;
return this.each(function () {
var $this = $(this),
data = $this.data('editableform'),
options = typeof option === 'object' && option;
if (!data) {
$this.data('editableform', (data = new EditableForm(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
//keep link to constructor to allow inheritance
$.fn.editableform.Constructor = EditableForm;
//defaults
$.fn.editableform.defaults = {
/* see also defaults for input */
/**
Type of input. Can be <code>text|textarea|select|date|checklist</code>
@property type
@type string
@default 'text'
**/
type: 'text',
/**
Url for submit, e.g. <code>'/post'</code>
If function - it will be called instead of ajax. Function should return deferred object to run fail/done callbacks.
@property url
@type string|function
@default null
@example
url: function(params) {
var d = new $.Deferred;
if(params.value === 'abc') {
return d.reject('error message'); //returning error via deferred object
} else {
//async saving data in js model
someModel.asyncSaveMethod({
...,
success: function(){
d.resolve();
}
});
return d.promise();
}
}
**/
url:null,
/**
Additional params for submit. If defined as <code>object</code> - it is **appended** to original ajax data (pk, name and value).
If defined as <code>function</code> - returned object **overwrites** original ajax data.
@example
params: function(params) {
//originally params contain pk, name and value
params.a = 1;
return params;
}
@property params
@type object|function
@default null
**/
params:null,
/**
Name of field. Will be submitted on server. Can be taken from <code>id</code> attribute
@property name
@type string
@default null
**/
name: null,
/**
Primary key of editable object (e.g. record id in database). For composite keys use object, e.g. <code>{id: 1, lang: 'en'}</code>.
Can be calculated dynamically via function.
@property pk
@type string|object|function
@default null
**/
pk: null,
/**
Initial value. If not defined - will be taken from element's content.
For __select__ type should be defined (as it is ID of shown text).
@property value
@type string|object
@default null
**/
value: null,
/**
Strategy for sending data on server. Can be <code>auto|always|never</code>.
When 'auto' data will be sent on server only if pk defined, otherwise new value will be stored in element.
@property send
@type string
@default 'auto'
**/
send: 'auto',
/**
Function for client-side validation. If returns string - means validation not passed and string showed as error.
@property validate
@type function
@default null
@example
validate: function(value) {
if($.trim(value) == '') {
return 'This field is required';
}
}
**/
validate: null,
/**
Success callback. Called when value successfully sent on server and **response status = 200**.
Usefull to work with json response. For example, if your backend response can be <code>{success: true}</code>
or <code>{success: false, msg: "server error"}</code> you can check it inside this callback.
If it returns **string** - means error occured and string is shown as error message.
If it returns **object like** <code>{newValue: <something>}</code> - it overwrites value, submitted by user.
Otherwise newValue simply rendered into element.
@property success
@type function
@default null
@example
success: function(response, newValue) {
if(!response.success) return response.msg;
}
**/
success: null,
/**
Error callback. Called when request failed (response status != 200).
Usefull when you want to parse error response and display a custom message.
Must return **string** - the message to be displayed in the error block.
@property error
@type function
@default null
@since 1.4.4
@example
error: function(response, newValue) {
if(response.status === 500) {
return 'Service unavailable. Please try later.';
} else {
return response.responseText;
}
}
**/
error: null,
/**
Additional options for submit ajax request.
List of values: http://api.jquery.com/jQuery.ajax
@property ajaxOptions
@type object
@default null
@since 1.1.1
@example
ajaxOptions: {
type: 'put',
dataType: 'json'
}
**/
ajaxOptions: null,
/**
Where to show buttons: left(true)|bottom|false
Form without buttons is auto-submitted.
@property showbuttons
@type boolean|string
@default true
@since 1.1.1
**/
showbuttons: true,
/**
Scope for callback methods (success, validate).
If <code>null</code> means editableform instance itself.
@property scope
@type DOMElement|object
@default null
@since 1.2.0
@private
**/
scope: null,
/**
Whether to save or cancel value when it was not changed but form was submitted
@property savenochange
@type boolean
@default false
@since 1.2.0
**/
savenochange: false
};
/*
Note: following params could redefined in engine: bootstrap or jqueryui:
Classes 'control-group' and 'editable-error-block' must always present!
*/
$.fn.editableform.template = '<form class="form-inline editableform">'+
'<div class="control-group">' +
'<div><div class="editable-input"></div><div class="editable-buttons"></div></div>'+
'<div class="editable-error-block"></div>' +
'</div>' +
'</form>';
//loading div
$.fn.editableform.loading = '<div class="editableform-loading"></div>';
//buttons
$.fn.editableform.buttons = '<button type="submit" class="editable-submit">ok</button>'+
'<button type="button" class="editable-cancel">cancel</button>';
//error class attached to control-group
$.fn.editableform.errorGroupClass = null;
//error class attached to editable-error-block
$.fn.editableform.errorBlockClass = 'editable-error';
}(window.jQuery));
/**
* EditableForm utilites
*/
(function ($) {
"use strict";
//utils
$.fn.editableutils = {
/**
* classic JS inheritance function
*/
inherit: function (Child, Parent) {
var F = function() { };
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.superclass = Parent.prototype;
},
/**
* set caret position in input
* see http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area
*/
setCursorPosition: function(elem, pos) {
if (elem.setSelectionRange) {
elem.setSelectionRange(pos, pos);
} else if (elem.createTextRange) {
var range = elem.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
},
/**
* function to parse JSON in *single* quotes. (jquery automatically parse only double quotes)
* That allows such code as: <a data-source="{'a': 'b', 'c': 'd'}">
* safe = true --> means no exception will be thrown
* for details see http://stackoverflow.com/questions/7410348/how-to-set-json-format-to-html5-data-attributes-in-the-jquery
*/
tryParseJson: function(s, safe) {
if (typeof s === 'string' && s.length && s.match(/^[\{\[].*[\}\]]$/)) {
if (safe) {
try {
/*jslint evil: true*/
s = (new Function('return ' + s))();
/*jslint evil: false*/
} catch (e) {} finally {
return s;
}
} else {
/*jslint evil: true*/
s = (new Function('return ' + s))();
/*jslint evil: false*/
}
}
return s;
},
/**
* slice object by specified keys
*/
sliceObj: function(obj, keys, caseSensitive /* default: false */) {
var key, keyLower, newObj = {};
if (!$.isArray(keys) || !keys.length) {
return newObj;
}
for (var i = 0; i < keys.length; i++) {
key = keys[i];
if (obj.hasOwnProperty(key)) {
newObj[key] = obj[key];
}
if(caseSensitive === true) {
continue;
}
//when getting data-* attributes via $.data() it's converted to lowercase.
//details: http://stackoverflow.com/questions/7602565/using-data-attributes-with-jquery
//workaround is code below.
keyLower = key.toLowerCase();
if (obj.hasOwnProperty(keyLower)) {
newObj[key] = obj[keyLower];
}
}
return newObj;
},
/*
exclude complex objects from $.data() before pass to config
*/
getConfigData: function($element) {
var data = {};
$.each($element.data(), function(k, v) {
if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {
data[k] = v;
}
});
return data;
},
/*
returns keys of object
*/
objectKeys: function(o) {
if (Object.keys) {
return Object.keys(o);
} else {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
var k=[], p;
for (p in o) {
if (Object.prototype.hasOwnProperty.call(o,p)) {
k.push(p);
}
}
return k;
}
},
/**
method to escape html.
**/
escape: function(str) {
return $('<div>').text(str).html();
},
/*
returns array items from sourceData having value property equal or inArray of 'value'
*/
itemsByValue: function(value, sourceData, valueProp) {
if(!sourceData || value === null) {
return [];
}
valueProp = valueProp || 'value';
var isValArray = $.isArray(value),
result = [],
that = this;
$.each(sourceData, function(i, o) {
if(o.children) {
result = result.concat(that.itemsByValue(value, o.children, valueProp));
} else {
/*jslint eqeq: true*/
if(isValArray) {
if($.grep(value, function(v){ return v == (o && typeof o === 'object' ? o[valueProp] : o); }).length) {
result.push(o);
}
} else {
if(value == (o && typeof o === 'object' ? o[valueProp] : o)) {
result.push(o);
}
}
/*jslint eqeq: false*/
}
});
return result;
},
/*
Returns input by options: type, mode.
*/
createInput: function(options) {
var TypeConstructor, typeOptions, input,
type = options.type;
//`date` is some kind of virtual type that is transformed to one of exact types
//depending on mode and core lib
if(type === 'date') {
//inline
if(options.mode === 'inline') {
if($.fn.editabletypes.datefield) {
type = 'datefield';
} else if($.fn.editabletypes.dateuifield) {
type = 'dateuifield';
}
//popup
} else {
if($.fn.editabletypes.date) {
type = 'date';
} else if($.fn.editabletypes.dateui) {
type = 'dateui';
}
}
//if type still `date` and not exist in types, replace with `combodate` that is base input
if(type === 'date' && !$.fn.editabletypes.date) {
type = 'combodate';
}
}
//`datetime` should be datetimefield in 'inline' mode
if(type === 'datetime' && options.mode === 'inline') {
type = 'datetimefield';
}
//change wysihtml5 to textarea for jquery UI and plain versions
if(type === 'wysihtml5' && !$.fn.editabletypes[type]) {
type = 'textarea';
}
//create input of specified type. Input will be used for converting value, not in form
if(typeof $.fn.editabletypes[type] === 'function') {
TypeConstructor = $.fn.editabletypes[type];
typeOptions = this.sliceObj(options, this.objectKeys(TypeConstructor.defaults));
input = new TypeConstructor(typeOptions);
return input;
} else {
$.error('Unknown type: '+ type);
return false;
}
}
};
}(window.jQuery));
/**
Attaches stand-alone container with editable-form to HTML element. Element is used only for positioning, value is not stored anywhere.<br>
This method applied internally in <code>$().editable()</code>. You should subscribe on it's events (save / cancel) to get profit of it.<br>
Final realization can be different: bootstrap-popover, jqueryui-tooltip, poshytip, inline-div. It depends on which js file you include.<br>
Applied as jQuery method.
@class editableContainer
@uses editableform
**/
(function ($) {
"use strict";
var Popup = function (element, options) {
this.init(element, options);
};
var Inline = function (element, options) {
this.init(element, options);
};
//methods
Popup.prototype = {
containerName: null, //tbd in child class
innerCss: null, //tbd in child class
containerClass: 'editable-container editable-popup', //css class applied to container element
init: function(element, options) {
this.$element = $(element);
//since 1.4.1 container do not use data-* directly as they already merged into options.
this.options = $.extend({}, $.fn.editableContainer.defaults, options);
this.splitOptions();
//set scope of form callbacks to element
this.formOptions.scope = this.$element[0];
this.initContainer();
//bind 'destroyed' listener to destroy container when element is removed from dom
this.$element.on('destroyed', $.proxy(function(){
this.destroy();
}, this));
//attach document handler to close containers on click / escape
if(!$(document).data('editable-handlers-attached')) {
//close all on escape
$(document).on('keyup.editable', function (e) {
if (e.which === 27) {
$('.editable-open').editableContainer('hide');
//todo: return focus on element
}
});
//close containers when click outside
//(mousedown could be better than click, it closes everything also on drag drop)
$(document).on('click.editable', function(e) {
var $target = $(e.target), i,
exclude_classes = ['.editable-container',
'.ui-datepicker-header',
'.datepicker', //in inline mode datepicker is rendered into body
'.modal-backdrop',
'.bootstrap-wysihtml5-insert-image-modal',
'.bootstrap-wysihtml5-insert-link-modal'
];
//check if element is detached. It occurs when clicking in bootstrap datepicker
if (!$.contains(document.documentElement, e.target)) {
return;
}
//for some reason FF 20 generates extra event (click) in select2 widget with e.target = document
//we need to filter it via construction below. See https://github.com/vitalets/x-editable/issues/199
//Possibly related to http://stackoverflow.com/questions/10119793/why-does-firefox-react-differently-from-webkit-and-ie-to-click-event-on-selec
if($target.is(document)) {
return;
}
//if click inside one of exclude classes --> no nothing
for(i=0; i<exclude_classes.length; i++) {
if($target.is(exclude_classes[i]) || $target.parents(exclude_classes[i]).length) {
return;
}
}
//close all open containers (except one - target)
Popup.prototype.closeOthers(e.target);
});
$(document).data('editable-handlers-attached', true);
}
},
//split options on containerOptions and formOptions
splitOptions: function() {
this.containerOptions = {};
this.formOptions = {};
if(!$.fn[this.containerName]) {
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
}
var cDef = $.fn[this.containerName].defaults;
//keys defined in container defaults go to container, others go to form
for(var k in this.options) {
if(k in cDef) {
this.containerOptions[k] = this.options[k];
} else {
this.formOptions[k] = this.options[k];
}
}
},
/*
Returns jquery object of container
@method tip()
*/
tip: function() {
return this.container() ? this.container().$tip : null;
},
/* returns container object */
container: function() {
return this.$element.data(this.containerDataName || this.containerName);
},
/* call native method of underlying container, e.g. this.$element.popover('method') */
call: function() {
this.$element[this.containerName].apply(this.$element, arguments);
},
initContainer: function(){
this.call(this.containerOptions);
},
renderForm: function() {
this.$form
.editableform(this.formOptions)
.on({
save: $.proxy(this.save, this), //click on submit button (value changed)
nochange: $.proxy(function(){ this.hide('nochange'); }, this), //click on submit button (value NOT changed)
cancel: $.proxy(function(){ this.hide('cancel'); }, this), //click on calcel button
show: $.proxy(this.setPosition, this), //re-position container every time form is shown (occurs each time after loading state)
rendering: $.proxy(this.setPosition, this), //this allows to place container correctly when loading shown
resize: $.proxy(this.setPosition, this), //this allows to re-position container when form size is changed
rendered: $.proxy(function(){
/**
Fired when container is shown and form is rendered (for select will wait for loading dropdown options).
**Note:** Bootstrap popover has own `shown` event that now cannot be separated from x-editable's one.
The workaround is to check `arguments.length` that is always `2` for x-editable.
@event shown
@param {Object} event event object
@example
$('#username').on('shown', function(e, editable) {
editable.input.$input.val('overwriting value of input..');
});
**/
/*
TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events.
*/
this.$element.triggerHandler('shown', this);
}, this)
})
.editableform('render');
},
/**
Shows container with form
@method show()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
/* Note: poshytip owerwrites this method totally! */
show: function (closeAll) {
this.$element.addClass('editable-open');
if(closeAll !== false) {
//close all open containers (except this)
this.closeOthers(this.$element[0]);
}
//show container itself
this.innerShow();
this.tip().addClass(this.containerClass);
/*
Currently, form is re-rendered on every show.
The main reason is that we dont know, what container will do with content when closed:
remove(), detach() or just hide().
Detaching form itself before hide and re-insert before show is good solution,
but visually it looks ugly, as container changes size before hide.
*/
//if form already exist - delete previous data
if(this.$form) {
//todo: destroy prev data!
//this.$form.destroy();
}
this.$form = $('<div>');
//insert form into container body
if(this.tip().is(this.innerCss)) {
//for inline container
this.tip().append(this.$form);
} else {
this.tip().find(this.innerCss).append(this.$form);
}
//render form
this.renderForm();
},
/**
Hides container with form
@method hide()
@param {string} reason Reason caused hiding. Can be <code>save|cancel|onblur|nochange|undefined (=manual)</code>
**/
hide: function(reason) {
if(!this.tip() || !this.tip().is(':visible') || !this.$element.hasClass('editable-open')) {
return;
}
this.$element.removeClass('editable-open');
this.innerHide();
/**
Fired when container was hidden. It occurs on both save or cancel.
**Note:** Bootstrap popover has own `hidden` event that now cannot be separated from x-editable's one.
The workaround is to check `arguments.length` that is always `2` for x-editable.
@event hidden
@param {object} event event object
@param {string} reason Reason caused hiding. Can be <code>save|cancel|onblur|nochange|manual</code>
@example
$('#username').on('hidden', function(e, reason) {
if(reason === 'save' || reason === 'cancel') {
//auto-open next editable
$(this).closest('tr').next().find('.editable').editable('show');
}
});
**/
this.$element.triggerHandler('hidden', reason || 'manual');
},
/* internal show method. To be overwritten in child classes */
innerShow: function () {
},
/* internal hide method. To be overwritten in child classes */
innerHide: function () {
},
/**
Toggles container visibility (show / hide)
@method toggle()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
toggle: function(closeAll) {
if(this.container() && this.tip() && this.tip().is(':visible')) {
this.hide();
} else {
this.show(closeAll);
}
},
/*
Updates the position of container when content changed.
@method setPosition()
*/
setPosition: function() {
//tbd in child class
},
save: function(e, params) {
/**
Fired when new value was submitted. You can use <code>$(this).data('editableContainer')</code> inside handler to access to editableContainer instance
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue submitted value
@param {Object} params.response ajax response
@example
$('#username').on('save', function(e, params) {
//assuming server response: '{success: true}'
var pk = $(this).data('editableContainer').options.pk;
if(params.response && params.response.success) {
alert('value: ' + params.newValue + ' with pk: ' + pk + ' saved!');
} else {
alert('error!');
}
});
**/
this.$element.triggerHandler('save', params);
//hide must be after trigger, as saving value may require methods od plugin, applied to input
this.hide('save');
},
/**
Sets new option
@method option(key, value)
@param {string} key
@param {mixed} value
**/
option: function(key, value) {
this.options[key] = value;
if(key in this.containerOptions) {
this.containerOptions[key] = value;
this.setContainerOption(key, value);
} else {
this.formOptions[key] = value;
if(this.$form) {
this.$form.editableform('option', key, value);
}
}
},
setContainerOption: function(key, value) {
this.call('option', key, value);
},
/**
Destroys the container instance
@method destroy()
**/
destroy: function() {
this.hide();
this.innerDestroy();
this.$element.off('destroyed');
this.$element.removeData('editableContainer');
},
/* to be overwritten in child classes */
innerDestroy: function() {
},
/*
Closes other containers except one related to passed element.
Other containers can be cancelled or submitted (depends on onblur option)
*/
closeOthers: function(element) {
$('.editable-open').each(function(i, el){
//do nothing with passed element and it's children
if(el === element || $(el).find(element).length) {
return;
}
//otherwise cancel or submit all open containers
var $el = $(el),
ec = $el.data('editableContainer');
if(!ec) {
return;
}
if(ec.options.onblur === 'cancel') {
$el.data('editableContainer').hide('onblur');
} else if(ec.options.onblur === 'submit') {
$el.data('editableContainer').tip().find('form').submit();
}
});
},
/**
Activates input of visible container (e.g. set focus)
@method activate()
**/
activate: function() {
if(this.tip && this.tip().is(':visible') && this.$form) {
this.$form.data('editableform').input.activate();
}
}
};
/**
jQuery method to initialize editableContainer.
@method $().editableContainer(options)
@params {Object} options
@example
$('#edit').editableContainer({
type: 'text',
url: '/post',
pk: 1,
value: 'hello'
});
**/
$.fn.editableContainer = function (option) {
var args = arguments;
return this.each(function () {
var $this = $(this),
dataKey = 'editableContainer',
data = $this.data(dataKey),
options = typeof option === 'object' && option,
Constructor = (options.mode === 'inline') ? Inline : Popup;
if (!data) {
$this.data(dataKey, (data = new Constructor(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
//store constructors
$.fn.editableContainer.Popup = Popup;
$.fn.editableContainer.Inline = Inline;
//defaults
$.fn.editableContainer.defaults = {
/**
Initial value of form input
@property value
@type mixed
@default null
@private
**/
value: null,
/**
Placement of container relative to element. Can be <code>top|right|bottom|left</code>. Not used for inline container.
@property placement
@type string
@default 'top'
**/
placement: 'top',
/**
Whether to hide container on save/cancel.
@property autohide
@type boolean
@default true
@private
**/
autohide: true,
/**
Action when user clicks outside the container. Can be <code>cancel|submit|ignore</code>.
Setting <code>ignore</code> allows to have several containers open.
@property onblur
@type string
@default 'cancel'
@since 1.1.1
**/
onblur: 'cancel',
/**
Animation speed (inline mode)
@property anim
@type string
@default false
**/
anim: false,
/**
Mode of editable, can be `popup` or `inline`
@property mode
@type string
@default 'popup'
@since 1.4.0
**/
mode: 'popup'
};
/*
* workaround to have 'destroyed' event to destroy popover when element is destroyed
* see http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom
*/
jQuery.event.special.destroyed = {
remove: function(o) {
if (o.handler) {
o.handler();
}
}
};
}(window.jQuery));
/**
* Editable Inline
* ---------------------
*/
(function ($) {
"use strict";
//copy prototype from EditableContainer
//extend methods
$.extend($.fn.editableContainer.Inline.prototype, $.fn.editableContainer.Popup.prototype, {
containerName: 'editableform',
innerCss: '.editable-inline',
containerClass: 'editable-container editable-inline', //css class applied to container element
initContainer: function(){
//container is <span> element
this.$tip = $('<span></span>');
//convert anim to miliseconds (int)
if(!this.options.anim) {
this.options.anim = 0;
}
},
splitOptions: function() {
//all options are passed to form
this.containerOptions = {};
this.formOptions = this.options;
},
tip: function() {
return this.$tip;
},
innerShow: function () {
this.$element.hide();
this.tip().insertAfter(this.$element).show();
},
innerHide: function () {
this.$tip.hide(this.options.anim, $.proxy(function() {
this.$element.show();
this.innerDestroy();
}, this));
},
innerDestroy: function() {
if(this.tip()) {
this.tip().empty().remove();
}
}
});
}(window.jQuery));
/**
Makes editable any HTML element on the page. Applied as jQuery method.
@class editable
@uses editableContainer
**/
(function ($) {
"use strict";
var Editable = function (element, options) {
this.$element = $(element);
//data-* has more priority over js options: because dynamically created elements may change data-*
this.options = $.extend({}, $.fn.editable.defaults, options, $.fn.editableutils.getConfigData(this.$element));
if(this.options.selector) {
this.initLive();
} else {
this.init();
}
};
Editable.prototype = {
constructor: Editable,
init: function () {
var isValueByText = false,
doAutotext, finalize;
//name
this.options.name = this.options.name || this.$element.attr('id');
//create input of specified type. Input needed already here to convert value for initial display (e.g. show text by id for select)
//also we set scope option to have access to element inside input specific callbacks (e. g. source as function)
this.options.scope = this.$element[0];
this.input = $.fn.editableutils.createInput(this.options);
if(!this.input) {
return;
}
//set value from settings or by element's text
if (this.options.value === undefined || this.options.value === null) {
this.value = this.input.html2value($.trim(this.$element.html()));
isValueByText = true;
} else {
/*
value can be string when received from 'data-value' attribute
for complext objects value can be set as json string in data-value attribute,
e.g. data-value="{city: 'Moscow', street: 'Lenina'}"
*/
this.options.value = $.fn.editableutils.tryParseJson(this.options.value, true);
if(typeof this.options.value === 'string') {
this.value = this.input.str2value(this.options.value);
} else {
this.value = this.options.value;
}
}
//add 'editable' class to every editable element
this.$element.addClass('editable');
//attach handler activating editable. In disabled mode it just prevent default action (useful for links)
if(this.options.toggle !== 'manual') {
this.$element.addClass('editable-click');
this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){
//prevent following link
e.preventDefault();
//stop propagation not required because in document click handler it checks event target
//e.stopPropagation();
if(this.options.toggle === 'mouseenter') {
//for hover only show container
this.show();
} else {
//when toggle='click' we should not close all other containers as they will be closed automatically in document click listener
var closeAll = (this.options.toggle !== 'click');
this.toggle(closeAll);
}
}, this));
} else {
this.$element.attr('tabindex', -1); //do not stop focus on element when toggled manually
}
//check conditions for autotext:
switch(this.options.autotext) {
case 'always':
doAutotext = true;
break;
case 'auto':
//if element text is empty and value is defined and value not generated by text --> run autotext
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
break;
default:
doAutotext = false;
}
//depending on autotext run render() or just finilize init
$.when(doAutotext ? this.render() : true).then($.proxy(function() {
if(this.options.disabled) {
this.disable();
} else {
this.enable();
}
/**
Fired when element was initialized by `$().editable()` method.
Please note that you should setup `init` handler **before** applying `editable`.
@event init
@param {Object} event event object
@param {Object} editable editable instance (as here it cannot accessed via data('editable'))
@since 1.2.0
@example
$('#username').on('init', function(e, editable) {
alert('initialized ' + editable.options.name);
});
$('#username').editable();
**/
this.$element.triggerHandler('init', this);
}, this));
},
/*
Initializes parent element for live editables
*/
initLive: function() {
//store selector
var selector = this.options.selector;
//modify options for child elements
this.options.selector = false;
this.options.autotext = 'never';
//listen toggle events
this.$element.on(this.options.toggle + '.editable', selector, $.proxy(function(e){
var $target = $(e.target);
if(!$target.data('editable')) {
//if delegated element initially empty, we need to clear it's text (that was manually set to `empty` by user)
//see https://github.com/vitalets/x-editable/issues/137
if($target.hasClass(this.options.emptyclass)) {
$target.empty();
}
$target.editable(this.options).trigger(e);
}
}, this));
},
/*
Renders value into element's text.
Can call custom display method from options.
Can return deferred object.
@method render()
@param {mixed} response server response (if exist) to pass into display function
*/
render: function(response) {
//do not display anything
if(this.options.display === false) {
return;
}
//if input has `value2htmlFinal` method, we pass callback in third param to be called when source is loaded
if(this.input.value2htmlFinal) {
return this.input.value2html(this.value, this.$element[0], this.options.display, response);
//if display method defined --> use it
} else if(typeof this.options.display === 'function') {
return this.options.display.call(this.$element[0], this.value, response);
//else use input's original value2html() method
} else {
return this.input.value2html(this.value, this.$element[0]);
}
},
/**
Enables editable
@method enable()
**/
enable: function() {
this.options.disabled = false;
this.$element.removeClass('editable-disabled');
this.handleEmpty(this.isEmpty);
if(this.options.toggle !== 'manual') {
if(this.$element.attr('tabindex') === '-1') {
this.$element.removeAttr('tabindex');
}
}
},
/**
Disables editable
@method disable()
**/
disable: function() {
this.options.disabled = true;
this.hide();
this.$element.addClass('editable-disabled');
this.handleEmpty(this.isEmpty);
//do not stop focus on this element
this.$element.attr('tabindex', -1);
},
/**
Toggles enabled / disabled state of editable element
@method toggleDisabled()
**/
toggleDisabled: function() {
if(this.options.disabled) {
this.enable();
} else {
this.disable();
}
},
/**
Sets new option
@method option(key, value)
@param {string|object} key option name or object with several options
@param {mixed} value option new value
@example
$('.editable').editable('option', 'pk', 2);
**/
option: function(key, value) {
//set option(s) by object
if(key && typeof key === 'object') {
$.each(key, $.proxy(function(k, v){
this.option($.trim(k), v);
}, this));
return;
}
//set option by string
this.options[key] = value;
//disabled
if(key === 'disabled') {
return value ? this.disable() : this.enable();
}
//value
if(key === 'value') {
this.setValue(value);
}
//transfer new option to container!
if(this.container) {
this.container.option(key, value);
}
//pass option to input directly (as it points to the same in form)
if(this.input.option) {
this.input.option(key, value);
}
},
/*
* set emptytext if element is empty
*/
handleEmpty: function (isEmpty) {
//do not handle empty if we do not display anything
if(this.options.display === false) {
return;
}
this.isEmpty = isEmpty !== undefined ? isEmpty : $.trim(this.$element.text()) === '';
//emptytext shown only for enabled
if(!this.options.disabled) {
if (this.isEmpty) {
this.$element.text(this.options.emptytext);
if(this.options.emptyclass) {
this.$element.addClass(this.options.emptyclass);
}
} else if(this.options.emptyclass) {
this.$element.removeClass(this.options.emptyclass);
}
} else {
//below required if element disable property was changed
if(this.isEmpty) {
this.$element.empty();
if(this.options.emptyclass) {
this.$element.removeClass(this.options.emptyclass);
}
}
}
},
/**
Shows container with form
@method show()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
show: function (closeAll) {
if(this.options.disabled) {
return;
}
//init editableContainer: popover, tooltip, inline, etc..
if(!this.container) {
var containerOptions = $.extend({}, this.options, {
value: this.value,
input: this.input //pass input to form (as it is already created)
});
this.$element.editableContainer(containerOptions);
//listen `save` event
this.$element.on("save.internal", $.proxy(this.save, this));
this.container = this.$element.data('editableContainer');
} else if(this.container.tip().is(':visible')) {
return;
}
//show container
this.container.show(closeAll);
},
/**
Hides container with form
@method hide()
**/
hide: function () {
if(this.container) {
this.container.hide();
}
},
/**
Toggles container visibility (show / hide)
@method toggle()
@param {boolean} closeAll Whether to close all other editable containers when showing this one. Default true.
**/
toggle: function(closeAll) {
if(this.container && this.container.tip().is(':visible')) {
this.hide();
} else {
this.show(closeAll);
}
},
/*
* called when form was submitted
*/
save: function(e, params) {
//mark element with unsaved class if needed
if(this.options.unsavedclass) {
/*
Add unsaved css to element if:
- url is not user's function
- value was not sent to server
- params.response === undefined, that means data was not sent
- value changed
*/
var sent = false;
sent = sent || typeof this.options.url === 'function';
sent = sent || this.options.display === false;
sent = sent || params.response !== undefined;
sent = sent || (this.options.savenochange && this.input.value2str(this.value) !== this.input.value2str(params.newValue));
if(sent) {
this.$element.removeClass(this.options.unsavedclass);
} else {
this.$element.addClass(this.options.unsavedclass);
}
}
//set new value
this.setValue(params.newValue, false, params.response);
/**
Fired when new value was submitted. You can use <code>$(this).data('editable')</code> to access to editable instance
@event save
@param {Object} event event object
@param {Object} params additional params
@param {mixed} params.newValue submitted value
@param {Object} params.response ajax response
@example
$('#username').on('save', function(e, params) {
alert('Saved value: ' + params.newValue);
});
**/
//event itself is triggered by editableContainer. Description here is only for documentation
},
validate: function () {
if (typeof this.options.validate === 'function') {
return this.options.validate.call(this, this.value);
}
},
/**
Sets new value of editable
@method setValue(value, convertStr)
@param {mixed} value new value
@param {boolean} convertStr whether to convert value from string to internal format
**/
setValue: function(value, convertStr, response) {
if(convertStr) {
this.value = this.input.str2value(value);
} else {
this.value = value;
}
if(this.container) {
this.container.option('value', this.value);
}
$.when(this.render(response))
.then($.proxy(function() {
this.handleEmpty();
}, this));
},
/**
Activates input of visible container (e.g. set focus)
@method activate()
**/
activate: function() {
if(this.container) {
this.container.activate();
}
},
/**
Removes editable feature from element
@method destroy()
**/
destroy: function() {
this.disable();
if(this.container) {
this.container.destroy();
}
if(this.options.toggle !== 'manual') {
this.$element.removeClass('editable-click');
this.$element.off(this.options.toggle + '.editable');
}
this.$element.off("save.internal");
this.$element.removeClass('editable editable-open editable-disabled');
this.$element.removeData('editable');
}
};
/* EDITABLE PLUGIN DEFINITION
* ======================= */
/**
jQuery method to initialize editable element.
@method $().editable(options)
@params {Object} options
@example
$('#username').editable({
type: 'text',
url: '/post',
pk: 1
});
**/
$.fn.editable = function (option) {
//special API methods returning non-jquery object
var result = {}, args = arguments, datakey = 'editable';
switch (option) {
/**
Runs client-side validation for all matched editables
@method validate()
@returns {Object} validation errors map
@example
$('#username, #fullname').editable('validate');
// possible result:
{
username: "username is required",
fullname: "fullname should be minimum 3 letters length"
}
**/
case 'validate':
this.each(function () {
var $this = $(this), data = $this.data(datakey), error;
if (data && (error = data.validate())) {
result[data.options.name] = error;
}
});
return result;
/**
Returns current values of editable elements.
Note that it returns an **object** with name-value pairs, not a value itself. It allows to get data from several elements.
If value of some editable is `null` or `undefined` it is excluded from result object.
@method getValue()
@returns {Object} object of element names and values
@example
$('#username, #fullname').editable('getValue');
// possible result:
{
username: "superuser",
fullname: "John"
}
**/
case 'getValue':
this.each(function () {
var $this = $(this), data = $this.data(datakey);
if (data && data.value !== undefined && data.value !== null) {
result[data.options.name] = data.input.value2submit(data.value);
}
});
return result;
/**
This method collects values from several editable elements and submit them all to server.
Internally it runs client-side validation for all fields and submits only in case of success.
See <a href="#newrecord">creating new records</a> for details.
@method submit(options)
@param {object} options
@param {object} options.url url to submit data
@param {object} options.data additional data to submit
@param {object} options.ajaxOptions additional ajax options
@param {function} options.error(obj) error handler
@param {function} options.success(obj,config) success handler
@returns {Object} jQuery object
**/
case 'submit': //collects value, validate and submit to server for creating new record
var config = arguments[1] || {},
$elems = this,
errors = this.editable('validate'),
values;
if($.isEmptyObject(errors)) {
values = this.editable('getValue');
if(config.data) {
$.extend(values, config.data);
}
$.ajax($.extend({
url: config.url,
data: values,
type: 'POST'
}, config.ajaxOptions))
.success(function(response) {
//successful response 200 OK
if(typeof config.success === 'function') {
config.success.call($elems, response, config);
}
})
.error(function(){ //ajax error
if(typeof config.error === 'function') {
config.error.apply($elems, arguments);
}
});
} else { //client-side validation error
if(typeof config.error === 'function') {
config.error.call($elems, errors);
}
}
return this;
}
//return jquery object
return this.each(function () {
var $this = $(this),
data = $this.data(datakey),
options = typeof option === 'object' && option;
if (!data) {
$this.data(datakey, (data = new Editable(this, options)));
}
if (typeof option === 'string') { //call method
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
$.fn.editable.defaults = {
/**
Type of input. Can be <code>text|textarea|select|date|checklist</code> and more
@property type
@type string
@default 'text'
**/
type: 'text',
/**
Sets disabled state of editable
@property disabled
@type boolean
@default false
**/
disabled: false,
/**
How to toggle editable. Can be <code>click|dblclick|mouseenter|manual</code>.
When set to <code>manual</code> you should manually call <code>show/hide</code> methods of editable.
**Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handler of some DOM element,
you need to apply <code>e.stopPropagation()</code> because containers are being closed on any click on document.
@example
$('#edit-button').click(function(e) {
e.stopPropagation();
$('#username').editable('toggle');
});
@property toggle
@type string
@default 'click'
**/
toggle: 'click',
/**
Text shown when element is empty.
@property emptytext
@type string
@default 'Empty'
**/
emptytext: 'Empty',
/**
Allows to automatically set element's text based on it's value. Can be <code>auto|always|never</code>. Useful for select and date.
For example, if dropdown list is <code>{1: 'a', 2: 'b'}</code> and element's value set to <code>1</code>, it's html will be automatically set to <code>'a'</code>.
<code>auto</code> - text will be automatically set only if element is empty.
<code>always|never</code> - always(never) try to set element's text.
@property autotext
@type string
@default 'auto'
**/
autotext: 'auto',
/**
Initial value of input. If not set, taken from element's text.
Note, that if element's text is empty - text is automatically generated from value and can be customized (see `autotext` option).
For example, to display currency sign:
@example
<a id="price" data-type="text" data-value="100"></a>
<script>
$('#price').editable({
...
display: function(value) {
$(this).text(value + '$');
}
})
</script>
@property value
@type mixed
@default element's text
**/
value: null,
/**
Callback to perform custom displaying of value in element's text.
If `null`, default input's display used.
If `false`, no displaying methods will be called, element's text will never change.
Runs under element's scope.
_**Parameters:**_
* `value` current value to be displayed
* `response` server response (if display called after ajax submit), since 1.4.0
For _inputs with source_ (select, checklist) parameters are different:
* `value` current value to be displayed
* `sourceData` array of items for current input (e.g. dropdown items)
* `response` server response (if display called after ajax submit), since 1.4.0
To get currently selected items use `$.fn.editableutils.itemsByValue(value, sourceData)`.
@property display
@type function|boolean
@default null
@since 1.2.0
@example
display: function(value, sourceData) {
//display checklist as comma-separated values
var html = [],
checked = $.fn.editableutils.itemsByValue(value, sourceData);
if(checked.length) {
$.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });
$(this).html(html.join(', '));
} else {
$(this).empty();
}
}
**/
display: null,
/**
Css class applied when editable text is empty.
@property emptyclass
@type string
@since 1.4.1
@default editable-empty
**/
emptyclass: 'editable-empty',
/**
Css class applied when value was stored but not sent to server (`pk` is empty or `send = 'never'`).
You may set it to `null` if you work with editables locally and submit them together.
@property unsavedclass
@type string
@since 1.4.1
@default editable-unsaved
**/
unsavedclass: 'editable-unsaved',
/**
If selector is provided, editable will be delegated to the specified targets.
Usefull for dynamically generated DOM elements.
**Please note**, that delegated targets can't be initialized with `emptytext` and `autotext` options,
as they actually become editable only after first click.
You should manually set class `editable-click` to these elements.
Also, if element originally empty you should add class `editable-empty`, set `data-value=""` and write emptytext into element:
@property selector
@type string
@since 1.4.1
@default null
@example
<div id="user">
<!-- empty -->
<a href="#" data-name="username" data-type="text" class="editable-click editable-empty" data-value="" title="Username">Empty</a>
<!-- non-empty -->
<a href="#" data-name="group" data-type="select" data-source="/groups" data-value="1" class="editable-click" title="Group">Operator</a>
</div>
<script>
$('#user').editable({
selector: 'a',
url: '/post',
pk: 1
});
</script>
**/
selector: null
};
}(window.jQuery));
/**
AbstractInput - base class for all editable inputs.
It defines interface to be implemented by any input type.
To create your own input you can inherit from this class.
@class abstractinput
**/
(function ($) {
"use strict";
//types
$.fn.editabletypes = {};
var AbstractInput = function () { };
AbstractInput.prototype = {
/**
Initializes input
@method init()
**/
init: function(type, options, defaults) {
this.type = type;
this.options = $.extend({}, defaults, options);
},
/*
this method called before render to init $tpl that is inserted in DOM
*/
prerender: function() {
this.$tpl = $(this.options.tpl); //whole tpl as jquery object
this.$input = this.$tpl; //control itself, can be changed in render method
this.$clear = null; //clear button
this.error = null; //error message, if input cannot be rendered
},
/**
Renders input from tpl. Can return jQuery deferred object.
Can be overwritten in child objects
@method render()
**/
render: function() {
},
/**
Sets element's html by value.
@method value2html(value, element)
@param {mixed} value
@param {DOMElement} element
**/
value2html: function(value, element) {
$(element).text(value);
},
/**
Converts element's html to value
@method html2value(html)
@param {string} html
@returns {mixed}
**/
html2value: function(html) {
return $('<div>').html(html).text();
},
/**
Converts value to string (for internal compare). For submitting to server used value2submit().
@method value2str(value)
@param {mixed} value
@returns {string}
**/
value2str: function(value) {
return value;
},
/**
Converts string received from server into value. Usually from `data-value` attribute.
@method str2value(str)
@param {string} str
@returns {mixed}
**/
str2value: function(str) {
return str;
},
/**
Converts value for submitting to server. Result can be string or object.
@method value2submit(value)
@param {mixed} value
@returns {mixed}
**/
value2submit: function(value) {
return value;
},
/**
Sets value of input.
@method value2input(value)
@param {mixed} value
**/
value2input: function(value) {
this.$input.val(value);
},
/**
Returns value of input. Value can be object (e.g. datepicker)
@method input2value()
**/
input2value: function() {
return this.$input.val();
},
/**
Activates input. For text it sets focus.
@method activate()
**/
activate: function() {
if(this.$input.is(':visible')) {
this.$input.focus();
}
},
/**
Creates input.
@method clear()
**/
clear: function() {
this.$input.val(null);
},
/**
method to escape html.
**/
escape: function(str) {
return $('<div>').text(str).html();
},
/**
attach handler to automatically submit form when value changed (useful when buttons not shown)
**/
autosubmit: function() {
},
// -------- helper functions --------
setClass: function() {
if(this.options.inputclass) {
this.$input.addClass(this.options.inputclass);
}
},
setAttr: function(attr) {
if (this.options[attr] !== undefined && this.options[attr] !== null) {
this.$input.attr(attr, this.options[attr]);
}
},
option: function(key, value) {
this.options[key] = value;
}
};
AbstractInput.defaults = {
/**
HTML template of input. Normally you should not change it.
@property tpl
@type string
@default ''
**/
tpl: '',
/**
CSS class automatically applied to input
@property inputclass
@type string
@default input-medium
**/
inputclass: 'input-medium',
//scope for external methods (e.g. source defined as function)
//for internal use only
scope: null,
//need to re-declare showbuttons here to get it's value from common config (passed only options existing in defaults)
showbuttons: true
};
$.extend($.fn.editabletypes, {abstractinput: AbstractInput});
}(window.jQuery));
/**
List - abstract class for inputs that have source option loaded from js array or via ajax
@class list
@extends abstractinput
**/
(function ($) {
"use strict";
var List = function (options) {
};
$.fn.editableutils.inherit(List, $.fn.editabletypes.abstractinput);
$.extend(List.prototype, {
render: function () {
var deferred = $.Deferred();
this.error = null;
this.onSourceReady(function () {
this.renderList();
deferred.resolve();
}, function () {
this.error = this.options.sourceError;
deferred.resolve();
});
return deferred.promise();
},
html2value: function (html) {
return null; //can't set value by text
},
value2html: function (value, element, display, response) {
var deferred = $.Deferred(),
success = function () {
if(typeof display === 'function') {
//custom display method
display.call(element, value, this.sourceData, response);
} else {
this.value2htmlFinal(value, element);
}
deferred.resolve();
};
//for null value just call success without loading source
if(value === null) {
success.call(this);
} else {
this.onSourceReady(success, function () { deferred.resolve(); });
}
return deferred.promise();
},
// ------------- additional functions ------------
onSourceReady: function (success, error) {
//if allready loaded just call success
if($.isArray(this.sourceData)) {
success.call(this);
return;
}
// try parse json in single quotes (for double quotes jquery does automatically)
try {
this.options.source = $.fn.editableutils.tryParseJson(this.options.source, false);
} catch (e) {
error.call(this);
return;
}
var source = this.options.source;
//run source if it function
if ($.isFunction(source)) {
source = source.call(this.options.scope);
}
//loading from url
if (typeof source === 'string') {
//try to get from cache
if(this.options.sourceCache) {
var cacheID = source,
cache;
if (!$(document).data(cacheID)) {
$(document).data(cacheID, {});
}
cache = $(document).data(cacheID);
//check for cached data
if (cache.loading === false && cache.sourceData) { //take source from cache
this.sourceData = cache.sourceData;
this.doPrepend();
success.call(this);
return;
} else if (cache.loading === true) { //cache is loading, put callback in stack to be called later
cache.callbacks.push($.proxy(function () {
this.sourceData = cache.sourceData;
this.doPrepend();
success.call(this);
}, this));
//also collecting error callbacks
cache.err_callbacks.push($.proxy(error, this));
return;
} else { //no cache yet, activate it
cache.loading = true;
cache.callbacks = [];
cache.err_callbacks = [];
}
}
//loading sourceData from server
$.ajax({
url: source,
type: 'get',
cache: false,
dataType: 'json',
success: $.proxy(function (data) {
if(cache) {
cache.loading = false;
}
this.sourceData = this.makeArray(data);
if($.isArray(this.sourceData)) {
if(cache) {
//store result in cache
cache.sourceData = this.sourceData;
//run success callbacks for other fields waiting for this source
$.each(cache.callbacks, function () { this.call(); });
}
this.doPrepend();
success.call(this);
} else {
error.call(this);
if(cache) {
//run error callbacks for other fields waiting for this source
$.each(cache.err_callbacks, function () { this.call(); });
}
}
}, this),
error: $.proxy(function () {
error.call(this);
if(cache) {
cache.loading = false;
//run error callbacks for other fields
$.each(cache.err_callbacks, function () { this.call(); });
}
}, this)
});
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
error.call(this);
}
}
},
doPrepend: function () {
if(this.options.prepend === null || this.options.prepend === undefined) {
return;
}
if(!$.isArray(this.prependData)) {
//run prepend if it is function (once)
if ($.isFunction(this.options.prepend)) {
this.options.prepend = this.options.prepend.call(this.options.scope);
}
//try parse json in single quotes
this.options.prepend = $.fn.editableutils.tryParseJson(this.options.prepend, true);
//convert prepend from string to object
if (typeof this.options.prepend === 'string') {
this.options.prepend = {'': this.options.prepend};
}
this.prependData = this.makeArray(this.options.prepend);
}
if($.isArray(this.prependData) && $.isArray(this.sourceData)) {
this.sourceData = this.prependData.concat(this.sourceData);
}
},
/*
renders input list
*/
renderList: function() {
// this method should be overwritten in child class
},
/*
set element's html by value
*/
value2htmlFinal: function(value, element) {
// this method should be overwritten in child class
},
/**
* convert data to array suitable for sourceData, e.g. [{value: 1, text: 'abc'}, {...}]
*/
makeArray: function(data) {
var count, obj, result = [], item, iterateItem;
if(!data || typeof data === 'string') {
return null;
}
if($.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.
*/
iterateItem = function (k, v) {
obj = {value: k, text: v};
if(count++ >= 2) {
return false;// exit from `each` if item has more than one key.
}
};
for(var i = 0; i < data.length; i++) {
item = data[i];
if(typeof item === 'object') {
count = 0; //count of keys inside item
$.each(item, iterateItem);
//case: [{val1: 'text1'}, {val2: 'text2} ...]
if(count === 1) {
result.push(obj);
//case: [{value: 1, text: 'text1'}, {value: 2, text: 'text2'}, ...]
} else if(count > 1) {
//removed check of existance: item.hasOwnProperty('value') && item.hasOwnProperty('text')
if(item.children) {
item.children = this.makeArray(item.children);
}
result.push(item);
}
} else {
//case: ['text1', 'text2' ...]
result.push({value: item, text: item});
}
}
} else { //case: {val1: 'text1', val2: 'text2, ...}
$.each(data, function (k, v) {
result.push({value: k, text: v});
});
}
return result;
},
option: function(key, value) {
this.options[key] = value;
if(key === 'source') {
this.sourceData = null;
}
if(key === 'prepend') {
this.prependData = null;
}
}
});
List.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
Source data for list.
If **array** - it should be in format: `[{value: 1, text: "text1"}, {value: 2, text: "text2"}, ...]`
For compability, object format is also supported: `{"1": "text1", "2": "text2" ...}` but it does not guarantee elements order.
If **string** - considered ajax url to load items. In that case results will be cached for fields with the same source and name. See also `sourceCache` option.
If **function**, it should return data in format above (since 1.4.0).
Since 1.4.1 key `children` supported to render OPTGROUP (for **select** input only).
`[{text: "group1", children: [{value: 1, text: "text1"}, {value: 2, text: "text2"}]}, ...]`
@property source
@type string | array | object | function
@default null
**/
source: null,
/**
Data automatically prepended to the beginning of dropdown list.
@property prepend
@type string | array | object | function
@default false
**/
prepend: false,
/**
Error message when list cannot be loaded (e.g. ajax error)
@property sourceError
@type string
@default Error when loading list
**/
sourceError: 'Error when loading list',
/**
if <code>true</code> and source is **string url** - results will be cached for fields with the same source.
Usefull for editable column in grid to prevent extra requests.
@property sourceCache
@type boolean
@default true
@since 1.2.0
**/
sourceCache: true
});
$.fn.editabletypes.list = List;
}(window.jQuery));
/**
Text input
@class text
@extends abstractinput
@final
@example
<a href="#" id="username" data-type="text" data-pk="1">awesome</a>
<script>
$(function(){
$('#username').editable({
url: '/post',
title: 'Enter username'
});
});
</script>
**/
(function ($) {
"use strict";
var Text = function (options) {
this.init('text', options, Text.defaults);
};
$.fn.editableutils.inherit(Text, $.fn.editabletypes.abstractinput);
$.extend(Text.prototype, {
render: function() {
this.renderClear();
this.setClass();
this.setAttr('placeholder');
},
activate: function() {
if(this.$input.is(':visible')) {
this.$input.focus();
$.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length);
if(this.toggleClear) {
this.toggleClear();
}
}
},
//render clear button
renderClear: function() {
if (this.options.clear) {
this.$clear = $('<span class="editable-clear-x"></span>');
this.$input.after(this.$clear)
.css('padding-right', 24)
.keyup($.proxy(function(e) {
//arrows, enter, tab, etc
if(~$.inArray(e.keyCode, [40,38,9,13,27])) {
return;
}
clearTimeout(this.t);
var that = this;
this.t = setTimeout(function() {
that.toggleClear(e);
}, 100);
}, this))
.parent().css('position', 'relative');
this.$clear.click($.proxy(this.clear, this));
}
},
postrender: function() {
/*
//now `clear` is positioned via css
if(this.$clear) {
//can position clear button only here, when form is shown and height can be calculated
// var h = this.$input.outerHeight(true) || 20,
var h = this.$clear.parent().height(),
delta = (h - this.$clear.height()) / 2;
//this.$clear.css({bottom: delta, right: delta});
}
*/
},
//show / hide clear button
toggleClear: function(e) {
if(!this.$clear) {
return;
}
var len = this.$input.val().length,
visible = this.$clear.is(':visible');
if(len && !visible) {
this.$clear.show();
}
if(!len && visible) {
this.$clear.hide();
}
},
clear: function() {
this.$clear.hide();
this.$input.val('').focus();
}
});
Text.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl: '<input type="text">',
/**
Placeholder attribute of input. Shown when input is empty.
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Whether to show `clear` button
@property clear
@type boolean
@default true
**/
clear: true
});
$.fn.editabletypes.text = Text;
}(window.jQuery));
/**
Textarea input
@class textarea
@extends abstractinput
@final
@example
<a href="#" id="comments" data-type="textarea" data-pk="1">awesome comment!</a>
<script>
$(function(){
$('#comments').editable({
url: '/post',
title: 'Enter comments',
rows: 10
});
});
</script>
**/
(function ($) {
"use strict";
var Textarea = function (options) {
this.init('textarea', options, Textarea.defaults);
};
$.fn.editableutils.inherit(Textarea, $.fn.editabletypes.abstractinput);
$.extend(Textarea.prototype, {
render: function () {
this.setClass();
this.setAttr('placeholder');
this.setAttr('rows');
//ctrl + enter
this.$input.keydown(function (e) {
if (e.ctrlKey && e.which === 13) {
$(this).closest('form').submit();
}
});
},
value2html: function(value, element) {
var html = '', lines;
if(value) {
lines = value.split("\n");
for (var i = 0; i < lines.length; i++) {
lines[i] = $('<div>').text(lines[i]).html();
}
html = lines.join('<br>');
}
$(element).html(html);
},
html2value: function(html) {
if(!html) {
return '';
}
var regex = new RegExp(String.fromCharCode(10), 'g');
var lines = html.split(/<br\s*\/?>/i);
for (var i = 0; i < lines.length; i++) {
var text = $('<div>').html(lines[i]).text();
// Remove newline characters (\n) to avoid them being converted by value2html() method
// thus adding extra <br> tags
text = text.replace(regex, '');
lines[i] = text;
}
return lines.join("\n");
},
activate: function() {
$.fn.editabletypes.text.prototype.activate.call(this);
}
});
Textarea.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <textarea></textarea>
**/
tpl:'<textarea></textarea>',
/**
@property inputclass
@default input-large
**/
inputclass: 'input-large',
/**
Placeholder attribute of input. Shown when input is empty.
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Number of rows in textarea
@property rows
@type integer
@default 7
**/
rows: 7
});
$.fn.editabletypes.textarea = Textarea;
}(window.jQuery));
/**
Select (dropdown)
@class select
@extends list
@final
@example
<a href="#" id="status" data-type="select" data-pk="1" data-url="/post" data-original-title="Select status"></a>
<script>
$(function(){
$('#status').editable({
value: 2,
source: [
{value: 1, text: 'Active'},
{value: 2, text: 'Blocked'},
{value: 3, text: 'Deleted'}
]
});
});
</script>
**/
(function ($) {
"use strict";
var Select = function (options) {
this.init('select', options, Select.defaults);
};
$.fn.editableutils.inherit(Select, $.fn.editabletypes.list);
$.extend(Select.prototype, {
renderList: function() {
this.$input.empty();
var fillItems = function($el, data) {
if($.isArray(data)) {
for(var i=0; i<data.length; i++) {
if(data[i].children) {
$el.append(fillItems($('<optgroup>', {label: data[i].text}), data[i].children));
} else {
$el.append($('<option>', {value: data[i].value}).text(data[i].text));
}
}
}
return $el;
};
fillItems(this.$input, this.sourceData);
this.setClass();
//enter submit
this.$input.on('keydown.editable', function (e) {
if (e.which === 13) {
$(this).closest('form').submit();
}
});
},
value2htmlFinal: function(value, element) {
var text = '',
items = $.fn.editableutils.itemsByValue(value, this.sourceData);
if(items.length) {
text = items[0].text;
}
$(element).text(text);
},
autosubmit: function() {
this.$input.off('keydown.editable').on('change.editable', function(){
$(this).closest('form').submit();
});
}
});
Select.defaults = $.extend({}, $.fn.editabletypes.list.defaults, {
/**
@property tpl
@default <select></select>
**/
tpl:'<select></select>'
});
$.fn.editabletypes.select = Select;
}(window.jQuery));
/**
List of checkboxes.
Internally value stored as javascript array of values.
@class checklist
@extends list
@final
@example
<a href="#" id="options" data-type="checklist" data-pk="1" data-url="/post" data-original-title="Select options"></a>
<script>
$(function(){
$('#options').editable({
value: [2, 3],
source: [
{value: 1, text: 'option1'},
{value: 2, text: 'option2'},
{value: 3, text: 'option3'}
]
});
});
</script>
**/
(function ($) {
"use strict";
var Checklist = function (options) {
this.init('checklist', options, Checklist.defaults);
};
$.fn.editableutils.inherit(Checklist, $.fn.editabletypes.list);
$.extend(Checklist.prototype, {
renderList: function() {
var $label, $div;
this.$tpl.empty();
if(!$.isArray(this.sourceData)) {
return;
}
for(var i=0; i<this.sourceData.length; i++) {
$label = $('<label>').append($('<input>', {
type: 'checkbox',
value: this.sourceData[i].value
}))
.append($('<span>').text(' '+this.sourceData[i].text));
$('<div>').append($label).appendTo(this.$tpl);
}
this.$input = this.$tpl.find('input[type="checkbox"]');
this.setClass();
},
value2str: function(value) {
return $.isArray(value) ? value.sort().join($.trim(this.options.separator)) : '';
},
//parse separated string
str2value: function(str) {
var reg, value = null;
if(typeof str === 'string' && str.length) {
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
value = str.split(reg);
} else if($.isArray(str)) {
value = str;
} else {
value = [str];
}
return value;
},
//set checked on required checkboxes
value2input: function(value) {
this.$input.prop('checked', false);
if($.isArray(value) && value.length) {
this.$input.each(function(i, el) {
var $el = $(el);
// cannot use $.inArray as it performs strict comparison
$.each(value, function(j, val){
/*jslint eqeq: true*/
if($el.val() == val) {
/*jslint eqeq: false*/
$el.prop('checked', true);
}
});
});
}
},
input2value: function() {
var checked = [];
this.$input.filter(':checked').each(function(i, el) {
checked.push($(el).val());
});
return checked;
},
//collect text of checked boxes
value2htmlFinal: function(value, element) {
var html = [],
checked = $.fn.editableutils.itemsByValue(value, this.sourceData);
if(checked.length) {
$.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); });
$(element).html(html.join('<br>'));
} else {
$(element).empty();
}
},
activate: function() {
this.$input.first().focus();
},
autosubmit: function() {
this.$input.on('keydown', function(e){
if (e.which === 13) {
$(this).closest('form').submit();
}
});
}
});
Checklist.defaults = $.extend({}, $.fn.editabletypes.list.defaults, {
/**
@property tpl
@default <div></div>
**/
tpl:'<div class="editable-checklist"></div>',
/**
@property inputclass
@type string
@default null
**/
inputclass: null,
/**
Separator of values when reading from `data-value` attribute
@property separator
@type string
@default ','
**/
separator: ','
});
$.fn.editabletypes.checklist = Checklist;
}(window.jQuery));
/**
HTML5 input types.
Following types are supported:
* password
* email
* url
* tel
* number
* range
Learn more about html5 inputs:
http://www.w3.org/wiki/HTML5_form_additions
To check browser compatibility please see:
https://developer.mozilla.org/en-US/docs/HTML/Element/Input
@class html5types
@extends text
@final
@since 1.3.0
@example
<a href="#" id="email" data-type="email" data-pk="1">[email protected]</a>
<script>
$(function(){
$('#email').editable({
url: '/post',
title: 'Enter email'
});
});
</script>
**/
/**
@property tpl
@default depends on type
**/
/*
Password
*/
(function ($) {
"use strict";
var Password = function (options) {
this.init('password', options, Password.defaults);
};
$.fn.editableutils.inherit(Password, $.fn.editabletypes.text);
$.extend(Password.prototype, {
//do not display password, show '[hidden]' instead
value2html: function(value, element) {
if(value) {
$(element).text('[hidden]');
} else {
$(element).empty();
}
},
//as password not displayed, should not set value by html
html2value: function(html) {
return null;
}
});
Password.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="password">'
});
$.fn.editabletypes.password = Password;
}(window.jQuery));
/*
Email
*/
(function ($) {
"use strict";
var Email = function (options) {
this.init('email', options, Email.defaults);
};
$.fn.editableutils.inherit(Email, $.fn.editabletypes.text);
Email.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="email">'
});
$.fn.editabletypes.email = Email;
}(window.jQuery));
/*
Url
*/
(function ($) {
"use strict";
var Url = function (options) {
this.init('url', options, Url.defaults);
};
$.fn.editableutils.inherit(Url, $.fn.editabletypes.text);
Url.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="url">'
});
$.fn.editabletypes.url = Url;
}(window.jQuery));
/*
Tel
*/
(function ($) {
"use strict";
var Tel = function (options) {
this.init('tel', options, Tel.defaults);
};
$.fn.editableutils.inherit(Tel, $.fn.editabletypes.text);
Tel.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="tel">'
});
$.fn.editabletypes.tel = Tel;
}(window.jQuery));
/*
Number
*/
(function ($) {
"use strict";
var NumberInput = function (options) {
this.init('number', options, NumberInput.defaults);
};
$.fn.editableutils.inherit(NumberInput, $.fn.editabletypes.text);
$.extend(NumberInput.prototype, {
render: function () {
NumberInput.superclass.render.call(this);
this.setAttr('min');
this.setAttr('max');
this.setAttr('step');
},
postrender: function() {
if(this.$clear) {
//increase right ffset for up/down arrows
this.$clear.css({right: 24});
/*
//can position clear button only here, when form is shown and height can be calculated
var h = this.$input.outerHeight(true) || 20,
delta = (h - this.$clear.height()) / 2;
//add 12px to offset right for up/down arrows
this.$clear.css({top: delta, right: delta + 16});
*/
}
}
});
NumberInput.defaults = $.extend({}, $.fn.editabletypes.text.defaults, {
tpl: '<input type="number">',
inputclass: 'input-mini',
min: null,
max: null,
step: null
});
$.fn.editabletypes.number = NumberInput;
}(window.jQuery));
/*
Range (inherit from number)
*/
(function ($) {
"use strict";
var Range = function (options) {
this.init('range', options, Range.defaults);
};
$.fn.editableutils.inherit(Range, $.fn.editabletypes.number);
$.extend(Range.prototype, {
render: function () {
this.$input = this.$tpl.filter('input');
this.setClass();
this.setAttr('min');
this.setAttr('max');
this.setAttr('step');
this.$input.on('input', function(){
$(this).siblings('output').text($(this).val());
});
},
activate: function() {
this.$input.focus();
}
});
Range.defaults = $.extend({}, $.fn.editabletypes.number.defaults, {
tpl: '<input type="range"><output style="width: 30px; display: inline-block"></output>',
inputclass: 'input-medium'
});
$.fn.editabletypes.range = Range;
}(window.jQuery));
/**
Select2 input. Based on amazing work of Igor Vaynberg https://github.com/ivaynberg/select2.
Please see [original docs](http://ivaynberg.github.com/select2) for detailed description and options.
You should manually include select2 distributive:
<link href="select2/select2.css" rel="stylesheet" type="text/css"></link>
<script src="select2/select2.js"></script>
For make it **Bootstrap-styled** you can use css from [here](https://github.com/t0m/select2-bootstrap-css):
<link href="select2-bootstrap.css" rel="stylesheet" type="text/css"></link>
**Note:** currently `ajax` source for select2 is not supported, as it's not possible to load it in closed select2 state.
The solution is to load source manually and assign statically.
@class select2
@extends abstractinput
@since 1.4.1
@final
@example
<a href="#" id="country" data-type="select2" data-pk="1" data-value="ru" data-url="/post" data-original-title="Select country"></a>
<script>
$(function(){
$('#country').editable({
source: [
{id: 'gb', text: 'Great Britain'},
{id: 'us', text: 'United States'},
{id: 'ru', text: 'Russia'}
],
select2: {
multiple: true
}
});
});
</script>
**/
(function ($) {
"use strict";
var Constructor = function (options) {
this.init('select2', options, Constructor.defaults);
options.select2 = options.select2 || {};
var that = this,
mixin = { //mixin to select2 options
placeholder: options.placeholder
};
//detect whether it is multi-valued
this.isMultiple = options.select2.tags || options.select2.multiple;
//if not `tags` mode, we need define initSelection to set data from source
if(!options.select2.tags) {
if(options.source) {
mixin.data = options.source;
}
//this function can be defaulted in seletc2. See https://github.com/ivaynberg/select2/issues/710
mixin.initSelection = function (element, callback) {
//temp: try update results
/*
if(options.select2 && options.select2.ajax) {
console.log('attached');
var original = $(element).data('select2').postprocessResults;
console.log(original);
$(element).data('select2').postprocessResults = function(data, initial) {
console.log('postprocess');
// this.element.triggerHandler('loaded', [data]);
original.apply(this, arguments);
}
// $(element).on('loaded', function(){console.log('loaded');});
$(element).data('select2').updateResults(true);
}
*/
var val = that.str2value(element.val()),
data = $.fn.editableutils.itemsByValue(val, mixin.data, 'id');
//for single-valued mode should not use array. Take first element instead.
if($.isArray(data) && data.length && !that.isMultiple) {
data = data[0];
}
callback(data);
};
}
//overriding objects in config (as by default jQuery extend() is not recursive)
this.options.select2 = $.extend({}, Constructor.defaults.select2, mixin, options.select2);
};
$.fn.editableutils.inherit(Constructor, $.fn.editabletypes.abstractinput);
$.extend(Constructor.prototype, {
render: function() {
this.setClass();
//apply select2
this.$input.select2(this.options.select2);
//when data is loaded via ajax, we need to know when it's done
if('ajax' in this.options.select2) {
/*
console.log('attached');
var original = this.$input.data('select2').postprocessResults;
this.$input.data('select2').postprocessResults = function(data, initial) {
this.element.triggerHandler('loaded', [data]);
original.apply(this, arguments);
}
*/
}
//trigger resize of editableform to re-position container in multi-valued mode
if(this.isMultiple) {
this.$input.on('change', function() {
$(this).closest('form').parent().triggerHandler('resize');
});
}
},
value2html: function(value, element) {
var text = '', data;
if(this.$input) { //called when submitting form and select2 already exists
data = this.$input.select2('data');
} else { //on init (autotext)
//here select2 instance not created yet and data may be even not loaded.
//we can check data/tags property of select config and if exist lookup text
if(this.options.select2.tags) {
data = value;
} else if(this.options.select2.data) {
data = $.fn.editableutils.itemsByValue(value, this.options.select2.data, 'id');
} else {
//if('ajax' in this.options.select2) {
}
}
if($.isArray(data)) {
//collect selected data and show with separator
text = [];
$.each(data, function(k, v){
text.push(v && typeof v === 'object' ? v.text : v);
});
} else if(data) {
text = data.text;
}
text = $.isArray(text) ? text.join(this.options.viewseparator) : text;
$(element).text(text);
},
html2value: function(html) {
return this.options.select2.tags ? this.str2value(html, this.options.viewseparator) : null;
},
value2input: function(value) {
this.$input.val(value).trigger('change', true); //second argument needed to separate initial change from user's click (for autosubmit)
},
input2value: function() {
return this.$input.select2('val');
},
str2value: function(str, separator) {
if(typeof str !== 'string' || !this.isMultiple) {
return str;
}
separator = separator || this.options.select2.separator || $.fn.select2.defaults.separator;
var val, i, l;
if (str === null || str.length < 1) {
return null;
}
val = str.split(separator);
for (i = 0, l = val.length; i < l; i = i + 1) {
val[i] = $.trim(val[i]);
}
return val;
},
autosubmit: function() {
this.$input.on('change', function(e, isInitial){
if(!isInitial) {
$(this).closest('form').submit();
}
});
}
});
Constructor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="hidden">
**/
tpl:'<input type="hidden">',
/**
Configuration of select2. [Full list of options](http://ivaynberg.github.com/select2).
@property select2
@type object
@default null
**/
select2: null,
/**
Placeholder attribute of select
@property placeholder
@type string
@default null
**/
placeholder: null,
/**
Source data for select. It will be assigned to select2 `data` property and kept here just for convenience.
Please note, that format is different from simple `select` input: use 'id' instead of 'value'.
E.g. `[{id: 1, text: "text1"}, {id: 2, text: "text2"}, ...]`.
@property source
@type array
@default null
**/
source: null,
/**
Separator used to display tags.
@property viewseparator
@type string
@default ', '
**/
viewseparator: ', '
});
$.fn.editabletypes.select2 = Constructor;
}(window.jQuery));
/**
* Combodate - 1.0.3
* Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com.
* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang
*
* Author: Vitaliy Potapov
* Project page: http://github.com/vitalets/combodate
* Copyright (c) 2012 Vitaliy Potapov. Released under MIT License.
**/
(function ($) {
var Combodate = function (element, options) {
this.$element = $(element);
if(!this.$element.is('input')) {
$.error('Combodate should be applied to INPUT element');
return;
}
this.options = $.extend({}, $.fn.combodate.defaults, options, this.$element.data());
this.init();
};
Combodate.prototype = {
constructor: Combodate,
init: function () {
this.map = {
//key regexp moment.method
day: ['D', 'date'],
month: ['M', 'month'],
year: ['Y', 'year'],
hour: ['[Hh]', 'hours'],
minute: ['m', 'minutes'],
second: ['s', 'seconds'],
ampm: ['[Aa]', '']
};
this.$widget = $('<span class="combodate"></span>').html(this.getTemplate());
this.initCombos();
//update original input on change
this.$widget.on('change', 'select', $.proxy(function(){
this.$element.val(this.getValue());
}, this));
this.$widget.find('select').css('width', 'auto');
//hide original input and insert widget
this.$element.hide().after(this.$widget);
//set initial value
this.setValue(this.$element.val() || this.options.value);
},
/*
Replace tokens in template with <select> elements
*/
getTemplate: function() {
var tpl = this.options.template;
//first pass
$.each(this.map, function(k, v) {
v = v[0];
var r = new RegExp(v+'+'),
token = v.length > 1 ? v.substring(1, 2) : v;
tpl = tpl.replace(r, '{'+token+'}');
});
//replace spaces with
tpl = tpl.replace(/ /g, ' ');
//second pass
$.each(this.map, function(k, v) {
v = v[0];
var token = v.length > 1 ? v.substring(1, 2) : v;
tpl = tpl.replace('{'+token+'}', '<select class="'+k+'"></select>');
});
return tpl;
},
/*
Initialize combos that presents in template
*/
initCombos: function() {
var that = this;
$.each(this.map, function(k, v) {
var $c = that.$widget.find('.'+k), f, items;
if($c.length) {
that['$'+k] = $c; //set properties like this.$day, this.$month etc.
f = 'fill' + k.charAt(0).toUpperCase() + k.slice(1); //define method name to fill items, e.g `fillDays`
items = that[f]();
that['$'+k].html(that.renderItems(items));
}
});
},
/*
Initialize items of combos. Handles `firstItem` option
*/
initItems: function(key) {
var values = [],
relTime;
if(this.options.firstItem === 'name') {
//need both to support moment ver < 2 and >= 2
relTime = moment.relativeTime || moment.langData()._relativeTime;
var header = typeof relTime[key] === 'function' ? relTime[key](1, true, key, false) : relTime[key];
//take last entry (see momentjs lang files structure)
header = header.split(' ').reverse()[0];
values.push(['', header]);
} else if(this.options.firstItem === 'empty') {
values.push(['', '']);
}
return values;
},
/*
render items to string of <option> tags
*/
renderItems: function(items) {
var str = [];
for(var i=0; i<items.length; i++) {
str.push('<option value="'+items[i][0]+'">'+items[i][1]+'</option>');
}
return str.join("\n");
},
/*
fill day
*/
fillDay: function() {
var items = this.initItems('d'), name, i,
twoDigit = this.options.template.indexOf('DD') !== -1;
for(i=1; i<=31; i++) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill month
*/
fillMonth: function() {
var items = this.initItems('M'), name, i,
longNames = this.options.template.indexOf('MMMM') !== -1,
shortNames = this.options.template.indexOf('MMM') !== -1,
twoDigit = this.options.template.indexOf('MM') !== -1;
for(i=0; i<=11; i++) {
if(longNames) {
name = moment().month(i).format('MMMM');
} else if(shortNames) {
name = moment().month(i).format('MMM');
} else if(twoDigit) {
name = this.leadZero(i+1);
} else {
name = i+1;
}
items.push([i, name]);
}
return items;
},
/*
fill year
*/
fillYear: function() {
var items = [], name, i,
longNames = this.options.template.indexOf('YYYY') !== -1;
for(i=this.options.maxYear; i>=this.options.minYear; i--) {
name = longNames ? i : (i+'').substring(2);
items[this.options.yearDescending ? 'push' : 'unshift']([i, name]);
}
items = this.initItems('y').concat(items);
return items;
},
/*
fill hour
*/
fillHour: function() {
var items = this.initItems('h'), name, i,
h12 = this.options.template.indexOf('h') !== -1,
h24 = this.options.template.indexOf('H') !== -1,
twoDigit = this.options.template.toLowerCase().indexOf('hh') !== -1,
max = h12 ? 12 : 23;
for(i=0; i<=max; i++) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill minute
*/
fillMinute: function() {
var items = this.initItems('m'), name, i,
twoDigit = this.options.template.indexOf('mm') !== -1;
for(i=0; i<=59; i+= this.options.minuteStep) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill second
*/
fillSecond: function() {
var items = this.initItems('s'), name, i,
twoDigit = this.options.template.indexOf('ss') !== -1;
for(i=0; i<=59; i+= this.options.secondStep) {
name = twoDigit ? this.leadZero(i) : i;
items.push([i, name]);
}
return items;
},
/*
fill ampm
*/
fillAmpm: function() {
var ampmL = this.options.template.indexOf('a') !== -1,
ampmU = this.options.template.indexOf('A') !== -1,
items = [
['am', ampmL ? 'am' : 'AM'],
['pm', ampmL ? 'pm' : 'PM']
];
return items;
},
/*
Returns current date value.
If format not specified - `options.format` used.
If format = `null` - Moment object returned.
*/
getValue: function(format) {
var dt, values = {},
that = this,
notSelected = false;
//getting selected values
$.each(this.map, function(k, v) {
if(k === 'ampm') {
return;
}
var def = k === 'day' ? 1 : 0;
values[k] = that['$'+k] ? parseInt(that['$'+k].val(), 10) : def;
if(isNaN(values[k])) {
notSelected = true;
return false;
}
});
//if at least one visible combo not selected - return empty string
if(notSelected) {
return '';
}
//convert hours if 12h format
if(this.$ampm) {
values.hour = this.$ampm.val() === 'am' ? values.hour : values.hour+12;
if(values.hour === 24) {
values.hour = 0;
}
}
dt = moment([values.year, values.month, values.day, values.hour, values.minute, values.second]);
//highlight invalid date
this.highlight(dt);
format = format === undefined ? this.options.format : format;
if(format === null) {
return dt.isValid() ? dt : null;
} else {
return dt.isValid() ? dt.format(format) : '';
}
},
setValue: function(value) {
if(!value) {
return;
}
var dt = typeof value === 'string' ? moment(value, this.options.format) : moment(value),
that = this,
values = {};
//function to find nearest value in select options
function getNearest($select, value) {
var delta = {};
$select.children('option').each(function(i, opt){
var optValue = $(opt).attr('value'),
distance;
if(optValue === '') return;
distance = Math.abs(optValue - value);
if(typeof delta.distance === 'undefined' || distance < delta.distance) {
delta = {value: optValue, distance: distance};
}
});
return delta.value;
}
if(dt.isValid()) {
//read values from date object
$.each(this.map, function(k, v) {
if(k === 'ampm') {
return;
}
values[k] = dt[v[1]]();
});
if(this.$ampm) {
if(values.hour > 12) {
values.hour -= 12;
values.ampm = 'pm';
} else {
values.ampm = 'am';
}
}
$.each(values, function(k, v) {
//call val() for each existing combo, e.g. this.$hour.val()
if(that['$'+k]) {
if(k === 'minute' && that.options.minuteStep > 1 && that.options.roundTime) {
v = getNearest(that['$'+k], v);
}
if(k === 'second' && that.options.secondStep > 1 && that.options.roundTime) {
v = getNearest(that['$'+k], v);
}
that['$'+k].val(v);
}
});
this.$element.val(dt.format(this.options.format));
}
},
/*
highlight combos if date is invalid
*/
highlight: function(dt) {
if(!dt.isValid()) {
if(this.options.errorClass) {
this.$widget.addClass(this.options.errorClass);
} else {
//store original border color
if(!this.borderColor) {
this.borderColor = this.$widget.find('select').css('border-color');
}
this.$widget.find('select').css('border-color', 'red');
}
} else {
if(this.options.errorClass) {
this.$widget.removeClass(this.options.errorClass);
} else {
this.$widget.find('select').css('border-color', this.borderColor);
}
}
},
leadZero: function(v) {
return v <= 9 ? '0' + v : v;
},
destroy: function() {
this.$widget.remove();
this.$element.removeData('combodate').show();
}
//todo: clear method
};
$.fn.combodate = function ( option ) {
var d, args = Array.apply(null, arguments);
args.shift();
//getValue returns date as string / object (not jQuery object)
if(option === 'getValue' && this.length && (d = this.eq(0).data('combodate'))) {
return d.getValue.apply(d, args);
}
return this.each(function () {
var $this = $(this),
data = $this.data('combodate'),
options = typeof option == 'object' && option;
if (!data) {
$this.data('combodate', (data = new Combodate(this, options)));
}
if (typeof option == 'string' && typeof data[option] == 'function') {
data[option].apply(data, args);
}
});
};
$.fn.combodate.defaults = {
//in this format value stored in original input
format: 'DD-MM-YYYY HH:mm',
//in this format items in dropdowns are displayed
template: 'D / MMM / YYYY H : mm',
//initial value, can be `new Date()`
value: null,
minYear: 1970,
maxYear: 2015,
yearDescending: true,
minuteStep: 5,
secondStep: 1,
firstItem: 'empty', //'name', 'empty', 'none'
errorClass: null,
roundTime: true //whether to round minutes and seconds if step > 1
};
}(window.jQuery));
/**
Combodate input - dropdown date and time picker.
Based on [combodate](http://vitalets.github.com/combodate) plugin (included). To use it you should manually include [momentjs](http://momentjs.com).
<script src="js/moment.min.js"></script>
Allows to input:
* only date
* only time
* both date and time
Please note, that format is taken from momentjs and **not compatible** with bootstrap-datepicker / jquery UI datepicker.
Internally value stored as `momentjs` object.
@class combodate
@extends abstractinput
@final
@since 1.4.0
@example
<a href="#" id="dob" data-type="combodate" data-pk="1" data-url="/post" data-value="1984-05-15" data-original-title="Select date"></a>
<script>
$(function(){
$('#dob').editable({
format: 'YYYY-MM-DD',
viewformat: 'DD.MM.YYYY',
template: 'D / MMMM / YYYY',
combodate: {
minYear: 2000,
maxYear: 2015,
minuteStep: 1
}
}
});
});
</script>
**/
/*global moment*/
(function ($) {
"use strict";
var Constructor = function (options) {
this.init('combodate', options, Constructor.defaults);
//by default viewformat equals to format
if(!this.options.viewformat) {
this.options.viewformat = this.options.format;
}
//try parse combodate config defined as json string in data-combodate
options.combodate = $.fn.editableutils.tryParseJson(options.combodate, true);
//overriding combodate config (as by default jQuery extend() is not recursive)
this.options.combodate = $.extend({}, Constructor.defaults.combodate, options.combodate, {
format: this.options.format,
template: this.options.template
});
};
$.fn.editableutils.inherit(Constructor, $.fn.editabletypes.abstractinput);
$.extend(Constructor.prototype, {
render: function () {
this.$input.combodate(this.options.combodate);
//"clear" link
/*
if(this.options.clear) {
this.$clear = $('<a href="#"></a>').html(this.options.clear).click($.proxy(function(e){
e.preventDefault();
e.stopPropagation();
this.clear();
}, this));
this.$tpl.parent().append($('<div class="editable-clear">').append(this.$clear));
}
*/
},
value2html: function(value, element) {
var text = value ? value.format(this.options.viewformat) : '';
$(element).text(text);
},
html2value: function(html) {
return html ? moment(html, this.options.viewformat) : null;
},
value2str: function(value) {
return value ? value.format(this.options.format) : '';
},
str2value: function(str) {
return str ? moment(str, this.options.format) : null;
},
value2submit: function(value) {
return this.value2str(value);
},
value2input: function(value) {
this.$input.combodate('setValue', value);
},
input2value: function() {
return this.$input.combodate('getValue', null);
},
activate: function() {
this.$input.siblings('.combodate').find('select').eq(0).focus();
},
/*
clear: function() {
this.$input.data('datepicker').date = null;
this.$input.find('.active').removeClass('active');
},
*/
autosubmit: function() {
}
});
Constructor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl:'<input type="text">',
/**
@property inputclass
@default null
**/
inputclass: null,
/**
Format used for sending value to server. Also applied when converting date from <code>data-value</code> attribute.<br>
See list of tokens in [momentjs docs](http://momentjs.com/docs/#/parsing/string-format)
@property format
@type string
@default YYYY-MM-DD
**/
format:'YYYY-MM-DD',
/**
Format used for displaying date. Also applied when converting date from element's text on init.
If not specified equals to `format`.
@property viewformat
@type string
@default null
**/
viewformat: null,
/**
Template used for displaying dropdowns.
@property template
@type string
@default D / MMM / YYYY
**/
template: 'D / MMM / YYYY',
/**
Configuration of combodate.
Full list of options: http://vitalets.github.com/combodate/#docs
@property combodate
@type object
@default null
**/
combodate: null
/*
(not implemented yet)
Text shown as clear date button.
If <code>false</code> clear button will not be rendered.
@property clear
@type boolean|string
@default 'x clear'
*/
//clear: '× clear'
});
$.fn.editabletypes.combodate = Constructor;
}(window.jQuery));
/*
Editableform based on jQuery UI
*/
(function ($) {
"use strict";
$.extend($.fn.editableform.Constructor.prototype, {
initButtons: function() {
var $btn = this.$form.find('.editable-buttons');
$btn.append($.fn.editableform.buttons);
if(this.options.showbuttons === 'bottom') {
$btn.addClass('editable-buttons-bottom');
}
this.$form.find('.editable-submit').button({
icons: { primary: "ui-icon-check" },
text: false
}).removeAttr('title');
this.$form.find('.editable-cancel').button({
icons: { primary: "ui-icon-closethick" },
text: false
}).removeAttr('title');
}
});
//error classes
$.fn.editableform.errorGroupClass = null;
$.fn.editableform.errorBlockClass = 'ui-state-error';
}(window.jQuery));
/**
* Editable jQuery UI Tooltip
* ---------------------
* requires jquery ui 1.9.x
*/
(function ($) {
"use strict";
//extend methods
$.extend($.fn.editableContainer.Popup.prototype, {
containerName: 'tooltip', //jQuery method, aplying the widget
containerDataName: 'uiTooltip', //object name in elements .data() (e.g. uiTooltip for tooltip)
innerCss: '.ui-tooltip-content',
//split options on containerOptions and formOptions
splitOptions: function() {
this.containerOptions = {};
this.formOptions = {};
//defaults for tooltip
var cDef = $.ui[this.containerName].prototype.options;
for(var k in this.options) {
if(k in cDef) {
this.containerOptions[k] = this.options[k];
} else {
this.formOptions[k] = this.options[k];
}
}
},
initContainer: function(){
this.handlePlacement();
$.extend(this.containerOptions, {
items: '*',
content: ' ',
track: false,
open: $.proxy(function() {
//disable events hiding tooltip by default
this.container()._on(this.container().element, {
mouseleave: function(e){ e.stopImmediatePropagation(); },
focusout: function(e){ e.stopImmediatePropagation(); }
});
}, this)
});
this.call(this.containerOptions);
//disable standart triggering tooltip event
this.container()._off(this.container().element, 'mouseover focusin');
},
tip: function() {
return this.container() ? this.container()._find(this.container().element) : null;
},
innerShow: function() {
this.call('open');
var label = this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle");
this.tip().find(this.innerCss).empty().append($('<label>').text(label));
},
innerHide: function() {
this.call('close');
},
innerDestroy: function() {
/* tooltip destroys itself on hide */
},
setPosition: function() {
this.tip().position( $.extend({
of: this.$element
}, this.containerOptions.position ) );
},
handlePlacement: function() {
var pos;
switch(this.options.placement) {
case 'top':
pos = {
my: "center bottom-5",
at: "center top"
};
break;
case 'right':
pos = {
my: "left+5 center",
at: "right center"
};
break;
case 'bottom':
pos = {
my: "center top+5",
at: "center bottom"
};
break;
case 'left':
pos = {
my: "right-5 center",
at: "left center"
};
break;
}
this.containerOptions.position = pos;
}
});
}(window.jQuery));
/**
jQuery UI Datepicker.
Description and examples: http://jqueryui.com/datepicker.
This input is also accessible as **date** type. Do not use it together with __bootstrap-datepicker__ as both apply <code>$().datepicker()</code> method.
For **i18n** you should include js file from here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n.
@class dateui
@extends abstractinput
@final
@example
<a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-original-title="Select date">15/05/1984</a>
<script>
$(function(){
$('#dob').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
datepicker: {
firstDay: 1
}
}
});
});
</script>
**/
(function ($) {
"use strict";
var DateUI = function (options) {
this.init('dateui', options, DateUI.defaults);
this.initPicker(options, DateUI.defaults);
};
$.fn.editableutils.inherit(DateUI, $.fn.editabletypes.abstractinput);
$.extend(DateUI.prototype, {
initPicker: function(options, defaults) {
//by default viewformat equals to format
if(!this.options.viewformat) {
this.options.viewformat = this.options.format;
}
//correct formats: replace yyyy with yy (for compatibility with bootstrap datepicker)
this.options.viewformat = this.options.viewformat.replace('yyyy', 'yy');
this.options.format = this.options.format.replace('yyyy', 'yy');
//overriding datepicker config (as by default jQuery extend() is not recursive)
//since 1.4 datepicker internally uses viewformat instead of format. Format is for submit only
this.options.datepicker = $.extend({}, defaults.datepicker, options.datepicker, {
dateFormat: this.options.viewformat
});
},
render: function () {
this.$input.datepicker(this.options.datepicker);
//"clear" link
if(this.options.clear) {
this.$clear = $('<a href="#"></a>').html(this.options.clear).click($.proxy(function(e){
e.preventDefault();
e.stopPropagation();
this.clear();
}, this));
this.$tpl.parent().append($('<div class="editable-clear">').append(this.$clear));
}
},
value2html: function(value, element) {
var text = $.datepicker.formatDate(this.options.viewformat, value);
DateUI.superclass.value2html(text, element);
},
html2value: function(html) {
if(typeof html !== 'string') {
return html;
}
//if string does not match format, UI datepicker throws exception
var d;
try {
d = $.datepicker.parseDate(this.options.viewformat, html);
} catch(e) {}
return d;
},
value2str: function(value) {
return $.datepicker.formatDate(this.options.format, value);
},
str2value: function(str) {
if(typeof str !== 'string') {
return str;
}
//if string does not match format, UI datepicker throws exception
var d;
try {
d = $.datepicker.parseDate(this.options.format, str);
} catch(e) {}
return d;
},
value2submit: function(value) {
return this.value2str(value);
},
value2input: function(value) {
this.$input.datepicker('setDate', value);
},
input2value: function() {
return this.$input.datepicker('getDate');
},
activate: function() {
},
clear: function() {
this.$input.datepicker('setDate', null);
},
autosubmit: function() {
this.$input.on('mouseup', 'table.ui-datepicker-calendar a.ui-state-default', function(e){
var $form = $(this).closest('form');
setTimeout(function() {
$form.submit();
}, 200);
});
}
});
DateUI.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
@property tpl
@default <div></div>
**/
tpl:'<div class="editable-date"></div>',
/**
@property inputclass
@default null
**/
inputclass: null,
/**
Format used for sending value to server. Also applied when converting date from <code>data-value</code> attribute.<br>
Full list of tokens: http://docs.jquery.com/UI/Datepicker/formatDate
@property format
@type string
@default yyyy-mm-dd
**/
format:'yyyy-mm-dd',
/**
Format used for displaying date. Also applied when converting date from element's text on init.
If not specified equals to <code>format</code>
@property viewformat
@type string
@default null
**/
viewformat: null,
/**
Configuration of datepicker.
Full list of options: http://api.jqueryui.com/datepicker
@property datepicker
@type object
@default {
firstDay: 0,
changeYear: true,
changeMonth: true
}
**/
datepicker: {
firstDay: 0,
changeYear: true,
changeMonth: true,
showOtherMonths: true
},
/**
Text shown as clear date button.
If <code>false</code> clear button will not be rendered.
@property clear
@type boolean|string
@default 'x clear'
**/
clear: '× clear'
});
$.fn.editabletypes.dateui = DateUI;
}(window.jQuery));
/**
jQuery UI datefield input - modification for inline mode.
Shows normal <input type="text"> and binds popup datepicker.
Automatically shown in inline mode.
@class dateuifield
@extends dateui
@since 1.4.0
**/
(function ($) {
"use strict";
var DateUIField = function (options) {
this.init('dateuifield', options, DateUIField.defaults);
this.initPicker(options, DateUIField.defaults);
};
$.fn.editableutils.inherit(DateUIField, $.fn.editabletypes.dateui);
$.extend(DateUIField.prototype, {
render: function () {
// this.$input = this.$tpl.find('input');
this.$input.datepicker(this.options.datepicker);
$.fn.editabletypes.text.prototype.renderClear.call(this);
},
value2input: function(value) {
this.$input.val($.datepicker.formatDate(this.options.viewformat, value));
},
input2value: function() {
return this.html2value(this.$input.val());
},
activate: function() {
$.fn.editabletypes.text.prototype.activate.call(this);
},
toggleClear: function() {
$.fn.editabletypes.text.prototype.toggleClear.call(this);
},
autosubmit: function() {
//reset autosubmit to empty
}
});
DateUIField.defaults = $.extend({}, $.fn.editabletypes.dateui.defaults, {
/**
@property tpl
@default <input type="text">
**/
tpl: '<input type="text"/>',
/**
@property inputclass
@default null
**/
inputclass: null,
/* datepicker config */
datepicker: {
showOn: "button",
buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif",
buttonImageOnly: true,
firstDay: 0,
changeYear: true,
changeMonth: true,
showOtherMonths: true
},
/* disable clear link */
clear: false
});
$.fn.editabletypes.dateuifield = DateUIField;
}(window.jQuery)); |
app/javascript/mastodon/features/blocks/index.js | haleyashleypraesent/ProjectPrionosuchus | import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import LoadingIndicator from '../../components/loading_indicator';
import { ScrollContainer } from 'react-router-scroll';
import Column from '../ui/components/column';
import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import AccountContainer from '../../containers/account_container';
import { fetchBlocks, expandBlocks } from '../../actions/blocks';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
const messages = defineMessages({
heading: { id: 'column.blocks', defaultMessage: 'Blocked users' },
});
const mapStateToProps = state => ({
accountIds: state.getIn(['user_lists', 'blocks', 'items']),
});
class Blocks extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.list,
intl: PropTypes.object.isRequired,
};
componentWillMount () {
this.props.dispatch(fetchBlocks());
}
handleScroll = (e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target;
if (scrollTop === scrollHeight - clientHeight) {
this.props.dispatch(expandBlocks());
}
}
render () {
const { intl, accountIds } = this.props;
if (!accountIds) {
return (
<Column>
<LoadingIndicator />
</Column>
);
}
return (
<Column icon='ban' heading={intl.formatMessage(messages.heading)}>
<ColumnBackButtonSlim />
<ScrollContainer scrollKey='blocks'>
<div className='scrollable' onScroll={this.handleScroll}>
{accountIds.map(id =>
<AccountContainer key={id} id={id} />
)}
</div>
</ScrollContainer>
</Column>
);
}
}
export default connect(mapStateToProps)(injectIntl(Blocks));
|
script/jquery-1.4.4.min.js | redraiment/pig | /*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Nov 11 19:04:53 2010 -0500
*/
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
c.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".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
|
test/utils/createClientRender.js | kybarg/material-ui | /* eslint-env mocha */
import React from 'react';
import PropTypes from 'prop-types';
import {
act,
buildQueries,
cleanup,
createEvent,
fireEvent as rtlFireEvent,
queries,
render as testingLibraryRender,
} from '@testing-library/react/pure';
// holes are *All* selectors which aren't necessary for id selectors
const [queryDescriptionOf, , getDescriptionOf, , findDescriptionOf] = buildQueries(
function queryAllDescriptionsOf(container, element) {
return container.querySelectorAll(`#${element.getAttribute('aria-describedby')}`);
},
function getMultipleError() {
return `Found multiple descriptions. An element should be described by a unique element.`;
},
function getMissingError() {
return `Found no describing element.`;
},
);
const customQueries = { queryDescriptionOf, getDescriptionOf, findDescriptionOf };
/**
*
* @param {React.ReactElement} element
* @param {object} [options]
* @param {boolean} [options.baseElement] - https://testing-library.com/docs/react-testing-library/api#baseelement-1
* @param {boolean} [options.disableUnnmount] - if true does not cleanup before mount
* @param {boolean} [options.strict] - wrap in React.StrictMode?
* @returns {import('@testing-library/react').RenderResult<typeof queries & typeof customQueries> & { setProps(props: object): void}}
* TODO: type return RenderResult in setProps
*/
function clientRender(element, options = {}) {
const { baseElement, strict = false, wrapper: InnerWrapper = React.Fragment } = options;
const Mode = strict ? React.StrictMode : React.Fragment;
function Wrapper({ children }) {
return (
<Mode>
<InnerWrapper>{children}</InnerWrapper>
</Mode>
);
}
Wrapper.propTypes = { children: PropTypes.node };
const result = testingLibraryRender(element, {
baseElement,
queries: { ...queries, ...customQueries },
wrapper: Wrapper,
});
/**
* convenience helper. Better than repeating all props.
*/
result.setProps = function setProps(props) {
result.rerender(React.cloneElement(element, props));
return result;
};
return result;
}
export function createClientRender(globalOptions = {}) {
const { strict: globalStrict } = globalOptions;
afterEach(() => {
act(() => {
cleanup();
});
});
return function configuredClientRender(element, options = {}) {
const { strict = globalStrict, ...localOptions } = options;
return clientRender(element, { ...localOptions, strict });
};
}
const fireEvent = Object.assign(rtlFireEvent, {
// polyfill event.key for chrome 49 (supported in Material-UI v4)
// for user-interactions react does the polyfilling but manually created
// events don't have this luxury
keyDown(element, options = {}) {
const event = createEvent.keyDown(element, options);
Object.defineProperty(event, 'key', {
get() {
return options.key || '';
},
});
rtlFireEvent(element, event);
},
keyUp(element, options = {}) {
const event = createEvent.keyUp(element, options);
Object.defineProperty(event, 'key', {
get() {
return options.key || '';
},
});
rtlFireEvent(element, event);
},
});
export * from '@testing-library/react';
export { act, cleanup, fireEvent };
export function render() {
throw new Error(
"Don't use `render` directly. Instead use the return value from `createClientRender`",
);
}
|
app/components/AboutPage.js | ufv-js/ru-now | import React from 'react'
export default ({time}) => <h1>Rota 'about', que também tem acesso ao estado: {time}</h1> |
code/workspaces/web-app/src/components/common/ExternalLink.spec.js | NERC-CEH/datalab | import React from 'react';
import { render } from '@testing-library/react';
import ExternalLink from './ExternalLink';
describe('ExternalLink', () => {
it('renders to match snapshot correctly passing props to child components', () => {
const wrapper = render(<ExternalLink href="http://test-external-link.com">Test Link Text</ExternalLink>).container;
expect(wrapper).toMatchSnapshot();
});
});
|
src/pages/Home.js | ianroberts131/visual-algorithms | import React, { Component } from 'react';
import { Link } from 'react-router';
import { Row, Col } from 'react-bootstrap';
class Home extends Component {
render() {
return (
<Row className="home">
<Col xs={ 12 } id="header-section">
<h1 id="home-header">Visual Algorithms</h1>
<h3 id="home-description">Bringing common computer science algorithms to life</h3>
</Col>
<Col xs={ 12 } id="algo-boxes">
<Col xs={ 12 } sm={ 6 } className='algo-item'>
<Link className="link" to="/search">
<h3 className="algo-header">Search Algorithms</h3>
<img className='search-img' src={require('../images/search-img.jpg')} alt="Searching Algorithm" onClick={ (e) => {
this.props.searchBaseState();
this.props.changeSpeed('regular');
}
}></img>
</Link>
</Col>
<Col xs={ 12 } sm={ 6 } className='algo-item'>
<Link className="link" to="/sort">
<h3 className="algo-header">Sort Algorithms</h3>
<img className='sort-img' src={require('../images/sort-img.jpg')} alt="Sorting Algorithm" onClick={ (e) => {
this.props.sortBaseState();
this.props.changeSpeed('regular');
}
}></img>
</Link>
</Col>
</Col>
</Row>
)
}
}
export default Home;
|
ajax/libs/material-ui/4.9.4/es/Breadcrumbs/Breadcrumbs.js | cdnjs/cdnjs | import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import React from 'react';
import { isFragment } from 'react-is';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import Typography from '../Typography';
import BreadcrumbCollapsed from './BreadcrumbCollapsed';
export const styles = {
/* Styles applied to the root element. */
root: {},
/* Styles applied to the ol element. */
ol: {
display: 'flex',
flexWrap: 'wrap',
alignItems: 'center',
padding: 0,
margin: 0,
listStyle: 'none'
},
/* Styles applied to the li element. */
li: {},
/* Styles applied to the separator element. */
separator: {
display: 'flex',
userSelect: 'none',
marginLeft: 8,
marginRight: 8
}
};
function insertSeparators(items, className, separator) {
return items.reduce((acc, current, index) => {
if (index < items.length - 1) {
acc = acc.concat(current, React.createElement("li", {
"aria-hidden": true,
key: `separator-${index}`,
className: className
}, separator));
} else {
acc.push(current);
}
return acc;
}, []);
}
const Breadcrumbs = React.forwardRef(function Breadcrumbs(props, ref) {
const {
children,
classes,
className,
component: Component = 'nav',
expandText = 'Show path',
itemsAfterCollapse = 1,
itemsBeforeCollapse = 1,
maxItems = 8,
separator = '/'
} = props,
other = _objectWithoutPropertiesLoose(props, ["children", "classes", "className", "component", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"]);
const [expanded, setExpanded] = React.useState(false);
const renderItemsBeforeAndAfter = allItems => {
const handleClickExpand = () => {
setExpanded(true);
}; // This defends against someone passing weird input, to ensure that if all
// items would be shown anyway, we just show all items without the EllipsisItem
if (itemsBeforeCollapse + itemsAfterCollapse >= allItems.length) {
if (process.env.NODE_ENV !== 'production') {
console.error(['Material-UI: you have provided an invalid combination of props to the Breadcrumbs.', `itemsAfterCollapse={${itemsAfterCollapse}} + itemsBeforeCollapse={${itemsBeforeCollapse}} >= maxItems={${maxItems}}`].join('\n'));
}
return allItems;
}
return [...allItems.slice(0, itemsBeforeCollapse), React.createElement(BreadcrumbCollapsed, {
"aria-label": expandText,
key: "ellipsis",
onClick: handleClickExpand
}), ...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)];
};
const allItems = React.Children.toArray(children).filter(child => {
if (process.env.NODE_ENV !== 'production') {
if (isFragment(child)) {
console.error(["Material-UI: the Breadcrumbs component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
}
}
return React.isValidElement(child);
}).map((child, index) => React.createElement("li", {
className: classes.li,
key: `child-${index}`
}, child));
return React.createElement(Typography, _extends({
ref: ref,
component: Component,
color: "textSecondary",
className: clsx(classes.root, className)
}, other), React.createElement("ol", {
className: classes.ol
}, insertSeparators(expanded || maxItems && allItems.length <= maxItems ? allItems : renderItemsBeforeAndAfter(allItems), classes.separator, separator)));
});
process.env.NODE_ENV !== "production" ? Breadcrumbs.propTypes = {
/**
* The breadcrumb children.
*/
children: PropTypes.node.isRequired,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
* By default, it maps the variant to a good default headline component.
*/
component: PropTypes.elementType,
/**
* Override the default label for the expand button.
*
* For localization purposes, you can use the provided [translations](/guides/localization/).
*/
expandText: PropTypes.string,
/**
* If max items is exceeded, the number of items to show after the ellipsis.
*/
itemsAfterCollapse: PropTypes.number,
/**
* If max items is exceeded, the number of items to show before the ellipsis.
*/
itemsBeforeCollapse: PropTypes.number,
/**
* Specifies the maximum number of breadcrumbs to display. When there are more
* than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
* will be shown, with an ellipsis in between.
*/
maxItems: PropTypes.number,
/**
* Custom separator node.
*/
separator: PropTypes.node
} : void 0;
export default withStyles(styles, {
name: 'MuiBreadcrumbs'
})(Breadcrumbs); |
packages/ringcentral-widgets-test/test/integration-test/legacy/TextInput.spec.js | ringcentral/ringcentral-js-widget | import React from 'react';
import { shallow, mount } from 'enzyme';
import Textinput from 'ringcentral-widgets/components/TextInput';
describe('<Textinput />', () => {
it('should render correct', () => {
const wrapper = shallow(<Textinput />);
expect(wrapper.find('div').length).toEqual(1);
expect(wrapper.find('input').length).toEqual(1);
});
it('props received', () => {
const eventHandler = jest.fn();
const onKeyDown = jest.fn();
const wrapper = shallow(
<Textinput
className={'helloClass'}
invalid={false}
onChange={eventHandler}
placeholder={'hello placeholder'}
disabled={false}
readOnly={false}
pattern={'hello pattern'}
name={'hello name'}
maxLength={20}
value={'hello value'}
defaultValue={'hello default value'}
onKeyDown={onKeyDown}
/>,
);
const div = wrapper.find('div').first();
expect(div.props().className).toBeDefined();
expect(div.props().className).toEqual('root helloClass');
const input = wrapper.find('input').first();
expect(input.props().onChange).toBeDefined();
expect(input.props().placeholder).toBeDefined();
expect(input.props().disabled).toBeDefined();
expect(input.props().readOnly).toBeDefined();
expect(input.props().pattern).toBeDefined();
expect(input.props().name).toBeDefined();
expect(input.props().maxLength).toBeDefined();
expect(input.props().defaultValue).toBeDefined();
expect(input.props().onKeyDown).toBeDefined();
expect(input.props().placeholder).toEqual('hello placeholder');
expect(input.props().disabled).toEqual(false);
expect(input.props().readOnly).toEqual(false);
expect(input.props().pattern).toEqual('hello pattern');
expect(input.props().name).toEqual('hello name');
expect(input.props().maxLength).toEqual(20);
expect(input.props().defaultValue).toEqual('hello default value');
});
it('onChange event bind success', () => {
const eventHandler = jest.fn();
const wrapper = mount(<Textinput onChange={eventHandler} />);
wrapper.find('input').simulate('change', { target: { value: 'hello' } });
expect(eventHandler.mock.calls.length).toEqual(1);
});
it('onKeyDown event bind success', () => {
const onKeyDown = jest.fn();
const wrapper = mount(<Textinput onKeyDown={onKeyDown} />);
wrapper.find('input').simulate('keydown', { which: 'a' });
expect(onKeyDown.mock.calls.length).toEqual(1);
});
});
|
demo/src/common/containers/NoMatch.js | misterfresh/react-easy-transition | 'use strict'
import React, { Component } from 'react';
import Helmet from 'react-helmet';
class NoMatch extends Component {
render() {
return (
<div>
<Helmet title='Not Found' />
Page was not found
</div>
)
}
}
export default NoMatch;
|
config/webpack.dev.js | akhandpratapsingh-tudip/Atithi | const helpers = require('./helpers');
const path = require('path');
const webpackMerge = require('webpack-merge'); // used to merge webpack configs
const commonConfig = require('./webpack.common.js'); // the settings that are common to prod and dev
/**
* Webpack Plugins
*/
const DefinePlugin = require('webpack/lib/DefinePlugin');
const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin');
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
/**
* Webpack Constants
*/
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';
const HOST = process.env.HOST || 'localhost';
const PORT = process.env.PORT || 3000;
const HMR = helpers.hasProcessFlag('hot');
const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
host: HOST,
port: PORT,
ENV: ENV,
HMR: HMR
});
/**
* Webpack configuration
*
* See: http://webpack.github.io/docs/configuration.html#cli
*/
module.exports = function (options) {
return webpackMerge(commonConfig({env: ENV}), {
/**
* Developer tool to enhance debugging
*
* See: http://webpack.github.io/docs/configuration.html#devtool
* See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps
*/
devtool: 'cheap-module-source-map',
/**
* Options affecting the output of the compilation.
*
* See: http://webpack.github.io/docs/configuration.html#output
*/
output: {
/**
* The output directory as absolute path (required).
*
* See: http://webpack.github.io/docs/configuration.html#output-path
*/
path: helpers.root('dist'),
/**
* Specifies the name of each output file on disk.
* IMPORTANT: You must not specify an absolute path here!
*
* See: http://webpack.github.io/docs/configuration.html#output-filename
*/
filename: '[name].bundle.js',
/**
* The filename of the SourceMaps for the JavaScript files.
* They are inside the output.path directory.
*
* See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename
*/
sourceMapFilename: '[name].map',
/** The filename of non-entry chunks as relative path
* inside the output.path directory.
*
* See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
*/
chunkFilename: '[id].chunk.js',
library: 'ac_[name]',
libraryTarget: 'var',
},
plugins: [
/**
* Plugin: DefinePlugin
* Description: Define free variables.
* Useful for having development builds with debug logging or adding global constants.
*
* Environment helpers
*
* See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
*/
// NOTE: when adding more properties, make sure you include them in custom-typings.d.ts
new DefinePlugin({
'ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR,
'process.env': {
'ENV': JSON.stringify(METADATA.ENV),
'NODE_ENV': JSON.stringify(METADATA.ENV),
'HMR': METADATA.HMR,
}
}),
/**
* Plugin: NamedModulesPlugin (experimental)
* Description: Uses file names as module name.
*
* See: https://github.com/webpack/webpack/commit/a04ffb928365b19feb75087c63f13cadfc08e1eb
*/
// new NamedModulesPlugin(),
/**
* Plugin LoaderOptionsPlugin (experimental)
*
* See: https://gist.github.com/sokra/27b24881210b56bbaff7
*/
new LoaderOptionsPlugin({
debug: true,
options: {
context: helpers.root('src'),
output: {
path: helpers.root('dist')
},
/**
* Static analysis linter for TypeScript advanced options configuration
* Description: An extensible linter for the TypeScript language.
*
* See: https://github.com/wbuchwalter/tslint-loader
*/
tslint: {
emitErrors: false,
failOnHint: false,
resourcePath: 'src'
}
}
})
],
/**
* Webpack Development Server configuration
* Description: The webpack-dev-server is a little node.js Express server.
* The server emits information about the compilation state to the client,
* which reacts to those events.
*
* See: https://webpack.github.io/docs/webpack-dev-server.html
*/
devServer: {
port: METADATA.port,
host: METADATA.host,
historyApiFallback: {
index: '/index.html'
},
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
},
/*
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
node: {
global: true,
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
});
};
|
ajax/libs/react-bootstrap-table/2.6.0-beta.1/react-bootstrap-table.js | brix/cdnjs | (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'object')
exports["ReactBootstrapTable"] = factory(require("react"), require("react-dom"));
else
root["ReactBootstrapTable"] = factory(root["React"], root["ReactDOM"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TableHeaderColumn = exports.BootstrapTable = undefined;
var _BootstrapTable = __webpack_require__(1);
var _BootstrapTable2 = _interopRequireDefault(_BootstrapTable);
var _TableHeaderColumn = __webpack_require__(190);
var _TableHeaderColumn2 = _interopRequireDefault(_TableHeaderColumn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (typeof window !== 'undefined') {
window.BootstrapTable = _BootstrapTable2.default;
window.TableHeaderColumn = _TableHeaderColumn2.default;
}
exports.BootstrapTable = _BootstrapTable2.default;
exports.TableHeaderColumn = _TableHeaderColumn2.default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
}();
;
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _TableHeader = __webpack_require__(5);
var _TableHeader2 = _interopRequireDefault(_TableHeader);
var _TableBody = __webpack_require__(8);
var _TableBody2 = _interopRequireDefault(_TableBody);
var _PaginationList = __webpack_require__(178);
var _PaginationList2 = _interopRequireDefault(_PaginationList);
var _ToolBar = __webpack_require__(180);
var _ToolBar2 = _interopRequireDefault(_ToolBar);
var _TableFilter = __webpack_require__(181);
var _TableFilter2 = _interopRequireDefault(_TableFilter);
var _TableDataStore = __webpack_require__(182);
var _util = __webpack_require__(183);
var _util2 = _interopRequireDefault(_util);
var _csv_export_util = __webpack_require__(184);
var _csv_export_util2 = _interopRequireDefault(_csv_export_util);
var _Filter = __webpack_require__(188);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint no-alert: 0 */
/* eslint max-len: 0 */
var BootstrapTable = function (_Component) {
_inherits(BootstrapTable, _Component);
function BootstrapTable(props) {
_classCallCheck(this, BootstrapTable);
var _this = _possibleConstructorReturn(this, (BootstrapTable.__proto__ || Object.getPrototypeOf(BootstrapTable)).call(this, props));
_this.handleSort = function () {
return _this.__handleSort__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handlePaginationData = function () {
return _this.__handlePaginationData__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleMouseLeave = function () {
return _this.__handleMouseLeave__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleMouseEnter = function () {
return _this.__handleMouseEnter__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowMouseOut = function () {
return _this.__handleRowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowMouseOver = function () {
return _this.__handleRowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowClick = function () {
return _this.__handleRowClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowDoubleClick = function () {
return _this.__handleRowDoubleClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleSelectAllRow = function () {
return _this.__handleSelectAllRow__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleShowOnlySelected = function () {
return _this.__handleShowOnlySelected__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleSelectRow = function () {
return _this.__handleSelectRow__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleAddRow = function () {
return _this.__handleAddRow__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.getPageByRowKey = function () {
return _this.__getPageByRowKey__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleDropRow = function () {
return _this.__handleDropRow__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleFilterData = function () {
return _this.__handleFilterData__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleExportCSV = function () {
return _this.__handleExportCSV__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleSearch = function () {
return _this.__handleSearch__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this._scrollHeader = function () {
return _this.___scrollHeader__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this._adjustTable = function () {
return _this.___adjustTable__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this._adjustHeaderWidth = function () {
return _this.___adjustHeaderWidth__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this._adjustHeight = function () {
return _this.___adjustHeight__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.isIE = false;
_this._attachCellEditFunc();
if (_util2.default.canUseDOM()) {
_this.isIE = document.documentMode;
}
_this.store = new _TableDataStore.TableDataStore(_this.props.data.slice());
_this.initTable(_this.props);
if (_this.props.selectRow && _this.props.selectRow.selected) {
var copy = _this.props.selectRow.selected.slice();
_this.store.setSelectedRowKey(copy);
}
var currPage = _Const2.default.PAGE_START_INDEX;
if (typeof _this.props.options.page !== 'undefined') {
currPage = _this.props.options.page;
} else if (typeof _this.props.options.pageStartIndex !== 'undefined') {
currPage = _this.props.options.pageStartIndex;
}
_this.state = {
data: _this.getTableData(),
currPage: currPage,
sizePerPage: _this.props.options.sizePerPage || _Const2.default.SIZE_PER_PAGE_LIST[0],
selectedRowKeys: _this.store.getSelectedRowKeys()
};
return _this;
}
_createClass(BootstrapTable, [{
key: 'initTable',
value: function initTable(props) {
var _this2 = this;
var keyField = props.keyField;
var isKeyFieldDefined = typeof keyField === 'string' && keyField.length;
_react2.default.Children.forEach(props.children, function (column) {
if (column.props.isKey) {
if (keyField) {
throw new Error('Error. Multiple key column be detected in TableHeaderColumn.');
}
keyField = column.props.dataField;
}
if (column.props.filter) {
// a column contains a filter
if (!_this2.filter) {
// first time create the filter on the BootstrapTable
_this2.filter = new _Filter.Filter();
}
// pass the filter to column with filter
column.props.filter.emitter = _this2.filter;
}
});
if (this.filter) {
this.filter.removeAllListeners('onFilterChange');
this.filter.on('onFilterChange', function (currentFilter) {
_this2.handleFilterData(currentFilter);
});
}
this.colInfos = this.getColumnsDescription(props).reduce(function (prev, curr) {
prev[curr.name] = curr;
return prev;
}, {});
if (!isKeyFieldDefined && !keyField) {
throw new Error('Error. No any key column defined in TableHeaderColumn.\n Use \'isKey={true}\' to specify a unique column after version 0.5.4.');
}
this.store.setProps({
isPagination: props.pagination,
keyField: keyField,
colInfos: this.colInfos,
multiColumnSearch: props.multiColumnSearch,
remote: this.isRemoteDataSource()
});
}
}, {
key: 'getTableData',
value: function getTableData() {
var result = [];
var _props = this.props,
options = _props.options,
pagination = _props.pagination;
var sortName = options.defaultSortName || options.sortName;
var sortOrder = options.defaultSortOrder || options.sortOrder;
var searchText = options.defaultSearch;
if (sortName && sortOrder) {
this.store.sort(sortOrder, sortName);
}
if (searchText) {
this.store.search(searchText);
}
if (pagination) {
var page = void 0;
var sizePerPage = void 0;
if (this.store.isChangedPage()) {
sizePerPage = this.state.sizePerPage;
page = this.state.currPage;
} else {
sizePerPage = options.sizePerPage || _Const2.default.SIZE_PER_PAGE_LIST[0];
page = options.page || 1;
}
result = this.store.page(page, sizePerPage).get();
} else {
result = this.store.get();
}
return result;
}
}, {
key: 'getColumnsDescription',
value: function getColumnsDescription(_ref) {
var children = _ref.children;
return _react2.default.Children.map(children, function (column, i) {
return {
name: column.props.dataField,
align: column.props.dataAlign,
sort: column.props.dataSort,
format: column.props.dataFormat,
formatExtraData: column.props.formatExtraData,
filterFormatted: column.props.filterFormatted,
filterValue: column.props.filterValue,
editable: column.props.editable,
customEditor: column.props.customEditor,
hidden: column.props.hidden,
hiddenOnInsert: column.props.hiddenOnInsert,
searchable: column.props.searchable,
className: column.props.columnClassName,
columnTitle: column.props.columnTitle,
width: column.props.width,
text: column.props.children,
sortFunc: column.props.sortFunc,
sortFuncExtraData: column.props.sortFuncExtraData,
export: column.props.export,
index: i
};
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
this.initTable(nextProps);
var options = nextProps.options,
selectRow = nextProps.selectRow;
this.store.setData(nextProps.data.slice());
// from #481
var page = this.state.currPage;
if (this.props.options.page !== options.page) {
page = options.page;
}
// from #481
var sizePerPage = this.state.sizePerPage;
if (this.props.options.sizePerPage !== options.sizePerPage) {
sizePerPage = options.sizePerPage;
}
if (this.isRemoteDataSource()) {
this.setState({
data: nextProps.data.slice(),
currPage: page,
sizePerPage: sizePerPage
});
} else {
// #125
// remove !options.page for #709
if (page > Math.ceil(nextProps.data.length / sizePerPage)) {
page = 1;
}
var sortInfo = this.store.getSortInfo();
var sortField = options.sortName || (sortInfo ? sortInfo.sortField : undefined);
var sortOrder = options.sortOrder || (sortInfo ? sortInfo.order : undefined);
if (sortField && sortOrder) this.store.sort(sortOrder, sortField);
var data = this.store.page(page, sizePerPage).get();
this.setState({
data: data,
currPage: page,
sizePerPage: sizePerPage
});
}
if (selectRow && selectRow.selected) {
// set default select rows to store.
var copy = selectRow.selected.slice();
this.store.setSelectedRowKey(copy);
this.setState({
selectedRowKeys: copy
});
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this._adjustTable();
window.addEventListener('resize', this._adjustTable);
this.refs.body.refs.container.addEventListener('scroll', this._scrollHeader);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
window.removeEventListener('resize', this._adjustTable);
this.refs.body.refs.container.removeEventListener('scroll', this._scrollHeader);
if (this.filter) {
this.filter.removeAllListeners('onFilterChange');
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
this._adjustTable();
this._attachCellEditFunc();
if (this.props.options.afterTableComplete) {
this.props.options.afterTableComplete();
}
}
}, {
key: '_attachCellEditFunc',
value: function _attachCellEditFunc() {
var cellEdit = this.props.cellEdit;
if (cellEdit) {
this.props.cellEdit.__onCompleteEdit__ = this.handleEditCell.bind(this);
if (cellEdit.mode !== _Const2.default.CELL_EDIT_NONE) {
this.props.selectRow.clickToSelect = false;
}
}
}
/**
* Returns true if in the current configuration,
* the datagrid should load its data remotely.
*
* @param {Object} [props] Optional. If not given, this.props will be used
* @return {Boolean}
*/
}, {
key: 'isRemoteDataSource',
value: function isRemoteDataSource(props) {
return (props || this.props).remote;
}
}, {
key: 'render',
value: function render() {
var style = {
height: this.props.height,
maxHeight: this.props.maxHeight
};
var columns = this.getColumnsDescription(this.props);
var sortInfo = this.store.getSortInfo();
var pagination = this.renderPagination();
var toolBar = this.renderToolBar();
var tableFilter = this.renderTableFilter(columns);
var isSelectAll = this.isSelectAll();
var sortIndicator = this.props.options.sortIndicator;
if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true;
return _react2.default.createElement(
'div',
{ className: (0, _classnames2.default)('react-bs-table-container', this.props.containerClass),
style: this.props.containerStyle },
toolBar,
_react2.default.createElement(
'div',
{ ref: 'table',
className: (0, _classnames2.default)('react-bs-table', this.props.tableContainerClass),
style: _extends({}, style, this.props.tableStyle),
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave },
_react2.default.createElement(
_TableHeader2.default,
{
ref: 'header',
headerContainerClass: this.props.headerContainerClass,
tableHeaderClass: this.props.tableHeaderClass,
style: this.props.headerStyle,
rowSelectType: this.props.selectRow.mode,
customComponent: this.props.selectRow.customComponent,
hideSelectColumn: this.props.selectRow.hideSelectColumn,
sortName: sortInfo ? sortInfo.sortField : undefined,
sortOrder: sortInfo ? sortInfo.order : undefined,
sortIndicator: sortIndicator,
onSort: this.handleSort,
onSelectAllRow: this.handleSelectAllRow,
bordered: this.props.bordered,
condensed: this.props.condensed,
isFiltered: this.filter ? true : false,
isSelectAll: isSelectAll },
this.props.children
),
_react2.default.createElement(_TableBody2.default, { ref: 'body',
bodyContainerClass: this.props.bodyContainerClass,
tableBodyClass: this.props.tableBodyClass,
style: _extends({}, style, this.props.bodyStyle),
data: this.state.data,
columns: columns,
trClassName: this.props.trClassName,
striped: this.props.striped,
bordered: this.props.bordered,
hover: this.props.hover,
keyField: this.store.getKeyField(),
condensed: this.props.condensed,
selectRow: this.props.selectRow,
cellEdit: this.props.cellEdit,
selectedRowKeys: this.state.selectedRowKeys,
onRowClick: this.handleRowClick,
onRowDoubleClick: this.handleRowDoubleClick,
onRowMouseOver: this.handleRowMouseOver,
onRowMouseOut: this.handleRowMouseOut,
onSelectRow: this.handleSelectRow,
noDataText: this.props.options.noDataText })
),
tableFilter,
pagination
);
}
}, {
key: 'isSelectAll',
value: function isSelectAll() {
if (this.store.isEmpty()) return false;
var unselectable = this.props.selectRow.unselectable;
var defaultSelectRowKeys = this.store.getSelectedRowKeys();
var allRowKeys = this.store.getAllRowkey();
if (defaultSelectRowKeys.length === 0) return false;
var match = 0;
var noFound = 0;
var unSelectableCnt = 0;
defaultSelectRowKeys.forEach(function (selected) {
if (allRowKeys.indexOf(selected) !== -1) match++;else noFound++;
if (unselectable && unselectable.indexOf(selected) !== -1) unSelectableCnt++;
});
if (noFound === defaultSelectRowKeys.length) return false;
if (match === allRowKeys.length) {
return true;
} else {
if (unselectable && match <= unSelectableCnt && unSelectableCnt === unselectable.length) return false;else return 'indeterminate';
}
// return (match === allRowKeys.length) ? true : 'indeterminate';
}
}, {
key: 'cleanSelected',
value: function cleanSelected() {
this.store.setSelectedRowKey([]);
this.setState({
selectedRowKeys: []
});
}
}, {
key: '__handleSort__REACT_HOT_LOADER__',
value: function __handleSort__REACT_HOT_LOADER__(order, sortField) {
if (this.props.options.onSortChange) {
this.props.options.onSortChange(sortField, order, this.props);
}
if (this.isRemoteDataSource()) {
this.store.setSortInfo(order, sortField);
return;
}
var result = this.store.sort(order, sortField).get();
this.setState({
data: result
});
}
}, {
key: '__handlePaginationData__REACT_HOT_LOADER__',
value: function __handlePaginationData__REACT_HOT_LOADER__(page, sizePerPage) {
var _props$options = this.props.options,
onPageChange = _props$options.onPageChange,
pageStartIndex = _props$options.pageStartIndex;
if (onPageChange) {
onPageChange(page, sizePerPage);
}
this.setState({
currPage: page,
sizePerPage: sizePerPage
});
if (this.isRemoteDataSource()) {
return;
}
// We calculate an offset here in order to properly fetch the indexed data,
// despite the page start index not always being 1
var normalizedPage = void 0;
if (pageStartIndex !== undefined) {
var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex);
normalizedPage = page + offset;
} else {
normalizedPage = page;
}
var result = this.store.page(normalizedPage, sizePerPage).get();
this.setState({ data: result });
}
}, {
key: '__handleMouseLeave__REACT_HOT_LOADER__',
value: function __handleMouseLeave__REACT_HOT_LOADER__() {
if (this.props.options.onMouseLeave) {
this.props.options.onMouseLeave();
}
}
}, {
key: '__handleMouseEnter__REACT_HOT_LOADER__',
value: function __handleMouseEnter__REACT_HOT_LOADER__() {
if (this.props.options.onMouseEnter) {
this.props.options.onMouseEnter();
}
}
}, {
key: '__handleRowMouseOut__REACT_HOT_LOADER__',
value: function __handleRowMouseOut__REACT_HOT_LOADER__(row, event) {
if (this.props.options.onRowMouseOut) {
this.props.options.onRowMouseOut(row, event);
}
}
}, {
key: '__handleRowMouseOver__REACT_HOT_LOADER__',
value: function __handleRowMouseOver__REACT_HOT_LOADER__(row, event) {
if (this.props.options.onRowMouseOver) {
this.props.options.onRowMouseOver(row, event);
}
}
}, {
key: '__handleRowClick__REACT_HOT_LOADER__',
value: function __handleRowClick__REACT_HOT_LOADER__(row) {
if (this.props.options.onRowClick) {
this.props.options.onRowClick(row);
}
}
}, {
key: '__handleRowDoubleClick__REACT_HOT_LOADER__',
value: function __handleRowDoubleClick__REACT_HOT_LOADER__(row) {
if (this.props.options.onRowDoubleClick) {
this.props.options.onRowDoubleClick(row);
}
}
}, {
key: '__handleSelectAllRow__REACT_HOT_LOADER__',
value: function __handleSelectAllRow__REACT_HOT_LOADER__(e) {
var isSelected = e.currentTarget.checked;
var keyField = this.store.getKeyField();
var _props$selectRow = this.props.selectRow,
onSelectAll = _props$selectRow.onSelectAll,
unselectable = _props$selectRow.unselectable,
selected = _props$selectRow.selected;
var selectedRowKeys = [];
var result = true;
var rows = isSelected ? this.store.get() : this.store.getRowByKey(this.state.selectedRowKeys);
if (unselectable && unselectable.length > 0) {
if (isSelected) {
rows = rows.filter(function (r) {
return unselectable.indexOf(r[keyField]) === -1 || selected && selected.indexOf(r[keyField]) !== -1;
});
} else {
rows = rows.filter(function (r) {
return unselectable.indexOf(r[keyField]) === -1;
});
}
}
if (onSelectAll) {
result = this.props.selectRow.onSelectAll(isSelected, rows);
}
if (typeof result == 'undefined' || result !== false) {
if (isSelected) {
selectedRowKeys = Array.isArray(result) ? result : rows.map(function (r) {
return r[keyField];
});
} else {
if (unselectable && selected) {
selectedRowKeys = selected.filter(function (r) {
return unselectable.indexOf(r) > -1;
});
}
}
this.store.setSelectedRowKey(selectedRowKeys);
this.setState({ selectedRowKeys: selectedRowKeys });
}
}
}, {
key: '__handleShowOnlySelected__REACT_HOT_LOADER__',
value: function __handleShowOnlySelected__REACT_HOT_LOADER__() {
this.store.ignoreNonSelected();
var result = void 0;
if (this.props.pagination) {
result = this.store.page(1, this.state.sizePerPage).get();
} else {
result = this.store.get();
}
this.setState({
data: result,
currPage: this.props.options.pageStartIndex || _Const2.default.PAGE_START_INDEX
});
}
}, {
key: '__handleSelectRow__REACT_HOT_LOADER__',
value: function __handleSelectRow__REACT_HOT_LOADER__(row, isSelected, e) {
var result = true;
var currSelected = this.store.getSelectedRowKeys();
var rowKey = row[this.store.getKeyField()];
var selectRow = this.props.selectRow;
if (selectRow.onSelect) {
result = selectRow.onSelect(row, isSelected, e);
}
if (typeof result === 'undefined' || result !== false) {
if (selectRow.mode === _Const2.default.ROW_SELECT_SINGLE) {
currSelected = isSelected ? [rowKey] : [];
} else {
if (isSelected) {
currSelected.push(rowKey);
} else {
currSelected = currSelected.filter(function (key) {
return rowKey !== key;
});
}
}
this.store.setSelectedRowKey(currSelected);
this.setState({
selectedRowKeys: currSelected
});
}
}
}, {
key: 'handleEditCell',
value: function handleEditCell(newVal, rowIndex, colIndex) {
var onCellEdit = this.props.options.onCellEdit;
var _props$cellEdit = this.props.cellEdit,
beforeSaveCell = _props$cellEdit.beforeSaveCell,
afterSaveCell = _props$cellEdit.afterSaveCell;
var fieldName = void 0;
_react2.default.Children.forEach(this.props.children, function (column, i) {
if (i === colIndex) {
fieldName = column.props.dataField;
return false;
}
});
if (beforeSaveCell) {
var isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal);
if (!isValid && typeof isValid !== 'undefined') {
this.setState({
data: this.store.get()
});
return;
}
}
if (onCellEdit) {
newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);
}
if (this.isRemoteDataSource()) {
if (afterSaveCell) {
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
}
return;
}
var result = this.store.edit(newVal, rowIndex, fieldName).get();
this.setState({
data: result
});
if (afterSaveCell) {
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
}
}
}, {
key: 'handleAddRowAtBegin',
value: function handleAddRowAtBegin(newObj) {
try {
this.store.addAtBegin(newObj);
} catch (e) {
return e;
}
this._handleAfterAddingRow(newObj, true);
}
}, {
key: '__handleAddRow__REACT_HOT_LOADER__',
value: function __handleAddRow__REACT_HOT_LOADER__(newObj) {
var onAddRow = this.props.options.onAddRow;
if (onAddRow) {
var colInfos = this.store.getColInfos();
onAddRow(newObj, colInfos);
}
if (this.isRemoteDataSource()) {
if (this.props.options.afterInsertRow) {
this.props.options.afterInsertRow(newObj);
}
return null;
}
try {
this.store.add(newObj);
} catch (e) {
return e;
}
this._handleAfterAddingRow(newObj, false);
}
}, {
key: 'getSizePerPage',
value: function getSizePerPage() {
return this.state.sizePerPage;
}
}, {
key: 'getCurrentPage',
value: function getCurrentPage() {
return this.state.currPage;
}
}, {
key: 'getTableDataIgnorePaging',
value: function getTableDataIgnorePaging() {
return this.store.getCurrentDisplayData();
}
}, {
key: '__getPageByRowKey__REACT_HOT_LOADER__',
value: function __getPageByRowKey__REACT_HOT_LOADER__(rowKey) {
var sizePerPage = this.state.sizePerPage;
var currentData = this.store.getCurrentDisplayData();
var keyField = this.store.getKeyField();
var result = currentData.findIndex(function (x) {
return x[keyField] === rowKey;
});
if (result > -1) {
return parseInt(result / sizePerPage, 10) + 1;
} else {
return result;
}
}
}, {
key: '__handleDropRow__REACT_HOT_LOADER__',
value: function __handleDropRow__REACT_HOT_LOADER__(rowKeys) {
var _this3 = this;
var dropRowKeys = rowKeys ? rowKeys : this.store.getSelectedRowKeys();
// add confirm before the delete action if that option is set.
if (dropRowKeys && dropRowKeys.length > 0) {
if (this.props.options.handleConfirmDeleteRow) {
this.props.options.handleConfirmDeleteRow(function () {
_this3.deleteRow(dropRowKeys);
}, dropRowKeys);
} else if (confirm('Are you sure you want to delete?')) {
this.deleteRow(dropRowKeys);
}
}
}
}, {
key: 'deleteRow',
value: function deleteRow(dropRowKeys) {
var onDeleteRow = this.props.options.onDeleteRow;
if (onDeleteRow) {
onDeleteRow(dropRowKeys);
}
this.store.setSelectedRowKey([]); // clear selected row key
if (this.isRemoteDataSource()) {
if (this.props.options.afterDeleteRow) {
this.props.options.afterDeleteRow(dropRowKeys);
}
return;
}
this.store.remove(dropRowKeys); // remove selected Row
var result = void 0;
if (this.props.pagination) {
var sizePerPage = this.state.sizePerPage;
var currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage);
var currPage = this.state.currPage;
if (currPage > currLastPage) currPage = currLastPage;
result = this.store.page(currPage, sizePerPage).get();
this.setState({
data: result,
selectedRowKeys: this.store.getSelectedRowKeys(),
currPage: currPage
});
} else {
result = this.store.get();
this.setState({
data: result,
selectedRowKeys: this.store.getSelectedRowKeys()
});
}
if (this.props.options.afterDeleteRow) {
this.props.options.afterDeleteRow(dropRowKeys);
}
}
}, {
key: '__handleFilterData__REACT_HOT_LOADER__',
value: function __handleFilterData__REACT_HOT_LOADER__(filterObj) {
var onFilterChange = this.props.options.onFilterChange;
if (onFilterChange) {
var colInfos = this.store.getColInfos();
onFilterChange(filterObj, colInfos);
}
this.setState({
currPage: this.props.options.pageStartIndex || _Const2.default.PAGE_START_INDEX
});
if (this.isRemoteDataSource()) {
if (this.props.options.afterColumnFilter) {
this.props.options.afterColumnFilter(filterObj, this.store.getDataIgnoringPagination());
}
return;
}
this.store.filter(filterObj);
var sortObj = this.store.getSortInfo();
if (sortObj) {
this.store.sort(sortObj.order, sortObj.sortField);
}
var result = void 0;
if (this.props.pagination) {
var sizePerPage = this.state.sizePerPage;
result = this.store.page(1, sizePerPage).get();
} else {
result = this.store.get();
}
if (this.props.options.afterColumnFilter) {
this.props.options.afterColumnFilter(filterObj, this.store.getDataIgnoringPagination());
}
this.setState({
data: result
});
}
}, {
key: '__handleExportCSV__REACT_HOT_LOADER__',
value: function __handleExportCSV__REACT_HOT_LOADER__() {
var result = {};
var csvFileName = this.props.csvFileName;
var onExportToCSV = this.props.options.onExportToCSV;
if (onExportToCSV) {
result = onExportToCSV();
} else {
result = this.store.getDataIgnoringPagination();
}
var keys = [];
this.props.children.map(function (column) {
if (column.props.export === true || typeof column.props.export === 'undefined' && column.props.hidden === false) {
keys.push({
field: column.props.dataField,
format: column.props.csvFormat,
header: column.props.csvHeader || column.props.dataField
});
}
});
if (typeof csvFileName === 'function') {
csvFileName = csvFileName();
}
(0, _csv_export_util2.default)(result, keys, csvFileName);
}
}, {
key: '__handleSearch__REACT_HOT_LOADER__',
value: function __handleSearch__REACT_HOT_LOADER__(searchText) {
var onSearchChange = this.props.options.onSearchChange;
if (onSearchChange) {
var colInfos = this.store.getColInfos();
onSearchChange(searchText, colInfos, this.props.multiColumnSearch);
}
this.setState({
currPage: this.props.options.pageStartIndex || _Const2.default.PAGE_START_INDEX
});
if (this.isRemoteDataSource()) {
if (this.props.options.afterSearch) {
this.props.options.afterSearch(searchText, this.store.getDataIgnoringPagination());
}
return;
}
this.store.search(searchText);
var sortObj = this.store.getSortInfo();
if (sortObj) {
this.store.sort(sortObj.order, sortObj.sortField);
}
var result = void 0;
if (this.props.pagination) {
var sizePerPage = this.state.sizePerPage;
result = this.store.page(1, sizePerPage).get();
} else {
result = this.store.get();
}
if (this.props.options.afterSearch) {
this.props.options.afterSearch(searchText, this.store.getDataIgnoringPagination());
}
this.setState({
data: result
});
}
}, {
key: 'renderPagination',
value: function renderPagination() {
if (this.props.pagination) {
var dataSize = void 0;
if (this.isRemoteDataSource()) {
dataSize = this.props.fetchInfo.dataTotalSize;
} else {
dataSize = this.store.getDataNum();
}
var options = this.props.options;
if (Math.ceil(dataSize / this.state.sizePerPage) <= 1 && this.props.ignoreSinglePage) return null;
return _react2.default.createElement(
'div',
{ className: 'react-bs-table-pagination' },
_react2.default.createElement(_PaginationList2.default, {
ref: 'pagination',
currPage: this.state.currPage,
changePage: this.handlePaginationData,
sizePerPage: this.state.sizePerPage,
sizePerPageList: options.sizePerPageList || _Const2.default.SIZE_PER_PAGE_LIST,
pageStartIndex: options.pageStartIndex,
paginationShowsTotal: options.paginationShowsTotal,
paginationSize: options.paginationSize || _Const2.default.PAGINATION_SIZE,
remote: this.isRemoteDataSource(),
dataSize: dataSize,
onSizePerPageList: options.onSizePerPageList,
prePage: options.prePage || _Const2.default.PRE_PAGE,
nextPage: options.nextPage || _Const2.default.NEXT_PAGE,
firstPage: options.firstPage || _Const2.default.FIRST_PAGE,
lastPage: options.lastPage || _Const2.default.LAST_PAGE,
hideSizePerPage: options.hideSizePerPage })
);
}
return null;
}
}, {
key: 'renderToolBar',
value: function renderToolBar() {
var _props2 = this.props,
selectRow = _props2.selectRow,
insertRow = _props2.insertRow,
deleteRow = _props2.deleteRow,
search = _props2.search,
children = _props2.children;
var enableShowOnlySelected = selectRow && selectRow.showOnlySelected;
if (enableShowOnlySelected || insertRow || deleteRow || search || this.props.exportCSV) {
var columns = void 0;
if (Array.isArray(children)) {
columns = children.map(function (column, r) {
var props = column.props;
return {
name: props.children,
field: props.dataField,
hiddenOnInsert: props.hiddenOnInsert,
// when you want same auto generate value and not allow edit, example ID field
autoValue: props.autoValue || false,
// for create editor, no params for column.editable() indicate that editor for new row
editable: props.editable && typeof props.editable === 'function' ? props.editable() : props.editable,
format: props.dataFormat ? function (value) {
return props.dataFormat(value, null, props.formatExtraData, r).replace(/<.*?>/g, '');
} : false
};
});
} else {
columns = [{
name: children.props.children,
field: children.props.dataField,
editable: children.props.editable,
hiddenOnInsert: children.props.hiddenOnInsert
}];
}
return _react2.default.createElement(
'div',
{ className: 'react-bs-table-tool-bar' },
_react2.default.createElement(_ToolBar2.default, {
defaultSearch: this.props.options.defaultSearch,
clearSearch: this.props.options.clearSearch,
searchDelayTime: this.props.options.searchDelayTime,
enableInsert: insertRow,
enableDelete: deleteRow,
enableSearch: search,
enableExportCSV: this.props.exportCSV,
enableShowOnlySelected: enableShowOnlySelected,
columns: columns,
searchPlaceholder: this.props.searchPlaceholder,
exportCSVText: this.props.options.exportCSVText,
insertText: this.props.options.insertText,
deleteText: this.props.options.deleteText,
saveText: this.props.options.saveText,
closeText: this.props.options.closeText,
ignoreEditable: this.props.options.ignoreEditable,
onAddRow: this.handleAddRow,
onDropRow: this.handleDropRow,
onSearch: this.handleSearch,
onExportCSV: this.handleExportCSV,
onShowOnlySelected: this.handleShowOnlySelected })
);
} else {
return null;
}
}
}, {
key: 'renderTableFilter',
value: function renderTableFilter(columns) {
if (this.props.columnFilter) {
return _react2.default.createElement(_TableFilter2.default, { columns: columns,
rowSelectType: this.props.selectRow.mode,
onFilter: this.handleFilterData });
} else {
return null;
}
}
}, {
key: '___scrollHeader__REACT_HOT_LOADER__',
value: function ___scrollHeader__REACT_HOT_LOADER__(e) {
this.refs.header.refs.container.scrollLeft = e.currentTarget.scrollLeft;
}
}, {
key: '___adjustTable__REACT_HOT_LOADER__',
value: function ___adjustTable__REACT_HOT_LOADER__() {
if (!this.props.printable) {
this._adjustHeaderWidth();
}
this._adjustHeight();
}
}, {
key: '___adjustHeaderWidth__REACT_HOT_LOADER__',
value: function ___adjustHeaderWidth__REACT_HOT_LOADER__() {
var header = this.refs.header.refs.header;
var headerContainer = this.refs.header.refs.container;
var tbody = this.refs.body.refs.tbody;
var firstRow = tbody.childNodes[0];
var isScroll = headerContainer.offsetWidth !== tbody.parentNode.offsetWidth;
var scrollBarWidth = isScroll ? _util2.default.getScrollBarWidth() : 0;
if (firstRow && this.store.getDataNum()) {
var cells = firstRow.childNodes;
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
var computedStyle = getComputedStyle(cell);
var width = parseFloat(computedStyle.width.replace('px', ''));
if (this.isIE) {
var paddingLeftWidth = parseFloat(computedStyle.paddingLeft.replace('px', ''));
var paddingRightWidth = parseFloat(computedStyle.paddingRight.replace('px', ''));
var borderRightWidth = parseFloat(computedStyle.borderRightWidth.replace('px', ''));
var borderLeftWidth = parseFloat(computedStyle.borderLeftWidth.replace('px', ''));
width = width + paddingLeftWidth + paddingRightWidth + borderRightWidth + borderLeftWidth;
}
var lastPadding = cells.length - 1 === i ? scrollBarWidth : 0;
if (width <= 0) {
width = 120;
cell.width = width + lastPadding + 'px';
}
var result = width + lastPadding + 'px';
header.childNodes[i].style.width = result;
header.childNodes[i].style.minWidth = result;
}
} else {
_react2.default.Children.forEach(this.props.children, function (child, i) {
if (child.props.width) {
header.childNodes[i].style.width = child.props.width + 'px';
header.childNodes[i].style.minWidth = child.props.width + 'px';
}
});
}
}
}, {
key: '___adjustHeight__REACT_HOT_LOADER__',
value: function ___adjustHeight__REACT_HOT_LOADER__() {
var height = this.props.height;
var maxHeight = this.props.maxHeight;
if (typeof height === 'number' && !isNaN(height) || height.indexOf('%') === -1) {
this.refs.body.refs.container.style.height = parseFloat(height, 10) - this.refs.header.refs.container.offsetHeight + 'px';
}
if (maxHeight) {
maxHeight = typeof maxHeight === 'number' ? maxHeight : parseInt(maxHeight.replace('px', ''), 10);
this.refs.body.refs.container.style.maxHeight = maxHeight - this.refs.header.refs.container.offsetHeight + 'px';
}
}
}, {
key: '_handleAfterAddingRow',
value: function _handleAfterAddingRow(newObj, atTheBeginning) {
var result = void 0;
if (this.props.pagination) {
// if pagination is enabled and inserting row at the end,
// change page to the last page
// otherwise, change it to the first page
var sizePerPage = this.state.sizePerPage;
if (atTheBeginning) {
var firstPage = this.props.options.pageStartIndex || _Const2.default.PAGE_START_INDEX;
result = this.store.page(firstPage, sizePerPage).get();
this.setState({
data: result,
currPage: firstPage
});
} else {
var currLastPage = Math.ceil(this.store.getDataNum() / sizePerPage);
result = this.store.page(currLastPage, sizePerPage).get();
this.setState({
data: result,
currPage: currLastPage
});
}
} else {
result = this.store.get();
this.setState({
data: result
});
}
if (this.props.options.afterInsertRow) {
this.props.options.afterInsertRow(newObj);
}
}
}]);
return BootstrapTable;
}(_react.Component);
BootstrapTable.propTypes = {
keyField: _react.PropTypes.string,
height: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
maxHeight: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
data: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object]),
remote: _react.PropTypes.bool, // remote data, default is false
striped: _react.PropTypes.bool,
bordered: _react.PropTypes.bool,
hover: _react.PropTypes.bool,
condensed: _react.PropTypes.bool,
pagination: _react.PropTypes.bool,
printable: _react.PropTypes.bool,
searchPlaceholder: _react.PropTypes.string,
selectRow: _react.PropTypes.shape({
mode: _react.PropTypes.oneOf([_Const2.default.ROW_SELECT_NONE, _Const2.default.ROW_SELECT_SINGLE, _Const2.default.ROW_SELECT_MULTI]),
customComponent: _react.PropTypes.func,
bgColor: _react.PropTypes.string,
selected: _react.PropTypes.array,
onSelect: _react.PropTypes.func,
onSelectAll: _react.PropTypes.func,
clickToSelect: _react.PropTypes.bool,
hideSelectColumn: _react.PropTypes.bool,
clickToSelectAndEditCell: _react.PropTypes.bool,
showOnlySelected: _react.PropTypes.bool,
unselectable: _react.PropTypes.array
}),
cellEdit: _react.PropTypes.shape({
mode: _react.PropTypes.string,
blurToSave: _react.PropTypes.bool,
beforeSaveCell: _react.PropTypes.func,
afterSaveCell: _react.PropTypes.func
}),
insertRow: _react.PropTypes.bool,
deleteRow: _react.PropTypes.bool,
search: _react.PropTypes.bool,
columnFilter: _react.PropTypes.bool,
trClassName: _react.PropTypes.any,
tableStyle: _react.PropTypes.object,
containerStyle: _react.PropTypes.object,
headerStyle: _react.PropTypes.object,
bodyStyle: _react.PropTypes.object,
containerClass: _react.PropTypes.string,
tableContainerClass: _react.PropTypes.string,
headerContainerClass: _react.PropTypes.string,
bodyContainerClass: _react.PropTypes.string,
tableHeaderClass: _react.PropTypes.string,
tableBodyClass: _react.PropTypes.string,
options: _react.PropTypes.shape({
clearSearch: _react.PropTypes.bool,
sortName: _react.PropTypes.string,
sortOrder: _react.PropTypes.string,
defaultSortName: _react.PropTypes.string,
defaultSortOrder: _react.PropTypes.string,
sortIndicator: _react.PropTypes.bool,
afterTableComplete: _react.PropTypes.func,
afterDeleteRow: _react.PropTypes.func,
afterInsertRow: _react.PropTypes.func,
afterSearch: _react.PropTypes.func,
afterColumnFilter: _react.PropTypes.func,
onRowClick: _react.PropTypes.func,
onRowDoubleClick: _react.PropTypes.func,
page: _react.PropTypes.number,
pageStartIndex: _react.PropTypes.number,
paginationShowsTotal: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]),
sizePerPageList: _react.PropTypes.array,
sizePerPage: _react.PropTypes.number,
paginationSize: _react.PropTypes.number,
hideSizePerPage: _react.PropTypes.bool,
onSortChange: _react.PropTypes.func,
onPageChange: _react.PropTypes.func,
onSizePerPageList: _react.PropTypes.func,
onFilterChange: _react2.default.PropTypes.func,
onSearchChange: _react2.default.PropTypes.func,
onAddRow: _react2.default.PropTypes.func,
onExportToCSV: _react2.default.PropTypes.func,
onCellEdit: _react2.default.PropTypes.func,
noDataText: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.object]),
handleConfirmDeleteRow: _react.PropTypes.func,
prePage: _react.PropTypes.string,
nextPage: _react.PropTypes.string,
firstPage: _react.PropTypes.string,
lastPage: _react.PropTypes.string,
searchDelayTime: _react.PropTypes.number,
exportCSVText: _react.PropTypes.string,
insertText: _react.PropTypes.string,
deleteText: _react.PropTypes.string,
saveText: _react.PropTypes.string,
closeText: _react.PropTypes.string,
ignoreEditable: _react.PropTypes.bool,
defaultSearch: _react.PropTypes.string
}),
fetchInfo: _react.PropTypes.shape({
dataTotalSize: _react.PropTypes.number
}),
exportCSV: _react.PropTypes.bool,
csvFileName: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]),
ignoreSinglePage: _react.PropTypes.bool
};
BootstrapTable.defaultProps = {
height: '100%',
maxHeight: undefined,
striped: false,
bordered: true,
hover: false,
condensed: false,
pagination: false,
printable: false,
searchPlaceholder: undefined,
selectRow: {
mode: _Const2.default.ROW_SELECT_NONE,
bgColor: _Const2.default.ROW_SELECT_BG_COLOR,
selected: [],
onSelect: undefined,
onSelectAll: undefined,
clickToSelect: false,
hideSelectColumn: false,
clickToSelectAndEditCell: false,
showOnlySelected: false,
unselectable: [],
customComponent: undefined
},
cellEdit: {
mode: _Const2.default.CELL_EDIT_NONE,
blurToSave: false,
beforeSaveCell: undefined,
afterSaveCell: undefined
},
insertRow: false,
deleteRow: false,
search: false,
multiColumnSearch: false,
columnFilter: false,
trClassName: '',
tableStyle: undefined,
containerStyle: undefined,
headerStyle: undefined,
bodyStyle: undefined,
containerClass: null,
tableContainerClass: null,
headerContainerClass: null,
bodyContainerClass: null,
tableHeaderClass: null,
tableBodyClass: null,
options: {
clearSearch: false,
sortName: undefined,
sortOrder: undefined,
defaultSortName: undefined,
defaultSortOrder: undefined,
sortIndicator: true,
afterTableComplete: undefined,
afterDeleteRow: undefined,
afterInsertRow: undefined,
afterSearch: undefined,
afterColumnFilter: undefined,
onRowClick: undefined,
onRowDoubleClick: undefined,
onMouseLeave: undefined,
onMouseEnter: undefined,
onRowMouseOut: undefined,
onRowMouseOver: undefined,
page: undefined,
paginationShowsTotal: false,
sizePerPageList: _Const2.default.SIZE_PER_PAGE_LIST,
sizePerPage: undefined,
paginationSize: _Const2.default.PAGINATION_SIZE,
hideSizePerPage: false,
onSizePerPageList: undefined,
noDataText: undefined,
handleConfirmDeleteRow: undefined,
prePage: _Const2.default.PRE_PAGE,
nextPage: _Const2.default.NEXT_PAGE,
firstPage: _Const2.default.FIRST_PAGE,
lastPage: _Const2.default.LAST_PAGE,
pageStartIndex: undefined,
searchDelayTime: undefined,
exportCSVText: _Const2.default.EXPORT_CSV_TEXT,
insertText: _Const2.default.INSERT_BTN_TEXT,
deleteText: _Const2.default.DELETE_BTN_TEXT,
saveText: _Const2.default.SAVE_BTN_TEXT,
closeText: _Const2.default.CLOSE_BTN_TEXT,
ignoreEditable: false,
defaultSearch: ''
},
fetchInfo: {
dataTotalSize: 0
},
exportCSV: false,
csvFileName: 'spreadsheet.csv',
ignoreSinglePage: false
};
var _default = BootstrapTable;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(BootstrapTable, 'BootstrapTable', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/BootstrapTable.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/BootstrapTable.js');
}();
;
/***/ },
/* 2 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
return classNames;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.classNames = classNames;
}
}());
/***/ },
/* 4 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _default = {
SORT_DESC: 'desc',
SORT_ASC: 'asc',
SIZE_PER_PAGE: 10,
NEXT_PAGE: '>',
LAST_PAGE: '>>',
PRE_PAGE: '<',
FIRST_PAGE: '<<',
PAGE_START_INDEX: 1,
ROW_SELECT_BG_COLOR: '',
ROW_SELECT_NONE: 'none',
ROW_SELECT_SINGLE: 'radio',
ROW_SELECT_MULTI: 'checkbox',
CELL_EDIT_NONE: 'none',
CELL_EDIT_CLICK: 'click',
CELL_EDIT_DBCLICK: 'dbclick',
SIZE_PER_PAGE_LIST: [10, 25, 30, 50],
PAGINATION_SIZE: 5,
NO_DATA_TEXT: 'There is no data to display',
SHOW_ONLY_SELECT: 'Show Selected Only',
SHOW_ALL: 'Show All',
EXPORT_CSV_TEXT: 'Export to CSV',
INSERT_BTN_TEXT: 'New',
DELETE_BTN_TEXT: 'Delete',
SAVE_BTN_TEXT: 'Save',
CLOSE_BTN_TEXT: 'Close',
FILTER_DELAY: 500,
FILTER_TYPE: {
TEXT: 'TextFilter',
REGEX: 'RegexFilter',
SELECT: 'SelectFilter',
NUMBER: 'NumberFilter',
DATE: 'DateFilter',
CUSTOM: 'CustomFilter'
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Const.js');
}();
;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(6);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _SelectRowHeaderColumn = __webpack_require__(7);
var _SelectRowHeaderColumn2 = _interopRequireDefault(_SelectRowHeaderColumn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Checkbox = function (_Component) {
_inherits(Checkbox, _Component);
function Checkbox() {
_classCallCheck(this, Checkbox);
return _possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).apply(this, arguments));
}
_createClass(Checkbox, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.update(this.props.checked);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(props) {
this.update(props.checked);
}
}, {
key: 'update',
value: function update(checked) {
_reactDom2.default.findDOMNode(this).indeterminate = checked === 'indeterminate';
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement('input', { className: 'react-bs-select-all',
type: 'checkbox',
checked: this.props.checked,
onChange: this.props.onChange });
}
}]);
return Checkbox;
}(_react.Component);
var TableHeader = function (_Component2) {
_inherits(TableHeader, _Component2);
function TableHeader() {
_classCallCheck(this, TableHeader);
return _possibleConstructorReturn(this, (TableHeader.__proto__ || Object.getPrototypeOf(TableHeader)).apply(this, arguments));
}
_createClass(TableHeader, [{
key: 'render',
value: function render() {
var _this3 = this;
var containerClasses = (0, _classnames2.default)('react-bs-container-header', 'table-header-wrapper', this.props.headerContainerClass);
var tableClasses = (0, _classnames2.default)('table', 'table-hover', {
'table-bordered': this.props.bordered,
'table-condensed': this.props.condensed
}, this.props.tableHeaderClass);
var selectRowHeaderCol = null;
if (!this.props.hideSelectColumn) selectRowHeaderCol = this.renderSelectRowHeader();
var i = 0;
return _react2.default.createElement(
'div',
{ ref: 'container', className: containerClasses, style: this.props.style },
_react2.default.createElement(
'table',
{ className: tableClasses },
_react2.default.createElement(
'thead',
null,
_react2.default.createElement(
'tr',
{ ref: 'header' },
selectRowHeaderCol,
_react2.default.Children.map(this.props.children, function (elm) {
var _props = _this3.props,
sortIndicator = _props.sortIndicator,
sortName = _props.sortName,
sortOrder = _props.sortOrder,
onSort = _props.onSort;
var _elm$props = elm.props,
dataField = _elm$props.dataField,
dataSort = _elm$props.dataSort;
var sort = dataSort && dataField === sortName ? sortOrder : undefined;
return _react2.default.cloneElement(elm, { key: i++, onSort: onSort, sort: sort, sortIndicator: sortIndicator });
})
)
)
)
);
}
}, {
key: 'renderSelectRowHeader',
value: function renderSelectRowHeader() {
if (this.props.customComponent) {
var CustomComponent = this.props.customComponent;
return _react2.default.createElement(
_SelectRowHeaderColumn2.default,
null,
_react2.default.createElement(CustomComponent, { type: 'checkbox', checked: this.props.isSelectAll,
indeterminate: this.props.isSelectAll === 'indeterminate', disabled: false,
onChange: this.props.onSelectAllRow, rowIndex: 'Header' })
);
} else if (this.props.rowSelectType === _Const2.default.ROW_SELECT_SINGLE) {
return _react2.default.createElement(_SelectRowHeaderColumn2.default, null);
} else if (this.props.rowSelectType === _Const2.default.ROW_SELECT_MULTI) {
return _react2.default.createElement(
_SelectRowHeaderColumn2.default,
null,
_react2.default.createElement(Checkbox, {
onChange: this.props.onSelectAllRow,
checked: this.props.isSelectAll })
);
} else {
return null;
}
}
}]);
return TableHeader;
}(_react.Component);
TableHeader.propTypes = {
headerContainerClass: _react.PropTypes.string,
tableHeaderClass: _react.PropTypes.string,
style: _react.PropTypes.object,
rowSelectType: _react.PropTypes.string,
onSort: _react.PropTypes.func,
onSelectAllRow: _react.PropTypes.func,
sortName: _react.PropTypes.string,
sortOrder: _react.PropTypes.string,
hideSelectColumn: _react.PropTypes.bool,
bordered: _react.PropTypes.bool,
condensed: _react.PropTypes.bool,
isFiltered: _react.PropTypes.bool,
isSelectAll: _react.PropTypes.oneOf([true, 'indeterminate', false]),
sortIndicator: _react.PropTypes.bool,
customComponent: _react.PropTypes.func
};
var _default = TableHeader;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Checkbox, 'Checkbox', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeader.js');
__REACT_HOT_LOADER__.register(TableHeader, 'TableHeader', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeader.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeader.js');
}();
;
/***/ },
/* 6 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var SelectRowHeaderColumn = function (_Component) {
_inherits(SelectRowHeaderColumn, _Component);
function SelectRowHeaderColumn() {
_classCallCheck(this, SelectRowHeaderColumn);
return _possibleConstructorReturn(this, (SelectRowHeaderColumn.__proto__ || Object.getPrototypeOf(SelectRowHeaderColumn)).apply(this, arguments));
}
_createClass(SelectRowHeaderColumn, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'th',
{ style: { textAlign: 'center' } },
this.props.children
);
}
}]);
return SelectRowHeaderColumn;
}(_react.Component);
SelectRowHeaderColumn.propTypes = {
children: _react.PropTypes.node
};
var _default = SelectRowHeaderColumn;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(SelectRowHeaderColumn, 'SelectRowHeaderColumn', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/SelectRowHeaderColumn.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/SelectRowHeaderColumn.js');
}();
;
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _TableRow = __webpack_require__(9);
var _TableRow2 = _interopRequireDefault(_TableRow);
var _TableColumn = __webpack_require__(10);
var _TableColumn2 = _interopRequireDefault(_TableColumn);
var _TableEditColumn = __webpack_require__(11);
var _TableEditColumn2 = _interopRequireDefault(_TableEditColumn);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var isFun = function isFun(obj) {
return obj && typeof obj === 'function';
};
var TableBody = function (_Component) {
_inherits(TableBody, _Component);
function TableBody(props) {
_classCallCheck(this, TableBody);
var _this = _possibleConstructorReturn(this, (TableBody.__proto__ || Object.getPrototypeOf(TableBody)).call(this, props));
_this.handleRowMouseOut = function () {
return _this.__handleRowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowMouseOver = function () {
return _this.__handleRowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowClick = function () {
return _this.__handleRowClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleRowDoubleClick = function () {
return _this.__handleRowDoubleClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleSelectRow = function () {
return _this.__handleSelectRow__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleSelectRowColumChange = function () {
return _this.__handleSelectRowColumChange__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleEditCell = function () {
return _this.__handleEditCell__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleCompleteEditCell = function () {
return _this.__handleCompleteEditCell__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.state = {
currEditCell: null
};
return _this;
}
_createClass(TableBody, [{
key: 'render',
value: function render() {
var tableClasses = (0, _classnames2.default)('table', {
'table-striped': this.props.striped,
'table-bordered': this.props.bordered,
'table-hover': this.props.hover,
'table-condensed': this.props.condensed
}, this.props.tableBodyClass);
var unselectable = this.props.selectRow.unselectable || [];
var isSelectRowDefined = this._isSelectRowDefined();
var tableHeader = this.renderTableHeader(isSelectRowDefined);
var inputType = this.props.selectRow.mode === _Const2.default.ROW_SELECT_SINGLE ? 'radio' : 'checkbox';
var CustomComponent = this.props.selectRow.customComponent;
var tableRows = this.props.data.map(function (data, r) {
var tableColumns = this.props.columns.map(function (column, i) {
var fieldValue = data[column.name];
if (column.name !== this.props.keyField && // Key field can't be edit
column.editable && // column is editable? default is true, user can set it false
this.state.currEditCell !== null && this.state.currEditCell.rid === r && this.state.currEditCell.cid === i) {
var editable = column.editable;
var format = column.format ? function (value) {
return column.format(value, data, column.formatExtraData, r).replace(/<.*?>/g, '');
} : false;
if (isFun(column.editable)) {
editable = column.editable(fieldValue, data, r, i);
}
return _react2.default.createElement(_TableEditColumn2.default, {
completeEdit: this.handleCompleteEditCell
// add by bluespring for column editor customize
, editable: editable,
customEditor: column.customEditor,
format: column.format ? format : false,
key: i,
blurToSave: this.props.cellEdit.blurToSave,
rowIndex: r,
colIndex: i,
row: data,
fieldValue: fieldValue });
} else {
// add by bluespring for className customize
var columnChild = fieldValue && fieldValue.toString();
var columnTitle = null;
var tdClassName = column.className;
if (isFun(column.className)) {
tdClassName = column.className(fieldValue, data, r, i);
}
if (typeof column.format !== 'undefined') {
var formattedValue = column.format(fieldValue, data, column.formatExtraData, r);
if (!_react2.default.isValidElement(formattedValue)) {
columnChild = _react2.default.createElement('div', { dangerouslySetInnerHTML: { __html: formattedValue } });
} else {
columnChild = formattedValue;
columnTitle = column.columnTitle && formattedValue ? formattedValue.toString() : null;
}
} else {
columnTitle = column.columnTitle && fieldValue ? fieldValue.toString() : null;
}
return _react2.default.createElement(
_TableColumn2.default,
{ key: i,
dataAlign: column.align,
className: tdClassName,
columnTitle: columnTitle,
cellEdit: this.props.cellEdit,
hidden: column.hidden,
onEdit: this.handleEditCell,
width: column.width },
columnChild
);
}
}, this);
var key = data[this.props.keyField];
var disable = unselectable.indexOf(key) !== -1;
var selected = this.props.selectedRowKeys.indexOf(key) !== -1;
var selectRowColumn = isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? this.renderSelectRowColumn(selected, inputType, disable, CustomComponent, r) : null;
// add by bluespring for className customize
var trClassName = this.props.trClassName;
if (isFun(this.props.trClassName)) {
trClassName = this.props.trClassName(data, r);
}
return _react2.default.createElement(
_TableRow2.default,
{ isSelected: selected, key: key, className: trClassName,
selectRow: isSelectRowDefined ? this.props.selectRow : undefined,
enableCellEdit: this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_NONE,
onRowClick: this.handleRowClick,
onRowDoubleClick: this.handleRowDoubleClick,
onRowMouseOver: this.handleRowMouseOver,
onRowMouseOut: this.handleRowMouseOut,
onSelectRow: this.handleSelectRow,
unselectableRow: disable },
selectRowColumn,
tableColumns
);
}, this);
if (tableRows.length === 0) {
tableRows.push(_react2.default.createElement(
_TableRow2.default,
{ key: '##table-empty##' },
_react2.default.createElement(
'td',
{ colSpan: this.props.columns.length + (isSelectRowDefined ? 1 : 0),
className: 'react-bs-table-no-data' },
this.props.noDataText || _Const2.default.NO_DATA_TEXT
)
));
}
return _react2.default.createElement(
'div',
{ ref: 'container',
className: (0, _classnames2.default)('react-bs-container-body', this.props.bodyContainerClass),
style: this.props.style },
_react2.default.createElement(
'table',
{ className: tableClasses },
tableHeader,
_react2.default.createElement(
'tbody',
{ ref: 'tbody' },
tableRows
)
)
);
}
}, {
key: 'renderTableHeader',
value: function renderTableHeader(isSelectRowDefined) {
var selectRowHeader = null;
if (isSelectRowDefined) {
var style = {
width: 30,
minWidth: 30
};
if (!this.props.selectRow.hideSelectColumn) {
selectRowHeader = _react2.default.createElement('col', { style: style, key: -1 });
}
}
var theader = this.props.columns.map(function (column, i) {
var style = {
display: column.hidden ? 'none' : null
};
if (column.width) {
var width = parseInt(column.width, 10);
style.width = width;
/** add min-wdth to fix user assign column width
not eq offsetWidth in large column table **/
style.minWidth = width;
}
return _react2.default.createElement('col', { style: style, key: i, className: column.className });
});
return _react2.default.createElement(
'colgroup',
{ ref: 'header' },
selectRowHeader,
theader
);
}
}, {
key: '__handleRowMouseOut__REACT_HOT_LOADER__',
value: function __handleRowMouseOut__REACT_HOT_LOADER__(rowIndex, event) {
var targetRow = this.props.data[rowIndex];
this.props.onRowMouseOut(targetRow, event);
}
}, {
key: '__handleRowMouseOver__REACT_HOT_LOADER__',
value: function __handleRowMouseOver__REACT_HOT_LOADER__(rowIndex, event) {
var targetRow = this.props.data[rowIndex];
this.props.onRowMouseOver(targetRow, event);
}
}, {
key: '__handleRowClick__REACT_HOT_LOADER__',
value: function __handleRowClick__REACT_HOT_LOADER__(rowIndex) {
var selectedRow = void 0;
var _props = this.props,
data = _props.data,
onRowClick = _props.onRowClick;
data.forEach(function (row, i) {
if (i === rowIndex - 1) {
selectedRow = row;
}
});
onRowClick(selectedRow);
}
}, {
key: '__handleRowDoubleClick__REACT_HOT_LOADER__',
value: function __handleRowDoubleClick__REACT_HOT_LOADER__(rowIndex) {
var selectedRow = void 0;
var _props2 = this.props,
data = _props2.data,
onRowDoubleClick = _props2.onRowDoubleClick;
data.forEach(function (row, i) {
if (i === rowIndex - 1) {
selectedRow = row;
}
});
onRowDoubleClick(selectedRow);
}
}, {
key: '__handleSelectRow__REACT_HOT_LOADER__',
value: function __handleSelectRow__REACT_HOT_LOADER__(rowIndex, isSelected, e) {
var selectedRow = void 0;
var _props3 = this.props,
data = _props3.data,
onSelectRow = _props3.onSelectRow;
data.forEach(function (row, i) {
if (i === rowIndex - 1) {
selectedRow = row;
return false;
}
});
onSelectRow(selectedRow, isSelected, e);
}
}, {
key: '__handleSelectRowColumChange__REACT_HOT_LOADER__',
value: function __handleSelectRowColumChange__REACT_HOT_LOADER__(e, rowIndex) {
if (!this.props.selectRow.clickToSelect || !this.props.selectRow.clickToSelectAndEditCell) {
this.handleSelectRow(rowIndex + 1, e.currentTarget.checked, e);
}
}
}, {
key: '__handleEditCell__REACT_HOT_LOADER__',
value: function __handleEditCell__REACT_HOT_LOADER__(rowIndex, columnIndex, e) {
if (this._isSelectRowDefined()) {
columnIndex--;
if (this.props.selectRow.hideSelectColumn) columnIndex++;
}
rowIndex--;
var stateObj = {
currEditCell: {
rid: rowIndex,
cid: columnIndex
}
};
if (this.props.selectRow.clickToSelectAndEditCell && this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_DBCLICK) {
var selected = this.props.selectedRowKeys.indexOf(this.props.data[rowIndex][this.props.keyField]) !== -1;
this.handleSelectRow(rowIndex + 1, !selected, e);
}
this.setState(stateObj);
}
}, {
key: '__handleCompleteEditCell__REACT_HOT_LOADER__',
value: function __handleCompleteEditCell__REACT_HOT_LOADER__(newVal, rowIndex, columnIndex) {
this.setState({ currEditCell: null });
if (newVal !== null) {
this.props.cellEdit.__onCompleteEdit__(newVal, rowIndex, columnIndex);
}
}
}, {
key: 'renderSelectRowColumn',
value: function renderSelectRowColumn(selected, inputType, disabled) {
var _this2 = this;
var CustomComponent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var rowIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
return _react2.default.createElement(
_TableColumn2.default,
{ dataAlign: 'center' },
CustomComponent ? _react2.default.createElement(CustomComponent, { type: inputType, checked: selected, disabled: disabled,
rowIndex: rowIndex,
onChange: function onChange(e) {
return _this2.handleSelectRowColumChange(e, e.currentTarget.parentElement.parentElement.parentElement.rowIndex);
} }) : _react2.default.createElement('input', { type: inputType, checked: selected, disabled: disabled,
onChange: function onChange(e) {
return _this2.handleSelectRowColumChange(e, e.currentTarget.parentElement.parentElement.rowIndex);
} })
);
}
}, {
key: '_isSelectRowDefined',
value: function _isSelectRowDefined() {
return this.props.selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || this.props.selectRow.mode === _Const2.default.ROW_SELECT_MULTI;
}
}]);
return TableBody;
}(_react.Component);
TableBody.propTypes = {
data: _react.PropTypes.array,
columns: _react.PropTypes.array,
striped: _react.PropTypes.bool,
bordered: _react.PropTypes.bool,
hover: _react.PropTypes.bool,
condensed: _react.PropTypes.bool,
keyField: _react.PropTypes.string,
selectedRowKeys: _react.PropTypes.array,
onRowClick: _react.PropTypes.func,
onRowDoubleClick: _react.PropTypes.func,
onSelectRow: _react.PropTypes.func,
noDataText: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.object]),
style: _react.PropTypes.object,
tableBodyClass: _react.PropTypes.string,
bodyContainerClass: _react.PropTypes.string
};
var _default = TableBody;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(isFun, 'isFun', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableBody.js');
__REACT_HOT_LOADER__.register(TableBody, 'TableBody', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableBody.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableBody.js');
}();
;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'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 _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 _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TableRow = function (_Component) {
_inherits(TableRow, _Component);
function TableRow(props) {
_classCallCheck(this, TableRow);
var _this = _possibleConstructorReturn(this, (TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call(this, props));
_this.rowClick = function () {
return _this.__rowClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.rowDoubleClick = function () {
return _this.__rowDoubleClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.rowMouseOut = function () {
return _this.__rowMouseOut__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.rowMouseOver = function () {
return _this.__rowMouseOver__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.clickNum = 0;
return _this;
}
_createClass(TableRow, [{
key: '__rowClick__REACT_HOT_LOADER__',
value: function __rowClick__REACT_HOT_LOADER__(e) {
var _this2 = this;
if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'SELECT' && e.target.tagName !== 'TEXTAREA') {
(function () {
var rowIndex = e.currentTarget.rowIndex + 1;
var _props = _this2.props,
selectRow = _props.selectRow,
unselectableRow = _props.unselectableRow,
isSelected = _props.isSelected,
onSelectRow = _props.onSelectRow;
if (selectRow) {
if (selectRow.clickToSelect && !unselectableRow) {
onSelectRow(rowIndex, !isSelected, e);
} else if (selectRow.clickToSelectAndEditCell && !unselectableRow) {
_this2.clickNum++;
/** if clickToSelectAndEditCell is enabled,
* there should be a delay to prevent a selection changed when
* user dblick to edit cell on same row but different cell
**/
setTimeout(function () {
if (_this2.clickNum === 1) {
onSelectRow(rowIndex, !isSelected, e);
}
_this2.clickNum = 0;
}, 200);
}
}
if (_this2.props.onRowClick) _this2.props.onRowClick(rowIndex);
})();
}
}
}, {
key: '__rowDoubleClick__REACT_HOT_LOADER__',
value: function __rowDoubleClick__REACT_HOT_LOADER__(e) {
if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'SELECT' && e.target.tagName !== 'TEXTAREA') {
var rowIndex = e.currentTarget.rowIndex + 1;
if (this.props.onRowDoubleClick) {
this.props.onRowDoubleClick(rowIndex);
}
}
}
}, {
key: '__rowMouseOut__REACT_HOT_LOADER__',
value: function __rowMouseOut__REACT_HOT_LOADER__(e) {
if (this.props.onRowMouseOut) {
this.props.onRowMouseOut(e.currentTarget.rowIndex, e);
}
}
}, {
key: '__rowMouseOver__REACT_HOT_LOADER__',
value: function __rowMouseOver__REACT_HOT_LOADER__(e) {
if (this.props.onRowMouseOver) {
this.props.onRowMouseOver(e.currentTarget.rowIndex, e);
}
}
}, {
key: 'render',
value: function render() {
this.clickNum = 0;
var trCss = {
style: {
backgroundColor: this.props.isSelected ? this.props.selectRow.bgColor : null
},
className: (0, _classnames2.default)(this.props.isSelected ? this.props.selectRow.className : null, this.props.className)
};
if (this.props.selectRow && (this.props.selectRow.clickToSelect || this.props.selectRow.clickToSelectAndEditCell) || this.props.onRowClick || this.props.onRowDoubleClick) {
return _react2.default.createElement(
'tr',
_extends({}, trCss, {
onMouseOver: this.rowMouseOver,
onMouseOut: this.rowMouseOut,
onClick: this.rowClick,
onDoubleClick: this.rowDoubleClick }),
this.props.children
);
} else {
return _react2.default.createElement(
'tr',
trCss,
this.props.children
);
}
}
}]);
return TableRow;
}(_react.Component);
TableRow.propTypes = {
isSelected: _react.PropTypes.bool,
enableCellEdit: _react.PropTypes.bool,
onRowClick: _react.PropTypes.func,
onRowDoubleClick: _react.PropTypes.func,
onSelectRow: _react.PropTypes.func,
onRowMouseOut: _react.PropTypes.func,
onRowMouseOver: _react.PropTypes.func,
unselectableRow: _react.PropTypes.bool
};
TableRow.defaultProps = {
onRowClick: undefined,
onRowDoubleClick: undefined
};
var _default = TableRow;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TableRow, 'TableRow', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableRow.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableRow.js');
}();
;
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'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 _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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TableColumn = function (_Component) {
_inherits(TableColumn, _Component);
function TableColumn(props) {
_classCallCheck(this, TableColumn);
var _this = _possibleConstructorReturn(this, (TableColumn.__proto__ || Object.getPrototypeOf(TableColumn)).call(this, props));
_this.handleCellEdit = function () {
return _this.__handleCellEdit__REACT_HOT_LOADER__.apply(_this, arguments);
};
return _this;
}
/* eslint no-unused-vars: [0, { "args": "after-used" }] */
_createClass(TableColumn, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
var children = this.props.children;
var shouldUpdated = this.props.width !== nextProps.width || this.props.className !== nextProps.className || this.props.hidden !== nextProps.hidden || this.props.dataAlign !== nextProps.dataAlign || (typeof children === 'undefined' ? 'undefined' : _typeof(children)) !== _typeof(nextProps.children) || ('' + this.props.onEdit).toString() !== ('' + nextProps.onEdit).toString();
if (shouldUpdated) {
return shouldUpdated;
}
if ((typeof children === 'undefined' ? 'undefined' : _typeof(children)) === 'object' && children !== null && children.props !== null) {
if (children.props.type === 'checkbox' || children.props.type === 'radio') {
shouldUpdated = shouldUpdated || children.props.type !== nextProps.children.props.type || children.props.checked !== nextProps.children.props.checked || children.props.disabled !== nextProps.children.props.disabled;
} else {
shouldUpdated = true;
}
} else {
shouldUpdated = shouldUpdated || children !== nextProps.children;
}
if (shouldUpdated) {
return shouldUpdated;
}
if (!(this.props.cellEdit && nextProps.cellEdit)) {
return false;
} else {
return shouldUpdated || this.props.cellEdit.mode !== nextProps.cellEdit.mode;
}
}
}, {
key: '__handleCellEdit__REACT_HOT_LOADER__',
value: function __handleCellEdit__REACT_HOT_LOADER__(e) {
if (this.props.cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) {
if (document.selection && document.selection.empty) {
document.selection.empty();
} else if (window.getSelection) {
var sel = window.getSelection();
sel.removeAllRanges();
}
}
this.props.onEdit(e.currentTarget.parentElement.rowIndex + 1, e.currentTarget.cellIndex, e);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
children = _props.children,
columnTitle = _props.columnTitle,
className = _props.className,
dataAlign = _props.dataAlign,
hidden = _props.hidden,
cellEdit = _props.cellEdit;
var tdStyle = {
textAlign: dataAlign,
display: hidden ? 'none' : null
};
var opts = {};
if (cellEdit) {
if (cellEdit.mode === _Const2.default.CELL_EDIT_CLICK) {
opts.onClick = this.handleCellEdit;
} else if (cellEdit.mode === _Const2.default.CELL_EDIT_DBCLICK) {
opts.onDoubleClick = this.handleCellEdit;
}
}
return _react2.default.createElement(
'td',
_extends({ style: tdStyle,
title: columnTitle,
className: className
}, opts),
typeof children === 'boolean' ? children.toString() : children
);
}
}]);
return TableColumn;
}(_react.Component);
TableColumn.propTypes = {
dataAlign: _react.PropTypes.string,
hidden: _react.PropTypes.bool,
className: _react.PropTypes.string,
columnTitle: _react.PropTypes.string,
children: _react.PropTypes.node
};
TableColumn.defaultProps = {
dataAlign: 'left',
hidden: false,
className: ''
};
var _default = TableColumn;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TableColumn, 'TableColumn', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableColumn.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableColumn.js');
}();
;
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
'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 _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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Editor = __webpack_require__(12);
var _Editor2 = _interopRequireDefault(_Editor);
var _Notification = __webpack_require__(13);
var _Notification2 = _interopRequireDefault(_Notification);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TableEditColumn = function (_Component) {
_inherits(TableEditColumn, _Component);
function TableEditColumn(props) {
_classCallCheck(this, TableEditColumn);
var _this = _possibleConstructorReturn(this, (TableEditColumn.__proto__ || Object.getPrototypeOf(TableEditColumn)).call(this, props));
_this.handleKeyPress = function () {
return _this.__handleKeyPress__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleBlur = function () {
return _this.__handleBlur__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleCustomUpdate = function () {
return _this.__handleCustomUpdate__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.timeouteClear = 0;
_this.state = {
shakeEditor: false
};
return _this;
}
_createClass(TableEditColumn, [{
key: '__handleKeyPress__REACT_HOT_LOADER__',
value: function __handleKeyPress__REACT_HOT_LOADER__(e) {
if (e.keyCode === 13) {
// Pressed ENTER
var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value;
if (!this.validator(value)) {
return;
}
this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
} else if (e.keyCode === 27) {
this.props.completeEdit(null, this.props.rowIndex, this.props.colIndex);
} else if (e.type === 'click' && !this.props.blurToSave) {
// textarea click save button
var _value = e.target.parentElement.firstChild.value;
if (!this.validator(_value)) {
return;
}
this.props.completeEdit(_value, this.props.rowIndex, this.props.colIndex);
}
}
}, {
key: '__handleBlur__REACT_HOT_LOADER__',
value: function __handleBlur__REACT_HOT_LOADER__(e) {
e.stopPropagation();
if (this.props.blurToSave) {
var value = e.currentTarget.type === 'checkbox' ? this._getCheckBoxValue(e) : e.currentTarget.value;
if (!this.validator(value)) {
return;
}
this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
}
}
}, {
key: '__handleCustomUpdate__REACT_HOT_LOADER__',
// modified by iuculanop
// BEGIN
value: function __handleCustomUpdate__REACT_HOT_LOADER__(value) {
this.props.completeEdit(value, this.props.rowIndex, this.props.colIndex);
}
}, {
key: 'validator',
value: function validator(value) {
var ts = this;
var valid = true;
if (ts.props.editable.validator) {
var input = ts.refs.inputRef;
var checkVal = ts.props.editable.validator(value);
var responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal);
if (responseType !== 'object' && checkVal !== true) {
valid = false;
ts.refs.notifier.notice('error', checkVal, 'Pressed ESC can cancel');
} else if (responseType === 'object' && checkVal.isValid !== true) {
valid = false;
ts.refs.notifier.notice(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title);
}
if (!valid) {
// animate input
ts.clearTimeout();
ts.setState({ shakeEditor: true });
ts.timeouteClear = setTimeout(function () {
ts.setState({ shakeEditor: false });
}, 300);
input.focus();
return valid;
}
}
return valid;
}
// END
}, {
key: 'clearTimeout',
value: function (_clearTimeout) {
function clearTimeout() {
return _clearTimeout.apply(this, arguments);
}
clearTimeout.toString = function () {
return _clearTimeout.toString();
};
return clearTimeout;
}(function () {
if (this.timeouteClear !== 0) {
clearTimeout(this.timeouteClear);
this.timeouteClear = 0;
}
})
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this.refs.inputRef.focus();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.clearTimeout();
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
editable = _props.editable,
format = _props.format,
customEditor = _props.customEditor;
var shakeEditor = this.state.shakeEditor;
var attr = {
ref: 'inputRef',
onKeyDown: this.handleKeyPress,
onBlur: this.handleBlur
};
var fieldValue = this.props.fieldValue;
// put placeholder if exist
editable.placeholder && (attr.placeholder = editable.placeholder);
var editorClass = (0, _classnames2.default)({ 'animated': shakeEditor, 'shake': shakeEditor });
var cellEditor = void 0;
if (customEditor) {
var customEditorProps = _extends({
row: this.props.row
}, attr, {
defaultValue: fieldValue || ''
}, customEditor.customEditorParameters);
cellEditor = customEditor.getElement(this.handleCustomUpdate, customEditorProps);
} else {
fieldValue = fieldValue === 0 ? '0' : fieldValue;
cellEditor = (0, _Editor2.default)(editable, attr, format, editorClass, fieldValue || '');
}
return _react2.default.createElement(
'td',
{ ref: 'td', style: { position: 'relative' } },
cellEditor,
_react2.default.createElement(_Notification2.default, { ref: 'notifier' })
);
}
}, {
key: '_getCheckBoxValue',
value: function _getCheckBoxValue(e) {
var value = '';
var values = e.currentTarget.value.split(':');
value = e.currentTarget.checked ? values[0] : values[1];
return value;
}
}]);
return TableEditColumn;
}(_react.Component);
TableEditColumn.propTypes = {
completeEdit: _react.PropTypes.func,
rowIndex: _react.PropTypes.number,
colIndex: _react.PropTypes.number,
blurToSave: _react.PropTypes.bool,
editable: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.object]),
format: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]),
row: _react.PropTypes.any,
fieldValue: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.bool, _react.PropTypes.number, _react.PropTypes.array, _react.PropTypes.object])
};
var _default = TableEditColumn;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TableEditColumn, 'TableEditColumn', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableEditColumn.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableEditColumn.js');
}();
;
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _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 = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var editor = function editor(editable, attr, format, editorClass, defaultValue, ignoreEditable) {
if (editable === true || editable === false && ignoreEditable || typeof editable === 'string') {
// simple declare
var type = editable ? 'text' : editable;
return _react2.default.createElement('input', _extends({}, attr, { type: type, defaultValue: defaultValue,
className: (editorClass || '') + ' form-control editor edit-text' }));
} else if (!editable) {
var _type = editable ? 'text' : editable;
return _react2.default.createElement('input', _extends({}, attr, { type: _type, defaultValue: defaultValue,
disabled: 'disabled',
className: (editorClass || '') + ' form-control editor edit-text' }));
} else if (editable && (editable.type === undefined || editable.type === null || editable.type.trim() === '')) {
var _type2 = editable ? 'text' : editable;
return _react2.default.createElement('input', _extends({}, attr, { type: _type2, defaultValue: defaultValue,
className: (editorClass || '') + ' form-control editor edit-text' }));
} else if (editable.type) {
// standard declare
// put style if exist
editable.style && (attr.style = editable.style);
// put class if exist
attr.className = (editorClass || '') + ' form-control editor edit-' + editable.type + (editable.className ? ' ' + editable.className : '');
if (editable.type === 'select') {
// process select input
var options = [];
var values = editable.options.values;
if (Array.isArray(values)) {
(function () {
// only can use arrray data for options
var rowValue = void 0;
options = values.map(function (d, i) {
rowValue = format ? format(d) : d;
return _react2.default.createElement(
'option',
{ key: 'option' + i, value: d },
rowValue
);
});
})();
}
return _react2.default.createElement(
'select',
_extends({}, attr, { defaultValue: defaultValue }),
options
);
} else if (editable.type === 'textarea') {
var _ret2 = function () {
// process textarea input
// put other if exist
editable.cols && (attr.cols = editable.cols);
editable.rows && (attr.rows = editable.rows);
var saveBtn = void 0;
var keyUpHandler = attr.onKeyDown;
if (keyUpHandler) {
attr.onKeyDown = function (e) {
if (e.keyCode !== 13) {
// not Pressed ENTER
keyUpHandler(e);
}
};
saveBtn = _react2.default.createElement(
'button',
{
className: 'btn btn-info btn-xs textarea-save-btn',
onClick: keyUpHandler },
'save'
);
}
return {
v: _react2.default.createElement(
'div',
null,
_react2.default.createElement('textarea', _extends({}, attr, { defaultValue: defaultValue })),
saveBtn
)
};
}();
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
} else if (editable.type === 'checkbox') {
var _values = 'true:false';
if (editable.options && editable.options.values) {
// values = editable.options.values.split(':');
_values = editable.options.values;
}
attr.className = attr.className.replace('form-control', '');
attr.className += ' checkbox pull-right';
var checked = defaultValue && defaultValue.toString() === _values.split(':')[0] ? true : false;
return _react2.default.createElement('input', _extends({}, attr, { type: 'checkbox',
value: _values, defaultChecked: checked }));
} else if (editable.type === 'datetime') {
return _react2.default.createElement('input', _extends({}, attr, { type: 'datetime-local', defaultValue: defaultValue }));
} else {
// process other input type. as password,url,email...
return _react2.default.createElement('input', _extends({}, attr, { type: 'text', defaultValue: defaultValue }));
}
}
// default return for other case of editable
return _react2.default.createElement('input', _extends({}, attr, { type: 'text',
className: (editorClass || '') + ' form-control editor edit-text' }));
};
var _default = editor;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(editor, 'editor', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Editor.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Editor.js');
}();
;
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _reactToastr = __webpack_require__(14);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ToastrMessageFactory = _react2.default.createFactory(_reactToastr.ToastMessage.animation);
var Notification = function (_Component) {
_inherits(Notification, _Component);
function Notification() {
_classCallCheck(this, Notification);
return _possibleConstructorReturn(this, (Notification.__proto__ || Object.getPrototypeOf(Notification)).apply(this, arguments));
}
_createClass(Notification, [{
key: 'notice',
// allow type is success,info,warning,error
value: function notice(type, msg, title) {
this.refs.toastr[type](msg, title, {
mode: 'single',
timeOut: 5000,
extendedTimeOut: 1000,
showAnimation: 'animated bounceIn',
hideAnimation: 'animated bounceOut'
});
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(_reactToastr.ToastContainer, { ref: 'toastr',
toastMessageFactory: ToastrMessageFactory,
id: 'toast-container',
className: 'toast-top-right' });
}
}]);
return Notification;
}(_react.Component);
var _default = Notification;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(ToastrMessageFactory, 'ToastrMessageFactory', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Notification.js');
__REACT_HOT_LOADER__.register(Notification, 'Notification', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Notification.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Notification.js');
}();
;
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ToastMessage = exports.ToastContainer = undefined;
var _ToastContainer = __webpack_require__(15);
var _ToastContainer2 = _interopRequireDefault(_ToastContainer);
var _ToastMessage = __webpack_require__(171);
var _ToastMessage2 = _interopRequireDefault(_ToastMessage);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.ToastContainer = _ToastContainer2.default;
exports.ToastMessage = _ToastMessage2.default;
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _omit2 = __webpack_require__(16);
var _omit3 = _interopRequireDefault(_omit2);
var _includes2 = __webpack_require__(153);
var _includes3 = _interopRequireDefault(_includes2);
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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _reactAddonsUpdate = __webpack_require__(164);
var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate);
var _ToastMessage = __webpack_require__(171);
var _ToastMessage2 = _interopRequireDefault(_ToastMessage);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ToastContainer = function (_Component) {
_inherits(ToastContainer, _Component);
function ToastContainer() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ToastContainer);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ToastContainer.__proto__ || Object.getPrototypeOf(ToastContainer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
toasts: [],
toastId: 0,
messageList: []
}, _this._handle_toast_remove = _this._handle_toast_remove.bind(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(ToastContainer, [{
key: "error",
value: function error(message, title, optionsOverride) {
this._notify(this.props.toastType.error, message, title, optionsOverride);
}
}, {
key: "info",
value: function info(message, title, optionsOverride) {
this._notify(this.props.toastType.info, message, title, optionsOverride);
}
}, {
key: "success",
value: function success(message, title, optionsOverride) {
this._notify(this.props.toastType.success, message, title, optionsOverride);
}
}, {
key: "warning",
value: function warning(message, title, optionsOverride) {
this._notify(this.props.toastType.warning, message, title, optionsOverride);
}
}, {
key: "clear",
value: function clear() {
var _this2 = this;
Object.keys(this.refs).forEach(function (key) {
_this2.refs[key].hideToast(false);
});
}
}, {
key: "_notify",
value: function _notify(type, message, title) {
var _this3 = this;
var optionsOverride = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
if (this.props.preventDuplicates) {
if ((0, _includes3.default)(this.state.messageList, message)) {
return;
}
}
var key = this.state.toastId++;
var toastId = key;
var newToast = (0, _reactAddonsUpdate2.default)(optionsOverride, {
$merge: {
type: type,
title: title,
message: message,
toastId: toastId,
key: key,
ref: "toasts__" + key,
handleOnClick: function handleOnClick(e) {
if ("function" === typeof optionsOverride.handleOnClick) {
optionsOverride.handleOnClick();
}
return _this3._handle_toast_on_click(e);
},
handleRemove: this._handle_toast_remove
}
});
var toastOperation = _defineProperty({}, "" + (this.props.newestOnTop ? "$unshift" : "$push"), [newToast]);
var messageOperation = _defineProperty({}, "" + (this.props.newestOnTop ? "$unshift" : "$push"), [message]);
var nextState = (0, _reactAddonsUpdate2.default)(this.state, {
toasts: toastOperation,
messageList: messageOperation
});
this.setState(nextState);
}
}, {
key: "_handle_toast_on_click",
value: function _handle_toast_on_click(event) {
this.props.onClick(event);
if (event.defaultPrevented) {
return;
}
event.preventDefault();
event.stopPropagation();
}
}, {
key: "_handle_toast_remove",
value: function _handle_toast_remove(toastId) {
var _this4 = this;
if (this.props.preventDuplicates) {
this.state.previousMessage = "";
}
var operationName = "" + (this.props.newestOnTop ? "reduceRight" : "reduce");
this.state.toasts[operationName](function (found, toast, index) {
if (found || toast.toastId !== toastId) {
return false;
}
_this4.setState((0, _reactAddonsUpdate2.default)(_this4.state, {
toasts: { $splice: [[index, 1]] },
messageList: { $splice: [[index, 1]] }
}));
return true;
}, false);
}
}, {
key: "render",
value: function render() {
var _this5 = this;
var divProps = (0, _omit3.default)(this.props, ["toastType", "toastMessageFactory", "preventDuplicates", "newestOnTop"]);
return _react2.default.createElement(
"div",
_extends({}, divProps, { "aria-live": "polite", role: "alert" }),
this.state.toasts.map(function (toast) {
return _this5.props.toastMessageFactory(toast);
})
);
}
}]);
return ToastContainer;
}(_react.Component);
ToastContainer.propTypes = {
toastType: _react.PropTypes.shape({
error: _react.PropTypes.string,
info: _react.PropTypes.string,
success: _react.PropTypes.string,
warning: _react.PropTypes.string
}).isRequired,
id: _react.PropTypes.string.isRequired,
toastMessageFactory: _react.PropTypes.func.isRequired,
preventDuplicates: _react.PropTypes.bool.isRequired,
newestOnTop: _react.PropTypes.bool.isRequired,
onClick: _react.PropTypes.func.isRequired
};
ToastContainer.defaultProps = {
toastType: {
error: "error",
info: "info",
success: "success",
warning: "warning"
},
id: "toast-container",
toastMessageFactory: _react2.default.createFactory(_ToastMessage2.default.animation),
preventDuplicates: true,
newestOnTop: true,
onClick: function onClick() {}
};
exports.default = ToastContainer;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(17),
baseClone = __webpack_require__(18),
baseUnset = __webpack_require__(128),
castPath = __webpack_require__(129),
copyObject = __webpack_require__(68),
flatRest = __webpack_require__(142),
getAllKeysIn = __webpack_require__(105);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
/***/ },
/* 17 */
/***/ function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(19),
arrayEach = __webpack_require__(63),
assignValue = __webpack_require__(64),
baseAssign = __webpack_require__(67),
baseAssignIn = __webpack_require__(90),
cloneBuffer = __webpack_require__(94),
copyArray = __webpack_require__(95),
copySymbols = __webpack_require__(96),
copySymbolsIn = __webpack_require__(99),
getAllKeys = __webpack_require__(103),
getAllKeysIn = __webpack_require__(105),
getTag = __webpack_require__(106),
initCloneArray = __webpack_require__(111),
initCloneByTag = __webpack_require__(112),
initCloneObject = __webpack_require__(126),
isArray = __webpack_require__(75),
isBuffer = __webpack_require__(76),
isObject = __webpack_require__(43),
keys = __webpack_require__(69);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(20),
stackClear = __webpack_require__(28),
stackDelete = __webpack_require__(29),
stackGet = __webpack_require__(30),
stackHas = __webpack_require__(31),
stackSet = __webpack_require__(32);
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(21),
listCacheDelete = __webpack_require__(22),
listCacheGet = __webpack_require__(25),
listCacheHas = __webpack_require__(26),
listCacheSet = __webpack_require__(27);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ },
/* 21 */
/***/ function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(23);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
var eq = __webpack_require__(24);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ },
/* 24 */
/***/ function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(23);
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(23);
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(23);
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(20);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
/***/ },
/* 29 */
/***/ function(module, exports) {
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
/***/ },
/* 30 */
/***/ function(module, exports) {
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
/***/ },
/* 31 */
/***/ function(module, exports) {
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHas;
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(20),
Map = __webpack_require__(33),
MapCache = __webpack_require__(48);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34),
root = __webpack_require__(39);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(35),
getValue = __webpack_require__(47);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(36),
isMasked = __webpack_require__(44),
isObject = __webpack_require__(43),
toSource = __webpack_require__(46);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(37),
isObject = __webpack_require__(43);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(38),
getRawTag = __webpack_require__(41),
objectToString = __webpack_require__(42);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
value = Object(value);
return (symToStringTag && symToStringTag in value)
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(39);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(40);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ },
/* 40 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(38);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ },
/* 42 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ },
/* 43 */
/***/ function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(45);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(39);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ },
/* 46 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ },
/* 47 */
/***/ function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(49),
mapCacheDelete = __webpack_require__(57),
mapCacheGet = __webpack_require__(60),
mapCacheHas = __webpack_require__(61),
mapCacheSet = __webpack_require__(62);
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(50),
ListCache = __webpack_require__(20),
Map = __webpack_require__(33);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(51),
hashDelete = __webpack_require__(53),
hashGet = __webpack_require__(54),
hashHas = __webpack_require__(55),
hashSet = __webpack_require__(56);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ },
/* 51 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(52);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ },
/* 53 */
/***/ function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(52);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(52);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(52);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(58);
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(59);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ },
/* 59 */
/***/ function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(58);
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ },
/* 61 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(58);
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ },
/* 62 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(58);
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ },
/* 63 */
/***/ function(module, exports) {
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(65),
eq = __webpack_require__(24);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(66);
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(68),
keys = __webpack_require__(69);
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(64),
baseAssignValue = __webpack_require__(65);
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(70),
baseKeys = __webpack_require__(85),
isArrayLike = __webpack_require__(89);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(71),
isArguments = __webpack_require__(72),
isArray = __webpack_require__(75),
isBuffer = __webpack_require__(76),
isIndex = __webpack_require__(79),
isTypedArray = __webpack_require__(80);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
/***/ },
/* 71 */
/***/ function(module, exports) {
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(73),
isObjectLike = __webpack_require__(74);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(37),
isObjectLike = __webpack_require__(74);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ },
/* 74 */
/***/ function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 75 */
/***/ function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ },
/* 76 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(39),
stubFalse = __webpack_require__(78);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(77)(module)))
/***/ },
/* 77 */
/***/ function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 78 */
/***/ function(module, exports) {
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = stubFalse;
/***/ },
/* 79 */
/***/ function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ },
/* 80 */
/***/ function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(81),
baseUnary = __webpack_require__(83),
nodeUtil = __webpack_require__(84);
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
/***/ },
/* 81 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(37),
isLength = __webpack_require__(82),
isObjectLike = __webpack_require__(74);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;
/***/ },
/* 82 */
/***/ function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ },
/* 83 */
/***/ function(module, exports) {
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ },
/* 84 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(40);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(77)(module)))
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(86),
nativeKeys = __webpack_require__(87);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
/***/ },
/* 86 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ },
/* 87 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(88);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ },
/* 88 */
/***/ function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ },
/* 89 */
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(36),
isLength = __webpack_require__(82);
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ },
/* 90 */
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(68),
keysIn = __webpack_require__(91);
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
/***/ },
/* 91 */
/***/ function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(70),
baseKeysIn = __webpack_require__(92),
isArrayLike = __webpack_require__(89);
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ },
/* 92 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(43),
isPrototype = __webpack_require__(86),
nativeKeysIn = __webpack_require__(93);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
/***/ },
/* 93 */
/***/ function(module, exports) {
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(39);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(77)(module)))
/***/ },
/* 95 */
/***/ function(module, exports) {
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
/***/ },
/* 96 */
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(68),
getSymbols = __webpack_require__(97);
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;
/***/ },
/* 97 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(88),
stubArray = __webpack_require__(98);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
module.exports = getSymbols;
/***/ },
/* 98 */
/***/ function(module, exports) {
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
/***/ },
/* 99 */
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(68),
getSymbolsIn = __webpack_require__(100);
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
/***/ },
/* 100 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(101),
getPrototype = __webpack_require__(102),
getSymbols = __webpack_require__(97),
stubArray = __webpack_require__(98);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ },
/* 101 */
/***/ function(module, exports) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ },
/* 102 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(88);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ },
/* 103 */
/***/ function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(104),
getSymbols = __webpack_require__(97),
keys = __webpack_require__(69);
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
/***/ },
/* 104 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(101),
isArray = __webpack_require__(75);
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
/***/ },
/* 105 */
/***/ function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(104),
getSymbolsIn = __webpack_require__(100),
keysIn = __webpack_require__(91);
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
/***/ },
/* 106 */
/***/ function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(107),
Map = __webpack_require__(33),
Promise = __webpack_require__(108),
Set = __webpack_require__(109),
WeakMap = __webpack_require__(110),
baseGetTag = __webpack_require__(37),
toSource = __webpack_require__(46);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34),
root = __webpack_require__(39);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ },
/* 108 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34),
root = __webpack_require__(39);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ },
/* 109 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34),
root = __webpack_require__(39);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ },
/* 110 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(34),
root = __webpack_require__(39);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ },
/* 111 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;
/***/ },
/* 112 */
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(113),
cloneDataView = __webpack_require__(115),
cloneMap = __webpack_require__(116),
cloneRegExp = __webpack_require__(120),
cloneSet = __webpack_require__(121),
cloneSymbol = __webpack_require__(124),
cloneTypedArray = __webpack_require__(125);
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
/***/ },
/* 113 */
/***/ function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(114);
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
/***/ },
/* 114 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(39);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ },
/* 115 */
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(113);
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;
/***/ },
/* 116 */
/***/ function(module, exports, __webpack_require__) {
var addMapEntry = __webpack_require__(117),
arrayReduce = __webpack_require__(118),
mapToArray = __webpack_require__(119);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
module.exports = cloneMap;
/***/ },
/* 117 */
/***/ function(module, exports) {
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
module.exports = addMapEntry;
/***/ },
/* 118 */
/***/ function(module, exports) {
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
module.exports = arrayReduce;
/***/ },
/* 119 */
/***/ function(module, exports) {
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;
/***/ },
/* 120 */
/***/ function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
/***/ },
/* 121 */
/***/ function(module, exports, __webpack_require__) {
var addSetEntry = __webpack_require__(122),
arrayReduce = __webpack_require__(118),
setToArray = __webpack_require__(123);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
module.exports = cloneSet;
/***/ },
/* 122 */
/***/ function(module, exports) {
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
module.exports = addSetEntry;
/***/ },
/* 123 */
/***/ function(module, exports) {
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ },
/* 124 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(38);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;
/***/ },
/* 125 */
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(113);
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;
/***/ },
/* 126 */
/***/ function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(127),
getPrototype = __webpack_require__(102),
isPrototype = __webpack_require__(86);
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
module.exports = initCloneObject;
/***/ },
/* 127 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(43);
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
module.exports = baseCreate;
/***/ },
/* 128 */
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(129),
last = __webpack_require__(137),
parent = __webpack_require__(138),
toKey = __webpack_require__(140);
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
module.exports = baseUnset;
/***/ },
/* 129 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(75),
isKey = __webpack_require__(130),
stringToPath = __webpack_require__(132),
toString = __webpack_require__(135);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ },
/* 130 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(75),
isSymbol = __webpack_require__(131);
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
/***/ },
/* 131 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(37),
isObjectLike = __webpack_require__(74);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ },
/* 132 */
/***/ function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(133);
/** Used to match property names within property paths. */
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ },
/* 133 */
/***/ function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(134);
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ },
/* 134 */
/***/ function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(48);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ },
/* 135 */
/***/ function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(136);
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ },
/* 136 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(38),
arrayMap = __webpack_require__(17),
isArray = __webpack_require__(75),
isSymbol = __webpack_require__(131);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ },
/* 137 */
/***/ function(module, exports) {
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
/***/ },
/* 138 */
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(139),
baseSlice = __webpack_require__(141);
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
module.exports = parent;
/***/ },
/* 139 */
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(129),
toKey = __webpack_require__(140);
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
/***/ },
/* 140 */
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(131);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
/***/ },
/* 141 */
/***/ function(module, exports) {
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
module.exports = baseSlice;
/***/ },
/* 142 */
/***/ function(module, exports, __webpack_require__) {
var flatten = __webpack_require__(143),
overRest = __webpack_require__(146),
setToString = __webpack_require__(148);
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;
/***/ },
/* 143 */
/***/ function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(144);
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
/***/ },
/* 144 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(101),
isFlattenable = __webpack_require__(145);
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ },
/* 145 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(38),
isArguments = __webpack_require__(72),
isArray = __webpack_require__(75);
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
/***/ },
/* 146 */
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(147);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
/***/ },
/* 147 */
/***/ function(module, exports) {
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
module.exports = apply;
/***/ },
/* 148 */
/***/ function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(149),
shortOut = __webpack_require__(152);
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
/***/ },
/* 149 */
/***/ function(module, exports, __webpack_require__) {
var constant = __webpack_require__(150),
defineProperty = __webpack_require__(66),
identity = __webpack_require__(151);
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
/***/ },
/* 150 */
/***/ function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
/***/ },
/* 151 */
/***/ function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ },
/* 152 */
/***/ function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
/***/ },
/* 153 */
/***/ function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(154),
isArrayLike = __webpack_require__(89),
isString = __webpack_require__(158),
toInteger = __webpack_require__(159),
values = __webpack_require__(162);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
module.exports = includes;
/***/ },
/* 154 */
/***/ function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(155),
baseIsNaN = __webpack_require__(156),
strictIndexOf = __webpack_require__(157);
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
/***/ },
/* 155 */
/***/ function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
/***/ },
/* 156 */
/***/ function(module, exports) {
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
module.exports = baseIsNaN;
/***/ },
/* 157 */
/***/ function(module, exports) {
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = strictIndexOf;
/***/ },
/* 158 */
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(37),
isArray = __webpack_require__(75),
isObjectLike = __webpack_require__(74);
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
module.exports = isString;
/***/ },
/* 159 */
/***/ function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(160);
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;
/***/ },
/* 160 */
/***/ function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(161);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
/***/ },
/* 161 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(43),
isSymbol = __webpack_require__(131);
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ },
/* 162 */
/***/ function(module, exports, __webpack_require__) {
var baseValues = __webpack_require__(163),
keys = __webpack_require__(69);
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
module.exports = values;
/***/ },
/* 163 */
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(17);
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
module.exports = baseValues;
/***/ },
/* 164 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(165);
/***/ },
/* 165 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-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.
*
* @providesModule update
*/
/* global hasOwnProperty:true */
'use strict';
var _prodInvariant = __webpack_require__(167),
_assign = __webpack_require__(168);
var keyOf = __webpack_require__(169);
var invariant = __webpack_require__(170);
var hasOwnProperty = {}.hasOwnProperty;
function shallowCopy(x) {
if (Array.isArray(x)) {
return x.concat();
} else if (x && typeof x === 'object') {
return _assign(new x.constructor(), x);
} else {
return x;
}
}
var COMMAND_PUSH = keyOf({ $push: null });
var COMMAND_UNSHIFT = keyOf({ $unshift: null });
var COMMAND_SPLICE = keyOf({ $splice: null });
var COMMAND_SET = keyOf({ $set: null });
var COMMAND_MERGE = keyOf({ $merge: null });
var COMMAND_APPLY = keyOf({ $apply: null });
var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
var ALL_COMMANDS_SET = {};
ALL_COMMANDS_LIST.forEach(function (command) {
ALL_COMMANDS_SET[command] = true;
});
function invariantArrayCase(value, spec, command) {
!Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
var specValue = spec[command];
!Array.isArray(specValue) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
}
/**
* Returns a updated shallow copy of an object without mutating the original.
* See https://facebook.github.io/react/docs/update.html for details.
*/
function update(value, spec) {
!(typeof spec === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
if (hasOwnProperty.call(spec, COMMAND_SET)) {
!(Object.keys(spec).length === 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
return spec[COMMAND_SET];
}
var nextValue = shallowCopy(value);
if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
var mergeObj = spec[COMMAND_MERGE];
!(mergeObj && typeof mergeObj === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
!(nextValue && typeof nextValue === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
_assign(nextValue, spec[COMMAND_MERGE]);
}
if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
invariantArrayCase(value, spec, COMMAND_PUSH);
spec[COMMAND_PUSH].forEach(function (item) {
nextValue.push(item);
});
}
if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
invariantArrayCase(value, spec, COMMAND_UNSHIFT);
spec[COMMAND_UNSHIFT].forEach(function (item) {
nextValue.unshift(item);
});
}
if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
!Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
!Array.isArray(spec[COMMAND_SPLICE]) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
spec[COMMAND_SPLICE].forEach(function (args) {
!Array.isArray(args) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
nextValue.splice.apply(nextValue, args);
});
}
if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
!(typeof spec[COMMAND_APPLY] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
nextValue = spec[COMMAND_APPLY](nextValue);
}
for (var k in spec) {
if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
nextValue[k] = update(value[k], spec[k]);
}
}
return nextValue;
}
module.exports = update;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(166)))
/***/ },
/* 166 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ },
/* 167 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-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.
*
* @providesModule reactProdInvariant
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
/***/ },
/* 168 */
/***/ function(module, exports) {
'use strict';
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (e) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ },
/* 169 */
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-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.
*
*/
/**
* Allows extraction of a minified key. Let's the build system minify keys
* without losing the ability to dynamically use key strings as values
* themselves. Pass in an object with a single key/val pair and it will return
* you the string key of that single record. Suppose you want to grab the
* value for a key 'className' inside of an object. Key/val minification may
* have aliased that key to be 'xa12'. keyOf({className: null}) will return
* 'xa12' in that case. Resolve keys you want to use once at startup time, then
* reuse those resolutions.
*/
var keyOf = function keyOf(oneKeyObj) {
var key;
for (key in oneKeyObj) {
if (!oneKeyObj.hasOwnProperty(key)) {
continue;
}
return key;
}
return null;
};
module.exports = keyOf;
/***/ },
/* 170 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-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';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
function invariant(condition, format, a, b, c, d, e, f) {
if (process.env.NODE_ENV !== 'production') {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(166)))
/***/ },
/* 171 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.jQuery = exports.animation = undefined;
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _reactAddonsUpdate = __webpack_require__(164);
var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _animationMixin = __webpack_require__(172);
var _animationMixin2 = _interopRequireDefault(_animationMixin);
var _jQueryMixin = __webpack_require__(177);
var _jQueryMixin2 = _interopRequireDefault(_jQueryMixin);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function noop() {}
var ToastMessageSpec = {
displayName: "ToastMessage",
getDefaultProps: function getDefaultProps() {
var iconClassNames = {
error: "toast-error",
info: "toast-info",
success: "toast-success",
warning: "toast-warning"
};
return {
className: "toast",
iconClassNames: iconClassNames,
titleClassName: "toast-title",
messageClassName: "toast-message",
tapToDismiss: true,
closeButton: false
};
},
handleOnClick: function handleOnClick(event) {
this.props.handleOnClick(event);
if (this.props.tapToDismiss) {
this.hideToast(true);
}
},
_handle_close_button_click: function _handle_close_button_click(event) {
event.stopPropagation();
this.hideToast(true);
},
_handle_remove: function _handle_remove() {
this.props.handleRemove(this.props.toastId);
},
_render_close_button: function _render_close_button() {
return this.props.closeButton ? _react2.default.createElement("button", {
className: "toast-close-button", role: "button",
onClick: this._handle_close_button_click,
dangerouslySetInnerHTML: { __html: "×" }
}) : false;
},
_render_title_element: function _render_title_element() {
return this.props.title ? _react2.default.createElement(
"div",
{ className: this.props.titleClassName },
this.props.title
) : false;
},
_render_message_element: function _render_message_element() {
return this.props.message ? _react2.default.createElement(
"div",
{ className: this.props.messageClassName },
this.props.message
) : false;
},
render: function render() {
var iconClassName = this.props.iconClassName || this.props.iconClassNames[this.props.type];
return _react2.default.createElement(
"div",
{
className: (0, _classnames2.default)(this.props.className, iconClassName),
style: this.props.style,
onClick: this.handleOnClick,
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave
},
this._render_close_button(),
this._render_title_element(),
this._render_message_element()
);
}
};
var animation = exports.animation = _react2.default.createClass((0, _reactAddonsUpdate2.default)(ToastMessageSpec, {
displayName: { $set: "ToastMessage.animation" },
mixins: { $set: [_animationMixin2.default] }
}));
var jQuery = exports.jQuery = _react2.default.createClass((0, _reactAddonsUpdate2.default)(ToastMessageSpec, {
displayName: { $set: "ToastMessage.jQuery" },
mixins: { $set: [_jQueryMixin2.default] }
}));
/*
* assign default noop functions
*/
ToastMessageSpec.handleMouseEnter = noop;
ToastMessageSpec.handleMouseLeave = noop;
ToastMessageSpec.hideToast = noop;
var ToastMessage = _react2.default.createClass(ToastMessageSpec);
ToastMessage.animation = animation;
ToastMessage.jQuery = jQuery;
exports.default = ToastMessage;
/***/ },
/* 172 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ReactTransitionEvents = __webpack_require__(173);
var _ReactTransitionEvents2 = _interopRequireDefault(_ReactTransitionEvents);
var _reactDom = __webpack_require__(6);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _elementClass = __webpack_require__(176);
var _elementClass2 = _interopRequireDefault(_elementClass);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var TICK = 17;
var toString = Object.prototype.toString;
exports.default = {
getDefaultProps: function getDefaultProps() {
return {
transition: null, // some examples defined in index.scss (scale, fadeInOut, rotate)
showAnimation: "animated bounceIn", // or other animations from animate.css
hideAnimation: "animated bounceOut",
timeOut: 5000,
extendedTimeOut: 1000
};
},
componentWillMount: function componentWillMount() {
this.classNameQueue = [];
this.isHiding = false;
this.intervalId = null;
},
componentDidMount: function componentDidMount() {
var _this = this;
this._is_mounted = true;
this._show();
var node = _reactDom2.default.findDOMNode(this);
var onHideComplete = function onHideComplete() {
if (_this.isHiding) {
_this._set_is_hiding(false);
_ReactTransitionEvents2.default.removeEndEventListener(node, onHideComplete);
_this._handle_remove();
}
};
_ReactTransitionEvents2.default.addEndEventListener(node, onHideComplete);
if (this.props.timeOut > 0) {
this._set_interval_id(setTimeout(this.hideToast, this.props.timeOut));
}
},
componentWillUnmount: function componentWillUnmount() {
this._is_mounted = false;
if (this.intervalId) {
clearTimeout(this.intervalId);
}
},
_set_transition: function _set_transition(hide) {
var animationType = hide ? "leave" : "enter";
var node = _reactDom2.default.findDOMNode(this);
var className = this.props.transition + "-" + animationType;
var activeClassName = className + "-active";
var endListener = function endListener(e) {
if (e && e.target !== node) {
return;
}
var classList = (0, _elementClass2.default)(node);
classList.remove(className);
classList.remove(activeClassName);
_ReactTransitionEvents2.default.removeEndEventListener(node, endListener);
};
_ReactTransitionEvents2.default.addEndEventListener(node, endListener);
(0, _elementClass2.default)(node).add(className);
// Need to do this to actually trigger a transition.
this._queue_class(activeClassName);
},
_clear_transition: function _clear_transition(hide) {
var node = _reactDom2.default.findDOMNode(this);
var animationType = hide ? "leave" : "enter";
var className = this.props.transition + "-" + animationType;
var activeClassName = className + "-active";
var classList = (0, _elementClass2.default)(node);
classList.remove(className);
classList.remove(activeClassName);
},
_set_animation: function _set_animation(hide) {
var node = _reactDom2.default.findDOMNode(this);
var animations = this._get_animation_classes(hide);
var endListener = function endListener(e) {
if (e && e.target !== node) {
return;
}
animations.forEach(function (anim) {
return (0, _elementClass2.default)(node).remove(anim);
});
_ReactTransitionEvents2.default.removeEndEventListener(node, endListener);
};
_ReactTransitionEvents2.default.addEndEventListener(node, endListener);
animations.forEach(function (anim) {
return (0, _elementClass2.default)(node).add(anim);
});
},
_get_animation_classes: function _get_animation_classes(hide) {
var animations = hide ? this.props.hideAnimation : this.props.showAnimation;
if ("[object Array]" === toString.call(animations)) {
return animations;
} else if ("string" === typeof animations) {
return animations.split(" ");
}
},
_clear_animation: function _clear_animation(hide) {
var node = _reactDom2.default.findDOMNode(this);
var animations = this._get_animation_classes(hide);
animations.forEach(function (animation) {
return (0, _elementClass2.default)(node).remove(animation);
});
},
_queue_class: function _queue_class(className) {
this.classNameQueue.push(className);
if (!this.timeout) {
this.timeout = setTimeout(this._flush_class_name_queue, TICK);
}
},
_flush_class_name_queue: function _flush_class_name_queue() {
var _this2 = this;
if (this._is_mounted) {
(function () {
var node = _reactDom2.default.findDOMNode(_this2);
_this2.classNameQueue.forEach(function (className) {
return (0, _elementClass2.default)(node).add(className);
});
})();
}
this.classNameQueue.length = 0;
this.timeout = null;
},
_show: function _show() {
if (this.props.transition) {
this._set_transition();
} else if (this.props.showAnimation) {
this._set_animation();
}
},
handleMouseEnter: function handleMouseEnter() {
clearTimeout(this.intervalId);
this._set_interval_id(null);
if (this.isHiding) {
this._set_is_hiding(false);
if (this.props.hideAnimation) {
this._clear_animation(true);
} else if (this.props.transition) {
this._clear_transition(true);
}
}
},
handleMouseLeave: function handleMouseLeave() {
if (!this.isHiding && (this.props.timeOut > 0 || this.props.extendedTimeOut > 0)) {
this._set_interval_id(setTimeout(this.hideToast, this.props.extendedTimeOut));
}
},
hideToast: function hideToast(override) {
if (this.isHiding || this.intervalId === null && !override) {
return;
}
this._set_is_hiding(true);
if (this.props.transition) {
this._set_transition(true);
} else if (this.props.hideAnimation) {
this._set_animation(true);
} else {
this._handle_remove();
}
},
_set_interval_id: function _set_interval_id(intervalId) {
this.intervalId = intervalId;
},
_set_is_hiding: function _set_is_hiding(isHiding) {
this.isHiding = isHiding;
}
};
/***/ },
/* 173 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-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.
*
* @providesModule ReactTransitionEvents
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(174);
var getVendorPrefixedEventName = __webpack_require__(175);
var endEvents = [];
function detectEvents() {
var animEnd = getVendorPrefixedEventName('animationend');
var transEnd = getVendorPrefixedEventName('transitionend');
if (animEnd) {
endEvents.push(animEnd);
}
if (transEnd) {
endEvents.push(transEnd);
}
}
if (ExecutionEnvironment.canUseDOM) {
detectEvents();
}
// We use the raw {add|remove}EventListener() call because EventListener
// does not know how to remove event listeners and we really should
// clean up. Also, these events are not triggered in older browsers
// so we should be A-OK here.
function addEventListener(node, eventName, eventListener) {
node.addEventListener(eventName, eventListener, false);
}
function removeEventListener(node, eventName, eventListener) {
node.removeEventListener(eventName, eventListener, false);
}
var ReactTransitionEvents = {
addEndEventListener: function (node, eventListener) {
if (endEvents.length === 0) {
// If CSS transitions are not supported, trigger an "end animation"
// event immediately.
window.setTimeout(eventListener, 0);
return;
}
endEvents.forEach(function (endEvent) {
addEventListener(node, endEvent, eventListener);
});
},
removeEndEventListener: function (node, eventListener) {
if (endEvents.length === 0) {
return;
}
endEvents.forEach(function (endEvent) {
removeEventListener(node, endEvent, eventListener);
});
}
};
module.exports = ReactTransitionEvents;
/***/ },
/* 174 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-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';
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
* Simple, lightweight module assisting with the detection and context of
* Worker. Helps avoid circular dependencies and allows code to reason about
* whether or not they are in a Worker, even if they never include the main
* `ReactWorker` dependency.
*/
var ExecutionEnvironment = {
canUseDOM: canUseDOM,
canUseWorkers: typeof Worker !== 'undefined',
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
canUseViewport: canUseDOM && !!window.screen,
isInWorker: !canUseDOM // For now, this is true - might change in the future.
};
module.exports = ExecutionEnvironment;
/***/ },
/* 175 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-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.
*
* @providesModule getVendorPrefixedEventName
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(174);
/**
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
*
* @param {string} styleProp
* @param {string} eventName
* @returns {object}
*/
function makePrefixMap(styleProp, eventName) {
var prefixes = {};
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
prefixes['Moz' + styleProp] = 'moz' + eventName;
prefixes['ms' + styleProp] = 'MS' + eventName;
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
return prefixes;
}
/**
* A list of event names to a configurable list of vendor prefixes.
*/
var vendorPrefixes = {
animationend: makePrefixMap('Animation', 'AnimationEnd'),
animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
animationstart: makePrefixMap('Animation', 'AnimationStart'),
transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
* Event names that have already been detected and prefixed (if applicable).
*/
var prefixedEventNames = {};
/**
* Element to check for prefixes on.
*/
var style = {};
/**
* Bootstrap if a DOM exists.
*/
if (ExecutionEnvironment.canUseDOM) {
style = document.createElement('div').style;
// On some platforms, in particular some releases of Android 4.x,
// the un-prefixed "animation" and "transition" properties are defined on the
// style object but the events that fire will still be prefixed, so we need
// to check if the un-prefixed events are usable, and if not remove them from the map.
if (!('AnimationEvent' in window)) {
delete vendorPrefixes.animationend.animation;
delete vendorPrefixes.animationiteration.animation;
delete vendorPrefixes.animationstart.animation;
}
// Same as above
if (!('TransitionEvent' in window)) {
delete vendorPrefixes.transitionend.transition;
}
}
/**
* Attempts to determine the correct vendor prefixed event name.
*
* @param {string} eventName
* @returns {string}
*/
function getVendorPrefixedEventName(eventName) {
if (prefixedEventNames[eventName]) {
return prefixedEventNames[eventName];
} else if (!vendorPrefixes[eventName]) {
return eventName;
}
var prefixMap = vendorPrefixes[eventName];
for (var styleProp in prefixMap) {
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
return prefixedEventNames[eventName] = prefixMap[styleProp];
}
}
return '';
}
module.exports = getVendorPrefixedEventName;
/***/ },
/* 176 */
/***/ function(module, exports) {
module.exports = function(opts) {
return new ElementClass(opts)
}
function indexOf(arr, prop) {
if (arr.indexOf) return arr.indexOf(prop)
for (var i = 0, len = arr.length; i < len; i++)
if (arr[i] === prop) return i
return -1
}
function ElementClass(opts) {
if (!(this instanceof ElementClass)) return new ElementClass(opts)
var self = this
if (!opts) opts = {}
// similar doing instanceof HTMLElement but works in IE8
if (opts.nodeType) opts = {el: opts}
this.opts = opts
this.el = opts.el || document.body
if (typeof this.el !== 'object') this.el = document.querySelector(this.el)
}
ElementClass.prototype.add = function(className) {
var el = this.el
if (!el) return
if (el.className === "") return el.className = className
var classes = el.className.split(' ')
if (indexOf(classes, className) > -1) return classes
classes.push(className)
el.className = classes.join(' ')
return classes
}
ElementClass.prototype.remove = function(className) {
var el = this.el
if (!el) return
if (el.className === "") return
var classes = el.className.split(' ')
var idx = indexOf(classes, className)
if (idx > -1) classes.splice(idx, 1)
el.className = classes.join(' ')
return classes
}
ElementClass.prototype.has = function(className) {
var el = this.el
if (!el) return
var classes = el.className.split(' ')
return indexOf(classes, className) > -1
}
ElementClass.prototype.toggle = function(className) {
var el = this.el
if (!el) return
if (this.has(className)) this.remove(className)
else this.add(className)
}
/***/ },
/* 177 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactDom = __webpack_require__(6);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function call_show_method($node, props) {
$node[props.showMethod]({
duration: props.showDuration,
easing: props.showEasing
});
}
exports.default = {
getDefaultProps: function getDefaultProps() {
return {
style: {
display: "none" },
showMethod: "fadeIn", // slideDown, and show are built into jQuery
showDuration: 300,
showEasing: "swing", // and linear are built into jQuery
hideMethod: "fadeOut",
hideDuration: 1000,
hideEasing: "swing",
//
timeOut: 5000,
extendedTimeOut: 1000
};
},
getInitialState: function getInitialState() {
return {
intervalId: null,
isHiding: false
};
},
componentDidMount: function componentDidMount() {
call_show_method(this._get_$_node(), this.props);
if (this.props.timeOut > 0) {
this._set_interval_id(setTimeout(this.hideToast, this.props.timeOut));
}
},
handleMouseEnter: function handleMouseEnter() {
clearTimeout(this.state.intervalId);
this._set_interval_id(null);
this._set_is_hiding(false);
call_show_method(this._get_$_node().stop(true, true), this.props);
},
handleMouseLeave: function handleMouseLeave() {
if (!this.state.isHiding && (this.props.timeOut > 0 || this.props.extendedTimeOut > 0)) {
this._set_interval_id(setTimeout(this.hideToast, this.props.extendedTimeOut));
}
},
hideToast: function hideToast(override) {
if (this.state.isHiding || this.state.intervalId === null && !override) {
return;
}
this.setState({ isHiding: true });
this._get_$_node()[this.props.hideMethod]({
duration: this.props.hideDuration,
easing: this.props.hideEasing,
complete: this._handle_remove
});
},
_get_$_node: function _get_$_node() {
/* eslint-disable no-undef */
return jQuery(_reactDom2.default.findDOMNode(this));
/* eslint-enable no-undef */
},
_set_interval_id: function _set_interval_id(intervalId) {
this.setState({
intervalId: intervalId
});
},
_set_is_hiding: function _set_is_hiding(isHiding) {
this.setState({
isHiding: isHiding
});
}
};
/***/ },
/* 178 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _PageButton = __webpack_require__(179);
var _PageButton2 = _interopRequireDefault(_PageButton);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var PaginationList = function (_Component) {
_inherits(PaginationList, _Component);
function PaginationList() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, PaginationList);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = PaginationList.__proto__ || Object.getPrototypeOf(PaginationList)).call.apply(_ref, [this].concat(args))), _this), _this.changePage = function () {
var _this2;
return (_this2 = _this).__changePage__REACT_HOT_LOADER__.apply(_this2, arguments);
}, _this.changeSizePerPage = function () {
var _this3;
return (_this3 = _this).__changeSizePerPage__REACT_HOT_LOADER__.apply(_this3, arguments);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(PaginationList, [{
key: '__changePage__REACT_HOT_LOADER__',
value: function __changePage__REACT_HOT_LOADER__(page) {
var _props = this.props,
pageStartIndex = _props.pageStartIndex,
prePage = _props.prePage,
currPage = _props.currPage,
nextPage = _props.nextPage,
lastPage = _props.lastPage,
firstPage = _props.firstPage,
sizePerPage = _props.sizePerPage;
if (page === prePage) {
page = currPage - 1 < pageStartIndex ? pageStartIndex : currPage - 1;
} else if (page === nextPage) {
page = currPage + 1 > this.lastPage ? this.lastPage : currPage + 1;
} else if (page === lastPage) {
page = this.lastPage;
} else if (page === firstPage) {
page = pageStartIndex;
} else {
page = parseInt(page, 10);
}
if (page !== currPage) {
this.props.changePage(page, sizePerPage);
}
}
}, {
key: '__changeSizePerPage__REACT_HOT_LOADER__',
value: function __changeSizePerPage__REACT_HOT_LOADER__(e) {
e.preventDefault();
var selectSize = parseInt(e.currentTarget.getAttribute('data-page'), 10);
var currPage = this.props.currPage;
if (selectSize !== this.props.sizePerPage) {
this.totalPages = Math.ceil(this.props.dataSize / selectSize);
this.lastPage = this.props.pageStartIndex + this.totalPages - 1;
if (currPage > this.lastPage) currPage = this.lastPage;
this.props.changePage(currPage, selectSize);
if (this.props.onSizePerPageList) {
this.props.onSizePerPageList(selectSize);
}
}
}
}, {
key: 'render',
value: function render() {
var _this4 = this;
var _props2 = this.props,
currPage = _props2.currPage,
dataSize = _props2.dataSize,
sizePerPage = _props2.sizePerPage,
sizePerPageList = _props2.sizePerPageList,
paginationShowsTotal = _props2.paginationShowsTotal,
pageStartIndex = _props2.pageStartIndex,
hideSizePerPage = _props2.hideSizePerPage;
var sizePerPageText = '';
this.totalPages = Math.ceil(dataSize / sizePerPage);
this.lastPage = this.props.pageStartIndex + this.totalPages - 1;
var pageBtns = this.makePage();
var pageListStyle = {
float: 'right',
// override the margin-top defined in .pagination class in bootstrap.
marginTop: '0px'
};
var sizePerPageOptions = sizePerPageList.map(function (_sizePerPage) {
var pageText = _sizePerPage.text || _sizePerPage;
var pageNum = _sizePerPage.value || _sizePerPage;
if (sizePerPage === pageNum) sizePerPageText = pageText;
return _react2.default.createElement(
'li',
{ key: pageText, role: 'presentation' },
_react2.default.createElement(
'a',
{ role: 'menuitem',
tabIndex: '-1', href: '#',
'data-page': pageNum,
onClick: _this4.changeSizePerPage },
pageText
)
);
});
var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex);
var start = (currPage - pageStartIndex) * sizePerPage;
start = dataSize === 0 ? 0 : start + 1;
var to = Math.min(sizePerPage * (currPage + offset) - 1, dataSize);
if (to >= dataSize) to--;
var total = paginationShowsTotal ? _react2.default.createElement(
'span',
null,
'Showing rows ',
start,
' to\xA0',
to + 1,
' of\xA0',
dataSize
) : null;
if (typeof paginationShowsTotal === 'function') {
total = paginationShowsTotal(start, to + 1, dataSize);
}
var dropDownStyle = {
visibility: hideSizePerPage ? 'hidden' : 'visible'
};
return _react2.default.createElement(
'div',
{ className: 'row', style: { marginTop: 15 } },
sizePerPageList.length > 1 ? _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'div',
{ className: 'col-md-6' },
total,
' ',
_react2.default.createElement(
'span',
{ className: 'dropdown', style: dropDownStyle },
_react2.default.createElement(
'button',
{ className: 'btn btn-default dropdown-toggle',
type: 'button', id: 'pageDropDown', 'data-toggle': 'dropdown',
'aria-expanded': 'true' },
sizePerPageText,
_react2.default.createElement(
'span',
null,
' ',
_react2.default.createElement('span', { className: 'caret' })
)
),
_react2.default.createElement(
'ul',
{ className: 'dropdown-menu', role: 'menu', 'aria-labelledby': 'pageDropDown' },
sizePerPageOptions
)
)
),
_react2.default.createElement(
'div',
{ className: 'col-md-6' },
_react2.default.createElement(
'ul',
{ className: 'pagination', style: pageListStyle },
pageBtns
)
)
) : _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'div',
{ className: 'col-md-6' },
total
),
_react2.default.createElement(
'div',
{ className: 'col-md-6' },
_react2.default.createElement(
'ul',
{ className: 'pagination', style: pageListStyle },
pageBtns
)
)
)
);
}
}, {
key: 'makePage',
value: function makePage() {
var pages = this.getPages();
return pages.map(function (page) {
var isActive = page === this.props.currPage;
var disabled = false;
var hidden = false;
if (this.props.currPage === this.props.pageStartIndex && (page === this.props.firstPage || page === this.props.prePage)) {
disabled = true;
hidden = true;
}
if (this.props.currPage === this.lastPage && (page === this.props.nextPage || page === this.props.lastPage)) {
disabled = true;
hidden = true;
}
return _react2.default.createElement(
_PageButton2.default,
{ key: page,
changePage: this.changePage,
active: isActive,
disable: disabled,
hidden: hidden },
page
);
}, this);
}
}, {
key: 'getPages',
value: function getPages() {
var pages = void 0;
var endPage = this.totalPages;
if (endPage <= 0) return [];
var startPage = Math.max(this.props.currPage - Math.floor(this.props.paginationSize / 2), this.props.pageStartIndex);
endPage = startPage + this.props.paginationSize - 1;
if (endPage > this.lastPage) {
endPage = this.lastPage;
startPage = endPage - this.props.paginationSize + 1;
}
if (startPage !== this.props.pageStartIndex && this.totalPages > this.props.paginationSize) {
pages = [this.props.firstPage, this.props.prePage];
} else if (this.totalPages > 1) {
pages = [this.props.prePage];
} else {
pages = [];
}
for (var i = startPage; i <= endPage; i++) {
if (i >= this.props.pageStartIndex) pages.push(i);
}
if (endPage < this.lastPage) {
pages.push(this.props.nextPage);
pages.push(this.props.lastPage);
} else if (endPage === this.lastPage && this.props.currPage !== this.lastPage) {
pages.push(this.props.nextPage);
}
return pages;
}
}]);
return PaginationList;
}(_react.Component);
PaginationList.propTypes = {
currPage: _react.PropTypes.number,
sizePerPage: _react.PropTypes.number,
dataSize: _react.PropTypes.number,
changePage: _react.PropTypes.func,
sizePerPageList: _react.PropTypes.array,
paginationShowsTotal: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]),
paginationSize: _react.PropTypes.number,
remote: _react.PropTypes.bool,
onSizePerPageList: _react.PropTypes.func,
prePage: _react.PropTypes.string,
pageStartIndex: _react.PropTypes.number,
hideSizePerPage: _react.PropTypes.bool
};
PaginationList.defaultProps = {
sizePerPage: _Const2.default.SIZE_PER_PAGE,
pageStartIndex: _Const2.default.PAGE_START_INDEX
};
var _default = PaginationList;
exports.default = _default;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(PaginationList, 'PaginationList', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/pagination/PaginationList.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/pagination/PaginationList.js');
}();
;
/***/ },
/* 179 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var PageButton = function (_Component) {
_inherits(PageButton, _Component);
function PageButton(props) {
_classCallCheck(this, PageButton);
var _this = _possibleConstructorReturn(this, (PageButton.__proto__ || Object.getPrototypeOf(PageButton)).call(this, props));
_this.pageBtnClick = function () {
return _this.__pageBtnClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
return _this;
}
_createClass(PageButton, [{
key: '__pageBtnClick__REACT_HOT_LOADER__',
value: function __pageBtnClick__REACT_HOT_LOADER__(e) {
e.preventDefault();
this.props.changePage(e.currentTarget.textContent);
}
}, {
key: 'render',
value: function render() {
var classes = (0, _classnames2.default)({
'active': this.props.active,
'disabled': this.props.disable,
'hidden': this.props.hidden,
'page-item': true
});
return _react2.default.createElement(
'li',
{ className: classes },
_react2.default.createElement(
'a',
{ href: '#', onClick: this.pageBtnClick, className: 'page-link' },
this.props.children
)
);
}
}]);
return PageButton;
}(_react.Component);
PageButton.propTypes = {
changePage: _react.PropTypes.func,
active: _react.PropTypes.bool,
disable: _react.PropTypes.bool,
hidden: _react.PropTypes.bool,
children: _react.PropTypes.node
};
var _default = PageButton;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(PageButton, 'PageButton', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/pagination/PageButton.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/pagination/PageButton.js');
}();
;
/***/ },
/* 180 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _Editor = __webpack_require__(12);
var _Editor2 = _interopRequireDefault(_Editor);
var _Notification = __webpack_require__(13);
var _Notification2 = _interopRequireDefault(_Notification);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ToolBar = function (_Component) {
_inherits(ToolBar, _Component);
function ToolBar(props) {
var _arguments = arguments;
_classCallCheck(this, ToolBar);
var _this = _possibleConstructorReturn(this, (ToolBar.__proto__ || Object.getPrototypeOf(ToolBar)).call(this, props));
_this.handleSaveBtnClick = function () {
return _this.__handleSaveBtnClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleShowOnlyToggle = function () {
return _this.__handleShowOnlyToggle__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleDropRowBtnClick = function () {
return _this.__handleDropRowBtnClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleDebounce = function (func, wait, immediate) {
var timeout = void 0;
return function () {
var later = function later() {
timeout = null;
if (!immediate) {
func.apply(_this, _arguments);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait || 0);
if (callNow) {
func.appy(_this, _arguments);
}
};
};
_this.handleKeyUp = function () {
return _this.__handleKeyUp__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleExportCSV = function () {
return _this.__handleExportCSV__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleClearBtnClick = function () {
return _this.__handleClearBtnClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.timeouteClear = 0;
_this.modalClassName;
_this.state = {
isInsertRowTrigger: true,
validateState: null,
shakeEditor: false,
showSelected: false
};
return _this;
}
_createClass(ToolBar, [{
key: 'componentWillMount',
value: function componentWillMount() {
var _this2 = this;
var delay = this.props.searchDelayTime ? this.props.searchDelayTime : 0;
this.debounceCallback = this.handleDebounce(function () {
_this2.props.onSearch(_this2.refs.seachInput.value);
}, delay);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.clearTimeout();
}
}, {
key: 'clearTimeout',
value: function (_clearTimeout) {
function clearTimeout() {
return _clearTimeout.apply(this, arguments);
}
clearTimeout.toString = function () {
return _clearTimeout.toString();
};
return clearTimeout;
}(function () {
if (this.timeouteClear) {
clearTimeout(this.timeouteClear);
this.timeouteClear = 0;
}
})
// modified by iuculanop
// BEGIN
}, {
key: 'checkAndParseForm',
value: function checkAndParseForm() {
var _this3 = this;
var newObj = {};
var validateState = {};
var isValid = true;
var checkVal = void 0;
var responseType = void 0;
var tempValue = void 0;
this.props.columns.forEach(function (column, i) {
if (column.autoValue) {
// when you want same auto generate value and not allow edit, example ID field
var time = new Date().getTime();
tempValue = typeof column.autoValue === 'function' ? column.autoValue() : 'autovalue-' + time;
} else if (column.hiddenOnInsert) {
tempValue = '';
} else {
var dom = this.refs[column.field + i];
tempValue = dom.value;
if (column.editable && column.editable.type === 'checkbox') {
var values = tempValue.split(':');
tempValue = dom.checked ? values[0] : values[1];
}
if (column.editable && column.editable.validator) {
// process validate
checkVal = column.editable.validator(tempValue);
responseType = typeof checkVal === 'undefined' ? 'undefined' : _typeof(checkVal);
if (responseType !== 'object' && checkVal !== true) {
this.refs.notifier.notice('error', 'Form validate errors, please checking!', 'Pressed ESC can cancel');
isValid = false;
validateState[column.field] = checkVal;
} else if (responseType === 'object' && checkVal.isValid !== true) {
this.refs.notifier.notice(checkVal.notification.type, checkVal.notification.msg, checkVal.notification.title);
isValid = false;
validateState[column.field] = checkVal.notification.msg;
}
}
}
newObj[column.field] = tempValue;
}, this);
if (isValid) {
return newObj;
} else {
this.clearTimeout();
// show error in form and shake it
this.setState({ validateState: validateState, shakeEditor: true });
this.timeouteClear = setTimeout(function () {
_this3.setState({ shakeEditor: false });
}, 300);
return null;
}
}
// END
}, {
key: '__handleSaveBtnClick__REACT_HOT_LOADER__',
value: function __handleSaveBtnClick__REACT_HOT_LOADER__() {
var _this4 = this;
var newObj = this.checkAndParseForm();
if (!newObj) {
// validate errors
return;
}
var msg = this.props.onAddRow(newObj);
if (msg) {
this.refs.notifier.notice('error', msg, 'Pressed ESC can cancel');
this.clearTimeout();
// shake form and hack prevent modal hide
this.setState({
shakeEditor: true,
validateState: 'this is hack for prevent bootstrap modal hide'
});
// clear animate class
this.timeouteClear = setTimeout(function () {
_this4.setState({ shakeEditor: false });
}, 300);
} else {
// reset state and hide modal hide
this.setState({
validateState: null,
shakeEditor: false
}, function () {
document.querySelector('.modal-backdrop').click();
document.querySelector('.' + _this4.modalClassName).click();
});
// reset form
this.refs.form.reset();
}
}
}, {
key: '__handleShowOnlyToggle__REACT_HOT_LOADER__',
value: function __handleShowOnlyToggle__REACT_HOT_LOADER__() {
this.setState({
showSelected: !this.state.showSelected
});
this.props.onShowOnlySelected();
}
}, {
key: '__handleDropRowBtnClick__REACT_HOT_LOADER__',
value: function __handleDropRowBtnClick__REACT_HOT_LOADER__() {
this.props.onDropRow();
}
}, {
key: 'handleCloseBtn',
value: function handleCloseBtn() {
this.refs.warning.style.display = 'none';
}
}, {
key: '__handleKeyUp__REACT_HOT_LOADER__',
value: function __handleKeyUp__REACT_HOT_LOADER__(event) {
event.persist();
this.debounceCallback(event);
}
}, {
key: '__handleExportCSV__REACT_HOT_LOADER__',
value: function __handleExportCSV__REACT_HOT_LOADER__() {
this.props.onExportCSV();
}
}, {
key: '__handleClearBtnClick__REACT_HOT_LOADER__',
value: function __handleClearBtnClick__REACT_HOT_LOADER__() {
this.refs.seachInput.value = '';
this.props.onSearch('');
}
}, {
key: 'render',
value: function render() {
this.modalClassName = 'bs-table-modal-sm' + ToolBar.modalSeq++;
var insertBtn = null;
var deleteBtn = null;
var exportCSV = null;
var showSelectedOnlyBtn = null;
if (this.props.enableInsert) {
insertBtn = _react2.default.createElement(
'button',
{ type: 'button',
className: 'btn btn-info react-bs-table-add-btn',
'data-toggle': 'modal',
'data-target': '.' + this.modalClassName },
_react2.default.createElement('i', { className: 'glyphicon glyphicon-plus' }),
' ',
this.props.insertText
);
}
if (this.props.enableDelete) {
deleteBtn = _react2.default.createElement(
'button',
{ type: 'button',
className: 'btn btn-warning react-bs-table-del-btn',
'data-toggle': 'tooltip',
'data-placement': 'right',
title: 'Drop selected row',
onClick: this.handleDropRowBtnClick },
_react2.default.createElement('i', { className: 'glyphicon glyphicon-trash' }),
' ',
this.props.deleteText
);
}
if (this.props.enableShowOnlySelected) {
showSelectedOnlyBtn = _react2.default.createElement(
'button',
{ type: 'button',
onClick: this.handleShowOnlyToggle,
className: 'btn btn-primary',
'data-toggle': 'button',
'aria-pressed': 'false' },
this.state.showSelected ? _Const2.default.SHOW_ALL : _Const2.default.SHOW_ONLY_SELECT
);
}
if (this.props.enableExportCSV) {
exportCSV = _react2.default.createElement(
'button',
{ type: 'button',
className: 'btn btn-success hidden-print',
onClick: this.handleExportCSV },
_react2.default.createElement('i', { className: 'glyphicon glyphicon-export' }),
this.props.exportCSVText
);
}
var searchTextInput = this.renderSearchPanel();
var modal = this.props.enableInsert ? this.renderInsertRowModal() : null;
return _react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement(
'div',
{ className: 'col-xs-12 col-sm-6 col-md-6 col-lg-8' },
_react2.default.createElement(
'div',
{ className: 'btn-group btn-group-sm', role: 'group' },
exportCSV,
insertBtn,
deleteBtn,
showSelectedOnlyBtn
)
),
_react2.default.createElement(
'div',
{ className: 'col-xs-12 col-sm-6 col-md-6 col-lg-4' },
searchTextInput
),
_react2.default.createElement(_Notification2.default, { ref: 'notifier' }),
modal
);
}
}, {
key: 'renderSearchPanel',
value: function renderSearchPanel() {
if (this.props.enableSearch) {
var classNames = 'form-group form-group-sm react-bs-table-search-form';
var clearBtn = null;
if (this.props.clearSearch) {
clearBtn = _react2.default.createElement(
'span',
{ className: 'input-group-btn' },
_react2.default.createElement(
'button',
{
className: 'btn btn-default',
type: 'button',
onClick: this.handleClearBtnClick },
'Clear'
)
);
classNames += ' input-group input-group-sm';
}
return _react2.default.createElement(
'div',
{ className: classNames },
_react2.default.createElement('input', { ref: 'seachInput',
className: 'form-control',
type: 'text',
defaultValue: this.props.defaultSearch,
placeholder: this.props.searchPlaceholder ? this.props.searchPlaceholder : 'Search',
onKeyUp: this.handleKeyUp }),
clearBtn
);
} else {
return null;
}
}
}, {
key: 'renderInsertRowModal',
value: function renderInsertRowModal() {
var _this5 = this;
var validateState = this.state.validateState || {};
var shakeEditor = this.state.shakeEditor;
var inputField = this.props.columns.map(function (column, i) {
var editable = column.editable,
format = column.format,
field = column.field,
name = column.name,
autoValue = column.autoValue,
hiddenOnInsert = column.hiddenOnInsert;
var attr = {
ref: field + i,
placeholder: editable.placeholder ? editable.placeholder : name
};
if (autoValue || hiddenOnInsert) {
// when you want same auto generate value
// and not allow edit, for example ID field
return null;
}
var error = validateState[field] ? _react2.default.createElement(
'span',
{ className: 'help-block bg-danger' },
validateState[field]
) : null;
// let editor = Editor(editable,attr,format);
// if(editor.props.type && editor.props.type == 'checkbox'){
return _react2.default.createElement(
'div',
{ className: 'form-group', key: field },
_react2.default.createElement(
'label',
null,
name
),
(0, _Editor2.default)(editable, attr, format, '', undefined, _this5.props.ignoreEditable),
error
);
});
var modalClass = (0, _classnames2.default)('modal', 'fade', this.modalClassName, {
// hack prevent bootstrap modal hide by reRender
'in': shakeEditor || this.state.validateState
});
var dialogClass = (0, _classnames2.default)('modal-dialog', 'modal-sm', {
'animated': shakeEditor,
'shake': shakeEditor
});
return _react2.default.createElement(
'div',
{ ref: 'modal', className: modalClass, tabIndex: '-1', role: 'dialog' },
_react2.default.createElement(
'div',
{ className: dialogClass },
_react2.default.createElement(
'div',
{ className: 'modal-content' },
_react2.default.createElement(
'div',
{ className: 'modal-header' },
_react2.default.createElement(
'button',
{ type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Close' },
_react2.default.createElement(
'span',
{ 'aria-hidden': 'true' },
'\xD7'
)
),
_react2.default.createElement(
'h4',
{ className: 'modal-title' },
'New Record'
)
),
_react2.default.createElement(
'div',
{ className: 'modal-body' },
_react2.default.createElement(
'form',
{ ref: 'form' },
inputField
)
),
_react2.default.createElement(
'div',
{ className: 'modal-footer' },
_react2.default.createElement(
'button',
{ type: 'button',
className: 'btn btn-default',
'data-dismiss': 'modal' },
this.props.closeText
),
_react2.default.createElement(
'button',
{ type: 'button',
className: 'btn btn-primary',
onClick: this.handleSaveBtnClick },
this.props.saveText
)
)
)
)
);
}
}]);
return ToolBar;
}(_react.Component);
ToolBar.modalSeq = 0;
ToolBar.propTypes = {
onAddRow: _react.PropTypes.func,
onDropRow: _react.PropTypes.func,
onShowOnlySelected: _react.PropTypes.func,
enableInsert: _react.PropTypes.bool,
enableDelete: _react.PropTypes.bool,
enableSearch: _react.PropTypes.bool,
enableShowOnlySelected: _react.PropTypes.bool,
columns: _react.PropTypes.array,
searchPlaceholder: _react.PropTypes.string,
exportCSVText: _react.PropTypes.string,
insertText: _react.PropTypes.string,
deleteText: _react.PropTypes.string,
saveText: _react.PropTypes.string,
closeText: _react.PropTypes.string,
clearSearch: _react.PropTypes.bool,
ignoreEditable: _react.PropTypes.bool,
defaultSearch: _react.PropTypes.string
};
ToolBar.defaultProps = {
enableInsert: false,
enableDelete: false,
enableSearch: false,
enableShowOnlySelected: false,
clearSearch: false,
ignoreEditable: false,
exportCSVText: _Const2.default.EXPORT_CSV_TEXT,
insertText: _Const2.default.INSERT_BTN_TEXT,
deleteText: _Const2.default.DELETE_BTN_TEXT,
saveText: _Const2.default.SAVE_BTN_TEXT,
closeText: _Const2.default.CLOSE_BTN_TEXT
};
var _default = ToolBar;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(ToolBar, 'ToolBar', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/toolbar/ToolBar.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/toolbar/ToolBar.js');
}();
;
/***/ },
/* 181 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TableFilter = function (_Component) {
_inherits(TableFilter, _Component);
function TableFilter(props) {
_classCallCheck(this, TableFilter);
var _this = _possibleConstructorReturn(this, (TableFilter.__proto__ || Object.getPrototypeOf(TableFilter)).call(this, props));
_this.handleKeyUp = function () {
return _this.__handleKeyUp__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.filterObj = {};
return _this;
}
_createClass(TableFilter, [{
key: '__handleKeyUp__REACT_HOT_LOADER__',
value: function __handleKeyUp__REACT_HOT_LOADER__(e) {
var _e$currentTarget = e.currentTarget,
value = _e$currentTarget.value,
name = _e$currentTarget.name;
if (value.trim() === '') {
delete this.filterObj[name];
} else {
this.filterObj[name] = value;
}
this.props.onFilter(this.filterObj);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
striped = _props.striped,
condensed = _props.condensed,
rowSelectType = _props.rowSelectType,
columns = _props.columns;
var tableClasses = (0, _classnames2.default)('table', {
'table-striped': striped,
'table-condensed': condensed
});
var selectRowHeader = null;
if (rowSelectType === _Const2.default.ROW_SELECT_SINGLE || rowSelectType === _Const2.default.ROW_SELECT_MULTI) {
var style = {
width: 35,
paddingLeft: 0,
paddingRight: 0
};
selectRowHeader = _react2.default.createElement(
'th',
{ style: style, key: -1 },
'Filter'
);
}
var filterField = columns.map(function (column) {
var hidden = column.hidden,
width = column.width,
name = column.name;
var thStyle = {
display: hidden ? 'none' : null,
width: width
};
return _react2.default.createElement(
'th',
{ key: name, style: thStyle },
_react2.default.createElement(
'div',
{ className: 'th-inner table-header-column' },
_react2.default.createElement('input', { size: '10', type: 'text',
placeholder: name, name: name, onKeyUp: this.handleKeyUp })
)
);
}, this);
return _react2.default.createElement(
'table',
{ className: tableClasses, style: { marginTop: 5 } },
_react2.default.createElement(
'thead',
null,
_react2.default.createElement(
'tr',
{ style: { borderBottomStyle: 'hidden' } },
selectRowHeader,
filterField
)
)
);
}
}]);
return TableFilter;
}(_react.Component);
TableFilter.propTypes = {
columns: _react.PropTypes.array,
rowSelectType: _react.PropTypes.string,
onFilter: _react.PropTypes.func
};
var _default = TableFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TableFilter, 'TableFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableFilter.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableFilter.js');
}();
;
/***/ },
/* 182 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TableDataStore = undefined;
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 _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; }; }(); /* eslint no-nested-ternary: 0 */
/* eslint guard-for-in: 0 */
/* eslint no-console: 0 */
/* eslint eqeqeq: 0 */
/* eslint one-var: 0 */
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _sort(arr, sortField, order, sortFunc, sortFuncExtraData) {
order = order.toLowerCase();
var isDesc = order === _Const2.default.SORT_DESC;
arr.sort(function (a, b) {
if (sortFunc) {
return sortFunc(a, b, order, sortField, sortFuncExtraData);
} else {
var valueA = a[sortField] === null ? '' : a[sortField];
var valueB = b[sortField] === null ? '' : b[sortField];
if (isDesc) {
if (typeof valueB === 'string') {
return valueB.localeCompare(valueA);
} else {
return valueA > valueB ? -1 : valueA < valueB ? 1 : 0;
}
} else {
if (typeof valueA === 'string') {
return valueA.localeCompare(valueB);
} else {
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
}
}
}
});
return arr;
}
var TableDataStore = function () {
function TableDataStore(data) {
_classCallCheck(this, TableDataStore);
this.data = data;
this.colInfos = null;
this.filteredData = null;
this.isOnFilter = false;
this.filterObj = null;
this.searchText = null;
this.sortObj = null;
this.pageObj = {};
this.selected = [];
this.multiColumnSearch = false;
this.showOnlySelected = false;
this.remote = false; // remote data
}
_createClass(TableDataStore, [{
key: 'setProps',
value: function setProps(props) {
this.keyField = props.keyField;
this.enablePagination = props.isPagination;
this.colInfos = props.colInfos;
this.remote = props.remote;
this.multiColumnSearch = props.multiColumnSearch;
}
}, {
key: 'setData',
value: function setData(data) {
this.data = data;
if (this.remote) {
return;
}
this._refresh(true);
}
}, {
key: 'getColInfos',
value: function getColInfos() {
return this.colInfos;
}
}, {
key: 'getSortInfo',
value: function getSortInfo() {
return this.sortObj;
}
}, {
key: 'setSortInfo',
value: function setSortInfo(order, sortField) {
this.sortObj = {
order: order,
sortField: sortField
};
}
}, {
key: 'setSelectedRowKey',
value: function setSelectedRowKey(selectedRowKeys) {
this.selected = selectedRowKeys;
}
}, {
key: 'getRowByKey',
value: function getRowByKey(keys) {
var _this = this;
return keys.map(function (key) {
var result = _this.data.filter(function (d) {
return d[_this.keyField] === key;
});
if (result.length !== 0) return result[0];
});
}
}, {
key: 'getSelectedRowKeys',
value: function getSelectedRowKeys() {
return this.selected;
}
}, {
key: 'getCurrentDisplayData',
value: function getCurrentDisplayData() {
if (this.isOnFilter) return this.filteredData;else return this.data;
}
}, {
key: '_refresh',
value: function _refresh(skipSorting) {
if (this.isOnFilter) {
if (this.filterObj !== null) this.filter(this.filterObj);
if (this.searchText !== null) this.search(this.searchText);
}
if (!skipSorting && this.sortObj) {
this.sort(this.sortObj.order, this.sortObj.sortField);
}
}
}, {
key: 'ignoreNonSelected',
value: function ignoreNonSelected() {
var _this2 = this;
this.showOnlySelected = !this.showOnlySelected;
if (this.showOnlySelected) {
this.isOnFilter = true;
this.filteredData = this.data.filter(function (row) {
var result = _this2.selected.find(function (x) {
return row[_this2.keyField] === x;
});
return typeof result !== 'undefined' ? true : false;
});
} else {
this.isOnFilter = false;
}
}
}, {
key: 'sort',
value: function sort(order, sortField) {
this.setSortInfo(order, sortField);
var currentDisplayData = this.getCurrentDisplayData();
if (!this.colInfos[sortField]) return this;
var _colInfos$sortField = this.colInfos[sortField],
sortFunc = _colInfos$sortField.sortFunc,
sortFuncExtraData = _colInfos$sortField.sortFuncExtraData;
currentDisplayData = _sort(currentDisplayData, sortField, order, sortFunc, sortFuncExtraData);
return this;
}
}, {
key: 'page',
value: function page(_page, sizePerPage) {
this.pageObj.end = _page * sizePerPage - 1;
this.pageObj.start = this.pageObj.end - (sizePerPage - 1);
return this;
}
}, {
key: 'edit',
value: function edit(newVal, rowIndex, fieldName) {
var currentDisplayData = this.getCurrentDisplayData();
var rowKeyCache = void 0;
if (!this.enablePagination) {
currentDisplayData[rowIndex][fieldName] = newVal;
rowKeyCache = currentDisplayData[rowIndex][this.keyField];
} else {
currentDisplayData[this.pageObj.start + rowIndex][fieldName] = newVal;
rowKeyCache = currentDisplayData[this.pageObj.start + rowIndex][this.keyField];
}
if (this.isOnFilter) {
this.data.forEach(function (row) {
if (row[this.keyField] === rowKeyCache) {
row[fieldName] = newVal;
}
}, this);
if (this.filterObj !== null) this.filter(this.filterObj);
if (this.searchText !== null) this.search(this.searchText);
}
return this;
}
}, {
key: 'addAtBegin',
value: function addAtBegin(newObj) {
if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') {
throw new Error(this.keyField + ' can\'t be empty value.');
}
var currentDisplayData = this.getCurrentDisplayData();
currentDisplayData.forEach(function (row) {
if (row[this.keyField].toString() === newObj[this.keyField].toString()) {
throw new Error(this.keyField + ' ' + newObj[this.keyField] + ' already exists');
}
}, this);
currentDisplayData.unshift(newObj);
if (this.isOnFilter) {
this.data.unshift(newObj);
}
this._refresh(false);
}
}, {
key: 'add',
value: function add(newObj) {
if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') {
throw new Error(this.keyField + ' can\'t be empty value.');
}
var currentDisplayData = this.getCurrentDisplayData();
currentDisplayData.forEach(function (row) {
if (row[this.keyField].toString() === newObj[this.keyField].toString()) {
throw new Error(this.keyField + ' ' + newObj[this.keyField] + ' already exists');
}
}, this);
currentDisplayData.push(newObj);
if (this.isOnFilter) {
this.data.push(newObj);
}
this._refresh(false);
}
}, {
key: 'remove',
value: function remove(rowKey) {
var _this3 = this;
var currentDisplayData = this.getCurrentDisplayData();
var result = currentDisplayData.filter(function (row) {
return rowKey.indexOf(row[_this3.keyField]) === -1;
});
if (this.isOnFilter) {
this.data = this.data.filter(function (row) {
return rowKey.indexOf(row[_this3.keyField]) === -1;
});
this.filteredData = result;
} else {
this.data = result;
}
}
}, {
key: 'filter',
value: function filter(filterObj) {
if (Object.keys(filterObj).length === 0) {
this.filteredData = null;
this.isOnFilter = false;
this.filterObj = null;
if (this.searchText) this._search(this.data);
} else {
var source = this.data;
this.filterObj = filterObj;
if (this.searchText) {
this._search(source);
source = this.filteredData;
}
this._filter(source);
}
}
}, {
key: 'filterNumber',
value: function filterNumber(targetVal, filterVal, comparator) {
var valid = true;
switch (comparator) {
case '=':
{
if (targetVal != filterVal) {
valid = false;
}
break;
}
case '>':
{
if (targetVal <= filterVal) {
valid = false;
}
break;
}
case '>=':
{
if (targetVal < filterVal) {
valid = false;
}
break;
}
case '<':
{
if (targetVal >= filterVal) {
valid = false;
}
break;
}
case '<=':
{
if (targetVal > filterVal) {
valid = false;
}
break;
}
case '!=':
{
if (targetVal == filterVal) {
valid = false;
}
break;
}
default:
{
console.error('Number comparator provided is not supported');
break;
}
}
return valid;
}
}, {
key: 'filterDate',
value: function filterDate(targetVal, filterVal, comparator) {
// if (!targetVal) {
// return false;
// }
// return (targetVal.getDate() === filterVal.getDate() &&
// targetVal.getMonth() === filterVal.getMonth() &&
// targetVal.getFullYear() === filterVal.getFullYear());
var valid = true;
switch (comparator) {
case '=':
{
if (targetVal != filterVal) {
valid = false;
}
break;
}
case '>':
{
if (targetVal <= filterVal) {
valid = false;
}
break;
}
case '>=':
{
if (targetVal < filterVal) {
valid = false;
}
break;
}
case '<':
{
if (targetVal >= filterVal) {
valid = false;
}
break;
}
case '<=':
{
if (targetVal > filterVal) {
valid = false;
}
break;
}
case '!=':
{
if (targetVal == filterVal) {
valid = false;
}
break;
}
default:
{
console.error('Date comparator provided is not supported');
break;
}
}
return valid;
}
}, {
key: 'filterRegex',
value: function filterRegex(targetVal, filterVal) {
try {
return new RegExp(filterVal, 'i').test(targetVal);
} catch (e) {
return true;
}
}
}, {
key: 'filterCustom',
value: function filterCustom(targetVal, filterVal, callbackInfo) {
if (callbackInfo !== null && (typeof callbackInfo === 'undefined' ? 'undefined' : _typeof(callbackInfo)) === 'object') {
return callbackInfo.callback(targetVal, callbackInfo.callbackParameters);
}
return this.filterText(targetVal, filterVal);
}
}, {
key: 'filterText',
value: function filterText(targetVal, filterVal) {
targetVal = targetVal.toString().toLowerCase();
filterVal = filterVal.toString().toLowerCase();
if (targetVal.indexOf(filterVal) === -1) {
return false;
}
return true;
}
/* General search function
* It will search for the text if the input includes that text;
*/
}, {
key: 'search',
value: function search(searchText) {
if (searchText.trim() === '') {
this.filteredData = null;
this.isOnFilter = false;
this.searchText = null;
if (this.filterObj) this._filter(this.data);
} else {
var source = this.data;
this.searchText = searchText;
if (this.filterObj) {
this._filter(source);
source = this.filteredData;
}
this._search(source);
}
}
}, {
key: '_filter',
value: function _filter(source) {
var _this4 = this;
var filterObj = this.filterObj;
this.filteredData = source.filter(function (row, r) {
var valid = true;
var filterVal = void 0;
for (var key in filterObj) {
var targetVal = row[key];
if (targetVal === null || targetVal === undefined) {
targetVal = '';
}
switch (filterObj[key].type) {
case _Const2.default.FILTER_TYPE.NUMBER:
{
filterVal = filterObj[key].value.number;
break;
}
case _Const2.default.FILTER_TYPE.CUSTOM:
{
filterVal = _typeof(filterObj[key].value) === 'object' ? undefined : typeof filterObj[key].value === 'string' ? filterObj[key].value.toLowerCase() : filterObj[key].value;
break;
}
case _Const2.default.FILTER_TYPE.DATE:
{
filterVal = filterObj[key].value.date;
break;
}
case _Const2.default.FILTER_TYPE.REGEX:
{
filterVal = filterObj[key].value;
break;
}
default:
{
filterVal = typeof filterObj[key].value === 'string' ? filterObj[key].value.toLowerCase() : filterObj[key].value;
if (filterVal === undefined) {
// Support old filter
filterVal = filterObj[key].toLowerCase();
}
break;
}
}
var format = void 0,
filterFormatted = void 0,
formatExtraData = void 0,
filterValue = void 0;
if (_this4.colInfos[key]) {
format = _this4.colInfos[key].format;
filterFormatted = _this4.colInfos[key].filterFormatted;
formatExtraData = _this4.colInfos[key].formatExtraData;
filterValue = _this4.colInfos[key].filterValue;
if (filterFormatted && format) {
targetVal = format(row[key], row, formatExtraData, r);
} else if (filterValue) {
targetVal = filterValue(row[key], row);
}
}
switch (filterObj[key].type) {
case _Const2.default.FILTER_TYPE.NUMBER:
{
valid = _this4.filterNumber(targetVal, filterVal, filterObj[key].value.comparator);
break;
}
case _Const2.default.FILTER_TYPE.DATE:
{
valid = _this4.filterDate(targetVal, filterVal, filterObj[key].value.comparator);
break;
}
case _Const2.default.FILTER_TYPE.REGEX:
{
valid = _this4.filterRegex(targetVal, filterVal);
break;
}
case _Const2.default.FILTER_TYPE.CUSTOM:
{
valid = _this4.filterCustom(targetVal, filterVal, filterObj[key].value);
break;
}
default:
{
if (filterObj[key].type === _Const2.default.FILTER_TYPE.SELECT && filterFormatted && filterFormatted && format) {
filterVal = format(filterVal, row, formatExtraData, r);
}
valid = _this4.filterText(targetVal, filterVal);
break;
}
}
if (!valid) {
break;
}
}
return valid;
});
this.isOnFilter = true;
}
}, {
key: '_search',
value: function _search(source) {
var _this5 = this;
var searchTextArray = [];
if (this.multiColumnSearch) {
searchTextArray = this.searchText.split(' ');
} else {
searchTextArray.push(this.searchText);
}
this.filteredData = source.filter(function (row, r) {
var keys = Object.keys(row);
var valid = false;
// for loops are ugly, but performance matters here.
// And you cant break from a forEach.
// http://jsperf.com/for-vs-foreach/66
for (var i = 0, keysLength = keys.length; i < keysLength; i++) {
var key = keys[i];
// fixed data filter when misunderstand 0 is false
var filterSpecialNum = false;
if (!isNaN(row[key]) && parseInt(row[key], 10) === 0) {
filterSpecialNum = true;
}
if (_this5.colInfos[key] && (row[key] || filterSpecialNum)) {
var _colInfos$key = _this5.colInfos[key],
format = _colInfos$key.format,
filterFormatted = _colInfos$key.filterFormatted,
filterValue = _colInfos$key.filterValue,
formatExtraData = _colInfos$key.formatExtraData,
searchable = _colInfos$key.searchable;
var targetVal = row[key];
if (searchable) {
if (filterFormatted && format) {
targetVal = format(targetVal, row, formatExtraData, r);
} else if (filterValue) {
targetVal = filterValue(targetVal, row);
}
for (var j = 0, textLength = searchTextArray.length; j < textLength; j++) {
var filterVal = searchTextArray[j].toLowerCase();
if (targetVal.toString().toLowerCase().indexOf(filterVal) !== -1) {
valid = true;
break;
}
}
}
}
}
return valid;
});
this.isOnFilter = true;
}
}, {
key: 'getDataIgnoringPagination',
value: function getDataIgnoringPagination() {
return this.getCurrentDisplayData();
}
}, {
key: 'get',
value: function get() {
var _data = this.getCurrentDisplayData();
if (_data.length === 0) return _data;
if (this.remote || !this.enablePagination) {
return _data;
} else {
var result = [];
for (var i = this.pageObj.start; i <= this.pageObj.end; i++) {
result.push(_data[i]);
if (i + 1 === _data.length) break;
}
return result;
}
}
}, {
key: 'getKeyField',
value: function getKeyField() {
return this.keyField;
}
}, {
key: 'getDataNum',
value: function getDataNum() {
return this.getCurrentDisplayData().length;
}
}, {
key: 'isChangedPage',
value: function isChangedPage() {
return this.pageObj.start && this.pageObj.end ? true : false;
}
}, {
key: 'isEmpty',
value: function isEmpty() {
return this.data.length === 0 || this.data === null || this.data === undefined;
}
}, {
key: 'getAllRowkey',
value: function getAllRowkey() {
var _this6 = this;
return this.data.map(function (row) {
return row[_this6.keyField];
});
}
}]);
return TableDataStore;
}();
exports.TableDataStore = TableDataStore;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_sort, '_sort', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/store/TableDataStore.js');
__REACT_HOT_LOADER__.register(TableDataStore, 'TableDataStore', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/store/TableDataStore.js');
}();
;
/***/ },
/* 183 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {
renderReactSortCaret: function renderReactSortCaret(order) {
var orderClass = (0, _classnames2.default)('order', {
'dropup': order === _Const2.default.SORT_ASC
});
return _react2.default.createElement(
'span',
{ className: orderClass },
_react2.default.createElement('span', { className: 'caret', style: { margin: '10px 5px' } })
);
},
getScrollBarWidth: function getScrollBarWidth() {
var inner = document.createElement('p');
inner.style.width = '100%';
inner.style.height = '200px';
var outer = document.createElement('div');
outer.style.position = 'absolute';
outer.style.top = '0px';
outer.style.left = '0px';
outer.style.visibility = 'hidden';
outer.style.width = '200px';
outer.style.height = '150px';
outer.style.overflow = 'hidden';
outer.appendChild(inner);
document.body.appendChild(outer);
var w1 = inner.offsetWidth;
outer.style.overflow = 'scroll';
var w2 = inner.offsetWidth;
if (w1 === w2) w2 = outer.clientWidth;
document.body.removeChild(outer);
return w1 - w2;
},
canUseDOM: function canUseDOM() {
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/util.js');
}();
;
/***/ },
/* 184 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _util = __webpack_require__(183);
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (_util2.default.canUseDOM()) {
var filesaver = __webpack_require__(185);
var saveAs = filesaver.saveAs;
} /* eslint block-scoped-var: 0 */
/* eslint vars-on-top: 0 */
/* eslint no-var: 0 */
/* eslint no-unused-vars: 0 */
function toString(data, keys) {
var dataString = '';
if (data.length === 0) return dataString;
dataString += keys.map(function (x) {
return x.header;
}).join(',') + '\n';
data.map(function (row) {
keys.map(function (col, i) {
var field = col.field,
format = col.format;
var value = typeof format !== 'undefined' ? format(row[field], row) : row[field];
var cell = typeof value !== 'undefined' ? '"' + value + '"' : '';
dataString += cell;
if (i + 1 < keys.length) dataString += ',';
});
dataString += '\n';
});
return dataString;
}
var exportCSV = function exportCSV(data, keys, filename) {
var dataString = toString(data, keys);
if (typeof window !== 'undefined') {
saveAs(new Blob([dataString], { type: 'text/plain;charset=utf-8' }), filename, true);
}
};
var _default = exportCSV;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(saveAs, 'saveAs', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/csv_export_util.js');
__REACT_HOT_LOADER__.register(toString, 'toString', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/csv_export_util.js');
__REACT_HOT_LOADER__.register(exportCSV, 'exportCSV', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/csv_export_util.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/csv_export_util.js');
}();
;
/***/ },
/* 185 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict";
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.1.20151003
*
* By Eli Grey, http://eligrey.com
* License: MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs = saveAs || function (view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var doc = view.document
// only get URL when necessary in case Blob.js hasn't overridden it yet
,
get_URL = function get_URL() {
return view.URL || view.webkitURL || view;
},
save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a"),
can_use_save_link = "download" in save_link,
click = function click(node) {
var event = new MouseEvent("click");
node.dispatchEvent(event);
},
is_safari = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent),
webkit_req_fs = view.webkitRequestFileSystem,
req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem,
throw_outside = function throw_outside(ex) {
(view.setImmediate || view.setTimeout)(function () {
throw ex;
}, 0);
},
force_saveable_type = "application/octet-stream",
fs_min_size = 0
// See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and
// https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047
// for the reasoning behind the timeout and revocation flow
,
arbitrary_revoke_timeout = 500 // in ms
,
revoke = function revoke(file) {
var revoker = function revoker() {
if (typeof file === "string") {
// file is an object URL
get_URL().revokeObjectURL(file);
} else {
// file is a File
file.remove();
}
};
if (view.chrome) {
revoker();
} else {
setTimeout(revoker, arbitrary_revoke_timeout);
}
},
dispatch = function dispatch(filesaver, event_types, event) {
event_types = [].concat(event_types);
var i = event_types.length;
while (i--) {
var listener = filesaver["on" + event_types[i]];
if (typeof listener === "function") {
try {
listener.call(filesaver, event || filesaver);
} catch (ex) {
throw_outside(ex);
}
}
}
},
auto_bom = function auto_bom(blob) {
// prepend BOM for UTF-8 XML and text/* types (including HTML)
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob(["\uFEFF", blob], { type: blob.type });
}
return blob;
},
FileSaver = function FileSaver(blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
// First try a.download, then web filesystem, then object URLs
var filesaver = this,
type = blob.type,
blob_changed = false,
object_url,
target_view,
dispatch_all = function dispatch_all() {
dispatch(filesaver, "writestart progress write writeend".split(" "));
}
// on any filesys errors revert to saving with object URLs
,
fs_error = function fs_error() {
if (target_view && is_safari && typeof FileReader !== "undefined") {
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.onloadend = function () {
var base64Data = reader.result;
target_view.location.href = "data:attachment/file" + base64Data.slice(base64Data.search(/[,;]/));
filesaver.readyState = filesaver.DONE;
dispatch_all();
};
reader.readAsDataURL(blob);
filesaver.readyState = filesaver.INIT;
return;
}
// don't create more object URLs than needed
if (blob_changed || !object_url) {
object_url = get_URL().createObjectURL(blob);
}
if (target_view) {
target_view.location.href = object_url;
} else {
var new_tab = view.open(object_url, "_blank");
if (new_tab == undefined && is_safari) {
//Apple do not allow window.open, see http://bit.ly/1kZffRI
view.location.href = object_url;
}
}
filesaver.readyState = filesaver.DONE;
dispatch_all();
revoke(object_url);
},
abortable = function abortable(func) {
return function () {
if (filesaver.readyState !== filesaver.DONE) {
return func.apply(this, arguments);
}
};
},
create_if_not_found = { create: true, exclusive: false },
slice;
filesaver.readyState = filesaver.INIT;
if (!name) {
name = "download";
}
if (can_use_save_link) {
object_url = get_URL().createObjectURL(blob);
save_link.href = object_url;
save_link.download = name;
setTimeout(function () {
click(save_link);
dispatch_all();
revoke(object_url);
filesaver.readyState = filesaver.DONE;
});
return;
}
// Object and web filesystem URLs have a problem saving in Google Chrome when
// viewed in a tab, so I force save with application/octet-stream
// http://code.google.com/p/chromium/issues/detail?id=91158
// Update: Google errantly closed 91158, I submitted it again:
// https://code.google.com/p/chromium/issues/detail?id=389642
if (view.chrome && type && type !== force_saveable_type) {
slice = blob.slice || blob.webkitSlice;
blob = slice.call(blob, 0, blob.size, force_saveable_type);
blob_changed = true;
}
// Since I can't be sure that the guessed media type will trigger a download
// in WebKit, I append .download to the filename.
// https://bugs.webkit.org/show_bug.cgi?id=65440
if (webkit_req_fs && name !== "download") {
name += ".download";
}
if (type === force_saveable_type || webkit_req_fs) {
target_view = view;
}
if (!req_fs) {
fs_error();
return;
}
fs_min_size += blob.size;
req_fs(view.TEMPORARY, fs_min_size, abortable(function (fs) {
fs.root.getDirectory("saved", create_if_not_found, abortable(function (dir) {
var save = function save() {
dir.getFile(name, create_if_not_found, abortable(function (file) {
file.createWriter(abortable(function (writer) {
writer.onwriteend = function (event) {
target_view.location.href = file.toURL();
filesaver.readyState = filesaver.DONE;
dispatch(filesaver, "writeend", event);
revoke(file);
};
writer.onerror = function () {
var error = writer.error;
if (error.code !== error.ABORT_ERR) {
fs_error();
}
};
"writestart progress write abort".split(" ").forEach(function (event) {
writer["on" + event] = filesaver["on" + event];
});
writer.write(blob);
filesaver.abort = function () {
writer.abort();
filesaver.readyState = filesaver.DONE;
};
filesaver.readyState = filesaver.WRITING;
}), fs_error);
}), fs_error);
};
dir.getFile(name, { create: false }, abortable(function (file) {
// delete file if it already exists
file.remove();
save();
}), abortable(function (ex) {
if (ex.code === ex.NOT_FOUND_ERR) {
save();
} else {
fs_error();
}
}));
}), fs_error);
}), fs_error);
},
FS_proto = FileSaver.prototype,
saveAs = function saveAs(blob, name, no_auto_bom) {
return new FileSaver(blob, name, no_auto_bom);
};
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
return function (blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
return navigator.msSaveOrOpenBlob(blob, name || "download");
};
}
FS_proto.abort = function () {
var filesaver = this;
filesaver.readyState = filesaver.DONE;
dispatch(filesaver, "abort");
};
FS_proto.readyState = FS_proto.INIT = 0;
FS_proto.WRITING = 1;
FS_proto.DONE = 2;
FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null;
return saveAs;
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || undefined.content);
// `self` is undefined in Firefox for Android content script context
// while `this` is nsIContentFrameMessageManager
// with an attribute `content` that corresponds to the window
if (typeof module !== "undefined" && module.exports) {
module.exports.saveAs = saveAs;
} else if ("function" !== "undefined" && __webpack_require__(186) !== null && __webpack_require__(187) != null) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
return saveAs;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(saveAs, "saveAs", "/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filesaver.js");
}();
;
/***/ },
/* 186 */
/***/ function(module, exports) {
module.exports = function() { throw new Error("define cannot be used indirect"); };
/***/ },
/* 187 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
/* WEBPACK VAR INJECTION */}.call(exports, {}))
/***/ },
/* 188 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Filter = undefined;
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 _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 _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _events = __webpack_require__(189);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Filter = exports.Filter = function (_EventEmitter) {
_inherits(Filter, _EventEmitter);
function Filter(data) {
_classCallCheck(this, Filter);
var _this = _possibleConstructorReturn(this, (Filter.__proto__ || Object.getPrototypeOf(Filter)).call(this, data));
_this.currentFilter = {};
return _this;
}
_createClass(Filter, [{
key: 'handleFilter',
value: function handleFilter(dataField, value, type) {
var filterType = type || _Const2.default.FILTER_TYPE.CUSTOM;
if (value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
// value of the filter is an object
var hasValue = true;
for (var prop in value) {
if (!value[prop] || value[prop] === '') {
hasValue = false;
break;
}
}
// if one of the object properties is undefined or empty, we remove the filter
if (hasValue) {
this.currentFilter[dataField] = { value: value, type: filterType };
} else {
delete this.currentFilter[dataField];
}
} else if (!value || value.trim() === '') {
delete this.currentFilter[dataField];
} else {
this.currentFilter[dataField] = { value: value.trim(), type: filterType };
}
this.emit('onFilterChange', this.currentFilter);
}
}]);
return Filter;
}(_events.EventEmitter);
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Filter, 'Filter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/Filter.js');
}();
;
/***/ },
/* 189 */
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() {
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10;
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
};
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
if (!this._events)
this._events = {};
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events.error ||
(isObject(this._events.error) && !this._events.error.length)) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
}
throw TypeError('Uncaught, unspecified "error" event.');
}
}
handler = this._events[type];
if (isUndefined(handler))
return false;
if (isFunction(handler)) {
switch (arguments.length) {
// fast cases
case 1:
handler.call(this);
break;
case 2:
handler.call(this, arguments[1]);
break;
case 3:
handler.call(this, arguments[1], arguments[2]);
break;
// slower
default:
len = arguments.length;
args = new Array(len - 1);
for (i = 1; i < len; i++)
args[i - 1] = arguments[i];
handler.apply(this, args);
}
} else if (isObject(handler)) {
len = arguments.length;
args = new Array(len - 1);
for (i = 1; i < len; i++)
args[i - 1] = arguments[i];
listeners = handler.slice();
len = listeners.length;
for (i = 0; i < len; i++)
listeners[i].apply(this, args);
}
return true;
};
EventEmitter.prototype.addListener = function(type, listener) {
var m;
if (!isFunction(listener))
throw TypeError('listener must be a function');
if (!this._events)
this._events = {};
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (this._events.newListener)
this.emit('newListener', type,
isFunction(listener.listener) ?
listener.listener : listener);
if (!this._events[type])
// Optimize the case of one listener. Don't need the extra array object.
this._events[type] = listener;
else if (isObject(this._events[type]))
// If we've already got an array, just append.
this._events[type].push(listener);
else
// Adding the second element, need to change to array.
this._events[type] = [this._events[type], listener];
// Check for listener leak
if (isObject(this._events[type]) && !this._events[type].warned) {
var m;
if (!isUndefined(this._maxListeners)) {
m = this._maxListeners;
} else {
m = EventEmitter.defaultMaxListeners;
}
if (m && m > 0 && this._events[type].length > m) {
this._events[type].warned = true;
console.error('(node) warning: possible EventEmitter memory ' +
'leak detected. %d listeners added. ' +
'Use emitter.setMaxListeners() to increase limit.',
this._events[type].length);
if (typeof console.trace === 'function') {
// not supported in IE 10
console.trace();
}
}
}
return this;
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.once = function(type, listener) {
if (!isFunction(listener))
throw TypeError('listener must be a function');
var fired = false;
function g() {
this.removeListener(type, g);
if (!fired) {
fired = true;
listener.apply(this, arguments);
}
}
g.listener = listener;
this.on(type, g);
return this;
};
// emits a 'removeListener' event iff the listener was removed
EventEmitter.prototype.removeListener = function(type, listener) {
var list, position, length, i;
if (!isFunction(listener))
throw TypeError('listener must be a function');
if (!this._events || !this._events[type])
return this;
list = this._events[type];
length = list.length;
position = -1;
if (list === listener ||
(isFunction(list.listener) && list.listener === listener)) {
delete this._events[type];
if (this._events.removeListener)
this.emit('removeListener', type, listener);
} else if (isObject(list)) {
for (i = length; i-- > 0;) {
if (list[i] === listener ||
(list[i].listener && list[i].listener === listener)) {
position = i;
break;
}
}
if (position < 0)
return this;
if (list.length === 1) {
list.length = 0;
delete this._events[type];
} else {
list.splice(position, 1);
}
if (this._events.removeListener)
this.emit('removeListener', type, listener);
}
return this;
};
EventEmitter.prototype.removeAllListeners = function(type) {
var key, listeners;
if (!this._events)
return this;
// not listening for removeListener, no need to emit
if (!this._events.removeListener) {
if (arguments.length === 0)
this._events = {};
else if (this._events[type])
delete this._events[type];
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
for (key in this._events) {
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = {};
return this;
}
listeners = this._events[type];
if (isFunction(listeners)) {
this.removeListener(type, listeners);
} else {
// LIFO order
while (listeners.length)
this.removeListener(type, listeners[listeners.length - 1]);
}
delete this._events[type];
return this;
};
EventEmitter.prototype.listeners = function(type) {
var ret;
if (!this._events || !this._events[type])
ret = [];
else if (isFunction(this._events[type]))
ret = [this._events[type]];
else
ret = this._events[type].slice();
return ret;
};
EventEmitter.listenerCount = function(emitter, type) {
var ret;
if (!emitter._events || !emitter._events[type])
ret = 0;
else if (isFunction(emitter._events[type]))
ret = 1;
else
ret = emitter._events[type].length;
return ret;
};
function isFunction(arg) {
return typeof arg === 'function';
}
function isNumber(arg) {
return typeof arg === 'number';
}
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
function isUndefined(arg) {
return arg === void 0;
}
/***/ },
/* 190 */
/***/ function(module, exports, __webpack_require__) {
'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 _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 _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
var _util = __webpack_require__(183);
var _util2 = _interopRequireDefault(_util);
var _Date = __webpack_require__(191);
var _Date2 = _interopRequireDefault(_Date);
var _Text = __webpack_require__(192);
var _Text2 = _interopRequireDefault(_Text);
var _Regex = __webpack_require__(193);
var _Regex2 = _interopRequireDefault(_Regex);
var _Select = __webpack_require__(194);
var _Select2 = _interopRequireDefault(_Select);
var _Number = __webpack_require__(195);
var _Number2 = _interopRequireDefault(_Number);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint default-case: 0 */
/* eslint guard-for-in: 0 */
var TableHeaderColumn = function (_Component) {
_inherits(TableHeaderColumn, _Component);
function TableHeaderColumn(props) {
_classCallCheck(this, TableHeaderColumn);
var _this = _possibleConstructorReturn(this, (TableHeaderColumn.__proto__ || Object.getPrototypeOf(TableHeaderColumn)).call(this, props));
_this.handleColumnClick = function () {
return _this.__handleColumnClick__REACT_HOT_LOADER__.apply(_this, arguments);
};
_this.handleFilter = _this.handleFilter.bind(_this);
return _this;
}
_createClass(TableHeaderColumn, [{
key: '__handleColumnClick__REACT_HOT_LOADER__',
value: function __handleColumnClick__REACT_HOT_LOADER__() {
if (!this.props.dataSort) return;
var order = this.props.sort === _Const2.default.SORT_DESC ? _Const2.default.SORT_ASC : _Const2.default.SORT_DESC;
this.props.onSort(order, this.props.dataField);
}
}, {
key: 'handleFilter',
value: function handleFilter(value, type) {
this.props.filter.emitter.handleFilter(this.props.dataField, value, type);
}
}, {
key: 'getFilters',
value: function getFilters() {
switch (this.props.filter.type) {
case _Const2.default.FILTER_TYPE.TEXT:
{
return _react2.default.createElement(_Text2.default, _extends({ ref: 'textFilter' }, this.props.filter, {
columnName: this.props.children, filterHandler: this.handleFilter }));
}
case _Const2.default.FILTER_TYPE.REGEX:
{
return _react2.default.createElement(_Regex2.default, _extends({ ref: 'regexFilter' }, this.props.filter, {
columnName: this.props.children, filterHandler: this.handleFilter }));
}
case _Const2.default.FILTER_TYPE.SELECT:
{
return _react2.default.createElement(_Select2.default, _extends({ ref: 'selectFilter' }, this.props.filter, {
columnName: this.props.children, filterHandler: this.handleFilter }));
}
case _Const2.default.FILTER_TYPE.NUMBER:
{
return _react2.default.createElement(_Number2.default, _extends({ ref: 'numberFilter' }, this.props.filter, {
columnName: this.props.children, filterHandler: this.handleFilter }));
}
case _Const2.default.FILTER_TYPE.DATE:
{
return _react2.default.createElement(_Date2.default, _extends({ ref: 'dateFilter' }, this.props.filter, {
columnName: this.props.children, filterHandler: this.handleFilter }));
}
case _Const2.default.FILTER_TYPE.CUSTOM:
{
var elm = this.props.filter.getElement(this.handleFilter, this.props.filter.customFilterParameters);
return _react2.default.cloneElement(elm, { ref: 'customFilter' });
}
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this.refs['header-col'].setAttribute('data-field', this.props.dataField);
}
}, {
key: 'render',
value: function render() {
var defaultCaret = void 0;
var _props = this.props,
dataAlign = _props.dataAlign,
dataField = _props.dataField,
headerAlign = _props.headerAlign,
headerTitle = _props.headerTitle,
hidden = _props.hidden,
sort = _props.sort,
dataSort = _props.dataSort,
sortIndicator = _props.sortIndicator,
children = _props.children,
caretRender = _props.caretRender,
className = _props.className;
var thStyle = {
textAlign: headerAlign || dataAlign,
display: hidden ? 'none' : null
};
if (sortIndicator) {
defaultCaret = !dataSort ? null : _react2.default.createElement(
'span',
{ className: 'order' },
_react2.default.createElement(
'span',
{ className: 'dropdown' },
_react2.default.createElement('span', { className: 'caret', style: { margin: '10px 0 10px 5px', color: '#ccc' } })
),
_react2.default.createElement(
'span',
{ className: 'dropup' },
_react2.default.createElement('span', { className: 'caret', style: { margin: '10px 0', color: '#ccc' } })
)
);
}
var sortCaret = sort ? _util2.default.renderReactSortCaret(sort) : defaultCaret;
if (caretRender) {
sortCaret = caretRender(sort, dataField);
}
var classes = (0, _classnames2.default)(typeof className === 'function' ? className() : className, dataSort ? 'sort-column' : '');
var title = headerTitle && typeof children === 'string' ? { title: children } : null;
return _react2.default.createElement(
'th',
_extends({ ref: 'header-col',
className: classes,
style: thStyle,
onClick: this.handleColumnClick
}, title),
children,
sortCaret,
_react2.default.createElement(
'div',
{ onClick: function onClick(e) {
return e.stopPropagation();
} },
this.props.filter ? this.getFilters() : null
)
);
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
if (this.props.filter === undefined) {
return;
}
switch (this.props.filter.type) {
case _Const2.default.FILTER_TYPE.TEXT:
{
this.refs.textFilter.cleanFiltered();
break;
}
case _Const2.default.FILTER_TYPE.REGEX:
{
this.refs.regexFilter.cleanFiltered();
break;
}
case _Const2.default.FILTER_TYPE.SELECT:
{
this.refs.selectFilter.cleanFiltered();
break;
}
case _Const2.default.FILTER_TYPE.NUMBER:
{
this.refs.numberFilter.cleanFiltered();
break;
}
case _Const2.default.FILTER_TYPE.DATE:
{
this.refs.dateFilter.cleanFiltered();
break;
}
case _Const2.default.FILTER_TYPE.CUSTOM:
{
this.refs.customFilter.cleanFiltered();
break;
}
}
}
}, {
key: 'applyFilter',
value: function applyFilter(val) {
if (this.props.filter === undefined) return;
switch (this.props.filter.type) {
case _Const2.default.FILTER_TYPE.TEXT:
{
this.refs.textFilter.applyFilter(val);
break;
}
case _Const2.default.FILTER_TYPE.REGEX:
{
this.refs.regexFilter.applyFilter(val);
break;
}
case _Const2.default.FILTER_TYPE.SELECT:
{
this.refs.selectFilter.applyFilter(val);
break;
}
case _Const2.default.FILTER_TYPE.NUMBER:
{
this.refs.numberFilter.applyFilter(val);
break;
}
case _Const2.default.FILTER_TYPE.DATE:
{
this.refs.dateFilter.applyFilter(val);
break;
}
}
}
}]);
return TableHeaderColumn;
}(_react.Component);
var filterTypeArray = [];
for (var key in _Const2.default.FILTER_TYPE) {
filterTypeArray.push(_Const2.default.FILTER_TYPE[key]);
}
TableHeaderColumn.propTypes = {
dataField: _react.PropTypes.string,
dataAlign: _react.PropTypes.string,
headerAlign: _react.PropTypes.string,
headerTitle: _react.PropTypes.bool,
dataSort: _react.PropTypes.bool,
onSort: _react.PropTypes.func,
dataFormat: _react.PropTypes.func,
csvFormat: _react.PropTypes.func,
csvHeader: _react.PropTypes.string,
isKey: _react.PropTypes.bool,
editable: _react.PropTypes.any,
hidden: _react.PropTypes.bool,
hiddenOnInsert: _react.PropTypes.bool,
searchable: _react.PropTypes.bool,
className: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]),
width: _react.PropTypes.string,
sortFunc: _react.PropTypes.func,
sortFuncExtraData: _react.PropTypes.any,
columnClassName: _react.PropTypes.any,
columnTitle: _react.PropTypes.bool,
filterFormatted: _react.PropTypes.bool,
filterValue: _react.PropTypes.func,
sort: _react.PropTypes.string,
caretRender: _react.PropTypes.func,
formatExtraData: _react.PropTypes.any,
filter: _react.PropTypes.shape({
type: _react.PropTypes.oneOf(filterTypeArray),
delay: _react.PropTypes.number,
options: _react.PropTypes.oneOfType([_react.PropTypes.object, // for SelectFilter
_react.PropTypes.arrayOf(_react.PropTypes.number) // for NumberFilter
]),
numberComparators: _react.PropTypes.arrayOf(_react.PropTypes.string),
emitter: _react.PropTypes.object,
placeholder: _react.PropTypes.string,
getElement: _react.PropTypes.func,
customFilterParameters: _react.PropTypes.object
}),
sortIndicator: _react.PropTypes.bool,
export: _react.PropTypes.bool
};
TableHeaderColumn.defaultProps = {
dataAlign: 'left',
headerAlign: undefined,
headerTitle: true,
dataSort: false,
dataFormat: undefined,
csvFormat: undefined,
csvHeader: undefined,
isKey: false,
editable: true,
onSort: undefined,
hidden: false,
hiddenOnInsert: false,
searchable: true,
className: '',
columnTitle: false,
width: null,
sortFunc: undefined,
columnClassName: '',
filterFormatted: false,
filterValue: undefined,
sort: undefined,
formatExtraData: undefined,
sortFuncExtraData: undefined,
filter: undefined,
sortIndicator: true
};
var _default = TableHeaderColumn;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TableHeaderColumn, 'TableHeaderColumn', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeaderColumn.js');
__REACT_HOT_LOADER__.register(filterTypeArray, 'filterTypeArray', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeaderColumn.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/TableHeaderColumn.js');
}();
;
/***/ },
/* 191 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint quotes: 0 */
/* eslint max-len: 0 */
var legalComparators = ['=', '>', '>=', '<', '<=', '!='];
function dateParser(d) {
return d.getFullYear() + '-' + ("0" + (d.getMonth() + 1)).slice(-2) + '-' + ("0" + d.getDate()).slice(-2);
}
var DateFilter = function (_Component) {
_inherits(DateFilter, _Component);
function DateFilter(props) {
_classCallCheck(this, DateFilter);
var _this = _possibleConstructorReturn(this, (DateFilter.__proto__ || Object.getPrototypeOf(DateFilter)).call(this, props));
_this.dateComparators = _this.props.dateComparators || legalComparators;
_this.filter = _this.filter.bind(_this);
_this.onChangeComparator = _this.onChangeComparator.bind(_this);
return _this;
}
_createClass(DateFilter, [{
key: 'setDefaultDate',
value: function setDefaultDate() {
var defaultDate = '';
var defaultValue = this.props.defaultValue;
if (defaultValue && defaultValue.date) {
// Set the appropriate format for the input type=date, i.e. "YYYY-MM-DD"
defaultDate = dateParser(new Date(defaultValue.date));
}
return defaultDate;
}
}, {
key: 'onChangeComparator',
value: function onChangeComparator(event) {
var date = this.refs.inputDate.value;
var comparator = event.target.value;
if (date === '') {
return;
}
date = new Date(date);
this.props.filterHandler({ date: date, comparator: comparator }, _Const2.default.FILTER_TYPE.DATE);
}
}, {
key: 'getComparatorOptions',
value: function getComparatorOptions() {
var optionTags = [];
optionTags.push(_react2.default.createElement('option', { key: '-1' }));
for (var i = 0; i < this.dateComparators.length; i++) {
optionTags.push(_react2.default.createElement(
'option',
{ key: i, value: this.dateComparators[i] },
this.dateComparators[i]
));
}
return optionTags;
}
}, {
key: 'filter',
value: function filter(event) {
var comparator = this.refs.dateFilterComparator.value;
var dateValue = event.target.value;
if (dateValue) {
this.props.filterHandler({ date: new Date(dateValue), comparator: comparator }, _Const2.default.FILTER_TYPE.DATE);
} else {
this.props.filterHandler(null, _Const2.default.FILTER_TYPE.DATE);
}
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
var value = this.setDefaultDate();
var comparator = this.props.defaultValue ? this.props.defaultValue.comparator : '';
this.setState({ isPlaceholderSelected: value === '' });
this.refs.dateFilterComparator.value = comparator;
this.refs.inputDate.value = value;
this.props.filterHandler({ date: new Date(value), comparator: comparator }, _Const2.default.FILTER_TYPE.DATE);
}
}, {
key: 'applyFilter',
value: function applyFilter(filterDateObj) {
var date = filterDateObj.date,
comparator = filterDateObj.comparator;
this.setState({ isPlaceholderSelected: date === '' });
this.refs.dateFilterComparator.value = comparator;
this.refs.inputDate.value = dateParser(date);
this.props.filterHandler({ date: date, comparator: comparator }, _Const2.default.FILTER_TYPE.DATE);
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var comparator = this.refs.dateFilterComparator.value;
var dateValue = this.refs.inputDate.value;
if (comparator && dateValue) {
this.props.filterHandler({ date: new Date(dateValue), comparator: comparator }, _Const2.default.FILTER_TYPE.DATE);
}
}
}, {
key: 'render',
value: function render() {
var defaultValue = this.props.defaultValue;
return _react2.default.createElement(
'div',
{ className: 'filter date-filter' },
_react2.default.createElement(
'select',
{ ref: 'dateFilterComparator',
className: 'date-filter-comparator form-control',
onChange: this.onChangeComparator,
defaultValue: defaultValue ? defaultValue.comparator : '' },
this.getComparatorOptions()
),
_react2.default.createElement('input', { ref: 'inputDate',
className: 'filter date-filter-input form-control',
type: 'date',
onChange: this.filter,
defaultValue: this.setDefaultDate() })
);
}
}]);
return DateFilter;
}(_react.Component);
DateFilter.propTypes = {
filterHandler: _react.PropTypes.func.isRequired,
defaultValue: _react.PropTypes.shape({
date: _react.PropTypes.object,
comparator: _react.PropTypes.oneOf(legalComparators)
}),
/* eslint consistent-return: 0 */
dateComparators: function dateComparators(props, propName) {
if (!props[propName]) {
return;
}
for (var i = 0; i < props[propName].length; i++) {
var comparatorIsValid = false;
for (var j = 0; j < legalComparators.length; j++) {
if (legalComparators[j] === props[propName][i]) {
comparatorIsValid = true;
break;
}
}
if (!comparatorIsValid) {
return new Error('Date comparator provided is not supported.\n Use only ' + legalComparators);
}
}
},
columnName: _react.PropTypes.string
};
var _default = DateFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(legalComparators, 'legalComparators', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Date.js');
__REACT_HOT_LOADER__.register(dateParser, 'dateParser', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Date.js');
__REACT_HOT_LOADER__.register(DateFilter, 'DateFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Date.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Date.js');
}();
;
/***/ },
/* 192 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var TextFilter = function (_Component) {
_inherits(TextFilter, _Component);
function TextFilter(props) {
_classCallCheck(this, TextFilter);
var _this = _possibleConstructorReturn(this, (TextFilter.__proto__ || Object.getPrototypeOf(TextFilter)).call(this, props));
_this.filter = _this.filter.bind(_this);
_this.timeout = null;
return _this;
}
_createClass(TextFilter, [{
key: 'filter',
value: function filter(event) {
var _this2 = this;
if (this.timeout) {
clearTimeout(this.timeout);
}
var filterValue = event.target.value;
this.timeout = setTimeout(function () {
_this2.props.filterHandler(filterValue, _Const2.default.FILTER_TYPE.TEXT);
}, this.props.delay);
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
var value = this.props.defaultValue ? this.props.defaultValue : '';
this.refs.inputText.value = value;
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.TEXT);
}
}, {
key: 'applyFilter',
value: function applyFilter(filterText) {
this.refs.inputText.value = filterText;
this.props.filterHandler(filterText, _Const2.default.FILTER_TYPE.TEXT);
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var defaultValue = this.refs.inputText.value;
if (defaultValue) {
this.props.filterHandler(defaultValue, _Const2.default.FILTER_TYPE.TEXT);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
clearTimeout(this.timeout);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
placeholder = _props.placeholder,
columnName = _props.columnName,
defaultValue = _props.defaultValue;
return _react2.default.createElement('input', { ref: 'inputText',
className: 'filter text-filter form-control',
type: 'text',
onChange: this.filter,
placeholder: placeholder || 'Enter ' + columnName + '...',
defaultValue: defaultValue ? defaultValue : '' });
}
}]);
return TextFilter;
}(_react.Component);
TextFilter.propTypes = {
filterHandler: _react.PropTypes.func.isRequired,
defaultValue: _react.PropTypes.string,
delay: _react.PropTypes.number,
placeholder: _react.PropTypes.string,
columnName: _react.PropTypes.string
};
TextFilter.defaultProps = {
delay: _Const2.default.FILTER_DELAY
};
var _default = TextFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(TextFilter, 'TextFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Text.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Text.js');
}();
;
/***/ },
/* 193 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var RegexFilter = function (_Component) {
_inherits(RegexFilter, _Component);
function RegexFilter(props) {
_classCallCheck(this, RegexFilter);
var _this = _possibleConstructorReturn(this, (RegexFilter.__proto__ || Object.getPrototypeOf(RegexFilter)).call(this, props));
_this.filter = _this.filter.bind(_this);
_this.timeout = null;
return _this;
}
_createClass(RegexFilter, [{
key: 'filter',
value: function filter(event) {
var _this2 = this;
if (this.timeout) {
clearTimeout(this.timeout);
}
var filterValue = event.target.value;
this.timeout = setTimeout(function () {
_this2.props.filterHandler(filterValue, _Const2.default.FILTER_TYPE.REGEX);
}, this.props.delay);
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
var value = this.props.defaultValue ? this.props.defaultValue : '';
this.refs.inputText.value = value;
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.TEXT);
}
}, {
key: 'applyFilter',
value: function applyFilter(filterRegx) {
this.refs.inputText.value = filterRegx;
this.props.filterHandler(filterRegx, _Const2.default.FILTER_TYPE.REGEX);
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var value = this.refs.inputText.value;
if (value) {
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.REGEX);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
clearTimeout(this.timeout);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
defaultValue = _props.defaultValue,
placeholder = _props.placeholder,
columnName = _props.columnName;
return _react2.default.createElement('input', { ref: 'inputText',
className: 'filter text-filter form-control',
type: 'text',
onChange: this.filter,
placeholder: placeholder || 'Enter Regex for ' + columnName + '...',
defaultValue: defaultValue ? defaultValue : '' });
}
}]);
return RegexFilter;
}(_react.Component);
RegexFilter.propTypes = {
filterHandler: _react.PropTypes.func.isRequired,
defaultValue: _react.PropTypes.string,
delay: _react.PropTypes.number,
placeholder: _react.PropTypes.string,
columnName: _react.PropTypes.string
};
RegexFilter.defaultProps = {
delay: _Const2.default.FILTER_DELAY
};
var _default = RegexFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(RegexFilter, 'RegexFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Regex.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Regex.js');
}();
;
/***/ },
/* 194 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var SelectFilter = function (_Component) {
_inherits(SelectFilter, _Component);
function SelectFilter(props) {
_classCallCheck(this, SelectFilter);
var _this = _possibleConstructorReturn(this, (SelectFilter.__proto__ || Object.getPrototypeOf(SelectFilter)).call(this, props));
_this.filter = _this.filter.bind(_this);
_this.state = {
isPlaceholderSelected: _this.props.defaultValue === undefined || !_this.props.options.hasOwnProperty(_this.props.defaultValue)
};
return _this;
}
_createClass(SelectFilter, [{
key: 'filter',
value: function filter(event) {
var value = event.target.value;
this.setState({ isPlaceholderSelected: value === '' });
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.SELECT);
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
var value = this.props.defaultValue !== undefined ? this.props.defaultValue : '';
this.setState({ isPlaceholderSelected: value === '' });
this.refs.selectInput.value = value;
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.SELECT);
}
}, {
key: 'applyFilter',
value: function applyFilter(filterOption) {
filterOption = filterOption + '';
this.setState({ isPlaceholderSelected: filterOption === '' });
this.refs.selectInput.value = filterOption;
this.props.filterHandler(filterOption, _Const2.default.FILTER_TYPE.SELECT);
}
}, {
key: 'getOptions',
value: function getOptions() {
var optionTags = [];
var _props = this.props,
options = _props.options,
placeholder = _props.placeholder,
columnName = _props.columnName,
selectText = _props.selectText;
var selectTextValue = selectText !== undefined ? selectText : 'Select';
optionTags.push(_react2.default.createElement(
'option',
{ key: '-1', value: '' },
placeholder || selectTextValue + ' ' + columnName + '...'
));
Object.keys(options).map(function (key) {
optionTags.push(_react2.default.createElement(
'option',
{ key: key, value: key },
options[key] + ''
));
});
return optionTags;
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var value = this.refs.selectInput.value;
if (value) {
this.props.filterHandler(value, _Const2.default.FILTER_TYPE.SELECT);
}
}
}, {
key: 'render',
value: function render() {
var selectClass = (0, _classnames2.default)('filter', 'select-filter', 'form-control', { 'placeholder-selected': this.state.isPlaceholderSelected });
return _react2.default.createElement(
'select',
{ ref: 'selectInput',
className: selectClass,
onChange: this.filter,
defaultValue: this.props.defaultValue !== undefined ? this.props.defaultValue : '' },
this.getOptions()
);
}
}]);
return SelectFilter;
}(_react.Component);
SelectFilter.propTypes = {
filterHandler: _react.PropTypes.func.isRequired,
options: _react.PropTypes.object.isRequired,
placeholder: _react.PropTypes.string,
columnName: _react.PropTypes.string
};
var _default = SelectFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(SelectFilter, 'SelectFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Select.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Select.js');
}();
;
/***/ },
/* 195 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _Const = __webpack_require__(4);
var _Const2 = _interopRequireDefault(_Const);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var legalComparators = ['=', '>', '>=', '<', '<=', '!='];
var NumberFilter = function (_Component) {
_inherits(NumberFilter, _Component);
function NumberFilter(props) {
_classCallCheck(this, NumberFilter);
var _this = _possibleConstructorReturn(this, (NumberFilter.__proto__ || Object.getPrototypeOf(NumberFilter)).call(this, props));
_this.numberComparators = _this.props.numberComparators || legalComparators;
_this.timeout = null;
_this.state = {
isPlaceholderSelected: _this.props.defaultValue === undefined || _this.props.defaultValue.number === undefined || _this.props.options && _this.props.options.indexOf(_this.props.defaultValue.number) === -1
};
_this.onChangeNumber = _this.onChangeNumber.bind(_this);
_this.onChangeNumberSet = _this.onChangeNumberSet.bind(_this);
_this.onChangeComparator = _this.onChangeComparator.bind(_this);
return _this;
}
_createClass(NumberFilter, [{
key: 'onChangeNumber',
value: function onChangeNumber(event) {
var _this2 = this;
var comparator = this.refs.numberFilterComparator.value;
if (comparator === '') {
return;
}
if (this.timeout) {
clearTimeout(this.timeout);
}
var filterValue = event.target.value;
this.timeout = setTimeout(function () {
_this2.props.filterHandler({ number: filterValue, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}, this.props.delay);
}
}, {
key: 'onChangeNumberSet',
value: function onChangeNumberSet(event) {
var comparator = this.refs.numberFilterComparator.value;
var value = event.target.value;
this.setState({ isPlaceholderSelected: value === '' });
if (comparator === '') {
return;
}
this.props.filterHandler({ number: value, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}
}, {
key: 'onChangeComparator',
value: function onChangeComparator(event) {
var value = this.refs.numberFilter.value;
var comparator = event.target.value;
if (value === '') {
return;
}
this.props.filterHandler({ number: value, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}
}, {
key: 'cleanFiltered',
value: function cleanFiltered() {
var value = this.props.defaultValue ? this.props.defaultValue.number : '';
var comparator = this.props.defaultValue ? this.props.defaultValue.comparator : '';
this.setState({ isPlaceholderSelected: value === '' });
this.refs.numberFilterComparator.value = comparator;
this.refs.numberFilter.value = value;
this.props.filterHandler({ number: value, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}
}, {
key: 'applyFilter',
value: function applyFilter(filterObj) {
var number = filterObj.number,
comparator = filterObj.comparator;
this.setState({ isPlaceholderSelected: number === '' });
this.refs.numberFilterComparator.value = comparator;
this.refs.numberFilter.value = number;
this.props.filterHandler({ number: number, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}
}, {
key: 'getComparatorOptions',
value: function getComparatorOptions() {
var optionTags = [];
optionTags.push(_react2.default.createElement('option', { key: '-1' }));
for (var i = 0; i < this.numberComparators.length; i++) {
optionTags.push(_react2.default.createElement(
'option',
{ key: i, value: this.numberComparators[i] },
this.numberComparators[i]
));
}
return optionTags;
}
}, {
key: 'getNumberOptions',
value: function getNumberOptions() {
var optionTags = [];
var options = this.props.options;
optionTags.push(_react2.default.createElement(
'option',
{ key: '-1', value: '' },
this.props.placeholder || 'Select ' + this.props.columnName + '...'
));
for (var i = 0; i < options.length; i++) {
optionTags.push(_react2.default.createElement(
'option',
{ key: i, value: options[i] },
options[i]
));
}
return optionTags;
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var comparator = this.refs.numberFilterComparator.value;
var number = this.refs.numberFilter.value;
if (comparator && number) {
this.props.filterHandler({ number: number, comparator: comparator }, _Const2.default.FILTER_TYPE.NUMBER);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
clearTimeout(this.timeout);
}
}, {
key: 'render',
value: function render() {
var selectClass = (0, _classnames2.default)('select-filter', 'number-filter-input', 'form-control', { 'placeholder-selected': this.state.isPlaceholderSelected });
return _react2.default.createElement(
'div',
{ className: 'filter number-filter' },
_react2.default.createElement(
'select',
{ ref: 'numberFilterComparator',
className: 'number-filter-comparator form-control',
onChange: this.onChangeComparator,
defaultValue: this.props.defaultValue ? this.props.defaultValue.comparator : '' },
this.getComparatorOptions()
),
this.props.options ? _react2.default.createElement(
'select',
{ ref: 'numberFilter',
className: selectClass,
onChange: this.onChangeNumberSet,
defaultValue: this.props.defaultValue ? this.props.defaultValue.number : '' },
this.getNumberOptions()
) : _react2.default.createElement('input', { ref: 'numberFilter',
type: 'number',
className: 'number-filter-input form-control',
placeholder: this.props.placeholder || 'Enter ' + this.props.columnName + '...',
onChange: this.onChangeNumber,
defaultValue: this.props.defaultValue ? this.props.defaultValue.number : '' })
);
}
}]);
return NumberFilter;
}(_react.Component);
NumberFilter.propTypes = {
filterHandler: _react.PropTypes.func.isRequired,
options: _react.PropTypes.arrayOf(_react.PropTypes.number),
defaultValue: _react.PropTypes.shape({
number: _react.PropTypes.number,
comparator: _react.PropTypes.oneOf(legalComparators)
}),
delay: _react.PropTypes.number,
/* eslint consistent-return: 0 */
numberComparators: function numberComparators(props, propName) {
if (!props[propName]) {
return;
}
for (var i = 0; i < props[propName].length; i++) {
var comparatorIsValid = false;
for (var j = 0; j < legalComparators.length; j++) {
if (legalComparators[j] === props[propName][i]) {
comparatorIsValid = true;
break;
}
}
if (!comparatorIsValid) {
return new Error('Number comparator provided is not supported.\n Use only ' + legalComparators);
}
}
},
placeholder: _react.PropTypes.string,
columnName: _react.PropTypes.string
};
NumberFilter.defaultProps = {
delay: _Const2.default.FILTER_DELAY
};
var _default = NumberFilter;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(legalComparators, 'legalComparators', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Number.js');
__REACT_HOT_LOADER__.register(NumberFilter, 'NumberFilter', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Number.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/shaochang.fang/Documents/workspace/github/react-bootstrap-table/src/filters/Number.js');
}();
;
/***/ }
/******/ ])
});
;
//# sourceMappingURL=react-bootstrap-table.js.map |
packages/veritone-react-common/src/components/DataPicker/UploaderViewContainer/index.js | veritone/veritone-sdk | import React from 'react';
import { arrayOf, string, func, shape, bool, number, object, oneOfType } from 'prop-types';
import HTML from 'react-dnd-html5-backend';
import { DndProvider } from 'react-dnd';
import Button from '@material-ui/core/Button';
import CheckCircle from '@material-ui/icons/CheckCircle';
import Info from '@material-ui/icons/Info';
import Warning from '@material-ui/icons/Warning';
import green from '@material-ui/core/colors/green';
import { makeStyles } from '@material-ui/styles';
import FileUploader from '../../FilePicker/FileUploader';
import FileList from '../../FilePicker/FileList';
import FilePickerHeader from '../../FilePicker/FilePickerHeader';
import FileProgressList from '../../FilePicker/FileProgressList';
import FilePickerFooter from '../../FilePicker/FilePickerFooter';
import styles from './styles';
const useStyles = makeStyles(styles);
const UploadViewContainer = ({
accept,
onFilesSelected,
onReject,
uploadPickerState,
uploadStatusMsg,
uploadSuccess,
uploadWarning,
uploadError,
uploadedFiles,
percentByFiles,
onCancel,
onUpload,
handleAbort,
onRetryDone,
retryRequest,
onDeleteFile,
multiple,
containerStyle,
onRemoveFile,
isFullScreen
}) => {
const classes = useStyles();
const completeStatus = {
[uploadSuccess]: 'success',
[uploadWarning]: 'warning',
[uploadError]: 'failure'
}[true];
const icon = {
success: (<CheckCircle style={{ fill: green[500] }} />),
failure: (<Info style={{ color: '#F44336' }} />),
warning: (<Warning style={{ color: '#ffc107' }} />)
}[completeStatus];
const uploadDisabled = (
percentByFiles
&& percentByFiles.length > 0
&& percentByFiles.some(percent => percent.value.percent > 0)
) || (uploadedFiles && !uploadedFiles.length);
return (
<div className={classes['uploaderContainer']} style={containerStyle}>
<div className={classes['uploaderContent']}>
{
uploadPickerState === 'selecting'
? (
<div className={classes['uploaderUploadArea']}>
<DndProvider backend={HTML}>
<FileUploader
acceptedFileTypes={accept}
onFilesSelected={onFilesSelected}
multiple={multiple}
onFilesRejected={onReject}
/>
</DndProvider>
{uploadedFiles && !!uploadedFiles.length && (
<FileList
files={uploadedFiles}
onRemoveFile={onRemoveFile}
/>
)}
</div>
) : (
<div className={classes['uploaderFileList']}>
<div>
<FilePickerHeader
title={completeStatus ? `Upload ${completeStatus}` : 'Uploading'}
titleIcon={icon}
message={uploadStatusMsg}
hideTabs />
<div className={classes['uploadProgressContainer']}>
<FileProgressList
percentByFiles={percentByFiles}
handleAbort={handleAbort}
showErrors={completeStatus && completeStatus !== 'success'}
/>
</div>
</div>
{
completeStatus && completeStatus !== 'success'
&& percentByFiles && !!percentByFiles.length
&& (
<div
className={classes['uploaderRetryButtonContainer']}
data-veritone-element="picker-retry-controls"
>
<Button
onClick={onRetryDone}>
Done
</Button>
<Button
variant="contained"
color="primary"
onClick={retryRequest}>
Retry All
</Button>
</div>
)
}
</div>
)
}
</div>
<FilePickerFooter
title="Upload"
onCancel={onCancel}
disabled={uploadDisabled}
onSubmit={onUpload}
hasIntercom={isFullScreen}
/>
</div>
);
}
UploadViewContainer.propTypes = {
accept: arrayOf(string),
onFilesSelected: func.isRequired,
onUpload: func.isRequired,
onCancel: func,
onDeleteFile: func,
onReject: func,
multiple: bool,
containerStyle: shape({
heigh: number,
width: number
}),
percentByFiles: arrayOf(shape({
key: string,
value: shape({
type: string,
percent: number,
size: number,
error: string
})
})),
uploadPickerState: string,
uploadStatusMsg: string,
uploadSuccess: oneOfType([string, bool]),
uploadError: oneOfType([string, bool]),
uploadWarning: oneOfType([string, bool]),
uploadedFiles: arrayOf(object),
handleAbort: func,
onRetryDone: func,
retryRequest: func,
onRemoveFile: func,
isFullScreen: bool
};
UploadViewContainer.defaultProps = {
accept: [],
multiple: true
}
export default UploadViewContainer;
|
SearchResults.js | ikhsan/Marvel-Finder | 'use strict';
var React = require('react-native');
var {
StyleSheet,
Image,
View,
TouchableHighlight,
ListView,
Text,
Component
} = React;
var showCharacter = require('./showCharacter');
var styles = StyleSheet.create({
thumb: {
width: 80,
height: 80,
marginRight: 10
},
textContainer: {
flex: 1
},
separator: {
height: 1,
backgroundColor: '#dddddd'
},
name: {
fontSize: 25,
fontWeight: 'bold',
color: '#EC1D23'
},
charid: {
fontSize: 20,
color: '#656565'
},
rowContainer: {
flexDirection: 'row',
padding: 10
}
});
var SearchResults = React.createClass({
getInitialState: function() {
var ds = new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2 });
return {
dataSource: ds.cloneWithRows(this.props.characters)
};
},
rowPressed: function(charId) {
var character = this.props.characters.filter(char => char.id === charId)[0];
showCharacter(character);
},
renderRow: function(rowData, sectionID, rowID) {
var title = rowData.name;
var image_url = rowData.thumbnail.path + "." + rowData.thumbnail.extension;
var charID = rowData.id;
return (
<TouchableHighlight
onPress={() => this.rowPressed(charID)}
underlayColor='#dddddd'>
<View>
<View style={styles.rowContainer}>
<Image style={styles.thumb} source={{ uri: image_url }} />
<View style={styles.textContainer}>
<Text style={styles.name}>{title}</Text>
<Text style={styles.charid} numberOfLines={1}>{charID}</Text>
</View>
</View>
<View style={styles.separator} />
</View>
</TouchableHighlight>
);
},
render: function() {
return (
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderRow} />
);
},
});
module.exports = SearchResults;
|
src/parser/druid/feral/modules/features/checklist/Component.js | ronaldpereira/WoWAnalyzer | import React from 'react';
import PropTypes from 'prop-types';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import RACES from 'game/RACES';
import { TooltipElement } from 'common/Tooltip';
import Checklist from 'parser/shared/modules/features/Checklist';
import Rule from 'parser/shared/modules/features/Checklist/Rule';
import Requirement from 'parser/shared/modules/features/Checklist/Requirement';
import PreparationRule from 'parser/shared/modules/features/Checklist/PreparationRule';
import GenericCastEfficiencyRequirement from 'parser/shared/modules/features/Checklist/GenericCastEfficiencyRequirement';
const FeralDruidChecklist = ({ combatant, castEfficiency, thresholds }) => {
const UptimeRequirement = props => (
<Requirement
name={(
<>
<SpellLink id={props.spell} /> uptime
</>
)}
thresholds={props.thresholds}
/>
);
UptimeRequirement.propTypes = {
spell: PropTypes.object.isRequired,
};
const CastEfficiencyRequirement = props => (
<GenericCastEfficiencyRequirement
castEfficiency={castEfficiency.getCastEfficiencyForSpellId(props.spell)}
{...props}
/>
);
CastEfficiencyRequirement.propTypes = {
spell: PropTypes.object.isRequired,
};
const SnapshotDowngradeRequirement = props => (
<Requirement
name={(
<>
<SpellLink id={props.spell} /> downgraded before the pandemic window
</>
)}
thresholds={props.thresholds}
tooltip="Downgrading a snapshot can be unavoidable, but you should let the upgraded version last as long as possible by avoiding early refreshes."
/>
);
SnapshotDowngradeRequirement.propTypes = {
spell: PropTypes.object.isRequired,
};
return (
<Checklist>
{/* Builders
🗵 Uptime for Rake DoT
🗵 Uptime for Moonfire DoT (if talented for it)
☐ Avoid the types of early refresh which aren't already caught by the snapshot analysers. (Can be tricky to determine with certainty if such a refresh is bad, although if the player is just spamming Rake that should be flagged as a mistake.)
🗵 Cast efficiency of Brutal Slash (if talented)
🗵 Cast efficiency of Feral Frenzy (if talented)
🗵 Only use Swipe if it hits multiple enemies
🗵 Don't waste combo points by generating more when full
*/}
<Rule
name="Generate combo points"
description={(
<>
Builders use energy and give you combo points. Keep your <TooltipElement content="Rake and Moonfire if you have the Lunar Inspiration talent, and Thrash if you the Wild Fleshrending azerite trait.">DoTs</TooltipElement> active, use <SpellLink id={SPELLS.BRUTAL_SLASH_TALENT.id} /> and <SpellLink id={SPELLS.FERAL_FRENZY_TALENT.id} /> if you have those talents, then fill with <SpellLink id={SPELLS.SHRED.id} />. Don't waste combo points by continuing to use builders when at full combo points.<br /><br />
You should adapt your behaviour in AoE situations (the analyzer only accounts for some of this, so use your discretion when looking at AoE-heavy fights.) If you'll hit 2 or more targets replace <SpellLink id={SPELLS.SHRED.id} /> with <SpellLink id={SPELLS.SWIPE_CAT.id} />. When fighting <TooltipElement content="The threshold varies slightly depending on your stats and azerite traits.">5 targets</TooltipElement> or more it's no longer worth using <SpellLink id={SPELLS.RAKE.id} /> and <SpellLink id={SPELLS.MOONFIRE_FERAL.id} />. Unlike in the Legion expansion you should never spam <SpellLink id={SPELLS.THRASH_FERAL.id} />, keep it active only if you have <SpellLink id={SPELLS.WILD_FLESHRENDING.id} /> traits or if you would otherwise be using <SpellLink id={SPELLS.SWIPE_CAT.id} /> on targets without any bleeds.
</>
)}
>
<UptimeRequirement spell={SPELLS.RAKE.id} thresholds={thresholds.rakeUptime} />
{combatant.hasTalent(SPELLS.LUNAR_INSPIRATION_TALENT.id) && (
<UptimeRequirement spell={SPELLS.MOONFIRE_FERAL.id} thresholds={thresholds.moonfireUptime} />
)}
{combatant.hasTalent(SPELLS.BRUTAL_SLASH_TALENT.id) && (
<CastEfficiencyRequirement spell={SPELLS.BRUTAL_SLASH_TALENT.id} />
)}
{combatant.hasTalent(SPELLS.FERAL_FRENZY_TALENT.id) && (
<CastEfficiencyRequirement spell={SPELLS.FERAL_FRENZY_TALENT.id} />
)}
<Requirement
name={(
<>
Inappropriate <SpellLink id={SPELLS.SWIPE_CAT.id} />
</>
)}
thresholds={thresholds.swipeHitOne}
tooltip="How many times you used Swipe but had it only hit 1 target. Against a single target you should use Shred instead."
/>
<Requirement
name={(
<>
Combo points wasted
</>
)}
thresholds={thresholds.comboPointsWaste}
tooltip="Generating combo points after already reaching the maximum 5 wastes them."
/>
</Rule>
{/* Finishers
🗵 Uptime on Rip DoT
🗵 Uptime for Savage Roar buff (if talented)
🗵 Ferocious Bite only at energy >= 50
🗵 Don't cast Rip when Ferocious Bite could have refreshed it, unless you're upgrading the snapshot
🗵 Don't reduce duration of Rip by refreshing early and with low combo points
🗵 Don't use finishers at less than 5 combo points (except for certain exceptions)
*/}
<Rule
name="Spend combo points"
description={(
<>
You should generally only use finishers with a full 5 combo points. The exception is the first <SpellLink id={SPELLS.RIP.id} /> of the fight which should be applied as early as possible. <SpellLink id={SPELLS.SABERTOOTH_TALENT.id} /> is a damage gain in many situations and simplifies your finisher use, allowing you to almost always use <SpellLink id={SPELLS.FEROCIOUS_BITE.id} /> as your single target finisher. When casting <SpellLink id={SPELLS.FEROCIOUS_BITE.id} /> make sure you have at least <TooltipElement content="Ferocious Bite's tooltip says it needs just 25 energy, but you should always give it an additional 25 to double its damage.">50 energy.</TooltipElement><br /><br />
<SpellLink id={SPELLS.PRIMAL_WRATH_TALENT.id} /> can replace both <SpellLink id={SPELLS.RIP.id} /> and <SpellLink id={SPELLS.FEROCIOUS_BITE.id} /> when against approximately 3 or more enemies.
</>
)}
>
<UptimeRequirement spell={SPELLS.RIP.id} thresholds={thresholds.ripUptime} />
{combatant.hasTalent(SPELLS.SAVAGE_ROAR_TALENT.id) && (
<UptimeRequirement spell={SPELLS.SAVAGE_ROAR_TALENT.id} thresholds={thresholds.savageRoarUptime} />
)}
<Requirement
name={(
<>
<SpellLink id={SPELLS.FEROCIOUS_BITE.id} /> damage bonus from energy
</>
)}
thresholds={thresholds.ferociousBiteEnergy}
tooltip="Ferocious Bite consumes up to 50 energy, and should always be given that full 50 energy to significantly increase its damage."
/>
{combatant.hasTalent(SPELLS.SABERTOOTH_TALENT.id) && (
<Requirement
name={(
<>
<SpellLink id={SPELLS.RIP.id} /> which should have been <SpellLink id={SPELLS.FEROCIOUS_BITE.id} />
</>
)}
thresholds={thresholds.ripShouldBeBite}
tooltip="With the Sabertooth talent you can maintain your Rip by using Ferocious Bite. If you instead cast Rip you are missing out on the Ferocious Bite damage. If the replacement Rip has a better snapshot then it may have been worth using, so those cases are not counted here."
/>
)}
<Requirement
name={(
<>
<SpellLink id={SPELLS.RIP.id} /> casts which reduced duration
</>
)}
thresholds={thresholds.ripDurationReduction}
tooltip="Because Rip's duration is based on combo points used it is possible to reduce the duration of your existing bleed by reapplying it with low combo points. Not only is this a waste of resources but you're doing less damage than you would if you'd done nothing at all."
/>
<Requirement
name={(
<>
Needless low combo point finishers
</>
)}
thresholds={thresholds.badLowComboFinishers}
tooltip="Your finishers are most efficient when used with full combo points. However it is still worth using a low combo point Rip if it's not yet up on a target (this exception is detected and taken into account when calculating this metric.)"
/>
</Rule>
{/* Manage your energy
🗵 Don't cap energy
🗵 Don't waste energy from Tiger's Fury
☐ Some kind of check for good pooling behaviour (having high energy when using a finisher is generally good, but would benefit from some research to quantify that effect.)
Switch out the whole rule section if we can detect that the player was in a situation where energy was abundant.
*/}
{!thresholds.tigersFuryIgnoreEnergy && (
<Rule
name="Manage your energy"
description={(
<>
Your actions are <TooltipElement content="Notable exceptions are when you have the Predator talent with enemies regularly dying, or large AoE situations with certain builds.">usually</TooltipElement> limited by available energy so managing it well is important. Don't let it reach the cap and miss out on regeneration, and avoid wasting generated energy from <SpellLink id={SPELLS.TIGERS_FURY.id} />. Allowing your energy to "pool" before using a finisher is often <TooltipElement content="Using a finisher when at low energy leaves you with little of both your main resources which greatly limits your options. Pooling energy first means you'll have energy left over to react to whatever happens in the fight around you. Although pooling is useful never let your uptime of DoTs and Savage Roar drop because of it.">beneficial</TooltipElement>.
</>
)}
>
<Requirement
name={(
<>
Wasted natural regeneration from being capped
</>
)}
thresholds={thresholds.energyCapped}
tooltip="Some waste during Berserk or Incarnation (especially with Bloodlust active) is not a concern. If the fight mechanics force you to not attack for periods of time then capping energy is inevitable. Please use your knowledge of the fight when weighing the importance of this metric."
/>
<Requirement
name={(
<>
Wasted energy from <SpellLink id={SPELLS.TIGERS_FURY.id} />
</>
)}
thresholds={thresholds.tigersFuryEnergy}
tooltip="There are some situations where energy is very abundant and the energy gain from Tiger's Fury becomes unimportant, but that is rare in boss fights. Generally you should aim to use Tiger's Fury both for its energy and damage increase."
/>
</Rule>
)}
{thresholds.tigersFuryIgnoreEnergy && combatant.hasTalent(SPELLS.PREDATOR_TALENT.id) && (
<Rule
name="Manage your energy"
description={(
<>
Normally your actions are limited by available energy. In this fight you made good use of <SpellLink id={SPELLS.PREDATOR_TALENT.id} /> to allow extra <SpellLink id={SPELLS.TIGERS_FURY.id} /> which makes the usual measures of energy management much less important.
</>
)}
>
<Requirement
name={(
<>
Additional <SpellLink id={SPELLS.TIGERS_FURY.id} /> from <SpellLink id={SPELLS.PREDATOR_TALENT.id} /> per minute
</>
)}
thresholds={thresholds.predatorWrongTalent}
/>
</Rule>
)}
{/*Use your cooldowns
🗵 Cast efficiency of Berserk or Incarnation (depending on talent)
☐ Make the most of Berserk/Incarnation by using as many abilities as possible during the buff (importance of this may be so low that it's not worth checking - run some simulations to find out)
🗵 Cast efficiency of Tiger's Fury
🗵 Shadowmeld for Night Elves: cast efficiency of correctly using it to buff Rake
*/}
<Rule
name="Use your cooldowns"
description={(
<>
Aim to use your cooldowns as often as possible, try to get prepared to use the ability when you see it's nearly ready. <SpellLink id={SPELLS.BERSERK.id} /> (or <SpellLink id={SPELLS.INCARNATION_KING_OF_THE_JUNGLE_TALENT.id} />) should be used when you have plenty of energy so that you get the most effect from its cost reduction. Make sure you don't cap energy when using <SpellLink id={SPELLS.TIGERS_FURY.id} />, but still use it as often as possible. Slightly delaying one so it lines up with the other can be beneficial, but avoid delaying so much that you'd miss out on an extra use during the fight.
</>
)}
>
{!combatant.hasTalent(SPELLS.INCARNATION_KING_OF_THE_JUNGLE_TALENT.id) && (
<CastEfficiencyRequirement spell={SPELLS.BERSERK.id} />
)}
{combatant.hasTalent(SPELLS.INCARNATION_KING_OF_THE_JUNGLE_TALENT.id) && (
<CastEfficiencyRequirement spell={SPELLS.INCARNATION_KING_OF_THE_JUNGLE_TALENT.id} />
)}
<CastEfficiencyRequirement spell={SPELLS.TIGERS_FURY.id} />
{combatant.race === RACES.NightElf && (
<Requirement
name={<SpellLink id={SPELLS.SHADOWMELD.id} />}
thresholds={thresholds.shadowmeld}
tooltip="This measures how many of the possible uses of Shadowmeld were used to provide the double damage bonus to Rake."
/>
)}
</Rule>
{/*Manage Snapshots
🗵 Only refresh a Moonfire (if talented) before pandemic if the new one is stronger
🗵 Only refresh a Rake before pandemic if the new one is stronger
🗵 Only refresh a Rip before pandemic if the new one is stronger
🗵 Don't end a Prowl-empowered Rake early by refreshing without that empowerment
*/}
<Rule
name="Make the most of snapshots"
description={(
<>
<TooltipElement content="Tiger's Fury affects all DoTs, Bloodtalons affects all except Moonfire.">Certain buffs</TooltipElement> will increase the damage of your DoTs for their full duration, even after the buff wears off. Making the most of this mechanic can be the difference between good and great results.<br />
As a general rule it's beneficial to refresh a DoT early if you would increase the snapshot. It's better to refresh with a weaker version of the DoT during the <TooltipElement content="The last 30% of the DoT's duration. If you refresh during this time you don't lose any duration in the process.">pandemic window</TooltipElement> than to let it wear off. The exception is <SpellLink id={SPELLS.RAKE.id} /> empowered by <TooltipElement content="The effect is also provided by Incarnation: King of the Jungle, and Shadowmeld for Night Elves">Prowl</TooltipElement> which is so much stronger that you should wait until the DoT wears off when replacing it with an unbuffed version.<br />
<SpellLink id={SPELLS.SABERTOOTH_TALENT.id} /> allows you to use <SpellLink id={SPELLS.FEROCIOUS_BITE.id} /> to maintain the existing snapshot on <SpellLink id={SPELLS.RIP.id} /> and should be used to do so.
</>
)}
>
{combatant.hasTalent(SPELLS.LUNAR_INSPIRATION_TALENT.id) && (
<SnapshotDowngradeRequirement spell={SPELLS.MOONFIRE_FERAL.id} thresholds={thresholds.moonfireDowngrade} />
)}
<SnapshotDowngradeRequirement spell={SPELLS.RAKE.id} thresholds={thresholds.rakeDowngrade} />
<SnapshotDowngradeRequirement spell={SPELLS.RIP.id} thresholds={thresholds.ripDowngrade} />
<Requirement
name={(
<>
Average seconds of Prowl-buffed <SpellLink id={SPELLS.RAKE.id} /> lost by refreshing early
</>
)}
thresholds={thresholds.rakeProwlDowngrade}
/>
</Rule>
{/*Manage Bloodtalons - whole section is only if talent is taken
🗵 Use Predatory Swiftness to generate charges
🗵 Don't waste charges by overwriting
☐ Prioritize using charges on Rip and Rake
*/}
{combatant.hasTalent(SPELLS.BLOODTALONS_TALENT.id) && (
<Rule
name="Weave in Bloodtalons"
description={(
<>
Taking the <SpellLink id={SPELLS.BLOODTALONS_TALENT.id} /> talent adds an extra set of mechanics to weave into your rotation. You should use every <SpellLink id={SPELLS.PREDATORY_SWIFTNESS.id} /> proc to generate <SpellLink id={SPELLS.BLOODTALONS_TALENT.id} /> charges, which you then spend to buff attacks. Aim to always have the buff active on <SpellLink id={SPELLS.RIP.id} /> and <SpellLink id={SPELLS.RAKE.id} />. Depending on your other talent choices and the number of targets you'll usually have access to more charges than needed to keep those two DoTs buffed, use the rest to buff other high damage attacks such as <SpellLink id={SPELLS.BRUTAL_SLASH_TALENT.id} />. Choose the right time to cast <SpellLink id={SPELLS.REGROWTH.id} /> or <SpellLink id={SPELLS.ENTANGLING_ROOTS.id} /> and generate charges, usually the best time is when you reach 4 or 5 combo points so <SpellLink id={SPELLS.BLOODTALONS_TALENT.id} /> is active for your finisher.
</>
)}
>
<Requirement
name={(
<>
<SpellLink id={SPELLS.PREDATORY_SWIFTNESS.id} /> wasted
</>
)}
thresholds={thresholds.predatorySwiftnessWasted}
/>
<Requirement
name={(
<>
<SpellLink id={SPELLS.BLOODTALONS_TALENT.id} /> wasted
</>
)}
thresholds={thresholds.bloodtalonsWasted}
tooltip="Using Bloodtalons to buff any ability counts as it not being wasted. See the statistics results section for details on how those charges were used."
/>
</Rule>
)}
{/*Pick the right talents (if player is using talents that may be unsuitable)
🗵 Only use Predator if it's allowing you to reset Tiger's Fury by killing adds
*/}
{(combatant.hasTalent(SPELLS.PREDATOR_TALENT.id)) && (
<Rule
name="Pick the most suitable Talents"
description={(
<>
The <SpellLink id={SPELLS.PREDATOR_TALENT.id} /> talent is generally only effective on fights with multiple enemies and should be swapped out for single target encounters.
</>
)}
>
{combatant.hasTalent(SPELLS.PREDATOR_TALENT.id) && (
<Requirement
name={(
<>
Additional <SpellLink id={SPELLS.TIGERS_FURY.id} /> from <SpellLink id={SPELLS.PREDATOR_TALENT.id} />
</>
)}
thresholds={thresholds.predatorWrongTalent}
/>
)}
</Rule>
)}
{/*Be prepared
🗵 Universal rules for using potions, enchants, etc.
*/}
<PreparationRule thresholds={thresholds} />
</Checklist>
);
};
FeralDruidChecklist.propTypes = {
castEfficiency: PropTypes.object.isRequired,
combatant: PropTypes.shape({
hasTalent: PropTypes.func.isRequired,
hasTrinket: PropTypes.func.isRequired,
race: PropTypes.any,
}).isRequired,
thresholds: PropTypes.object.isRequired,
};
export default FeralDruidChecklist;
|
ajax/libs/angular.js/2.0.0-alpha.39/http.min.js | x112358/cdnjs | "use strict";var Reflect;!function(e){function t(e,t,r,n){if(w(n)){if(w(r)){if(!j(e))throw new TypeError;if(!C(t))throw new TypeError;return p(e,t)}if(!j(e))throw new TypeError;if(!S(t))throw new TypeError;return r=R(r),d(e,t,r)}if(!j(e))throw new TypeError;if(!S(t))throw new TypeError;if(w(r))throw new TypeError;if(!S(n))throw new TypeError;return r=R(r),f(e,t,r,n)}function r(e,t){function r(r,n){if(w(n)){if(!C(r))throw new TypeError;_(e,t,r,void 0)}else{if(!S(r))throw new TypeError;n=R(n),_(e,t,r,n)}}return r}function n(e,t,r,n){if(!S(r))throw new TypeError;return w(n)||(n=R(n)),_(e,t,r,n)}function i(e,t,r){if(!S(t))throw new TypeError;return w(r)||(r=R(r)),g(e,t,r)}function o(e,t,r){if(!S(t))throw new TypeError;return w(r)||(r=R(r)),v(e,t,r)}function a(e,t,r){if(!S(t))throw new TypeError;return w(r)||(r=R(r)),y(e,t,r)}function s(e,t,r){if(!S(t))throw new TypeError;return w(r)||(r=R(r)),m(e,t,r)}function c(e,t){if(!S(e))throw new TypeError;return w(t)||(t=R(t)),b(e,t)}function u(e,t){if(!S(e))throw new TypeError;return w(t)||(t=R(t)),x(e,t)}function l(e,t,r){if(!S(t))throw new TypeError;w(r)||(r=R(r));var n=h(t,r,!1);if(w(n))return!1;if(!n["delete"](e))return!1;if(n.size>0)return!0;var i=N.get(t);return i["delete"](r),i.size>0?!0:(N["delete"](t),!0)}function p(e,t){for(var r=e.length-1;r>=0;--r){var n=e[r],i=n(t);if(!w(i)){if(!C(i))throw new TypeError;t=i}}return t}function f(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=e[i],a=o(t,r,n);if(!w(a)){if(!S(a))throw new TypeError;n=a}}return n}function d(e,t,r){for(var n=e.length-1;n>=0;--n){var i=e[n];i(t,r)}}function h(e,t,r){var n=N.get(e);if(!n){if(!r)return void 0;n=new k,N.set(e,n)}var i=n.get(t);if(!i){if(!r)return void 0;i=new k,n.set(t,i)}return i}function g(e,t,r){var n=v(e,t,r);if(n)return!0;var i=O(t);return null!==i?g(e,i,r):!1}function v(e,t,r){var n=h(t,r,!1);return void 0===n?!1:Boolean(n.has(e))}function y(e,t,r){var n=v(e,t,r);if(n)return m(e,t,r);var i=O(t);return null!==i?y(e,i,r):void 0}function m(e,t,r){var n=h(t,r,!1);return void 0===n?void 0:n.get(e)}function _(e,t,r,n){var i=h(r,n,!0);i.set(e,t)}function b(e,t){var r=x(e,t),n=O(e);if(null===n)return r;var i=b(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new M,a=[],s=0;s<r.length;s++){var c=r[s],u=o.has(c);u||(o.add(c),a.push(c))}for(var l=0;l<i.length;l++){var c=i[l],u=o.has(c);u||(o.add(c),a.push(c))}return a}function x(e,t){var r=h(e,t,!1),n=[];return r&&r.forEach(function(e,t){return n.push(t)}),n}function w(e){return void 0===e}function j(e){return Array.isArray(e)}function S(e){return"object"==typeof e?null!==e:"function"==typeof e}function C(e){return"function"==typeof e}function E(e){return"symbol"==typeof e}function R(e){return E(e)?e:String(e)}function O(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===T)return t;if(t!==T)return t;var r=e.prototype,n=Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i?t:i===e?t:i}function P(){function e(){this._keys=[],this._values=[],this._cache=t}var t={};return e.prototype={get size(){return this._keys.length},has:function(e){return e===this._cache?!0:this._find(e)>=0?(this._cache=e,!0):!1},get:function(e){var t=this._find(e);return t>=0?(this._cache=e,this._values[t]):void 0},set:function(e,t){return this["delete"](e),this._keys.push(e),this._values.push(t),this._cache=e,this},"delete":function(e){var r=this._find(e);return r>=0?(this._keys.splice(r,1),this._values.splice(r,1),this._cache=t,!0):!1},clear:function(){this._keys.length=0,this._values.length=0,this._cache=t},forEach:function(e,t){for(var r=this.size,n=0;r>n;++n){var i=this._keys[n],o=this._values[n];this._cache=i,e.call(this,o,i,this)}},_find:function(e){for(var t=this._keys,r=t.length,n=0;r>n;++n)if(t[n]===e)return n;return-1}},e}function I(){function e(){this._map=new k}return e.prototype={get size(){return this._map.length},has:function(e){return this._map.has(e)},add:function(e){return this._map.set(e,e),this},"delete":function(e){return this._map["delete"](e)},clear:function(){this._map.clear()},forEach:function(e,t){this._map.forEach(e,t)}},e}function D(){function e(){this._key=i()}function t(e,t){for(var r=0;t>r;++r)e[r]=255*Math.random()|0}function r(e){if(c){var r=c.randomBytes(e);return r}if("function"==typeof Uint8Array){var r=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(r):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(r):t(r,e),r}var r=new Array(e);return t(r,e),r}function n(){var e=r(a);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",n=0;a>n;++n){var i=e[n];(4===n||6===n||8===n)&&(t+="-"),16>i&&(t+="0"),t+=i.toString(16).toLowerCase()}return t}function i(){var e;do e="@@WeakMap@@"+n();while(u.call(l,e));return l[e]=!0,e}function o(e,t){if(!u.call(e,p)){if(!t)return void 0;Object.defineProperty(e,p,{value:Object.create(null)})}return e[p]}var a=16,s="undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process),c=s&&require("crypto"),u=Object.prototype.hasOwnProperty,l={},p=i();return e.prototype={has:function(e){var t=o(e,!1);return t?this._key in t:!1},get:function(e){var t=o(e,!1);return t?t[this._key]:void 0},set:function(e,t){var r=o(e,!0);return r[this._key]=t,this},"delete":function(e){var t=o(e,!1);return t&&this._key in t?delete t[this._key]:!1},clear:function(){this._key=i()}},e}var T=Object.getPrototypeOf(Function),k="function"==typeof Map?Map:P(),M="function"==typeof Set?Set:I(),A="function"==typeof WeakMap?WeakMap:D(),N=new A;e.decorate=t,e.metadata=r,e.defineMetadata=n,e.hasMetadata=i,e.hasOwnMetadata=o,e.getMetadata=a,e.getOwnMetadata=s,e.getMetadataKeys=c,e.getOwnMetadataKeys=u,e.deleteMetadata=l,function(t){if("undefined"!=typeof t.Reflect){if(t.Reflect!==e)for(var r in e)t.Reflect[r]=e[r]}else t.Reflect=e}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:"undefined"!=typeof global?global:Function("return this;")())}(Reflect||(Reflect={})),System.register("angular2/src/core/facade/lang",[],!0,function(e,t,r){function n(e){return e.name}function i(){return k}function o(e){return e}function a(){return function(e){return e}}function s(e){return void 0!==e&&null!==e}function c(e){return void 0===e||null===e}function u(e){return"string"==typeof e}function l(e){return"function"==typeof e}function p(e){return l(e)}function f(e){return"object"==typeof e&&null!==e}function d(e){return e instanceof T.Promise}function h(e){return Array.isArray(e)}function g(e){return"number"==typeof e}function v(e){return e instanceof t.Date&&!isNaN(e.valueOf())}function y(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function m(e){return e}function _(e,t){return e}function b(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function x(e){return e}function w(e){return c(e)?null:e}function j(e){return c(e)?!1:e}function S(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function C(e){console.log(e)}function E(e,t,r){for(var n=t.split("."),i=e;n.length>1;){var o=n.shift();i=i.hasOwnProperty(o)?i[o]:i[o]={}}(void 0===i||null===i)&&(i={}),i[n.shift()]=r}function R(){if(c(H))if(s(Symbol)&&s(Symbol.iterator))H=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(H=r)}return H}var O=System.global,P=O.define;O.define=void 0;var I,D=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};I="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:O:window;var T=I;t.global=T,t.Type=Function,t.getTypeNameForDebugging=n,t.Math=T.Math,t.Date=T.Date;var k="undefined"!=typeof T.assert;t.assertionsEnabled=i,T.assert=function(e){k&&T.assert.call(e)},t.CONST_EXPR=o,t.CONST=a,t.isPresent=s,t.isBlank=c,t.isString=u,t.isFunction=l,t.isType=p,t.isStringMap=f,t.isPromise=d,t.isArray=h,t.isNumber=g,t.isDate=v,t.stringify=y,t.serializeEnum=m,t.deserializeEnum=_;var M=function(){function e(){}return e.fromCharCode=function(e){return String.fromCharCode(e)},e.charCodeAt=function(e,t){return e.charCodeAt(t)},e.split=function(e,t){return e.split(t)},e.equals=function(e,t){return e===t},e.replace=function(e,t,r){return e.replace(t,r)},e.replaceAll=function(e,t,r){return e.replace(t,r)},e.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},e.toUpperCase=function(e){return e.toUpperCase()},e.toLowerCase=function(e){return e.toLowerCase()},e.startsWith=function(e,t){return e.startsWith(t)},e.substring=function(e,t,r){return void 0===r&&(r=null),e.substring(t,null===r?void 0:r)},e.replaceAllMapped=function(e,t,r){return e.replace(t,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return e.splice(-2,2),r(e)})},e.contains=function(e,t){return-1!=e.indexOf(t)},e.compare=function(e,t){return t>e?-1:e>t?1:0},e}();t.StringWrapper=M;var A=function(){function e(e){void 0===e&&(e=[]),this.parts=e}return e.prototype.add=function(e){this.parts.push(e)},e.prototype.toString=function(){return this.parts.join("")},e}();t.StringJoiner=A;var N=function(e){function t(t){e.call(this,t),this.message=t}return D(t,e),t.prototype.toString=function(){return this.message},t}(Error);t.NumberParseError=N;var V=function(){function e(){}return e.toFixed=function(e,t){return e.toFixed(t)},e.equal=function(e,t){return e===t},e.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new N("Invalid integer literal when parsing "+e);return t},e.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new N("Invalid integer literal when parsing "+e+" in base "+t)},e.parseFloat=function(e){return parseFloat(e)},Object.defineProperty(e,"NaN",{get:function(){return 0/0},enumerable:!0,configurable:!0}),e.isNaN=function(e){return isNaN(e)},e.isInteger=function(e){return Number.isInteger(e)},e}();t.NumberWrapper=V,t.RegExp=T.RegExp;var B=function(){function e(){}return e.create=function(e,t){return void 0===t&&(t=""),t=t.replace(/g/g,""),new T.RegExp(e,t+"g")},e.firstMatch=function(e,t){return e.lastIndex=0,e.exec(t)},e.test=function(e,t){return e.lastIndex=0,e.test(t)},e.matcher=function(e,t){return e.lastIndex=0,{re:e,input:t}},e}();t.RegExpWrapper=B;var L=function(){function e(){}return e.next=function(e){return e.re.exec(e.input)},e}();t.RegExpMatcherWrapper=L;var F=function(){function e(){}return e.apply=function(e,t){return e.apply(null,t)},e}();t.FunctionWrapper=F,t.looseIdentical=b,t.getMapKey=x,t.normalizeBlank=w,t.normalizeBool=j,t.isJsObject=S,t.print=C;var W=function(){function e(){}return e.parse=function(e){return T.JSON.parse(e)},e.stringify=function(e){return T.JSON.stringify(e,null,2)},e}();t.Json=W;var U=function(){function e(){}return e.create=function(e,r,n,i,o,a,s){return void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),new t.Date(e,r-1,n,i,o,a,s)},e.fromMillis=function(e){return new t.Date(e)},e.toMillis=function(e){return e.getTime()},e.now=function(){return new t.Date},e.toJson=function(e){return e.toJSON()},e}();t.DateWrapper=U,t.setValueOnPath=E;var H=null;return t.getSymbolIterator=R,O.define=P,r.exports}),System.register("angular2/src/core/di/metadata",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=function(){function e(e){this.token=e}return e.prototype.toString=function(){return"@Inject("+s.stringify(this.token)+")"},e=o([s.CONST(),a("design:paramtypes",[Object])],e)}();t.InjectMetadata=c;var u=function(){function e(){}return e.prototype.toString=function(){return"@Optional()"},e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.OptionalMetadata=u;var l=function(){function e(){}return Object.defineProperty(e.prototype,"token",{get:function(){return null},enumerable:!0,configurable:!0}),e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.DependencyMetadata=l;var p=function(){function e(){}return e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.InjectableMetadata=p;var f=function(){function e(){}return e.prototype.toString=function(){return"@Self()"},e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.SelfMetadata=f;var d=function(){function e(){}return e.prototype.toString=function(){return"@SkipSelf()"},e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.SkipSelfMetadata=d;var h=function(){function e(){}return e.prototype.toString=function(){return"@Host()"},e=o([s.CONST(),a("design:paramtypes",[])],e)}();return t.HostMetadata=h,n.define=i,r.exports}),System.register("angular2/src/core/util/decorators",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return p.isFunction(e)&&e.hasOwnProperty("annotation")&&(e=e.annotation),e}function i(e,t){if(e===Object||e===String||e===Function||e===Number||e===Array)throw new Error("Can not use native "+p.stringify(e)+" as constructor");if(p.isFunction(e))return e;if(e instanceof Array){var r=e,i=e[e.length-1];if(!p.isFunction(i))throw new Error("Last position of Class method array must be Function in key "+t+" was '"+p.stringify(i)+"'");var o=r.length-1;if(o!=i.length)throw new Error("Number of annotations ("+o+") does not match number of arguments ("+i.length+") in the function: "+p.stringify(i));for(var a=[],s=0,c=r.length-1;c>s;s++){var u=[];a.push(u);var l=r[s];if(l instanceof Array)for(var d=0;d<l.length;d++)u.push(n(l[d]));else u.push(p.isFunction(l)?n(l):l)}return f.defineMetadata("parameters",a,i),i}throw new Error("Only Function or Array is supported in Class definition for key '"+t+"' is '"+p.stringify(e)+"'")}function o(e){var t=i(e.hasOwnProperty("constructor")?e.constructor:void 0,"constructor"),r=t.prototype;if(e.hasOwnProperty("extends")){if(!p.isFunction(e["extends"]))throw new Error("Class definition 'extends' property must be a constructor function was: "+p.stringify(e["extends"]));t.prototype=r=Object.create(e["extends"].prototype)}for(var n in e)"extends"!=n&&"prototype"!=n&&e.hasOwnProperty(n)&&(r[n]=i(e[n],n));return this&&this.annotations instanceof Array&&f.defineMetadata("annotations",this.annotations,t),t}function a(e,t){function r(r){var n=new e(r);if(this instanceof e)return n;var i=p.isFunction(this)&&this.annotations instanceof Array?this.annotations:[];i.push(n);var a=function(e){var t=f.getOwnMetadata("annotations",e);return t=t||[],t.push(n),f.defineMetadata("annotations",t,e),e};return a.annotations=i,a.Class=o,t&&t(a),a}return void 0===t&&(t=null),r.prototype=Object.create(e.prototype),r}function s(e){function t(){function t(e,t,r){var n=f.getMetadata("parameters",e);for(n=n||[];n.length<=r;)n.push(null);n[r]=n[r]||[];var o=n[r];return o.push(i),f.defineMetadata("parameters",n,e),e}for(var r=[],n=0;n<arguments.length;n++)r[n-0]=arguments[n];var i=Object.create(e.prototype);return e.apply(i,r),this instanceof e?i:(t.annotation=i,t)}return t.prototype=Object.create(e.prototype),t}function c(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];var n=Object.create(e.prototype);return e.apply(n,t),this instanceof e?n:function(e,t){var r=f.getOwnMetadata("propMetadata",e.constructor);r=r||{},r[t]=r[t]||[],r[t].unshift(n),f.defineMetadata("propMetadata",r,e.constructor)}}return t.prototype=Object.create(e.prototype),t}var u=System.global,l=u.define;u.define=void 0;var p=e("angular2/src/core/facade/lang");t.Class=o;var f=p.global.Reflect;if(!f||!f.getMetadata)throw"reflect-metadata shim is required when using class decorators";return t.makeDecorator=a,t.makeParamDecorator=s,t.makePropDecorator=c,u.define=l,r.exports}),System.register("angular2/src/core/di/forward_ref",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return e.__forward_ref__=n,e.toString=function(){return s.stringify(this())},e}function i(e){return s.isFunction(e)&&e.hasOwnProperty("__forward_ref__")&&e.__forward_ref__===n?e():e}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang");return t.forwardRef=n,t.resolveForwardRef=i,o.define=a,r.exports}),System.register("angular2/src/core/facade/collection",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return s.isJsObject(e)?s.isArray(e)||!(e instanceof t.Map)&&s.getSymbolIterator()in e:!1}function i(e,t){if(s.isArray(e))for(var r=0;r<e.length;r++)t(e[r]);else for(var n,i=e[s.getSymbolIterator()]();!(n=i.next()).done;)t(n.value)}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang");t.Map=s.global.Map,t.Set=s.global.Set;var c=function(){try{if(1===new t.Map([[1,2]]).size)return function(e){return new t.Map(e)}}catch(e){}return function(e){for(var r=new t.Map,n=0;n<e.length;n++){var i=e[n];r.set(i[0],i[1])}return r}}(),u=function(){try{if(new t.Map(new t.Map))return function(e){return new t.Map(e)}}catch(e){}return function(e){var r=new t.Map;return e.forEach(function(e,t){r.set(t,e)}),r}}(),l=function(){return(new t.Map).keys().next?function(e){for(var t,r=e.keys();!(t=r.next()).done;)e.set(t.value,null)}:function(e){e.forEach(function(t,r){e.set(r,null)})}}(),p=function(){try{if((new t.Map).values().next)return function(e,t){return Array.from(t?e.values():e.keys())}}catch(e){}return function(e,t){var r=h.createFixedSize(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),f=function(){function e(){}return e.clone=function(e){return u(e)},e.createFromStringMap=function(e){var r=new t.Map;for(var n in e)r.set(n,e[n]);return r},e.toStringMap=function(e){var t={};return e.forEach(function(e,r){return t[r]=e}),t},e.createFromPairs=function(e){return c(e)},e.forEach=function(e,t){e.forEach(t)},e.get=function(e,t){return e.get(t)},e.size=function(e){return e.size},e["delete"]=function(e,t){e["delete"](t)},e.clearValues=function(e){l(e)},e.iterable=function(e){return e},e.keys=function(e){return p(e,!1)},e.values=function(e){return p(e,!0)},e}();t.MapWrapper=f;var d=function(){function e(){}return e.create=function(){return{}},e.contains=function(e,t){return e.hasOwnProperty(t)},e.get=function(e,t){return e.hasOwnProperty(t)?e[t]:void 0},e.set=function(e,t,r){e[t]=r},e.keys=function(e){return Object.keys(e)},e.isEmpty=function(e){for(var t in e)return!1;return!0},e["delete"]=function(e,t){delete e[t]},e.forEach=function(e,t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},e.merge=function(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},e.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i,o=0;o<r.length;o++)if(i=r[o],e[i]!==t[i])return!1;return!0},e}();t.StringMapWrapper=d;var h=function(){function e(){}return e.createFixedSize=function(e){return new Array(e)},e.createGrowableSize=function(e){return new Array(e)},e.clone=function(e){return e.slice(0)},e.map=function(e,t){return e.map(t)},e.forEach=function(e,t){for(var r=0;r<e.length;r++)t(e[r])},e.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},e.first=function(e){return e?e[0]:null},e.last=function(e){return e&&0!=e.length?e[e.length-1]:null},e.find=function(e,t){for(var r=0;r<e.length;++r)if(t(e[r]))return e[r];return null},e.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},e.reduce=function(e,t,r){return e.reduce(t,r)},e.filter=function(e,t){return e.filter(t)},e.any=function(e,t){for(var r=0;r<e.length;++r)if(t(e[r]))return!0;return!1},e.contains=function(e,t){return-1!==e.indexOf(t)},e.reversed=function(t){var r=e.clone(t);return r.reverse()},e.concat=function(e,t){return e.concat(t)},e.insert=function(e,t,r){e.splice(t,0,r)},e.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},e.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},e.removeLast=function(e){return e.pop()},e.remove=function(e,t){var r=e.indexOf(t);return r>-1?(e.splice(r,1),!0):!1},e.clear=function(e){e.length=0},e.join=function(e,t){return e.join(t)},e.isEmpty=function(e){return 0==e.length},e.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},e.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},e.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},e.splice=function(e,t,r){return e.splice(t,r)},e.sort=function(e,t){s.isPresent(t)?e.sort(t):e.sort()},e.toString=function(e){return e.toString()},e.toJSON=function(e){return JSON.stringify(e)},e.maximum=function(e,t){if(0==e.length)return null;for(var r=null,n=-(1/0),i=0;i<e.length;i++){var o=e[i];if(!s.isBlank(o)){var a=t(o);a>n&&(r=o,n=a)}}return r},e}();t.ListWrapper=h,t.isListLikeIterable=n,t.iterateListLike=i;var g=function(){var e=new t.Set([1,2,3]);return 3===e.size?function(e){return new t.Set(e)}:function(e){var r=new t.Set(e);if(r.size!==e.length)for(var n=0;n<e.length;n++)r.add(e[n]);return r}}(),v=function(){function e(){}return e.createFromList=function(e){return g(e)},e.has=function(e,t){return e.has(t)},e["delete"]=function(e,t){e["delete"](t)},e}();return t.SetWrapper=v,o.define=a,r.exports}),System.register("angular2/src/core/facade/exception_handler",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=function(){function e(){this.res=[]}return e.prototype.log=function(e){this.res.push(e)},e.prototype.logError=function(e){this.res.push(e)},e.prototype.logGroup=function(e){this.res.push(e)},e.prototype.logGroupEnd=function(){},e}(),u=function(){function e(e,t){void 0===t&&(t=!0),this._logger=e,this._rethrowException=t}return e.exceptionToString=function(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var i=new c,o=new e(i,!1);return o.call(t,r,n),i.res.join("\n")},e.prototype.call=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=this._findOriginalException(e),i=this._findOriginalStack(e),a=this._findContext(e);if(this._logger.logGroup("EXCEPTION: "+this._extractMessage(e)),o.isPresent(t)&&o.isBlank(i)&&(this._logger.logError("STACKTRACE:"),this._logger.logError(this._longStackTrace(t))),o.isPresent(r)&&this._logger.logError("REASON: "+r),o.isPresent(n)&&this._logger.logError("ORIGINAL EXCEPTION: "+this._extractMessage(n)),o.isPresent(i)&&(this._logger.logError("ORIGINAL STACKTRACE:"),this._logger.logError(this._longStackTrace(i))),o.isPresent(a)&&(this._logger.logError("ERROR CONTEXT:"),this._logger.logError(a)),this._logger.logGroupEnd(),this._rethrowException)throw e},e.prototype._extractMessage=function(e){return e instanceof a.WrappedException?e.wrapperMessage:e.toString()},e.prototype._longStackTrace=function(e){return s.isListLikeIterable(e)?e.join("\n\n-----async gap-----\n"):e.toString()},e.prototype._findContext=function(e){try{return e instanceof a.WrappedException?o.isPresent(e.context)?e.context:this._findContext(e.originalException):null}catch(t){return null}},e.prototype._findOriginalException=function(e){if(!(e instanceof a.WrappedException))return null;for(var t=e.originalException;t instanceof a.WrappedException&&o.isPresent(t.originalException);)t=t.originalException;return t},e.prototype._findOriginalStack=function(e){if(!(e instanceof a.WrappedException))return null;for(var t=e,r=e.originalStack;t instanceof a.WrappedException&&o.isPresent(t.originalException);)t=t.originalException,t instanceof a.WrappedException&&o.isPresent(t.originalException)&&(r=t.originalStack);return r},e}();return t.ExceptionHandler=u,n.define=i,r.exports}),System.register("angular2/src/core/reflection/reflector",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection"],!0,function(e,t,r){function n(e,t){c.StringMapWrapper.forEach(t,function(t,r){return e.set(r,t)})}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/exceptions"),c=e("angular2/src/core/facade/collection"),u=function(){function e(e,t,r,n,i){this.annotations=e,this.parameters=t,this.factory=r,this.interfaces=n,this.propMetadata=i}return e}();t.ReflectionInfo=u;var l=function(){function e(e){this._injectableInfo=new c.Map,this._getters=new c.Map,this._setters=new c.Map,this._methods=new c.Map,this._usedKeys=null,this.reflectionCapabilities=e}return e.prototype.isReflectionEnabled=function(){return this.reflectionCapabilities.isReflectionEnabled()},e.prototype.trackUsage=function(){this._usedKeys=new c.Set},e.prototype.listUnusedKeys=function(){var e=this;if(null==this._usedKeys)throw new s.BaseException("Usage tracking is disabled");var t=c.MapWrapper.keys(this._injectableInfo);return c.ListWrapper.filter(t,function(t){return!c.SetWrapper.has(e._usedKeys,t)})},e.prototype.registerFunction=function(e,t){this._injectableInfo.set(e,t)},e.prototype.registerType=function(e,t){this._injectableInfo.set(e,t)},e.prototype.registerGetters=function(e){n(this._getters,e)},e.prototype.registerSetters=function(e){n(this._setters,e)},e.prototype.registerMethods=function(e){n(this._methods,e)},e.prototype.factory=function(e){if(this._containsReflectionInfo(e)){var t=this._getReflectionInfo(e).factory;return a.isPresent(t)?t:null}return this.reflectionCapabilities.factory(e)},e.prototype.parameters=function(e){if(this._injectableInfo.has(e)){var t=this._getReflectionInfo(e).parameters;return a.isPresent(t)?t:[]}return this.reflectionCapabilities.parameters(e)},e.prototype.annotations=function(e){if(this._injectableInfo.has(e)){var t=this._getReflectionInfo(e).annotations;return a.isPresent(t)?t:[]}return this.reflectionCapabilities.annotations(e)},e.prototype.propMetadata=function(e){if(this._injectableInfo.has(e)){var t=this._getReflectionInfo(e).propMetadata;return a.isPresent(t)?t:{}}return this.reflectionCapabilities.propMetadata(e)},e.prototype.interfaces=function(e){if(this._injectableInfo.has(e)){var t=this._getReflectionInfo(e).interfaces;return a.isPresent(t)?t:[]}return this.reflectionCapabilities.interfaces(e)},e.prototype.getter=function(e){return this._getters.has(e)?this._getters.get(e):this.reflectionCapabilities.getter(e)},e.prototype.setter=function(e){return this._setters.has(e)?this._setters.get(e):this.reflectionCapabilities.setter(e)},e.prototype.method=function(e){return this._methods.has(e)?this._methods.get(e):this.reflectionCapabilities.method(e)},e.prototype._getReflectionInfo=function(e){return a.isPresent(this._usedKeys)&&this._usedKeys.add(e),this._injectableInfo.get(e)},e.prototype._containsReflectionInfo=function(e){return this._injectableInfo.has(e)},e.prototype.importUri=function(e){return this.reflectionCapabilities.importUri(e)},e}();return t.Reflector=l,i.define=o,r.exports}),System.register("angular2/src/core/reflection/reflection_capabilities",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=function(){function e(e){this._reflect=o.isPresent(e)?e:o.global.Reflect}return e.prototype.isReflectionEnabled=function(){return!0},e.prototype.factory=function(e){switch(e.length){case 0:return function(){return new e};case 1:return function(t){return new e(t)};case 2:return function(t,r){return new e(t,r)};case 3:return function(t,r,n){return new e(t,r,n)};case 4:return function(t,r,n,i){return new e(t,r,n,i)};case 5:return function(t,r,n,i,o){return new e(t,r,n,i,o)};case 6:return function(t,r,n,i,o,a){return new e(t,r,n,i,o,a)};case 7:return function(t,r,n,i,o,a,s){return new e(t,r,n,i,o,a,s)};case 8:return function(t,r,n,i,o,a,s,c){return new e(t,r,n,i,o,a,s,c)};case 9:return function(t,r,n,i,o,a,s,c,u){return new e(t,r,n,i,o,a,s,c,u)};case 10:return function(t,r,n,i,o,a,s,c,u,l){return new e(t,r,n,i,o,a,s,c,u,l)};case 11:return function(t,r,n,i,o,a,s,c,u,l,p){return new e(t,r,n,i,o,a,s,c,u,l,p)};case 12:return function(t,r,n,i,o,a,s,c,u,l,p,f){return new e(t,r,n,i,o,a,s,c,u,l,p,f)};case 13:return function(t,r,n,i,o,a,s,c,u,l,p,f,d){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d)};case 14:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h)};case 15:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g)};case 16:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v)};case 17:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y)};case 18:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m)};case 19:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m,_){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m,_)};case 20:return function(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m,_,b){return new e(t,r,n,i,o,a,s,c,u,l,p,f,d,h,g,v,y,m,_,b)}}throw new Error("Cannot create a factory for '"+o.stringify(e)+"' because its constructor has more than 20 arguments")},e.prototype._zipTypesAndAnnotaions=function(e,t){var r;r=s.ListWrapper.createFixedSize("undefined"==typeof e?t.length:e.length);for(var n=0;n<r.length;n++)r[n]="undefined"==typeof e?[]:e[n]!=Object?[e[n]]:[],o.isPresent(t)&&o.isPresent(t[n])&&(r[n]=r[n].concat(t[n]));return r},e.prototype.parameters=function(e){if(o.isPresent(e.parameters))return e.parameters;if(o.isPresent(this._reflect)&&o.isPresent(this._reflect.getMetadata)){var t=this._reflect.getMetadata("parameters",e),r=this._reflect.getMetadata("design:paramtypes",e);if(o.isPresent(r)||o.isPresent(t))return this._zipTypesAndAnnotaions(r,t)}return s.ListWrapper.createFixedSize(e.length)},e.prototype.annotations=function(e){if(o.isPresent(e.annotations)){var t=e.annotations;return o.isFunction(t)&&t.annotations&&(t=t.annotations),t}if(o.isPresent(this._reflect)&&o.isPresent(this._reflect.getMetadata)){var t=this._reflect.getMetadata("annotations",e);if(o.isPresent(t))return t}return[]},e.prototype.propMetadata=function(e){if(o.isPresent(e.propMetadata)){var t=e.propMetadata;return o.isFunction(t)&&t.propMetadata&&(t=t.propMetadata),t}if(o.isPresent(this._reflect)&&o.isPresent(this._reflect.getMetadata)){var t=this._reflect.getMetadata("propMetadata",e);if(o.isPresent(t))return t}return{}},e.prototype.interfaces=function(e){throw new a.BaseException("JavaScript does not support interfaces")},e.prototype.getter=function(e){return new Function("o","return o."+e+";")},e.prototype.setter=function(e){return new Function("o","v","return o."+e+" = v;")},e.prototype.method=function(e){var t="if (!o."+e+") throw new Error('\""+e+"\" is undefined');\n return o."+e+".apply(o, args);";return new Function("o","args",t)},e.prototype.importUri=function(e){return"./"},e}();return t.ReflectionCapabilities=c,n.define=i,r.exports}),System.register("angular2/src/core/di/type_literal",[],!0,function(e,t,r){
var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){throw new Error("Type literals are only supported in Dart")},enumerable:!0,configurable:!0}),e}();return t.TypeLiteral=o,n.define=i,r.exports}),System.register("angular2/src/core/di/exceptions",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions"],!0,function(e,t,r){function n(e){for(var t=[],r=0;r<e.length;++r){if(c.ListWrapper.contains(t,e[r]))return t.push(e[r]),t;t.push(e[r])}return t}function i(e){if(e.length>1){var t=n(c.ListWrapper.reversed(e)),r=c.ListWrapper.map(t,function(e){return u.stringify(e.token)});return" ("+r.join(" -> ")+")"}return""}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=function(e){function t(t,r,n){e.call(this,"DI Exception"),this.keys=[r],this.injectors=[t],this.constructResolvingMessage=n,this.message=this.constructResolvingMessage(this.keys)}return s(t,e),t.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t),this.message=this.constructResolvingMessage(this.keys)},Object.defineProperty(t.prototype,"context",{get:function(){return this.injectors[this.injectors.length-1].debugContext()},enumerable:!0,configurable:!0}),t}(l.BaseException);t.AbstractBindingError=p;var f=function(e){function t(t,r){e.call(this,t,r,function(e){var t=u.stringify(c.ListWrapper.first(e).token);return"No provider for "+t+"!"+i(e)})}return s(t,e),t}(p);t.NoBindingError=f;var d=function(e){function t(t,r){e.call(this,t,r,function(e){return"Cannot instantiate cyclic dependency!"+i(e)})}return s(t,e),t}(p);t.CyclicDependencyError=d;var h=function(e){function t(t,r,n,i){e.call(this,"DI Exception",r,n,null),this.keys=[i],this.injectors=[t]}return s(t,e),t.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t)},Object.defineProperty(t.prototype,"wrapperMessage",{get:function(){var e=u.stringify(c.ListWrapper.first(this.keys).token);return"Error during instantiation of "+e+"!"+i(this.keys)+"."},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"causeKey",{get:function(){return this.keys[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.injectors[this.injectors.length-1].debugContext()},enumerable:!0,configurable:!0}),t}(l.WrappedException);t.InstantiationError=h;var g=function(e){function t(t){e.call(this,"Invalid binding - only instances of Binding and Type are allowed, got: "+t.toString())}return s(t,e),t}(l.BaseException);t.InvalidBindingError=g;var v=function(e){function t(r,n){e.call(this,t._genMessage(r,n))}return s(t,e),t._genMessage=function(e,t){for(var r=[],n=0,i=t.length;i>n;n++){var o=t[n];r.push(u.isBlank(o)||0==o.length?"?":c.ListWrapper.map(o,u.stringify).join(" "))}return"Cannot resolve all parameters for "+u.stringify(e)+"("+r.join(", ")+"). Make sure they all have valid type or annotations."},t}(l.BaseException);t.NoAnnotationError=v;var y=function(e){function t(t){e.call(this,"Index "+t+" is out-of-bounds.")}return s(t,e),t}(l.BaseException);t.OutOfBoundsError=y;var m=function(e){function t(t,r){e.call(this,"Cannot mix multi bindings and regular bindings, got: "+t.toString()+" "+r.toString())}return s(t,e),t}(l.BaseException);return t.MixingMultiBindingsWithRegularBindings=m,o.define=a,r.exports}),System.register("angular2/src/core/di/opaque_token",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=function(){function e(e){this._desc=e}return e.prototype.toString=function(){return"Token "+this._desc},e=o([s.CONST(),a("design:paramtypes",[String])],e)}();return t.OpaqueToken=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/iterable_differs",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/exceptions"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/di"),p=function(){function e(e){this.factories=e}return e.create=function(t,r){if(s.isPresent(r)){var n=u.ListWrapper.clone(r.factories);return t=t.concat(n),new e(t)}return new e(t)},e.extend=function(t){return new l.Binding(e,{toFactory:function(r){if(s.isBlank(r))throw new c.BaseException("Cannot extend IterableDiffers without a parent injector");return e.create(t,r)},deps:[[e,new l.SkipSelfMetadata,new l.OptionalMetadata]]})},e.prototype.find=function(e){var t=u.ListWrapper.find(this.factories,function(t){return t.supports(e)});if(s.isPresent(t))return t;throw new c.BaseException("Cannot find a differ supporting object '"+e+"'")},e=o([l.Injectable(),s.CONST(),a("design:paramtypes",[Array])],e)}();return t.IterableDiffers=p,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/default_iterable_differ",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/exceptions"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/facade/lang"),p=function(){function e(){}return e.prototype.supports=function(e){return u.isListLikeIterable(e)},e.prototype.create=function(e){return new f},e=o([s.CONST(),a("design:paramtypes",[])],e)}();t.DefaultIterableDifferFactory=p;var f=function(){function e(){this._collection=null,this._length=null,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(e.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)},e.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},e.prototype.forEachMovedItem=function(e){var t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)},e.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},e.prototype.diff=function(e){if(l.isBlank(e)&&(e=[]),!u.isListLikeIterable(e))throw new c.BaseException("Error trying to diff '"+e+"'");return this.check(e)?this:null},e.prototype.onDestroy=function(){},e.prototype.check=function(e){var t=this;this._reset();var r,n,i=this._itHead,o=!1;if(l.isArray(e)){var a=e;for(this._length=e.length,r=0;r<this._length;r++)n=a[r],null!==i&&l.looseIdentical(i.item,n)?o&&(i=this._verifyReinsertion(i,n,r)):(i=this._mismatch(i,n,r),o=!0),i=i._next}else r=0,u.iterateListLike(e,function(e){null!==i&&l.looseIdentical(i.item,e)?o&&(i=t._verifyReinsertion(i,e,r)):(i=t._mismatch(i,e,r),o=!0),i=i._next,r++}),this._length=r;return this._truncate(i),this._collection=e,this.isDirty},Object.defineProperty(e.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),e.prototype._reset=function(){if(this.isDirty){var e,t;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=t)e.previousIndex=e.currentIndex,t=e._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null}},e.prototype._mismatch=function(e,t,r){var n;return null===e?n=this._itTail:(n=e._prev,this._remove(e)),e=null===this._linkedRecords?null:this._linkedRecords.get(t,r),null!==e?this._moveAfter(e,n,r):(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(t),null!==e?this._reinsertAfter(e,n,r):e=this._addAfter(new d(t),n,r)),e},e.prototype._verifyReinsertion=function(e,t,r){var n=null===this._unlinkedRecords?null:this._unlinkedRecords.get(t);return null!==n?e=this._reinsertAfter(n,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e},e.prototype._truncate=function(e){for(;null!==e;){var t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null)},e.prototype._reinsertAfter=function(e,t,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);var n=e._prevRemoved,i=e._nextRemoved;return null===n?this._removalsHead=i:n._nextRemoved=i,null===i?this._removalsTail=n:i._prevRemoved=n,this._insertAfter(e,t,r),this._addToMoves(e,r),e},e.prototype._moveAfter=function(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e},e.prototype._addAfter=function(e,t,r){return this._insertAfter(e,t,r),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e},e.prototype._insertAfter=function(e,t,r){var n=null===t?this._itHead:t._next;return e._next=n,e._prev=t,null===n?this._itTail=e:n._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new g),this._linkedRecords.put(e),e.currentIndex=r,e},e.prototype._remove=function(e){return this._addToRemovals(this._unlink(e))},e.prototype._unlink=function(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);var t=e._prev,r=e._next;return null===t?this._itHead=r:t._next=r,null===r?this._itTail=t:r._prev=t,e},e.prototype._addToMoves=function(e,t){return e.previousIndex===t?e:(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e,e)},e.prototype._addToRemovals=function(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new g),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e},e.prototype.toString=function(){var e,t=[];for(e=this._itHead;null!==e;e=e._next)t.push(e);var r=[];for(e=this._previousItHead;null!==e;e=e._nextPrevious)r.push(e);var n=[];for(e=this._additionsHead;null!==e;e=e._nextAdded)n.push(e);var i=[];for(e=this._movesHead;null!==e;e=e._nextMoved)i.push(e);var o=[];for(e=this._removalsHead;null!==e;e=e._nextRemoved)o.push(e);return"collection: "+t.join(", ")+"\nprevious: "+r.join(", ")+"\nadditions: "+n.join(", ")+"\nmoves: "+i.join(", ")+"\nremovals: "+o.join(", ")+"\n"},e}();t.DefaultIterableDiffer=f;var d=function(){function e(e){this.item=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null}return e.prototype.toString=function(){return this.previousIndex===this.currentIndex?l.stringify(this.item):l.stringify(this.item)+"["+l.stringify(this.previousIndex)+"->"+l.stringify(this.currentIndex)+"]"},e}();t.CollectionChangeRecord=d;var h=function(){function e(){this._head=null,this._tail=null}return e.prototype.add=function(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)},e.prototype.get=function(e,t){var r;for(r=this._head;null!==r;r=r._nextDup)if((null===t||t<r.currentIndex)&&l.looseIdentical(r.item,e))return r;return null},e.prototype.remove=function(e){var t=e._prevDup,r=e._nextDup;return null===t?this._head=r:t._nextDup=r,null===r?this._tail=t:r._prevDup=t,null===this._head},e}(),g=function(){function e(){this.map=new Map}return e.prototype.put=function(e){var t=l.getMapKey(e.item),r=this.map.get(t);l.isPresent(r)||(r=new h,this.map.set(t,r)),r.add(e)},e.prototype.get=function(e,t){void 0===t&&(t=null);var r=l.getMapKey(e),n=this.map.get(r);return l.isBlank(n)?null:n.get(e,t)},e.prototype.remove=function(e){var t=l.getMapKey(e.item),r=this.map.get(t);return r.remove(e)&&u.MapWrapper["delete"](this.map,t),e},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===u.MapWrapper.size(this.map)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this.map.clear()},e.prototype.toString=function(){return"_DuplicateMap("+l.stringify(this.map)+")"},e}();return n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/keyvalue_differs",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/exceptions"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/di"),p=function(){function e(e){this.factories=e}return e.create=function(t,r){if(s.isPresent(r)){var n=u.ListWrapper.clone(r.factories);return t=t.concat(n),new e(t)}return new e(t)},e.extend=function(t){return new l.Binding(e,{toFactory:function(r){if(s.isBlank(r))throw new c.BaseException("Cannot extend KeyValueDiffers without a parent injector");return e.create(t,r)},deps:[[e,new l.SkipSelfMetadata,new l.OptionalMetadata]]})},e.prototype.find=function(e){var t=u.ListWrapper.find(this.factories,function(t){return t.supports(e)});if(s.isPresent(t))return t;throw new c.BaseException("Cannot find a differ supporting object '"+e+"'")},e=o([l.Injectable(),s.CONST(),a("design:paramtypes",[Array])],e)}();return t.KeyValueDiffers=p,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/differs/default_keyvalue_differ",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=function(){function e(){}return e.prototype.supports=function(e){return e instanceof Map||c.isJsObject(e)},e.prototype.create=function(e){return new p},e=o([c.CONST(),a("design:paramtypes",[])],e)}();t.DefaultKeyValueDifferFactory=l;var p=function(){function e(){this._records=new Map,this._mapHead=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._mapHead;null!==t;t=t._next)e(t)},e.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)},e.prototype.forEachChangedItem=function(e){var t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)},e.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},e.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},e.prototype.diff=function(e){if(c.isBlank(e)&&(e=s.MapWrapper.createFromPairs([])),!(e instanceof Map||c.isJsObject(e)))throw new u.BaseException("Error trying to diff '"+e+"'");return this.check(e)?this:null},e.prototype.onDestroy=function(){},e.prototype.check=function(e){var t=this;this._reset();var r=this._records,n=this._mapHead,i=null,o=null,a=!1;return this._forEach(e,function(e,s){var u;null!==n&&s===n.key?(u=n,c.looseIdentical(e,n.currentValue)||(n.previousValue=n.currentValue,n.currentValue=e,t._addToChanges(n))):(a=!0,null!==n&&(n._next=null,t._removeFromSeq(i,n),t._addToRemovals(n)),r.has(s)?u=r.get(s):(u=new f(s),r.set(s,u),u.currentValue=e,t._addToAdditions(u))),a&&(t._isInRemovals(u)&&t._removeFromRemovals(u),null==o?t._mapHead=u:o._next=u),i=n,o=u,n=null===n?null:n._next}),this._truncate(i,n),this.isDirty},e.prototype._reset=function(){if(this.isDirty){var e;for(e=this._previousMapHead=this._mapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=this._removalsTail=null}},e.prototype._truncate=function(e,t){for(;null!==t;){null===e?this._mapHead=null:e._next=null;var r=t._next;this._addToRemovals(t),e=t,t=r}for(var n=this._removalsHead;null!==n;n=n._nextRemoved)n.previousValue=n.currentValue,n.currentValue=null,s.MapWrapper["delete"](this._records,n.key)},e.prototype._isInRemovals=function(e){return e===this._removalsHead||null!==e._nextRemoved||null!==e._prevRemoved},e.prototype._addToRemovals=function(e){null===this._removalsHead?this._removalsHead=this._removalsTail=e:(this._removalsTail._nextRemoved=e,e._prevRemoved=this._removalsTail,this._removalsTail=e)},e.prototype._removeFromSeq=function(e,t){var r=t._next;null===e?this._mapHead=r:e._next=r},e.prototype._removeFromRemovals=function(e){var t=e._prevRemoved,r=e._nextRemoved;null===t?this._removalsHead=r:t._nextRemoved=r,null===r?this._removalsTail=t:r._prevRemoved=t,e._prevRemoved=e._nextRemoved=null},e.prototype._addToAdditions=function(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)},e.prototype._addToChanges=function(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)},e.prototype.toString=function(){var e,t=[],r=[],n=[],i=[],o=[];for(e=this._mapHead;null!==e;e=e._next)t.push(c.stringify(e));for(e=this._previousMapHead;null!==e;e=e._nextPrevious)r.push(c.stringify(e));for(e=this._changesHead;null!==e;e=e._nextChanged)n.push(c.stringify(e));for(e=this._additionsHead;null!==e;e=e._nextAdded)i.push(c.stringify(e));for(e=this._removalsHead;null!==e;e=e._nextRemoved)o.push(c.stringify(e));return"map: "+t.join(", ")+"\nprevious: "+r.join(", ")+"\nadditions: "+i.join(", ")+"\nchanges: "+n.join(", ")+"\nremovals: "+o.join(", ")+"\n"},e.prototype._forEach=function(e,t){e instanceof Map?s.MapWrapper.forEach(e,t):s.StringMapWrapper.forEach(e,t)},e}();t.DefaultKeyValueDiffer=p;var f=function(){function e(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._nextAdded=null,this._nextRemoved=null,this._prevRemoved=null,this._nextChanged=null}return e.prototype.toString=function(){return c.looseIdentical(this.previousValue,this.currentValue)?c.stringify(this.key):c.stringify(this.key)+"["+c.stringify(this.previousValue)+"->"+c.stringify(this.currentValue)+"]"},e}();return t.KVChangeRecord=f,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/parser/ast",["angular2/src/core/facade/lang","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/collection"),c=function(){function e(){}return e.prototype.visit=function(e){return null},e.prototype.toString=function(){return"AST"},e}();t.AST=c;var u=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.visit=function(e){},t}(c);t.EmptyExpr=u;var l=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.visit=function(e){return e.visitImplicitReceiver(this)},t}(c);t.ImplicitReceiver=l;var p=function(e){function t(t){e.call(this),this.expressions=t}return o(t,e),t.prototype.visit=function(e){return e.visitChain(this)},t}(c);t.Chain=p;var f=function(e){function t(t,r,n){e.call(this),this.condition=t,this.trueExp=r,this.falseExp=n}return o(t,e),t.prototype.visit=function(e){return e.visitConditional(this)},t}(c);t.Conditional=f;var d=function(e){function t(t,r,n){e.call(this),this.condition=t,this.trueExp=r,this.falseExp=n}return o(t,e),t.prototype.visit=function(e){return e.visitIf(this)},t}(c);t.If=d;var h=function(e){function t(t,r,n){e.call(this),this.receiver=t,this.name=r,this.getter=n}return o(t,e),t.prototype.visit=function(e){return e.visitPropertyRead(this)},t}(c);t.PropertyRead=h;var g=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.setter=n,this.value=i}return o(t,e),t.prototype.visit=function(e){return e.visitPropertyWrite(this)},t}(c);t.PropertyWrite=g;var v=function(e){function t(t,r,n){e.call(this),this.receiver=t,this.name=r,this.getter=n}return o(t,e),t.prototype.visit=function(e){return e.visitSafePropertyRead(this)},t}(c);t.SafePropertyRead=v;var y=function(e){function t(t,r){e.call(this),this.obj=t,this.key=r}return o(t,e),t.prototype.visit=function(e){return e.visitKeyedRead(this)},t}(c);t.KeyedRead=y;var m=function(e){function t(t,r,n){e.call(this),this.obj=t,this.key=r,this.value=n}return o(t,e),t.prototype.visit=function(e){return e.visitKeyedWrite(this)},t}(c);t.KeyedWrite=m;var _=function(e){function t(t,r,n){e.call(this),this.exp=t,this.name=r,this.args=n}return o(t,e),t.prototype.visit=function(e){return e.visitPipe(this)},t}(c);t.BindingPipe=_;var b=function(e){function t(t){e.call(this),this.value=t}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralPrimitive(this)},t}(c);t.LiteralPrimitive=b;var x=function(e){function t(t){e.call(this),this.expressions=t}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralArray(this)},t}(c);t.LiteralArray=x;var w=function(e){function t(t,r){e.call(this),this.keys=t,this.values=r}return o(t,e),t.prototype.visit=function(e){return e.visitLiteralMap(this)},t}(c);t.LiteralMap=w;var j=function(e){function t(t,r){e.call(this),this.strings=t,this.expressions=r}return o(t,e),t.prototype.visit=function(e){e.visitInterpolation(this)},t}(c);t.Interpolation=j;var S=function(e){function t(t,r,n){e.call(this),this.operation=t,this.left=r,this.right=n}return o(t,e),t.prototype.visit=function(e){return e.visitBinary(this)},t}(c);t.Binary=S;var C=function(e){function t(t){e.call(this),this.expression=t}return o(t,e),t.prototype.visit=function(e){return e.visitPrefixNot(this)},t}(c);t.PrefixNot=C;var E=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.fn=n,this.args=i}return o(t,e),t.prototype.visit=function(e){return e.visitMethodCall(this)},t}(c);t.MethodCall=E;var R=function(e){function t(t,r,n,i){e.call(this),this.receiver=t,this.name=r,this.fn=n,this.args=i}return o(t,e),t.prototype.visit=function(e){return e.visitSafeMethodCall(this)},t}(c);t.SafeMethodCall=R;var O=function(e){function t(t,r){e.call(this),this.target=t,this.args=r}return o(t,e),t.prototype.visit=function(e){return e.visitFunctionCall(this)},t}(c);t.FunctionCall=O;var P=function(e){function t(t,r,n){e.call(this),this.ast=t,this.source=r,this.location=n}return o(t,e),t.prototype.visit=function(e){return this.ast.visit(e)},t.prototype.toString=function(){return this.source+" in "+this.location},t}(c);t.ASTWithSource=P;var I=function(){function e(e,t,r,n){this.key=e,this.keyIsVar=t,this.name=r,this.expression=n}return e}();t.TemplateBinding=I;var D=function(){function e(){}return e.prototype.visitBinary=function(e){return e.left.visit(this),e.right.visit(this),null},e.prototype.visitChain=function(e){return this.visitAll(e.expressions)},e.prototype.visitConditional=function(e){return e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this),null},e.prototype.visitIf=function(e){return e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this),null},e.prototype.visitPipe=function(e){return e.exp.visit(this),this.visitAll(e.args),null},e.prototype.visitFunctionCall=function(e){return e.target.visit(this),this.visitAll(e.args),null},e.prototype.visitImplicitReceiver=function(e){return null},e.prototype.visitInterpolation=function(e){return this.visitAll(e.expressions)},e.prototype.visitKeyedRead=function(e){return e.obj.visit(this),e.key.visit(this),null},e.prototype.visitKeyedWrite=function(e){return e.obj.visit(this),e.key.visit(this),e.value.visit(this),null},e.prototype.visitLiteralArray=function(e){return this.visitAll(e.expressions)},e.prototype.visitLiteralMap=function(e){return this.visitAll(e.values)},e.prototype.visitLiteralPrimitive=function(e){return null},e.prototype.visitMethodCall=function(e){return e.receiver.visit(this),this.visitAll(e.args)},e.prototype.visitPrefixNot=function(e){return e.expression.visit(this),null},e.prototype.visitPropertyRead=function(e){return e.receiver.visit(this),null},e.prototype.visitPropertyWrite=function(e){return e.receiver.visit(this),e.value.visit(this),null},e.prototype.visitSafePropertyRead=function(e){return e.receiver.visit(this),null},e.prototype.visitSafeMethodCall=function(e){return e.receiver.visit(this),this.visitAll(e.args)},e.prototype.visitAll=function(e){var t=this;return s.ListWrapper.forEach(e,function(e){e.visit(t)}),null},e}();t.RecursiveAstVisitor=D;var T=function(){function e(){}return e.prototype.visitImplicitReceiver=function(e){return e},e.prototype.visitInterpolation=function(e){return new j(e.strings,this.visitAll(e.expressions))},e.prototype.visitLiteralPrimitive=function(e){return new b(e.value)},e.prototype.visitPropertyRead=function(e){return new h(e.receiver.visit(this),e.name,e.getter)},e.prototype.visitPropertyWrite=function(e){return new g(e.receiver.visit(this),e.name,e.setter,e.value)},e.prototype.visitSafePropertyRead=function(e){return new v(e.receiver.visit(this),e.name,e.getter)},e.prototype.visitMethodCall=function(e){return new E(e.receiver.visit(this),e.name,e.fn,this.visitAll(e.args))},e.prototype.visitSafeMethodCall=function(e){return new R(e.receiver.visit(this),e.name,e.fn,this.visitAll(e.args))},e.prototype.visitFunctionCall=function(e){return new O(e.target.visit(this),this.visitAll(e.args))},e.prototype.visitLiteralArray=function(e){return new x(this.visitAll(e.expressions))},e.prototype.visitLiteralMap=function(e){return new w(e.keys,this.visitAll(e.values))},e.prototype.visitBinary=function(e){return new S(e.operation,e.left.visit(this),e.right.visit(this))},e.prototype.visitPrefixNot=function(e){return new C(e.expression.visit(this))},e.prototype.visitConditional=function(e){return new f(e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))},e.prototype.visitPipe=function(e){return new _(e.exp.visit(this),e.name,this.visitAll(e.args))},e.prototype.visitKeyedRead=function(e){return new y(e.obj.visit(this),e.key.visit(this))},e.prototype.visitKeyedWrite=function(e){return new m(e.obj.visit(this),e.key.visit(this),e.value.visit(this))},e.prototype.visitAll=function(e){for(var t=s.ListWrapper.createFixedSize(e.length),r=0;r<e.length;++r)t[r]=e[r].visit(this);return t},e.prototype.visitChain=function(e){return new p(this.visitAll(e.expressions))},e.prototype.visitIf=function(e){var t=a.isPresent(e.falseExp)?e.falseExp.visit(this):null;return new d(e.condition.visit(this),e.trueExp.visit(this),t)},e}();return t.AstTransformer=T,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/parser/lexer",["angular2/src/core/di/decorators","angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions"],!0,function(e,t,r){function n(e,t){return new R(e,C.Character,t,j.StringWrapper.fromCharCode(t))}function i(e,t){return new R(e,C.Identifier,0,t)}function o(e,t){return new R(e,C.Keyword,0,t)}function a(e,t){return new R(e,C.Operator,0,t)}function s(e,t){return new R(e,C.String,0,t)}function c(e,t){return new R(e,C.Number,t,"")}function u(e){return e>=t.$TAB&&e<=t.$SPACE||e==q}function l(e){return e>=A&&H>=e||e>=I&&T>=e||e==M||e==t.$$}function p(e){return e>=A&&H>=e||e>=I&&T>=e||e>=O&&P>=e||e==M||e==t.$$}function f(e){return e>=O&&P>=e}function d(e){return e==N||e==D}function h(e){return e==t.$MINUS||e==t.$PLUS}function g(e){switch(e){case B:return t.$LF;case V:return t.$FF;case L:return t.$CR;case F:return t.$TAB;case U:return t.$VTAB;default:return e}}var v=System.global,y=v.define;v.define=void 0;var m=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},_=this&&this.__decorate||function(e,t,r,n){
if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},b=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},x=e("angular2/src/core/di/decorators"),w=e("angular2/src/core/facade/collection"),j=e("angular2/src/core/facade/lang"),S=e("angular2/src/core/facade/exceptions");!function(e){e[e.Character=0]="Character",e[e.Identifier=1]="Identifier",e[e.Keyword=2]="Keyword",e[e.String=3]="String",e[e.Operator=4]="Operator",e[e.Number=5]="Number"}(t.TokenType||(t.TokenType={}));var C=t.TokenType,E=function(){function e(){}return e.prototype.tokenize=function(e){for(var t=new z(e),r=[],n=t.scanToken();null!=n;)r.push(n),n=t.scanToken();return r},e=_([x.Injectable(),b("design:paramtypes",[])],e)}();t.Lexer=E;var R=function(){function e(e,t,r,n){this.index=e,this.type=t,this.numValue=r,this.strValue=n}return e.prototype.isCharacter=function(e){return this.type==C.Character&&this.numValue==e},e.prototype.isNumber=function(){return this.type==C.Number},e.prototype.isString=function(){return this.type==C.String},e.prototype.isOperator=function(e){return this.type==C.Operator&&this.strValue==e},e.prototype.isIdentifier=function(){return this.type==C.Identifier},e.prototype.isKeyword=function(){return this.type==C.Keyword},e.prototype.isKeywordVar=function(){return this.type==C.Keyword&&"var"==this.strValue},e.prototype.isKeywordNull=function(){return this.type==C.Keyword&&"null"==this.strValue},e.prototype.isKeywordUndefined=function(){return this.type==C.Keyword&&"undefined"==this.strValue},e.prototype.isKeywordTrue=function(){return this.type==C.Keyword&&"true"==this.strValue},e.prototype.isKeywordIf=function(){return this.type==C.Keyword&&"if"==this.strValue},e.prototype.isKeywordElse=function(){return this.type==C.Keyword&&"else"==this.strValue},e.prototype.isKeywordFalse=function(){return this.type==C.Keyword&&"false"==this.strValue},e.prototype.toNumber=function(){return this.type==C.Number?this.numValue:-1},e.prototype.toString=function(){switch(this.type){case C.Character:case C.Identifier:case C.Keyword:case C.Operator:case C.String:return this.strValue;case C.Number:return this.numValue.toString();default:return null}},e}();t.Token=R,t.EOF=new R(-1,C.Character,0,""),t.$EOF=0,t.$TAB=9,t.$LF=10,t.$VTAB=11,t.$FF=12,t.$CR=13,t.$SPACE=32,t.$BANG=33,t.$DQ=34,t.$HASH=35,t.$$=36,t.$PERCENT=37,t.$AMPERSAND=38,t.$SQ=39,t.$LPAREN=40,t.$RPAREN=41,t.$STAR=42,t.$PLUS=43,t.$COMMA=44,t.$MINUS=45,t.$PERIOD=46,t.$SLASH=47,t.$COLON=58,t.$SEMICOLON=59,t.$LT=60,t.$EQ=61,t.$GT=62,t.$QUESTION=63;var O=48,P=57,I=65,D=69,T=90;t.$LBRACKET=91,t.$BACKSLASH=92,t.$RBRACKET=93;var k=94,M=95,A=97,N=101,V=102,B=110,L=114,F=116,W=117,U=118,H=122;t.$LBRACE=123,t.$BAR=124,t.$RBRACE=125;var q=160,K=function(e){function t(t){e.call(this),this.message=t}return m(t,e),t.prototype.toString=function(){return this.message},t}(S.BaseException);t.ScannerError=K;var z=function(){function e(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}return e.prototype.advance=function(){this.peek=++this.index>=this.length?t.$EOF:j.StringWrapper.charCodeAt(this.input,this.index)},e.prototype.scanToken=function(){for(var e=this.input,r=this.length,i=this.peek,o=this.index;i<=t.$SPACE;){if(++o>=r){i=t.$EOF;break}i=j.StringWrapper.charCodeAt(e,o)}if(this.peek=i,this.index=o,o>=r)return null;if(l(i))return this.scanIdentifier();if(f(i))return this.scanNumber(o);var a=o;switch(i){case t.$PERIOD:return this.advance(),f(this.peek)?this.scanNumber(a):n(a,t.$PERIOD);case t.$LPAREN:case t.$RPAREN:case t.$LBRACE:case t.$RBRACE:case t.$LBRACKET:case t.$RBRACKET:case t.$COMMA:case t.$COLON:case t.$SEMICOLON:return this.scanCharacter(a,i);case t.$SQ:case t.$DQ:return this.scanString();case t.$HASH:case t.$PLUS:case t.$MINUS:case t.$STAR:case t.$SLASH:case t.$PERCENT:case k:return this.scanOperator(a,j.StringWrapper.fromCharCode(i));case t.$QUESTION:return this.scanComplexOperator(a,"?",t.$PERIOD,".");case t.$LT:case t.$GT:return this.scanComplexOperator(a,j.StringWrapper.fromCharCode(i),t.$EQ,"=");case t.$BANG:case t.$EQ:return this.scanComplexOperator(a,j.StringWrapper.fromCharCode(i),t.$EQ,"=",t.$EQ,"=");case t.$AMPERSAND:return this.scanComplexOperator(a,"&",t.$AMPERSAND,"&");case t.$BAR:return this.scanComplexOperator(a,"|",t.$BAR,"|");case q:for(;u(this.peek);)this.advance();return this.scanToken()}return this.error("Unexpected character ["+j.StringWrapper.fromCharCode(i)+"]",0),null},e.prototype.scanCharacter=function(e,t){return assert(this.peek==t),this.advance(),n(e,t)},e.prototype.scanOperator=function(e,t){return assert(this.peek==j.StringWrapper.charCodeAt(t,0)),assert(w.SetWrapper.has(G,t)),this.advance(),a(e,t)},e.prototype.scanComplexOperator=function(e,t,r,n,i,o){assert(this.peek==j.StringWrapper.charCodeAt(t,0)),this.advance();var s=t;return this.peek==r&&(this.advance(),s+=n),j.isPresent(i)&&this.peek==i&&(this.advance(),s+=o),assert(w.SetWrapper.has(G,s)),a(e,s)},e.prototype.scanIdentifier=function(){assert(l(this.peek));var e=this.index;for(this.advance();p(this.peek);)this.advance();var t=this.input.substring(e,this.index);return w.SetWrapper.has($,t)?o(e,t):i(e,t)},e.prototype.scanNumber=function(e){assert(f(this.peek));var r=this.index===e;for(this.advance();;){if(f(this.peek));else if(this.peek==t.$PERIOD)r=!1;else{if(!d(this.peek))break;this.advance(),h(this.peek)&&this.advance(),f(this.peek)||this.error("Invalid exponent",-1),r=!1}this.advance()}var n=this.input.substring(e,this.index),i=r?j.NumberWrapper.parseIntAutoRadix(n):j.NumberWrapper.parseFloat(n);return c(e,i)},e.prototype.scanString=function(){assert(this.peek==t.$SQ||this.peek==t.$DQ);var e=this.index,r=this.peek;this.advance();for(var n,i=this.index,o=this.input;this.peek!=r;)if(this.peek==t.$BACKSLASH){null==n&&(n=new j.StringJoiner),n.add(o.substring(i,this.index)),this.advance();var a;if(this.peek==W){var c=o.substring(this.index+1,this.index+5);try{a=j.NumberWrapper.parseInt(c,16)}catch(u){this.error("Invalid unicode escape [\\u"+c+"]",0)}for(var l=0;5>l;l++)this.advance()}else a=g(this.peek),this.advance();n.add(j.StringWrapper.fromCharCode(a)),i=this.index}else this.peek==t.$EOF?this.error("Unterminated quote",0):this.advance();var p=o.substring(i,this.index);this.advance();var f=p;return null!=n&&(n.add(p),f=n.toString()),s(e,f)},e.prototype.error=function(e,t){var r=this.index+t;throw new K("Lexer Error: "+e+" at column "+r+" in expression ["+this.input+"]")},e}(),G=w.SetWrapper.createFromList(["+","-","*","/","%","^","=","==","!=","===","!==","<",">","<=",">=","&&","||","&","|","!","?","#","?."]),$=w.SetWrapper.createFromList(["var","null","undefined","true","false","if","else"]);return v.define=y,r.exports}),System.register("angular2/src/core/change_detection/parser/parser",["angular2/src/core/di/decorators","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/parser/lexer","angular2/src/core/reflection/reflection","angular2/src/core/change_detection/parser/ast"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di/decorators"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/change_detection/parser/lexer"),d=e("angular2/src/core/reflection/reflection"),h=e("angular2/src/core/change_detection/parser/ast"),g=new h.ImplicitReceiver,v=/\{\{(.*?)\}\}/g,y=function(e){function t(t,r,n,i){e.call(this,"Parser Error: "+t+" "+n+" ["+r+"] in "+i)}return o(t,e),t}(l.BaseException),m=function(){function e(e,t){void 0===t&&(t=null),this._lexer=e,this._reflector=u.isPresent(t)?t:d.reflector}return e.prototype.parseAction=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!0).parseChain();return new h.ASTWithSource(n,e,t)},e.prototype.parseBinding=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!1).parseChain();return new h.ASTWithSource(n,e,t)},e.prototype.parseSimpleBinding=function(e,t){this._checkNoInterpolation(e,t);var r=this._lexer.tokenize(e),n=new _(e,t,r,this._reflector,!1).parseSimpleBinding();return new h.ASTWithSource(n,e,t)},e.prototype.parseTemplateBindings=function(e,t){var r=this._lexer.tokenize(e);return new _(e,t,r,this._reflector,!1).parseTemplateBindings()},e.prototype.parseInterpolation=function(e,t){var r=u.StringWrapper.split(e,v);if(r.length<=1)return null;for(var n=[],i=[],o=0;o<r.length;o++){var a=r[o];if(o%2===0)n.push(a);else{if(!(a.trim().length>0))throw new y("Blank expressions are not allowed in interpolated strings",e,"at column "+this._findInterpolationErrorColumn(r,o)+" in",t);var s=this._lexer.tokenize(a),c=new _(e,t,s,this._reflector,!1).parseChain();i.push(c)}}return new h.ASTWithSource(new h.Interpolation(n,i),e,t)},e.prototype.wrapLiteralPrimitive=function(e,t){return new h.ASTWithSource(new h.LiteralPrimitive(e),e,t)},e.prototype._checkNoInterpolation=function(e,t){var r=u.StringWrapper.split(e,v);if(r.length>1)throw new y("Got interpolation ({{}}) where expression was expected",e,"at column "+this._findInterpolationErrorColumn(r,1)+" in",t)},e.prototype._findInterpolationErrorColumn=function(e,t){for(var r="",n=0;t>n;n++)r+=n%2===0?e[n]:"{{"+e[n]+"}}";return r.length},e=a([c.Injectable(),s("design:paramtypes",[f.Lexer,d.Reflector])],e)}();t.Parser=m;var _=function(){function e(e,t,r,n,i){this.input=e,this.location=t,this.tokens=r,this.reflector=n,this.parseAction=i,this.index=0}return e.prototype.peek=function(e){var t=this.index+e;return t<this.tokens.length?this.tokens[t]:f.EOF},Object.defineProperty(e.prototype,"next",{get:function(){return this.peek(0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputIndex",{get:function(){return this.index<this.tokens.length?this.next.index:this.input.length},enumerable:!0,configurable:!0}),e.prototype.advance=function(){this.index++},e.prototype.optionalCharacter=function(e){return this.next.isCharacter(e)?(this.advance(),!0):!1},e.prototype.optionalKeywordVar=function(){return this.peekKeywordVar()?(this.advance(),!0):!1},e.prototype.peekKeywordVar=function(){return this.next.isKeywordVar()||this.next.isOperator("#")},e.prototype.expectCharacter=function(e){this.optionalCharacter(e)||this.error("Missing expected "+u.StringWrapper.fromCharCode(e))},e.prototype.optionalOperator=function(e){return this.next.isOperator(e)?(this.advance(),!0):!1},e.prototype.expectOperator=function(e){this.optionalOperator(e)||this.error("Missing expected operator "+e)},e.prototype.expectIdentifierOrKeyword=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()||this.error("Unexpected token "+e+", expected identifier or keyword"),this.advance(),e.toString()},e.prototype.expectIdentifierOrKeywordOrString=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()||e.isString()||this.error("Unexpected token "+e+", expected identifier, keyword, or string"),this.advance(),e.toString()},e.prototype.parseChain=function(){for(var e=[];this.index<this.tokens.length;){var t=this.parsePipe();if(e.push(t),this.optionalCharacter(f.$SEMICOLON))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.optionalCharacter(f.$SEMICOLON););else this.index<this.tokens.length&&this.error("Unexpected token '"+this.next+"'")}return 0==e.length?new h.EmptyExpr:1==e.length?e[0]:new h.Chain(e)},e.prototype.parseSimpleBinding=function(){var e=this.parseChain();return b.check(e)||this.error("Simple binding expression can only contain field access and constants'"),e},e.prototype.parsePipe=function(){var e=this.parseExpression();if(this.optionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{for(var t=this.expectIdentifierOrKeyword(),r=[];this.optionalCharacter(f.$COLON);)r.push(this.parsePipe());e=new h.BindingPipe(e,t,r)}while(this.optionalOperator("|"))}return e},e.prototype.parseExpression=function(){return this.parseConditional()},e.prototype.parseConditional=function(){var e=this.inputIndex,t=this.parseLogicalOr();if(this.optionalOperator("?")){var r=this.parsePipe();if(!this.optionalCharacter(f.$COLON)){var n=this.inputIndex,i=this.input.substring(e,n);this.error("Conditional expression "+i+" requires all 3 expressions")}var o=this.parsePipe();return new h.Conditional(t,r,o)}return t},e.prototype.parseLogicalOr=function(){for(var e=this.parseLogicalAnd();this.optionalOperator("||");)e=new h.Binary("||",e,this.parseLogicalAnd());return e},e.prototype.parseLogicalAnd=function(){for(var e=this.parseEquality();this.optionalOperator("&&");)e=new h.Binary("&&",e,this.parseEquality());return e},e.prototype.parseEquality=function(){for(var e=this.parseRelational();;)if(this.optionalOperator("=="))e=new h.Binary("==",e,this.parseRelational());else if(this.optionalOperator("==="))e=new h.Binary("===",e,this.parseRelational());else if(this.optionalOperator("!="))e=new h.Binary("!=",e,this.parseRelational());else{if(!this.optionalOperator("!=="))return e;e=new h.Binary("!==",e,this.parseRelational())}},e.prototype.parseRelational=function(){for(var e=this.parseAdditive();;)if(this.optionalOperator("<"))e=new h.Binary("<",e,this.parseAdditive());else if(this.optionalOperator(">"))e=new h.Binary(">",e,this.parseAdditive());else if(this.optionalOperator("<="))e=new h.Binary("<=",e,this.parseAdditive());else{if(!this.optionalOperator(">="))return e;e=new h.Binary(">=",e,this.parseAdditive())}},e.prototype.parseAdditive=function(){for(var e=this.parseMultiplicative();;)if(this.optionalOperator("+"))e=new h.Binary("+",e,this.parseMultiplicative());else{if(!this.optionalOperator("-"))return e;e=new h.Binary("-",e,this.parseMultiplicative())}},e.prototype.parseMultiplicative=function(){for(var e=this.parsePrefix();;)if(this.optionalOperator("*"))e=new h.Binary("*",e,this.parsePrefix());else if(this.optionalOperator("%"))e=new h.Binary("%",e,this.parsePrefix());else{if(!this.optionalOperator("/"))return e;e=new h.Binary("/",e,this.parsePrefix())}},e.prototype.parsePrefix=function(){return this.optionalOperator("+")?this.parsePrefix():this.optionalOperator("-")?new h.Binary("-",new h.LiteralPrimitive(0),this.parsePrefix()):this.optionalOperator("!")?new h.PrefixNot(this.parsePrefix()):this.parseCallChain()},e.prototype.parseCallChain=function(){for(var e=this.parsePrimary();;)if(this.optionalCharacter(f.$PERIOD))e=this.parseAccessMemberOrMethodCall(e,!1);else if(this.optionalOperator("?."))e=this.parseAccessMemberOrMethodCall(e,!0);else if(this.optionalCharacter(f.$LBRACKET)){var t=this.parsePipe();if(this.expectCharacter(f.$RBRACKET),this.optionalOperator("=")){var r=this.parseConditional();e=new h.KeyedWrite(e,t,r)}else e=new h.KeyedRead(e,t)}else{if(!this.optionalCharacter(f.$LPAREN))return e;var n=this.parseCallArguments();this.expectCharacter(f.$RPAREN),e=new h.FunctionCall(e,n)}},e.prototype.parsePrimary=function(){if(this.optionalCharacter(f.$LPAREN)){var e=this.parsePipe();return this.expectCharacter(f.$RPAREN),e}if(this.next.isKeywordNull()||this.next.isKeywordUndefined())return this.advance(),new h.LiteralPrimitive(null);if(this.next.isKeywordTrue())return this.advance(),new h.LiteralPrimitive(!0);if(this.next.isKeywordFalse())return this.advance(),new h.LiteralPrimitive(!1);if(this.parseAction&&this.next.isKeywordIf()){this.advance(),this.expectCharacter(f.$LPAREN);var t=this.parseExpression();this.expectCharacter(f.$RPAREN);var r,n=this.parseExpressionOrBlock();return this.next.isKeywordElse()&&(this.advance(),r=this.parseExpressionOrBlock()),new h.If(t,n,r)}if(this.optionalCharacter(f.$LBRACKET)){var i=this.parseExpressionList(f.$RBRACKET);return this.expectCharacter(f.$RBRACKET),new h.LiteralArray(i)}if(this.next.isCharacter(f.$LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(g,!1);if(this.next.isNumber()){var o=this.next.toNumber();return this.advance(),new h.LiteralPrimitive(o)}if(this.next.isString()){var a=this.next.toString();return this.advance(),new h.LiteralPrimitive(a)}throw this.error(this.index>=this.tokens.length?"Unexpected end of expression: "+this.input:"Unexpected token "+this.next),new l.BaseException("Fell through all cases in parsePrimary")},e.prototype.parseExpressionList=function(e){var t=[];if(!this.next.isCharacter(e))do t.push(this.parsePipe());while(this.optionalCharacter(f.$COMMA));return t},e.prototype.parseLiteralMap=function(){var e=[],t=[];if(this.expectCharacter(f.$LBRACE),!this.optionalCharacter(f.$RBRACE)){do{var r=this.expectIdentifierOrKeywordOrString();e.push(r),this.expectCharacter(f.$COLON),t.push(this.parsePipe())}while(this.optionalCharacter(f.$COMMA));this.expectCharacter(f.$RBRACE)}return new h.LiteralMap(e,t)},e.prototype.parseAccessMemberOrMethodCall=function(e,t){void 0===t&&(t=!1);var r=this.expectIdentifierOrKeyword();if(this.optionalCharacter(f.$LPAREN)){var n=this.parseCallArguments();this.expectCharacter(f.$RPAREN);var i=this.reflector.method(r);return t?new h.SafeMethodCall(e,r,i,n):new h.MethodCall(e,r,i,n)}if(!t){if(this.optionalOperator("=")){this.parseAction||this.error("Bindings cannot contain assignments");var o=this.parseConditional();return new h.PropertyWrite(e,r,this.reflector.setter(r),o)}return new h.PropertyRead(e,r,this.reflector.getter(r))}return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),null):new h.SafePropertyRead(e,r,this.reflector.getter(r))},e.prototype.parseCallArguments=function(){if(this.next.isCharacter(f.$RPAREN))return[];var e=[];do e.push(this.parsePipe());while(this.optionalCharacter(f.$COMMA));return e},e.prototype.parseExpressionOrBlock=function(){if(this.optionalCharacter(f.$LBRACE)){var e=this.parseBlockContent();return this.expectCharacter(f.$RBRACE),e}return this.parseExpression()},e.prototype.parseBlockContent=function(){this.parseAction||this.error("Binding expression cannot contain chained expression");for(var e=[];this.index<this.tokens.length&&!this.next.isCharacter(f.$RBRACE);){var t=this.parseExpression();if(e.push(t),this.optionalCharacter(f.$SEMICOLON))for(;this.optionalCharacter(f.$SEMICOLON););}return 0==e.length?new h.EmptyExpr:1==e.length?e[0]:new h.Chain(e)},e.prototype.expectTemplateBindingKey=function(){var e="",t=!1;do e+=this.expectIdentifierOrKeywordOrString(),t=this.optionalOperator("-"),t&&(e+="-");while(t);return e.toString()},e.prototype.parseTemplateBindings=function(){for(var e=[],t=null;this.index<this.tokens.length;){var r=this.optionalKeywordVar(),n=this.expectTemplateBindingKey();r||(null==t?t=n:n=t+"-"+n),this.optionalCharacter(f.$COLON);var i=null,o=null;if(r)i=this.optionalOperator("=")?this.expectTemplateBindingKey():"$implicit";else if(this.next!==f.EOF&&!this.peekKeywordVar()){var a=this.inputIndex,s=this.parsePipe(),c=this.input.substring(a,this.inputIndex);o=new h.ASTWithSource(s,c,this.location)}e.push(new h.TemplateBinding(n,r,i,o)),this.optionalCharacter(f.$SEMICOLON)||this.optionalCharacter(f.$COMMA)}return e},e.prototype.error=function(e,t){void 0===t&&(t=null),u.isBlank(t)&&(t=this.index);var r=t<this.tokens.length?"at column "+(this.tokens[t].index+1)+" in":"at the end of the expression";throw new y(e,this.input,r,this.location)},e}();t._ParseAST=_;var b=function(){function e(){this.simple=!0}return e.check=function(t){var r=new e;return t.visit(r),r.simple},e.prototype.visitImplicitReceiver=function(e){},e.prototype.visitInterpolation=function(e){this.simple=!1},e.prototype.visitLiteralPrimitive=function(e){},e.prototype.visitPropertyRead=function(e){},e.prototype.visitPropertyWrite=function(e){this.simple=!1},e.prototype.visitSafePropertyRead=function(e){this.simple=!1},e.prototype.visitMethodCall=function(e){this.simple=!1},e.prototype.visitSafeMethodCall=function(e){this.simple=!1},e.prototype.visitFunctionCall=function(e){this.simple=!1},e.prototype.visitLiteralArray=function(e){this.visitAll(e.expressions)},e.prototype.visitLiteralMap=function(e){this.visitAll(e.values)},e.prototype.visitBinary=function(e){this.simple=!1},e.prototype.visitPrefixNot=function(e){this.simple=!1},e.prototype.visitConditional=function(e){this.simple=!1},e.prototype.visitPipe=function(e){this.simple=!1},e.prototype.visitKeyedRead=function(e){this.simple=!1},e.prototype.visitKeyedWrite=function(e){this.simple=!1},e.prototype.visitAll=function(e){for(var t=p.ListWrapper.createFixedSize(e.length),r=0;r<e.length;++r)t[r]=e[r].visit(this);return t},e.prototype.visitChain=function(e){this.simple=!1},e.prototype.visitIf=function(e){this.simple=!1},e}();return n.define=i,r.exports}),System.register("angular2/src/core/change_detection/parser/locals",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=function(){function e(e,t){this.parent=e,this.current=t}return e.prototype.contains=function(e){return this.current.has(e)?!0:o.isPresent(this.parent)?this.parent.contains(e):!1},e.prototype.get=function(e){if(this.current.has(e))return this.current.get(e);if(o.isPresent(this.parent))return this.parent.get(e);throw new a.BaseException("Cannot find '"+e+"'")},e.prototype.set=function(e,t){if(!this.current.has(e))throw new a.BaseException("Setting of new keys post-construction is not supported. Key: "+e+".");this.current.set(e,t)},e.prototype.clearValues=function(){s.MapWrapper.clearValues(this.current)},e}();return t.Locals=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/exceptions",["angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/exceptions"),s=function(e){function t(t,r,n,i){e.call(this,"Expression '"+t+"' has changed after it was checked. "+("Previous value: '"+r+"'. Current value: '"+n+"'"))}return o(t,e),t}(a.BaseException);t.ExpressionChangedAfterItHasBeenCheckedException=s;var c=function(e){function t(t,r,n,i){e.call(this,r+" in ["+t+"]",r,n,i),this.location=t}return o(t,e),t}(a.WrappedException);t.ChangeDetectionError=c;var u=function(e){function t(){e.call(this,"Attempt to detect changes on a dehydrated detector.")}return o(t,e),t}(a.BaseException);return t.DehydratedException=u,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/interfaces",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e,t,r,n,i,o){this.element=e,this.componentElement=t,this.directive=r,this.context=n,this.locals=i,this.injector=o}return e}();t.DebugContext=o;var a=function(){function e(e,t,r,n){this.genCheckNoChanges=e,this.genDebugInfo=t,this.logBindingUpdate=r,this.useJit=n}return e}();t.ChangeDetectorGenConfig=a;var s=function(){function e(e,t,r,n,i,o,a){this.id=e,this.strategy=t,this.variableNames=r,this.bindingRecords=n,this.eventRecords=i,this.directiveRecords=o,this.genConfig=a}return e}();return t.ChangeDetectorDefinition=s,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/constants",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return a.isBlank(e)||e===s.Default}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang");!function(e){e[e.CheckOnce=0]="CheckOnce",e[e.Checked=1]="Checked",e[e.CheckAlways=2]="CheckAlways",e[e.Detached=3]="Detached",e[e.OnPush=4]="OnPush",e[e.Default=5]="Default",e[e.OnPushObserve=6]="OnPushObserve"}(t.ChangeDetectionStrategy||(t.ChangeDetectionStrategy={}));var s=t.ChangeDetectionStrategy;return t.CHANGE_DECTION_STRATEGY_VALUES=[s.CheckOnce,s.Checked,s.CheckAlways,s.Detached,s.OnPush,s.Default,s.OnPushObserve],t.isDefaultChangeDetectionStrategy=n,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/pipe_lifecycle_reflector",[],!0,function(e,t,r){function n(e){return e.constructor.prototype.onDestroy}var i=System.global,o=i.define;return i.define=void 0,t.implementsOnDestroy=n,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/binding_record",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a="directiveLifecycle",s="native",c="directive",u="elementProperty",l="elementAttribute",p="elementClass",f="elementStyle",d="textNode",h="event",g="hostEvent",v=function(){function e(e,t,r,n,i){this.mode=e,this.elementIndex=t,this.name=r,this.unit=n,this.debug=i}return e.prototype.isDirective=function(){return this.mode===c},e.prototype.isElementProperty=function(){return this.mode===u},e.prototype.isElementAttribute=function(){return this.mode===l},e.prototype.isElementClass=function(){return this.mode===p},e.prototype.isElementStyle=function(){return this.mode===f},e.prototype.isTextNode=function(){return this.mode===d},e}();t.BindingTarget=v;var y=function(){function e(e,t,r,n,i,o,a){this.mode=e,this.target=t,this.implicitReceiver=r,this.ast=n,this.setter=i,this.lifecycleEvent=o,this.directiveRecord=a}return e.prototype.isDirectiveLifecycle=function(){return this.mode===a},e.prototype.callOnChanges=function(){return o.isPresent(this.directiveRecord)&&this.directiveRecord.callOnChanges},e.prototype.isDefaultChangeDetection=function(){return o.isBlank(this.directiveRecord)||this.directiveRecord.isDefaultChangeDetection()},e.createDirectiveDoCheck=function(t){return new e(a,null,0,null,null,"DoCheck",t)},e.createDirectiveOnInit=function(t){return new e(a,null,0,null,null,"OnInit",t)},e.createDirectiveOnChanges=function(t){return new e(a,null,0,null,null,"OnChanges",t)},e.createForDirective=function(t,r,n,i){var o=i.directiveIndex.elementIndex,a=new v(c,o,r,null,t.toString());return new e(c,a,0,t,n,null,i)},e.createForElementProperty=function(t,r,n){var i=new v(u,r,n,null,t.toString());return new e(s,i,0,t,null,null,null)},e.createForElementAttribute=function(t,r,n){var i=new v(l,r,n,null,t.toString());return new e(s,i,0,t,null,null,null)},e.createForElementClass=function(t,r,n){var i=new v(p,r,n,null,t.toString());return new e(s,i,0,t,null,null,null)},e.createForElementStyle=function(t,r,n,i){var o=new v(f,r,n,i,t.toString());return new e(s,o,0,t,null,null,null)},e.createForHostProperty=function(t,r,n){var i=new v(u,t.elementIndex,n,null,r.toString());return new e(s,i,t,r,null,null,null)},e.createForHostAttribute=function(t,r,n){var i=new v(l,t.elementIndex,n,null,r.toString());return new e(s,i,t,r,null,null,null)},e.createForHostClass=function(t,r,n){var i=new v(p,t.elementIndex,n,null,r.toString());return new e(s,i,t,r,null,null,null)},e.createForHostStyle=function(t,r,n,i){var o=new v(f,t.elementIndex,n,i,r.toString());return new e(s,o,t,r,null,null,null)},e.createForTextNode=function(t,r){var n=new v(d,r,null,null,t.toString());return new e(s,n,0,t,null,null,null)},e.createForEvent=function(t,r,n){var i=new v(h,n,r,null,t.toString());return new e(h,i,0,t,null,null,null)},e.createForHostEvent=function(t,r,n){var i=n.directiveIndex,o=new v(g,i.elementIndex,r,null,t.toString());return new e(g,o,i,t,null,null,n)},e}();return t.BindingRecord=y,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/directive_record",["angular2/src/core/facade/lang","angular2/src/core/change_detection/constants"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/change_detection/constants"),s=function(){function e(e,t){this.elementIndex=e,this.directiveIndex=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.elementIndex+"_"+this.directiveIndex},enumerable:!0,configurable:!0}),e}();t.DirectiveIndex=s;var c=function(){function e(e){var t=void 0===e?{}:e,r=t.directiveIndex,n=t.callAfterContentInit,i=t.callAfterContentChecked,a=t.callAfterViewInit,s=t.callAfterViewChecked,c=t.callOnChanges,u=t.callDoCheck,l=t.callOnInit,p=t.changeDetection;this.directiveIndex=r,this.callAfterContentInit=o.normalizeBool(n),this.callAfterContentChecked=o.normalizeBool(i),this.callOnChanges=o.normalizeBool(c),this.callAfterViewInit=o.normalizeBool(a),this.callAfterViewChecked=o.normalizeBool(s),this.callDoCheck=o.normalizeBool(u),this.callOnInit=o.normalizeBool(l),this.changeDetection=p}return e.prototype.isDefaultChangeDetection=function(){return a.isDefaultChangeDetectionStrategy(this.changeDetection)},e}();return t.DirectiveRecord=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/change_detector_ref",["angular2/src/core/change_detection/constants"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/change_detection/constants"),a=function(){function e(e){this._cd=e}return e.prototype.markForCheck=function(){this._cd.markPathToRootAsCheckOnce()},e.prototype.detach=function(){this._cd.mode=o.ChangeDetectionStrategy.Detached},e.prototype.detectChanges=function(){this._cd.detectChanges()},e.prototype.reattach=function(){this._cd.mode=o.ChangeDetectionStrategy.CheckAlways,this.markForCheck()},e}();return t.ChangeDetectorRef=a,n.define=i,r.exports}),System.register("angular2/src/core/profile/wtf_impl",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(){var e=f.global.wtf;return e&&(l=e.trace)?(p=l.events,!0):!1}function i(e,t){return void 0===t&&(t=null),p.createScope(e,t)}function o(e,t){return l.leaveScope(e,t),t}function a(e,t){return l.beginTimeRange(e,t)}function s(e){l.endTimeRange(e)}var c=System.global,u=c.define;c.define=void 0;var l,p,f=e("angular2/src/core/facade/lang");return t.detectWTF=n,t.createScope=i,t.leave=o,t.startTimeRange=a,t.endTimeRange=s,c.define=u,r.exports}),System.register("angular2/src/core/change_detection/observable_facade",[],!0,function(e,t,r){function n(e){return!1}var i=System.global,o=i.define;return i.define=void 0,t.isObservable=n,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/proto_record",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,function(e){e[e.Self=0]="Self",e[e.Const=1]="Const",e[e.PrimitiveOp=2]="PrimitiveOp",e[e.PropertyRead=3]="PropertyRead",e[e.PropertyWrite=4]="PropertyWrite",e[e.Local=5]="Local",e[e.InvokeMethod=6]="InvokeMethod",e[e.InvokeClosure=7]="InvokeClosure",e[e.KeyedRead=8]="KeyedRead",e[e.KeyedWrite=9]="KeyedWrite",e[e.Pipe=10]="Pipe",e[e.Interpolate=11]="Interpolate",e[e.SafeProperty=12]="SafeProperty",e[e.CollectionLiteral=13]="CollectionLiteral",e[e.SafeMethodInvoke=14]="SafeMethodInvoke",e[e.DirectiveLifecycle=15]="DirectiveLifecycle",
e[e.Chain=16]="Chain"}(t.RecordType||(t.RecordType={}));var o=t.RecordType,a=function(){function e(e,t,r,n,i,o,a,s,c,u,l,p,f,d){this.mode=e,this.name=t,this.funcOrValue=r,this.args=n,this.fixedArgs=i,this.contextIndex=o,this.directiveIndex=a,this.selfIndex=s,this.bindingRecord=c,this.lastInBinding=u,this.lastInDirective=l,this.argumentToPureFunction=p,this.referencedBySelf=f,this.propertyBindingIndex=d}return e.prototype.isPureFunction=function(){return this.mode===o.Interpolate||this.mode===o.CollectionLiteral},e.prototype.isUsedByOtherRecord=function(){return!this.lastInBinding||this.referencedBySelf},e.prototype.shouldBeChecked=function(){return this.argumentToPureFunction||this.lastInBinding||this.isPureFunction()||this.isPipeRecord()},e.prototype.isPipeRecord=function(){return this.mode===o.Pipe},e.prototype.isLifeCycleRecord=function(){return this.mode===o.DirectiveLifecycle},e}();return t.ProtoRecord=a,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/event_binding",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e,t,r,n){this.eventName=e,this.elIndex=t,this.dirIndex=r,this.records=n}return e}();return t.EventBinding=o,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/coalesce",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){function n(e){for(var t=[],r=new f.Map,n=0;n<e.length;++n){var a=e[n],c=s(a,t.length+1,r),u=o(c,t);p.isPresent(u)&&c.lastInBinding?(t.push(i(c,u.selfIndex,t.length+1)),r.set(a.selfIndex,u.selfIndex),u.referencedBySelf=!0):p.isPresent(u)&&!c.lastInBinding?(c.argumentToPureFunction&&(u.argumentToPureFunction=!0),r.set(a.selfIndex,u.selfIndex)):(t.push(c),r.set(a.selfIndex,c.selfIndex))}return t}function i(e,t,r){return new d.ProtoRecord(d.RecordType.Self,"self",null,[],e.fixedArgs,t,e.directiveIndex,r,e.bindingRecord,e.lastInBinding,e.lastInDirective,!1,!1,e.propertyBindingIndex)}function o(e,t){return f.ListWrapper.find(t,function(t){return t.mode!==d.RecordType.DirectiveLifecycle&&a(t,e)&&t.mode===e.mode&&p.looseIdentical(t.funcOrValue,e.funcOrValue)&&t.contextIndex===e.contextIndex&&p.looseIdentical(t.name,e.name)&&f.ListWrapper.equals(t.args,e.args)})}function a(e,t){var r=p.isBlank(e.directiveIndex)?null:e.directiveIndex.directiveIndex,n=p.isBlank(e.directiveIndex)?null:e.directiveIndex.elementIndex,i=p.isBlank(t.directiveIndex)?null:t.directiveIndex.directiveIndex,o=p.isBlank(t.directiveIndex)?null:t.directiveIndex.elementIndex;return r===i&&n===o}function s(e,t,r){var n=f.ListWrapper.map(e.args,function(e){return c(r,e)}),i=c(r,e.contextIndex);return new d.ProtoRecord(e.mode,e.name,e.funcOrValue,n,e.fixedArgs,i,e.directiveIndex,t,e.bindingRecord,e.lastInBinding,e.lastInDirective,e.argumentToPureFunction,e.referencedBySelf,e.propertyBindingIndex)}function c(e,t){var r=e.get(t);return p.isPresent(r)?r:t}var u=System.global,l=u.define;u.define=void 0;var p=e("angular2/src/core/facade/lang"),f=e("angular2/src/core/facade/collection"),d=e("angular2/src/core/change_detection/proto_record");return t.coalesce=n,u.define=l,r.exports}),System.register("angular2/src/core/change_detection/codegen_name_util",["angular2/src/core/facade/lang","angular2/src/core/facade/collection"],!0,function(e,t,r){function n(e){return a.StringWrapper.replaceAll(e,m,"")}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/collection"),c="alreadyChecked",u="context",l="propertyBindingIndex",p="directiveIndices",f="dispatcher",d="locals",h="mode",g="pipes",v="protos";t.CONTEXT_INDEX=0;var y="this.",m=a.RegExpWrapper.create("\\W","g");t.sanitizeName=n;var _=function(){function e(e,r,i,o){this._records=e,this._eventBindings=r,this._directiveRecords=i,this._utilName=o,this._sanitizedEventNames=new s.Map,this._sanitizedNames=s.ListWrapper.createFixedSize(this._records.length+1),this._sanitizedNames[t.CONTEXT_INDEX]=u;for(var a=0,c=this._records.length;c>a;++a)this._sanitizedNames[a+1]=n(""+this._records[a].name+a);for(var l=0;l<r.length;++l){for(var p=r[l],f=[u],a=0,c=p.records.length;c>a;++a)f.push(n(""+p.records[a].name+a+"_"+l));this._sanitizedEventNames.set(p,f)}}return e.prototype._addFieldPrefix=function(e){return""+y+e},e.prototype.getDispatcherName=function(){return this._addFieldPrefix(f)},e.prototype.getPipesAccessorName=function(){return this._addFieldPrefix(g)},e.prototype.getProtosName=function(){return this._addFieldPrefix(v)},e.prototype.getDirectivesAccessorName=function(){return this._addFieldPrefix(p)},e.prototype.getLocalsAccessorName=function(){return this._addFieldPrefix(d)},e.prototype.getAlreadyCheckedName=function(){return this._addFieldPrefix(c)},e.prototype.getModeName=function(){return this._addFieldPrefix(h)},e.prototype.getPropertyBindingIndex=function(){return this._addFieldPrefix(l)},e.prototype.getLocalName=function(e){return"l_"+this._sanitizedNames[e]},e.prototype.getEventLocalName=function(e,t){return"l_"+s.MapWrapper.get(this._sanitizedEventNames,e)[t]},e.prototype.getChangeName=function(e){return"c_"+this._sanitizedNames[e]},e.prototype.genInitLocals=function(){for(var e=[],r=[],n=0,i=this.getFieldCount();i>n;++n)if(n==t.CONTEXT_INDEX)e.push(this.getLocalName(n)+" = "+this.getFieldName(n));else{var o=this._records[n-1];if(o.argumentToPureFunction){var a=this.getChangeName(n);e.push(this.getLocalName(n)+","+a),r.push(a)}else e.push(""+this.getLocalName(n))}var c=s.ListWrapper.isEmpty(r)?"":s.ListWrapper.join(r,"=")+" = false;";return"var "+s.ListWrapper.join(e,",")+";"+c},e.prototype.genInitEventLocals=function(){var e=this,r=[this.getLocalName(t.CONTEXT_INDEX)+" = "+this.getFieldName(t.CONTEXT_INDEX)];return s.MapWrapper.forEach(this._sanitizedEventNames,function(n,i){for(var o=0;o<n.length;++o)o!==t.CONTEXT_INDEX&&r.push(""+e.getEventLocalName(i,o))}),r.length>1?"var "+r.join(",")+";":""},e.prototype.getPreventDefaultAccesor=function(){return"preventDefault"},e.prototype.getFieldCount=function(){return this._sanitizedNames.length},e.prototype.getFieldName=function(e){return this._addFieldPrefix(this._sanitizedNames[e])},e.prototype.getAllFieldNames=function(){for(var e=[],t=0,r=this.getFieldCount();r>t;++t)(0===t||this._records[t-1].shouldBeChecked())&&e.push(this.getFieldName(t));for(var n=0,i=this._records.length;i>n;++n){var o=this._records[n];o.isPipeRecord()&&e.push(this.getPipeName(o.selfIndex))}for(var a=0,s=this._directiveRecords.length;s>a;++a){var c=this._directiveRecords[a];e.push(this.getDirectiveName(c.directiveIndex)),c.isDefaultChangeDetection()||e.push(this.getDetectorName(c.directiveIndex))}return e},e.prototype.genDehydrateFields=function(){var e=this.getAllFieldNames();return s.ListWrapper.removeAt(e,t.CONTEXT_INDEX),s.ListWrapper.isEmpty(e)?"":(e.push(this._utilName+".uninitialized;"),s.ListWrapper.join(e," = "))},e.prototype.genPipeOnDestroy=function(){var e=this;return s.ListWrapper.join(s.ListWrapper.map(s.ListWrapper.filter(this._records,function(e){return e.isPipeRecord()}),function(t){return e._utilName+".callPipeOnDestroy("+e.getPipeName(t.selfIndex)+");"}),"\n")},e.prototype.getPipeName=function(e){return this._addFieldPrefix(this._sanitizedNames[e]+"_pipe")},e.prototype.getDirectiveName=function(e){return this._addFieldPrefix("directive_"+e.name)},e.prototype.getDetectorName=function(e){return this._addFieldPrefix("detector_"+e.name)},e}();return t.CodegenNameUtil=_,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/codegen_facade",[],!0,function(e,t,r){function n(e){return JSON.stringify(e)}function i(e){return"'"+e+"'"}function o(e){return e.join(" + ")}var a=System.global,s=a.define;return a.define=void 0,t.codify=n,t.rawString=i,t.combineGeneratedStrings=o,a.define=s,r.exports}),System.register("angular2/src/core/metadata/view",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang");!function(e){e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None"}(t.ViewEncapsulation||(t.ViewEncapsulation={}));var c=t.ViewEncapsulation;t.VIEW_ENCAPSULATION_VALUES=[c.Emulated,c.Native,c.None];var u=function(){function e(e){var t=void 0===e?{}:e,r=t.templateUrl,n=t.template,i=t.directives,o=t.pipes,a=t.encapsulation,s=t.styles,c=t.styleUrls;this.templateUrl=r,this.template=n,this.styleUrls=c,this.styles=s,this.directives=i,this.pipes=o,this.encapsulation=a}return e=o([s.CONST(),a("design:paramtypes",[Object])],e)}();return t.ViewMetadata=u,n.define=i,r.exports}),System.register("angular2/src/core/util",["angular2/src/core/util/decorators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/util/decorators");return t.Class=o.Class,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/noop",[],!0,function(e,t,r){function n(){}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/throwError",[],!0,function(e,t,r){function n(e){throw e}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/tryOrOnError",[],!0,function(e,t,r){function n(e){function t(){try{t.target.apply(this,arguments)}catch(e){this.error(e)}}return t.target=e,t}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Subscription",[],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var a=function(){function e(t){n(this,e),this.isUnsubscribed=!1,t&&(this._unsubscribe=t)}return e.prototype._unsubscribe=function(){},e.prototype.unsubscribe=function t(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var t=this._unsubscribe,e=this._subscriptions;if(this._subscriptions=void 0,t&&t.call(this),null!=e)for(var r=-1,n=e.length;++r<n;)e[r].unsubscribe()}},e.prototype.add=function(t){if(t&&t!==this&&t!==e.EMPTY){var r=t;switch(typeof t){case"function":r=new e(t);case"object":if(r.isUnsubscribed||"function"!=typeof r.unsubscribe)break;if(this.isUnsubscribed)r.unsubscribe();else{var n=this._subscriptions||(this._subscriptions=[]);n.push(r)}break;default:throw new Error("Unrecognized subscription "+t+" added to Subscription.")}}},e.prototype.remove=function(t){if(null!=t&&t!==this&&t!==e.EMPTY){var r=this._subscriptions;if(r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},e}();return t["default"]=a,a.EMPTY=function(e){return e.isUnsubscribed=!0,e}(new a),r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/root",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},a=o[typeof self]&&self||o[typeof window]&&window;t.root=a;var s=(o[typeof t]&&t&&!t.nodeType&&t,o[typeof r]&&r&&!r.nodeType&&r,o[typeof n]&&n);return!s||s.global!==s&&s.window!==s||(t.root=a=s),n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription",["@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscription"),u=n(c),l=function(e){function t(r,n){i(this,t),e.call(this),this.subject=r,this.observer=n,this.isUnsubscribed=!1}return o(t,e),t.prototype.unsubscribe=function(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var e=this.subject,t=e.observers;if(this.subject=void 0,t&&0!==t.length&&!e.isUnsubscribed){var r=t.indexOf(this.observer);-1!==r&&t.splice(r,1)}}},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("angular2/src/core/pipes/invalid_pipe_argument_exception",["angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/exceptions"),s=function(e){function t(t,r){e.call(this,"Invalid argument '"+r+"' for pipe '"+t+"'")}return o(t,e),t}(a.BaseException);return t.InvalidPipeArgumentException=s,n.define=i,r.exports}),System.register("angular2/src/core/facade/intl",[],!0,function(e,t,r){function n(e){return 2==e?"2-digit":"numeric"}function i(e){return 4>e?"short":"long"}function o(e){for(var t,r={},o=0;o<e.length;){for(t=o;t<e.length&&e[t]==e[o];)t++;var a=t-o;switch(e[o]){case"G":r.era=i(a);break;case"y":r.year=n(a);break;case"M":r.month=a>=3?i(a):n(a);break;case"d":r.day=n(a);break;case"E":r.weekday=i(a);break;case"j":r.hour=n(a);break;case"h":r.hour=n(a),r.hour12=!0;break;case"H":r.hour=n(a),r.hour12=!1;break;case"m":r.minute=n(a);break;case"s":r.second=n(a);break;case"z":r.timeZoneName="long";break;case"Z":r.timeZoneName="short"}o=t}return r}var a=System.global,s=a.define;a.define=void 0,function(e){e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency"}(t.NumberFormatStyle||(t.NumberFormatStyle={}));var c=t.NumberFormatStyle,u=function(){function e(){}return e.format=function(e,t,r,n){var i=void 0===n?{}:n,o=i.minimumIntegerDigits,a=void 0===o?1:o,s=i.minimumFractionDigits,u=void 0===s?0:s,l=i.maximumFractionDigits,p=void 0===l?3:l,f=i.currency,d=i.currencyAsSymbol,h=void 0===d?!1:d,g={minimumIntegerDigits:a,minimumFractionDigits:u,maximumFractionDigits:p};return g.style=c[r].toLowerCase(),r==c.Currency&&(g.currency=f,g.currencyDisplay=h?"symbol":"code"),new Intl.NumberFormat(t,g).format(e)},e}();t.NumberFormatter=u;var l=new Map,p=function(){function e(){}return e.format=function(e,t,r){var n=t+r;if(l.has(n))return l.get(n).format(e);var i=new Intl.DateTimeFormat(t,o(r));return l.set(n,i),i.format(e)},e}();return t.DateFormatter=p,a.define=s,r.exports}),System.register("angular2/src/core/pipes/uppercase_pipe",["angular2/src/core/facade/lang","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/metadata"),u=e("angular2/src/core/di"),l=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),p=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),s.isBlank(t))return t;if(!s.isString(t))throw new l.InvalidPipeArgumentException(e,t);return s.StringWrapper.toUpperCase(t)},e=o([s.CONST(),c.Pipe({name:"uppercase"}),u.Injectable(),a("design:paramtypes",[])],e)}();return t.UpperCasePipe=p,n.define=i,r.exports}),System.register("angular2/src/core/pipes/lowercase_pipe",["angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/metadata","angular2/src/core/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/di"),u=e("angular2/src/core/metadata"),l=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),p=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),s.isBlank(t))return t;if(!s.isString(t))throw new l.InvalidPipeArgumentException(e,t);return s.StringWrapper.toLowerCase(t)},e=o([s.CONST(),u.Pipe({name:"lowercase"}),c.Injectable(),a("design:paramtypes",[])],e)}();return t.LowerCasePipe=p,n.define=i,r.exports}),System.register("angular2/src/core/pipes/json_pipe",["angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/di"),u=e("angular2/src/core/metadata"),l=function(){function e(){}return e.prototype.transform=function(e,t){return void 0===t&&(t=null),s.Json.stringify(e)},e=o([s.CONST(),u.Pipe({name:"json"}),c.Injectable(),a("design:paramtypes",[])],e)}();return t.JsonPipe=l,n.define=i,r.exports}),System.register("angular2/src/core/pipes/slice_pipe",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/di","angular2/src/core/pipes/invalid_pipe_argument_exception","angular2/src/core/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/exceptions"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/di"),p=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),f=e("angular2/src/core/metadata"),d=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),s.isBlank(r)||0==r.length)throw new c.BaseException("Slice pipe requires one argument");if(!this.supports(t))throw new p.InvalidPipeArgumentException(e,t);if(s.isBlank(t))return t;var n=r[0],i=r.length>1?r[1]:null;return s.isString(t)?s.StringWrapper.slice(t,n,i):u.ListWrapper.slice(t,n,i)},e.prototype.supports=function(e){return s.isString(e)||s.isArray(e)},e=o([f.Pipe({name:"slice"}),l.Injectable(),a("design:paramtypes",[])],e)}();return t.SlicePipe=d,n.define=i,r.exports}),System.register("angular2/src/core/pipes/number_pipe",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/intl","angular2/src/core/di","angular2/src/core/metadata","angular2/src/core/facade/collection","angular2/src/core/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=e("angular2/src/core/facade/intl"),p=e("angular2/src/core/di"),f=e("angular2/src/core/metadata"),d=e("angular2/src/core/facade/collection"),h=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),g="en-US",v=c.RegExpWrapper.create("^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$"),y=function(){function e(){}return e._format=function(t,r,n,i,o){if(void 0===i&&(i=null),void 0===o&&(o=!1),c.isBlank(t))return null;if(!c.isNumber(t))throw new h.InvalidPipeArgumentException(e,t);var a=1,s=0,p=3;if(c.isPresent(n)){var f=c.RegExpWrapper.firstMatch(v,n);if(c.isBlank(f))throw new u.BaseException(n+" is not a valid digit info for number pipes");c.isPresent(f[1])&&(a=c.NumberWrapper.parseIntAutoRadix(f[1])),c.isPresent(f[3])&&(s=c.NumberWrapper.parseIntAutoRadix(f[3])),c.isPresent(f[5])&&(p=c.NumberWrapper.parseIntAutoRadix(f[5]))}return l.NumberFormatter.format(t,g,r,{minimumIntegerDigits:a,minimumFractionDigits:s,maximumFractionDigits:p,currency:i,currencyAsSymbol:o})},e=a([c.CONST(),p.Injectable(),s("design:paramtypes",[])],e)}();t.NumberPipe=y;var m=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=d.ListWrapper.first(t);return y._format(e,l.NumberFormatStyle.Decimal,r)},t=a([c.CONST(),f.Pipe({name:"number"}),p.Injectable(),s("design:paramtypes",[])],t)}(y);t.DecimalPipe=m;var _=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=d.ListWrapper.first(t);return y._format(e,l.NumberFormatStyle.Percent,r)},t=a([c.CONST(),f.Pipe({name:"percent"}),p.Injectable(),s("design:paramtypes",[])],t)}(y);t.PercentPipe=_;var b=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.transform=function(e,t){var r=c.isPresent(t)&&t.length>0?t[0]:"USD",n=c.isPresent(t)&&t.length>1?t[1]:!1,i=c.isPresent(t)&&t.length>2?t[2]:null;return y._format(e,l.NumberFormatStyle.Currency,i,r,n)},t=a([c.CONST(),f.Pipe({name:"currency"}),p.Injectable(),s("design:paramtypes",[])],t)}(y);return t.CurrencyPipe=b,n.define=i,r.exports}),System.register("angular2/src/core/facade",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang");t.Type=o.Type;var a=e("angular2/src/core/facade/async");t.Observable=a.Observable,t.EventEmitter=a.EventEmitter;var s=e("angular2/src/core/facade/exceptions");return t.WrappedException=s.WrappedException,n.define=i,r.exports}),System.register("angular2/src/core/linker/template_commands",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(){return y++}function i(e,t,r){return new w(e,t,r)}function o(e){return new j(e)}function a(e,t,r,n,i,o,a){return new S(e,t,r,n,i,o,a)}function s(){return new C}function c(e,t,r,n,i,o,a,s){return new E(e,t,r,n,i,o,a,s)}function u(){return new R}function l(e,t,r,n,i,o,a){return new O(e,t,r,n,i,o,a)}function p(e,t,r){void 0===r&&(r=null);for(var n=0;n<t.length;n++)t[n].visit(e,r)}var f=System.global,d=f.define;f.define=void 0;var h=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},g=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},v=e("angular2/src/core/facade/lang"),y=0;t.nextTemplateId=n;var m=function(){function e(e){this._templateGetter=e}return e.prototype.getTemplate=function(){return this._templateGetter()},e=h([v.CONST(),g("design:paramtypes",[Function])],e)}();t.CompiledHostTemplate=m;var _=function(){function e(e,t){this.id=e,this._dataGetter=t}return e.prototype.getData=function(e){var t=this._dataGetter(e,this.id);return new b(t[0],t[1],t[2])},e}();t.CompiledTemplate=_;var b=function(){function e(e,t,r){this.changeDetectorFactory=e,this.commands=t,this.styles=r}return e}();t.CompiledTemplateData=b;var x=v.CONST_EXPR([]),w=function(){function e(e,t,r){this.value=e,this.isBound=t,this.ngContentIndex=r}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.TextCmd=w,t.text=i;var j=function(){function e(e){this.ngContentIndex=e,this.isBound=!1}return e.prototype.visit=function(e,t){return e.visitNgContent(this,t)},e}();t.NgContentCmd=j,t.ngContent=o;var S=function(){function e(e,t,r,n,i,o,a){this.name=e,this.attrNameAndValues=t,this.eventTargetAndNames=r,this.variableNameAndValues=n,this.directives=i,this.isBound=o,this.ngContentIndex=a}return e.prototype.visit=function(e,t){return e.visitBeginElement(this,t)},e}();t.BeginElementCmd=S,t.beginElement=a;var C=function(){function e(){}return e.prototype.visit=function(e,t){return e.visitEndElement(t)},e}();t.EndElementCmd=C,t.endElement=s;var E=function(){function e(e,t,r,n,i,o,a,s){this.name=e,this.attrNameAndValues=t,this.eventTargetAndNames=r,this.variableNameAndValues=n,this.directives=i,this.nativeShadow=o,this.ngContentIndex=a,this.template=s,this.isBound=!0,this.templateId=s.id}return e.prototype.visit=function(e,t){return e.visitBeginComponent(this,t)},e}();t.BeginComponentCmd=E,t.beginComponent=c;var R=function(){function e(){}return e.prototype.visit=function(e,t){return e.visitEndComponent(t)},e}();t.EndComponentCmd=R,t.endComponent=u;var O=function(){function e(e,t,r,n,i,o,a){this.attrNameAndValues=e,this.variableNameAndValues=t,this.directives=r,this.isMerged=n,this.ngContentIndex=i,this.changeDetectorFactory=o,this.children=a,this.isBound=!0,this.name=null,this.eventTargetAndNames=x}return e.prototype.visit=function(e,t){return e.visitEmbeddedTemplate(this,t)},e}();return t.EmbeddedTemplateCmd=O,t.embeddedTemplate=l,t.visitAllCommands=p,f.define=d,r.exports}),System.register("angular2/src/core/compiler/selector",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/exceptions"),c="",u=a.RegExpWrapper.create("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)"),l=function(){function e(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return e.parse=function(t){for(var r,n=[],i=function(e,t){t.notSelectors.length>0&&a.isBlank(t.element)&&o.ListWrapper.isEmpty(t.classNames)&&o.ListWrapper.isEmpty(t.attrs)&&(t.element="*"),e.push(t)},c=new e,l=a.RegExpWrapper.matcher(u,t),p=c,f=!1;a.isPresent(r=a.RegExpMatcherWrapper.next(l));){if(a.isPresent(r[1])){if(f)throw new s.BaseException("Nesting :not is not allowed in a selector");f=!0,p=new e,c.notSelectors.push(p)}if(a.isPresent(r[2])&&p.setElement(r[2]),a.isPresent(r[3])&&p.addClassName(r[3]),a.isPresent(r[4])&&p.addAttribute(r[4],r[5]),a.isPresent(r[6])&&(f=!1,p=c),a.isPresent(r[7])){if(f)throw new s.BaseException("Multiple selectors in :not are not supported");i(n,c),c=p=new e}}return i(n,c),n},e.prototype.isElementSelector=function(){return a.isPresent(this.element)&&o.ListWrapper.isEmpty(this.classNames)&&o.ListWrapper.isEmpty(this.attrs)&&0===this.notSelectors.length},e.prototype.setElement=function(e){void 0===e&&(e=null),a.isPresent(e)&&(e=e.toLowerCase()),this.element=e},e.prototype.getMatchingElementTemplate=function(){for(var e=a.isPresent(this.element)?this.element:"div",t=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",r="",n=0;n<this.attrs.length;n+=2){var i=this.attrs[n],o=""!==this.attrs[n+1]?'="'+this.attrs[n+1]+'"':"";r+=" "+i+o}return"<"+e+t+r+"></"+e+">"},e.prototype.addAttribute=function(e,t){void 0===t&&(t=c),this.attrs.push(e.toLowerCase()),t=a.isPresent(t)?t.toLowerCase():c,this.attrs.push(t)},e.prototype.addClassName=function(e){this.classNames.push(e.toLowerCase())},e.prototype.toString=function(){var e="";if(a.isPresent(this.element)&&(e+=this.element),a.isPresent(this.classNames))for(var t=0;t<this.classNames.length;t++)e+="."+this.classNames[t];if(a.isPresent(this.attrs))for(var t=0;t<this.attrs.length;){var r=this.attrs[t++],n=this.attrs[t++];e+="["+r,n.length>0&&(e+="="+n),e+="]"}return o.ListWrapper.forEach(this.notSelectors,function(t){e+=":not("+t.toString()+")"}),e},e}();t.CssSelector=l;var p=function(){function e(){this._elementMap=new o.Map,this._elementPartialMap=new o.Map,this._classMap=new o.Map,this._classPartialMap=new o.Map,this._attrValueMap=new o.Map,this._attrValuePartialMap=new o.Map,this._listContexts=[]}return e.createNotMatcher=function(t){var r=new e;return r.addSelectables(t,null),r},e.prototype.addSelectables=function(e,t){var r=null;e.length>1&&(r=new f(e),this._listContexts.push(r));for(var n=0;n<e.length;n++)this._addSelectable(e[n],t,r)},e.prototype._addSelectable=function(e,t,r){var n=this,i=e.element,s=e.classNames,c=e.attrs,u=new d(e,t,r);if(a.isPresent(i)){var l=0===c.length&&0===s.length;l?this._addTerminal(n._elementMap,i,u):n=this._addPartial(n._elementPartialMap,i)}if(a.isPresent(s))for(var p=0;p<s.length;p++){var l=0===c.length&&p===s.length-1,f=s[p];l?this._addTerminal(n._classMap,f,u):n=this._addPartial(n._classPartialMap,f)}if(a.isPresent(c))for(var p=0;p<c.length;){var l=p===c.length-2,h=c[p++],g=c[p++];if(l){var v=n._attrValueMap,y=v.get(h);a.isBlank(y)&&(y=new o.Map,v.set(h,y)),this._addTerminal(y,g,u)}else{var m=n._attrValuePartialMap,_=m.get(h);a.isBlank(_)&&(_=new o.Map,m.set(h,_)),n=this._addPartial(_,g)}}},e.prototype._addTerminal=function(e,t,r){var n=e.get(t);a.isBlank(n)&&(n=[],e.set(t,n)),n.push(r)},e.prototype._addPartial=function(t,r){var n=t.get(r);return a.isBlank(n)&&(n=new e,t.set(r,n)),n},e.prototype.match=function(e,t){for(var r=!1,n=e.element,i=e.classNames,o=e.attrs,s=0;s<this._listContexts.length;s++)this._listContexts[s].alreadyMatched=!1;if(r=this._matchTerminal(this._elementMap,n,e,t)||r,r=this._matchPartial(this._elementPartialMap,n,e,t)||r,a.isPresent(i))for(var u=0;u<i.length;u++){var l=i[u];r=this._matchTerminal(this._classMap,l,e,t)||r,r=this._matchPartial(this._classPartialMap,l,e,t)||r;
}if(a.isPresent(o))for(var u=0;u<o.length;){var p=o[u++],f=o[u++],d=this._attrValueMap.get(p);a.StringWrapper.equals(f,c)||(r=this._matchTerminal(d,c,e,t)||r),r=this._matchTerminal(d,f,e,t)||r;var h=this._attrValuePartialMap.get(p);a.StringWrapper.equals(f,c)||(r=this._matchPartial(h,c,e,t)||r),r=this._matchPartial(h,f,e,t)||r}return r},e.prototype._matchTerminal=function(e,t,r,n){if(a.isBlank(e)||a.isBlank(t))return!1;var i=e.get(t),o=e.get("*");if(a.isPresent(o)&&(i=i.concat(o)),a.isBlank(i))return!1;for(var s,c=!1,u=0;u<i.length;u++)s=i[u],c=s.finalize(r,n)||c;return c},e.prototype._matchPartial=function(e,t,r,n){if(a.isBlank(e)||a.isBlank(t))return!1;var i=e.get(t);return a.isBlank(i)?!1:i.match(r,n)},e}();t.SelectorMatcher=p;var f=function(){function e(e){this.selectors=e,this.alreadyMatched=!1}return e}();t.SelectorListContext=f;var d=function(){function e(e,t,r){this.selector=e,this.cbContext=t,this.listContext=r,this.notSelectors=e.notSelectors}return e.prototype.finalize=function(e,t){var r=!0;if(this.notSelectors.length>0&&(a.isBlank(this.listContext)||!this.listContext.alreadyMatched)){var n=p.createNotMatcher(this.notSelectors);r=!n.match(e,null)}return r&&a.isPresent(t)&&(a.isBlank(this.listContext)||!this.listContext.alreadyMatched)&&(a.isPresent(this.listContext)&&(this.listContext.alreadyMatched=!0),t(this.selector,this.cbContext)),r},e}();return t.SelectorContext=d,n.define=i,r.exports}),System.register("angular2/src/core/compiler/util",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return y.StringWrapper.replaceAllMapped(e,m,function(e){return"-"+e[1].toLowerCase()})}function i(e){return y.StringWrapper.replaceAllMapped(e,_,function(e){return e[1].toUpperCase()})}function o(e){return y.isBlank(e)?null:"'"+s(e,b)+"'"}function a(e){return y.isBlank(e)?null:'"'+s(e,x)+'"'}function s(e,r){return y.StringWrapper.replaceAllMapped(e,r,function(e){return"$"==e[0]?t.IS_DART?"\\$":"$":"\n"==e[0]?"\\n":"\\"+e[0]})}function c(e,r){void 0===r&&(r=!1);var n=t.IS_DART&&r?"const "+e:"var "+e;return t.IS_DART?n+" = ":n+" = exports['"+e+"'] = "}function u(e){return(t.IS_DART?"..addAll":".concat")+"("+e+")"}function l(e,r){return t.IS_DART?".map( ("+e.join(",")+") => "+r+" ).toList()":".map(function("+e.join(",")+") { return "+r+"; })"}function p(e,r){return t.IS_DART?".replaceAll('"+e+"', "+r+")":".replace(/"+e+"/g, "+r+")"}function f(e,r,n){return void 0===n&&(n=""),t.IS_DART?n+"("+e.join(",")+") => "+r:"function "+n+"("+e.join(",")+") { return "+r+"; }"}function d(e){return t.IS_DART?"'${"+e+"}'":e}function h(e,t){var r=y.StringWrapper.split(e.trim(),/\s*:\s*/g);return r.length>1?r:t}var g=System.global,v=g.define;g.define=void 0;var y=e("angular2/src/core/facade/lang"),m=/([A-Z])/g,_=/-([a-z])/g,b=/'|\\|\n|\$/g,x=/"|\\|\n|\$/g;return t.IS_DART=!y.isJsObject({}),t.MODULE_SUFFIX=t.IS_DART?".dart":".js",t.camelCaseToDashCase=n,t.dashCaseToCamelCase=i,t.escapeSingleQuoteString=o,t.escapeDoubleQuoteString=a,t.codeGenExportVariable=c,t.codeGenConcatArray=u,t.codeGenMapArray=l,t.codeGenReplaceAll=p,t.codeGenValueFn=f,t.codeGenToString=d,t.splitAtColon=h,g.define=v,r.exports}),System.register("angular2/src/core/linker/interfaces",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,function(e){e[e.OnInit=0]="OnInit",e[e.OnDestroy=1]="OnDestroy",e[e.DoCheck=2]="DoCheck",e[e.OnChanges=3]="OnChanges",e[e.AfterContentInit=4]="AfterContentInit",e[e.AfterContentChecked=5]="AfterContentChecked",e[e.AfterViewInit=6]="AfterViewInit",e[e.AfterViewChecked=7]="AfterViewChecked"}(t.LifecycleHooks||(t.LifecycleHooks={}));var o=t.LifecycleHooks;return t.LIFECYCLE_HOOKS_VALUES=[o.OnInit,o.OnDestroy,o.DoCheck,o.OnChanges,o.AfterContentInit,o.AfterContentChecked,o.AfterViewInit,o.AfterViewChecked],n.define=i,r.exports}),System.register("angular2/src/core/compiler/source_module",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return"#MODULE["+e+"]"}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=/#MODULE\[([^\]]*)\]/g;t.moduleRef=n;var c=function(){function e(e,t){this.moduleUrl=e,this.sourceWithModuleRefs=t}return e.prototype.getSourceWithImports=function(){var e=this,t={},r=[],n=a.StringWrapper.replaceAllMapped(this.sourceWithModuleRefs,s,function(n){var i=n[1],o=t[i];return a.isBlank(o)&&(i==e.moduleUrl?o="":(o="import"+r.length,r.push([i,o])),t[i]=o),o.length>0?o+".":""});return new p(n,r)},e}();t.SourceModule=c;var u=function(){function e(e,t){this.declarations=e,this.expression=t}return e}();t.SourceExpression=u;var l=function(){function e(e,t){this.declarations=e,this.expressions=t}return e}();t.SourceExpressions=l;var p=function(){function e(e,t){this.source=e,this.imports=t}return e}();return t.SourceWithImports=p,i.define=o,r.exports}),System.register("angular2/src/core/compiler/template_ast",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e,t,r){void 0===r&&(r=null);var n=[];return t.forEach(function(t){var i=t.visit(e,r);a.isPresent(i)&&n.push(i)}),n}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=function(){function e(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.TextAst=s;var c=function(){function e(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitBoundText(this,t)},e}();t.BoundTextAst=c;var u=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitAttr(this,t)},e}();t.AttrAst=u;var l=function(){function e(e,t,r,n,i){this.name=e,this.type=t,this.value=r,this.unit=n,this.sourceInfo=i}return e.prototype.visit=function(e,t){return e.visitElementProperty(this,t)},e}();t.BoundElementPropertyAst=l;var p=function(){function e(e,t,r,n){this.name=e,this.target=t,this.handler=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitEvent(this,t)},Object.defineProperty(e.prototype,"fullName",{get:function(){return a.isPresent(this.target)?this.target+":"+this.name:this.name},enumerable:!0,configurable:!0}),e}();t.BoundEventAst=p;var f=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitVariable(this,t)},e}();t.VariableAst=f;var d=function(){function e(e,t,r,n,i,o,a,s,c){this.name=e,this.attrs=t,this.inputs=r,this.outputs=n,this.exportAsVars=i,this.directives=o,this.children=a,this.ngContentIndex=s,this.sourceInfo=c}return e.prototype.visit=function(e,t){return e.visitElement(this,t)},e.prototype.isBound=function(){return this.inputs.length>0||this.outputs.length>0||this.exportAsVars.length>0||this.directives.length>0},e.prototype.getComponent=function(){return this.directives.length>0&&this.directives[0].directive.isComponent?this.directives[0].directive:null},e}();t.ElementAst=d;var h=function(){function e(e,t,r,n,i,o){this.attrs=e,this.vars=t,this.directives=r,this.children=n,this.ngContentIndex=i,this.sourceInfo=o}return e.prototype.visit=function(e,t){return e.visitEmbeddedTemplate(this,t)},e}();t.EmbeddedTemplateAst=h;var g=function(){function e(e,t,r,n){this.directiveName=e,this.templateName=t,this.value=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitDirectiveProperty(this,t)},e}();t.BoundDirectivePropertyAst=g;var v=function(){function e(e,t,r,n,i,o){this.directive=e,this.inputs=t,this.hostProperties=r,this.hostEvents=n,this.exportAsVars=i,this.sourceInfo=o}return e.prototype.visit=function(e,t){return e.visitDirective(this,t)},e}();t.DirectiveAst=v;var y=function(){function e(e,t){this.ngContentIndex=e,this.sourceInfo=t}return e.prototype.visit=function(e,t){return e.visitNgContent(this,t)},e}();return t.NgContentAst=y,function(e){e[e.Property=0]="Property",e[e.Attribute=1]="Attribute",e[e.Class=2]="Class",e[e.Style=3]="Style"}(t.PropertyBindingType||(t.PropertyBindingType={})),t.PropertyBindingType,t.templateVisitAll=n,i.define=o,r.exports}),System.register("angular2/src/transform/template_compiler/change_detector_codegen",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e){}return e.prototype.generate=function(e,t,r){throw"Not implemented in JS"},e.prototype.toString=function(){throw"Not implemented in JS"},e}();return t.Codegen=o,n.define=i,r.exports}),System.register("angular2/src/core/compiler/xhr",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e.prototype.get=function(e){return null},e}();return t.XHR=o,n.define=i,r.exports}),System.register("angular2/src/core/dom/dom_adapter",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){a.isBlank(t.DOM)&&(t.DOM=e)}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang");t.setRootDomAdapter=n;var s=function(){function e(){}return e}();return t.DomAdapter=s,i.define=o,r.exports}),System.register("angular2/src/core/compiler/url_resolver",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/collection"],!0,function(e,t,r){function n(e,t,r,n,i,o,a){var s=[];return d.isPresent(e)&&s.push(e+":"),d.isPresent(r)&&(s.push("//"),d.isPresent(t)&&s.push(t+"@"),s.push(r),d.isPresent(n)&&s.push(":"+n)),d.isPresent(i)&&s.push(i),d.isPresent(o)&&s.push("?"+o),d.isPresent(a)&&s.push("#"+a),s.join("")}function i(e){return d.RegExpWrapper.firstMatch(y,e)}function o(e){if("/"==e)return"/";for(var t="/"==e[0]?"/":"",r="/"===e[e.length-1]?"/":"",n=e.split("/"),i=[],o=0,a=0;a<n.length;a++){var s=n[a];switch(s){case"":case".":break;case"..":i.length>0?h.ListWrapper.removeAt(i,i.length-1):o++;break;default:i.push(s)}}if(""==t){for(;o-->0;)h.ListWrapper.insert(i,0,"..");0===i.length&&i.push(".")}return t+i.join("/")+r}function a(e){var t=e[v.Path];return t=d.isBlank(t)?"":o(t),e[v.Path]=t,n(e[v.Scheme],e[v.UserInfo],e[v.Domain],e[v.Port],t,e[v.QueryData],e[v.Fragment])}function s(e,t){var r=i(encodeURI(t)),n=i(e);if(d.isPresent(r[v.Scheme]))return a(r);r[v.Scheme]=n[v.Scheme];for(var o=v.Scheme;o<=v.Port;o++)d.isBlank(r[o])&&(r[o]=n[o]);if("/"==r[v.Path][0])return a(r);var s=n[v.Path];d.isBlank(s)&&(s="/");var c=s.lastIndexOf("/");return s=s.substring(0,c+1)+r[v.Path],r[v.Path]=s,a(r)}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=e("angular2/src/core/di"),d=e("angular2/src/core/facade/lang"),h=e("angular2/src/core/facade/collection"),g=function(){function e(){}return e.prototype.resolve=function(e,t){return s(e,t)},e=l([f.Injectable(),p("design:paramtypes",[])],e)}();t.UrlResolver=g;var v,y=d.RegExpWrapper.create("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");return function(e){e[e.Scheme=1]="Scheme",e[e.UserInfo=2]="UserInfo",e[e.Domain=3]="Domain",e[e.Port=4]="Port",e[e.Path=5]="Path",e[e.QueryData=6]="QueryData",e[e.Fragment=7]="Fragment"}(v||(v={})),c.define=u,r.exports}),System.register("angular2/src/core/compiler/style_url_resolver",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e,t,r){var n=[];return r=i(e,t,r,n),r=o(e,t,r),new u(r,n)}function i(e,t,r,n){return c.StringWrapper.replaceAllMapped(r,p,function(r){var i=c.isPresent(r[1])?r[1]:r[2];return n.push(e.resolve(t,i)),""})}function o(e,t,r){return c.StringWrapper.replaceAllMapped(r,l,function(r){var n=r[1],i=r[2];if(c.RegExpWrapper.test(d,i))return r[0];var o=c.StringWrapper.replaceAll(i,f,""),a=r[3],s=e.resolve(t,o);return n+"'"+s+"'"+a})}var a=System.global,s=a.define;a.define=void 0;var c=e("angular2/src/core/facade/lang");t.resolveStyleUrls=n;var u=function(){function e(e,t){this.style=e,this.styleUrls=t}return e}();t.StyleWithImports=u;var l=/(url\()([^)]*)(\))/g,p=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,f=/['"]/g,d=/^['"]?data:/g;return a.define=s,r.exports}),System.register("angular2/src/core/compiler/command_compiler",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/linker/template_commands","angular2/src/core/compiler/template_ast","angular2/src/core/compiler/source_module","angular2/src/core/metadata/view","angular2/src/core/compiler/style_compiler","angular2/src/core/compiler/util","angular2/src/core/di"],!0,function(e,t,r){function n(e,t,r){return g.templateVisitAll(e,t,r),r}function i(e){for(var t=new Set,r=[],n=0;n<e.length;n+=2){var i=e[n],o=e[n+1],a=i+":"+o;d.SetWrapper.has(t,a)||(r.push(i),r.push(o),t.add(a))}return r}function o(e){return e instanceof R?e.value:f.isString(e)?_.escapeSingleQuoteString(e):f.isBlank(e)?"null":""+e}function a(e){return"["+e.map(o).join(",")+"]"}function s(e){var t=e.map(function(e){return""+v.moduleRef(e.type.moduleUrl)+e.type.name});return"["+t.join(",")+"]"}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/facade/collection"),h=e("angular2/src/core/linker/template_commands"),g=e("angular2/src/core/compiler/template_ast"),v=e("angular2/src/core/compiler/source_module"),y=e("angular2/src/core/metadata/view"),m=e("angular2/src/core/compiler/style_compiler"),_=e("angular2/src/core/compiler/util"),b=e("angular2/src/core/di");t.TEMPLATE_COMMANDS_MODULE_REF=v.moduleRef("package:angular2/src/core/linker/template_commands"+_.MODULE_SUFFIX);var x="$implicit",w=function(){function e(){}return e.prototype.compileComponentRuntime=function(e,t,r,n,i,o){var a=new C(new j(e,t,r,o,i),0);return g.templateVisitAll(a,n),a.result},e.prototype.compileComponentCodeGen=function(e,t,r,n,i,o){var a=new C(new S(e,t,r,o,i),0);g.templateVisitAll(a,n);var s="["+a.result.join(",")+"]";return new v.SourceExpression([],s)},e=l([b.Injectable(),p("design:paramtypes",[])],e)}();t.CommandCompiler=w;var j=function(){function e(e,t,r,n,i){this.component=e,this.appId=t,this.templateId=r,this.componentTemplateFactory=n,this.changeDetectorFactories=i}return e.prototype._mapDirectives=function(e){return e.map(function(e){return e.type.runtime})},e.prototype._addStyleShimAttributes=function(e,t,r){var n=[];return f.isPresent(t)&&t.template.encapsulation===y.ViewEncapsulation.Emulated&&(n.push(m.shimHostAttribute(this.appId,r)),n.push("")),this.component.template.encapsulation===y.ViewEncapsulation.Emulated&&(n.push(m.shimContentAttribute(this.appId,this.templateId)),n.push("")),n.concat(e)},e.prototype.createText=function(e,t,r){return h.text(e,t,r)},e.prototype.createNgContent=function(e){return h.ngContent(e)},e.prototype.createBeginElement=function(e,t,r,n,i,o,a){return h.beginElement(e,this._addStyleShimAttributes(t,null,null),r,n,this._mapDirectives(i),o,a)},e.prototype.createEndElement=function(){return h.endElement()},e.prototype.createBeginComponent=function(e,t,r,n,i,o,a){var s=this.componentTemplateFactory(i[0]);return h.beginComponent(e,this._addStyleShimAttributes(t,i[0],s.id),r,n,this._mapDirectives(i),o,a,s)},e.prototype.createEndComponent=function(){return h.endComponent()},e.prototype.createEmbeddedTemplate=function(e,t,r,n,i,o,a){return h.embeddedTemplate(t,r,this._mapDirectives(n),i,o,this.changeDetectorFactories[e],a)},e}(),S=function(){function e(e,t,r,n,i){this.component=e,this.appIdExpr=t,this.templateIdExpr=r,this.componentTemplateFactory=n,this.changeDetectorFactoryExpressions=i}return e.prototype._addStyleShimAttributes=function(e,t,r){var n=[];return f.isPresent(t)&&t.template.encapsulation===y.ViewEncapsulation.Emulated&&(n.push(new R(m.shimHostAttributeExpr(this.appIdExpr,r))),n.push("")),this.component.template.encapsulation===y.ViewEncapsulation.Emulated&&(n.push(new R(m.shimContentAttributeExpr(this.appIdExpr,this.templateIdExpr))),n.push("")),n.concat(e)},e.prototype.createText=function(e,r,n){return t.TEMPLATE_COMMANDS_MODULE_REF+"text("+_.escapeSingleQuoteString(e)+", "+r+", "+n+")"},e.prototype.createNgContent=function(e){return t.TEMPLATE_COMMANDS_MODULE_REF+"ngContent("+e+")"},e.prototype.createBeginElement=function(e,r,n,i,o,c,u){var l=a(this._addStyleShimAttributes(r,null,null));return t.TEMPLATE_COMMANDS_MODULE_REF+"beginElement("+_.escapeSingleQuoteString(e)+", "+l+", "+a(n)+", "+a(i)+", "+s(o)+", "+c+", "+u+")"},e.prototype.createEndElement=function(){return t.TEMPLATE_COMMANDS_MODULE_REF+"endElement()"},e.prototype.createBeginComponent=function(e,r,n,i,o,c,u){var l=this.componentTemplateFactory(o[0]),p=a(this._addStyleShimAttributes(r,o[0],l+".id"));return t.TEMPLATE_COMMANDS_MODULE_REF+"beginComponent("+_.escapeSingleQuoteString(e)+", "+p+", "+a(n)+", "+a(i)+", "+s(o)+", "+c+", "+u+", "+l+")"},e.prototype.createEndComponent=function(){return t.TEMPLATE_COMMANDS_MODULE_REF+"endComponent()"},e.prototype.createEmbeddedTemplate=function(e,r,n,i,o,c,u){return t.TEMPLATE_COMMANDS_MODULE_REF+"embeddedTemplate("+a(r)+", "+a(n)+", "+(s(i)+", "+o+", "+c+", "+this.changeDetectorFactoryExpressions[e]+", ["+u.join(",")+"])")},e}(),C=function(){function e(e,t){this.commandFactory=e,this.embeddedTemplateIndex=t,this.result=[],this.transitiveNgContentCount=0}return e.prototype._readAttrNameAndValues=function(e,t){var r=n(this,t,[]);return e.forEach(function(e){d.StringMapWrapper.forEach(e.hostAttributes,function(e,t){r.push(t),r.push(e)})}),i(r)},e.prototype.visitNgContent=function(e,t){return this.transitiveNgContentCount++,this.result.push(this.commandFactory.createNgContent(e.ngContentIndex)),null},e.prototype.visitEmbeddedTemplate=function(t,r){var n=this;this.embeddedTemplateIndex++;var i=new e(this.commandFactory,this.embeddedTemplateIndex);g.templateVisitAll(i,t.children);var o=i.transitiveNgContentCount>0,a=[];t.vars.forEach(function(e){a.push(e.name),a.push(e.value.length>0?e.value:x)});var s=[];return d.ListWrapper.forEachWithIndex(t.directives,function(e,t){e.visit(n,new E(t,[],[],s))}),this.result.push(this.commandFactory.createEmbeddedTemplate(this.embeddedTemplateIndex,this._readAttrNameAndValues(s,t.attrs),a,s,o,t.ngContentIndex,i.result)),this.transitiveNgContentCount+=i.transitiveNgContentCount,this.embeddedTemplateIndex=i.embeddedTemplateIndex,null},e.prototype.visitElement=function(e,t){var r=this,o=e.getComponent(),a=n(this,e.outputs,[]),s=[];f.isBlank(o)&&e.exportAsVars.forEach(function(e){s.push(e.name),s.push(null)});var c=[];d.ListWrapper.forEachWithIndex(e.directives,function(e,t){e.visit(r,new E(t,a,s,c))}),a=i(a);var u=this._readAttrNameAndValues(c,e.attrs);return f.isPresent(o)?(this.result.push(this.commandFactory.createBeginComponent(e.name,u,a,s,c,o.template.encapsulation===y.ViewEncapsulation.Native,e.ngContentIndex)),g.templateVisitAll(this,e.children),this.result.push(this.commandFactory.createEndComponent())):(this.result.push(this.commandFactory.createBeginElement(e.name,u,a,s,c,e.isBound(),e.ngContentIndex)),g.templateVisitAll(this,e.children),this.result.push(this.commandFactory.createEndElement())),null},e.prototype.visitVariable=function(e,t){return null},e.prototype.visitAttr=function(e,t){return t.push(e.name),t.push(e.value),null},e.prototype.visitBoundText=function(e,t){return this.result.push(this.commandFactory.createText(null,!0,e.ngContentIndex)),null},e.prototype.visitText=function(e,t){return this.result.push(this.commandFactory.createText(e.value,!1,e.ngContentIndex)),null},e.prototype.visitDirective=function(e,t){return t.targetDirectives.push(e.directive),g.templateVisitAll(this,e.hostEvents,t.eventTargetAndNames),e.exportAsVars.forEach(function(e){t.targetVariableNameAndValues.push(e.name),t.targetVariableNameAndValues.push(t.index)}),null},e.prototype.visitEvent=function(e,t){return t.push(e.target),t.push(e.name),null},e.prototype.visitDirectiveProperty=function(e,t){return null},e.prototype.visitElementProperty=function(e,t){return null},e}(),E=function(){function e(e,t,r,n){this.index=e,this.eventTargetAndNames=t,this.targetVariableNameAndValues=r,this.targetDirectives=n}return e}(),R=function(){function e(e){this.value=e}return e}();return c.define=u,r.exports}),System.register("angular2/src/core/compiler/html_ast",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e,t,r){void 0===r&&(r=null);var n=[];return t.forEach(function(t){var i=t.visit(e,r);a.isPresent(i)&&n.push(i)}),n}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=function(){function e(e,t){this.value=e,this.sourceInfo=t}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.HtmlTextAst=s;var c=function(){function e(e,t,r){this.name=e,this.value=t,this.sourceInfo=r}return e.prototype.visit=function(e,t){return e.visitAttr(this,t)},e}();t.HtmlAttrAst=c;var u=function(){function e(e,t,r,n){this.name=e,this.attrs=t,this.children=r,this.sourceInfo=n}return e.prototype.visit=function(e,t){return e.visitElement(this,t)},e}();return t.HtmlElementAst=u,t.htmlVisitAll=n,i.define=o,r.exports}),System.register("angular2/src/core/compiler/schema/element_schema_registry",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e.prototype.hasProperty=function(e,t){return!0},e.prototype.getMappedPropName=function(e){return e},e}();return t.ElementSchemaRegistry=o,n.define=i,r.exports}),System.register("angular2/src/core/compiler/template_preparser",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){var t=null,r=null,n=null,o=!1;e.attrs.forEach(function(e){e.name==c?t=e.value:e.name==f?r=e.value:e.name==p?n=e.value:e.name==v&&(o=!0)}),t=i(t);var a=e.name,s=y.OTHER;return a==u?s=y.NG_CONTENT:a==h?s=y.STYLE:a==g?s=y.SCRIPT:a==l&&n==d&&(s=y.STYLESHEET),new m(s,t,r,o)}function i(e){return s.isBlank(e)||0===e.length?"*":e}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang"),c="select",u="ng-content",l="link",p="rel",f="href",d="stylesheet",h="style",g="script",v="ng-non-bindable";t.preparseElement=n,function(e){e[e.NG_CONTENT=0]="NG_CONTENT",e[e.STYLE=1]="STYLE",e[e.STYLESHEET=2]="STYLESHEET",e[e.SCRIPT=3]="SCRIPT",e[e.OTHER=4]="OTHER"}(t.PreparsedElementType||(t.PreparsedElementType={}));var y=t.PreparsedElementType,m=function(){function e(e,t,r,n){this.type=e,this.selectAttr=t,this.hrefAttr=r,this.nonBindable=n}return e}();return t.PreparsedElement=m,o.define=a,r.exports}),System.register("angular2/src/core/compiler/template_normalizer",["angular2/src/core/compiler/directive_metadata","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/async","angular2/src/core/compiler/xhr","angular2/src/core/compiler/url_resolver","angular2/src/core/compiler/style_url_resolver","angular2/src/core/di","angular2/src/core/metadata/view","angular2/src/core/compiler/html_ast","angular2/src/core/compiler/html_parser","angular2/src/core/compiler/template_preparser"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/compiler/directive_metadata"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=e("angular2/src/core/facade/async"),p=e("angular2/src/core/compiler/xhr"),f=e("angular2/src/core/compiler/url_resolver"),d=e("angular2/src/core/compiler/style_url_resolver"),h=e("angular2/src/core/di"),g=e("angular2/src/core/metadata/view"),v=e("angular2/src/core/compiler/html_ast"),y=e("angular2/src/core/compiler/html_parser"),m=e("angular2/src/core/compiler/template_preparser"),_=function(){function e(e,t,r){this._xhr=e,this._urlResolver=t,this._domParser=r}return e.prototype.normalizeTemplate=function(e,t){var r=this;if(c.isPresent(t.template))return l.PromiseWrapper.resolve(this.normalizeLoadedTemplate(e,t,t.template,e.moduleUrl));if(c.isPresent(t.templateUrl)){var n=this._urlResolver.resolve(e.moduleUrl,t.templateUrl);return this._xhr.get(n).then(function(i){return r.normalizeLoadedTemplate(e,t,i,n)})}throw new u.BaseException("No template specified for component "+e.name)},e.prototype.normalizeLoadedTemplate=function(e,t,r,n){var i=this,o=this._domParser.parse(r,e.name),a=new b;v.htmlVisitAll(a,o);var c=t.styles.concat(a.styles),u=a.styleUrls.map(function(e){return i._urlResolver.resolve(n,e)}).concat(t.styleUrls.map(function(t){return i._urlResolver.resolve(e.moduleUrl,t)})),l=c.map(function(e){var t=d.resolveStyleUrls(i._urlResolver,n,e);return t.styleUrls.forEach(function(e){return u.push(e)}),t.style}),p=t.encapsulation;return p===g.ViewEncapsulation.Emulated&&0===l.length&&0===u.length&&(p=g.ViewEncapsulation.None),new s.CompileTemplateMetadata({encapsulation:p,template:r,templateUrl:n,styles:l,styleUrls:u,ngContentSelectors:a.ngContentSelectors})},e=o([h.Injectable(),a("design:paramtypes",[p.XHR,f.UrlResolver,y.HtmlParser])],e)}();t.TemplateNormalizer=_;var b=function(){function e(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return e.prototype.visitElement=function(e,t){var r=m.preparseElement(e);switch(r.type){case m.PreparsedElementType.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(r.selectAttr);break;case m.PreparsedElementType.STYLE:var n="";e.children.forEach(function(e){e instanceof v.HtmlTextAst&&(n+=e.value)}),this.styles.push(n);break;case m.PreparsedElementType.STYLESHEET:this.styleUrls.push(r.hrefAttr)}return r.nonBindable&&this.ngNonBindableStackCount++,v.htmlVisitAll(this,e.children),r.nonBindable&&this.ngNonBindableStackCount--,null},e.prototype.visitAttr=function(e,t){return null},e.prototype.visitText=function(e,t){return null},e}();return n.define=i,r.exports}),System.register("angular2/src/core/linker/directive_resolver",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/metadata","angular2/src/core/reflection/reflection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=e("angular2/src/core/facade/collection"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/reflection/reflection"),d=function(){function e(){}return e.prototype.resolve=function(e){var t=f.reflector.annotations(s.resolveForwardRef(e));if(c.isPresent(t))for(var r=0;r<t.length;r++){var n=t[r];if(n instanceof p.DirectiveMetadata){var i=f.reflector.propMetadata(e);return this._mergeWithPropertyMetadata(n,i)}}throw new u.BaseException("No Directive annotation found on "+c.stringify(e))},e.prototype._mergeWithPropertyMetadata=function(e,t){var r=[],n=[],i={},o={};return l.StringMapWrapper.forEach(t,function(e,t){e.forEach(function(e){if(e instanceof p.InputMetadata&&r.push(c.isPresent(e.bindingPropertyName)?t+": "+e.bindingPropertyName:t),e instanceof p.OutputMetadata&&n.push(c.isPresent(e.bindingPropertyName)?t+": "+e.bindingPropertyName:t),e instanceof p.HostBindingMetadata&&(c.isPresent(e.hostPropertyName)?i["["+e.hostPropertyName+"]"]=t:i["["+t+"]"]=t),e instanceof p.HostListenerMetadata){var a=c.isPresent(e.args)?e.args.join(", "):"";i["("+e.eventName+")"]=t+"("+a+")"}e instanceof p.ContentChildrenMetadata&&(o[t]=e),e instanceof p.ViewChildrenMetadata&&(o[t]=e),e instanceof p.ContentChildMetadata&&(o[t]=e),e instanceof p.ViewChildMetadata&&(o[t]=e)})}),this._merge(e,r,n,i,o)},e.prototype._merge=function(e,t,r,n,i){var o=c.isPresent(e.inputs)?l.ListWrapper.concat(e.inputs,t):t,a=c.isPresent(e.outputs)?l.ListWrapper.concat(e.outputs,r):r,s=c.isPresent(e.host)?l.StringMapWrapper.merge(e.host,n):n,u=c.isPresent(e.queries)?l.StringMapWrapper.merge(e.queries,i):i;return 0==o.length&&c.isPresent(e.properties)&&(o=e.properties),0==a.length&&c.isPresent(e.events)&&(a=e.events),e instanceof p.ComponentMetadata?new p.ComponentMetadata({selector:e.selector,inputs:o,outputs:a,host:s,bindings:e.bindings,exportAs:e.exportAs,moduleId:e.moduleId,queries:u,changeDetection:e.changeDetection,viewBindings:e.viewBindings}):new p.DirectiveMetadata({selector:e.selector,inputs:o,outputs:a,host:s,bindings:e.bindings,exportAs:e.exportAs,moduleId:e.moduleId,queries:u})},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.DirectiveResolver=d,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_resolver",["angular2/src/core/di","angular2/src/core/metadata/view","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/reflection/reflection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/metadata/view"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/reflection/reflection"),d=function(){function e(){this._cache=new p.Map}return e.prototype.resolve=function(e){var t=this._cache.get(e);return u.isBlank(t)&&(t=this._resolve(e),this._cache.set(e,t)),t},e.prototype._resolve=function(e){for(var t=f.reflector.annotations(e),r=0;r<t.length;r++){var n=t[r];if(n instanceof c.ViewMetadata)return n}throw new l.BaseException("No View annotation found on component "+u.stringify(e))},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.ViewResolver=d,n.define=i,r.exports}),System.register("angular2/src/core/linker/directive_lifecycle_reflector",["angular2/src/core/facade/lang","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e,t){if(!(t instanceof a.Type))return!1;var r=t.prototype;
switch(e){case s.LifecycleHooks.AfterContentInit:return!!r.afterContentInit;case s.LifecycleHooks.AfterContentChecked:return!!r.afterContentChecked;case s.LifecycleHooks.AfterViewInit:return!!r.afterViewInit;case s.LifecycleHooks.AfterViewChecked:return!!r.afterViewChecked;case s.LifecycleHooks.OnChanges:return!!r.onChanges;case s.LifecycleHooks.DoCheck:return!!r.doCheck;case s.LifecycleHooks.OnDestroy:return!!r.onDestroy;case s.LifecycleHooks.OnInit:return!!r.onInit;default:return!1}}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/linker/interfaces");return t.hasLifecycleHook=n,i.define=o,r.exports}),System.register("angular2/src/core/application_tokens",["angular2/src/core/di","angular2/src/core/facade/lang"],!0,function(e,t,r){function n(){return""+i()+i()+i()}function i(){return c.StringWrapper.fromCharCode(97+c.Math.floor(25*c.Math.random()))}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/lang");return t.APP_COMPONENT_REF_PROMISE=c.CONST_EXPR(new s.OpaqueToken("Promise<ComponentRef>")),t.APP_COMPONENT=c.CONST_EXPR(new s.OpaqueToken("AppComponent")),t.APP_ID=c.CONST_EXPR(new s.OpaqueToken("AppId")),t.APP_ID_RANDOM_BINDING=c.CONST_EXPR(new s.Binding(t.APP_ID,{toFactory:n,deps:[]})),o.define=a,r.exports}),System.register("angular2/src/core/pipes/pipe_binding",["angular2/src/core/di/binding","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/di/binding"),s=e("angular2/src/core/di"),c=function(e){function t(t,r,n,i,o){e.call(this,n,i,o),this.name=t,this.pure=r}return o(t,e),t.createFromType=function(e,r){var n=new s.Binding(e,{toClass:e}),i=a.resolveBinding(n);return new t(r.name,r.pure,i.key,i.resolvedFactories,i.multiBinding)},t}(s.ResolvedBinding);return t.PipeBinding=c,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/pipes",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e,t){this.pipe=e,this.pure=t}return e}();return t.SelectedPipe=o,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_ref",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return e._view}function i(e){return s.isPresent(e)?e._protoView:null}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang");t.internalView=n,t.internalProtoView=i;var c=function(){function e(e){this._view=e,this._changeDetectorRef=null}return Object.defineProperty(e.prototype,"render",{get:function(){return this._view.render},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderFragment",{get:function(){return this._view.renderFragment},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changeDetectorRef",{get:function(){return null===this._changeDetectorRef&&(this._changeDetectorRef=this._view.changeDetector.ref),this._changeDetectorRef},set:function(e){throw"readonly"},enumerable:!0,configurable:!0}),e.prototype.setLocal=function(e,t){this._view.setLocal(e,t)},e}();t.ViewRef=c;var u=function(){function e(e){this._protoView=e}return e}();return t.ProtoViewRef=u,o.define=a,r.exports}),System.register("angular2/src/core/render/dom/util",["angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return s.StringWrapper.replaceAllMapped(e,c,function(e){return"-"+e[1].toLowerCase()})}function i(e){return s.StringWrapper.replaceAllMapped(e,u,function(e){return e[1].toUpperCase()})}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang"),c=/([A-Z])/g,u=/-([a-z])/g;return t.camelCaseToDashCase=n,t.dashCaseToCamelCase=i,o.define=a,r.exports}),System.register("angular2/src/core/linker/element_binder",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=function(){function e(e,t,r,n,i,s){if(this.index=e,this.parent=t,this.distanceToParent=r,this.protoElementInjector=n,this.componentDirective=i,this.nestedProtoView=s,o.isBlank(e))throw new a.BaseException("null index not allowed.")}return e}();return t.ElementBinder=s,n.define=i,r.exports}),System.register("angular2/src/core/render/api",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e}();t.RenderProtoViewRef=o;var a=function(){function e(){}return e}();t.RenderFragmentRef=a;var s=function(){function e(){}return e}();t.RenderViewRef=s;var c=function(){function e(e,t){this.viewRef=e,this.fragmentRefs=t}return e}();t.RenderViewWithFragments=c;var u=function(){function e(){}return e.prototype.registerComponentTemplate=function(e,t,r,n){},e.prototype.createProtoView=function(e){return null},e.prototype.createRootHostView=function(e,t,r){return null},e.prototype.createView=function(e,t){return null},e.prototype.destroyView=function(e){},e.prototype.attachFragmentAfterFragment=function(e,t){},e.prototype.attachFragmentAfterElement=function(e,t){},e.prototype.detachFragment=function(e){},e.prototype.hydrateView=function(e){},e.prototype.dehydrateView=function(e){},e.prototype.getNativeElementSync=function(e){return null},e.prototype.setElementProperty=function(e,t,r){},e.prototype.setElementAttribute=function(e,t,r){},e.prototype.setElementClass=function(e,t,r){},e.prototype.setElementStyle=function(e,t,r){},e.prototype.invokeElementMethod=function(e,t,r){},e.prototype.setText=function(e,t,r){},e.prototype.setEventDispatcher=function(e,t){},e}();return t.Renderer=u,n.define=i,r.exports}),System.register("angular2/src/core/linker/element_ref",["angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/exceptions"),a=function(){function e(e,t,r){this._renderer=r,this.parentView=e,this.boundElementIndex=t}return Object.defineProperty(e.prototype,"renderView",{get:function(){return this.parentView.render},set:function(e){throw new o.BaseException("Abstract setter")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeElement",{get:function(){return this._renderer.getNativeElementSync(this)},enumerable:!0,configurable:!0}),e}();return t.ElementRef=a,n.define=i,r.exports}),System.register("angular2/src/core/linker/template_ref",["angular2/src/core/linker/view_ref"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/linker/view_ref"),a=function(){function e(e){this.elementRef=e}return e.prototype._getProtoView=function(){var e=o.internalView(this.elementRef.parentView);return e.proto.elementBinders[this.elementRef.boundElementIndex-e.elementOffset].nestedProtoView},Object.defineProperty(e.prototype,"protoViewRef",{get:function(){return this._getProtoView().ref},enumerable:!0,configurable:!0}),e.prototype.hasLocal=function(e){return this._getProtoView().templateVariableBindings.has(e)},e}();return t.TemplateRef=a,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_pool",["angular2/src/core/di","angular2/src/core/facade/collection","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/facade/lang");t.APP_VIEW_POOL_CAPACITY=l.CONST_EXPR(new c.OpaqueToken("AppViewPool.viewPoolCapacity"));var p=function(){function e(e){this._pooledViewsPerProtoView=new u.Map,this._poolCapacityPerProtoView=e}return e.prototype.getView=function(e){var t=this._pooledViewsPerProtoView.get(e);return l.isPresent(t)&&t.length>0?u.ListWrapper.removeLast(t):null},e.prototype.returnView=function(e){var t=e.proto,r=this._pooledViewsPerProtoView.get(t);l.isBlank(r)&&(r=[],this._pooledViewsPerProtoView.set(t,r));var n=r.length<this._poolCapacityPerProtoView;return n&&r.push(e),n},e=o([c.Injectable(),s(0,c.Inject(t.APP_VIEW_POOL_CAPACITY)),a("design:paramtypes",[Object])],e)}();return t.AppViewPool=p,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_listener",["angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=function(){function e(){}return e.prototype.viewCreated=function(e){},e.prototype.viewDestroyed=function(e){},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.AppViewListener=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/view_container_ref",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/linker/view_ref"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/linker/view_ref"),c=function(){function e(e,t){this.viewManager=e,this.element=t}return e.prototype._getViews=function(){var e=s.internalView(this.element.parentView).viewContainers[this.element.boundElementIndex];return a.isPresent(e)?e.views:[]},e.prototype.clear=function(){for(var e=this.length-1;e>=0;e--)this.remove(e)},e.prototype.get=function(e){return this._getViews()[e].ref},Object.defineProperty(e.prototype,"length",{get:function(){return this._getViews().length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.createEmbeddedViewInContainer(this.element,t,e)},e.prototype.createHostView=function(e,t,r){return void 0===e&&(e=null),void 0===t&&(t=-1),void 0===r&&(r=null),-1==t&&(t=this.length),this.viewManager.createHostViewInContainer(this.element,t,e,r)},e.prototype.insert=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.attachViewInContainer(this.element,t,e)},e.prototype.indexOf=function(e){return o.ListWrapper.indexOf(this._getViews(),s.internalView(e))},e.prototype.remove=function(e){void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.destroyViewInContainer(this.element,e)},e.prototype.detach=function(e){return void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.detachViewInContainer(this.element,e)},e}();return t.ViewContainerRef=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/query_list",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/async"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/async"),c=function(){function e(){this._results=[],this._emitter=new s.EventEmitter}return Object.defineProperty(e.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return o.ListWrapper.first(this._results)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return o.ListWrapper.last(this._results)},enumerable:!0,configurable:!0}),e.prototype.map=function(e){return this._results.map(e)},e.prototype[a.getSymbolIterator()]=function(){return this._results[a.getSymbolIterator()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=e},e.prototype.notifyOnChanges=function(){this._emitter.next(this)},e}();return t.QueryList=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/event_config",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang");t.EVENT_TARGET_SEPARATOR=":";var a=function(){function e(e,t,r){this.fieldName=e,this.eventName=t,this.isLongForm=r}return e.parse=function(r){var n=r,i=r,a=!1,s=r.indexOf(t.EVENT_TARGET_SEPARATOR);return s>-1&&(n=o.StringWrapper.substring(r,0,s).trim(),i=o.StringWrapper.substring(r,s+1).trim(),a=!0),new e(n,i,a)},e.prototype.getFullName=function(){return this.isLongForm?""+this.fieldName+t.EVENT_TARGET_SEPARATOR+this.eventName:this.eventName},e}();return t.EventConfig=a,n.define=i,r.exports}),System.register("angular2/src/core/linker/pipe_resolver",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/metadata","angular2/src/core/reflection/reflection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=e("angular2/src/core/metadata"),p=e("angular2/src/core/reflection/reflection"),f=function(){function e(){}return e.prototype.resolve=function(e){var t=p.reflector.annotations(s.resolveForwardRef(e));if(c.isPresent(t))for(var r=0;r<t.length;r++){var n=t[r];if(n instanceof l.PipeMetadata)return n}throw new u.BaseException("No Pipe decorator found on "+c.stringify(e))},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.PipeResolver=f,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/dom_tokens",["angular2/src/core/di","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),a=e("angular2/src/core/facade/lang");return t.DOCUMENT=a.CONST_EXPR(new o.OpaqueToken("DocumentToken")),n.define=i,r.exports}),System.register("angular2/src/animate/css_animation_options",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){this.classesToAdd=[],this.classesToRemove=[],this.animationClasses=[]}return e}();return t.CssAnimationOptions=o,n.define=i,r.exports}),System.register("angular2/src/core/facade/math",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang");return t.Math=o.global.Math,t.NaN=typeof t.NaN,n.define=i,r.exports}),System.register("angular2/src/animate/browser_details",["angular2/src/core/di","angular2/src/core/facade/math","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/math"),u=e("angular2/src/core/dom/dom_adapter"),l=function(){function e(){this.elapsedTimeIncludesDelay=!1,this.doesElapsedTimeIncludesDelay()}return e.prototype.doesElapsedTimeIncludesDelay=function(){var e=this,t=u.DOM.createElement("div");u.DOM.setAttribute(t,"style","position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"),this.raf(function(r){u.DOM.on(t,"transitionend",function(r){var n=c.Math.round(1e3*r.elapsedTime);e.elapsedTimeIncludesDelay=2==n,u.DOM.remove(t)}),u.DOM.setStyle(t,"width","2px")},2)},e.prototype.raf=function(e,t){void 0===t&&(t=1);var r=new p(e,t);return function(){return r.cancel()}},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();t.BrowserDetails=l;var p=function(){function e(e,t){this.callback=e,this.frames=t,this._raf()}return e.prototype._raf=function(){var e=this;this.currentFrameId=u.DOM.requestAnimationFrame(function(t){return e._nextFrame(t)})},e.prototype._nextFrame=function(e){this.frames--,this.frames>0?this._raf():this.callback(e)},e.prototype.cancel=function(){u.DOM.cancelAnimationFrame(this.currentFrameId),this.currentFrameId=null},e}();return n.define=i,r.exports}),System.register("angular2/src/core/zone/ng_zone",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/profile/profile"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/profile/profile"),c=function(){function e(e){var t=e.enableLongStackTrace;this._runScope=s.wtfCreateScope("NgZone#run()"),this._microtaskScope=s.wtfCreateScope("NgZone#microtask()"),this._inVmTurnDone=!1,this._pendingTimeouts=[],this._onTurnStart=null,this._onTurnDone=null,this._onEventDone=null,this._onErrorHandler=null,this._pendingMicrotasks=0,this._hasExecutedCodeInInnerZone=!1,this._nestedRun=0,a.global.zone?(this._disabled=!1,this._mountZone=a.global.zone,this._innerZone=this._createInnerZone(this._mountZone,t)):(this._disabled=!0,this._mountZone=null)}return e.prototype.overrideOnTurnStart=function(e){this._onTurnStart=a.normalizeBlank(e)},e.prototype.overrideOnTurnDone=function(e){this._onTurnDone=a.normalizeBlank(e)},e.prototype.overrideOnEventDone=function(e,t){var r=this;void 0===t&&(t=!1);var n=a.normalizeBlank(e);this._onEventDone=t?function(){r._pendingTimeouts.length||n()}:n},e.prototype.overrideOnErrorHandler=function(e){this._onErrorHandler=a.normalizeBlank(e)},e.prototype.run=function(e){if(this._disabled)return e();var t=this._runScope();try{return this._innerZone.run(e)}finally{s.wtfLeave(t)}},e.prototype.runOutsideAngular=function(e){return this._disabled?e():this._mountZone.run(e)},e.prototype._createInnerZone=function(e,t){var r,n=this._microtaskScope,i=this;return r=t?o.StringMapWrapper.merge(Zone.longStackTraceZone,{onError:function(e){i._onError(this,e)}}):{onError:function(e){i._onError(this,e)}},e.fork(r).fork({$run:function(e){return function(){try{return i._nestedRun++,i._hasExecutedCodeInInnerZone||(i._hasExecutedCodeInInnerZone=!0,i._onTurnStart&&e.call(i._innerZone,i._onTurnStart)),e.apply(this,arguments)}finally{if(i._nestedRun--,0==i._pendingMicrotasks&&0==i._nestedRun&&!this._inVmTurnDone){if(i._onTurnDone&&i._hasExecutedCodeInInnerZone)try{this._inVmTurnDone=!0,e.call(i._innerZone,i._onTurnDone)}finally{this._inVmTurnDone=!1,i._hasExecutedCodeInInnerZone=!1}0===i._pendingMicrotasks&&a.isPresent(i._onEventDone)&&i.runOutsideAngular(i._onEventDone)}}}},$scheduleMicrotask:function(e){return function(t){i._pendingMicrotasks++;var r=function(){var e=n();try{t()}finally{i._pendingMicrotasks--,s.wtfLeave(e)}};e.call(this,r)}},$setTimeout:function(e){return function(t,r){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var s,c=function(){t(),o.ListWrapper.remove(i._pendingTimeouts,s)};return s=e(c,r,n),i._pendingTimeouts.push(s),s}},$clearTimeout:function(e){return function(t){e(t),o.ListWrapper.remove(i._pendingTimeouts,t)}},_innerZone:!0})},e.prototype._onError=function(e,t){if(!a.isPresent(this._onErrorHandler))throw console.log("## _onError ##"),console.log(t.stack),t;for(var r=[a.normalizeBlank(t.stack)];e&&e.constructedAtException;)r.push(e.constructedAtException.get()),e=e.parent;this._onErrorHandler(t,r)},e}();return t.NgZone=c,n.define=i,r.exports}),System.register("angular2/src/core/render/view",["angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/render/api"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/render/api"),l=function(e){function t(t){e.call(this),this.cmds=t}return o(t,e),t}(u.RenderProtoViewRef);t.DefaultProtoViewRef=l;var p=function(e){function t(t){e.call(this),this.nodes=t}return o(t,e),t}(u.RenderFragmentRef);t.DefaultRenderFragmentRef=p;var f=function(e){function t(t,r,n,i,o){e.call(this),this.fragments=t,this.boundTextNodes=r,this.boundElements=n,this.nativeShadowRoots=i,this.globalEventAdders=o,this.hydrated=!1,this.eventDispatcher=null,this.globalEventRemovers=null}return o(t,e),t.prototype.hydrate=function(){if(this.hydrated)throw new a.BaseException("The view is already hydrated.");this.hydrated=!0,this.globalEventRemovers=s.ListWrapper.createFixedSize(this.globalEventAdders.length);for(var e=0;e<this.globalEventAdders.length;e++)this.globalEventRemovers[e]=this.globalEventAdders[e]()},t.prototype.dehydrate=function(){if(!this.hydrated)throw new a.BaseException("The view is already dehydrated.");for(var e=0;e<this.globalEventRemovers.length;e++)this.globalEventRemovers[e]();this.globalEventRemovers=null,this.hydrated=!1},t.prototype.setEventDispatcher=function(e){this.eventDispatcher=e},t.prototype.dispatchRenderEvent=function(e,t,r){var n=!0;if(c.isPresent(this.eventDispatcher)){var i=new s.Map;i.set("$event",r),n=this.eventDispatcher.dispatchRenderEvent(e,t,i)}return n},t}(u.RenderViewRef);return t.DefaultRenderView=f,n.define=i,r.exports}),System.register("angular2/src/core/compiler/runtime_compiler",["angular2/src/core/linker/compiler","angular2/src/core/linker/proto_view_factory","angular2/src/core/compiler/template_compiler","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/linker/compiler"),u=e("angular2/src/core/linker/proto_view_factory"),l=e("angular2/src/core/compiler/template_compiler"),p=e("angular2/src/core/di"),f=function(e){function t(t,r){e.call(this,t),this._templateCompiler=r}return o(t,e),t.prototype.compileInHost=function(e){var t=this;return this._templateCompiler.compileHostComponentRuntime(e).then(function(e){return c.internalCreateProtoView(t,e)})},t.prototype.clearCache=function(){e.prototype.clearCache.call(this),this._templateCompiler.clearCache()},t=a([p.Injectable(),s("design:paramtypes",[u.ProtoViewFactory,l.TemplateCompiler])],t)}(c.Compiler);return t.RuntimeCompiler=f,n.define=i,r.exports}),System.register("angular2/src/core/compiler/schema/dom_element_schema_registry",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/dom/dom_adapter","angular2/src/core/compiler/schema/element_schema_registry"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/collection"),p=e("angular2/src/core/dom/dom_adapter"),f=e("angular2/src/core/compiler/schema/element_schema_registry"),d=function(e){function t(){e.apply(this,arguments),this._protoElements=new Map}return o(t,e),t.prototype._getProtoElement=function(e){var t=this._protoElements.get(e);return u.isBlank(t)&&(t=p.DOM.createElement(e),this._protoElements.set(e,t)),t},t.prototype.hasProperty=function(e,t){if(-1!==e.indexOf("-"))return!0;var r=this._getProtoElement(e);return p.DOM.hasProperty(r,t)},t.prototype.getMappedPropName=function(e){var t=l.StringMapWrapper.get(p.DOM.attrToPropMap,e);return u.isPresent(t)?t:e},t=a([c.Injectable(),s("design:paramtypes",[])],t)}(f.ElementSchemaRegistry);return t.DomElementSchemaRegistry=d,n.define=i,r.exports}),System.register("angular2/src/core/compiler/app_root_url",["angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!0,configurable:!0}),e=o([s.Injectable(),a("design:paramtypes",[String])],e)}();return t.AppRootUrl=c,n.define=i,r.exports}),System.register("angular2/src/core/compiler/anchor_based_app_root_url",["angular2/src/core/compiler/app_root_url","angular2/src/core/dom/dom_adapter","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/compiler/app_root_url"),u=e("angular2/src/core/dom/dom_adapter"),l=e("angular2/src/core/di"),p=function(e){function t(){e.call(this,"");var t,r=u.DOM.createElement("a");u.DOM.resolveAndSetHref(r,"./",null),t=u.DOM.getHref(r),this.value=t}return o(t,e),t=a([l.Injectable(),s("design:paramtypes",[])],t)}(c.AppRootUrl);return t.AnchorBasedAppRootUrl=p,n.define=i,r.exports}),System.register("angular2/src/core/forms/validators",["angular2/src/core/facade/lang","angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/di");t.NG_VALIDATORS=a.CONST_EXPR(new c.OpaqueToken("NgValidators"));var u=function(){function e(){}return e.required=function(e){return o.isBlank(e.value)||""==e.value?{required:!0}:null},e.nullValidator=function(e){return null},e.compose=function(t){return o.isBlank(t)?e.nullValidator:function(e){var r=s.ListWrapper.reduce(t,function(t,r){var n=r(e);return o.isPresent(n)?s.StringMapWrapper.merge(t,n):t},{});return s.StringMapWrapper.isEmpty(r)?null:r}},e.group=function(t){var r={};return s.StringMapWrapper.forEach(t.controls,function(n,i){t.contains(i)&&o.isPresent(n.errors)&&e._mergeErrors(n,r)}),s.StringMapWrapper.isEmpty(r)?null:r},e.array=function(t){var r={};return t.controls.forEach(function(t){o.isPresent(t.errors)&&e._mergeErrors(t,r)}),s.StringMapWrapper.isEmpty(r)?null:r},e._mergeErrors=function(e,t){s.StringMapWrapper.forEach(e.errors,function(r,n){s.StringMapWrapper.contains(t,n)||(t[n]=[]);var i=t[n];i.push(e)})},e}();return t.Validators=u,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/abstract_control_directive",["angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=function(){function e(){}return Object.defineProperty(e.prototype,"control",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return o.isPresent(this.control)?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return o.isPresent(this.control)?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errors",{get:function(){return o.isPresent(this.control)?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pristine",{get:function(){return o.isPresent(this.control)?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dirty",{get:function(){return o.isPresent(this.control)?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touched",{get:function(){return o.isPresent(this.control)?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"untouched",{get:function(){return o.isPresent(this.control)?this.control.untouched:null},enumerable:!0,configurable:!0}),e}();return t.AbstractControlDirective=a,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/control_container",["angular2/src/core/forms/directives/abstract_control_directive"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e;
}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/forms/directives/abstract_control_directive"),s=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t}(a.AbstractControlDirective);return t.ControlContainer=s,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_control",["angular2/src/core/forms/directives/abstract_control_directive"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/forms/directives/abstract_control_directive"),s=function(e){function t(){e.apply(this,arguments),this.name=null,this.valueAccessor=null}return o(t,e),Object.defineProperty(t.prototype,"validator",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){},t}(a.AbstractControlDirective);return t.NgControl=s,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/control_value_accessor",["angular2/src/core/facade/lang","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/di");return t.NG_VALUE_ACCESSOR=o.CONST_EXPR(new a.OpaqueToken("NgValueAccessor")),n.define=i,r.exports}),System.register("angular2/src/core/linker/dynamic_component_loader",["angular2/src/core/di","angular2/src/core/linker/compiler","angular2/src/core/facade/lang","angular2/src/core/linker/view_manager"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/linker/compiler"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/linker/view_manager"),p=function(){function e(e,t,r,n,i){this._dispose=i,this.location=e,this.instance=t,this.componentType=r,this.injector=n}return Object.defineProperty(e.prototype,"hostView",{get:function(){return this.location.parentView},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostComponentType",{get:function(){return this.componentType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostComponent",{get:function(){return this.instance},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._dispose()},e}();t.ComponentRef=p;var f=function(){function e(e,t){this._compiler=e,this._viewManager=t}return e.prototype.loadAsRoot=function(e,t,r,n){var i=this;return this._compiler.compileInHost(e).then(function(o){var a=i._viewManager.createRootHostView(o,t,r),s=i._viewManager.getHostElement(a),c=i._viewManager.getComponent(s),l=function(){i._viewManager.destroyRootHostView(a),u.isPresent(n)&&n()};return new p(s,c,e,r,l)})},e.prototype.loadIntoLocation=function(e,t,r,n){return void 0===n&&(n=null),this.loadNextToLocation(e,this._viewManager.getNamedElementInComponentView(t,r),n)},e.prototype.loadNextToLocation=function(e,t,r){var n=this;return void 0===r&&(r=null),this._compiler.compileInHost(e).then(function(i){var o=n._viewManager.getViewContainer(t),a=o.createHostView(i,o.length,r),s=n._viewManager.getHostElement(a),c=n._viewManager.getComponent(s),u=function(){var e=o.indexOf(a);-1!==e&&o.remove(e)};return new p(s,c,e,null,u)})},e=o([s.Injectable(),a("design:paramtypes",[c.Compiler,l.AppViewManager])],e)}();return t.DynamicComponentLoader=f,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/checkbox_value_accessor",["angular2/src/core/metadata","angular2/src/core/render","angular2/src/core/linker","angular2/src/core/di","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/facade/lang","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/metadata"),c=e("angular2/src/core/render"),u=e("angular2/src/core/linker"),l=e("angular2/src/core/di"),p=e("angular2/src/core/forms/directives/control_value_accessor"),f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/forms/directives/shared"),h=f.CONST_EXPR(new l.Binding(p.NG_VALUE_ACCESSOR,{toAlias:l.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){d.setProperty(this._renderer,this._elementRef,"checked",e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e=o([s.Directive({selector:"input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},bindings:[h]}),a("design:paramtypes",[c.Renderer,u.ElementRef])],e)}();return t.CheckboxControlValueAccessor=g,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/select_control_value_accessor",["angular2/src/core/di","angular2/src/core/render","angular2/src/core/linker","angular2/src/core/metadata","angular2/src/core/facade/async","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/facade/lang","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/core/render"),l=e("angular2/src/core/linker"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/facade/async"),d=e("angular2/src/core/forms/directives/control_value_accessor"),h=e("angular2/src/core/facade/lang"),g=e("angular2/src/core/forms/directives/shared"),v=h.CONST_EXPR(new c.Binding(d.NG_VALUE_ACCESSOR,{toAlias:c.forwardRef(function(){return m}),multi:!0})),y=function(){function e(){}return e=o([p.Directive({selector:"option"}),a("design:paramtypes",[])],e)}();t.NgSelectOption=y;var m=function(){function e(e,t,r){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){},this._updateValueWhenListOfOptionsChanges(r)}return e.prototype.writeValue=function(e){this.value=e,g.setProperty(this._renderer,this._elementRef,"value",e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype._updateValueWhenListOfOptionsChanges=function(e){var t=this;f.ObservableWrapper.subscribe(e.changes,function(e){return t.writeValue(t.value)})},e=o([p.Directive({selector:"select[ng-control],select[ng-form-control],select[ng-model]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[v]}),s(2,p.Query(y,{descendants:!0})),a("design:paramtypes",[u.Renderer,l.ElementRef,l.QueryList])],e)}();return t.SelectControlValueAccessor=m,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_form_control",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/ng_control","angular2/src/core/forms/validators","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/core/forms/directives/ng_control"),h=e("angular2/src/core/forms/validators"),g=e("angular2/src/core/forms/directives/control_value_accessor"),v=e("angular2/src/core/forms/directives/shared"),y=u.CONST_EXPR(new f.Binding(d.NgControl,{toAlias:f.forwardRef(function(){return m})})),m=function(e){function t(t,r){e.call(this),this.update=new l.EventEmitter,this._added=!1,this.validators=t,this.valueAccessor=v.selectValueAccessor(this,r)}return o(t,e),t.prototype.onChanges=function(e){this._added||(v.setUpControl(this.form,this),this.form.updateValidity(),this._added=!0),v.isPropertyUpdated(e,this.viewModel)&&(this.form.updateValue(this.model),this.viewModel=this.model)},Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return h.Validators.compose(this.validators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,l.ObservableWrapper.callNext(this.update,e)},t=a([p.Directive({selector:"[ng-form-control]",bindings:[y],inputs:["form: ngFormControl","model: ngModel"],outputs:["update: ngModel"],exportAs:"form"}),c(0,f.Optional()),c(0,f.Inject(h.NG_VALIDATORS)),c(1,f.Optional()),c(1,f.Inject(g.NG_VALUE_ACCESSOR)),s("design:paramtypes",[Array,Array])],t)}(d.NgControl);return t.NgFormControl=m,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_model",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/forms/directives/ng_control","angular2/src/core/forms/model","angular2/src/core/forms/validators","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/core/forms/directives/control_value_accessor"),h=e("angular2/src/core/forms/directives/ng_control"),g=e("angular2/src/core/forms/model"),v=e("angular2/src/core/forms/validators"),y=e("angular2/src/core/forms/directives/shared"),m=u.CONST_EXPR(new f.Binding(h.NgControl,{toAlias:f.forwardRef(function(){return _})})),_=function(e){function t(t,r){e.call(this),this._control=new g.Control,this._added=!1,this.update=new l.EventEmitter,this.validators=t,this.valueAccessor=y.selectValueAccessor(this,r)}return o(t,e),t.prototype.onChanges=function(e){this._added||(y.setUpControl(this._control,this),this._control.updateValidity(),this._added=!0),y.isPropertyUpdated(e,this.viewModel)&&(this._control.updateValue(this.model),this.viewModel=this.model)},Object.defineProperty(t.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return v.Validators.compose(this.validators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,l.ObservableWrapper.callNext(this.update,e)},t=a([p.Directive({selector:"[ng-model]:not([ng-control]):not([ng-form-control])",bindings:[m],inputs:["model: ngModel"],outputs:["update: ngModel"],exportAs:"form"}),c(0,f.Optional()),c(0,f.Inject(v.NG_VALIDATORS)),c(1,f.Optional()),c(1,f.Inject(d.NG_VALUE_ACCESSOR)),s("design:paramtypes",[Array,Array])],t)}(h.NgControl);return t.NgModel=_,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_control_group",["angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/forms/directives/control_container","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/metadata"),l=e("angular2/src/core/di"),p=e("angular2/src/core/facade/lang"),f=e("angular2/src/core/forms/directives/control_container"),d=e("angular2/src/core/forms/directives/shared"),h=p.CONST_EXPR(new l.Binding(f.ControlContainer,{toAlias:l.forwardRef(function(){return g})})),g=function(e){function t(t){e.call(this),this._parent=t}return o(t,e),t.prototype.onInit=function(){this.formDirective.addControlGroup(this)},t.prototype.onDestroy=function(){this.formDirective.removeControlGroup(this)},Object.defineProperty(t.prototype,"control",{get:function(){return this.formDirective.getControlGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return d.controlPath(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent.formDirective},enumerable:!0,configurable:!0}),t=a([u.Directive({selector:"[ng-control-group]",bindings:[h],inputs:["name: ng-control-group"],exportAs:"form"}),c(0,l.Host()),c(0,l.SkipSelf()),s("design:paramtypes",[f.ControlContainer])],t)}(f.ControlContainer);return t.NgControlGroup=g,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_form_model",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/control_container","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/core/forms/directives/control_container"),h=e("angular2/src/core/forms/directives/shared"),g=c.CONST_EXPR(new f.Binding(d.ControlContainer,{toAlias:f.forwardRef(function(){return v})})),v=function(e){function t(){e.apply(this,arguments),this.form=null,this.directives=[],this.ngSubmit=new l.EventEmitter}return o(t,e),t.prototype.onChanges=function(e){this._updateDomValue()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this.form.find(e.path);h.setUpControl(t,e),t.updateValidity(),this.directives.push(e)},t.prototype.getControl=function(e){return this.form.find(e.path)},t.prototype.removeControl=function(e){u.ListWrapper.remove(this.directives,e)},t.prototype.addControlGroup=function(e){},t.prototype.removeControlGroup=function(e){},t.prototype.getControlGroup=function(e){return this.form.find(e.path)},t.prototype.updateModel=function(e,t){var r=this.form.find(e.path);r.updateValue(t)},t.prototype.onSubmit=function(){return l.ObservableWrapper.callNext(this.ngSubmit,null),!1},t.prototype._updateDomValue=function(){var e=this;u.ListWrapper.forEach(this.directives,function(t){var r=e.form.find(t.path);t.valueAccessor.writeValue(r.value)})},t=a([p.Directive({selector:"[ng-form-model]",bindings:[g],inputs:["form: ng-form-model"],host:{"(submit)":"onSubmit()"},outputs:["ngSubmit"],exportAs:"form"}),s("design:paramtypes",[])],t)}(d.ControlContainer);return t.NgFormModel=v,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_form",["angular2/src/core/facade/async","angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/control_container","angular2/src/core/forms/model","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/async"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/core/forms/directives/control_container"),h=e("angular2/src/core/forms/model"),g=e("angular2/src/core/forms/directives/shared"),v=l.CONST_EXPR(new f.Binding(d.ControlContainer,{toAlias:f.forwardRef(function(){return y})})),y=function(e){function t(){e.apply(this,arguments),this.form=new h.ControlGroup({}),this.ngSubmit=new c.EventEmitter}return o(t,e),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;this._later(function(r){var n=t._findContainer(e.path),i=new h.Control;g.setUpControl(i,e),n.addControl(e.name,i),i.updateValidity()})},t.prototype.getControl=function(e){return this.form.find(e.path)},t.prototype.removeControl=function(e){var t=this;this._later(function(r){var n=t._findContainer(e.path);l.isPresent(n)&&(n.removeControl(e.name),n.updateValidity())})},t.prototype.addControlGroup=function(e){var t=this;this._later(function(r){var n=t._findContainer(e.path),i=new h.ControlGroup({});n.addControl(e.name,i),i.updateValidity()})},t.prototype.removeControlGroup=function(e){var t=this;this._later(function(r){var n=t._findContainer(e.path);l.isPresent(n)&&(n.removeControl(e.name),n.updateValidity())})},t.prototype.getControlGroup=function(e){return this.form.find(e.path)},t.prototype.updateModel=function(e,t){var r=this;this._later(function(n){var i=r.form.find(e.path);i.updateValue(t)})},t.prototype.onSubmit=function(){return c.ObservableWrapper.callNext(this.ngSubmit,null),!1},t.prototype._findContainer=function(e){return u.ListWrapper.removeLast(e),u.ListWrapper.isEmpty(e)?this.form:this.form.find(e)},t.prototype._later=function(e){c.PromiseWrapper.then(c.PromiseWrapper.resolve(null),e,function(e){})},t=a([p.Directive({selector:"form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]",bindings:[v],host:{"(submit)":"onSubmit()"},outputs:["ngSubmit"],exportAs:"form"}),s("design:paramtypes",[])],t)}(d.ControlContainer);return t.NgForm=y,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/ng_control_status",["angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/ng_control","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/metadata"),u=e("angular2/src/core/di"),l=e("angular2/src/core/forms/directives/ng_control"),p=e("angular2/src/core/facade/lang"),f=function(){function e(e){this._cd=e}return Object.defineProperty(e.prototype,"ngClassUntouched",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.untouched:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassTouched",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.touched:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassPristine",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.pristine:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassDirty",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.dirty:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassValid",{get:function(){return p.isPresent(this._cd.control)?this._cd.control.valid:!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClassInvalid",{get:function(){return p.isPresent(this._cd.control)?!this._cd.control.valid:!1},enumerable:!0,configurable:!0}),e=o([c.Directive({selector:"[ng-control],[ng-model],[ng-form-control]",host:{"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid"}}),s(0,u.Self()),a("design:paramtypes",[l.NgControl])],e)}();return t.NgControlStatus=f,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/validators",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/metadata","angular2/src/core/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/metadata"),l=e("angular2/src/core/forms/validators"),p=c.CONST_EXPR(new s.Binding(l.NG_VALIDATORS,{toValue:l.Validators.required,multi:!0})),f=function(){function e(){}return e=o([u.Directive({selector:"[required][ng-control],[required][ng-form-control],[required][ng-model]",bindings:[p]}),a("design:paramtypes",[])],e)}();return t.DefaultValidators=f,n.define=i,r.exports}),System.register("angular2/src/core/forms/form_builder",["angular2/src/core/di","angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/forms/model"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/forms/model"),p=function(){function e(){}return e.prototype.group=function(e,t){void 0===t&&(t=null);var r=this._reduceControls(e),n=u.isPresent(t)?c.StringMapWrapper.get(t,"optionals"):null,i=u.isPresent(t)?c.StringMapWrapper.get(t,"validator"):null;return u.isPresent(i)?new l.ControlGroup(r,n,i):new l.ControlGroup(r,n)},e.prototype.control=function(e,t){return void 0===t&&(t=null),u.isPresent(t)?new l.Control(e,t):new l.Control(e)},e.prototype.array=function(e,t){var r=this;void 0===t&&(t=null);var n=c.ListWrapper.map(e,function(e){return r._createControl(e)});return u.isPresent(t)?new l.ControlArray(n,t):new l.ControlArray(n)},e.prototype._reduceControls=function(e){var t=this,r={};return c.StringMapWrapper.forEach(e,function(e,n){r[n]=t._createControl(e)}),r},e.prototype._createControl=function(e){if(e instanceof l.Control||e instanceof l.ControlGroup||e instanceof l.ControlArray)return e;if(u.isArray(e)){var t=e[0],r=e.length>1?e[1]:null;return this.control(t,r)}return this.control(e)},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.FormBuilder=p,n.define=i,r.exports}),System.register("angular2/src/core/dom/generic_browser_adapter",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/collection"),s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/dom/dom_adapter"),u=function(e){function t(){var t=this;e.call(this),this._animationPrefix=null,this._transitionEnd=null;try{var r=this.createElement("div",this.defaultDoc());if(s.isPresent(this.getStyle(r,"animationName")))this._animationPrefix="";else for(var n=["Webkit","Moz","O","ms"],i=0;i<n.length;i++)if(s.isPresent(this.getStyle(r,n[i]+"AnimationName"))){this._animationPrefix="-"+s.StringWrapper.toLowerCase(n[i])+"-";break}var o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};a.StringMapWrapper.forEach(o,function(e,n){s.isPresent(t.getStyle(r,n))&&(t._transitionEnd=e)})}catch(c){this._animationPrefix=null,this._transitionEnd=null}}return o(t,e),t.prototype.getDistributedNodes=function(e){return e.getDistributedNodes()},t.prototype.resolveAndSetHref=function(e,t,r){e.href=null==r?t:t+"/../"+r},t.prototype.cssToRules=function(e){var t=this.createStyleElement(e);this.appendChild(this.defaultDoc().head,t);var r=[];if(s.isPresent(t.sheet))try{var n=t.sheet.cssRules;r=a.ListWrapper.createFixedSize(n.length);for(var i=0;i<n.length;i++)r[i]=n[i]}catch(o){}return this.remove(t),r},t.prototype.supportsDOMEvents=function(){return!0},t.prototype.supportsNativeShadowDOM=function(){return s.isFunction(this.defaultDoc().body.createShadowRoot)},t.prototype.supportsUnprefixedCssAnimation=function(){return s.isPresent(this.defaultDoc().body.style)&&s.isPresent(this.defaultDoc().body.style.animationName)},t.prototype.getAnimationPrefix=function(){return s.isPresent(this._animationPrefix)?this._animationPrefix:""},t.prototype.getTransitionEnd=function(){return s.isPresent(this._transitionEnd)?this._transitionEnd:""},t.prototype.supportsAnimation=function(){return s.isPresent(this._animationPrefix)&&s.isPresent(this._transitionEnd)},t}(c.DomAdapter);return t.GenericBrowserDomAdapter=u,n.define=i,r.exports}),System.register("angular2/src/core/testability/testability",["angular2/src/core/di","angular2/src/core/dom/dom_adapter","angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/zone/ng_zone","angular2/src/core/facade/async"],!0,function(e,t,r){
function n(e){m=e}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/dom/dom_adapter"),l=e("angular2/src/core/facade/collection"),p=e("angular2/src/core/facade/lang"),f=e("angular2/src/core/facade/exceptions"),d=e("angular2/src/core/zone/ng_zone"),h=e("angular2/src/core/facade/async"),g=function(){function e(e){this._ngZone=e,this._pendingCount=0,this._callbacks=[],this._isAngularEventPending=!1,this._watchAngularEvents(e)}return e.prototype._watchAngularEvents=function(e){var t=this;e.overrideOnTurnStart(function(){t._isAngularEventPending=!0}),e.overrideOnEventDone(function(){t._isAngularEventPending=!1,t._runCallbacksIfReady()},!0)},e.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._pendingCount},e.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new f.BaseException("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},e.prototype.isStable=function(){return 0==this._pendingCount&&!this._isAngularEventPending},e.prototype._runCallbacksIfReady=function(){var e=this;this.isStable()&&h.PromiseWrapper.resolve(null).then(function(t){for(;0!==e._callbacks.length;)e._callbacks.pop()()})},e.prototype.whenStable=function(e){this._callbacks.push(e),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.isAngularEventPending=function(){return this._isAngularEventPending},e.prototype.findBindings=function(e,t,r){return[]},e=a([c.Injectable(),s("design:paramtypes",[d.NgZone])],e)}();t.Testability=g;var v=function(){function e(){this._applications=new l.Map,m.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.getAllTestabilities=function(){return l.MapWrapper.values(this._applications)},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),null==e?null:this._applications.has(e)?this._applications.get(e):t?this.findTestabilityInTree(u.DOM.isShadowRoot(e)?u.DOM.getHost(e):u.DOM.parentElement(e)):null},e=a([c.Injectable(),s("design:paramtypes",[])],e)}();t.TestabilityRegistry=v;var y=function(){function e(){}return e.prototype.addToWindow=function(e){},e=a([p.CONST(),s("design:paramtypes",[])],e)}();t.setTestabilityGetter=n;var m=p.CONST_EXPR(new y);return i.define=o,r.exports}),System.register("angular2/src/core/compiler/xhr_impl",["angular2/src/core/di","angular2/src/core/facade/async","angular2/src/core/facade/lang","angular2/src/core/compiler/xhr"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/async"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/compiler/xhr"),f=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.get=function(e){var t=u.PromiseWrapper.completer(),r=new XMLHttpRequest;return r.open("GET",e,!0),r.responseType="text",r.onload=function(){var n=l.isPresent(r.response)?r.response:r.responseText,i=1223===r.status?204:r.status;0===i&&(i=n?200:0),i>=200&&300>=i?t.resolve(n):t.reject("Failed to load "+e,null)},r.onerror=function(){t.reject("Failed to load "+e,null)},r.send(),t.promise},t=a([c.Injectable(),s("design:paramtypes",[])],t)}(p.XHR);return t.XHRImpl=f,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/key_events",["angular2/src/core/dom/dom_adapter","angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/render/dom/events/event_manager","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/dom/dom_adapter"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/collection"),p=e("angular2/src/core/render/dom/events/event_manager"),f=e("angular2/src/core/di"),d=["alt","control","meta","shift"],h={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},g=function(e){function t(){e.call(this)}return o(t,e),t.prototype.supports=function(e){return u.isPresent(t.parseEventName(e))},t.prototype.addEventListener=function(e,r,n){var i=t.parseEventName(r),o=t.eventCallback(e,l.StringMapWrapper.get(i,"fullKey"),n,this.manager.getZone());this.manager.getZone().runOutsideAngular(function(){c.DOM.on(e,l.StringMapWrapper.get(i,"domEventName"),o)})},t.parseEventName=function(e){var r=e.toLowerCase().split("."),n=l.ListWrapper.removeAt(r,0);if(0===r.length||!u.StringWrapper.equals(n,"keydown")&&!u.StringWrapper.equals(n,"keyup"))return null;var i=t._normalizeKey(l.ListWrapper.removeLast(r)),o="";if(l.ListWrapper.forEach(d,function(e){l.ListWrapper.contains(r,e)&&(l.ListWrapper.remove(r,e),o+=e+".")}),o+=i,0!=r.length||0===i.length)return null;var a=l.StringMapWrapper.create();return l.StringMapWrapper.set(a,"domEventName",n),l.StringMapWrapper.set(a,"fullKey",o),a},t.getEventFullKey=function(e){var t="",r=c.DOM.getEventKey(e);return r=r.toLowerCase(),u.StringWrapper.equals(r," ")?r="space":u.StringWrapper.equals(r,".")&&(r="dot"),l.ListWrapper.forEach(d,function(n){if(n!=r){var i=l.StringMapWrapper.get(h,n);i(e)&&(t+=n+".")}}),t+=r},t.eventCallback=function(e,r,n,i){return function(e){u.StringWrapper.equals(t.getEventFullKey(e),r)&&i.run(function(){return n(e)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t=a([f.Injectable(),s("design:paramtypes",[])],t)}(p.EventManagerPlugin);return t.KeyEventsPlugin=g,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/hammer_common",["angular2/src/core/render/dom/events/event_manager","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/render/dom/events/event_manager"),s=e("angular2/src/core/facade/collection"),c={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},u=function(e){function t(){e.call(this)}return o(t,e),t.prototype.supports=function(e){return e=e.toLowerCase(),s.StringMapWrapper.contains(c,e)},t}(a.EventManagerPlugin);return t.HammerGesturesPluginCommon=u,n.define=i,r.exports}),System.register("angular2/src/core/platform_bindings",["angular2/src/core/di","angular2/src/core/facade/exceptions","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/dom/dom_adapter");return t.EXCEPTION_BINDING=o.bind(a.ExceptionHandler).toFactory(function(){return new a.ExceptionHandler(s.DOM,!1)},[]),n.define=i,r.exports}),System.register("angular2/src/core/profile/wtf_init",[],!0,function(e,t,r){function n(){}var i=System.global,o=i.define;return i.define=void 0,t.wtfInit=n,i.define=o,r.exports}),System.register("angular2/src/core/life_cycle/life_cycle",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/profile/profile"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/exceptions"),l=e("angular2/src/core/profile/profile"),p=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this._runningTick=!1,this._changeDetectors=[],c.isPresent(e)&&this._changeDetectors.push(e),this._enforceNoNewChanges=t}return e.prototype.registerWith=function(e,t){var r=this;void 0===t&&(t=null),c.isPresent(t)&&this._changeDetectors.push(t),e.overrideOnTurnDone(function(){return r.tick()})},e.prototype.tick=function(){if(this._runningTick)throw new u.BaseException("LifeCycle.tick is called recursively");var t=e._tickScope();try{this._runningTick=!0,this._changeDetectors.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._changeDetectors.forEach(function(e){return e.checkNoChanges()})}finally{this._runningTick=!1,l.wtfLeave(t)}},e._tickScope=l.wtfCreateScope("LifeCycle#tick()"),e=o([s.Injectable(),a("design:paramtypes",[Object,Boolean])],e)}();return t.LifeCycle=p,n.define=i,r.exports}),System.register("angular2/src/core/bootstrap",["angular2/src/core/application"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/application");return t.bootstrap=o.bootstrap,n.define=i,r.exports}),System.register("angular2/src/core/services/title",["angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/dom/dom_adapter"),a=function(){function e(){}return e.prototype.getTitle=function(){return o.DOM.getTitle()},e.prototype.setTitle=function(e){o.DOM.setTitle(e)},e}();return t.Title=a,n.define=i,r.exports}),System.register("angular2/src/core/lifecycle",["angular2/src/core/life_cycle/life_cycle"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/life_cycle/life_cycle");return t.LifeCycle=o.LifeCycle,n.define=i,r.exports}),System.register("angular2/src/core/zone",["angular2/src/core/zone/ng_zone"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/zone/ng_zone");return t.NgZone=o.NgZone,n.define=i,r.exports}),System.register("angular2/src/core/directives/ng_class",["angular2/src/core/facade/lang","angular2/src/core/metadata","angular2/src/core/linker","angular2/src/core/change_detection","angular2/src/core/render","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/metadata"),u=e("angular2/src/core/linker"),l=e("angular2/src/core/change_detection"),p=e("angular2/src/core/render"),f=e("angular2/src/core/facade/collection"),d=function(){function e(e,t,r,n){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=r,this._renderer=n,this._initialClasses=[]}return Object.defineProperty(e.prototype,"initialClasses",{set:function(e){this._applyInitialClasses(!0),this._initialClasses=s.isPresent(e)&&s.isString(e)?e.split(" "):[],this._applyInitialClasses(!1),this._applyClasses(this._rawClass,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawClass",{set:function(e){this._cleanupClasses(this._rawClass),s.isString(e)&&(e=e.split(" ")),this._rawClass=e,s.isPresent(e)?f.isListLikeIterable(e)?(this._differ=this._iterableDiffers.find(e).create(null),this._mode="iterable"):(this._differ=this._keyValueDiffers.find(e).create(null),this._mode="keyValue"):this._differ=null},enumerable:!0,configurable:!0}),e.prototype.doCheck=function(){if(s.isPresent(this._differ)){var e=this._differ.diff(this._rawClass);s.isPresent(e)&&("iterable"==this._mode?this._applyIterableChanges(e):this._applyKeyValueChanges(e))}},e.prototype.onDestroy=function(){this._cleanupClasses(this._rawClass)},e.prototype._cleanupClasses=function(e){this._applyClasses(e,!0),this._applyInitialClasses(!1)},e.prototype._applyKeyValueChanges=function(e){var t=this;e.forEachAddedItem(function(e){t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})},e.prototype._applyIterableChanges=function(e){var t=this;e.forEachAddedItem(function(e){t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){t._toggleClass(e.item,!1)})},e.prototype._applyInitialClasses=function(e){var t=this;f.ListWrapper.forEach(this._initialClasses,function(r){t._toggleClass(r,!e)})},e.prototype._applyClasses=function(e,t){var r=this;s.isPresent(e)&&(f.isListLikeIterable(e)?f.ListWrapper.forEach(e,function(e){return r._toggleClass(e,!t)}):f.StringMapWrapper.forEach(e,function(e,n){e&&r._toggleClass(n,!t)}))},e.prototype._toggleClass=function(e,t){e=e.trim(),e.length>0&&this._renderer.setElementClass(this._ngEl,e,t)},e=o([c.Directive({selector:"[ng-class]",inputs:["rawClass: ng-class","initialClasses: class"]}),a("design:paramtypes",[l.IterableDiffers,l.KeyValueDiffers,u.ElementRef,p.Renderer])],e)}();return t.NgClass=d,n.define=i,r.exports}),System.register("angular2/src/core/directives/ng_for",["angular2/src/core/metadata","angular2/src/core/change_detection","angular2/src/core/linker","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/metadata"),c=e("angular2/src/core/change_detection"),u=e("angular2/src/core/linker"),l=e("angular2/src/core/facade/lang"),p=function(){function e(e,t,r,n){this._viewContainer=e,this._templateRef=t,this._iterableDiffers=r,this._cdr=n}return Object.defineProperty(e.prototype,"ngForOf",{set:function(e){this._ngForOf=e,l.isBlank(this._differ)&&l.isPresent(e)&&(this._differ=this._iterableDiffers.find(e).create(this._cdr))},enumerable:!0,configurable:!0}),e.prototype.doCheck=function(){if(l.isPresent(this._differ)){var e=this._differ.diff(this._ngForOf);l.isPresent(e)&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=[];e.forEachRemovedItem(function(e){return t.push(new f(e,null))}),e.forEachMovedItem(function(e){return t.push(new f(e,null))});var r=this._bulkRemove(t);e.forEachAddedItem(function(e){return r.push(new f(e,null))}),this._bulkInsert(r);for(var n=0;n<r.length;n++)this._perViewChange(r[n].view,r[n].record);for(var n=0,i=this._viewContainer.length;i>n;n++)this._viewContainer.get(n).setLocal("last",n===i-1)},e.prototype._perViewChange=function(e,t){e.setLocal("$implicit",t.item),e.setLocal("index",t.currentIndex),e.setLocal("even",t.currentIndex%2==0),e.setLocal("odd",t.currentIndex%2==1)},e.prototype._bulkRemove=function(e){e.sort(function(e,t){return e.record.previousIndex-t.record.previousIndex});for(var t=[],r=e.length-1;r>=0;r--){var n=e[r];l.isPresent(n.record.currentIndex)?(n.view=this._viewContainer.detach(n.record.previousIndex),t.push(n)):this._viewContainer.remove(n.record.previousIndex)}return t},e.prototype._bulkInsert=function(e){e.sort(function(e,t){return e.record.currentIndex-t.record.currentIndex});for(var t=0;t<e.length;t++){var r=e[t];l.isPresent(r.view)?this._viewContainer.insert(r.view,r.record.currentIndex):r.view=this._viewContainer.createEmbeddedView(this._templateRef,r.record.currentIndex)}return e},e=o([s.Directive({selector:"[ng-for][ng-for-of]",inputs:["ngForOf"]}),a("design:paramtypes",[u.ViewContainerRef,u.TemplateRef,c.IterableDiffers,c.ChangeDetectorRef])],e)}();t.NgFor=p;var f=function(){function e(e,t){this.record=e,this.view=t}return e}();return n.define=i,r.exports}),System.register("angular2/src/core/directives/ng_if",["angular2/src/core/metadata","angular2/src/core/linker","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/metadata"),c=e("angular2/src/core/linker"),u=e("angular2/src/core/facade/lang"),l=function(){function e(e,t){this._viewContainer=e,this._templateRef=t,this._prevCondition=null}return Object.defineProperty(e.prototype,"ngIf",{set:function(e){!e||!u.isBlank(this._prevCondition)&&this._prevCondition?e||!u.isBlank(this._prevCondition)&&!this._prevCondition||(this._prevCondition=!1,this._viewContainer.clear()):(this._prevCondition=!0,this._viewContainer.createEmbeddedView(this._templateRef))},enumerable:!0,configurable:!0}),e=o([s.Directive({selector:"[ng-if]",inputs:["ngIf"]}),a("design:paramtypes",[c.ViewContainerRef,c.TemplateRef])],e)}();return t.NgIf=l,n.define=i,r.exports}),System.register("angular2/src/core/directives/ng_style",["angular2/src/core/change_detection","angular2/src/core/linker","angular2/src/core/metadata","angular2/src/core/render","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/change_detection"),c=e("angular2/src/core/linker"),u=e("angular2/src/core/metadata"),l=e("angular2/src/core/render"),p=e("angular2/src/core/facade/lang"),f=function(){function e(e,t,r){this._differs=e,this._ngEl=t,this._renderer=r}return Object.defineProperty(e.prototype,"rawStyle",{set:function(e){this._rawStyle=e,p.isBlank(this._differ)&&p.isPresent(e)&&(this._differ=this._differs.find(this._rawStyle).create(null))},enumerable:!0,configurable:!0}),e.prototype.doCheck=function(){if(p.isPresent(this._differ)){var e=this._differ.diff(this._rawStyle);p.isPresent(e)&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=this;e.forEachAddedItem(function(e){t._setStyle(e.key,e.currentValue)}),e.forEachChangedItem(function(e){t._setStyle(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){t._setStyle(e.key,null)})},e.prototype._setStyle=function(e,t){this._renderer.setElementStyle(this._ngEl,e,t)},e=o([u.Directive({selector:"[ng-style]",inputs:["rawStyle: ng-style"]}),a("design:paramtypes",[s.KeyValueDiffers,c.ElementRef,l.Renderer])],e)}();return t.NgStyle=f,n.define=i,r.exports}),System.register("angular2/src/core/directives/ng_switch",["angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/linker","angular2/src/core/facade/lang","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/metadata"),u=e("angular2/src/core/di"),l=e("angular2/src/core/linker"),p=e("angular2/src/core/facade/lang"),f=e("angular2/src/core/facade/collection"),d=p.CONST_EXPR(new Object),h=function(){function e(e,t){this._viewContainerRef=e,this._templateRef=t}return e.prototype.create=function(){this._viewContainerRef.createEmbeddedView(this._templateRef)},e.prototype.destroy=function(){this._viewContainerRef.clear()},e}();t.SwitchView=h;var g=function(){function e(){this._useDefault=!1,this._valueViews=new f.Map,this._activeViews=[]}return Object.defineProperty(e.prototype,"ngSwitch",{set:function(e){this._emptyAllActiveViews(),this._useDefault=!1;var t=this._valueViews.get(e);p.isBlank(t)&&(this._useDefault=!0,t=p.normalizeBlank(this._valueViews.get(d))),this._activateViews(t),this._switchValue=e},enumerable:!0,configurable:!0}),e.prototype._onWhenValueChanged=function(e,t,r){this._deregisterView(e,r),this._registerView(t,r),e===this._switchValue?(r.destroy(),f.ListWrapper.remove(this._activeViews,r)):t===this._switchValue&&(this._useDefault&&(this._useDefault=!1,this._emptyAllActiveViews()),r.create(),this._activeViews.push(r)),0!==this._activeViews.length||this._useDefault||(this._useDefault=!0,this._activateViews(this._valueViews.get(d)))},e.prototype._emptyAllActiveViews=function(){for(var e=this._activeViews,t=0;t<e.length;t++)e[t].destroy();this._activeViews=[]},e.prototype._activateViews=function(e){if(p.isPresent(e)){for(var t=0;t<e.length;t++)e[t].create();this._activeViews=e}},e.prototype._registerView=function(e,t){var r=this._valueViews.get(e);p.isBlank(r)&&(r=[],this._valueViews.set(e,r)),r.push(t)},e.prototype._deregisterView=function(e,t){if(e!==d){var r=this._valueViews.get(e);1==r.length?this._valueViews["delete"](e):f.ListWrapper.remove(r,t)}},e=o([c.Directive({selector:"[ng-switch]",inputs:["ngSwitch"]}),a("design:paramtypes",[])],e)}();t.NgSwitch=g;var v=function(){function e(e,t,r){this._switch=r,this._value=d,this._view=new h(e,t)}return Object.defineProperty(e.prototype,"ngSwitchWhen",{set:function(e){this._switch._onWhenValueChanged(this._value,e,this._view),this._value=e},enumerable:!0,configurable:!0}),e=o([c.Directive({selector:"[ng-switch-when]",inputs:["ngSwitchWhen"]}),s(2,u.Host()),a("design:paramtypes",[l.ViewContainerRef,l.TemplateRef,g])],e)}();t.NgSwitchWhen=v;var y=function(){function e(e,t,r){r._registerView(d,new h(e,t))}return e=o([c.Directive({selector:"[ng-switch-default]"}),s(2,u.Host()),a("design:paramtypes",[l.ViewContainerRef,l.TemplateRef,g])],e)}();return t.NgSwitchDefault=y,n.define=i,r.exports}),System.register("angular2/src/core/directives/observable_list_diff",[],!0,function(e,t,r){var n=System.global,i=n.define;return n.define=void 0,n.define=i,r.exports}),System.register("angular2/src/core/debug/debug_element",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/dom/dom_adapter","angular2/src/core/linker/view_ref"],!0,function(e,t,r){function n(e){return new p(l.internalView(e.parentView),e.boundElementIndex)}function i(e){return e.map(function(e){return e.nativeElement})}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/dom/dom_adapter"),l=e("angular2/src/core/linker/view_ref"),p=function(){function e(e,t){this._parentView=e,this._boundElementIndex=t,this._elementInjector=this._parentView.elementInjectors[this._boundElementIndex]}return Object.defineProperty(e.prototype,"componentInstance",{get:function(){return s.isPresent(this._elementInjector)?this._elementInjector.getComponent():null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeElement",{get:function(){return this.elementRef.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elementRef",{get:function(){return this._parentView.elementRefs[this._boundElementIndex]},enumerable:!0,configurable:!0}),e.prototype.getDirectiveInstance=function(e){return this._elementInjector.getDirectiveAtIndex(e)},Object.defineProperty(e.prototype,"children",{get:function(){return this._getChildElements(this._parentView,this._boundElementIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentViewChildren",{get:function(){var e=this._parentView.getNestedView(this._boundElementIndex);return s.isPresent(e)?this._getChildElements(e,null):[]},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(e,t){this._parentView.triggerEventHandlers(e,t,this._boundElementIndex)},e.prototype.hasDirective=function(e){return s.isPresent(this._elementInjector)?this._elementInjector.hasDirective(e):!1},e.prototype.inject=function(e){return s.isPresent(this._elementInjector)?this._elementInjector.get(e):null},e.prototype.getLocal=function(e){return this._parentView.locals.get(e)},e.prototype.query=function(e,t){void 0===t&&(t=f.all);var r=this.queryAll(e,t);return r.length>0?r[0]:null},e.prototype.queryAll=function(e,t){void 0===t&&(t=f.all);var r=t(this);return c.ListWrapper.filter(r,e)},e.prototype._getChildElements=function(t,r){var n=this,i=[],o=null;s.isPresent(r)&&(o=t.proto.elementBinders[r-t.elementOffset]);for(var a=0;a<t.proto.elementBinders.length;++a){var u=t.proto.elementBinders[a];if(u.parent==o){i.push(new e(t,t.elementOffset+a));var l=t.viewContainers[t.elementOffset+a];s.isPresent(l)&&c.ListWrapper.forEach(l.views,function(e){i=i.concat(n._getChildElements(e,null))})}}return i},e}();t.DebugElement=p,t.inspectElement=n,t.asNativeElements=i;var f=function(){function e(){}return e.all=function(t){var r=[];return r.push(t),c.ListWrapper.forEach(t.children,function(t){r=r.concat(e.all(t))}),c.ListWrapper.forEach(t.componentViewChildren,function(t){r=r.concat(e.all(t))}),r},e.light=function(t){var r=[];return c.ListWrapper.forEach(t.children,function(t){r.push(t),r=r.concat(e.light(t))}),r},e.view=function(t){var r=[];return c.ListWrapper.forEach(t.componentViewChildren,function(t){r.push(t),r=r.concat(e.light(t))}),r},e}();t.Scope=f;var d=function(){function e(){}return e.all=function(){return function(e){return!0}},e.css=function(e){return function(t){return s.isPresent(t.nativeElement)?u.DOM.elementMatches(t.nativeElement,e):!1}},e.directive=function(e){return function(t){return t.hasDirective(e)}},e}();return t.By=d,o.define=a,r.exports}),System.register("angular2/src/core/debug/debug_element_view_listener",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/di","angular2/src/core/linker/view_listener","angular2/src/core/dom/dom_adapter","angular2/src/core/render/api","angular2/src/core/debug/debug_element"],!0,function(e,t,r){function n(e,t){l.isPresent(e)&&h.DOM.setData(e,y,p.ListWrapper.join(t,_))}function i(e){var t=h.DOM.getData(e,y);return l.isPresent(t)?p.ListWrapper.map(t.split(_),function(e){return l.NumberWrapper.parseInt(e,10)}):null}function o(e){var t=i(e);if(l.isPresent(t)){var r=x.get(t[0]);if(l.isPresent(r))return new v.DebugElement(r,t[1])}return null}var a=System.global,s=a.define;a.define=void 0;var c=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},u=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/di"),d=e("angular2/src/core/linker/view_listener"),h=e("angular2/src/core/dom/dom_adapter"),g=e("angular2/src/core/render/api"),v=e("angular2/src/core/debug/debug_element"),y="ngid",m="ng.probe",_="#",b=new p.Map,x=new p.Map,w=0;t.inspectNativeElement=o;var j=function(){function e(e){this._renderer=e,h.DOM.setGlobalVar(m,o)}return e.prototype.viewCreated=function(e){var t=w++;x.set(t,e),b.set(e,t);for(var r=0;r<e.elementRefs.length;r++){var i=e.elementRefs[r];n(this._renderer.getNativeElementSync(i),[t,r])}},e.prototype.viewDestroyed=function(e){var t=b.get(e);p.MapWrapper["delete"](b,e),p.MapWrapper["delete"](x,t)},e=c([f.Injectable(),u("design:paramtypes",[g.Renderer])],e)}();return t.DebugElementViewListener=j,t.ELEMENT_PROBE_BINDINGS=l.CONST_EXPR([j,l.CONST_EXPR(new f.Binding(d.AppViewListener,{toAlias:j}))]),a.define=s,r.exports}),System.register("angular2/src/http/interfaces",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(){}return e}();t.ConnectionBackend=o;var a=function(){function e(){}return e}();return t.Connection=a,n.define=i,r.exports}),System.register("angular2/src/http/headers",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=function(){function e(t){var r=this;return o.isBlank(t)?void(this._headersMap=new s.Map):void(t instanceof e?this._headersMap=t._headersMap:(this._headersMap=s.MapWrapper.createFromStringMap(t),
s.MapWrapper.forEach(this._headersMap,function(e,t){if(!s.isListLikeIterable(e)){var n=[];n.push(e),r._headersMap.set(t,n)}})))}return e.prototype.append=function(e,t){var r=this._headersMap.get(e),n=s.isListLikeIterable(r)?r:[];n.push(t),this._headersMap.set(e,n)},e.prototype["delete"]=function(e){s.MapWrapper["delete"](this._headersMap,e)},e.prototype.forEach=function(e){s.MapWrapper.forEach(this._headersMap,e)},e.prototype.get=function(e){return s.ListWrapper.first(this._headersMap.get(e))},e.prototype.has=function(e){return this._headersMap.has(e)},e.prototype.keys=function(){return s.MapWrapper.keys(this._headersMap)},e.prototype.set=function(e,t){var r=[];if(s.isListLikeIterable(t)){var n=t.join(",");r.push(n)}else r.push(t);this._headersMap.set(e,r)},e.prototype.values=function(){return s.MapWrapper.values(this._headersMap)},e.prototype.getAll=function(e){var t=this._headersMap.get(e);return s.isListLikeIterable(t)?t:[]},e.prototype.entries=function(){throw new a.BaseException('"entries" method is not implemented on Headers class')},e}();return t.Headers=c,n.define=i,r.exports}),System.register("angular2/src/http/enums",[],!0,function(e,t,r){var n=System.global,i=n.define;return n.define=void 0,function(e){e[e.Get=0]="Get",e[e.Post=1]="Post",e[e.Put=2]="Put",e[e.Delete=3]="Delete",e[e.Options=4]="Options",e[e.Head=5]="Head",e[e.Patch=6]="Patch"}(t.RequestMethods||(t.RequestMethods={})),t.RequestMethods,!function(e){e[e.Unsent=0]="Unsent",e[e.Open=1]="Open",e[e.HeadersReceived=2]="HeadersReceived",e[e.Loading=3]="Loading",e[e.Done=4]="Done",e[e.Cancelled=5]="Cancelled"}(t.ReadyStates||(t.ReadyStates={})),t.ReadyStates,!function(e){e[e.Basic=0]="Basic",e[e.Cors=1]="Cors",e[e.Default=2]="Default",e[e.Error=3]="Error",e[e.Opaque=4]="Opaque"}(t.ResponseTypes||(t.ResponseTypes={})),t.ResponseTypes,n.define=i,r.exports}),System.register("angular2/src/http/url_search_params",["angular2/src/core/facade/lang","angular2/src/core/facade/collection"],!0,function(e,t,r){function n(e){void 0===e&&(e="");var t=new s.Map;if(e.length>0){var r=a.StringWrapper.split(e,new RegExp("&"));s.ListWrapper.forEach(r,function(e){var r=a.StringWrapper.split(e,new RegExp("=")),n=r[0],i=r[1],o=a.isPresent(t.get(n))?t.get(n):[];o.push(i),t.set(n,o)})}return t}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/collection"),c=function(){function e(e){void 0===e&&(e=""),this.rawParams=e,this.paramsMap=n(e)}return e.prototype.clone=function(){var t=new e;return t.appendAll(this),t},e.prototype.has=function(e){return this.paramsMap.has(e)},e.prototype.get=function(e){var t=this.paramsMap.get(e);return s.isListLikeIterable(t)?s.ListWrapper.first(t):null},e.prototype.getAll=function(e){var t=this.paramsMap.get(e);return a.isPresent(t)?t:[]},e.prototype.set=function(e,t){var r=this.paramsMap.get(e),n=a.isPresent(r)?r:[];s.ListWrapper.clear(n),n.push(t),this.paramsMap.set(e,n)},e.prototype.setAll=function(e){var t=this;s.MapWrapper.forEach(e.paramsMap,function(e,r){var n=t.paramsMap.get(r),i=a.isPresent(n)?n:[];s.ListWrapper.clear(i),i.push(e[0]),t.paramsMap.set(r,i)})},e.prototype.append=function(e,t){var r=this.paramsMap.get(e),n=a.isPresent(r)?r:[];n.push(t),this.paramsMap.set(e,n)},e.prototype.appendAll=function(e){var t=this;s.MapWrapper.forEach(e.paramsMap,function(e,r){for(var n=t.paramsMap.get(r),i=a.isPresent(n)?n:[],o=0;o<e.length;++o)i.push(e[o]);t.paramsMap.set(r,i)})},e.prototype.replaceAll=function(e){var t=this;s.MapWrapper.forEach(e.paramsMap,function(e,r){var n=t.paramsMap.get(r),i=a.isPresent(n)?n:[];s.ListWrapper.clear(i);for(var o=0;o<e.length;++o)i.push(e[o]);t.paramsMap.set(r,i)})},e.prototype.toString=function(){var e=[];return s.MapWrapper.forEach(this.paramsMap,function(t,r){s.ListWrapper.forEach(t,function(t){e.push(r+"="+t)})}),s.ListWrapper.join(e,"&")},e.prototype["delete"]=function(e){s.MapWrapper["delete"](this.paramsMap,e)},e}();return t.URLSearchParams=c,i.define=o,r.exports}),System.register("angular2/src/http/static_response",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/http/http_utils"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/http/http_utils"),c=function(){function e(e){this._body=e.body,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,this.type=e.type,this.url=e.url}return e.prototype.blob=function(){throw new a.BaseException('"blob()" method not implemented on Response superclass')},e.prototype.json=function(){var e;return s.isJsObject(this._body)?e=this._body:o.isString(this._body)&&(e=o.Json.parse(this._body)),e},e.prototype.text=function(){return this._body.toString()},e.prototype.arrayBuffer=function(){throw new a.BaseException('"arrayBuffer()" method not implemented on Response superclass')},e}();return t.Response=c,n.define=i,r.exports}),System.register("angular2/src/http/base_response_options",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/http/headers","angular2/src/http/enums"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/http/headers"),p=e("angular2/src/http/enums"),f=function(){function e(e){var t=void 0===e?{}:e,r=t.body,n=t.status,i=t.headers,o=t.statusText,a=t.type,s=t.url;this.body=u.isPresent(r)?r:null,this.status=u.isPresent(n)?n:null,this.headers=u.isPresent(i)?i:null,this.statusText=u.isPresent(o)?o:null,this.type=u.isPresent(a)?a:null,this.url=u.isPresent(s)?s:null}return e.prototype.merge=function(t){return new e({body:u.isPresent(t)&&u.isPresent(t.body)?t.body:this.body,status:u.isPresent(t)&&u.isPresent(t.status)?t.status:this.status,headers:u.isPresent(t)&&u.isPresent(t.headers)?t.headers:this.headers,statusText:u.isPresent(t)&&u.isPresent(t.statusText)?t.statusText:this.statusText,type:u.isPresent(t)&&u.isPresent(t.type)?t.type:this.type,url:u.isPresent(t)&&u.isPresent(t.url)?t.url:this.url})},e}();t.ResponseOptions=f;var d=function(e){function t(){e.call(this,{status:200,statusText:"Ok",type:p.ResponseTypes.Default,headers:new l.Headers})}return o(t,e),t=a([c.Injectable(),s("design:paramtypes",[])],t)}(f);return t.BaseResponseOptions=d,n.define=i,r.exports}),System.register("angular2/src/http/backends/browser_xhr",["angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=function(){function e(){}return e.prototype.build=function(){return new XMLHttpRequest},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.BrowserXhr=c,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/VirtualTimeScheduler",["@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscription"),u=n(c),l=function(){function e(){o(this,e),this.actions=[],this.active=!1,this.scheduled=!1,this.index=0,this.sorted=!1,this.frame=0}return e.prototype.now=function(){return 0},e.prototype.sortActions=function(){this.sorted||(this.actions.sort(function(e,t){return e.delay===t.delay?e.index>t.index?1:-1:e.delay>t.delay?1:-1}),this.sorted=!0)},e.prototype.flush=function(){this.sortActions();for(var e=this.actions;e.length>0;){var t=e.shift();this.frame=t.delay,t.execute()}this.frame=0},e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),this.sorted=!1,new p(this,e,this.index++).schedule(r,t)},e}();t["default"]=l;var p=function(e){function t(r,n,i){o(this,t),e.call(this),this.scheduler=r,this.work=n,this.index=i}return i(t,e),t.prototype.schedule=function(e){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1];if(this.isUnsubscribed)return this;var n=this.scheduler,i=n.frame===this.delay?this:new t(n,this.work,n.index+=1);return i.state=e,i.delay=n.frame+r,n.actions.push(i),this},t.prototype.execute=function(){if(this.isUnsubscribed)throw new Error("How did did we execute a canceled Action?");this.work(this.state)},t.prototype.unsubscribe=function(){var t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=void 0,this.state=void 0,this.scheduler=void 0,-1!==n&&r.splice(n,1),e.prototype.unsubscribe.call(this)},t}(u["default"]);return r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Notification",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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")}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/Observable"),c=n(s),u=function(){function e(t,r,n){i(this,e),this.kind=t,this.value=r,this.exception=n,this.hasValue="N"===t}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next(this.value);case"E":return e.error(this.exception);case"C":return e.complete()}},e.prototype["do"]=function(e,t,r){var n=this.kind;switch(n){case"N":return e(this.value);case"E":return t(this.exception);case"C":return r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this["do"](e,t,r)},e.prototype.toObservable=function(){var e=this.kind,t=this.value;switch(e){case"N":return c["default"].of(t);case"E":return c["default"]["throw"](t);case"C":return c["default"].empty()}},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return new e("C")},e}();return t["default"]=u,r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction",["@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscription"),u=n(c),l=function(e){function t(r,n){i(this,t),e.call(this),this.scheduler=r,this.work=n}return o(t,e),t.prototype.schedule=function(e){if(this.isUnsubscribed)return this;this.state=e;var t=this.scheduler;return t.actions.push(this),t.flush(),this},t.prototype.execute=function(){if(this.isUnsubscribed)throw new Error("How did did we execute a canceled Action?");this.work(this.state)},t.prototype.unsubscribe=function(){var t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=void 0,this.state=void 0,this.scheduler=void 0,-1!==n&&r.splice(n,1),e.prototype.unsubscribe.call(this)},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/FutureAction",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),u=n(c),l=function(e){function t(r,n){i(this,t),e.call(this,r,n),this.scheduler=r,this.work=n}return o(t,e),t.prototype.schedule=function(e){var t=this,r=arguments.length<=1||void 0===arguments[1]?0:arguments[1];if(this.isUnsubscribed)return this;this.delay=r,this.state=e;var n=this.id;null!=n&&(this.id=void 0,clearTimeout(n));var i=this.scheduler;return this.id=setTimeout(function(){t.id=void 0,i.actions.push(t),i.flush()},this.delay),this},t.prototype.unsubscribe=function(){var t=this.id;null!=t&&(this.id=void 0,clearTimeout(t)),e.prototype.unsubscribe.call(this)},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Immediate",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root"),a={setImmediate:function(e){return 0},clearImmediate:function(e){}};return t.Immediate=a,o.root&&o.root.setImmediate?(a.setImmediate=o.root.setImmediate,a.clearImmediate=o.root.clearImmediate):t.Immediate=a=function(e,t){function r(e){delete h[e]}function n(e){return h[d]=i.apply(void 0,e),d++}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return function(){"function"==typeof e?e.apply(void 0,r):new Function(""+e)()}}function o(e){if(g)setTimeout(i(o,e),0);else{var t=h[e];if(t){g=!0;try{t()}finally{r(e),g=!1}}}}function a(){return function(){var t=n(arguments);return e.process.nextTick(i(o,t)),t}}function s(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}function c(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&o(+r.data.slice(t.length))};return e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),function(){var r=n(arguments);return e.postMessage(t+r,"*"),r}}function u(){var e=new MessageChannel;return e.port1.onmessage=function(e){var t=e.data;o(t)},function(){var t=n(arguments);return e.port2.postMessage(t),t}}function l(){var e=v.documentElement;return function(){var t=n(arguments),r=v.createElement("script");return r.onreadystatechange=function(){o(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r),t}}function p(){return function(){var e=n(arguments);return setTimeout(i(o,e),0),e}}var f,d=1,h={},g=!1,v=e.document;return f="[object process]"==={}.toString.call(e.process)?a():s()?c():e.MessageChannel?u():v&&"onreadystatechange"in v.createElement("script")?l():p(),t.setImmediate=f,t.clearImmediate=r,t}(o.root,a),n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject",["@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),p=n(l),f=function(e){function t(r,n,o){void 0===r&&(r=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY),i(this,t),e.call(this),this.events=[],this.bufferSize=1>r?1:r,this._windowTime=1>n?1:n,this.scheduler=o}return o(t,e),t.prototype._next=function(t){var r=this._getNow();this.events.push(new d(r,t)),this._getEvents(r),e.prototype._next.call(this,t)},t.prototype._subscribe=function(t){for(var r=this._getEvents(this._getNow()),n=-1,i=r.length;!t.isUnsubscribed&&++n<i;)t.next(r[n].value);return e.prototype._subscribe.call(this,t)},t.prototype._getNow=function(){return(this.scheduler||p["default"]).now()},t.prototype._getEvents=function(e){for(var t=this.bufferSize,r=this._windowTime,n=this.events,i=n.length,o=0;i>o&&!(e-n[o].time<r);)o+=1;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(u["default"]);t["default"]=f;var d=function h(e,t){i(this,h),this.time=e,this.value=t};return r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject",["@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=function(e){function t(r){i(this,t),e.call(this),this.value=r}return o(t,e),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r?(r.isUnsubscribed||t.next(this.value),r):void 0},t.prototype._next=function(t){e.prototype._next.call(this,this.value=t)},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscription"),p=n(l),f=function(e){function t(r,n){i(this,t),e.call(this),this.source=r,this.subjectFactory=n}return o(t,e),t.prototype._subscribe=function(e){return this._getSubject().subscribe(e)},t.prototype._getSubject=function(){var e=this.subject;return e&&!e.isUnsubscribed?e:this.subject=this.subjectFactory()},t.prototype.connect=function(){var e=this.source,t=this.subscription;return t&&!t.isUnsubscribed?t:(t=e.subscribe(this._getSubject()),t.add(new d(this)),this.subscription=t)},t.prototype.refCount=function(){return new h(this)},t}(u["default"]);t["default"]=f;var d=function(e){function t(r){i(this,t),e.call(this),this.connectable=r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;e.subject=void 0,e.subscription=void 0,this.connectable=void 0},t}(p["default"]),h=function(e){function t(r){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];i(this,t),e.call(this),this.connectable=r,this.refCount=n}return o(t,e),t.prototype._subscribe=function(e){var t=this.connectable,r=t.subscribe(e);return 1===++this.refCount&&(this.connection=t.connect()),r.add(new g(this)),r},t}(u["default"]),g=function(e){function t(r){i(this,t),e.call(this),this.refCountObservable=r}return o(t,e),t.prototype._unsubscribe=function(){var e=this.refCountObservable;0===--e.refCount&&(e.connection.unsubscribe(),e.connection=void 0)},t}(p["default"]);return r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ScalarObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(r,n){i(this,t),e.call(this),this.value=r,this.scheduler=n,this._isScalar=!0}return o(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.done,r=e.value,n=e.subscriber;return t?void n.complete():(n.next(r),void(n.isUnsubscribed||(e.done=!0,this.schedule(e))))},t.prototype._subscribe=function(e){var r=this.value,n=this.scheduler;n?e.add(n.schedule(t.dispatch,0,{done:!1,value:r,subscriber:e})):(e.next(r),e.isUnsubscribed||e.complete())},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/EmptyObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(r){i(this,t),e.call(this),this.scheduler=r}return o(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){var t=e.subscriber;t.complete()},t.prototype._subscribe=function(e){var r=this.scheduler;r?e.add(r.schedule(t.dispatch,0,{subscriber:e})):e.complete()},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/errorObject",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o={e:{}};return t.errorObject=o,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ErrorObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(r,n){i(this,t),e.call(this),this.error=r,this.scheduler=n}return o(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.error,r=e.subscriber;r.error(t)},t.prototype._subscribe=function(e){var r=this.error,n=this.scheduler;n?e.add(n.schedule(t.dispatch,0,{error:r,subscriber:e})):e.error(r)},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(){i(this,t),e.call(this)}return o(t,e),t.create=function(){return new t},t.prototype._subscribe=function(e){},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/isNumeric",[],!0,function(e,t,r){function n(e){return!a(e)&&e-parseFloat(e)+1>=0}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=Array.isArray;return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/PromiseObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(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("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){var t=e.value,r=e.subscriber;r.next(t),r.complete()}function s(e){var t=e.err,r=e.subscriber;r.error(t)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0;var l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscription"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),g=n(h),v=function(e){function t(r,n){i(this,t),e.call(this),this.promise=r,this.scheduler=n,this._isScalar=!1}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?g["default"]:arguments[1];return new t(e,r)},t.prototype._subscribe=function(e){var t=this,r=this.scheduler,n=this.promise;if(r===g["default"])this._isScalar?(e.next(this.value),e.complete()):n.then(function(r){t._isScalar=!0,t.value=r,e.next(r),e.complete()},function(t){return e.error(t)});else{var i=function(){var i=new d["default"];if(t._isScalar){var o=t.value;i.add(r.schedule(a,0,{value:o,subscriber:e}))}else n.then(function(n){t._isScalar=!0,t.value=n,i.add(r.schedule(a,0,{value:n,subscriber:e}))},function(t){return i.add(r.schedule(s,0,{err:t,subscriber:e}))});return{v:i}}();if("object"==typeof i)return i.v}},t}(p["default"]);return t["default"]=v,r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/RangeObservable",["@reactivex/rxjs/dist/cjs/Observable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=function(e){function t(r,n,o){i(this,t),e.call(this),this.start=r,this.end=n,this.scheduler=o}return o(t,e),t.create=function(e,r,n){return void 0===e&&(e=0),void 0===r&&(r=0),new t(e,r,n)},t.dispatch=function(e){var t=e.start,r=e.index,n=e.end,i=e.subscriber;return r>=n?void i.complete():(i.next(t),void(i.isUnsubscribed||(e.index=r+1,e.start=t+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,n=this.start,i=this.end,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{index:r,end:i,start:n,subscriber:e}));else for(;;){if(r++>=i){e.complete();break}if(e.next(n++),e.isUnsubscribed)break}},t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/TimerObservable",["@reactivex/rxjs/dist/cjs/util/isNumeric","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/isNumeric"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(e){function t(r,n,o){void 0===r&&(r=0),i(this,t),e.call(this),this.dueTime=r,this.period=n,this.scheduler=o,u["default"](n)?this._period=Number(n)<1&&1||Number(n):n&&"function"==typeof n.schedule&&(o=n),o&&"function"==typeof o.schedule||(o=d["default"]),this.scheduler=o}return o(t,e),t.create=function(e,r,n){return void 0===e&&(e=0),new t(e,r,n)},t.dispatch=function(e){var r=e.index,n=e.period,i=e.subscriber,o=this;return i.next(r),"undefined"==typeof n?void i.complete():void(i.isUnsubscribed||("undefined"==typeof o.delay?o.add(o.scheduler.schedule(t.dispatch,n,{index:r+1,period:n,subscriber:i})):(e.index=r+1,o.schedule(e,n))))},t.prototype._subscribe=function(e){var r=0,n=this._period,i=this.dueTime,o=this.scheduler;e.add(o.schedule(t.dispatch,i,{index:r,period:n,subscriber:e}))},t}(p["default"]);return t["default"]=h,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscription"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/errorObject"),g=function(e){function t(r,n,o){i(this,t),e.call(this),this.addHandler=r,this.removeHandler=n,this.selector=o}return o(t,e),t.create=function(e,r,n){return new t(e,r,n)},t.prototype._subscribe=function(e){var t=this.addHandler,r=this.removeHandler,n=this.selector,i=n?function(t){var r=d["default"](n).apply(null,arguments);r===h.errorObject?e.error(r.e):e.next(r)}:function(t){e.next(t)},o=d["default"](t)(i);o===h.errorObject&&e.error(o.e),e.add(new p["default"](function(){r(i)}))},t}(u["default"]);return t["default"]=g,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/FromEventObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/errorObject"),d=e("@reactivex/rxjs/dist/cjs/Subscription"),h=n(d),g=function(e){function t(r,n,o){i(this,t),e.call(this),this.sourceObj=r,this.eventName=n,this.selector=o}return o(t,e),t.create=function(e,r,n){return new t(e,r,n)},t.setupSubscription=function(e,r,n,i){var o=void 0,a=e.toString();if("[object NodeList]"===a||"[object HTMLCollection]"===a)for(var s=0,c=e.length;c>s;s++)t.setupSubscription(e[s],r,n,i);else"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener?(e.addEventListener(r,n),o=function(){return e.removeEventListener(r,n)}):"function"==typeof e.on&&"function"==typeof e.off?(e.on(r,n),o=function(){return e.off(r,n)}):"function"==typeof e.addListener&&"function"==typeof e.removeListener&&(e.addListener(r,n),o=function(){return e.removeListener(r,n)});i.add(new h["default"](o))},t.prototype._subscribe=function(e){var r=this.sourceObj,n=this.eventName,i=this.selector,o=i?function(t){var r=p["default"](i)(t);r===f.errorObject?e.error(r.e):e.next(r)}:function(t){return e.next(t)};t.setupSubscription(r,n,o,e)},t}(u["default"]);return t["default"]=g,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(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("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){return null!==e}function s(e){for(var t=[],r=0;e>r;r++)t.push(null);return t}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0;var l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=function(e){function t(r){i(this,t),e.call(this),this.observables=r}return o(t,e),t.create=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return new t(r)},t.prototype._subscribe=function(e){for(var t=this.observables,r=t.length,n={complete:0,total:r,values:s(r)},i=0;r>i;i++)t[i].subscribe(new g(e,this,i,n))},t}(p["default"]);t["default"]=h;var g=function(e){function t(r,n,o,a){i(this,t),e.call(this,r),this.parent=n,this.index=o,this.context=a}return o(t,e),t.prototype._next=function(e){this._value=e},t.prototype._complete=function(){var e=this.context;e.values[this.index]=this._value,e.values.every(a)&&(this.destination.next(e.values),this.destination.complete())},t}(d["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Symbol_iterator",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root");return o.root.Symbol||(o.root.Symbol={}),o.root.Symbol.iterator||(o.root.Symbol.iterator="function"==typeof o.root.Symbol["for"]?o.root.Symbol["for"]("iterator"):o.root.Set&&"function"==typeof(new o.root.Set)["@@iterator"]?"@@iterator":"_es6shim_iterator_"),t["default"]=o.root.Symbol.iterator,r.exports=t["default"],n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/observeOn-support",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Notification"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscriber"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Notification"),p=n(l),f=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1];o(this,e),this.delay=r,this.scheduler=t}return e.prototype.call=function(e){return new d(e,this.scheduler,this.delay)},e}();t.ObserveOnOperator=f;var d=function(e){function t(r,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];o(this,t),e.call(this,r),this.delay=i,this.scheduler=n}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r)},t.prototype._next=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createNext(e),this.destination)))},t.prototype._error=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createError(e),this.destination)))},t.prototype._complete=function(){this.add(this.scheduler.schedule(t.dispatch,this.delay,new h(p["default"].createComplete(),this.destination)))},t}(u["default"]);t.ObserveOnSubscriber=d;var h=function g(e,t){o(this,g),this.notification=e,this.destination=t};return a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/merge-support",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subscriber"),u=n(c),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?Number.POSITIVE_INFINITY:arguments[0];o(this,e),this.concurrent=t}return e.prototype.call=function(e){return new p(e,this.concurrent)},e}();t.MergeOperator=l;var p=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.active=0,this.stopped=!1,this.buffer=[],this.concurrent=n}return i(t,e),t.prototype._next=function(e){var t=this.active;if(t<this.concurrent){var r=this.count,n=this._project(e,r);n&&(this.count=r+1,this.active=t+1,this.add(this._subscribeInner(n,e,r)))}else this._buffer(e)},t.prototype.complete=function(){this.stopped=!0,0===this.active&&0===this.buffer.length&&e.prototype.complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0},t.prototype._project=function(e,t){return e},t.prototype._buffer=function(e){this.buffer.push(e)},t.prototype._subscribeInner=function(e,t,r){var n=this.destination;if(!e._isScalar){var i=new f(n,this);return e._subscribe(i),i}n.next(e.value),this._innerComplete()},t.prototype._innerComplete=function(){var t=this.buffer,r=this.active-=1,n=this.stopped,i=t.length;n&&0===r&&0===i?e.prototype.complete.call(this):r<this.concurrent&&i>0&&this._next(t.shift())},t}(u["default"]);t.MergeSubscriber=p;var f=function(e){function t(r,n){o(this,t),e.call(this,r),this.parent=n}return i(t,e),t.prototype._complete=function(){this.parent._innerComplete()},t}(u["default"]);return t.MergeInnerSubscriber=f,a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concat",["@reactivex/rxjs/dist/cjs/operators/merge-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return t.unshift(this),t.push(1),c["default"].apply(this,t)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/operators/merge-static"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatAll",["@reactivex/rxjs/dist/cjs/operators/merge-support"],!0,function(e,t,r){function n(){return this.lift(new a.MergeOperator(1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/merge-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/flatMap-support",["@reactivex/rxjs/dist/cjs/operators/merge-support","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/operators/merge-support"),u=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/errorObject"),f=function(){function e(t,r){var n=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];o(this,e),this.project=t,this.projectResult=r,this.concurrent=n}return e.prototype.call=function(e){return new d(e,this.concurrent,this.project,this.projectResult)},e}();t.FlatMapOperator=f;var d=function(e){function t(r,n,i,a){o(this,t),e.call(this,r,n),this.project=i,this.projectResult=a}return i(t,e),t.prototype._project=function(e,t){var r=l["default"](this.project).call(this,e,t);return r===p.errorObject?(this.error(p.errorObject.e),null):r},t.prototype._subscribeInner=function(e,t,r){var n=this.projectResult;return n?e._subscribe(new h(this.destination,this,t,r,n)):e._isScalar?(this.destination.next(e.value),void this._innerComplete()):e._subscribe(new c.MergeInnerSubscriber(this.destination,this))},t}(c.MergeSubscriber);t.FlatMapSubscriber=d;var h=function(e){function t(r,n,i,a,s){o(this,t),e.call(this,r,n),this.count=0,this.value=i,this.index=a,this.project=s}return i(t,e),t.prototype._next=function(e){var t=e,r=this.count++;t=l["default"](this.project).call(this,this.value,e,this.index,r),t===p.errorObject?this.destination.error(p.errorObject.e):this.destination.next(t)},t}(c.MergeInnerSubscriber);return t.FlatMapInnerSubscriber=h,a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/flatMapTo-support",["@reactivex/rxjs/dist/cjs/operators/flatMap-support"],!0,function(e,t,r){function n(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 i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/operators/flatMap-support"),c=function(){function e(t,r){var n=arguments.length<=2||void 0===arguments[2]?Number.POSITIVE_INFINITY:arguments[2];i(this,e),this.observable=t,this.projectResult=r,this.concurrent=n}return e.prototype.call=function(e){return new u(e,this.concurrent,this.observable,this.projectResult)},e}();t.FlatMapToOperator=c;var u=function(e){function t(r,n,o,a){i(this,t),e.call(this,r,n,null,a),this.observable=o}return n(t,e),t.prototype._project=function(e,t){return this.observable},t}(s.FlatMapSubscriber);return t.FlatMapToSubscriber=u,o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/merge",["@reactivex/rxjs/dist/cjs/operators/merge-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return t.unshift(this),c["default"].apply(this,t)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/operators/merge-static"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mergeAll",["@reactivex/rxjs/dist/cjs/operators/merge-support"],!0,function(e,t,r){function n(e){return this.lift(new a.MergeOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/merge-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/flatMap",["@reactivex/rxjs/dist/cjs/operators/flatMap-support"],!0,function(e,t,r){function n(e,t,r){return this.lift(new a.FlatMapOperator(e,t,r))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/flatMap-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/flatMapTo",["@reactivex/rxjs/dist/cjs/operators/flatMapTo-support"],!0,function(e,t,r){function n(e,t,r){return this.lift(new a.FlatMapToOperator(e,t,r))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/flatMapTo-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switchAll",["@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/operators/merge-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return this.lift(new f)}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscription"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/operators/merge-support"),f=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new d(e)},e}(),d=function(e){function t(r){o(this,t),e.call(this,r,1)}return i(t,e),t.prototype._buffer=function(e){var t=this.active;if(t>0){this.active=t-1;var r=this.innerSubscription;r&&(r.unsubscribe(),this.innerSubscription=null)}this._next(e)},t.prototype._subscribeInner=function(t,r,n){return this.innerSubscription=new l["default"],this.innerSubscription.add(e.prototype._subscribeInner.call(this,t,r,n)),this.innerSubscription},t}(p.MergeSubscriber);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switchLatest",["@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/operators/flatMap-support"],!0,function(e,t,r){function n(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("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){return this.lift(new f(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscription"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/operators/flatMap-support"),f=function(e){function t(r,n){i(this,t),e.call(this,r,n,1)}return o(t,e),t.prototype.call=function(e){return new d(e,this.project,this.projectResult)},t}(p.FlatMapOperator),d=function(e){function t(r,n,o){i(this,t),e.call(this,r,1,n,o)}return o(t,e),t.prototype._buffer=function(e){var t=this.active;if(t>0){this.active=t-1;var r=this.innerSubscription;r&&r.unsubscribe()}this._next(e)},t.prototype._subscribeInner=function(t,r,n){return this.innerSubscription=new l["default"],this.innerSubscription.add(e.prototype._subscribeInner.call(this,t,r,n)),this.innerSubscription},t}(p.FlatMapSubscriber);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/switchLatestTo",["@reactivex/rxjs/dist/cjs/operators/flatMapTo-support"],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 o(e,t){return this.lift(new u(e,t))}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0,t["default"]=o;var c=e("@reactivex/rxjs/dist/cjs/operators/flatMapTo-support"),u=function(e){function t(r,i){n(this,t),e.call(this,r,i,1)}return i(t,e),t.prototype.call=function(e){return new l(e,this.observable,this.projectResult)},t}(c.FlatMapToOperator),l=function(e){function t(r,i,o){n(this,t),e.call(this,r,1,i,o)}return i(t,e),t.prototype._buffer=function(e){var t=this.active;if(t>0){this.active=t-1;var r=this.innerSubscription;r&&r.unsubscribe()}this._next(e)},t.prototype._subscribeInner=function(t,r,n){return this.innerSubscription=e.prototype._subscribeInner.call(this,t,r,n)},t}(c.FlatMapToSubscriber);return r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/expand",["@reactivex/rxjs/dist/cjs/operators/merge-support","@reactivex/rxjs/dist/cjs/observables/EmptyObservable","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new g(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/operators/merge-support"),l=e("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/errorObject"),g=function(){function e(t){o(this,e),this.project=t}return e.prototype.call=function(e){return new v(e,this.project)},e}(),v=function(e){function t(r,n){o(this,t),e.call(this,r,Number.POSITIVE_INFINITY),this.project=n}return i(t,e),t.prototype._project=function(e,t){var r=d["default"](this.project).call(this,e,t);return r===h.errorObject?(this.error(h.errorObject.e),null):r},t.prototype._subscribeInner=function(e,t,r){if(e._isScalar)this.destination.next(e.value),this._innerComplete(),this._next(e.value);else{if(!(e instanceof p["default"]))return e._subscribe(new y(this.destination,this));this._innerComplete()}},t}(u.MergeSubscriber),y=function(e){function t(r,n){o(this,t),e.call(this,r,n)}return i(t,e),t.prototype._next=function(e){this.destination.next(e),this.parent.next(e)},t}(u.MergeInnerSubscriber);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/do",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/noop","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return this.lift(new v(e||f["default"],t||f["default"],r||f["default"]))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/noop"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t,r,n){o(this,e),this.next=t,this.error=r,this.complete=n}return e.prototype.call=function(e){return new y(e,this.next,this.error,this.complete)},e}(),y=function(e){function t(r,n,i,a){o(this,t),e.call(this,r),this.__next=n,this.__error=i,this.__complete=a}return i(t,e),t.prototype._next=function(e){var t=h["default"](this.__next)(e);t===g.errorObject?this.destination.error(g.errorObject.e):this.destination.next(e)},t.prototype._error=function(e){var t=h["default"](this.__error)(e);this.destination.error(t===g.errorObject?g.errorObject.e:e)},t.prototype._complete=function(){var e=h["default"](this.__complete)();e===g.errorObject?this.destination.error(g.errorObject.e):this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/bindCallback",[],!0,function(e,t,r){function n(e,t,r){if("undefined"==typeof t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/mapTo",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.value=t}return e.prototype.call=function(e){return new f(e,this.value)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.value=n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/toArray",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return this.lift(new p)}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new f(e)},e}(),f=function(e){function t(r){o(this,t),e.call(this,r),this.array=[]}return i(t,e),t.prototype._next=function(e){this.array.push(e)},t.prototype._complete=function(){this.destination.next(this.array),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/count",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return this.lift(new p)}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new f(e)},e}(),f=function(e){function t(r){o(this,t),e.call(this,r),this.count=0}return i(t,e),t.prototype._next=function(e){this.count+=1},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/scan",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new h(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t,r){o(this,e),this.acc=r,this.project=t}return e.prototype.call=function(e){return new g(e,this.project,this.acc)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.hasValue=!1,this.acc=i,this.project=n,this.hasSeed="undefined"!=typeof i}return i(t,e),t.prototype._next=function(e){if(!this.hasValue&&!(this.hasValue=this.hasSeed))return this.destination.next((this.hasValue=!0)&&(this.acc=e));var t=f["default"](this.project).call(this,this.acc,e);t===d.errorObject?this.destination.error(d.errorObject.e):this.destination.next(this.acc=t)},t.prototype._complete=function(){!this.hasValue&&this.hasSeed&&this.destination.next(this.acc),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/reduce",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new h(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t,r){o(this,e),this.acc=r,this.project=t}return e.prototype.call=function(e){return new g(e,this.project,this.acc)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.hasValue=!1,this.acc=i,this.project=n,this.hasSeed="undefined"!=typeof i}return i(t,e),t.prototype._next=function(e){if(this.hasValue||(this.hasValue=this.hasSeed)){var t=f["default"](this.project).call(this,this.acc,e);t===d.errorObject?this.destination.error(d.errorObject.e):this.acc=t}else this.acc=e,this.hasValue=!0},t.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/startWith",["@reactivex/rxjs/dist/cjs/observables/ScalarObservable","@reactivex/rxjs/dist/cjs/operators/concat-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return l["default"](new c["default"](e),this)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/concat-static"),l=n(u);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/take",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.total=t;
}return e.prototype.call=function(e){return new f(e,this.total)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.total=n}return i(t,e),t.prototype._next=function(e){var t=this.total;++this.count<=t&&(this.destination.next(e),this.count===t&&this.destination.complete())},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/skip",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.total=t}return e.prototype.call=function(e){return new f(e,this.total)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.total=n}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/skipUntil",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.notifier=t}return e.prototype.call=function(e){return new f(e,this.notifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.notifier=n,this.notificationSubscriber=new d,this.add(this.notifier.subscribe(this.notificationSubscriber))}return i(t,e),t.prototype._next=function(e){this.notificationSubscriber.hasNotified&&this.destination.next(e)},t}(l["default"]),d=function(e){function t(){o(this,t),e.call(this,null),this.hasNotified=!1}return i(t,e),t.prototype._next=function(){this.hasNotified=!0,this.unsubscribe()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/takeUntil",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.observable=t}return e.prototype.call=function(e){return new f(e,this.observable)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.add(n._subscribe(new d(r)))}return i(t,e),t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,r)}return i(t,e),t.prototype._next=function(){this.destination.complete()},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/filter",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new v(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),g=n(h),v=function(){function e(t,r){o(this,e),this.select=g["default"](t,r,2)}return e.prototype.call=function(e){return new y(e,this.select)},e}(),y=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.select=n}return i(t,e),t.prototype._next=function(e){var t=f["default"](this.select)(e,this.count++);t===d.errorObject?this.destination.error(d.errorObject.e):Boolean(t)&&this.destination.next(e)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new v(t?g["default"](e,t,2):e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),g=n(h),v=function(){function e(t){o(this,e),this.compare=t}return e.prototype.call=function(e){return new y(e,this.compare)},e}(),y=function(e){function t(r,n){o(this,t),e.call(this,r),this.hasValue=!1,"function"==typeof n&&(this.compare=n)}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=!1;if(this.hasValue){if(t=f["default"](this.compare)(this.value,e),t===d.errorObject)return void this.destination.error(d.errorObject.e)}else this.hasValue=!0;Boolean(t)===!1&&(this.value=e,this.destination.next(e))},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/distinctUntilKeyChanged",["@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r){return c["default"].call(this,function(n,i){return t?t.call(r,n[e],i[e]):n[e]===i[e]})}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip-support",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){for(var t=Array(e),r=0;e>r;r++)t[r]=null;return t}function s(e){return e[0]}function c(e){return e&&1===e.length}var u=System.global,l=u.define;u.define=void 0,t.__esModule=!0,t.mapValue=s,t.hasValue=c;var p=e("@reactivex/rxjs/dist/cjs/Subscriber"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t){o(this,e),this.project=t}return e.prototype.call=function(e){return new y(e,this.project)},e}();t.ZipOperator=v;var y=function(e){function t(r,n){var i=arguments.length<=2||void 0===arguments[2]?Object.create(null):arguments[2];o(this,t),e.call(this,r),this.active=0,this.observables=[],this.limit=Number.POSITIVE_INFINITY,this.project="function"==typeof n?n:null,this.values=i}return i(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.values,t=this.observables,r=-1,n=t.length;for(this.active=n;++r<n;)this.add(this._subscribeInner(t[r],e,r,n))},t.prototype._subscribeInner=function(e,t,r,n){return e._subscribe(new m(this.destination,this,t,r,n))},t.prototype._innerComplete=function(e){0===(this.active-=1)?this.destination.complete():this.limit=e.events},t}(f["default"]);t.ZipSubscriber=y;var m=function(e){function t(r,n,i,a,s){o(this,t),e.call(this,r),this.events=0,this.parent=n,this.values=i,this.index=a,this.total=s}return i(t,e),t.prototype._next=function(e){var t=this.parent,r=this.events,n=this.total,i=t.limit;if(r>=i)return void this.destination.complete();var o=this.index,s=this.values,u=s[r]||(s[r]=a(n));u[o]=[e],u.every(c)&&(this._projectNext(u,t.project),s[r]=void 0),this.events=r+1},t.prototype._projectNext=function(e,t){if(t&&"function"==typeof t){var r=h["default"](t).apply(null,e.map(s));if(r===g.errorObject)return void this.destination.error(g.errorObject.e);this.destination.next(r)}else this.destination.next(e.map(s))},t.prototype._complete=function(){this.parent._innerComplete(this)},t}(f["default"]);return t.ZipInnerSubscriber=m,u.define=l,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-static",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/combineLatest-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),new c["default"](t).lift(new u.CombineLatestOperator(n))}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineAll",["@reactivex/rxjs/dist/cjs/operators/combineLatest-support"],!0,function(e,t,r){function n(e){return this.lift(new a.CombineLatestOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/withLatestFrom",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t.pop(),i=t;return this.lift(new h(i,n))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t,r){o(this,e),this.observables=t,this.project=r}return e.prototype.call=function(e){return new g(e,this.observables,this.project)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.observables=n,this.project=i;var a=n.length;this.values=new Array(a),this.toSet=a;for(var s=0;a>s;s++)this.add(n[s]._subscribe(new v(this,s)))}return i(t,e),t.prototype.notifyValue=function(e,t){this.values[e]=t,this.toSet--},t.prototype._next=function(e){if(0===this.toSet){var t=this.values,r=f["default"](this.project)([e].concat(t));r===d.errorObject?this.destination.error(r.e):this.destination.next(r)}},t}(l["default"]),v=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.valueIndex=n}return i(t,e),t.prototype._next=function(e){this.parent.notifyValue(this.valueIndex,e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip-static",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/zip-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),new c["default"](t).lift(new u.ZipOperator(n))}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/zip-support");return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zipAll",["@reactivex/rxjs/dist/cjs/operators/zip-support"],!0,function(e,t,r){function n(e){return this.lift(new a.ZipOperator(e))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/zip-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/multicast",["@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return new c["default"](this,e)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/publishBehavior",["@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject","@reactivex/rxjs/dist/cjs/operators/multicast"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){return l["default"].call(this,function(){return new c["default"](e)})}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/multicast"),l=n(u);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/publishReplay",["@reactivex/rxjs/dist/cjs/subjects/ReplaySubject","@reactivex/rxjs/dist/cjs/operators/multicast"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===t&&(t=Number.POSITIVE_INFINITY),l["default"].call(this,function(){return new c["default"](e,t,r)})}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/multicast"),l=n(u);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/observeOn",["@reactivex/rxjs/dist/cjs/operators/observeOn-support"],!0,function(e,t,r){function n(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return this.lift(new a.ObserveOnOperator(e,t))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/observeOn-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),p=n(l),f=function(e){function t(r){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1],o=arguments.length<=2||void 0===arguments[2]?p["default"]:arguments[2];i(this,t),e.call(this),this.source=r,this.delayTime=n,this.scheduler=o}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?p["default"]:arguments[2];return new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return t.subscribe(r)},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source,i=this.scheduler;e.add(i.schedule(t.dispatch,r,{source:n,subscriber:e}))},t}(u["default"]);return t["default"]=f,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/not",[],!0,function(e,t,r){function n(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/toPromise",[],!0,function(e,t,r){function n(){var e=this,t=arguments.length<=0||void 0===arguments[0]?Promise:arguments[0];return new t(function(t,r){var n=void 0;e.subscribe(function(e){return n=e},function(e){return r(e)},function(){return t(n)})})}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.defaultValue=t}return e.prototype.call=function(e){return new f(e,this.defaultValue)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.defaultValue=n,this.isEmpty=!0}return i(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/materialize",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Notification"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return this.lift(new d)}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Notification"),f=n(p),d=function(){function e(){o(this,e)}return e.prototype.call=function(e){return new h(e)},e}(),h=function(e){function t(r){o(this,t),e.call(this,r)}return i(t,e),t.prototype._next=function(e){this.destination.next(f["default"].createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(f["default"].createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(f["default"].createComplete()),e.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/catch",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=new h(e),r=this.lift(t);return t.caught=r,r}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t){o(this,e),this.selector=t}return e.prototype.call=function(e){return new g(e,this.selector,this.caught)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.selector=n,this.caught=i}return i(t,e),t.prototype._error=function(e){var t=f["default"](this.selector)(e,this.caught);t===d.errorObject?this.destination.error(d.errorObject.e):this.add(t.subscribe(this.destination))},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/retry",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0];return this.lift(new p(e,this))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t,r){o(this,e),this.count=t,this.original=r}return e.prototype.call=function(e){return new f(e,this.count,this.original)},e}(),f=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.count=n,this.original=i,this.retries=0}return i(t,e),t.prototype._error=function(e){var t=this.count;t&&t===(this.retries+=1)?this.destination.error(e):this.resubscribe()},t.prototype.resubscribe=function(){this.original.subscribe(this)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/retryWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new v(e,this))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t,r){o(this,e),this.notifier=t,this.original=r}return e.prototype.call=function(e){return new y(e,this.notifier,this.original)},e}(),y=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.notifier=n,this.original=i}return i(t,e),t.prototype._error=function(e){if(!this.retryNotifications){this.errors=new f["default"];var t=h["default"](this.notifier).call(this,this.errors);t===g.errorObject?this.destination.error(g.errorObject.e):(this.retryNotifications=t,this.add(t._subscribe(new m(this))))}this.errors.next(e)},t.prototype.finalError=function(e){this.destination.error(e)},t.prototype.resubscribe=function(){this.original.subscribe(this)},t}(l["default"]),m=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.resubscribe()},t.prototype._error=function(e){this.parent.finalError(e)},t.prototype._complete=function(){this.parent.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/repeat",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e,this))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t,r){o(this,e),this.count=t,this.original=r}return e.prototype.call=function(e){return new f(e,this.count,this.original)},e}(),f=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.count=n,this.original=i,this.repeated=0}return i(t,e),t.prototype._complete=function(){this.count===(this.repeated+=1)?this.destination.complete():this.resubscribe()},t.prototype.resubscribe=function(){this.original.subscribe(this)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/finally",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new g(t?h["default"](e,t,2):e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subscription"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),h=n(d),g=function(){function e(t){o(this,e),this.finallySelector=t}return e.prototype.call=function(e){return new v(e,this.finallySelector)},e}(),v=function(e){function t(r,n){o(this,t),e.call(this,r),this.add(new f["default"](n))}return i(t,e),t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/isDate",[],!0,function(e,t,r){function n(e){return e instanceof Date&&!isNaN(+e)}var i=System.global,o=i.define;return i.define=void 0,t.__esModule=!0,t["default"]=n,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/timeoutWith",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/immediate","@reactivex/rxjs/dist/cjs/util/isDate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){var r=arguments.length<=2||void 0===arguments[2]?d["default"]:arguments[2],n=g["default"](e)?+e-Date.now():e;return this.lift(new v(n,t,r))}function s(e){var t=e.subscriber;t.handleTimeout()}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=a;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/isDate"),g=n(h),v=function(){function e(t,r,n){o(this,e),this.waitFor=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e){return new y(e,this.waitFor,this.withObservable,this.scheduler)},e}(),y=function(e){function t(r,n,i,a){o(this,t),e.call(this,r),this.waitFor=n,this.withObservable=i,this.scheduler=a;var c=n;a.schedule(s,c,{subscriber:this})}return i(t,e),t.prototype.handleTimeout=function(){var e=this.withObservable;this.add(e.subscribe(this))},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Map",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root");return t["default"]=o.root.Map||function(){function e(){this.size=0,this._values=[],this._keys=[]}return e.prototype["delete"]=function(e){var t=this._keys.indexOf(e);return-1===t?!1:(this._values.splice(t,1),this._keys.splice(t,1),this.size--,!0)},e.prototype.get=function(e){var t=this._keys.indexOf(e);return-1===t?void 0:this._values[t]},e.prototype.set=function(e,t){var r=this._keys.indexOf(e);return-1===r?(this._keys.push(e),this._values.push(t),this.size++):this._values[r]=t,
this},e.prototype.forEach=function(e,t){for(var r=0;r<this.size;r++)e.call(t,this._values[r],this._keys[r])},e}(),r.exports=t["default"],n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/FastMap",[],!0,function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var a=function(){function e(){n(this,e),this.size=0,this._values={}}return e.prototype["delete"]=function(e){return this._values[e]=null,!0},e.prototype.set=function(e,t){return this._values[e]=t,this},e.prototype.get=function(e){return this._values[e]},e.prototype.forEach=function(e,t){var r=this._values;for(var n in r)r.hasOwnProperty(n)&&e.call(t,r[n],n)},e.prototype.clear=function(){this._values={}},e}();return t["default"]=a,r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/subjects/GroupSubject",["@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=function(e){function t(r){i(this,t),e.call(this),this.key=r}return o(t,e),t}(u["default"]);return t["default"]=l,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/window",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new d(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=function(){function e(t){o(this,e),this.closingNotifier=t}return e.prototype.call=function(e){return new h(e,this.closingNotifier)},e}(),h=function(e){function t(r,n){o(this,t),e.call(this,r),this.closingNotifier=n,this.window=new f["default"],this.add(n._subscribe(new g(this))),this.openWindow()}return i(t,e),t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype.openWindow=function(){var e=this.window;e&&e.complete(),this.destination.next(this.window=new f["default"])},t}(l["default"]),g=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.openWindow()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new m(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/Subscription"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),v=n(g),y=e("@reactivex/rxjs/dist/cjs/util/errorObject"),m=function(){function e(t){o(this,e),this.closingSelector=t}return e.prototype.call=function(e){return new _(e,this.closingSelector)},e}(),_=function(e){function t(r,n){o(this,t),e.call(this,r),this.closingSelector=n,this.window=new f["default"],this.openWindow()}return i(t,e),t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype.openWindow=function(){var e=this.closingNotification;e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete(),this.destination.next(this.window=new f["default"]);var r=v["default"](this.closingSelector)();if(r===y.errorObject){var n=r.e;this.destination.error(n),this.window.error(n)}else{var i=this.closingNotification=new h["default"];this.add(i.add(r._subscribe(new b(this))))}},t}(l["default"]),b=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.openWindow()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowToggle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new m(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/Subscription"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),v=n(g),y=e("@reactivex/rxjs/dist/cjs/util/errorObject"),m=function(){function e(t,r){o(this,e),this.openings=t,this.closingSelector=r}return e.prototype.call=function(e){return new _(e,this.openings,this.closingSelector)},e}(),_=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.openings=n,this.closingSelector=i,this.windows=[],this.add(this.openings._subscribe(new x(this)))}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;r>n;n++)t[n].next(e)},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;)e.shift().complete();this.destination.complete()},t.prototype.openWindow=function(e){var t=new f["default"];this.windows.push(t),this.destination.next(t);var r={window:t,subscription:new h["default"]},n=this.closingSelector,i=v["default"](n)(e);i===y.errorObject?this.error(i.e):this.add(r.subscription.add(i._subscribe(new b(this,r))))},t.prototype.closeWindow=function(e){var t=e.window,r=e.subscription,n=this.windows;n.splice(n.indexOf(t),1),t.complete(),this.remove(r)},t}(l["default"]),b=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.windowContext=n}return i(t,e),t.prototype._next=function(){this.parent.closeWindow(this.windowContext)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]),x=function(e){function t(r){o(this,t),e.call(this),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.openWindow(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?y["default"]:arguments[2];return this.lift(new m(e,t,r))}function s(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&n.complete(),e.window=t.openWindow(),this.schedule(e,r)}function c(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a=this,s={action:a,subscription:null};a.add(s.subscription=n.schedule(u,t,{subscriber:r,window:o,context:s})),a.schedule(e,i)}function u(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0,t["default"]=a;var f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/Subject"),g=n(h),v=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),y=n(v),m=function(){function e(t,r,n){o(this,e),this.windowTimeSpan=t,this.windowCreationInterval=r,this.scheduler=n}return e.prototype.call=function(e){return new _(e,this.windowTimeSpan,this.windowCreationInterval,this.scheduler)},e}(),_=function(e){function t(r,n,i,a){if(o(this,t),e.call(this,r),this.windowTimeSpan=n,this.windowCreationInterval=i,this.scheduler=a,this.windows=[],null!==i&&i>=0){var l=this.openWindow();this.add(a.schedule(u,n,{subscriber:this,window:l,context:null})),this.add(a.schedule(c,i,{windowTimeSpan:n,windowCreationInterval:i,subscriber:this,scheduler:a}))}else{var p=this.openWindow();this.add(a.schedule(s,n,{subscriber:this,window:p,windowTimeSpan:n}))}}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;r>n;n++)t[n].next(e)},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;)e.shift().complete();this.destination.complete()},t.prototype.openWindow=function(){var e=new g["default"];return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(d["default"]);return r.exports=t["default"],l.define=p,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/windowCount",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return this.lift(new d(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subject"),f=n(p),d=function(){function e(t,r){o(this,e),this.windowSize=t,this.startWindowEvery=r}return e.prototype.call=function(e){return new h(e,this.windowSize,this.startWindowEvery)},e}(),h=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.windowSize=n,this.startWindowEvery=i,this.windows=[{count:0,notified:!1,window:new f["default"]}],this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.count+=1,r=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.windowSize,i=this.windows,o=i.length;if(t%r===0){var a=new f["default"];i.push({count:0,notified:!1,window:a})}for(var s=0;o>s;s++){var c=i[s],u=c.window;c.notified||(c.notified=!0,this.destination.next(u)),u.next(e),n===(c.count+=1)&&u.complete()}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().window.error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;)e.shift().window.complete();this.destination.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/delay",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Notification","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?h["default"]:arguments[1];return this.lift(new g(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Notification"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),h=n(d),g=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new v(e,this.delay,this.scheduler)},e}(),v=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.queue=[],this.active=!1,this.errored=!1,this.delay=n,this.scheduler=i}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else t.active=!1},t.prototype._next=function(e){if(!this.errored){var t=this.scheduler;this.queue.push(new y(t.now()+this.delay,f["default"].createNext(e))),this.active===!1&&this._schedule(t)}},t.prototype._error=function(e){var t=this.scheduler;this.errored=!0,this.queue=[new y(t.now()+this.delay,f["default"].createError(e))],this.active===!1&&this._schedule(t)},t.prototype._complete=function(){if(!this.errored){var e=this.scheduler;this.queue.push(new y(e.now()+this.delay,f["default"].createComplete())),this.active===!1&&this._schedule(e)}},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t}(l["default"]),y=function m(e,t){o(this,m),this.time=e,this.notification=t};return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/throttle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return this.lift(new h(e,t))}function s(e){var t=e.value,r=e.subscriber;r.throttledNext(t)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=a;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new g(e,this.delay,this.scheduler)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.delay=n,this.scheduler=i}return i(t,e),t.prototype._next=function(e){this.clearThrottle(),this.add(this.throttled=this.scheduler.schedule(s,this.delay,{value:e,subscriber:this}))},t.prototype.throttledNext=function(e){this.clearThrottle(),this.destination.next(e)},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.remove(e),e.unsubscribe(),this.throttled=null)},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/debounce",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return this.lift(new h(e,t))}function s(e){var t=e.value,r=e.subscriber;r.debouncedNext(t)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=a;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(){function e(t,r){o(this,e),this.dueTime=t,this.scheduler=r}return e.prototype.call=function(e){return new g(e,this.dueTime,this.scheduler)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.dueTime=n,this.scheduler=i}return i(t,e),t.prototype._next=function(e){this.debounced||this.add(this.debounced=this.scheduler.schedule(s,this.dueTime,{value:e,subscriber:this}))},t.prototype.clearDebounce=function(){var e=this.debounced;e&&(e.unsubscribe(),this.remove(e))},t.prototype.debouncedNext=function(e){this.clearDebounce(),this.destination.next(e)},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/buffer",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.closingNotifier=t}return e.prototype.call=function(e){return new f(e,this.closingNotifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.buffer=[],this.add(n._subscribe(new d(this)))}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){this.flushBuffer(),this.destination.complete()},t.prototype.flushBuffer=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.flushBuffer()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferCount",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.lift(new p(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t,r){o(this,e),this.bufferSize=t,this.startBufferEvery=r}return e.prototype.call=function(e){return new f(e,this.bufferSize,this.startBufferEvery)},e}(),f=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.bufferSize=n,this.startBufferEvery=i,this.buffers=[[]],this.count=0}return i(t,e),t.prototype._next=function(e){var t=this.count+=1,r=(this.destination,this.bufferSize),n=null==this.startBufferEvery?r:this.startBufferEvery,i=this.buffers,o=i.length,a=-1;t%n===0&&i.push([]);for(var s=0;o>s;s++){var c=i[s];c.push(e),c.length===r&&(a=s,this.destination.next(c))}-1!==a&&i.splice(a,1)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){for(var e=this.destination,t=this.buffers;t.length>0;){var r=t.shift();r.length>0&&e.next(r)}e.complete()},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?g["default"]:arguments[2];return this.lift(new v(e,t,r))}function s(e){var t=e.subscriber,r=e.buffer;r&&t.closeBuffer(r),e.buffer=t.openBuffer(),this.schedule(e,e.bufferTimeSpan)}function c(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openBuffer(),a=this;a.add(i.schedule(u,r,{subscriber:n,buffer:o})),a.schedule(e,t)}function u(e){var t=e.subscriber,r=e.buffer;t.closeBuffer(r)}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0,t["default"]=a;var f=e("@reactivex/rxjs/dist/cjs/Subscriber"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),g=n(h),v=function(){function e(t,r,n){o(this,e),this.bufferTimeSpan=t,this.bufferCreationInterval=r,this.scheduler=n}return e.prototype.call=function(e){return new y(e,this.bufferTimeSpan,this.bufferCreationInterval,this.scheduler)},e}(),y=function(e){function t(r,n,i,a){o(this,t),e.call(this,r),this.bufferTimeSpan=n,this.bufferCreationInterval=i,this.scheduler=a,this.buffers=[];var l=this.openBuffer();null!==i&&i>=0?(this.add(a.schedule(u,n,{subscriber:this,buffer:l})),this.add(a.schedule(c,i,{bufferTimeSpan:n,bufferCreationInterval:i,subscriber:this,scheduler:a}))):this.add(a.schedule(s,n,{subscriber:this,buffer:l,bufferTimeSpan:n}))}return i(t,e),t.prototype._next=function(e){for(var t=this.buffers,r=t.length,n=0;r>n;n++)t[n].push(e)},t.prototype._error=function(e){this.buffers.length=0,this.destination.error(e)},t.prototype._complete=function(){for(var e=this.buffers;e.length>0;)this.destination.next(e.shift());this.destination.complete()},t.prototype.openBuffer=function(){var e=[];return this.buffers.push(e),e},t.prototype.closeBuffer=function(e){this.destination.next(e);var t=this.buffers;t.splice(t.indexOf(e),1)},t}(d["default"]);return r.exports=t["default"],l.define=p,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferToggle",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new v(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/Subscription"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/util/errorObject"),v=function(){function e(t,r){o(this,e),this.openings=t,this.closingSelector=r}return e.prototype.call=function(e){return new y(e,this.openings,this.closingSelector)},e}(),y=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.openings=n,this.closingSelector=i,this.buffers=[],this.add(this.openings._subscribe(new _(this)))}return i(t,e),t.prototype._next=function(e){for(var t=this.buffers,r=t.length,n=0;r>n;n++)t[n].push(e)},t.prototype._error=function(e){this.buffers=null,this.destination.error(e)},t.prototype._complete=function(){for(var e=this.buffers;e.length>0;)this.destination.next(e.shift());this.destination.complete()},t.prototype.openBuffer=function(e){var t=this.closingSelector,r=this.buffers,n=h["default"](t)(e);if(n===g.errorObject){var i=n.e;this.buffers=null,this.destination.error(i)}else{var o=[],a={buffer:o,subscription:new f["default"]};r.push(o),this.add(a.subscription.add(n._subscribe(new m(this,a))))}},t.prototype.closeBuffer=function(e){var t=e.buffer,r=e.subscription,n=this.buffers;this.destination.next(t),n.splice(n.indexOf(t),1),this.remove(r),r.unsubscribe()},t}(l["default"]),m=function(e){function t(r,n){o(this,t),e.call(this,null),this.parent=r,this.context=n}return i(t,e),t.prototype._next=function(){this.parent.closeBuffer(this.context)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]),_=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(e){this.parent.openBuffer(e)},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/bufferWhen",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new h(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=function(){function e(t){o(this,e),this.closingSelector=t}return e.prototype.call=function(e){return new g(e,this.closingSelector)},e}(),g=function(e){function t(r,n){o(this,t),e.call(this,r),this.closingSelector=n,this.openBuffer()}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._error=function(e){this.buffer=null,this.destination.error(e)},t.prototype._complete=function(){var e=this.buffer;this.destination.next(e),this.buffer=null,this.destination.complete()},t.prototype.openBuffer=function(){var e=this.closingNotification;e&&(this.remove(e),e.unsubscribe());var t=this.buffer;t&&this.destination.next(t),this.buffer=[];var r=f["default"](this.closingSelector)();if(r===d.errorObject){var n=r.e;this.buffer=null,this.destination.error(n)}else this.add(this.closingNotification=r._subscribe(new v(this)))},t}(l["default"]),v=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.openBuffer()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/sample",["@reactivex/rxjs/dist/cjs/Subscriber"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return this.lift(new p(e))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=function(){function e(t){o(this,e),this.notifier=t}return e.prototype.call=function(e){return new f(e,this.notifier)},e}(),f=function(e){function t(r,n){o(this,t),e.call(this,r),this.notifier=n,this.hasValue=!1,this.add(n._subscribe(new d(this)))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&this.destination.next(this.lastValue)},t}(l["default"]),d=function(e){function t(r){o(this,t),e.call(this,null),this.parent=r}return i(t,e),t.prototype._next=function(){this.parent.notifyNext()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/sampleTime",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];
return this.lift(new h(e,t))}function s(e){var t=e.subscriber,r=e.delay;t.notifyNext(),this.schedule(e,r)}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=a;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(){function e(t,r){o(this,e),this.delay=t,this.scheduler=r}return e.prototype.call=function(e){return new g(e,this.delay,this.scheduler)},e}(),g=function(e){function t(r,n,i){o(this,t),e.call(this,r),this.delay=n,this.scheduler=i,this.hasValue=!1,this.add(i.schedule(s,n,{subscriber:this,delay:n}))}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&this.destination.next(this.lastValue)},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("angular2/src/http/backends/browser_jsonp",["angular2/src/core/di","angular2/src/core/facade/lang"],!0,function(e,t,r){function n(){return null===p&&(p=u.global[t.JSONP_HOME]={}),p}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/lang"),l=0;t.JSONP_HOME="__ng_jsonp__";var p=null,f=function(){function e(){}return e.prototype.build=function(e){var t=document.createElement("script");return t.src=e,t},e.prototype.nextRequestID=function(){return"__req"+l++},e.prototype.requestCallback=function(e){return t.JSONP_HOME+"."+e+".finished"},e.prototype.exposeConnection=function(e,t){var r=n();r[e]=t},e.prototype.removeConnection=function(e){var t=n();t[e]=null},e.prototype.send=function(e){document.body.appendChild(e)},e.prototype.cleanup=function(e){e.parentNode&&e.parentNode.removeChild(e)},e=a([c.Injectable(),s("design:paramtypes",[])],e)}();return t.BrowserJsonp=f,i.define=o,r.exports}),System.register("angular2/src/http/backends/mock_backend",["angular2/src/core/di","angular2/src/http/static_request","angular2/src/http/enums","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","@reactivex/rxjs/dist/cjs/Rx"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/http/static_request"),u=e("angular2/src/http/enums"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/facade/exceptions"),f=e("@reactivex/rxjs/dist/cjs/Rx"),d=f.Subject,h=f.ReplaySubject,g=function(){function e(e){this.response=new h(1).take(1),this.readyState=u.ReadyStates.Open,this.request=e}return e.prototype.mockRespond=function(e){if(this.readyState===u.ReadyStates.Done||this.readyState===u.ReadyStates.Cancelled)throw new p.BaseException("Connection has already been resolved");this.readyState=u.ReadyStates.Done,this.response.next(e),this.response.complete()},e.prototype.mockDownload=function(e){},e.prototype.mockError=function(e){this.readyState=u.ReadyStates.Done,this.response.error(e)},e}();t.MockConnection=g;var v=function(){function e(){var e=this;this.connectionsArray=[],this.connections=new d,this.connections.subscribe(function(t){return e.connectionsArray.push(t)}),this.pendingConnections=new d}return e.prototype.verifyNoPendingRequests=function(){var e=0;if(this.pendingConnections.subscribe(function(t){return e++}),e>0)throw new p.BaseException(e+" pending connections to be resolved")},e.prototype.resolveAllConnections=function(){this.connections.subscribe(function(e){return e.readyState=4})},e.prototype.createConnection=function(e){if(!(l.isPresent(e)&&e instanceof c.Request))throw new p.BaseException("createConnection requires an instance of Request, got "+e);var t=new g(e);return this.connections.next(t),t},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.MockBackend=v,n.define=i,r.exports}),System.register("angular2/src/core/di/decorators",["angular2/src/core/di/metadata","angular2/src/core/util/decorators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di/metadata"),a=e("angular2/src/core/util/decorators");return t.Inject=a.makeParamDecorator(o.InjectMetadata),t.Optional=a.makeParamDecorator(o.OptionalMetadata),t.Injectable=a.makeDecorator(o.InjectableMetadata),t.Self=a.makeParamDecorator(o.SelfMetadata),t.Host=a.makeParamDecorator(o.HostMetadata),t.SkipSelf=a.makeParamDecorator(o.SkipSelfMetadata),n.define=i,r.exports}),System.register("angular2/src/core/facade/exceptions",["angular2/src/core/facade/exception_handler","angular2/src/core/facade/exception_handler"],!0,function(e,t,r){function n(e){return new TypeError(e)}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/facade/exception_handler"),c=e("angular2/src/core/facade/exception_handler");t.ExceptionHandler=c.ExceptionHandler;var u=function(e){function t(t){void 0===t&&(t="--"),e.call(this,t),this.message=t,this.stack=new Error(t).stack}return a(t,e),t.prototype.toString=function(){return this.message},t}(Error);t.BaseException=u;var l=function(e){function t(t,r,n,i){e.call(this,t),this._wrapperMessage=t,this._originalException=r,this._originalStack=n,this._context=i,this._wrapperStack=new Error(t).stack}return a(t,e),Object.defineProperty(t.prototype,"wrapperMessage",{get:function(){return this._wrapperMessage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrapperStack",{get:function(){return this._wrapperStack},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalException",{get:function(){return this._originalException},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalStack",{get:function(){return this._originalStack},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return s.ExceptionHandler.exceptionToString(this)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.message},t}(Error);return t.WrappedException=l,t.makeTypeError=n,i.define=o,r.exports}),System.register("angular2/src/core/reflection/reflection",["angular2/src/core/reflection/reflector","angular2/src/core/reflection/reflector","angular2/src/core/reflection/reflection_capabilities"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/reflection/reflector"),a=e("angular2/src/core/reflection/reflector");t.Reflector=a.Reflector,t.ReflectionInfo=a.ReflectionInfo;var s=e("angular2/src/core/reflection/reflection_capabilities");return t.reflector=new o.Reflector(new s.ReflectionCapabilities),n.define=i,r.exports}),System.register("angular2/src/core/di/key",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/di/type_literal","angular2/src/core/di/forward_ref","angular2/src/core/di/type_literal"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/exceptions"),c=e("angular2/src/core/di/type_literal"),u=e("angular2/src/core/di/forward_ref"),l=e("angular2/src/core/di/type_literal");t.TypeLiteral=l.TypeLiteral;var p=function(){function e(e,t){if(this.token=e,this.id=t,a.isBlank(e))throw new s.BaseException("Token must be defined!")}return Object.defineProperty(e.prototype,"displayName",{get:function(){return a.stringify(this.token)},enumerable:!0,configurable:!0}),e.get=function(e){return d.get(u.resolveForwardRef(e))},Object.defineProperty(e,"numberOfKeys",{get:function(){return d.numberOfKeys},enumerable:!0,configurable:!0}),e}();t.Key=p;var f=function(){function e(){this._allKeys=new Map}return e.prototype.get=function(e){if(e instanceof p)return e;var t=e;if(e instanceof c.TypeLiteral&&(t=e.type),e=t,this._allKeys.has(e))return this._allKeys.get(e);var r=new p(e,p.numberOfKeys);return this._allKeys.set(e,r),r},Object.defineProperty(e.prototype,"numberOfKeys",{get:function(){return o.MapWrapper.size(this._allKeys)},enumerable:!0,configurable:!0}),e}();t.KeyRegistry=f;var d=new f;return n.define=i,r.exports}),System.register("angular2/src/core/change_detection/change_detection_util",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/constants","angular2/src/core/change_detection/pipe_lifecycle_reflector","angular2/src/core/change_detection/binding_record","angular2/src/core/change_detection/directive_record"],!0,function(e,t,r){function n(e,t){var r=y++%20,n=m[r];return n.previousValue=e,n.currentValue=t,n}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/exceptions"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/change_detection/constants"),l=e("angular2/src/core/change_detection/pipe_lifecycle_reflector"),p=e("angular2/src/core/change_detection/binding_record"),f=e("angular2/src/core/change_detection/directive_record"),d=function(){function e(e){this.wrapped=e}return e.wrap=function(e){var t=h[g++%5];return t.wrapped=e,t},e}();t.WrappedValue=d;var h=[new d(null),new d(null),new d(null),new d(null),new d(null)],g=0,v=function(){function e(e,t){this.previousValue=e,this.currentValue=t}return e.prototype.isFirstChange=function(){return this.previousValue===_.uninitialized},e}();t.SimpleChange=v;var y=0,m=[new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null),new v(null,null)],_=function(){function e(){}return e.arrayFn0=function(){return[]},e.arrayFn1=function(e){return[e]},e.arrayFn2=function(e,t){return[e,t]},e.arrayFn3=function(e,t,r){return[e,t,r]},e.arrayFn4=function(e,t,r,n){return[e,t,r,n]},e.arrayFn5=function(e,t,r,n,i){return[e,t,r,n,i]},e.arrayFn6=function(e,t,r,n,i,o){return[e,t,r,n,i,o]},e.arrayFn7=function(e,t,r,n,i,o,a){return[e,t,r,n,i,o,a]},e.arrayFn8=function(e,t,r,n,i,o,a,s){return[e,t,r,n,i,o,a,s]},e.arrayFn9=function(e,t,r,n,i,o,a,s,c){return[e,t,r,n,i,o,a,s,c]},e.operation_negate=function(e){return!e},e.operation_add=function(e,t){return e+t},e.operation_subtract=function(e,t){return e-t},e.operation_multiply=function(e,t){return e*t},e.operation_divide=function(e,t){return e/t},e.operation_remainder=function(e,t){return e%t},e.operation_equals=function(e,t){return e==t},e.operation_not_equals=function(e,t){return e!=t},e.operation_identical=function(e,t){return e===t},e.operation_not_identical=function(e,t){return e!==t},e.operation_less_then=function(e,t){return t>e},e.operation_greater_then=function(e,t){return e>t},e.operation_less_or_equals_then=function(e,t){return t>=e},e.operation_greater_or_equals_then=function(e,t){return e>=t},e.operation_logical_and=function(e,t){return e&&t},e.operation_logical_or=function(e,t){return e||t},e.cond=function(e,t,r){return e?t:r},e.mapFn=function(e){function t(t){for(var r=c.StringMapWrapper.create(),n=0;n<e.length;++n)c.StringMapWrapper.set(r,e[n],t[n]);return r}switch(e.length){case 0:return function(){return[]};case 1:return function(e){return t([e])};case 2:return function(e,r){return t([e,r])};case 3:return function(e,r,n){return t([e,r,n])};case 4:return function(e,r,n,i){return t([e,r,n,i])};case 5:return function(e,r,n,i,o){return t([e,r,n,i,o])};case 6:return function(e,r,n,i,o,a){return t([e,r,n,i,o,a])};case 7:return function(e,r,n,i,o,a,s){return t([e,r,n,i,o,a,s])};case 8:return function(e,r,n,i,o,a,s,c){return t([e,r,n,i,o,a,s,c])};case 9:return function(e,r,n,i,o,a,s,c,u){return t([e,r,n,i,o,a,s,c,u])};default:throw new s.BaseException("Does not support literal maps with more than 9 elements")}},e.keyedAccess=function(e,t){return e[t[0]]},e.unwrapValue=function(e){return e instanceof d?e.wrapped:e},e.changeDetectionMode=function(e){return u.isDefaultChangeDetectionStrategy(e)?u.ChangeDetectionStrategy.CheckAlways:u.ChangeDetectionStrategy.CheckOnce},e.simpleChange=function(e,t){return n(e,t)},e.isValueBlank=function(e){return a.isBlank(e)},e.s=function(e){return a.isPresent(e)?""+e:""},e.protoByIndex=function(e,t){return 1>t?null:e[t-1]},e.callPipeOnDestroy=function(e){l.implementsOnDestroy(e.pipe)&&e.pipe.onDestroy()},e.bindingTarget=function(e,t,r,n,i){return new p.BindingTarget(e,t,r,n,i)},e.directiveIndex=function(e,t){return new f.DirectiveIndex(e,t)},e.uninitialized=a.CONST_EXPR(new Object),e}();return t.ChangeDetectionUtil=_,i.define=o,r.exports}),System.register("angular2/src/core/profile/profile",["angular2/src/core/profile/wtf_impl"],!0,function(e,t,r){function n(e,t){return null}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/profile/wtf_impl");return t.wtfEnabled=a.detectWTF(),t.wtfCreateScope=t.wtfEnabled?a.createScope:function(e,t){return n},t.wtfLeave=t.wtfEnabled?a.leave:function(e,t){return t},t.wtfStartTimeRange=t.wtfEnabled?a.startTimeRange:function(e,t){return null},t.wtfEndTimeRange=t.wtfEnabled?a.endTimeRange:function(e){return null},i.define=o,r.exports}),System.register("angular2/src/core/change_detection/codegen_logic_util",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/change_detection/codegen_facade","angular2/src/core/change_detection/proto_record","angular2/src/core/change_detection/constants","angular2/src/core/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/collection"),a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/change_detection/codegen_facade"),c=e("angular2/src/core/change_detection/proto_record"),u=e("angular2/src/core/change_detection/constants"),l=e("angular2/src/core/facade/exceptions"),p=function(){function e(e,t,r){this._names=e,this._utilName=t,this._changeDetection=r}return e.prototype.genPropertyBindingEvalValue=function(e){var t=this;return this._genEvalValue(e,function(e){return t._names.getLocalName(e)},this._names.getLocalsAccessorName())},e.prototype.genEventBindingEvalValue=function(e,t){var r=this;return this._genEvalValue(t,function(t){return r._names.getEventLocalName(e,t)},"locals")},e.prototype._genEvalValue=function(e,t,r){var n,i=-1==e.contextIndex?this._names.getDirectiveName(e.directiveIndex):t(e.contextIndex),a=o.ListWrapper.map(e.args,function(e){return t(e)}).join(", ");switch(e.mode){case c.RecordType.Self:n=i;break;case c.RecordType.Const:n=s.codify(e.funcOrValue);break;case c.RecordType.PropertyRead:n=this._observe(i+"."+e.name,e);break;case c.RecordType.SafeProperty:var u=this._observe(i+"."+e.name,e);n=this._utilName+".isValueBlank("+i+") ? null : "+this._observe(u,e);break;case c.RecordType.PropertyWrite:n=i+"."+e.name+" = "+t(e.args[0]);break;case c.RecordType.Local:n=this._observe(r+".get("+s.rawString(e.name)+")",e);break;case c.RecordType.InvokeMethod:n=this._observe(i+"."+e.name+"("+a+")",e);break;case c.RecordType.SafeMethodInvoke:var p=i+"."+e.name+"("+a+")";n=this._utilName+".isValueBlank("+i+") ? null : "+this._observe(p,e);break;case c.RecordType.InvokeClosure:n=i+"("+a+")";break;case c.RecordType.PrimitiveOp:n=this._utilName+"."+e.name+"("+a+")";break;case c.RecordType.CollectionLiteral:n=this._utilName+"."+e.name+"("+a+")";break;case c.RecordType.Interpolate:n=this._genInterpolation(e);break;case c.RecordType.KeyedRead:n=this._observe(i+"["+t(e.args[0])+"]",e);break;case c.RecordType.KeyedWrite:n=i+"["+t(e.args[0])+"] = "+t(e.args[1]);break;case c.RecordType.Chain:n="null";break;default:throw new l.BaseException("Unknown operation "+e.mode)}return t(e.selfIndex)+" = "+n+";"},e.prototype._observe=function(e,t){return this._changeDetection===u.ChangeDetectionStrategy.OnPushObserve?"this.observeValue("+e+", "+t.selfIndex+")":e},e.prototype.genPropertyBindingTargets=function(e,t){var r=this,n=e.map(function(e){if(a.isBlank(e))return"null";var n=t?s.codify(e.debug):"null";return r._utilName+".bindingTarget("+s.codify(e.mode)+", "+e.elementIndex+", "+s.codify(e.name)+", "+s.codify(e.unit)+", "+n+")"});return"["+n.join(", ")+"]"},e.prototype.genDirectiveIndices=function(e){var t=this,r=e.map(function(e){return t._utilName+".directiveIndex("+e.directiveIndex.elementIndex+", "+e.directiveIndex.directiveIndex+")"});return"["+r.join(", ")+"]"},e.prototype._genInterpolation=function(e){for(var t=[],r=0;r<e.args.length;++r)t.push(s.codify(e.fixedArgs[r])),t.push(this._utilName+".s("+this._names.getLocalName(e.args[r])+")");return t.push(s.codify(e.fixedArgs[e.args.length])),s.combineGeneratedStrings(t)},e.prototype.genHydrateDirectives=function(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];t.push(this._names.getDirectiveName(n.directiveIndex)+" = "+this._genReadDirective(r)+";")}return t.join("\n")},e.prototype._genReadDirective=function(e){return this._changeDetection===u.ChangeDetectionStrategy.OnPushObserve?"this.observeDirective(this.getDirectiveFor(directives, "+e+"), "+e+")":"this.getDirectiveFor(directives, "+e+")"},e.prototype.genHydrateDetectors=function(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];n.isDefaultChangeDetection()||t.push(this._names.getDetectorName(n.directiveIndex)+" = this.getDetectorFor(directives, "+r+");")}return t.join("\n")},e.prototype.genContentLifecycleCallbacks=function(e){for(var t=[],r=e.length-1;r>=0;--r){var n=e[r];n.callAfterContentInit&&t.push("if(! "+this._names.getAlreadyCheckedName()+") "+this._names.getDirectiveName(n.directiveIndex)+".afterContentInit();"),n.callAfterContentChecked&&t.push(this._names.getDirectiveName(n.directiveIndex)+".afterContentChecked();")}return t},e.prototype.genViewLifecycleCallbacks=function(e){for(var t=[],r=e.length-1;r>=0;--r){var n=e[r];n.callAfterViewInit&&t.push("if(! "+this._names.getAlreadyCheckedName()+") "+this._names.getDirectiveName(n.directiveIndex)+".afterViewInit();"),n.callAfterViewChecked&&t.push(this._names.getDirectiveName(n.directiveIndex)+".afterViewChecked();")}return t},e}();return t.CodegenLogicUtil=p,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Subscriber",["@reactivex/rxjs/dist/cjs/util/noop","@reactivex/rxjs/dist/cjs/util/throwError","@reactivex/rxjs/dist/cjs/util/tryOrOnError","@reactivex/rxjs/dist/cjs/Subscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=e("@reactivex/rxjs/dist/cjs/util/noop"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/throwError"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/tryOrOnError"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/Subscription"),v=n(g),y=function(e){function t(r){if(i(this,t),e.call(this),this._isUnsubscribed=!1,this.destination=r,r){var n=r._subscription;n?this._subscription=n:r instanceof t&&(this._subscription=r)}}return o(t,e),t.create=function(e,r,n){var i=new t;return i._next="function"==typeof e&&h["default"](e)||l["default"],i._error="function"==typeof r&&r||f["default"],i._complete="function"==typeof n&&n||l["default"],i},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){this.destination.complete()},t.prototype.add=function(t){var r=this._subscription;r?r.add(t):e.prototype.add.call(this,t)},t.prototype.remove=function(t){this._subscription?this._subscription.remove(t):e.prototype.remove.call(this,t)},t.prototype.unsubscribe=function(){this._isUnsubscribed||(this._subscription?this._isUnsubscribed=!0:e.prototype.unsubscribe.call(this))},t.prototype.next=function(e){this.isUnsubscribed||this._next(e)},t.prototype.error=function(e){this.isUnsubscribed||(this._error(e),this.unsubscribe())},t.prototype.complete=function(){this.isUnsubscribed||(this._complete(),this.unsubscribe())},c(t,[{key:"isUnsubscribed",get:function(){var e=this._subscription;return e?this._isUnsubscribed||e.isUnsubscribed:this._isUnsubscribed},set:function(e){var t=this._subscription;t?t.isUnsubscribed=Boolean(e):this._isUnsubscribed=Boolean(e)}}]),t}(v["default"]);return t["default"]=y,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/Symbol_observable",["@reactivex/rxjs/dist/cjs/util/root"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.__esModule=!0;var o=e("@reactivex/rxjs/dist/cjs/util/root");return o.root.Symbol||(o.root.Symbol={}),o.root.Symbol.observable||(o.root.Symbol.observable="function"==typeof o.root.Symbol["for"]?o.root.Symbol["for"]("observable"):"@@observable"),t["default"]=o.root.Symbol.observable,r.exports=t["default"],n.define=i,r.exports}),System.register("angular2/src/core/pipes/date_pipe",["angular2/src/core/facade/lang","angular2/src/core/facade/intl","angular2/src/core/di","angular2/src/core/metadata","angular2/src/core/facade/collection","angular2/src/core/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/intl"),u=e("angular2/src/core/di"),l=e("angular2/src/core/metadata"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),d="en-US",h=function(){function e(){}return e.prototype.transform=function(t,r){if(s.isBlank(t))return null;if(!this.supports(t))throw new f.InvalidPipeArgumentException(e,t);var n=s.isPresent(r)&&r.length>0?r[0]:"mediumDate";return s.isNumber(t)&&(t=s.DateWrapper.fromMillis(t)),p.StringMapWrapper.contains(e._ALIASES,n)&&(n=p.StringMapWrapper.get(e._ALIASES,n)),c.DateFormatter.format(t,d,n)},e.prototype.supports=function(e){return s.isDate(e)||s.isNumber(e)},e._ALIASES={medium:"yMMMdjms","short":"yMdjm",fullDate:"yMMMMEEEEd",longDate:"yMMMMd",mediumDate:"yMMMd",shortDate:"yMd",mediumTime:"jms",shortTime:"jm"},e=o([s.CONST(),l.Pipe({name:"date"}),u.Injectable(),a("design:paramtypes",[])],e)}();return t.DatePipe=h,n.define=i,r.exports}),System.register("angular2/src/core/pipes/default_pipes",["angular2/src/core/pipes/async_pipe","angular2/src/core/pipes/uppercase_pipe","angular2/src/core/pipes/lowercase_pipe","angular2/src/core/pipes/json_pipe","angular2/src/core/pipes/slice_pipe","angular2/src/core/pipes/date_pipe","angular2/src/core/pipes/number_pipe","angular2/src/core/facade/lang","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/pipes/async_pipe"),a=e("angular2/src/core/pipes/uppercase_pipe"),s=e("angular2/src/core/pipes/lowercase_pipe"),c=e("angular2/src/core/pipes/json_pipe"),u=e("angular2/src/core/pipes/slice_pipe"),l=e("angular2/src/core/pipes/date_pipe"),p=e("angular2/src/core/pipes/number_pipe"),f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/di"),h=f.CONST_EXPR([o.AsyncPipe,a.UpperCasePipe,s.LowerCasePipe,c.JsonPipe,u.SlicePipe,p.DecimalPipe,p.PercentPipe,p.CurrencyPipe,l.DatePipe]);return t.DEFAULT_PIPES_TOKEN=f.CONST_EXPR(new d.OpaqueToken("Default Pipes")),t.DEFAULT_PIPES=f.CONST_EXPR(new d.Binding(t.DEFAULT_PIPES_TOKEN,{toValue:h})),n.define=i,r.exports}),System.register("angular2/src/core/compiler/directive_metadata",["angular2/src/core/facade/lang","angular2/src/core/facade/collection","angular2/src/core/change_detection/change_detection","angular2/src/core/metadata/view","angular2/src/core/compiler/selector","angular2/src/core/compiler/util","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e,t){var r=l.CssSelector.parse(t)[0].getMatchingElementTemplate();return v.create({type:new h({runtime:Object,name:"Host"+e.name,moduleUrl:e.moduleUrl,isHost:!0}),template:new g({template:r,templateUrl:"",styles:[],styleUrls:[],ngContentSelectors:[]}),changeDetection:c.ChangeDetectionStrategy.Default,inputs:[],outputs:[],host:{},lifecycleHooks:[],isComponent:!0,dynamicLoadable:!1,selector:"*"})}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/change_detection/change_detection"),u=e("angular2/src/core/metadata/view"),l=e("angular2/src/core/compiler/selector"),p=e("angular2/src/core/compiler/util"),f=e("angular2/src/core/linker/interfaces"),d=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g,h=function(){function e(e){var t=void 0===e?{}:e,r=t.runtime,n=t.name,i=t.moduleUrl,o=t.isHost;this.runtime=r,this.name=n,this.moduleUrl=i,this.isHost=a.normalizeBool(o)}return e.fromJson=function(t){return new e({name:t.name,moduleUrl:t.moduleUrl,isHost:t.isHost})},e.prototype.toJson=function(){return{name:this.name,moduleUrl:this.moduleUrl,isHost:this.isHost}},e}();t.CompileTypeMetadata=h;var g=function(){function e(e){var t=void 0===e?{}:e,r=t.encapsulation,n=t.template,i=t.templateUrl,o=t.styles,s=t.styleUrls,c=t.ngContentSelectors;this.encapsulation=a.isPresent(r)?r:u.ViewEncapsulation.Emulated,this.template=n,this.templateUrl=i,this.styles=a.isPresent(o)?o:[],this.styleUrls=a.isPresent(s)?s:[],this.ngContentSelectors=a.isPresent(c)?c:[]}return e.fromJson=function(t){return new e({encapsulation:a.isPresent(t.encapsulation)?u.VIEW_ENCAPSULATION_VALUES[t.encapsulation]:t.encapsulation,template:t.template,templateUrl:t.templateUrl,styles:t.styles,styleUrls:t.styleUrls,ngContentSelectors:t.ngContentSelectors})},e.prototype.toJson=function(){return{encapsulation:a.isPresent(this.encapsulation)?a.serializeEnum(this.encapsulation):this.encapsulation,template:this.template,templateUrl:this.templateUrl,styles:this.styles,styleUrls:this.styleUrls,ngContentSelectors:this.ngContentSelectors}},e}();t.CompileTemplateMetadata=g;var v=function(){function e(e){var t=void 0===e?{}:e,r=t.type,n=t.isComponent,i=t.dynamicLoadable,o=t.selector,a=t.exportAs,s=t.changeDetection,c=t.inputs,u=t.outputs,l=t.hostListeners,p=t.hostProperties,f=t.hostAttributes,d=t.lifecycleHooks,h=t.template;this.type=r,this.isComponent=n,this.dynamicLoadable=i,this.selector=o,this.exportAs=a,this.changeDetection=s,this.inputs=c,this.outputs=u,this.hostListeners=l,this.hostProperties=p,this.hostAttributes=f,this.lifecycleHooks=d,this.template=h}return e.create=function(t){var r=void 0===t?{}:t,n=r.type,i=r.isComponent,o=r.dynamicLoadable,c=r.selector,u=r.exportAs,l=r.changeDetection,f=r.inputs,h=r.outputs,g=r.host,v=r.lifecycleHooks,y=r.template,m={},_={},b={};a.isPresent(g)&&s.StringMapWrapper.forEach(g,function(e,t){var r=a.RegExpWrapper.firstMatch(d,t);a.isBlank(r)?b[t]=e:a.isPresent(r[1])?_[r[1]]=e:a.isPresent(r[2])&&(m[r[2]]=e)});var x={};a.isPresent(f)&&f.forEach(function(e){var t=p.splitAtColon(e,[e,e]);x[t[0]]=t[1]});var w={};return a.isPresent(h)&&h.forEach(function(e){var t=p.splitAtColon(e,[e,e]);w[t[0]]=t[1]}),new e({type:n,isComponent:a.normalizeBool(i),dynamicLoadable:a.normalizeBool(o),selector:c,exportAs:u,changeDetection:l,inputs:x,outputs:w,hostListeners:m,hostProperties:_,hostAttributes:b,lifecycleHooks:a.isPresent(v)?v:[],template:y})},e.fromJson=function(t){return new e({isComponent:t.isComponent,dynamicLoadable:t.dynamicLoadable,selector:t.selector,exportAs:t.exportAs,type:a.isPresent(t.type)?h.fromJson(t.type):t.type,changeDetection:a.isPresent(t.changeDetection)?c.CHANGE_DECTION_STRATEGY_VALUES[t.changeDetection]:t.changeDetection,inputs:t.inputs,outputs:t.outputs,hostListeners:t.hostListeners,hostProperties:t.hostProperties,hostAttributes:t.hostAttributes,lifecycleHooks:t.lifecycleHooks.map(function(e){return f.LIFECYCLE_HOOKS_VALUES[e]}),template:a.isPresent(t.template)?g.fromJson(t.template):t.template})},e.prototype.toJson=function(){return{isComponent:this.isComponent,dynamicLoadable:this.dynamicLoadable,selector:this.selector,exportAs:this.exportAs,type:a.isPresent(this.type)?this.type.toJson():this.type,changeDetection:a.isPresent(this.changeDetection)?a.serializeEnum(this.changeDetection):this.changeDetection,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,lifecycleHooks:this.lifecycleHooks.map(function(e){return a.serializeEnum(e)}),template:a.isPresent(this.template)?this.template.toJson():this.template}},e}();return t.CompileDirectiveMetadata=v,t.createHostComponentMeta=n,i.define=o,r.exports}),System.register("angular2/src/core/compiler/change_definition_factory",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/reflection/reflection","angular2/src/core/change_detection/change_detection","angular2/src/core/compiler/template_ast","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e,t,r,n){var o=[],a=new h(null,o,t);return f.templateVisitAll(a,n),i(o,e,r)}function i(e,t,r){var n=o(e);return e.map(function(e){var i=t.name+"_"+e.viewIndex;return new p.ChangeDetectorDefinition(i,e.strategy,n[e.viewIndex],e.bindingRecords,e.eventRecords,e.directiveRecords,r)})}function o(e){var t=c.ListWrapper.createFixedSize(e.length);return e.forEach(function(e){var r=u.isPresent(e.parent)?t[e.parent.viewIndex]:[];t[e.viewIndex]=r.concat(e.variableNames)}),t}var a=System.global,s=a.define;a.define=void 0;var c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/reflection/reflection"),p=e("angular2/src/core/change_detection/change_detection"),f=e("angular2/src/core/compiler/template_ast"),d=e("angular2/src/core/linker/interfaces");t.createChangeDetectorDefinitions=n;var h=function(){function e(e,t,r){this.parent=e,this.allVisitors=t,this.strategy=r,this.boundTextCount=0,this.boundElementCount=0,this.variableNames=[],
this.bindingRecords=[],this.eventRecords=[],this.directiveRecords=[],this.viewIndex=t.length,t.push(this)}return e.prototype.visitEmbeddedTemplate=function(t,r){this.boundElementCount++;for(var n=0;n<t.directives.length;n++)t.directives[n].visit(this,n);var i=new e(this,this.allVisitors,p.ChangeDetectionStrategy.Default);return f.templateVisitAll(i,t.vars),f.templateVisitAll(i,t.children),null},e.prototype.visitElement=function(e,t){e.isBound()&&this.boundElementCount++,f.templateVisitAll(this,e.inputs,null),f.templateVisitAll(this,e.outputs),f.templateVisitAll(this,e.exportAsVars);for(var r=0;r<e.directives.length;r++)e.directives[r].visit(this,r);return f.templateVisitAll(this,e.children),null},e.prototype.visitNgContent=function(e,t){return null},e.prototype.visitVariable=function(e,t){return this.variableNames.push(e.name),null},e.prototype.visitEvent=function(e,t){var r=u.isPresent(t)?p.BindingRecord.createForHostEvent(e.handler,e.fullName,t):p.BindingRecord.createForEvent(e.handler,e.fullName,this.boundElementCount-1);return this.eventRecords.push(r),null},e.prototype.visitElementProperty=function(e,t){var r,n=this.boundElementCount-1,i=u.isPresent(t)?t.directiveIndex:null;return e.type===f.PropertyBindingType.Property?r=u.isPresent(i)?p.BindingRecord.createForHostProperty(i,e.value,e.name):p.BindingRecord.createForElementProperty(e.value,n,e.name):e.type===f.PropertyBindingType.Attribute?r=u.isPresent(i)?p.BindingRecord.createForHostAttribute(i,e.value,e.name):p.BindingRecord.createForElementAttribute(e.value,n,e.name):e.type===f.PropertyBindingType.Class?r=u.isPresent(i)?p.BindingRecord.createForHostClass(i,e.value,e.name):p.BindingRecord.createForElementClass(e.value,n,e.name):e.type===f.PropertyBindingType.Style&&(r=u.isPresent(i)?p.BindingRecord.createForHostStyle(i,e.value,e.name,e.unit):p.BindingRecord.createForElementStyle(e.value,n,e.name,e.unit)),this.bindingRecords.push(r),null},e.prototype.visitAttr=function(e,t){return null},e.prototype.visitBoundText=function(e,t){var r=this.boundTextCount++;return this.bindingRecords.push(p.BindingRecord.createForTextNode(e.value,r)),null},e.prototype.visitText=function(e,t){return null},e.prototype.visitDirective=function(e,t){var r=new p.DirectiveIndex(this.boundElementCount-1,t),n=e.directive,i=new p.DirectiveRecord({directiveIndex:r,callAfterContentInit:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.AfterContentInit),callAfterContentChecked:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.AfterContentChecked),callAfterViewInit:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.AfterViewInit),callAfterViewChecked:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.AfterViewChecked),callOnChanges:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.OnChanges),callDoCheck:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.DoCheck),callOnInit:-1!==n.lifecycleHooks.indexOf(d.LifecycleHooks.OnInit),changeDetection:n.changeDetection});this.directiveRecords.push(i),f.templateVisitAll(this,e.inputs,i);var o=this.bindingRecords;return i.callOnChanges&&o.push(p.BindingRecord.createDirectiveOnChanges(i)),i.callOnInit&&o.push(p.BindingRecord.createDirectiveOnInit(i)),i.callDoCheck&&o.push(p.BindingRecord.createDirectiveDoCheck(i)),f.templateVisitAll(this,e.hostProperties,i),f.templateVisitAll(this,e.hostEvents,i),f.templateVisitAll(this,e.exportAsVars),null},e.prototype.visitDirectiveProperty=function(e,t){var r=l.reflector.setter(e.directiveName);return this.bindingRecords.push(p.BindingRecord.createForDirective(e.value,e.directiveName,r,t)),null},e}();return a.define=s,r.exports}),System.register("angular2/src/core/compiler/shadow_css",["angular2/src/core/dom/dom_adapter","angular2/src/core/facade/collection","angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){return s.DOM.cssToRules(e)}function i(e,t){if(!u.isBlank(t)){var r=n(e);t(r)}}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/dom/dom_adapter"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/facade/lang"),l=function(){function e(){this.strictStyling=!0}return e.prototype.shimStyle=function(e,t,r){void 0===r&&(r="");var n=s.DOM.getText(e);return this.shimCssText(n,t,r)},e.prototype.shimCssText=function(e,t,r){return void 0===r&&(r=""),e=this._insertDirectives(e),this._scopeCssText(e,t,r)},e.prototype._insertDirectives=function(e){return e=this._insertPolyfillDirectivesInCssText(e),this._insertPolyfillRulesInCssText(e)},e.prototype._insertPolyfillDirectivesInCssText=function(e){return u.StringWrapper.replaceAllMapped(e,p,function(e){return e[1]+"{"})},e.prototype._insertPolyfillRulesInCssText=function(e){return u.StringWrapper.replaceAllMapped(e,f,function(e){var t=e[0];return t=u.StringWrapper.replace(t,e[1],""),t=u.StringWrapper.replace(t,e[2],""),e[3]+t})},e.prototype._scopeCssText=function(e,t,r){var n=this,o=this._extractUnscopedRulesFromCssText(e);return e=this._insertPolyfillHostInCssText(e),e=this._convertColonHost(e),e=this._convertColonHostContext(e),e=this._convertShadowDOMSelectors(e),u.isPresent(t)&&i(e,function(i){e=n._scopeRules(i,t,r)}),e=e+"\n"+o,e.trim()},e.prototype._extractUnscopedRulesFromCssText=function(e){for(var t,r="",n=u.RegExpWrapper.matcher(d,e);u.isPresent(t=u.RegExpMatcherWrapper.next(n));){var i=t[0];i=u.StringWrapper.replace(i,t[2],""),i=u.StringWrapper.replace(i,t[1],t[3]),r+=i+"\n\n"}return r},e.prototype._convertColonHost=function(e){return this._convertColonRule(e,y,this._colonHostPartReplacer)},e.prototype._convertColonHostContext=function(e){return this._convertColonRule(e,m,this._colonHostContextPartReplacer)},e.prototype._convertColonRule=function(e,t,r){return u.StringWrapper.replaceAllMapped(e,t,function(e){if(u.isPresent(e[2])){for(var t=e[2].split(","),n=[],i=0;i<t.length;i++){var o=t[i];if(u.isBlank(o))break;o=o.trim(),n.push(r(_,o,e[3]))}return n.join(",")}return _+e[3]})},e.prototype._colonHostContextPartReplacer=function(e,t,r){return u.StringWrapper.contains(t,h)?this._colonHostPartReplacer(e,t,r):e+t+r+", "+t+" "+e+r},e.prototype._colonHostPartReplacer=function(e,t,r){return e+u.StringWrapper.replace(t,h,"")+r},e.prototype._convertShadowDOMSelectors=function(e){for(var t=0;t<b.length;t++)e=u.StringWrapper.replaceAll(e,b[t]," ");return e},e.prototype._scopeRules=function(e,t,r){var n="";if(u.isPresent(e))for(var i=0;i<e.length;i++){var o=e[i];if(s.DOM.isStyleRule(o)||s.DOM.isPageRule(o))n+=this._scopeSelector(o.selectorText,t,r,this.strictStyling)+" {\n",n+=this._propertiesFromRule(o)+"\n}\n\n";else if(s.DOM.isMediaRule(o))n+="@media "+o.media.mediaText+" {\n",n+=this._scopeRules(o.cssRules,t,r),n+="\n}\n\n";else try{u.isPresent(o.cssText)&&(n+=o.cssText+"\n\n")}catch(a){s.DOM.isKeyframesRule(o)&&u.isPresent(o.cssRules)&&(n+=this._ieSafeCssTextFromKeyFrameRule(o))}}return n},e.prototype._ieSafeCssTextFromKeyFrameRule=function(e){for(var t="@keyframes "+e.name+" {",r=0;r<e.cssRules.length;r++){var n=e.cssRules[r];t+=" "+n.keyText+" {"+n.style.cssText+"}"}return t+=" }"},e.prototype._scopeSelector=function(e,t,r,n){for(var i=[],o=e.split(","),a=0;a<o.length;a++){var s=o[a];s=s.trim(),this._selectorNeedsScoping(s,t)&&(s=n&&!u.StringWrapper.contains(s,_)?this._applyStrictSelectorScope(s,t):this._applySelectorScope(s,t,r)),i.push(s)}return i.join(", ")},e.prototype._selectorNeedsScoping=function(e,t){var r=this._makeScopeMatcher(t);return!u.isPresent(u.RegExpWrapper.firstMatch(r,e))},e.prototype._makeScopeMatcher=function(e){var t=/\[/g,r=/\]/g;return e=u.StringWrapper.replaceAll(e,t,"\\["),e=u.StringWrapper.replaceAll(e,r,"\\]"),u.RegExpWrapper.create("^("+e+")"+x,"m")},e.prototype._applySelectorScope=function(e,t,r){return this._applySimpleSelectorScope(e,t,r)},e.prototype._applySimpleSelectorScope=function(e,t,r){if(u.isPresent(u.RegExpWrapper.firstMatch(w,e))){var n=this.strictStyling?"["+r+"]":t;return e=u.StringWrapper.replace(e,_,n),u.StringWrapper.replaceAll(e,w,n+" ")}return t+" "+e},e.prototype._applyStrictSelectorScope=function(e,t){var r=/\[is=([^\]]*)\]/g;t=u.StringWrapper.replaceAllMapped(t,r,function(e){return e[1]});for(var n=[" ",">","+","~"],i=e,o="["+t+"]",a=0;a<n.length;a++){var s=n[a],l=i.split(s);i=c.ListWrapper.map(l,function(e){var t=u.StringWrapper.replaceAll(e.trim(),w,"");if(t.length>0&&!c.ListWrapper.contains(n,t)&&!u.StringWrapper.contains(t,o)){var r=/([^:]*)(:*)(.*)/g,i=u.RegExpWrapper.firstMatch(r,t);u.isPresent(i)&&(e=i[1]+o+i[2]+i[3])}return e}).join(s)}return i},e.prototype._insertPolyfillHostInCssText=function(e){return e=u.StringWrapper.replaceAll(e,S,g),e=u.StringWrapper.replaceAll(e,j,h)},e.prototype._propertiesFromRule=function(e){var t=e.style.cssText,r=/['"]+|attr/g;if(e.style.content.length>0&&!u.isPresent(u.RegExpWrapper.firstMatch(r,e.style.content))){var n=/content:[^;]*;/g;t=u.StringWrapper.replaceAll(t,n,"content: '"+e.style.content+"';")}return t},e}();t.ShadowCss=l;var p=/polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,f=/(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,d=/(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,h="-shadowcsshost",g="-shadowcsscontext",v=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",y=u.RegExpWrapper.create("("+h+v,"im"),m=u.RegExpWrapper.create("("+g+v,"im"),_=h+"-no-combinator",b=[/>>>/g,/::shadow/g,/::content/g,/\/deep\//g,/\/shadow-deep\//g,/\/shadow\//g],x="([>\\s~+[.,{:][\\s\\S]*)?$",w=u.RegExpWrapper.create(h,"im"),j=/:host/gim,S=/:host-context/gim;return o.define=a,r.exports}),System.register("angular2/src/core/compiler/html_parser",["angular2/src/core/facade/lang","angular2/src/core/dom/dom_adapter","angular2/src/core/compiler/html_ast","angular2/src/core/compiler/util","angular2/src/core/di"],!0,function(e,t,r){function n(e,t,r){var n=d.DOM.getText(e);return new h.HtmlTextAst(n,r+" > #text("+n+"):nth-child("+t+")")}function i(e,t,r,n){return new h.HtmlAttrAst(r,n,t+"["+r+"="+n+"]")}function o(e,t,r){var n=d.DOM.nodeName(e).toLowerCase(),i=r+" > "+n+":nth-child("+t+")",o=a(e,i),c=s(e,i);return new h.HtmlElementAst(n,o,c,i)}function a(e,t){var r=d.DOM.attributeMap(e),n=[];return r.forEach(function(e,t){return n.push([t,e])}),n.sort(function(e,t){return f.StringWrapper.compare(e[0],t[0])}),n.map(function(r){return i(e,t,r[0],r[1])})}function s(e,t){var r=d.DOM.templateAwareRoot(e),i=d.DOM.childNodesAsList(r),a=[],s=0;return i.forEach(function(e){var r=null;if(d.DOM.isTextNode(e)){var i=e;r=n(i,s,t)}else if(d.DOM.isElementNode(e)){var c=e;r=o(c,s,t)}f.isPresent(r)&&a.push(r),s++}),a}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/dom/dom_adapter"),h=e("angular2/src/core/compiler/html_ast"),g=e("angular2/src/core/compiler/util"),v=e("angular2/src/core/di"),y=function(){function e(){}return e.prototype.parse=function(e,t){var r=d.DOM.createTemplate(e);return s(r,t)},e.prototype.unparse=function(e){var t=new m,r=[];return h.htmlVisitAll(t,e,r),r.join("")},e=l([v.Injectable(),p("design:paramtypes",[])],e)}();t.HtmlParser=y;var m=function(){function e(){}return e.prototype.visitElement=function(e,t){t.push("<"+e.name);var r=[];return h.htmlVisitAll(this,e.attrs,r),e.attrs.length>0&&(t.push(" "),t.push(r.join(" "))),t.push(">"),h.htmlVisitAll(this,e.children,t),t.push("</"+e.name+">"),null},e.prototype.visitAttr=function(e,t){return t.push(e.name+"="+g.escapeDoubleQuoteString(e.value)),null},e.prototype.visitText=function(e,t){return t.push(e.value),null},e}();return c.define=u,r.exports}),System.register("angular2/src/core/compiler/runtime_metadata",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/compiler/directive_metadata","angular2/src/core/metadata/directives","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/view_resolver","angular2/src/core/linker/directive_lifecycle_reflector","angular2/src/core/linker/interfaces","angular2/src/core/reflection/reflection","angular2/src/core/di","angular2/src/core/compiler/util"],!0,function(e,t,r){function n(e){var t=new Map;return e.forEach(function(e){t.set(e.type.runtime,e)}),g.MapWrapper.values(t)}function i(e){if(d.isBlank(e.directives))return[];var t=[];return o(e.directives,t),t}function o(e,t){for(var r=0;r<e.length;r++){var n=f.resolveForwardRef(e[r]);d.isArray(n)?o(n,t):t.push(n)}}function a(e){return d.isPresent(e)&&e instanceof d.Type}function s(e,t){return d.isPresent(t.moduleId)?"package:"+t.moduleId+S.MODULE_SUFFIX:w.reflector.importUri(e)}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=e("angular2/src/core/di"),d=e("angular2/src/core/facade/lang"),h=e("angular2/src/core/facade/exceptions"),g=e("angular2/src/core/facade/collection"),v=e("angular2/src/core/compiler/directive_metadata"),y=e("angular2/src/core/metadata/directives"),m=e("angular2/src/core/linker/directive_resolver"),_=e("angular2/src/core/linker/view_resolver"),b=e("angular2/src/core/linker/directive_lifecycle_reflector"),x=e("angular2/src/core/linker/interfaces"),w=e("angular2/src/core/reflection/reflection"),j=e("angular2/src/core/di"),S=e("angular2/src/core/compiler/util"),C=function(){function e(e,t){this._directiveResolver=e,this._viewResolver=t,this._cache=new Map}return e.prototype.getMetadata=function(e){var t=this._cache.get(e);if(d.isBlank(t)){var r=this._directiveResolver.resolve(e),n=s(e,r),i=null,o=null;if(r instanceof y.ComponentMetadata){var a=r,c=this._viewResolver.resolve(e);i=new v.CompileTemplateMetadata({encapsulation:c.encapsulation,template:c.template,templateUrl:c.templateUrl,styles:c.styles,styleUrls:c.styleUrls}),o=a.changeDetection}t=v.CompileDirectiveMetadata.create({selector:r.selector,exportAs:r.exportAs,isComponent:d.isPresent(i),dynamicLoadable:!0,type:new v.CompileTypeMetadata({name:d.stringify(e),moduleUrl:n,runtime:e}),template:i,changeDetection:o,inputs:r.inputs,outputs:r.outputs,host:r.host,lifecycleHooks:g.ListWrapper.filter(x.LIFECYCLE_HOOKS_VALUES,function(t){return b.hasLifecycleHook(t,e)})}),this._cache.set(e,t)}return t},e.prototype.getViewDirectivesMetadata=function(e){for(var t=this,r=this._viewResolver.resolve(e),o=i(r),s=0;s<o.length;s++)if(!a(o[s]))throw new h.BaseException("Unexpected directive value '"+d.stringify(o[s])+"' on the View of component '"+d.stringify(e)+"'");return n(o.map(function(e){return t.getMetadata(e)}))},e=l([j.Injectable(),p("design:paramtypes",[m.DirectiveResolver,_.ViewResolver])],e)}();return t.RuntimeMetadataResolver=C,c.define=u,r.exports}),System.register("angular2/src/core/pipes/pipes",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/pipes"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/change_detection/pipes"),u=function(){function e(e){this.config=e,this.config=e}return e.fromBindings=function(t){var r={};return t.forEach(function(e){return r[e.name]=e}),new e(r)},e.prototype.get=function(e){var t=this.config[e];if(o.isBlank(t))throw new a.BaseException("Cannot find pipe '"+e+"'.");return t},e}();t.ProtoPipes=u;var l=function(){function e(e,t){this.proto=e,this.injector=t,this._config={}}return e.prototype.get=function(e){var t=s.StringMapWrapper.get(this._config,e);if(o.isPresent(t))return t;var r=this.proto.get(e),n=this.injector.instantiateResolved(r),i=new c.SelectedPipe(n,r.pure);return r.pure&&s.StringMapWrapper.set(this._config,e,i),i},e}();return t.Pipes=l,n.define=i,r.exports}),System.register("angular2/src/core/linker/view",["angular2/src/core/facade/collection","angular2/src/core/change_detection/change_detection","angular2/src/core/change_detection/interfaces","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/linker/view_ref","angular2/src/core/render/dom/util","angular2/src/core/change_detection/interfaces"],!0,function(e,t,r){function n(e){for(var t={},r=e;l.isPresent(r);)t=s.StringMapWrapper.merge(t,s.MapWrapper.toStringMap(r.current)),r=r.parent;return t}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/change_detection/change_detection"),u=e("angular2/src/core/change_detection/interfaces"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/facade/exceptions"),f=e("angular2/src/core/linker/view_ref"),d=e("angular2/src/core/render/dom/util"),h=e("angular2/src/core/change_detection/interfaces");t.DebugContext=h.DebugContext;var g="ng-reflect-";!function(e){e[e.HOST=0]="HOST",e[e.COMPONENT=1]="COMPONENT",e[e.EMBEDDED=2]="EMBEDDED"}(t.ViewType||(t.ViewType={}));var v=(t.ViewType,function(){function e(){this.views=[]}return e}());t.AppViewContainer=v;var y=function(){function e(e,t,r,n,i,o,a,u,l){this.renderer=e,this.proto=t,this.viewOffset=r,this.elementOffset=n,this.textOffset=i,this.render=a,this.renderFragment=u,this.containerElementInjector=l,this.views=null,this.elementInjectors=null,this.viewContainers=null,this.preBuiltObjects=null,this.changeDetector=null,this.context=null,this.ref=new f.ViewRef(this),this.locals=new c.Locals(null,s.MapWrapper.clone(o))}return e.prototype.init=function(e,t,r,n,i,o,a){this.changeDetector=e,this.elementInjectors=t,this.rootElementInjectors=r,this.preBuiltObjects=n,this.views=i,this.elementRefs=o,this.viewContainers=a},e.prototype.setLocal=function(e,t){if(!this.hydrated())throw new p.BaseException("Cannot set locals on dehydrated view.");if(this.proto.templateVariableBindings.has(e)){var r=this.proto.templateVariableBindings.get(e);this.locals.set(r,t)}},e.prototype.hydrated=function(){return l.isPresent(this.context)},e.prototype.triggerEventHandlers=function(e,t,r){var n=new s.Map;n.set("$event",t),this.dispatchEvent(r,e,n)},e.prototype.notifyOnBinding=function(e,t){if(e.isTextNode())this.renderer.setText(this.render,e.elementIndex+this.textOffset,t);else{var r=this.elementRefs[this.elementOffset+e.elementIndex];if(e.isElementProperty())this.renderer.setElementProperty(r,e.name,t);else if(e.isElementAttribute())this.renderer.setElementAttribute(r,e.name,l.isPresent(t)?""+t:null);else if(e.isElementClass())this.renderer.setElementClass(r,e.name,t);else{if(!e.isElementStyle())throw new p.BaseException("Unsupported directive record");var n=l.isPresent(e.unit)?e.unit:"";this.renderer.setElementStyle(r,e.name,""+t+n)}}},e.prototype.logBindingUpdate=function(e,t){if(e.isDirective()||e.isElementProperty()){var r=this.elementRefs[this.elementOffset+e.elementIndex];this.renderer.setElementAttribute(r,""+g+d.camelCaseToDashCase(e.name),""+t)}},e.prototype.notifyAfterContentChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)l.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].afterContentChecked()},e.prototype.notifyAfterViewChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)l.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].afterViewChecked()},e.prototype.getDirectiveFor=function(e){var t=this.elementInjectors[this.elementOffset+e.elementIndex];return t.getDirectiveAtIndex(e.directiveIndex)},e.prototype.getNestedView=function(e){var t=this.elementInjectors[e];return l.isPresent(t)?t.getNestedView():null},e.prototype.getContainerElement=function(){return l.isPresent(this.containerElementInjector)?this.containerElementInjector.getElementRef():null},e.prototype.getDebugContext=function(e,t){try{var r=this.elementOffset+e,i=r<this.elementRefs.length,o=i?this.elementRefs[this.elementOffset+e]:null,a=this.getContainerElement(),s=i?this.elementInjectors[this.elementOffset+e]:null,c=l.isPresent(o)?o.nativeElement:null,p=l.isPresent(a)?a.nativeElement:null,f=l.isPresent(t)?this.getDirectiveFor(t):null,d=l.isPresent(s)?s.getInjector():null;return new u.DebugContext(c,p,f,this.context,n(this.locals),d)}catch(h){return null}},e.prototype.getDetectorFor=function(e){var t=this.getNestedView(this.elementOffset+e.elementIndex);return l.isPresent(t)?t.changeDetector:null},e.prototype.invokeElementMethod=function(e,t,r){this.renderer.invokeElementMethod(this.elementRefs[e],t,r)},e.prototype.dispatchRenderEvent=function(e,t,r){var n=this.elementRefs[e],i=f.internalView(n.parentView);return i.dispatchEvent(n.boundElementIndex,t,r)},e.prototype.dispatchEvent=function(e,t,r){try{return this.hydrated()?!this.changeDetector.handleEvent(t,e-this.elementOffset,new c.Locals(this.locals,r)):!0}catch(n){var i=this.getDebugContext(e-this.elementOffset,null),o=l.isPresent(i)?new m(i.element,i.componentElement,i.context,i.locals,i.injector):null;throw new _(t,n,n.stack,o)}},Object.defineProperty(e.prototype,"ownBindersCount",{get:function(){return this.proto.elementBinders.length},enumerable:!0,configurable:!0}),e}();t.AppView=y;var m=function(){function e(e,t,r,n,i){this.element=e,this.componentElement=t,this.context=r,this.locals=n,this.injector=i}return e}(),_=function(e){function t(t,r,n,i){e.call(this,'Error during evaluation of "'+t+'"',r,n,i)}return a(t,e),t}(p.WrappedException),b=function(){function e(e,t,r){this.embeddedViewCount=e,this.elementCount=t,this.viewCount=r}return e}();t.AppProtoViewMergeInfo=b;var x=function(){function e(e,t,r,n,i,o){this.templateCmds=e,this.type=t,this.isMergable=r,this.changeDetectorFactory=n,this.templateVariableBindings=i,this.pipes=o,this.elementBinders=null,this.mergeInfo=null,this.variableLocations=null,this.textBindingCount=null,this.render=null,this.ref=new f.ProtoViewRef(this)}return e.prototype.init=function(e,t,r,n,i){var o=this;this.render=e,this.elementBinders=t,this.textBindingCount=r,this.mergeInfo=n,this.variableLocations=i,this.protoLocals=new s.Map,l.isPresent(this.templateVariableBindings)&&s.MapWrapper.forEach(this.templateVariableBindings,function(e,t){o.protoLocals.set(e,null)}),l.isPresent(i)&&s.MapWrapper.forEach(i,function(e,t){o.protoLocals.set(t,null)})},e.prototype.isInitialized=function(){return l.isPresent(this.elementBinders)},e}();return t.AppProtoView=x,i.define=o,r.exports}),System.register("angular2/src/core/linker/view_manager_utils",["angular2/src/core/di","angular2/src/core/facade/collection","angular2/src/core/linker/element_injector","angular2/src/core/facade/lang","angular2/src/core/linker/view","angular2/src/core/linker/element_ref","angular2/src/core/linker/template_ref","angular2/src/core/pipes/pipes"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/linker/element_injector"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/linker/view"),f=e("angular2/src/core/linker/element_ref"),d=e("angular2/src/core/linker/template_ref"),h=e("angular2/src/core/pipes/pipes"),g=function(){function e(){}return e.prototype.getComponentInstance=function(e,t){var r=e.elementInjectors[t];return r.getComponent()},e.prototype.createView=function(e,t,r,n){for(var i=t.fragmentRefs,o=t.viewRef,a=e.mergeInfo.elementCount,s=e.mergeInfo.viewCount,h=c.ListWrapper.createFixedSize(a),g=c.ListWrapper.createFixedSize(a),v=c.ListWrapper.createFixedSize(a),y=c.ListWrapper.createFixedSize(a),m=c.ListWrapper.createFixedSize(s),_=0,b=0,x=0,w=c.ListWrapper.createFixedSize(s),j=0;s>j;j++){var S=w[j],C=l.isPresent(S)?y[S]:null,E=l.isPresent(C)?v[S].view:null,R=l.isPresent(S)?E.proto.elementBinders[S-E.elementOffset].nestedProtoView:e,O=null;(0===j||R.type===p.ViewType.EMBEDDED)&&(O=i[x++]);var P=new p.AppView(n,R,j,_,b,R.protoLocals,o,O,C);m[j]=P,l.isPresent(S)&&(v[S].nestedView=P);for(var I=[],D=j+1,T=0;T<R.elementBinders.length;T++){var k=R.elementBinders[T],M=_+T,A=null;l.isPresent(k.nestedProtoView)&&k.nestedProtoView.isMergable&&(w[D]=M,D+=k.nestedProtoView.mergeInfo.viewCount);var N=k.protoElementInjector;if(l.isPresent(N))if(l.isPresent(N.parent)){var V=y[_+N.parent.index];A=N.instantiate(V)}else A=N.instantiate(null),I.push(A);y[M]=A;var B=new f.ElementRef(P.ref,M,n);if(h[B.boundElementIndex]=B,l.isPresent(A)){var L=l.isPresent(k.nestedProtoView)&&k.nestedProtoView.type===p.ViewType.EMBEDDED?new d.TemplateRef(B):null;v[M]=new u.PreBuiltObjects(r,P,B,L)}}P.init(R.changeDetectorFactory(P),y,I,v,m,h,g),l.isPresent(E)&&R.type===p.ViewType.COMPONENT&&E.changeDetector.addShadowDomChild(P.changeDetector),_+=R.elementBinders.length,b+=R.textBindingCount}return m[0]},e.prototype.hydrateRootHostView=function(e,t){this._hydrateView(e,t,null,new Object,null)},e.prototype.attachViewInContainer=function(e,t,r,n,i,o){l.isBlank(r)&&(r=e,n=t),e.changeDetector.addChild(o.changeDetector);var a=e.viewContainers[t];l.isBlank(a)&&(a=new p.AppViewContainer,e.viewContainers[t]=a),c.ListWrapper.insert(a.views,i,o);for(var s=r.elementInjectors[n],u=o.rootElementInjectors.length-1;u>=0;u--)l.isPresent(s.parent)&&o.rootElementInjectors[u].link(s.parent);s.traverseAndSetQueriesAsDirty()},e.prototype.detachViewInContainer=function(e,t,r){var n=e.viewContainers[t],i=n.views[r];e.elementInjectors[t].traverseAndSetQueriesAsDirty(),i.changeDetector.remove(),c.ListWrapper.removeAt(n.views,r);for(var o=0;o<i.rootElementInjectors.length;++o){var a=i.rootElementInjectors[o];a.unlink()}},e.prototype.hydrateViewInContainer=function(e,t,r,n,i,o){l.isBlank(r)&&(r=e,n=t);var a=e.viewContainers[t],c=a.views[i],u=r.elementInjectors[n],p=l.isPresent(o)?s.Injector.fromResolvedBindings(o):null;this._hydrateView(c,p,u.getHost(),r.context,r.locals)},e.prototype._hydrateView=function(e,t,r,n,i){for(var o=e.viewOffset,a=o+e.proto.mergeInfo.viewCount-1;a>=o;){var s=e.views[o],c=s.proto;if(s!==e&&s.proto.type===p.ViewType.EMBEDDED)o+=s.proto.mergeInfo.viewCount;else{s!==e&&(t=null,i=null,r=s.containerElementInjector,n=r.getComponent()),s.context=n,s.locals.parent=i;for(var u=c.elementBinders,f=0;f<u.length;f++){var d=f+s.elementOffset,g=e.elementInjectors[d];l.isPresent(g)&&(g.hydrate(t,r,s.preBuiltObjects[d]),this._populateViewLocals(s,g,d),this._setUpEventEmitters(s,g,d))}var v=l.isPresent(r)?new h.Pipes(s.proto.pipes,r.getInjector()):null;s.changeDetector.hydrate(s.context,s.locals,s,v),o++}}},e.prototype._populateViewLocals=function(e,t,r){l.isPresent(t.getDirectiveVariableBindings())&&c.MapWrapper.forEach(t.getDirectiveVariableBindings(),function(n,i){l.isBlank(n)?e.locals.set(i,e.elementRefs[r].nativeElement):e.locals.set(i,t.getDirectiveAtIndex(n))})},e.prototype._setUpEventEmitters=function(e,t,r){for(var n=t.getEventEmitterAccessors(),i=0;i<n.length;++i)for(var o=n[i],a=t.getDirectiveAtIndex(i),s=0;s<o.length;++s){var c=o[s];c.subscribe(e,r,a)}},e.prototype.dehydrateView=function(e){for(var t=e.viewOffset+e.proto.mergeInfo.viewCount-1,r=e.viewOffset;t>=r;r++){var n=e.views[r];if(n.hydrated()){l.isPresent(n.locals)&&n.locals.clearValues(),n.context=null,n.changeDetector.dehydrate();for(var i=n.proto.elementBinders,o=0;o<i.length;o++){var a=e.elementInjectors[n.elementOffset+o];l.isPresent(a)&&a.dehydrate()}}}},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.AppViewManagerUtils=g,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/shared_styles_host",["angular2/src/core/dom/dom_adapter","angular2/src/core/di","angular2/src/core/facade/collection","angular2/src/core/render/dom/dom_tokens"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/dom/dom_adapter"),l=e("angular2/src/core/di"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/render/dom/dom_tokens"),d=function(){function e(){this._styles=[],this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,r=[];e.forEach(function(e){p.SetWrapper.has(t._stylesSet,e)||(t._stylesSet.add(e),t._styles.push(e),r.push(e))}),this.onStylesAdded(r)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return this._styles},e=a([l.Injectable(),s("design:paramtypes",[])],e)}();t.SharedStylesHost=d;var h=function(e){function t(t){e.call(this),this._hostNodes=new Set,this._hostNodes.add(t.head)}return o(t,e),t.prototype._addStylesToHost=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];u.DOM.appendChild(t,u.DOM.createStyleElement(n))}},t.prototype.addHost=function(e){this._addStylesToHost(this._styles,e),this._hostNodes.add(e)},t.prototype.removeHost=function(e){p.SetWrapper["delete"](this._hostNodes,e)},t.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach(function(r){t._addStylesToHost(e,r)})},t=a([l.Injectable(),c(0,l.Inject(f.DOCUMENT)),s("design:paramtypes",[Object])],t)}(d);return t.DomSharedStylesHost=h,n.define=i,r.exports}),System.register("angular2/src/animate/animation",["angular2/src/core/facade/lang","angular2/src/core/facade/math","angular2/src/core/render/dom/util","angular2/src/core/facade/collection","angular2/src/core/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/math"),s=e("angular2/src/core/render/dom/util"),c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/dom/dom_adapter"),l=function(){function e(e,t,r){var n=this;this.element=e,this.data=t,this.browserDetails=r,this.callbacks=[],this.eventClearFunctions=[],this.completed=!1,this._stringPrefix="",this.startTime=o.DateWrapper.toMillis(o.DateWrapper.now()),this._stringPrefix=u.DOM.getAnimationPrefix(),this.setup(),this.wait(function(e){
return n.start()})}return Object.defineProperty(e.prototype,"totalTime",{get:function(){var e=null!=this.computedDelay?this.computedDelay:0,t=null!=this.computedDuration?this.computedDuration:0;return e+t},enumerable:!0,configurable:!0}),e.prototype.wait=function(e){this.browserDetails.raf(e,2)},e.prototype.setup=function(){null!=this.data.fromStyles&&this.applyStyles(this.data.fromStyles),null!=this.data.duration&&this.applyStyles({transitionDuration:this.data.duration.toString()+"ms"}),null!=this.data.delay&&this.applyStyles({transitionDelay:this.data.delay.toString()+"ms"})},e.prototype.start=function(){this.addClasses(this.data.classesToAdd),this.addClasses(this.data.animationClasses),this.removeClasses(this.data.classesToRemove),null!=this.data.toStyles&&this.applyStyles(this.data.toStyles);var e=u.DOM.getComputedStyle(this.element);this.computedDelay=a.Math.max(this.parseDurationString(e.getPropertyValue(this._stringPrefix+"transition-delay")),this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix+"transition-delay"))),this.computedDuration=a.Math.max(this.parseDurationString(e.getPropertyValue(this._stringPrefix+"transition-duration")),this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix+"transition-duration"))),this.addEvents()},e.prototype.applyStyles=function(e){var t=this;c.StringMapWrapper.forEach(e,function(e,r){var n=s.camelCaseToDashCase(r);o.isPresent(u.DOM.getStyle(t.element,n))?u.DOM.setStyle(t.element,n,e.toString()):u.DOM.setStyle(t.element,t._stringPrefix+n,e.toString())})},e.prototype.addClasses=function(e){for(var t=0,r=e.length;r>t;t++)u.DOM.addClass(this.element,e[t])},e.prototype.removeClasses=function(e){for(var t=0,r=e.length;r>t;t++)u.DOM.removeClass(this.element,e[t])},e.prototype.addEvents=function(){var e=this;this.totalTime>0?this.eventClearFunctions.push(u.DOM.onAndCancel(this.element,u.DOM.getTransitionEnd(),function(t){return e.handleAnimationEvent(t)})):this.handleAnimationCompleted()},e.prototype.handleAnimationEvent=function(e){var t=a.Math.round(1e3*e.elapsedTime);this.browserDetails.elapsedTimeIncludesDelay||(t+=this.computedDelay),e.stopPropagation(),t>=this.totalTime&&this.handleAnimationCompleted()},e.prototype.handleAnimationCompleted=function(){this.removeClasses(this.data.animationClasses),this.callbacks.forEach(function(e){return e()}),this.callbacks=[],this.eventClearFunctions.forEach(function(e){return e()}),this.eventClearFunctions=[],this.completed=!0},e.prototype.onComplete=function(e){return this.completed?e():this.callbacks.push(e),this},e.prototype.parseDurationString=function(e){var t=0;if(null==e||e.length<2)return t;if("ms"==e.substring(e.length-2)){var r=o.NumberWrapper.parseInt(this.stripLetters(e),10);r>t&&(t=r)}else if("s"==e.substring(e.length-1)){var n=1e3*o.NumberWrapper.parseFloat(this.stripLetters(e)),r=a.Math.floor(n);r>t&&(t=r)}return t},e.prototype.stripLetters=function(e){return o.StringWrapper.replaceAll(e,o.RegExpWrapper.create("[^0-9]+$",""),"")},e}();return t.Animation=l,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/event_manager",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/dom/dom_adapter","angular2/src/core/zone/ng_zone","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/dom/dom_adapter"),d=e("angular2/src/core/zone/ng_zone"),h=e("angular2/src/core/di");t.EVENT_MANAGER_PLUGINS=u.CONST_EXPR(new h.OpaqueToken("EventManagerPlugins"));var g=function(){function e(e,t){var r=this;this._zone=t,e.forEach(function(e){return e.manager=r}),this._plugins=p.ListWrapper.reversed(e)}return e.prototype.addEventListener=function(e,t,r){var n=this._findPluginFor(t);n.addEventListener(e,t,r)},e.prototype.addGlobalEventListener=function(e,t,r){var n=this._findPluginFor(t);return n.addGlobalEventListener(e,t,r)},e.prototype.getZone=function(){return this._zone},e.prototype._findPluginFor=function(e){for(var t=this._plugins,r=0;r<t.length;r++){var n=t[r];if(n.supports(e))return n}throw new l.BaseException("No event manager plugin found for event "+e)},e=a([h.Injectable(),c(0,h.Inject(t.EVENT_MANAGER_PLUGINS)),s("design:paramtypes",[Array,d.NgZone])],e)}();t.EventManager=g;var v=function(){function e(){}return e.prototype.supports=function(e){return!1},e.prototype.addEventListener=function(e,t,r){throw"not implemented"},e.prototype.addGlobalEventListener=function(e,t,r){throw"not implemented"},e}();t.EventManagerPlugin=v;var y=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.supports=function(e){return!0},t.prototype.addEventListener=function(e,t,r){var n=this.manager.getZone(),i=function(e){return n.run(function(){return r(e)})};this.manager.getZone().runOutsideAngular(function(){f.DOM.on(e,t,i)})},t.prototype.addGlobalEventListener=function(e,t,r){var n=f.DOM.getGlobalEventTarget(e),i=this.manager.getZone(),o=function(e){return i.run(function(){return r(e)})};return this.manager.getZone().runOutsideAngular(function(){return f.DOM.onAndCancel(n,t,o)})},t=a([h.Injectable(),s("design:paramtypes",[])],t)}(v);return t.DomEventsPlugin=y,n.define=i,r.exports}),System.register("angular2/src/core/render/view_factory",["angular2/src/core/facade/lang","angular2/src/core/render/view"],!0,function(e,t,r){function n(e,t,r){var n=[];s(new f(null,null,t,n,r),e);for(var c,u=[],d=[],h=[],g=[],v=0,y=function(e,t,r){return c.dispatchRenderEvent(e,t,r)},m=[],_=0;_<n.length;_++){var b=n[_];a(b.boundElements,u),a(b.boundTextNodes,d),a(b.nativeShadowRoots,h),l.isBlank(b.rootNodesParent)&&g.push(new p.DefaultRenderFragmentRef(b.fragmentRootNodes));for(var x=0;x<b.eventData.length;x++){var w=b.eventData[x],j=w[0]+v,S=w[1],C=w[2];if(l.isPresent(S)){var E=i(j,S+":"+C,y);m.push(o(S,C,E,r))}else{var E=i(j,C,y);r.on(u[j],C,E)}}v+=b.boundElements.length}return c=new p.DefaultRenderView(g,d,u,h,m)}function i(e,t,r){return function(n){return r(e,t,n)}}function o(e,t,r,n){return function(){return n.globalOn(e,t,r)}}function a(e,t){for(var r=0;r<e.length;r++)t.push(e[r])}function s(e,t){for(var r=0;r<t.length;r++)t[r].visit(e,null)}var c=System.global,u=c.define;c.define=void 0;var l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/render/view");t.createRenderView=n;var f=function(){function e(e,t,r,n,i){this.parentComponent=e,this.rootNodesParent=t,this.inplaceElement=r,this.allBuilders=n,this.factory=i,this.boundTextNodes=[],this.boundElements=[],this.eventData=[],this.fragmentRootNodes=[],this.nativeShadowRoots=[],this.parentStack=[t],n.push(this)}return Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentStack[this.parentStack.length-1]},enumerable:!0,configurable:!0}),e.prototype.visitText=function(e,t){var r=this.factory.createText(e.value);return this._addChild(r,e.ngContentIndex),e.isBound&&this.boundTextNodes.push(r),null},e.prototype.visitNgContent=function(e,t){if(l.isPresent(this.parentComponent))for(var r=this.parentComponent.project(),n=0;n<r.length;n++){var i=r[n];this._addChild(i,e.ngContentIndex)}return null},e.prototype.visitBeginElement=function(e,t){return this.parentStack.push(this._beginElement(e)),null},e.prototype.visitEndElement=function(e){return this._endElement(),null},e.prototype.visitBeginComponent=function(e,t){var r=this._beginElement(e),n=r;e.nativeShadow&&(n=this.factory.createShadowRoot(r,e.templateId),this.nativeShadowRoots.push(n));var i=new d(r,n,e,this.factory,this.allBuilders);return this.parentStack.push(i),null},e.prototype.visitEndComponent=function(e){var t=this.parent;return t.build(),this._endElement(),null},e.prototype.visitEmbeddedTemplate=function(t,r){var n=this.factory.createTemplateAnchor(t.attrNameAndValues);return this._addChild(n,t.ngContentIndex),this.boundElements.push(n),t.isMerged&&s(new e(this.parentComponent,null,null,this.allBuilders,this.factory),t.children),null},e.prototype._beginElement=function(e){var t;if(l.isPresent(this.inplaceElement)?(t=this.inplaceElement,this.inplaceElement=null,this.factory.mergeElement(t,e.attrNameAndValues),this.fragmentRootNodes.push(t)):(t=this.factory.createElement(e.name,e.attrNameAndValues),this._addChild(t,e.ngContentIndex)),e.isBound){this.boundElements.push(t);for(var r=0;r<e.eventTargetAndNames.length;r+=2){var n=e.eventTargetAndNames[r],i=e.eventTargetAndNames[r+1];this.eventData.push([this.boundElements.length-1,n,i])}}return t},e.prototype._endElement=function(){this.parentStack.pop()},e.prototype._addChild=function(e,t){var r=this.parent;l.isPresent(r)?r instanceof d?r.addContentNode(t,e):this.factory.appendChild(r,e):this.fragmentRootNodes.push(e)},e}(),d=function(){function e(e,t,r,n,i){this.hostElement=e,this.cmd=r,this.factory=n,this.contentNodesByNgContentIndex=[],this.projectingNgContentIndex=0,this.viewBuilder=new f(this,t,null,i,n)}return e.prototype.addContentNode=function(e,t){if(l.isBlank(e))this.cmd.nativeShadow&&this.factory.appendChild(this.hostElement,t);else{for(;this.contentNodesByNgContentIndex.length<=e;)this.contentNodesByNgContentIndex.push([]);this.contentNodesByNgContentIndex[e].push(t)}},e.prototype.project=function(){var e=this.projectingNgContentIndex++;return e<this.contentNodesByNgContentIndex.length?this.contentNodesByNgContentIndex[e]:[]},e.prototype.build=function(){s(this.viewBuilder,this.factory.resolveComponentTemplate(this.cmd.templateId))},e}();return c.define=u,r.exports}),System.register("angular2/src/core/forms/model",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/facade/collection","angular2/src/core/forms/validators"],!0,function(e,t,r){function n(e){return e instanceof f}function i(e,t){return c.isBlank(t)?null:(t instanceof Array||(t=t.split("/")),t instanceof Array&&l.ListWrapper.isEmpty(t)?null:l.ListWrapper.reduce(t,function(e,t){if(e instanceof h)return c.isPresent(e.controls[t])?e.controls[t]:null;if(e instanceof g){var r=t;return c.isPresent(e.at(r))?e.at(r):null}return null},e))}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/facade/async"),l=e("angular2/src/core/facade/collection"),p=e("angular2/src/core/forms/validators");t.VALID="VALID",t.INVALID="INVALID",t.isControl=n;var f=function(){function e(e){this.validator=e,this._pristine=!0,this._touched=!1}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this._status===t.VALID},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errors",{get:function(){return this._errors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pristine",{get:function(){return this._pristine},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touched",{get:function(){return this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"untouched",{get:function(){return!this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valueChanges",{get:function(){return this._valueChanges},enumerable:!0,configurable:!0}),e.prototype.markAsTouched=function(){this._touched=!0},e.prototype.markAsDirty=function(e){var t=(void 0===e?{}:e).onlySelf;t=c.normalizeBool(t),this._pristine=!1,c.isPresent(this._parent)&&!t&&this._parent.markAsDirty({onlySelf:t})},e.prototype.setParent=function(e){this._parent=e},e.prototype.updateValidity=function(e){var r=(void 0===e?{}:e).onlySelf;r=c.normalizeBool(r),this._errors=this.validator(this),this._status=c.isPresent(this._errors)?t.INVALID:t.VALID,c.isPresent(this._parent)&&!r&&this._parent.updateValidity({onlySelf:r})},e.prototype.updateValueAndValidity=function(e){var r=void 0===e?{}:e,n=r.onlySelf,i=r.emitEvent;n=c.normalizeBool(n),i=c.isPresent(i)?i:!0,this._updateValue(),i&&u.ObservableWrapper.callNext(this._valueChanges,this._value),this._errors=this.validator(this),this._status=c.isPresent(this._errors)?t.INVALID:t.VALID,c.isPresent(this._parent)&&!n&&this._parent.updateValueAndValidity({onlySelf:n,emitEvent:i})},e.prototype.find=function(e){return i(this,e)},e.prototype.getError=function(e,t){void 0===t&&(t=null);var r=c.isPresent(t)&&!l.ListWrapper.isEmpty(t)?this.find(t):this;return c.isPresent(r)&&c.isPresent(r._errors)?l.StringMapWrapper.get(r._errors,e):null},e.prototype.hasError=function(e,t){return void 0===t&&(t=null),c.isPresent(this.getError(e,t))},e.prototype._updateValue=function(){},e}();t.AbstractControl=f;var d=function(e){function t(t,r){void 0===t&&(t=null),void 0===r&&(r=p.Validators.nullValidator),e.call(this,r),this._value=t,this.updateValidity({onlySelf:!0}),this._valueChanges=new u.EventEmitter}return s(t,e),t.prototype.updateValue=function(e,t){var r=void 0===t?{}:t,n=r.onlySelf,i=r.emitEvent,o=r.emitModelToViewChange;o=c.isPresent(o)?o:!0,this._value=e,c.isPresent(this._onChange)&&o&&this._onChange(this._value),this.updateValueAndValidity({onlySelf:n,emitEvent:i})},t.prototype.registerOnChange=function(e){this._onChange=e},t}(f);t.Control=d;var h=function(e){function t(t,r,n){void 0===r&&(r=null),void 0===n&&(n=p.Validators.group),e.call(this,n),this.controls=t,this._optionals=c.isPresent(r)?r:{},this._valueChanges=new u.EventEmitter,this._setParentForControls(),this._value=this._reduceValue(),this.updateValidity({onlySelf:!0})}return s(t,e),t.prototype.addControl=function(e,t){this.controls[e]=t,t.setParent(this)},t.prototype.removeControl=function(e){l.StringMapWrapper["delete"](this.controls,e)},t.prototype.include=function(e){l.StringMapWrapper.set(this._optionals,e,!0),this.updateValueAndValidity()},t.prototype.exclude=function(e){l.StringMapWrapper.set(this._optionals,e,!1),this.updateValueAndValidity()},t.prototype.contains=function(e){var t=l.StringMapWrapper.contains(this.controls,e);return t&&this._included(e)},t.prototype._setParentForControls=function(){var e=this;l.StringMapWrapper.forEach(this.controls,function(t,r){t.setParent(e)})},t.prototype._updateValue=function(){this._value=this._reduceValue()},t.prototype._reduceValue=function(){return this._reduceChildren({},function(e,t,r){return e[r]=t.value,e})},t.prototype._reduceChildren=function(e,t){var r=this,n=e;return l.StringMapWrapper.forEach(this.controls,function(e,i){r._included(i)&&(n=t(n,e,i))}),n},t.prototype._included=function(e){var t=l.StringMapWrapper.contains(this._optionals,e);return!t||l.StringMapWrapper.get(this._optionals,e)},t}(f);t.ControlGroup=h;var g=function(e){function t(t,r){void 0===r&&(r=p.Validators.array),e.call(this,r),this.controls=t,this._valueChanges=new u.EventEmitter,this._setParentForControls(),this._updateValue(),this.updateValidity({onlySelf:!0})}return s(t,e),t.prototype.at=function(e){return this.controls[e]},t.prototype.push=function(e){this.controls.push(e),e.setParent(this),this.updateValueAndValidity()},t.prototype.insert=function(e,t){l.ListWrapper.insert(this.controls,e,t),t.setParent(this),this.updateValueAndValidity()},t.prototype.removeAt=function(e){l.ListWrapper.removeAt(this.controls,e),this.updateValueAndValidity()},Object.defineProperty(t.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),t.prototype._updateValue=function(){this._value=this.controls.map(function(e){return e.value})},t.prototype._setParentForControls=function(){var e=this;this.controls.forEach(function(t){t.setParent(e)})},t}(f);return t.ControlArray=g,o.define=a,r.exports}),System.register("angular2/src/core/linker",["angular2/src/core/linker/directive_resolver","angular2/src/core/linker/compiler","angular2/src/core/linker/view_manager","angular2/src/core/linker/query_list","angular2/src/core/linker/dynamic_component_loader","angular2/src/core/linker/element_ref","angular2/src/core/linker/template_ref","angular2/src/core/linker/view_ref","angular2/src/core/linker/view_container_ref","angular2/src/core/linker/dynamic_component_loader"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/linker/directive_resolver");t.DirectiveResolver=o.DirectiveResolver;var a=e("angular2/src/core/linker/compiler");t.Compiler=a.Compiler;var s=e("angular2/src/core/linker/view_manager");t.AppViewManager=s.AppViewManager;var c=e("angular2/src/core/linker/query_list");t.QueryList=c.QueryList;var u=e("angular2/src/core/linker/dynamic_component_loader");t.DynamicComponentLoader=u.DynamicComponentLoader;var l=e("angular2/src/core/linker/element_ref");t.ElementRef=l.ElementRef;var p=e("angular2/src/core/linker/template_ref");t.TemplateRef=p.TemplateRef;var f=e("angular2/src/core/linker/view_ref");t.ViewRef=f.ViewRef,t.ProtoViewRef=f.ProtoViewRef;var d=e("angular2/src/core/linker/view_container_ref");t.ViewContainerRef=d.ViewContainerRef;var h=e("angular2/src/core/linker/dynamic_component_loader");return t.ComponentRef=h.ComponentRef,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives",["angular2/src/core/facade/lang","angular2/src/core/forms/directives/ng_control_name","angular2/src/core/forms/directives/ng_form_control","angular2/src/core/forms/directives/ng_model","angular2/src/core/forms/directives/ng_control_group","angular2/src/core/forms/directives/ng_form_model","angular2/src/core/forms/directives/ng_form","angular2/src/core/forms/directives/default_value_accessor","angular2/src/core/forms/directives/checkbox_value_accessor","angular2/src/core/forms/directives/ng_control_status","angular2/src/core/forms/directives/select_control_value_accessor","angular2/src/core/forms/directives/validators","angular2/src/core/forms/directives/ng_control_name","angular2/src/core/forms/directives/ng_form_control","angular2/src/core/forms/directives/ng_model","angular2/src/core/forms/directives/ng_control","angular2/src/core/forms/directives/ng_control_group","angular2/src/core/forms/directives/ng_form_model","angular2/src/core/forms/directives/ng_form","angular2/src/core/forms/directives/default_value_accessor","angular2/src/core/forms/directives/checkbox_value_accessor","angular2/src/core/forms/directives/select_control_value_accessor","angular2/src/core/forms/directives/validators","angular2/src/core/forms/directives/ng_control_status"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/forms/directives/ng_control_name"),s=e("angular2/src/core/forms/directives/ng_form_control"),c=e("angular2/src/core/forms/directives/ng_model"),u=e("angular2/src/core/forms/directives/ng_control_group"),l=e("angular2/src/core/forms/directives/ng_form_model"),p=e("angular2/src/core/forms/directives/ng_form"),f=e("angular2/src/core/forms/directives/default_value_accessor"),d=e("angular2/src/core/forms/directives/checkbox_value_accessor"),h=e("angular2/src/core/forms/directives/ng_control_status"),g=e("angular2/src/core/forms/directives/select_control_value_accessor"),v=e("angular2/src/core/forms/directives/validators"),y=e("angular2/src/core/forms/directives/ng_control_name");t.NgControlName=y.NgControlName;var m=e("angular2/src/core/forms/directives/ng_form_control");t.NgFormControl=m.NgFormControl;var _=e("angular2/src/core/forms/directives/ng_model");t.NgModel=_.NgModel;var b=e("angular2/src/core/forms/directives/ng_control");t.NgControl=b.NgControl;var x=e("angular2/src/core/forms/directives/ng_control_group");t.NgControlGroup=x.NgControlGroup;var w=e("angular2/src/core/forms/directives/ng_form_model");t.NgFormModel=w.NgFormModel;var j=e("angular2/src/core/forms/directives/ng_form");t.NgForm=j.NgForm;var S=e("angular2/src/core/forms/directives/default_value_accessor");t.DefaultValueAccessor=S.DefaultValueAccessor;var C=e("angular2/src/core/forms/directives/checkbox_value_accessor");t.CheckboxControlValueAccessor=C.CheckboxControlValueAccessor;var E=e("angular2/src/core/forms/directives/select_control_value_accessor");t.SelectControlValueAccessor=E.SelectControlValueAccessor,t.NgSelectOption=E.NgSelectOption;var R=e("angular2/src/core/forms/directives/validators");t.DefaultValidators=R.DefaultValidators;var O=e("angular2/src/core/forms/directives/ng_control_status");return t.NgControlStatus=O.NgControlStatus,t.FORM_DIRECTIVES=o.CONST_EXPR([a.NgControlName,u.NgControlGroup,s.NgFormControl,c.NgModel,l.NgFormModel,p.NgForm,g.NgSelectOption,f.DefaultValueAccessor,d.CheckboxControlValueAccessor,g.SelectControlValueAccessor,h.NgControlStatus,v.DefaultValidators]),n.define=i,r.exports}),System.register("angular2/src/core/dom/browser_adapter",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/dom/dom_adapter","angular2/src/core/dom/generic_browser_adapter"],!0,function(e,t,r){function n(){return u.isBlank(y)&&(y=document.querySelector("base"),u.isBlank(y))?null:y.getAttribute("href")}function i(e){return u.isBlank(m)&&(m=document.createElement("a")),m.setAttribute("href",e),"/"===m.pathname.charAt(0)?m.pathname:"/"+m.pathname}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/core/facade/collection"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/dom/dom_adapter"),p=e("angular2/src/core/dom/generic_browser_adapter"),f={"class":"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},d=3,h={"\b":"Backspace"," ":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},g={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"},v=function(e){function t(){e.apply(this,arguments)}return s(t,e),t.prototype.parse=function(e){throw new Error("parse not implemented")},t.makeCurrent=function(){l.setRootDomAdapter(new t)},t.prototype.hasProperty=function(e,t){return t in e},t.prototype.setProperty=function(e,t,r){e[t]=r},t.prototype.getProperty=function(e,t){return e[t]},t.prototype.invoke=function(e,t,r){e[t].apply(e,r)},t.prototype.logError=function(e){window.console.error?window.console.error(e):window.console.log(e)},t.prototype.log=function(e){window.console.log(e)},t.prototype.logGroup=function(e){window.console.group?(window.console.group(e),this.logError(e)):window.console.log(e)},t.prototype.logGroupEnd=function(){window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return f},enumerable:!0,configurable:!0}),t.prototype.query=function(e){return document.querySelector(e)},t.prototype.querySelector=function(e,t){return e.querySelector(t)},t.prototype.querySelectorAll=function(e,t){return e.querySelectorAll(t)},t.prototype.on=function(e,t,r){e.addEventListener(t,r,!1)},t.prototype.onAndCancel=function(e,t,r){return e.addEventListener(t,r,!1),function(){e.removeEventListener(t,r,!1)}},t.prototype.dispatchEvent=function(e,t){e.dispatchEvent(t)},t.prototype.createMouseEvent=function(e){var t=document.createEvent("MouseEvent");return t.initEvent(e,!0,!0),t},t.prototype.createEvent=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t},t.prototype.preventDefault=function(e){e.preventDefault(),e.returnValue=!1},t.prototype.isPrevented=function(e){return e.defaultPrevented||u.isPresent(e.returnValue)&&!e.returnValue},t.prototype.getInnerHTML=function(e){return e.innerHTML},t.prototype.getOuterHTML=function(e){return e.outerHTML},t.prototype.nodeName=function(e){return e.nodeName},t.prototype.nodeValue=function(e){return e.nodeValue},t.prototype.type=function(e){return e.type},t.prototype.content=function(e){return this.hasProperty(e,"content")?e.content:e},t.prototype.firstChild=function(e){return e.firstChild},t.prototype.nextSibling=function(e){return e.nextSibling},t.prototype.parentElement=function(e){return e.parentNode},t.prototype.childNodes=function(e){return e.childNodes},t.prototype.childNodesAsList=function(e){for(var t=e.childNodes,r=c.ListWrapper.createFixedSize(t.length),n=0;n<t.length;n++)r[n]=t[n];return r},t.prototype.clearNodes=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},t.prototype.appendChild=function(e,t){e.appendChild(t)},t.prototype.removeChild=function(e,t){e.removeChild(t)},t.prototype.replaceChild=function(e,t,r){e.replaceChild(t,r)},t.prototype.remove=function(e){return e.parentNode&&e.parentNode.removeChild(e),e},t.prototype.insertBefore=function(e,t){e.parentNode.insertBefore(t,e)},t.prototype.insertAllBefore=function(e,t){c.ListWrapper.forEach(t,function(t){e.parentNode.insertBefore(t,e)})},t.prototype.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},t.prototype.setInnerHTML=function(e,t){e.innerHTML=t},t.prototype.getText=function(e){return e.textContent},t.prototype.setText=function(e,t){e.textContent=t},t.prototype.getValue=function(e){return e.value},t.prototype.setValue=function(e,t){e.value=t},t.prototype.getChecked=function(e){return e.checked},t.prototype.setChecked=function(e,t){e.checked=t},t.prototype.createComment=function(e){return document.createComment(e)},t.prototype.createTemplate=function(e){var t=document.createElement("template");return t.innerHTML=e,t},t.prototype.createElement=function(e,t){return void 0===t&&(t=document),t.createElement(e)},t.prototype.createTextNode=function(e,t){return void 0===t&&(t=document),t.createTextNode(e)},t.prototype.createScriptTag=function(e,t,r){void 0===r&&(r=document);var n=r.createElement("SCRIPT");return n.setAttribute(e,t),n},t.prototype.createStyleElement=function(e,t){void 0===t&&(t=document);var r=t.createElement("style");return this.appendChild(r,this.createTextNode(e)),r},t.prototype.createShadowRoot=function(e){return e.createShadowRoot()},t.prototype.getShadowRoot=function(e){return e.shadowRoot},t.prototype.getHost=function(e){return e.host},t.prototype.clone=function(e){return e.cloneNode(!0)},t.prototype.getElementsByClassName=function(e,t){return e.getElementsByClassName(t)},t.prototype.getElementsByTagName=function(e,t){return e.getElementsByTagName(t)},t.prototype.classList=function(e){return Array.prototype.slice.call(e.classList,0)},t.prototype.addClass=function(e,t){e.classList.add(t)},t.prototype.removeClass=function(e,t){e.classList.remove(t)},t.prototype.hasClass=function(e,t){return e.classList.contains(t)},t.prototype.setStyle=function(e,t,r){e.style[t]=r},t.prototype.removeStyle=function(e,t){e.style[t]=null},t.prototype.getStyle=function(e,t){return e.style[t]},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,r=e.attributes,n=0;n<r.length;n++){var i=r[n];t.set(i.name,i.value)}return t},t.prototype.hasAttribute=function(e,t){return e.hasAttribute(t)},t.prototype.getAttribute=function(e,t){return e.getAttribute(t)},t.prototype.setAttribute=function(e,t,r){e.setAttribute(t,r)},t.prototype.removeAttribute=function(e,t){e.removeAttribute(t)},t.prototype.templateAwareRoot=function(e){return this.isTemplateElement(e)?this.content(e):e},t.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},t.prototype.defaultDoc=function(){return document},t.prototype.getBoundingClientRect=function(e){try{return e.getBoundingClientRect()}catch(t){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},t.prototype.getTitle=function(){return document.title},t.prototype.setTitle=function(e){document.title=e||""},t.prototype.elementMatches=function(e,t){var r=!1;return e instanceof HTMLElement&&(e.matches?r=e.matches(t):e.msMatchesSelector?r=e.msMatchesSelector(t):e.webkitMatchesSelector&&(r=e.webkitMatchesSelector(t))),r},t.prototype.isTemplateElement=function(e){return e instanceof HTMLElement&&"TEMPLATE"==e.nodeName},t.prototype.isTextNode=function(e){return e.nodeType===Node.TEXT_NODE},t.prototype.isCommentNode=function(e){return e.nodeType===Node.COMMENT_NODE},t.prototype.isElementNode=function(e){return e.nodeType===Node.ELEMENT_NODE},t.prototype.hasShadowRoot=function(e){return e instanceof HTMLElement&&u.isPresent(e.shadowRoot)},t.prototype.isShadowRoot=function(e){return e instanceof DocumentFragment},t.prototype.importIntoDoc=function(e){var t=e;return this.isTemplateElement(e)&&(t=this.content(e)),document.importNode(t,!0)},t.prototype.adoptNode=function(e){return document.adoptNode(e)},t.prototype.isPageRule=function(e){return e.type===CSSRule.PAGE_RULE},t.prototype.isStyleRule=function(e){return e.type===CSSRule.STYLE_RULE},t.prototype.isMediaRule=function(e){return e.type===CSSRule.MEDIA_RULE},t.prototype.isKeyframesRule=function(e){return e.type===CSSRule.KEYFRAMES_RULE},t.prototype.getHref=function(e){return e.href},t.prototype.getEventKey=function(e){var t=e.key;if(u.isBlank(t)){if(t=e.keyIdentifier,u.isBlank(t))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),e.location===d&&g.hasOwnProperty(t)&&(t=g[t]))}return h.hasOwnProperty(t)&&(t=h[t]),t},t.prototype.getGlobalEventTarget=function(e){return"window"==e?window:"document"==e?document:"body"==e?document.body:void 0},t.prototype.getHistory=function(){return window.history},t.prototype.getLocation=function(){return window.location},t.prototype.getBaseHref=function(){var e=n();return u.isBlank(e)?null:i(e)},t.prototype.resetBaseElement=function(){y=null},t.prototype.getUserAgent=function(){return window.navigator.userAgent},t.prototype.setData=function(e,t,r){this.setAttribute(e,"data-"+t,r)},t.prototype.getData=function(e,t){return this.getAttribute(e,"data-"+t)},t.prototype.getComputedStyle=function(e){return getComputedStyle(e)},t.prototype.setGlobalVar=function(e,t){u.setValueOnPath(u.global,e,t)},t.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){window.cancelAnimationFrame(e)},t.prototype.performanceNow=function(){return u.isPresent(window.performance)&&u.isPresent(window.performance.now)?window.performance.now():u.DateWrapper.toMillis(u.DateWrapper.now())},t}(p.GenericBrowserDomAdapter);t.BrowserDomAdapter=v;var y=null,m=null;return o.define=a,r.exports}),System.register("angular2/src/core/testability/browser_testability",["angular2/src/core/testability/testability","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/testability/testability"),a=e("angular2/src/core/facade/lang"),s=function(){function e(e){this._testability=e}return e.prototype.isStable=function(){
return this._testability.isStable()},e.prototype.whenStable=function(e){this._testability.whenStable(e)},e.prototype.findBindings=function(e,t,r){return this._testability.findBindings(e,t,r)},e}(),c=function(){function e(){}return e.init=function(){o.setTestabilityGetter(new e)},e.prototype.addToWindow=function(e){a.global.getAngularTestability=function(t,r){void 0===r&&(r=!0);var n=e.findTestabilityInTree(t,r);if(null==n)throw new Error("Could not find testability for element.");return new s(n)},a.global.getAllAngularTestabilities=function(){var t=e.getAllTestabilities();return t.map(function(e){return new s(e)})}},e}();return t.BrowserGetTestability=c,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/events/hammer_gestures",["angular2/src/core/render/dom/events/hammer_common","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/render/dom/events/hammer_common"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/di"),f=function(e){function t(){e.apply(this,arguments)}return o(t,e),t.prototype.supports=function(t){if(!e.prototype.supports.call(this,t))return!1;if(!u.isPresent(window.Hammer))throw new l.BaseException("Hammer.js is not loaded, can not bind "+t+" event");return!0},t.prototype.addEventListener=function(e,t,r){var n=this.manager.getZone();t=t.toLowerCase(),n.runOutsideAngular(function(){var i=new Hammer(e);i.get("pinch").set({enable:!0}),i.get("rotate").set({enable:!0}),i.on(t,function(e){n.run(function(){r(e)})})})},t=a([p.Injectable(),s("design:paramtypes",[])],t)}(c.HammerGesturesPluginCommon);return t.HammerGesturesPlugin=f,n.define=i,r.exports}),System.register("angular2/src/core/application_ref",["angular2/src/core/zone/ng_zone","angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/application_tokens","angular2/src/core/facade/async","angular2/src/core/facade/collection","angular2/src/core/reflection/reflection","angular2/src/core/testability/testability","angular2/src/core/linker/dynamic_component_loader","angular2/src/core/facade/exceptions","angular2/src/core/dom/dom_adapter","angular2/src/core/linker/view_ref","angular2/src/core/life_cycle/life_cycle","angular2/src/core/change_detection/change_detection","angular2/src/core/linker/view_pool","angular2/src/core/linker/view_manager","angular2/src/core/linker/view_manager_utils","angular2/src/core/linker/view_listener","angular2/src/core/linker/proto_view_factory","angular2/src/core/pipes","angular2/src/core/linker/view_resolver","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/pipe_resolver","angular2/src/core/linker/compiler"],!0,function(e,t,r){function n(){return[f.bind(v.Reflector).toValue(v.reflector),y.TestabilityRegistry]}function i(e){return[f.bind(d.APP_COMPONENT).toValue(e),f.bind(d.APP_COMPONENT_REF_PROMISE).toFactory(function(t,r){return t.loadAsRoot(e,null,r).then(function(e){return p.isPresent(e.location.nativeElement)&&r.get(y.TestabilityRegistry).registerApplication(e.location.nativeElement,r.get(y.Testability)),e})},[m.DynamicComponentLoader,f.Injector]),f.bind(e).toFactory(function(e){return e.then(function(e){return e.instance})},[d.APP_COMPONENT_REF_PROMISE])]}function o(){return[k.Compiler,d.APP_ID_RANDOM_BINDING,S.AppViewPool,f.bind(S.APP_VIEW_POOL_CAPACITY).toValue(1e4),C.AppViewManager,E.AppViewManagerUtils,R.AppViewListener,O.ProtoViewFactory,I.ViewResolver,P.DEFAULT_PIPES,f.bind(j.IterableDiffers).toValue(j.defaultIterableDiffers),f.bind(j.KeyValueDiffers).toValue(j.defaultKeyValueDiffers),D.DirectiveResolver,T.PipeResolver,m.DynamicComponentLoader,f.bind(w.LifeCycle).toFactory(function(e){return new w.LifeCycle(null,p.assertionsEnabled())},[_.ExceptionHandler])]}function a(){return new l.NgZone({enableLongStackTrace:p.assertionsEnabled()})}function s(e,t){if(p.isPresent(M)){if(p.isBlank(e))return M;throw"platform() can only be called once per page"}return p.isPresent(t)&&t(),p.isBlank(e)&&(e=n()),M=new A(f.Injector.resolveAndCreate(e),function(){M=null})}var c=System.global,u=c.define;c.define=void 0;var l=e("angular2/src/core/zone/ng_zone"),p=e("angular2/src/core/facade/lang"),f=e("angular2/src/core/di"),d=e("angular2/src/core/application_tokens"),h=e("angular2/src/core/facade/async"),g=e("angular2/src/core/facade/collection"),v=e("angular2/src/core/reflection/reflection"),y=e("angular2/src/core/testability/testability"),m=e("angular2/src/core/linker/dynamic_component_loader"),_=e("angular2/src/core/facade/exceptions"),b=e("angular2/src/core/dom/dom_adapter"),x=e("angular2/src/core/linker/view_ref"),w=e("angular2/src/core/life_cycle/life_cycle"),j=e("angular2/src/core/change_detection/change_detection"),S=e("angular2/src/core/linker/view_pool"),C=e("angular2/src/core/linker/view_manager"),E=e("angular2/src/core/linker/view_manager_utils"),R=e("angular2/src/core/linker/view_listener"),O=e("angular2/src/core/linker/proto_view_factory"),P=e("angular2/src/core/pipes"),I=e("angular2/src/core/linker/view_resolver"),D=e("angular2/src/core/linker/directive_resolver"),T=e("angular2/src/core/linker/pipe_resolver"),k=e("angular2/src/core/linker/compiler");t.platformBindings=n,t.applicationCommonBindings=o,t.createNgZone=a;var M;t.platformCommon=s;var A=function(){function e(e,t){this._injector=e,this._dispose=t,this._applications=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),e.prototype.application=function(e){var t=this._initApp(a(),e);return t},e.prototype.asyncApplication=function(e){var t=this,r=a(),n=h.PromiseWrapper.completer();return r.run(function(){h.PromiseWrapper.then(e(r),function(e){n.resolve(t._initApp(r,e))})}),n.promise},e.prototype._initApp=function(e,t){var r,n=this;e.run(function(){t.push(f.bind(l.NgZone).toValue(e)),t.push(f.bind(N).toValue(n));var i;try{r=n.injector.resolveAndCreateChild(t),i=r.get(_.ExceptionHandler),e.overrideOnErrorHandler(function(e,t){return i.call(e,t)})}catch(o){p.isPresent(i)?i.call(o,o.stack):b.DOM.logError(o)}});var i=new N(this,e,r);return this._applications.push(i),i},e.prototype.dispose=function(){this._applications.forEach(function(e){return e.dispose()}),this._dispose()},e.prototype._applicationDisposed=function(e){g.ListWrapper.remove(this._applications,e)},e}();t.PlatformRef=A;var N=function(){function e(e,t,r){this._platform=e,this._zone=t,this._injector=r,this._bootstrapListeners=[],this._rootComponents=[]}return e.prototype.registerBootstrapListener=function(e){this._bootstrapListeners.push(e)},e.prototype.bootstrap=function(e,t){var r=this,n=h.PromiseWrapper.completer();return this._zone.run(function(){var o=i(e);p.isPresent(t)&&o.push(t);var a=r._injector.get(_.ExceptionHandler);try{var s=r._injector.resolveAndCreateChild(o),c=s.get(d.APP_COMPONENT_REF_PROMISE),u=function(e){var t=x.internalView(e.hostView).changeDetector,i=s.get(w.LifeCycle);i.registerWith(r._zone,t),i.tick(),n.resolve(e),r._rootComponents.push(e),r._bootstrapListeners.forEach(function(t){return t(e)})},l=h.PromiseWrapper.then(c,u);h.PromiseWrapper.then(l,function(e){}),h.PromiseWrapper.then(l,null,function(e,t){return n.reject(e,t)})}catch(f){a.call(f,f.stack),n.reject(f,f.stack)}}),n.promise},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._rootComponents.forEach(function(e){return e.dispose()}),this._platform._applicationDisposed(this)},e}();return t.ApplicationRef=N,c.define=u,r.exports}),System.register("angular2/src/core/services",["angular2/src/core/compiler/app_root_url","angular2/src/core/compiler/url_resolver","angular2/src/core/services/title"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/compiler/app_root_url");t.AppRootUrl=o.AppRootUrl;var a=e("angular2/src/core/compiler/url_resolver");t.UrlResolver=a.UrlResolver;var s=e("angular2/src/core/services/title");return t.Title=s.Title,n.define=i,r.exports}),System.register("angular2/src/core/directives",["angular2/src/core/facade/lang","angular2/src/core/directives/ng_class","angular2/src/core/directives/ng_for","angular2/src/core/directives/ng_if","angular2/src/core/directives/ng_style","angular2/src/core/directives/ng_switch","angular2/src/core/directives/ng_class","angular2/src/core/directives/ng_for","angular2/src/core/directives/ng_if","angular2/src/core/directives/ng_style","angular2/src/core/directives/ng_switch","angular2/src/core/directives/observable_list_diff"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/directives/ng_class"),c=e("angular2/src/core/directives/ng_for"),u=e("angular2/src/core/directives/ng_if"),l=e("angular2/src/core/directives/ng_style"),p=e("angular2/src/core/directives/ng_switch"),f=e("angular2/src/core/directives/ng_class");t.NgClass=f.NgClass;var d=e("angular2/src/core/directives/ng_for");t.NgFor=d.NgFor;var h=e("angular2/src/core/directives/ng_if");t.NgIf=h.NgIf;var g=e("angular2/src/core/directives/ng_style");t.NgStyle=g.NgStyle;var v=e("angular2/src/core/directives/ng_switch");return t.NgSwitch=v.NgSwitch,t.NgSwitchWhen=v.NgSwitchWhen,t.NgSwitchDefault=v.NgSwitchDefault,n(e("angular2/src/core/directives/observable_list_diff")),t.CORE_DIRECTIVES=a.CONST_EXPR([s.NgClass,c.NgFor,u.NgIf,l.NgStyle,p.NgSwitch,p.NgSwitchWhen,p.NgSwitchDefault]),i.define=o,r.exports}),System.register("angular2/src/core/debug",["angular2/src/core/debug/debug_element","angular2/src/core/debug/debug_element_view_listener"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0,n(e("angular2/src/core/debug/debug_element"));var a=e("angular2/src/core/debug/debug_element_view_listener");return t.inspectNativeElement=a.inspectNativeElement,t.ELEMENT_PROBE_BINDINGS=a.ELEMENT_PROBE_BINDINGS,i.define=o,r.exports}),System.register("angular2/src/http/http_utils",["angular2/src/core/facade/lang","angular2/src/http/enums","angular2/src/core/facade/exceptions","angular2/src/core/facade/lang"],!0,function(e,t,r){function n(e){if(a.isString(e)){var t=e;if(e=e.replace(/(\w)(\w*)/g,function(e,t,r){return t.toUpperCase()+r.toLowerCase()}),e=s.RequestMethods[e],"number"!=typeof e)throw c.makeTypeError('Invalid request method. The method "'+t+'" is not supported.')}return e}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/http/enums"),c=e("angular2/src/core/facade/exceptions");t.normalizeMethodName=n;var u=e("angular2/src/core/facade/lang");return t.isJsObject=u.isJsObject,i.define=o,r.exports}),System.register("angular2/src/http/base_request_options",["angular2/src/core/facade/lang","angular2/src/http/headers","angular2/src/http/enums","angular2/src/core/di","angular2/src/http/url_search_params","angular2/src/http/http_utils"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/http/headers"),l=e("angular2/src/http/enums"),p=e("angular2/src/core/di"),f=e("angular2/src/http/url_search_params"),d=e("angular2/src/http/http_utils"),h=function(){function e(e){var t=void 0===e?{}:e,r=t.method,n=t.headers,i=t.body,o=t.url,a=t.search;this.method=c.isPresent(r)?d.normalizeMethodName(r):null,this.headers=c.isPresent(n)?n:null,this.body=c.isPresent(i)?i:null,this.url=c.isPresent(o)?o:null,this.search=c.isPresent(a)?c.isString(a)?new f.URLSearchParams(a):a:null}return e.prototype.merge=function(t){return new e({method:c.isPresent(t)&&c.isPresent(t.method)?t.method:this.method,headers:c.isPresent(t)&&c.isPresent(t.headers)?t.headers:this.headers,body:c.isPresent(t)&&c.isPresent(t.body)?t.body:this.body,url:c.isPresent(t)&&c.isPresent(t.url)?t.url:this.url,search:c.isPresent(t)&&c.isPresent(t.search)?c.isString(t.search)?new f.URLSearchParams(t.search):t.search.clone():this.search})},e}();t.RequestOptions=h;var g=function(e){function t(){e.call(this,{method:l.RequestMethods.Get,headers:new u.Headers})}return o(t,e),t=a([p.Injectable(),s("design:paramtypes",[])],t)}(h);return t.BaseRequestOptions=g,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/TestScheduler",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/VirtualTimeScheduler","@reactivex/rxjs/dist/cjs/Notification","@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/VirtualTimeScheduler"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Notification"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/Subject"),g=n(h),v=function(e){function t(r){i(this,t),e.call(this),this.assertDeepEqual=r,this.flushTests=[]}return o(t,e),t.prototype.createColdObservable=function(e,r,n){var i=this;if(-1!==e.indexOf("^"))throw new Error('cold observable cannot have subscription offset "^"');var o=t.parseMarbles(e,r,n);return u["default"].create(function(e){o.forEach(function(t){var r=t.notification,n=t.frame;i.schedule(function(){r.observe(e)},n)},i)})},t.prototype.createHotObservable=function(e,r,n){var i=this,o=t.parseMarbles(e,r,n),a=new g["default"];return o.forEach(function(e){var t=e.notification,r=e.frame;i.schedule(function(){t.observe(a)},r)},this),a},t.prototype.expect=function(e){var r=this,n=[],i={observable:e,actual:n,marbles:null,ready:!1};return this.schedule(function(){e.subscribe(function(e){n.push({frame:r.frame,notification:d["default"].createNext(e)})},function(e){n.push({frame:r.frame,notification:d["default"].createError(e)})},function(){n.push({frame:r.frame,notification:d["default"].createComplete()})})},0),this.flushTests.push(i),{toBe:function(e,r,n){i.ready=!0,i.marbles=e,i.expected=t.parseMarbles(e,r,n)}}},t.prototype.flush=function(){e.prototype.flush.call(this);for(var t=this.flushTests.filter(function(e){return e.ready});t.length>0;){var r=t.shift();this.assertDeepEqual(r.actual,r.expected)}},t.parseMarbles=function(e,t,r){for(var n=e.length,i=[],o=e.indexOf("^"),a=-1===o?0:-10*o,s=0;n>s;s++){var c=10*s,u=void 0,l=e[s];switch(l){case"-":break;case"|":u=d["default"].createComplete();break;case"^":break;case"#":u=d["default"].createError(r||"error");break;default:u=d["default"].createNext(t[l])}c+=a,u&&i.push({notification:u,frame:c})}return i},t}(p["default"]);return t["default"]=v,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction","@reactivex/rxjs/dist/cjs/schedulers/FutureAction"],!0,function(e,t,r){function n(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")}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/schedulers/FutureAction"),l=n(u),p=function(){function e(){i(this,e),this.actions=[],this.active=!1,this.scheduled=!1}return e.prototype.now=function(){return Date.now()},e.prototype.flush=function(){if(!this.active&&!this.scheduled){this.active=!0;for(var e=this.actions,t=void 0;t=e.shift();)t.execute();this.active=!1}},e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),0>=t?this.scheduleNow(e,r):this.scheduleLater(e,t,r)},e.prototype.scheduleNow=function(e,t){return new c["default"](this,e).schedule(t)},e.prototype.scheduleLater=function(e,t,r){return new l["default"](this,e).schedule(r,t)},e}();return t["default"]=p,r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction",["@reactivex/rxjs/dist/cjs/util/Immediate","@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/Immediate"),u=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),l=n(u),p=function(e){function t(){i(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.schedule=function(e){var t=this;if(this.isUnsubscribed)return this;this.state=e;var r=this.scheduler;return r.actions.push(this),r.scheduled||(r.scheduled=!0,this.id=c.Immediate.setImmediate(function(){t.id=void 0,t.scheduler.scheduled=!1,t.scheduler.flush()})),this},t.prototype.unsubscribe=function(){var t=this.id,r=this.scheduler;e.prototype.unsubscribe.call(this),0===r.actions.length&&(r.active=!1,r.scheduled=!1,t&&(this.id=void 0,c.Immediate.clearImmediate(t)))},t}(l["default"]);return t["default"]=p,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/ArrayObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/observables/ScalarObservable","@reactivex/rxjs/dist/cjs/observables/EmptyObservable"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/observables/ScalarObservable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"),d=n(f),h=function(e){function t(r,n){i(this,t),e.call(this),this.array=r,this.scheduler=n}return o(t,e),t.create=function(e,r){return new t(e,r)},t.of=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];var i=r[r.length-1];i&&"function"==typeof i.schedule?r.pop():i=void 0;var o=r.length;return o>1?new t(r,i):1===o?new p["default"](r[0],i):new d["default"](i)},t.dispatch=function(e){var t=e.array,r=e.index,n=e.count,i=e.subscriber;return r>=n?void i.complete():(i.next(t[r]),void(i.isUnsubscribed||(e.index=r+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,n=this.array,i=n.length,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{array:n,index:r,count:i,subscriber:e}));else for(;;){if(r>=i){e.complete();break}if(e.next(n[r++]),e.isUnsubscribed)break}},t}(u["default"]);return t["default"]=h,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/util/tryCatch",["@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(){try{return s.apply(this,arguments)}catch(e){return c.errorObject.e=e,c.errorObject}}function i(e){return s=e,n}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s,c=e("@reactivex/rxjs/dist/cjs/util/errorObject");return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/IntervalObservable",["@reactivex/rxjs/dist/cjs/util/isNumeric","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/schedulers/nextTick"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/util/isNumeric"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Observable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),d=n(f),h=function(e){function t(){var r=arguments.length<=0||void 0===arguments[0]?0:arguments[0],n=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];i(this,t),e.call(this),this.period=r,this.scheduler=n,(!u["default"](r)||0>r)&&(this.period=0),n&&"function"==typeof n.schedule||(this.scheduler=d["default"])}return o(t,e),t.create=function(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0],r=arguments.length<=1||void 0===arguments[1]?d["default"]:arguments[1];return new t(e,r)},t.dispatch=function(e){var t=e.index,r=e.subscriber,n=e.period;r.next(t),r.isUnsubscribed||(e.index+=1,this.schedule(e,n))},t.prototype._subscribe=function(e){var r=0,n=this.period,i=this.scheduler;e.add(i.schedule(t.dispatch,n,{index:r,subscriber:e,period:n}))},t}(p["default"]);return t["default"]=h,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/IteratorObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/util/root","@reactivex/rxjs/dist/cjs/util/Symbol_iterator","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(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("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){var t=e[v["default"]];if(!t&&"string"==typeof e)return new w(e);if(!t&&void 0!==e.length)return new j(e);if(!t)throw new TypeError("Object is not iterable");return e[v["default"]]()}function s(e){var t=+e.length;return isNaN(t)?0:0!==t&&c(t)?(t=u(t)*Math.floor(Math.abs(t)),0>=t?0:t>x?x:t):t}function c(e){return"number"==typeof e&&h.root.isFinite(e)}function u(e){var t=+e;return 0===t?t:isNaN(t)?t:0>t?-1:1}var l=System.global,p=l.define;l.define=void 0,t.__esModule=!0;var f=e("@reactivex/rxjs/dist/cjs/Observable"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/root"),g=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),v=n(g),y=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),m=n(y),_=e("@reactivex/rxjs/dist/cjs/util/errorObject"),b=function(e){function t(r,n,o,a){i(this,t),e.call(this),this.iterator=r,this.project=n,this.thisArg=o,this.scheduler=a}return o(t,e),t.create=function(e,r,n,i){if(null==e)throw new Error("iterator cannot be null.");if(r&&"function"!=typeof r)throw new Error("When provided, `project` must be a function.");return new t(e,r,n,i)},t.dispatch=function(e){var t=e.index,r=e.hasError,n=e.thisArg,i=e.project,o=e.iterator,a=e.subscriber;if(r)return void a.error(e.error);var s=o.next();return s.done?void a.complete():(i?(s=m["default"](i).call(n,s.value,t),s===_.errorObject?(e.error=_.errorObject.e,e.hasError=!0):(a.next(s),e.index=t+1)):(a.next(s.value),e.index=t+1),void(a.isUnsubscribed||this.schedule(e)))},t.prototype._subscribe=function(e){var r=0,n=this.project,i=this.thisArg,o=a(Object(this.iterator)),s=this.scheduler;if(s)e.add(s.schedule(t.dispatch,0,{index:r,thisArg:i,project:n,iterator:o,subscriber:e}));else for(;;){var c=o.next();if(c.done){e.complete();break}if(n){if(c=m["default"](n).call(i,c.value,r++),c===_.errorObject){e.error(_.errorObject.e);break}e.next(c)}else e.next(c.value);if(e.isUnsubscribed)break}},t}(d["default"]);t["default"]=b;var x=Math.pow(2,53)-1,w=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?t.length:arguments[2];return function(){i(this,e),this.str=t,this.idx=r,this.len=n}.apply(this,arguments)}return e.prototype[v["default"]]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},e}(),j=function(){function e(t){var r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?s(t):arguments[2];return function(){i(this,e),this.arr=t,this.idx=r,this.len=n}.apply(this,arguments)}return e.prototype[v["default"]]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},e}();return r.exports=t["default"],l.define=p,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/merge-static",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/merge-support","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=Number.POSITIVE_INFINITY,t=p["default"],r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];var o=n[n.length-1];return"function"==typeof o.schedule?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof o&&(e=n.pop()),1===n.length?n[0]:new c["default"](n,t).lift(new u.MergeOperator(e))}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/merge-support"),l=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),p=n(l);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatMap",["@reactivex/rxjs/dist/cjs/operators/flatMap-support"],!0,function(e,t,r){function n(e,t){return this.lift(new a.FlatMapOperator(e,t,1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/flatMap-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concatMapTo",["@reactivex/rxjs/dist/cjs/operators/flatMapTo-support"],!0,function(e,t,r){function n(e,t){return this.lift(new a.FlatMapToOperator(e,t,1))}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0,t["default"]=n;var a=e("@reactivex/rxjs/dist/cjs/operators/flatMapTo-support");return r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/map",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject","@reactivex/rxjs/dist/cjs/util/bindCallback"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return this.lift(new v(e,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/errorObject"),h=e("@reactivex/rxjs/dist/cjs/util/bindCallback"),g=n(h),v=function(){function e(t,r){o(this,e),this.project=g["default"](t,r,2)}return e.prototype.call=function(e){return new y(e,this.project)},e}(),y=function(e){function t(r,n){o(this,t),e.call(this,r),this.count=0,this.project=n}return i(t,e),t.prototype._next=function(e){var t=f["default"](this.project)(e,this.count++);t===d.errorObject?this.error(d.errorObject.e):this.destination.next(t)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest-support",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/zip-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),new p["default"](t).lift(new d(n))}function s(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),t.unshift(this),new p["default"](t).lift(new d(n))}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t.combineLatest=a,t.combineLatestProto=s;var l=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/operators/zip-support"),d=function(){function e(t){o(this,e),this.project=t}return e.prototype.call=function(e){return new h(e,this.project)},e}();t.CombineLatestOperator=d;var h=function(e){function t(r,n){o(this,t),e.call(this,r,n,[]),this.limit=0}return i(t,e),t.prototype._subscribeInner=function(e,t,r,n){return e._subscribe(new g(this.destination,this,t,r,n))},t.prototype._innerComplete=function(e){0===(this.active-=1)&&this.destination.complete()},t}(f.ZipSubscriber);t.CombineLatestSubscriber=h;var g=function(e){function t(r,n,i,a,s){
o(this,t),e.call(this,r,n,i,a,s)}return i(t,e),t.prototype._next=function(e){var t=this.index,r=this.total,n=this.parent,i=this.values,o=i[t],a=void 0;o?(o[0]=e,a=n.limit):(a=n.limit+=1,i[t]=[e]),a>=r&&this._projectNext(i,n.project)},t}(f.ZipInnerSubscriber);return t.CombineLatestInnerSubscriber=g,c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/zip",["@reactivex/rxjs/dist/cjs/operators/zip-static"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return t.unshift(this),c["default"].apply(this,t)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/operators/zip-static"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/publish",["@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/operators/multicast"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){return new u["default"]}function o(){return p["default"].call(this,i)}var a=System.global,s=a.define;a.define=void 0,t.__esModule=!0,t["default"]=o;var c=e("@reactivex/rxjs/dist/cjs/Subject"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/operators/multicast"),p=n(l);return r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/subscribeOn",["@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return new c["default"](this,t,e)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/SubscribeOnObservable"),c=n(s);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/partition",["@reactivex/rxjs/dist/cjs/util/not","@reactivex/rxjs/dist/cjs/operators/filter"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return[l["default"].call(this,e),l["default"].call(this,c["default"](e,t))]}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/util/not"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/filter"),l=n(u);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/timeout",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/schedulers/immediate","@reactivex/rxjs/dist/cjs/util/isDate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?d["default"]:arguments[2],n=g["default"](e)?+e-Date.now():e;return this.lift(new v(n,t,r))}function s(e){var t=e.subscriber;t.sendTimeoutError()}var c=System.global,u=c.define;c.define=void 0,t.__esModule=!0,t["default"]=a;var l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/isDate"),g=n(h),v=function(){function e(t,r,n){o(this,e),this.waitFor=t,this.errorToSend=r,this.scheduler=n}return e.prototype.call=function(e){return new y(e,this.waitFor,this.errorToSend,this.scheduler)},e}(),y=function(e){function t(r,n,i,a){o(this,t),e.call(this,r),this.waitFor=n,this.errorToSend=i,this.scheduler=a;var c=n;a.schedule(s,c,{subscriber:this})}return i(t,e),t.prototype.sendTimeoutError=function(){this.error(this.errorToSend||new Error("timeout"))},t}(p["default"]);return r.exports=t["default"],c.define=u,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/groupBy",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/Map","@reactivex/rxjs/dist/cjs/util/FastMap","@reactivex/rxjs/dist/cjs/subjects/GroupSubject","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return this.lift(new b(e,r,t))}var s=System.global,c=s.define;s.define=void 0,t.__esModule=!0,t["default"]=a;var u=e("@reactivex/rxjs/dist/cjs/Subscriber"),l=n(u),p=e("@reactivex/rxjs/dist/cjs/util/Map"),f=n(p),d=e("@reactivex/rxjs/dist/cjs/util/FastMap"),h=n(d),g=e("@reactivex/rxjs/dist/cjs/subjects/GroupSubject"),v=n(g),y=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),m=n(y),_=e("@reactivex/rxjs/dist/cjs/util/errorObject"),b=function(){function e(t,r,n){o(this,e),this.keySelector=t,this.durationSelector=r,this.elementSelector=n}return e.prototype.call=function(e){return new x(e,this.keySelector,this.durationSelector,this.elementSelector)},e}(),x=function(e){function t(r,n,i,a){o(this,t),e.call(this,r),this.keySelector=n,this.durationSelector=i,this.elementSelector=a,this.groups=null}return i(t,e),t.prototype._next=function(e){var t=m["default"](this.keySelector)(e);if(t===_.errorObject)this.error(t.e);else{var r=this.groups,n=this.elementSelector,i=this.durationSelector;r||(r=this.groups="string"==typeof t?new h["default"]:new f["default"]);var o=r.get(t);if(!o){if(r.set(t,o=new v["default"](t)),i){var a=m["default"](i)(o);a===_.errorObject?this.error(a.e):this.add(a._subscribe(new w(o,this)))}this.destination.next(o)}if(n){var s=m["default"](n)(e);s===_.errorObject?o.error(s.e):o.next(s)}else o.next(e)}},t.prototype._error=function(e){var t=this,r=this.groups;r&&r.forEach(function(r,n){r.error(e),t.removeGroup(n)}),this.destination.error(e)},t.prototype._complete=function(){var e=this,t=this.groups;t&&t.forEach(function(t,r){t.complete(),e.removeGroup(t)}),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups[e]=null},t}(l["default"]),w=function(e){function t(r,n){o(this,t),e.call(this,null),this.group=r,this.parent=n}return i(t,e),t.prototype._next=function(e){var t=this.group;t.complete(),this.parent.removeGroup(t.key)},t.prototype._error=function(e){var t=this.group;t.error(e),this.parent.removeGroup(t.key)},t.prototype._complete=function(){var e=this.group;e.complete(),this.parent.removeGroup(e.key)},t}(l["default"]);return r.exports=t["default"],s.define=c,r.exports}),System.register("angular2/src/http/backends/jsonp_backend",["angular2/src/http/enums","angular2/src/http/static_response","angular2/src/http/base_response_options","angular2/src/core/di","angular2/src/http/backends/browser_jsonp","angular2/src/core/facade/exceptions","angular2/src/core/facade/lang","@reactivex/rxjs/dist/cjs/Rx"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/http/enums"),c=e("angular2/src/http/static_response"),u=e("angular2/src/http/base_response_options"),l=e("angular2/src/core/di"),p=e("angular2/src/http/backends/browser_jsonp"),f=e("angular2/src/core/facade/exceptions"),d=e("angular2/src/core/facade/lang"),h=e("@reactivex/rxjs/dist/cjs/Rx"),g=h.Observable,v=function(){function e(e,t,r){var n=this;if(this._dom=t,this.baseResponseOptions=r,this._finished=!1,e.method!==s.RequestMethods.Get)throw f.makeTypeError("JSONP requests must use GET request method.");this.request=e,this.response=new g(function(r){n.readyState=s.ReadyStates.Loading;var i=n._id=t.nextRequestID();t.exposeConnection(i,n);var o=t.requestCallback(n._id),a=e.url;a.indexOf("=JSONP_CALLBACK&")>-1?a=d.StringWrapper.replace(a,"=JSONP_CALLBACK&","="+o+"&"):a.lastIndexOf("=JSONP_CALLBACK")===a.length-"=JSONP_CALLBACK".length&&(a=d.StringWrapper.substring(a,0,a.length-"=JSONP_CALLBACK".length)+("="+o));var l=n._script=t.build(a),p=function(e){if(n.readyState!==s.ReadyStates.Cancelled){if(n.readyState=s.ReadyStates.Done,t.cleanup(l),!n._finished)return void r.error(f.makeTypeError("JSONP injected script did not invoke callback."));var i=new u.ResponseOptions({body:n._responseData});d.isPresent(n.baseResponseOptions)&&(i=n.baseResponseOptions.merge(i)),r.next(new c.Response(i)),r.complete()}},h=function(e){n.readyState!==s.ReadyStates.Cancelled&&(n.readyState=s.ReadyStates.Done,t.cleanup(l),r.error(e))};return l.addEventListener("load",p),l.addEventListener("error",h),t.send(l),function(){n.readyState=s.ReadyStates.Cancelled,l.removeEventListener("load",p),l.removeEventListener("error",h),d.isPresent(l)&&n._dom.cleanup(l)}})}return e.prototype.finished=function(e){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==s.ReadyStates.Cancelled&&(this._responseData=e)},e}();t.JSONPConnection=v;var y=function(){function e(e,t){this._browserJSONP=e,this._baseResponseOptions=t}return e.prototype.createConnection=function(e){return new v(e,this._browserJSONP,this._baseResponseOptions)},e=o([l.Injectable(),a("design:paramtypes",[p.BrowserJsonp,u.ResponseOptions])],e)}();return t.JSONPBackend=y,n.define=i,r.exports}),System.register("angular2/src/core/di/binding",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/reflection/reflection","angular2/src/core/di/key","angular2/src/core/di/metadata","angular2/src/core/di/exceptions","angular2/src/core/di/forward_ref"],!0,function(e,t,r){function n(e){return new D(e)}function i(e){var t,r;if(m.isPresent(e.toClass)){var n=C.resolveForwardRef(e.toClass);t=x.reflector.factory(n),r=p(n)}else m.isPresent(e.toAlias)?(t=function(e){return e},r=[E.fromKey(w.Key.get(e.toAlias))]):m.isPresent(e.toFactory)?(t=e.toFactory,r=l(e.toFactory,e.dependencies)):(t=function(){return e.toValue},r=R);return new I(t,r)}function o(e){return new P(w.Key.get(e.token),[i(e)],!1)}function a(e){var t=s(c(e,new Map));return t.map(function(e){if(e instanceof T)return new P(e.key,[e.resolvedFactory],!1);var t=e;return new P(t[0].key,t.map(function(e){return e.resolvedFactory}),!0)})}function s(e){return b.MapWrapper.values(e)}function c(e,t){return b.ListWrapper.forEach(e,function(e){if(e instanceof m.Type)u(n(e).toClass(e),t);else if(e instanceof O)u(e,t);else{if(!(e instanceof Array))throw new S.InvalidBindingError(e instanceof D?e.token:e);c(e,t)}}),t}function u(e,t){var r=w.Key.get(e.token),n=i(e),o=new T(r,n);if(e.multi){var a=t.get(r.id);if(a instanceof Array)a.push(o);else{if(!m.isBlank(a))throw new S.MixingMultiBindingsWithRegularBindings(a,e);t.set(r.id,[o])}}else{var a=t.get(r.id);if(a instanceof Array)throw new S.MixingMultiBindingsWithRegularBindings(a,e);t.set(r.id,o)}}function l(e,t){if(m.isBlank(t))return p(e);var r=b.ListWrapper.map(t,function(e){return[e]});return b.ListWrapper.map(t,function(t){return f(e,t,r)})}function p(e){var t=x.reflector.parameters(e);if(m.isBlank(t))return[];if(b.ListWrapper.any(t,function(e){return m.isBlank(e)}))throw new S.NoAnnotationError(e,t);return b.ListWrapper.map(t,function(r){return f(e,r,t)})}function f(e,t,r){var n=[],i=null,o=!1;if(!m.isArray(t))return d(t,o,null,null,n);for(var a=null,s=null,c=0;c<t.length;++c){var u=t[c];u instanceof m.Type?i=u:u instanceof j.InjectMetadata?i=u.token:u instanceof j.OptionalMetadata?o=!0:u instanceof j.SelfMetadata?s=u:u instanceof j.HostMetadata?s=u:u instanceof j.SkipSelfMetadata?a=u:u instanceof j.DependencyMetadata&&(m.isPresent(u.token)&&(i=u.token),n.push(u))}if(i=C.resolveForwardRef(i),m.isPresent(i))return d(i,o,a,s,n);throw new S.NoAnnotationError(e,r)}function d(e,t,r,n,i){return new E(w.Key.get(e),t,r,n,i)}var h=System.global,g=h.define;h.define=void 0;var v=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},y=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},m=e("angular2/src/core/facade/lang"),_=e("angular2/src/core/facade/exceptions"),b=e("angular2/src/core/facade/collection"),x=e("angular2/src/core/reflection/reflection"),w=e("angular2/src/core/di/key"),j=e("angular2/src/core/di/metadata"),S=e("angular2/src/core/di/exceptions"),C=e("angular2/src/core/di/forward_ref"),E=function(){function e(e,t,r,n,i){this.key=e,this.optional=t,this.lowerBoundVisibility=r,this.upperBoundVisibility=n,this.properties=i}return e.fromKey=function(t){return new e(t,!1,null,null,[])},e}();t.Dependency=E;var R=m.CONST_EXPR([]),O=function(){function e(e,t){var r=t.toClass,n=t.toValue,i=t.toAlias,o=t.toFactory,a=t.deps,s=t.multi;this.token=e,this.toClass=r,this.toValue=n,this.toAlias=i,this.toFactory=o,this.dependencies=a,this._multi=s}return Object.defineProperty(e.prototype,"multi",{get:function(){return m.normalizeBool(this._multi)},enumerable:!0,configurable:!0}),e=v([m.CONST(),y("design:paramtypes",[Object,Object])],e)}();t.Binding=O;var P=function(){function e(e,t,r){this.key=e,this.resolvedFactories=t,this.multiBinding=r}return Object.defineProperty(e.prototype,"resolvedFactory",{get:function(){return this.resolvedFactories[0]},enumerable:!0,configurable:!0}),e}();t.ResolvedBinding=P;var I=function(){function e(e,t){this.factory=e,this.dependencies=t}return e}();t.ResolvedFactory=I,t.bind=n;var D=function(){function e(e){this.token=e}return e.prototype.toClass=function(e){if(!m.isType(e))throw new _.BaseException('Trying to create a class binding but "'+m.stringify(e)+'" is not a class!');return new O(this.token,{toClass:e})},e.prototype.toValue=function(e){return new O(this.token,{toValue:e})},e.prototype.toAlias=function(e){if(m.isBlank(e))throw new _.BaseException("Can not alias "+m.stringify(this.token)+" to a blank value!");return new O(this.token,{toAlias:e})},e.prototype.toFactory=function(e,t){if(!m.isFunction(e))throw new _.BaseException('Trying to create a factory binding but "'+m.stringify(e)+'" is not a function!');return new O(this.token,{toFactory:e,deps:t})},e}();t.BindingBuilder=D,t.resolveFactory=i,t.resolveBinding=o,t.resolveBindings=a;var T=function(){function e(e,t){this.key=e,this.resolvedFactory=t}return e}();return h.define=g,r.exports}),System.register("angular2/src/core/change_detection/abstract_change_detector",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/change_detector_ref","angular2/src/core/change_detection/exceptions","angular2/src/core/change_detection/constants","angular2/src/core/profile/profile","angular2/src/core/change_detection/observable_facade"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/change_detection/change_detection_util"),u=e("angular2/src/core/change_detection/change_detector_ref"),l=e("angular2/src/core/change_detection/exceptions"),p=e("angular2/src/core/change_detection/constants"),f=e("angular2/src/core/profile/profile"),d=e("angular2/src/core/change_detection/observable_facade"),h=f.wtfCreateScope("ChangeDetector#check(ascii id, bool throwOnChange)"),g=function(){function e(e,t,r,n,i,o){this.element=e,this.componentElement=t,this.context=r,this.locals=n,this.injector=i,this.expression=o}return e}(),v=function(){function e(e,t,r,n,i,o){this.id=e,this.dispatcher=t,this.numberOfPropertyProtoRecords=r,this.bindingTargets=n,this.directiveIndices=i,this.strategy=o,this.lightDomChildren=[],this.shadowDomChildren=[],this.alreadyChecked=!1,this.locals=null,this.mode=null,this.pipes=null,this.ref=new u.ChangeDetectorRef(this)}return e.prototype.addChild=function(e){this.lightDomChildren.push(e),e.parent=this},e.prototype.removeChild=function(e){s.ListWrapper.remove(this.lightDomChildren,e)},e.prototype.addShadowDomChild=function(e){this.shadowDomChildren.push(e),e.parent=this},e.prototype.removeShadowDomChild=function(e){s.ListWrapper.remove(this.shadowDomChildren,e)},e.prototype.remove=function(){this.parent.removeChild(this)},e.prototype.handleEvent=function(e,t,r){var n=this.handleEventInternal(e,t,r);return this.markPathToRootAsCheckOnce(),n},e.prototype.handleEventInternal=function(e,t,r){return!1},e.prototype.detectChanges=function(){this.runDetectChanges(!1)},e.prototype.checkNoChanges=function(){throw new a.BaseException("Not implemented")},e.prototype.runDetectChanges=function(e){if(this.mode!==p.ChangeDetectionStrategy.Detached&&this.mode!==p.ChangeDetectionStrategy.Checked){var t=h(this.id,e);this.detectChangesInRecords(e),this._detectChangesInLightDomChildren(e),e||this.afterContentLifecycleCallbacks(),this._detectChangesInShadowDomChildren(e),e||this.afterViewLifecycleCallbacks(),this.mode===p.ChangeDetectionStrategy.CheckOnce&&(this.mode=p.ChangeDetectionStrategy.Checked),this.alreadyChecked=!0,f.wtfLeave(t)}},e.prototype.detectChangesInRecords=function(e){this.hydrated()||this.throwDehydratedError();try{this.detectChangesInRecordsInternal(e)}catch(t){this._throwError(t,t.stack)}},e.prototype.detectChangesInRecordsInternal=function(e){},e.prototype.hydrate=function(e,t,r,n){this.mode=c.ChangeDetectionUtil.changeDetectionMode(this.strategy),this.context=e,this.strategy===p.ChangeDetectionStrategy.OnPushObserve&&this.observeComponent(e),this.locals=t,this.pipes=n,this.hydrateDirectives(r),this.alreadyChecked=!1},e.prototype.hydrateDirectives=function(e){},e.prototype.dehydrate=function(){this.dehydrateDirectives(!0),this.strategy===p.ChangeDetectionStrategy.OnPushObserve&&this._unsubsribeFromObservables(),this.context=null,this.locals=null,this.pipes=null},e.prototype.dehydrateDirectives=function(e){},e.prototype.hydrated=function(){return null!==this.context},e.prototype.afterContentLifecycleCallbacks=function(){this.dispatcher.notifyAfterContentChecked(),this.afterContentLifecycleCallbacksInternal()},e.prototype.afterContentLifecycleCallbacksInternal=function(){},e.prototype.afterViewLifecycleCallbacks=function(){this.dispatcher.notifyAfterViewChecked(),this.afterViewLifecycleCallbacksInternal()},e.prototype.afterViewLifecycleCallbacksInternal=function(){},e.prototype._detectChangesInLightDomChildren=function(e){for(var t=this.lightDomChildren,r=0;r<t.length;++r)t[r].runDetectChanges(e)},e.prototype._detectChangesInShadowDomChildren=function(e){for(var t=this.shadowDomChildren,r=0;r<t.length;++r)t[r].runDetectChanges(e)},e.prototype.markAsCheckOnce=function(){this.mode=p.ChangeDetectionStrategy.CheckOnce},e.prototype.markPathToRootAsCheckOnce=function(){for(var e=this;o.isPresent(e)&&e.mode!==p.ChangeDetectionStrategy.Detached;)e.mode===p.ChangeDetectionStrategy.Checked&&(e.mode=p.ChangeDetectionStrategy.CheckOnce),e=e.parent},e.prototype._unsubsribeFromObservables=function(){if(o.isPresent(this.subscriptions))for(var e=0;e<this.subscriptions.length;++e){var t=this.subscriptions[e];o.isPresent(this.subscriptions[e])&&(t.cancel(),this.subscriptions[e]=null)}},e.prototype.observeValue=function(e,t){var r=this;return d.isObservable(e)&&(this._createArrayToStoreObservables(),o.isBlank(this.subscriptions[t])?(this.streams[t]=e.changes,this.subscriptions[t]=e.changes.listen(function(e){return r.ref.markForCheck()})):this.streams[t]!==e.changes&&(this.subscriptions[t].cancel(),this.streams[t]=e.changes,this.subscriptions[t]=e.changes.listen(function(e){return r.ref.markForCheck()}))),e},e.prototype.observeDirective=function(e,t){var r=this;if(d.isObservable(e)){this._createArrayToStoreObservables();var n=this.numberOfPropertyProtoRecords+t+2;this.streams[n]=e.changes,this.subscriptions[n]=e.changes.listen(function(e){return r.ref.markForCheck()})}return e},e.prototype.observeComponent=function(e){var t=this;if(d.isObservable(e)){this._createArrayToStoreObservables();var r=this.numberOfPropertyProtoRecords+1;this.streams[r]=e.changes,this.subscriptions[r]=e.changes.listen(function(e){return t.ref.markForCheck()})}return e},e.prototype._createArrayToStoreObservables=function(){o.isBlank(this.subscriptions)&&(this.subscriptions=s.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords+this.directiveIndices.length+2),this.streams=s.ListWrapper.createFixedSize(this.numberOfPropertyProtoRecords+this.directiveIndices.length+2))},e.prototype.getDirectiveFor=function(e,t){return e.getDirectiveFor(this.directiveIndices[t])},e.prototype.getDetectorFor=function(e,t){return e.getDetectorFor(this.directiveIndices[t])},e.prototype.notifyDispatcher=function(e){this.dispatcher.notifyOnBinding(this._currentBinding(),e)},e.prototype.logBindingUpdate=function(e){this.dispatcher.logBindingUpdate(this._currentBinding(),e)},e.prototype.addChange=function(e,t,r){return o.isBlank(e)&&(e={}),e[this._currentBinding().name]=c.ChangeDetectionUtil.simpleChange(t,r),e},e.prototype._throwError=function(e,t){var r;try{var n=this.dispatcher.getDebugContext(this._currentBinding().elementIndex,null),i=o.isPresent(n)?new g(n.element,n.componentElement,n.context,n.locals,n.injector,this._currentBinding().debug):null;r=new l.ChangeDetectionError(this._currentBinding().debug,e,t,i)}catch(a){r=new l.ChangeDetectionError(null,e,t,null)}throw r},e.prototype.throwOnChangeError=function(e,t){throw new l.ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug,e,t,null)},e.prototype.throwDehydratedError=function(){throw new l.DehydratedException},e.prototype._currentBinding=function(){return this.bindingTargets[this.propertyBindingIndex]},e}();return t.AbstractChangeDetector=v,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/change_detection_jit_generator",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/change_detection/abstract_change_detector","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/codegen_name_util","angular2/src/core/change_detection/codegen_logic_util","angular2/src/core/change_detection/codegen_facade","angular2/src/core/change_detection/proto_change_detector"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/facade/lang"),a=e("angular2/src/core/facade/exceptions"),s=e("angular2/src/core/change_detection/abstract_change_detector"),c=e("angular2/src/core/change_detection/change_detection_util"),u=e("angular2/src/core/change_detection/codegen_name_util"),l=e("angular2/src/core/change_detection/codegen_logic_util"),p=e("angular2/src/core/change_detection/codegen_facade"),f=e("angular2/src/core/change_detection/proto_change_detector"),d="isChanged",h="changes",g=function(){function e(e,t,r){this.changeDetectionUtilVarName=t,this.abstractChangeDetectorVarName=r;var n=f.createPropertyRecords(e),i=f.createEventRecords(e),o=e.bindingRecords.map(function(e){return e.target});this.id=e.id,this.changeDetectionStrategy=e.strategy,this.genConfig=e.genConfig,this.records=n,this.propertyBindingTargets=o,this.eventBindings=i,this.directiveRecords=e.directiveRecords,this._names=new u.CodegenNameUtil(this.records,this.eventBindings,this.directiveRecords,this.changeDetectionUtilVarName),this._logic=new l.CodegenLogicUtil(this._names,this.changeDetectionUtilVarName,this.changeDetectionStrategy),this.typeName=u.sanitizeName("ChangeDetector_"+this.id)}return e.prototype.generate=function(){var e="\n "+this.generateSource()+"\n return function(dispatcher) {\n return new "+this.typeName+"(dispatcher);\n }\n ";return new Function(this.abstractChangeDetectorVarName,this.changeDetectionUtilVarName,e)(s.AbstractChangeDetector,c.ChangeDetectionUtil)},e.prototype.generateSource=function(){var e=this;return"\n var "+this.typeName+" = function "+this.typeName+"(dispatcher) {\n "+this.abstractChangeDetectorVarName+".call(\n this, "+JSON.stringify(this.id)+", dispatcher, "+this.records.length+",\n "+this.typeName+".gen_propertyBindingTargets, "+this.typeName+".gen_directiveIndices,\n "+p.codify(this.changeDetectionStrategy)+");\n this.dehydrateDirectives(false);\n }\n\n "+this.typeName+".prototype = Object.create("+this.abstractChangeDetectorVarName+".prototype);\n\n "+this.typeName+".prototype.detectChangesInRecordsInternal = function(throwOnChange) {\n "+this._names.genInitLocals()+"\n var "+d+" = false;\n var "+h+" = null;\n\n "+this.records.map(function(t){return e._genRecord(t)}).join("\n")+"\n }\n\n "+this._maybeGenHandleEventInternal()+"\n\n "+this._genCheckNoChanges()+"\n\n "+this._maybeGenAfterContentLifecycleCallbacks()+"\n\n "+this._maybeGenAfterViewLifecycleCallbacks()+"\n\n "+this._maybeGenHydrateDirectives()+"\n\n "+this._maybeGenDehydrateDirectives()+"\n\n "+this._genPropertyBindingTargets()+"\n\n "+this._genDirectiveIndices()+"\n "},e.prototype._genPropertyBindingTargets=function(){var e=this._logic.genPropertyBindingTargets(this.propertyBindingTargets,this.genConfig.genDebugInfo);return this.typeName+".gen_propertyBindingTargets = "+e+";"},e.prototype._genDirectiveIndices=function(){var e=this._logic.genDirectiveIndices(this.directiveRecords);return this.typeName+".gen_directiveIndices = "+e+";"},e.prototype._maybeGenHandleEventInternal=function(){var e=this;if(this.eventBindings.length>0){var t=this.eventBindings.map(function(t){return e._genEventBinding(t)}).join("\n");return"\n "+this.typeName+".prototype.handleEventInternal = function(eventName, elIndex, locals) {\n var "+this._names.getPreventDefaultAccesor()+" = false;\n "+this._names.genInitEventLocals()+"\n "+t+"\n return "+this._names.getPreventDefaultAccesor()+";\n }\n "}return""},e.prototype._genEventBinding=function(e){var t=this,r=e.records.map(function(r){return t._genEventBindingEval(e,r)}).join("\n");return'\n if (eventName === "'+e.eventName+'" && elIndex === '+e.elIndex+") {\n "+r+"\n }"},e.prototype._genEventBindingEval=function(e,t){if(t.lastInBinding){var r=this._logic.genEventBindingEvalValue(e,t),n=this._genMarkPathToRootAsCheckOnce(t),i=this._genUpdatePreventDefault(e,t);return r+"\n"+n+"\n"+i}return this._logic.genEventBindingEvalValue(e,t)},e.prototype._genMarkPathToRootAsCheckOnce=function(e){var t=e.bindingRecord;return t.isDefaultChangeDetection()?"":this._names.getDetectorName(t.directiveRecord.directiveIndex)+".markPathToRootAsCheckOnce();"},e.prototype._genUpdatePreventDefault=function(e,t){var r=this._names.getEventLocalName(e,t.selfIndex);return"if ("+r+" === false) { "+this._names.getPreventDefaultAccesor()+" = true};"},e.prototype._maybeGenDehydrateDirectives=function(){var e=this._names.genPipeOnDestroy();e&&(e="if (destroyPipes) { "+e+" }");var t=this._names.genDehydrateFields();return e||t?this.typeName+".prototype.dehydrateDirectives = function(destroyPipes) {\n "+e+"\n "+t+"\n }":""},e.prototype._maybeGenHydrateDirectives=function(){var e=this._logic.genHydrateDirectives(this.directiveRecords),t=this._logic.genHydrateDetectors(this.directiveRecords);return e||t?this.typeName+".prototype.hydrateDirectives = function(directives) {\n "+e+"\n "+t+"\n }":""},e.prototype._maybeGenAfterContentLifecycleCallbacks=function(){var e=this._logic.genContentLifecycleCallbacks(this.directiveRecords);if(e.length>0){var t=e.join("\n");return"\n "+this.typeName+".prototype.afterContentLifecycleCallbacksInternal = function() {\n "+t+"\n }\n "}return""},e.prototype._maybeGenAfterViewLifecycleCallbacks=function(){var e=this._logic.genViewLifecycleCallbacks(this.directiveRecords);if(e.length>0){var t=e.join("\n");return"\n "+this.typeName+".prototype.afterViewLifecycleCallbacksInternal = function() {\n "+t+"\n }\n "}return""},e.prototype._genRecord=function(e){var t;return t=e.isLifeCycleRecord()?this._genDirectiveLifecycle(e):e.isPipeRecord()?this._genPipeCheck(e):this._genReferenceCheck(e),"\n "+this._maybeFirstInBinding(e)+"\n "+t+"\n "+this._maybeGenLastInDirective(e)+"\n "},e.prototype._genDirectiveLifecycle=function(e){if("DoCheck"===e.name)return this._genOnCheck(e);if("OnInit"===e.name)return this._genOnInit(e);if("OnChanges"===e.name)return this._genOnChange(e);throw new a.BaseException("Unknown lifecycle event '"+e.name+"'")},e.prototype._genPipeCheck=function(e){var t=this,r=this._names.getLocalName(e.contextIndex),n=e.args.map(function(e){return t._names.getLocalName(e)}).join(", "),i=this._names.getFieldName(e.selfIndex),o=this._names.getLocalName(e.selfIndex),a=this._names.getPipeName(e.selfIndex),s=e.name,c="\n if ("+a+" === "+this.changeDetectionUtilVarName+".uninitialized) {\n "+a+" = "+this._names.getPipesAccessorName()+".get('"+s+"');\n }\n ",u=o+" = "+a+".pipe.transform("+r+", ["+n+"]);",l=e.args.map(function(e){return t._names.getChangeName(e)});l.push(this._names.getChangeName(e.contextIndex));var p="!"+a+".pure || ("+l.join(" || ")+")",f="\n if ("+i+" !== "+o+") {\n "+o+" = "+this.changeDetectionUtilVarName+".unwrapValue("+o+")\n "+this._genChangeMarker(e)+"\n "+this._genUpdateDirectiveOrElement(e)+"\n "+this._genAddToChanges(e)+"\n "+i+" = "+o+";\n }\n ",d=e.shouldBeChecked()?""+u+f:u;return e.isUsedByOtherRecord()?c+" if ("+p+") { "+d+" } else { "+o+" = "+i+"; }":c+" if ("+p+") { "+d+" }"},e.prototype._genReferenceCheck=function(e){var t=this,r=this._names.getFieldName(e.selfIndex),n=this._names.getLocalName(e.selfIndex),i="\n "+this._logic.genPropertyBindingEvalValue(e)+"\n ",o="\n if ("+n+" !== "+r+") {\n "+this._genChangeMarker(e)+"\n "+this._genUpdateDirectiveOrElement(e)+"\n "+this._genAddToChanges(e)+"\n "+r+" = "+n+";\n }\n ",a=e.shouldBeChecked()?""+i+o:i;if(e.isPureFunction()){var s=e.args.map(function(e){return t._names.getChangeName(e)}).join(" || ");return e.isUsedByOtherRecord()?"if ("+s+") { "+a+" } else { "+n+" = "+r+"; }":"if ("+s+") { "+a+" }"}return a},e.prototype._genChangeMarker=function(e){return e.argumentToPureFunction?this._names.getChangeName(e.selfIndex)+" = true":""},e.prototype._genUpdateDirectiveOrElement=function(e){if(!e.lastInBinding)return"";var t=this._names.getLocalName(e.selfIndex),r=this._names.getFieldName(e.selfIndex),n=this.genConfig.logBindingUpdate?"this.logBindingUpdate("+t+");":"",i=e.bindingRecord;if(i.target.isDirective()){var o=this._names.getDirectiveName(i.directiveRecord.directiveIndex)+"."+i.target.name;return"\n "+this._genThrowOnChangeCheck(r,t)+"\n "+o+" = "+t+";\n "+n+"\n "+d+" = true;\n ";
}return"\n "+this._genThrowOnChangeCheck(r,t)+"\n this.notifyDispatcher("+t+");\n "+n+"\n "},e.prototype._genThrowOnChangeCheck=function(e,t){return this.genConfig.genCheckNoChanges?"\n if(throwOnChange) {\n this.throwOnChangeError("+e+", "+t+");\n }\n ":""},e.prototype._genCheckNoChanges=function(){return this.genConfig.genCheckNoChanges?this.typeName+".prototype.checkNoChanges = function() { this.runDetectChanges(true); }":""},e.prototype._genAddToChanges=function(e){var t=this._names.getLocalName(e.selfIndex),r=this._names.getFieldName(e.selfIndex);return e.bindingRecord.callOnChanges()?h+" = this.addChange("+h+", "+r+", "+t+");":""},e.prototype._maybeFirstInBinding=function(e){var t=c.ChangeDetectionUtil.protoByIndex(this.records,e.selfIndex-1),r=o.isBlank(t)||t.bindingRecord!==e.bindingRecord;return r&&!e.bindingRecord.isDirectiveLifecycle()?this._names.getPropertyBindingIndex()+" = "+e.propertyBindingIndex+";":""},e.prototype._maybeGenLastInDirective=function(e){return e.lastInDirective?"\n "+h+" = null;\n "+this._genNotifyOnPushDetectors(e)+"\n "+d+" = false;\n ":""},e.prototype._genOnCheck=function(e){var t=e.bindingRecord;return"if (!throwOnChange) "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".doCheck();"},e.prototype._genOnInit=function(e){var t=e.bindingRecord;return"if (!throwOnChange && !"+this._names.getAlreadyCheckedName()+") "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".onInit();"},e.prototype._genOnChange=function(e){var t=e.bindingRecord;return"if (!throwOnChange && "+h+") "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".onChanges("+h+");"},e.prototype._genNotifyOnPushDetectors=function(e){var t=e.bindingRecord;if(!e.lastInDirective||t.isDefaultChangeDetection())return"";var r="\n if("+d+") {\n "+this._names.getDetectorName(t.directiveRecord.directiveIndex)+".markAsCheckOnce();\n }\n ";return r},e}();return t.ChangeDetectorJITGenerator=g,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Observable",["@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/util/Symbol_observable"],!0,function(e,t,r){function n(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")}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0;var s=e("@reactivex/rxjs/dist/cjs/Subscriber"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/util/Symbol_observable"),l=n(u),p=function(){function e(t){i(this,e),this._isScalar=!1,t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype[l["default"]]=function(){return this},e.prototype.subscribe=function(e,t,r){var n=void 0;if(e&&"object"==typeof e)n=e instanceof c["default"]?e:new c["default"](e);else{var i=e;n=c["default"].create(i,t,r)}return n.add(this._subscribe(n)),n},e.prototype.forEach=function(e){var t=this;return new Promise(function(r,n){t.subscribe(e,n,r)})},e.prototype._subscribe=function(e){return this.source._subscribe(this.operator.call(e))},e}();return t["default"]=p,p.create=function(e){return new p(e)},r.exports=t["default"],o.define=a,r.exports}),System.register("angular2/src/core/compiler/change_detector_compiler",["angular2/src/core/compiler/source_module","angular2/src/core/change_detection/change_detection_jit_generator","angular2/src/core/compiler/change_definition_factory","angular2/src/core/change_detection/change_detection","angular2/src/transform/template_compiler/change_detector_codegen","angular2/src/core/compiler/util","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/compiler/source_module"),c=e("angular2/src/core/change_detection/change_detection_jit_generator"),u=e("angular2/src/core/compiler/change_definition_factory"),l=e("angular2/src/core/change_detection/change_detection"),p=e("angular2/src/transform/template_compiler/change_detector_codegen"),f=e("angular2/src/core/compiler/util"),d=e("angular2/src/core/di"),h="AbstractChangeDetector",g="ChangeDetectionUtil",v=s.moduleRef("package:angular2/src/core/change_detection/abstract_change_detector"+f.MODULE_SUFFIX),y=s.moduleRef("package:angular2/src/core/change_detection/change_detection_util"+f.MODULE_SUFFIX),m=s.moduleRef("package:angular2/src/core/change_detection/pregen_proto_change_detector"+f.MODULE_SUFFIX),_=function(){function e(e){this._genConfig=e}return e.prototype.compileComponentRuntime=function(e,t,r){var n=this,i=u.createChangeDetectorDefinitions(e,t,this._genConfig,r);return i.map(function(e){return n._createChangeDetectorFactory(e)})},e.prototype._createChangeDetectorFactory=function(e){if(f.IS_DART||!this._genConfig.useJit){var t=new l.DynamicProtoChangeDetector(e);return function(e){return t.instantiate(e)}}return new c.ChangeDetectorJITGenerator(e,g,h).generate()},e.prototype.compileComponentCodeGen=function(e,t,r){var n=u.createChangeDetectorDefinitions(e,t,this._genConfig,r),i=[],o=0,a=n.map(function(t){var r,n;if(f.IS_DART){r=new p.Codegen(m);var a=t.id,u=0===o&&e.isHost?"dynamic":""+s.moduleRef(e.moduleUrl)+e.name;r.generate(u,a,t),i.push("(dispatcher) => new "+a+"(dispatcher)"),n=r.toString()}else r=new c.ChangeDetectorJITGenerator(t,""+y+g,""+v+h),i.push("function(dispatcher) { return new "+r.typeName+"(dispatcher); }"),n=r.generateSource();return o++,n});return new s.SourceExpressions(a,i)},e=o([d.Injectable(),a("design:paramtypes",[l.ChangeDetectorGenConfig])],e)}();return t.ChangeDetectionCompiler=_,n.define=i,r.exports}),System.register("angular2/src/core/compiler/style_compiler",["angular2/src/core/compiler/source_module","angular2/src/core/metadata/view","angular2/src/core/compiler/xhr","angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/compiler/shadow_css","angular2/src/core/compiler/url_resolver","angular2/src/core/compiler/style_url_resolver","angular2/src/core/compiler/util","angular2/src/core/di"],!0,function(e,t,r){function n(e,t){return v.StringWrapper.replaceAll(R,S,s(e,t))}function i(e,t){return v.StringWrapper.replaceAll(O,S,c(e,t))}function o(e,t){return v.StringWrapper.replaceAll(C,S,s(e,t))}function a(e,t){return v.StringWrapper.replaceAll(E,S,c(e,t))}function s(e,t){return e+"-"+t}function c(e,t){return e+"+'-'+"+x.codeGenToString(t)}var u=System.global,l=u.define;u.define=void 0;var p=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},f=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},d=e("angular2/src/core/compiler/source_module"),h=e("angular2/src/core/metadata/view"),g=e("angular2/src/core/compiler/xhr"),v=e("angular2/src/core/facade/lang"),y=e("angular2/src/core/facade/async"),m=e("angular2/src/core/compiler/shadow_css"),_=e("angular2/src/core/compiler/url_resolver"),b=e("angular2/src/core/compiler/style_url_resolver"),x=e("angular2/src/core/compiler/util"),w=e("angular2/src/core/di"),j="%COMP%",S=/%COMP%/g,C="_nghost-"+j,E="'_nghost-'+"+j,R="_ngcontent-"+j,O="'_ngcontent-'+"+j,P=function(){function e(e,t){this._xhr=e,this._urlResolver=t,this._styleCache=new Map,this._shadowCss=new m.ShadowCss}return e.prototype.compileComponentRuntime=function(e,t,r){var n=r.styles,i=r.styleUrls;return this._loadStyles(n,i,r.encapsulation===h.ViewEncapsulation.Emulated).then(function(r){return r.map(function(r){return v.StringWrapper.replaceAll(r,S,s(e,t))})})},e.prototype.compileComponentCodeGen=function(e,t,r){var n,i=r.encapsulation===h.ViewEncapsulation.Emulated;return n=i?x.codeGenMapArray(["style"],"style"+x.codeGenReplaceAll(j,c(e,t))):"",this._styleCodeGen(r.styles,r.styleUrls,i,n)},e.prototype.compileStylesheetCodeGen=function(e,t){var r=b.resolveStyleUrls(this._urlResolver,e,t);return[this._styleModule(e,!1,this._styleCodeGen([r.style],r.styleUrls,!1,"")),this._styleModule(e,!0,this._styleCodeGen([r.style],r.styleUrls,!0,""))]},e.prototype.clearCache=function(){this._styleCache.clear()},e.prototype._loadStyles=function(e,t,r){var n=this,i=t.map(function(e){var t=""+e+(r?".shim":""),i=n._styleCache.get(t);return v.isBlank(i)&&(i=n._xhr.get(e).then(function(t){var i=b.resolveStyleUrls(n._urlResolver,e,t);return n._loadStyles([i.style],i.styleUrls,r)}),n._styleCache.set(t,i)),i});return y.PromiseWrapper.all(i).then(function(t){var i=e.map(function(e){return n._shimIfNeeded(e,r)});return t.forEach(function(e){return e.forEach(function(e){return i.push(e)})}),i})},e.prototype._styleCodeGen=function(e,t,r,n){var i=this,o="(";o+="["+e.map(function(e){return x.escapeSingleQuoteString(i._shimIfNeeded(e,r))}).join(",")+"]";for(var a=0;a<t.length;a++){var s=this._createModuleUrl(t[a],r);o+=x.codeGenConcatArray(d.moduleRef(s)+"STYLES")}return o+=")"+n,new d.SourceExpression([],o)},e.prototype._styleModule=function(e,t,r){var n="\n "+r.declarations.join("\n")+"\n "+x.codeGenExportVariable("STYLES")+r.expression+";\n ";return new d.SourceModule(this._createModuleUrl(e,t),n)},e.prototype._shimIfNeeded=function(e,t){return t?this._shadowCss.shimCssText(e,R,C):e},e.prototype._createModuleUrl=function(e,t){return t?e+".shim"+x.MODULE_SUFFIX:""+e+x.MODULE_SUFFIX},e=p([w.Injectable(),f("design:paramtypes",[g.XHR,_.UrlResolver])],e)}();return t.StyleCompiler=P,t.shimContentAttribute=n,t.shimContentAttributeExpr=i,t.shimHostAttribute=o,t.shimHostAttributeExpr=a,u.define=l,r.exports}),System.register("angular2/src/core/compiler/template_parser",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/facade/exceptions","angular2/src/core/change_detection/change_detection","angular2/src/core/compiler/html_parser","angular2/src/core/compiler/template_ast","angular2/src/core/compiler/selector","angular2/src/core/compiler/schema/element_schema_registry","angular2/src/core/compiler/template_preparser","angular2/src/core/compiler/html_ast","angular2/src/core/compiler/util"],!0,function(e,t,r){function n(e){return l.StringWrapper.split(e.trim(),/\s+/g)}function i(e,t){var r=new v.CssSelector;r.setElement(e);for(var i=0;i<t.length;i++){var o=t[i][0].toLowerCase(),a=t[i][1];if(r.addAttribute(o,a),o==C){var s=n(a);s.forEach(function(e){return r.addClassName(e)})}}return r}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},c=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/di"),f=e("angular2/src/core/facade/exceptions"),d=e("angular2/src/core/change_detection/change_detection"),h=e("angular2/src/core/compiler/html_parser"),g=e("angular2/src/core/compiler/template_ast"),v=e("angular2/src/core/compiler/selector"),y=e("angular2/src/core/compiler/schema/element_schema_registry"),m=e("angular2/src/core/compiler/template_preparser"),_=e("angular2/src/core/compiler/html_ast"),b=e("angular2/src/core/compiler/util"),x=/^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g,w="template",j="template",S="*",C="class",E=new RegExp("\\."),R="attr",O="class",P="style",I=v.CssSelector.parse("*")[0],D=function(){function e(e,t,r){this._exprParser=e,this._schemaRegistry=t,this._htmlParser=r}return e.prototype.parse=function(e,t,r){var n=new T(t,this._exprParser,this._schemaRegistry),i=_.htmlVisitAll(n,this._htmlParser.parse(e,r),N);if(n.errors.length>0){var o=n.errors.join("\n");throw new f.BaseException("Template parse errors:\n"+o)}return i},e=s([p.Injectable(),c("design:paramtypes",[d.Parser,y.ElementSchemaRegistry,h.HtmlParser])],e)}();t.TemplateParser=D;var T=function(){function e(e,t,r){var n=this;this._exprParser=t,this._schemaRegistry=r,this.errors=[],this.directivesIndex=new Map,this.selectorMatcher=new v.SelectorMatcher,u.ListWrapper.forEachWithIndex(e,function(e,t){var r=v.CssSelector.parse(e.selector);n.selectorMatcher.addSelectables(r,e),n.directivesIndex.set(e,t)})}return e.prototype._reportError=function(e){this.errors.push(e)},e.prototype._parseInterpolation=function(e,t){try{return this._exprParser.parseInterpolation(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseAction=function(e,t){try{return this._exprParser.parseAction(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseBinding=function(e,t){try{return this._exprParser.parseBinding(e,t)}catch(r){return this._reportError(""+r),this._exprParser.wrapLiteralPrimitive("ERROR",t)}},e.prototype._parseTemplateBindings=function(e,t){try{return this._exprParser.parseTemplateBindings(e,t)}catch(r){return this._reportError(""+r),[]}},e.prototype.visitText=function(e,t){var r=t.findNgContentIndex(I),n=this._parseInterpolation(e.value,e.sourceInfo);return l.isPresent(n)?new g.BoundTextAst(n,r,e.sourceInfo):new g.TextAst(e.value,r,e.sourceInfo)},e.prototype.visitAttr=function(e,t){return new g.AttrAst(e.name,e.value,e.sourceInfo)},e.prototype.visitElement=function(e,t){var r=this,n=e.name,o=m.preparseElement(e);if(o.type===m.PreparsedElementType.SCRIPT||o.type===m.PreparsedElementType.STYLE||o.type===m.PreparsedElementType.STYLESHEET)return null;var a=[],s=[],c=[],l=[],p=[],f=[],d=[],h=!1,v=[];e.attrs.forEach(function(e){a.push([e.name,e.value]);var t=r._parseAttr(e,a,s,l,c),n=r._parseInlineTemplateBinding(e,d,p,f);t||n||v.push(r.visitAttr(e,null)),n&&(h=!0)});var y,b=n==w,x=i(n,a),j=this._createDirectiveAsts(e.name,this._parseDirectives(this.selectorMatcher,x),s,b?[]:c,e.sourceInfo),S=this._createElementPropertyAsts(e.name,s,j),C=_.htmlVisitAll(o.nonBindable?V:this,e.children,A.create(j)),E=h?null:t.findNgContentIndex(x);if(o.type===m.PreparsedElementType.NG_CONTENT)y=new g.NgContentAst(E,e.sourceInfo);else if(b)this._assertNoComponentsNorElementBindingsOnTemplate(j,S,l,e.sourceInfo),y=new g.EmbeddedTemplateAst(v,c,j,C,E,e.sourceInfo);else{this._assertOnlyOneComponent(j,e.sourceInfo);var R=u.ListWrapper.filter(c,function(e){return 0===e.value.length});y=new g.ElementAst(n,v,S,l,R,j,C,E,e.sourceInfo)}if(h){var O=i(w,d),P=this._createDirectiveAsts(e.name,this._parseDirectives(this.selectorMatcher,O),p,[],e.sourceInfo),I=this._createElementPropertyAsts(e.name,p,P);this._assertNoComponentsNorElementBindingsOnTemplate(P,I,[],e.sourceInfo),y=new g.EmbeddedTemplateAst([],f,P,[y],t.findNgContentIndex(O),e.sourceInfo)}return y},e.prototype._parseInlineTemplateBinding=function(e,t,r,n){var i=null;if(e.name==j)i=e.value;else if(l.StringWrapper.startsWith(e.name,S)){var o=l.StringWrapper.substring(e.name,S.length);i=0==e.value.length?o:o+" "+e.value}if(l.isPresent(i)){for(var a=this._parseTemplateBindings(i,e.sourceInfo),s=0;s<a.length;s++){var c=a[s],u=b.camelCaseToDashCase(c.key);c.keyIsVar?(n.push(new g.VariableAst(b.dashCaseToCamelCase(c.key),c.name,e.sourceInfo)),t.push([u,c.name])):l.isPresent(c.expression)?this._parsePropertyAst(u,c.expression,e.sourceInfo,t,r):t.push([u,""])}return!0}return!1},e.prototype._parseAttr=function(e,t,r,n,i){var o=this._normalizeAttributeName(e.name),a=e.value,s=l.RegExpWrapper.firstMatch(x,o),c=!1;if(l.isPresent(s))if(c=!0,l.isPresent(s[1]))this._parseProperty(s[5],a,e.sourceInfo,t,r);else if(l.isPresent(s[2])){var u=s[5];this._parseVariable(u,a,e.sourceInfo,t,i)}else l.isPresent(s[3])?this._parseEvent(s[5],a,e.sourceInfo,t,n):l.isPresent(s[4])?(this._parseProperty(s[5],a,e.sourceInfo,t,r),this._parseAssignmentEvent(s[5],a,e.sourceInfo,t,n)):l.isPresent(s[6])?(this._parseProperty(s[6],a,e.sourceInfo,t,r),this._parseAssignmentEvent(s[6],a,e.sourceInfo,t,n)):l.isPresent(s[7])?this._parseProperty(s[7],a,e.sourceInfo,t,r):l.isPresent(s[8])&&this._parseEvent(s[8],a,e.sourceInfo,t,n);else c=this._parsePropertyInterpolation(o,a,e.sourceInfo,t,r);return c||this._parseLiteralAttr(o,a,e.sourceInfo,r),c},e.prototype._normalizeAttributeName=function(e){return l.StringWrapper.startsWith(e,"data-")?l.StringWrapper.substring(e,5):e},e.prototype._parseVariable=function(e,t,r,n,i){i.push(new g.VariableAst(b.dashCaseToCamelCase(e),t,r)),n.push([e,t])},e.prototype._parseProperty=function(e,t,r,n,i){this._parsePropertyAst(e,this._parseBinding(t,r),r,n,i)},e.prototype._parsePropertyInterpolation=function(e,t,r,n,i){var o=this._parseInterpolation(t,r);return l.isPresent(o)?(this._parsePropertyAst(e,o,r,n,i),!0):!1},e.prototype._parsePropertyAst=function(e,t,r,n,i){n.push([e,t.source]),i.push(new M(e,t,!1,r))},e.prototype._parseAssignmentEvent=function(e,t,r,n,i){this._parseEvent(e,t+"=$event",r,n,i)},e.prototype._parseEvent=function(e,t,r,n,i){var o=b.splitAtColon(e,[null,e]),a=o[0],s=o[1];i.push(new g.BoundEventAst(b.dashCaseToCamelCase(s),a,this._parseAction(t,r),r))},e.prototype._parseLiteralAttr=function(e,t,r,n){n.push(new M(b.dashCaseToCamelCase(e),this._exprParser.wrapLiteralPrimitive(t,r),!0,r))},e.prototype._parseDirectives=function(e,t){var r=this,n=[];return e.match(t,function(e,t){n.push(t)}),u.ListWrapper.sort(n,function(e,t){var n=e.isComponent,i=t.isComponent;return n&&!i?-1:!n&&i?1:r.directivesIndex.get(e)-r.directivesIndex.get(t)}),n},e.prototype._createDirectiveAsts=function(e,t,r,n,i){var o=this,a=new Set,s=t.map(function(t){var s=[],c=[],u=[];o._createDirectiveHostPropertyAsts(e,t.hostProperties,i,s),o._createDirectiveHostEventAsts(t.hostListeners,i,c),o._createDirectivePropertyAsts(t.inputs,r,u);var l=[];return n.forEach(function(e){(0===e.value.length&&t.isComponent||t.exportAs==e.value)&&(l.push(e),a.add(e.name))}),new g.DirectiveAst(t,u,s,c,l,i)});return n.forEach(function(e){e.value.length>0&&!u.SetWrapper.has(a,e.name)&&o._reportError('There is no directive with "exportAs" set to "'+e.value+'" at '+e.sourceInfo)}),s},e.prototype._createDirectiveHostPropertyAsts=function(e,t,r,n){var i=this;l.isPresent(t)&&u.StringMapWrapper.forEach(t,function(t,o){var a=i._parseBinding(t,r);n.push(i._createElementPropertyAst(e,o,a,r))})},e.prototype._createDirectiveHostEventAsts=function(e,t,r){var n=this;l.isPresent(e)&&u.StringMapWrapper.forEach(e,function(e,i){n._parseEvent(i,e,t,[],r)})},e.prototype._createDirectivePropertyAsts=function(e,t,r){if(l.isPresent(e)){var n=new Map;t.forEach(function(e){var t=b.dashCaseToCamelCase(e.name),r=n.get(e.name);(l.isBlank(r)||r.isLiteral)&&n.set(t,e)}),u.StringMapWrapper.forEach(e,function(e,t){e=b.dashCaseToCamelCase(e);var i=n.get(e);l.isPresent(i)&&r.push(new g.BoundDirectivePropertyAst(t,i.name,i.expression,i.sourceInfo))})}},e.prototype._createElementPropertyAsts=function(e,t,r){var n=this,i=[],o=new Map;return r.forEach(function(e){e.inputs.forEach(function(e){o.set(e.templateName,e)})}),t.forEach(function(t){!t.isLiteral&&l.isBlank(o.get(t.name))&&i.push(n._createElementPropertyAst(e,t.name,t.expression,t.sourceInfo))}),i},e.prototype._createElementPropertyAst=function(e,t,r,n){var i,o,a=null,s=l.StringWrapper.split(t,E);return 1===s.length?(o=this._schemaRegistry.getMappedPropName(b.dashCaseToCamelCase(s[0])),i=g.PropertyBindingType.Property,this._schemaRegistry.hasProperty(e,o)||this._reportError("Can't bind to '"+o+"' since it isn't a known native property in "+n)):s[0]==R?(o=b.dashCaseToCamelCase(s[1]),i=g.PropertyBindingType.Attribute):s[0]==O?(o=s[1],i=g.PropertyBindingType.Class):s[0]==P?(a=s.length>2?s[2]:null,o=b.dashCaseToCamelCase(s[1]),i=g.PropertyBindingType.Style):(this._reportError("Invalid property name "+t+" in "+n),i=null),new g.BoundElementPropertyAst(o,i,r,a,n)},e.prototype._findComponentDirectiveNames=function(e){var t=[];return e.forEach(function(e){var r=e.directive.type.name;e.directive.isComponent&&t.push(r)}),t},e.prototype._assertOnlyOneComponent=function(e,t){var r=this._findComponentDirectiveNames(e);r.length>1&&this._reportError("More than one component: "+r.join(",")+" in "+t)},e.prototype._assertNoComponentsNorElementBindingsOnTemplate=function(e,t,r,n){var i=this,o=this._findComponentDirectiveNames(e);o.length>0&&this._reportError("Components on an embedded template: "+o.join(",")+" in "+n),t.forEach(function(e){i._reportError("Property binding "+e.name+" not used by any directive on an embedded template in "+e.sourceInfo)}),r.forEach(function(e){i._reportError("Event binding "+e.name+" on an embedded template in "+e.sourceInfo)})},e}(),k=function(){function e(){}return e.prototype.visitElement=function(e,t){var r=m.preparseElement(e);if(r.type===m.PreparsedElementType.SCRIPT||r.type===m.PreparsedElementType.STYLE||r.type===m.PreparsedElementType.STYLESHEET)return null;var n=e.attrs.map(function(e){return[e.name,e.value]}),o=i(e.name,n),a=t.findNgContentIndex(o),s=_.htmlVisitAll(this,e.children,N);return new g.ElementAst(e.name,_.htmlVisitAll(this,e.attrs),[],[],[],[],s,a,e.sourceInfo)},e.prototype.visitAttr=function(e,t){return new g.AttrAst(e.name,e.value,e.sourceInfo)},e.prototype.visitText=function(e,t){var r=t.findNgContentIndex(I);return new g.TextAst(e.value,r,e.sourceInfo)},e}(),M=function(){function e(e,t,r,n){this.name=e,this.expression=t,this.isLiteral=r,this.sourceInfo=n}return e}();!function(){function e(e,t){this.message=e,this.sourceInfo=t}return e}(),t.splitClasses=n;var A=function(){function e(e,t){this.ngContentIndexMatcher=e,this.wildcardNgContentIndex=t}return e.create=function(t){if(0===t.length||!t[0].directive.isComponent)return N;for(var r=new v.SelectorMatcher,n=t[0].directive.template.ngContentSelectors,i=null,o=0;o<n.length;o++){var a=n[o];l.StringWrapper.equals(a,"*")?i=o:r.addSelectables(v.CssSelector.parse(n[o]),o)}return new e(r,i)},e.prototype.findNgContentIndex=function(e){var t=[];return l.isPresent(this.wildcardNgContentIndex)&&t.push(this.wildcardNgContentIndex),this.ngContentIndexMatcher.match(e,function(e,r){t.push(r)}),u.ListWrapper.sort(t),t.length>0?t[0]:null},e}(),N=new A(new v.SelectorMatcher,null),V=new k;return o.define=a,r.exports}),System.register("angular2/src/core/linker/view_manager",["angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/linker/view","angular2/src/core/linker/view_ref","angular2/src/core/render/api","angular2/src/core/linker/view_manager_utils","angular2/src/core/linker/view_pool","angular2/src/core/linker/view_listener","angular2/src/core/profile/profile","angular2/src/core/linker/proto_view_factory"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},c=e("angular2/src/core/di"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/linker/view"),f=e("angular2/src/core/linker/view_ref"),d=e("angular2/src/core/render/api"),h=e("angular2/src/core/linker/view_manager_utils"),g=e("angular2/src/core/linker/view_pool"),v=e("angular2/src/core/linker/view_listener"),y=e("angular2/src/core/profile/profile"),m=e("angular2/src/core/linker/proto_view_factory"),_=function(){function e(e,t,r,n,i){this._viewPool=e,this._viewListener=t,this._utils=r,this._renderer=n,this._createRootHostViewScope=y.wtfCreateScope("AppViewManager#createRootHostView()"),this._destroyRootHostViewScope=y.wtfCreateScope("AppViewManager#destroyRootHostView()"),this._createEmbeddedViewInContainerScope=y.wtfCreateScope("AppViewManager#createEmbeddedViewInContainer()"),this._createHostViewInContainerScope=y.wtfCreateScope("AppViewManager#createHostViewInContainer()"),this._destroyViewInContainerScope=y.wtfCreateScope("AppViewMananger#destroyViewInContainer()"),this._attachViewInContainerScope=y.wtfCreateScope("AppViewMananger#attachViewInContainer()"),this._detachViewInContainerScope=y.wtfCreateScope("AppViewMananger#detachViewInContainer()"),this._protoViewFactory=i}return e.prototype.getViewContainer=function(e){var t=f.internalView(e.parentView);return t.elementInjectors[e.boundElementIndex].getViewContainerRef()},e.prototype.getHostElement=function(e){var t=f.internalView(e);if(t.proto.type!==p.ViewType.HOST)throw new l.BaseException("This operation is only allowed on host views");return t.elementRefs[t.elementOffset]},e.prototype.getNamedElementInComponentView=function(e,t){var r=f.internalView(e.parentView),n=e.boundElementIndex,i=r.getNestedView(n);if(u.isBlank(i))throw new l.BaseException("There is no component directive at element "+n);var o=i.proto.variableLocations.get(t);if(u.isBlank(o))throw new l.BaseException("Could not find variable "+t);return i.elementRefs[i.elementOffset+o]},e.prototype.getComponent=function(e){var t=f.internalView(e.parentView),r=e.boundElementIndex;return this._utils.getComponentInstance(t,r)},e.prototype.createRootHostView=function(e,t,r){var n=this._createRootHostViewScope(),i=f.internalProtoView(e);this._protoViewFactory.initializeProtoViewIfNeeded(i);var o=t;u.isBlank(o)&&(o=i.elementBinders[0].componentDirective.metadata.selector);var a=this._renderer.createRootHostView(i.render,i.mergeInfo.embeddedViewCount+1,o),s=this._createMainView(i,a);return this._renderer.hydrateView(s.render),this._utils.hydrateRootHostView(s,r),y.wtfLeave(n,s.ref)},e.prototype.destroyRootHostView=function(e){var t=this._destroyRootHostViewScope(),r=f.internalView(e);this._renderer.detachFragment(r.renderFragment),this._renderer.dehydrateView(r.render),this._viewDehydrateRecurse(r),this._viewListener.viewDestroyed(r),this._renderer.destroyView(r.render),y.wtfLeave(t)},e.prototype.createEmbeddedViewInContainer=function(e,t,r){var n=this._createEmbeddedViewInContainerScope(),i=f.internalProtoView(r.protoViewRef);if(i.type!==p.ViewType.EMBEDDED)throw new l.BaseException("This method can only be called with embedded ProtoViews!");return this._protoViewFactory.initializeProtoViewIfNeeded(i),y.wtfLeave(n,this._createViewInContainer(e,t,i,r.elementRef,null))},e.prototype.createHostViewInContainer=function(e,t,r,n){var i=this._createHostViewInContainerScope(),o=f.internalProtoView(r);if(o.type!==p.ViewType.HOST)throw new l.BaseException("This method can only be called with host ProtoViews!");return this._protoViewFactory.initializeProtoViewIfNeeded(o),y.wtfLeave(i,this._createViewInContainer(e,t,o,e,n))},e.prototype._createViewInContainer=function(e,t,r,n,i){var o,a=f.internalView(e.parentView),s=e.boundElementIndex,c=f.internalView(n.parentView),l=n.boundElementIndex,d=c.getNestedView(l);return r.type===p.ViewType.EMBEDDED&&u.isPresent(d)&&!d.hydrated()?(o=d,this._attachRenderView(a,s,t,o)):(o=this._createPooledView(r),this._attachRenderView(a,s,t,o),this._renderer.hydrateView(o.render)),this._utils.attachViewInContainer(a,s,c,l,t,o),this._utils.hydrateViewInContainer(a,s,c,l,t,i),o.ref},e.prototype._attachRenderView=function(e,t,r,n){var i=e.elementRefs[t];if(0===r)this._renderer.attachFragmentAfterElement(i,n.renderFragment);else{var o=e.viewContainers[t].views[r-1];this._renderer.attachFragmentAfterFragment(o.renderFragment,n.renderFragment)}},e.prototype.destroyViewInContainer=function(e,t){var r=this._destroyViewInContainerScope(),n=f.internalView(e.parentView),i=e.boundElementIndex;this._destroyViewInContainer(n,i,t),y.wtfLeave(r)},e.prototype.attachViewInContainer=function(e,t,r){var n=this._attachViewInContainerScope(),i=f.internalView(r),o=f.internalView(e.parentView),a=e.boundElementIndex;return this._utils.attachViewInContainer(o,a,null,null,t,i),this._attachRenderView(o,a,t,i),y.wtfLeave(n,r)},e.prototype.detachViewInContainer=function(e,t){var r=this._detachViewInContainerScope(),n=f.internalView(e.parentView),i=e.boundElementIndex,o=n.viewContainers[i],a=o.views[t];return this._utils.detachViewInContainer(n,i,t),this._renderer.detachFragment(a.renderFragment),y.wtfLeave(r,a.ref)},e.prototype._createMainView=function(e,t){var r=this._utils.createView(e,t,this,this._renderer);return this._renderer.setEventDispatcher(r.render,r),this._viewListener.viewCreated(r),r},e.prototype._createPooledView=function(e){var t=this._viewPool.getView(e);return u.isBlank(t)&&(t=this._createMainView(e,this._renderer.createView(e.render,e.mergeInfo.embeddedViewCount+1))),t},e.prototype._destroyPooledView=function(e){var t=this._viewPool.returnView(e);t||(this._viewListener.viewDestroyed(e),this._renderer.destroyView(e.render))},e.prototype._destroyViewInContainer=function(e,t,r){var n=e.viewContainers[t],i=n.views[r];this._viewDehydrateRecurse(i),this._utils.detachViewInContainer(e,t,r),i.viewOffset>0?this._renderer.detachFragment(i.renderFragment):(this._renderer.dehydrateView(i.render),this._renderer.detachFragment(i.renderFragment),this._destroyPooledView(i))},e.prototype._viewDehydrateRecurse=function(e){e.hydrated()&&this._utils.dehydrateView(e);for(var t=e.viewContainers,r=e.viewOffset,n=e.viewOffset+e.proto.mergeInfo.viewCount-1,i=e.elementOffset,o=r;n>=o;o++)for(var a=e.views[o],s=0;s<a.proto.elementBinders.length;s++,i++){var c=t[i];if(u.isPresent(c))for(var l=c.views.length-1;l>=0;l--)this._destroyViewInContainer(a,i,l)}},e=o([c.Injectable(),s(4,c.Inject(c.forwardRef(function(){return m.ProtoViewFactory}))),a("design:paramtypes",[g.AppViewPool,v.AppViewListener,h.AppViewManagerUtils,d.Renderer,Object])],e)}();return t.AppViewManager=_,n.define=i,r.exports}),System.register("angular2/src/animate/css_animation_builder",["angular2/src/animate/css_animation_options","angular2/src/animate/animation"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/animate/css_animation_options"),a=e("angular2/src/animate/animation"),s=function(){function e(e){this.browserDetails=e,this.data=new o.CssAnimationOptions}return e.prototype.addAnimationClass=function(e){return this.data.animationClasses.push(e),this},e.prototype.addClass=function(e){return this.data.classesToAdd.push(e),this},e.prototype.removeClass=function(e){return this.data.classesToRemove.push(e),this},e.prototype.setDuration=function(e){return this.data.duration=e,this},e.prototype.setDelay=function(e){return this.data.delay=e,this},e.prototype.setStyles=function(e,t){return this.setFromStyles(e).setToStyles(t)},e.prototype.setFromStyles=function(e){return this.data.fromStyles=e,this},e.prototype.setToStyles=function(e){return this.data.toStyles=e,this},e.prototype.start=function(e){return new a.Animation(e,this.data,this.browserDetails);
},e}();return t.CssAnimationBuilder=s,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/default_value_accessor",["angular2/src/core/metadata","angular2/src/core/linker","angular2/src/core/render","angular2/src/core/di","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/facade/lang","angular2/src/core/forms/directives/shared"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/metadata"),c=e("angular2/src/core/linker"),u=e("angular2/src/core/render"),l=e("angular2/src/core/di"),p=e("angular2/src/core/forms/directives/control_value_accessor"),f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/forms/directives/shared"),h=f.CONST_EXPR(new l.Binding(p.NG_VALUE_ACCESSOR,{toAlias:l.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){var t=f.isBlank(e)?"":e;d.setProperty(this._renderer,this._elementRef,"value",t)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e=o([s.Directive({selector:"[ng-control],[ng-model],[ng-form-control]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[h]}),a("design:paramtypes",[u.Renderer,c.ElementRef])],e)}();return t.DefaultValueAccessor=g,n.define=i,r.exports}),System.register("angular2/src/http/static_request",["angular2/src/http/headers","angular2/src/http/http_utils","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/http/headers"),a=e("angular2/src/http/http_utils"),s=e("angular2/src/core/facade/lang"),c=function(){function e(e){var t=e.url;if(this.url=e.url,s.isPresent(e.search)){var r=e.search.toString();if(r.length>0){var n="?";s.StringWrapper.contains(this.url,"?")&&(n="&"==this.url[this.url.length-1]?"":"&"),this.url=t+n+r}}this._body=e.body,this.method=a.normalizeMethodName(e.method),this.headers=new o.Headers(e.headers)}return e.prototype.text=function(){return s.isPresent(this._body)?this._body.toString():""},e}();return t.Request=c,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/immediate",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var a=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"),s=n(a);return t["default"]=new s["default"],r.exports=t["default"],i.define=o,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler",["@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler","@reactivex/rxjs/dist/cjs/schedulers/NextTickAction","@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateScheduler"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/NextTickAction"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/ImmediateAction"),d=n(f),h=function(e){function t(){i(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.scheduleNow=function(e,t){return(this.scheduled?new d["default"](this,e):new p["default"](this,e)).schedule(t)},t}(u["default"]);return t["default"]=h,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/DeferObservable",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/util/tryCatch","@reactivex/rxjs/dist/cjs/util/errorObject"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/util/tryCatch"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/util/errorObject"),d=function(e){function t(r){i(this,t),e.call(this),this.observableFactory=r}return o(t,e),t.create=function(e){return new t(e)},t.prototype._subscribe=function(e){var t=p["default"](this.observableFactory)();t===f.errorObject?e.error(f.errorObject.e):t.subscribe(e)},t}(u["default"]);return t["default"]=d,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/observables/FromObservable",["@reactivex/rxjs/dist/cjs/observables/PromiseObservable","@reactivex/rxjs/dist/cjs/observables/IteratorObservable","@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/util/Symbol_observable","@reactivex/rxjs/dist/cjs/util/Symbol_iterator","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/operators/observeOn-support","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/observables/IteratorObservable"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/util/Symbol_observable"),g=n(h),v=e("@reactivex/rxjs/dist/cjs/util/Symbol_iterator"),y=n(v),m=e("@reactivex/rxjs/dist/cjs/Observable"),_=n(m),b=e("@reactivex/rxjs/dist/cjs/operators/observeOn-support"),x=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),w=n(x),j=Array.isArray,S=function(e){function t(r,n){i(this,t),e.call(this,null),this.ish=r,this.scheduler=n}return o(t,e),t.create=function(e){var r=arguments.length<=1||void 0===arguments[1]?w["default"]:arguments[1];if(e){if(j(e))return new d["default"](e,r);if("function"==typeof e.then)return new u["default"](e,r);if("function"==typeof e[g["default"]])return e instanceof _["default"]?e:new t(e,r);if("function"==typeof e[y["default"]])return new p["default"](e,null,null,r)}throw new TypeError(typeof e+" is not observable")},t.prototype._subscribe=function(e){var t=(this.ish,this.scheduler);return this.ish[g["default"]]().subscribe(t===w["default"]?e:new b.ObserveOnSubscriber(e,t,0))},t}(_["default"]);return t["default"]=S,r.exports=t["default"],a.define=s,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/concat-static",["@reactivex/rxjs/dist/cjs/operators/merge-static","@reactivex/rxjs/dist/cjs/schedulers/immediate"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=l["default"],t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];return r.length,"function"==typeof r[r.length-1].schedule&&(e=r.pop(),r.push(1,e)),c["default"].apply(this,r)}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/operators/merge-static"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),l=n(u);return r.exports=t["default"],o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/operators/combineLatest",["@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/operators/combineLatest-support"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t[t.length-1];return"function"==typeof n&&t.pop(),t.unshift(this),new c["default"](t).lift(new u.CombineLatestOperator(n))}var o=System.global,a=o.define;o.define=void 0,t.__esModule=!0,t["default"]=i;var s=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),c=n(s),u=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-support");return r.exports=t["default"],o.define=a,r.exports}),System.register("angular2/src/core/di/injector",["angular2/src/core/facade/collection","angular2/src/core/di/binding","angular2/src/core/di/exceptions","angular2/src/core/facade/lang","angular2/src/core/di/key","angular2/src/core/di/metadata"],!0,function(e,t,r){function n(e,t){return e===t||t===h.PublicAndPrivate||e===h.PublicAndPrivate}function i(e,t){for(var r=[],n=0;n<e._proto.numberOfBindings;++n)r.push(t(e._proto.getBindingAtIndex(n)));return r}var o=System.global,a=o.define;o.define=void 0;var s=e("angular2/src/core/facade/collection"),c=e("angular2/src/core/di/binding"),u=e("angular2/src/core/di/exceptions"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/di/key"),f=e("angular2/src/core/di/metadata"),d=10;t.UNDEFINED=l.CONST_EXPR(new Object),function(e){e[e.Public=0]="Public",e[e.Private=1]="Private",e[e.PublicAndPrivate=2]="PublicAndPrivate"}(t.Visibility||(t.Visibility={}));var h=t.Visibility,g=function(){function e(e,t){this.binding0=null,this.binding1=null,this.binding2=null,this.binding3=null,this.binding4=null,this.binding5=null,this.binding6=null,this.binding7=null,this.binding8=null,this.binding9=null,this.keyId0=null,this.keyId1=null,this.keyId2=null,this.keyId3=null,this.keyId4=null,this.keyId5=null,this.keyId6=null,this.keyId7=null,this.keyId8=null,this.keyId9=null,this.visibility0=null,this.visibility1=null,this.visibility2=null,this.visibility3=null,this.visibility4=null,this.visibility5=null,this.visibility6=null,this.visibility7=null,this.visibility8=null,this.visibility9=null;var r=t.length;r>0&&(this.binding0=t[0].binding,this.keyId0=t[0].getKeyId(),this.visibility0=t[0].visibility),r>1&&(this.binding1=t[1].binding,this.keyId1=t[1].getKeyId(),this.visibility1=t[1].visibility),r>2&&(this.binding2=t[2].binding,this.keyId2=t[2].getKeyId(),this.visibility2=t[2].visibility),r>3&&(this.binding3=t[3].binding,this.keyId3=t[3].getKeyId(),this.visibility3=t[3].visibility),r>4&&(this.binding4=t[4].binding,this.keyId4=t[4].getKeyId(),this.visibility4=t[4].visibility),r>5&&(this.binding5=t[5].binding,this.keyId5=t[5].getKeyId(),this.visibility5=t[5].visibility),r>6&&(this.binding6=t[6].binding,this.keyId6=t[6].getKeyId(),this.visibility6=t[6].visibility),r>7&&(this.binding7=t[7].binding,this.keyId7=t[7].getKeyId(),this.visibility7=t[7].visibility),r>8&&(this.binding8=t[8].binding,this.keyId8=t[8].getKeyId(),this.visibility8=t[8].visibility),r>9&&(this.binding9=t[9].binding,this.keyId9=t[9].getKeyId(),this.visibility9=t[9].visibility)}return e.prototype.getBindingAtIndex=function(e){if(0==e)return this.binding0;if(1==e)return this.binding1;if(2==e)return this.binding2;if(3==e)return this.binding3;if(4==e)return this.binding4;if(5==e)return this.binding5;if(6==e)return this.binding6;if(7==e)return this.binding7;if(8==e)return this.binding8;if(9==e)return this.binding9;throw new u.OutOfBoundsError(e)},e.prototype.createInjectorStrategy=function(e){return new m(e,this)},e}();t.ProtoInjectorInlineStrategy=g;var v=function(){function e(e,t){var r=t.length;this.bindings=s.ListWrapper.createFixedSize(r),this.keyIds=s.ListWrapper.createFixedSize(r),this.visibilities=s.ListWrapper.createFixedSize(r);for(var n=0;r>n;n++)this.bindings[n]=t[n].binding,this.keyIds[n]=t[n].getKeyId(),this.visibilities[n]=t[n].visibility}return e.prototype.getBindingAtIndex=function(e){if(0>e||e>=this.bindings.length)throw new u.OutOfBoundsError(e);return this.bindings[e]},e.prototype.createInjectorStrategy=function(e){return new _(this,e)},e}();t.ProtoInjectorDynamicStrategy=v;var y=function(){function e(e){this.numberOfBindings=e.length,this._strategy=e.length>d?new v(this,e):new g(this,e)}return e.prototype.getBindingAtIndex=function(e){return this._strategy.getBindingAtIndex(e)},e}();t.ProtoInjector=y;var m=function(){function e(e,r){this.injector=e,this.protoStrategy=r,this.obj0=t.UNDEFINED,this.obj1=t.UNDEFINED,this.obj2=t.UNDEFINED,this.obj3=t.UNDEFINED,this.obj4=t.UNDEFINED,this.obj5=t.UNDEFINED,this.obj6=t.UNDEFINED,this.obj7=t.UNDEFINED,this.obj8=t.UNDEFINED,this.obj9=t.UNDEFINED}return e.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},e.prototype.instantiateBinding=function(e,t){return this.injector._new(e,t)},e.prototype.attach=function(e,t){var r=this.injector;r._parent=e,r._isHost=t},e.prototype.getObjByKeyId=function(e,r){var i=this.protoStrategy,o=this.injector;return i.keyId0===e&&n(i.visibility0,r)?(this.obj0===t.UNDEFINED&&(this.obj0=o._new(i.binding0,i.visibility0)),this.obj0):i.keyId1===e&&n(i.visibility1,r)?(this.obj1===t.UNDEFINED&&(this.obj1=o._new(i.binding1,i.visibility1)),this.obj1):i.keyId2===e&&n(i.visibility2,r)?(this.obj2===t.UNDEFINED&&(this.obj2=o._new(i.binding2,i.visibility2)),this.obj2):i.keyId3===e&&n(i.visibility3,r)?(this.obj3===t.UNDEFINED&&(this.obj3=o._new(i.binding3,i.visibility3)),this.obj3):i.keyId4===e&&n(i.visibility4,r)?(this.obj4===t.UNDEFINED&&(this.obj4=o._new(i.binding4,i.visibility4)),this.obj4):i.keyId5===e&&n(i.visibility5,r)?(this.obj5===t.UNDEFINED&&(this.obj5=o._new(i.binding5,i.visibility5)),this.obj5):i.keyId6===e&&n(i.visibility6,r)?(this.obj6===t.UNDEFINED&&(this.obj6=o._new(i.binding6,i.visibility6)),this.obj6):i.keyId7===e&&n(i.visibility7,r)?(this.obj7===t.UNDEFINED&&(this.obj7=o._new(i.binding7,i.visibility7)),this.obj7):i.keyId8===e&&n(i.visibility8,r)?(this.obj8===t.UNDEFINED&&(this.obj8=o._new(i.binding8,i.visibility8)),this.obj8):i.keyId9===e&&n(i.visibility9,r)?(this.obj9===t.UNDEFINED&&(this.obj9=o._new(i.binding9,i.visibility9)),this.obj9):t.UNDEFINED},e.prototype.getObjAtIndex=function(e){if(0==e)return this.obj0;if(1==e)return this.obj1;if(2==e)return this.obj2;if(3==e)return this.obj3;if(4==e)return this.obj4;if(5==e)return this.obj5;if(6==e)return this.obj6;if(7==e)return this.obj7;if(8==e)return this.obj8;if(9==e)return this.obj9;throw new u.OutOfBoundsError(e)},e.prototype.getMaxNumberOfObjects=function(){return d},e}();t.InjectorInlineStrategy=m;var _=function(){function e(e,r){this.protoStrategy=e,this.injector=r,this.objs=s.ListWrapper.createFixedSize(e.bindings.length),s.ListWrapper.fill(this.objs,t.UNDEFINED)}return e.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},e.prototype.instantiateBinding=function(e,t){return this.injector._new(e,t)},e.prototype.attach=function(e,t){var r=this.injector;r._parent=e,r._isHost=t},e.prototype.getObjByKeyId=function(e,r){for(var i=this.protoStrategy,o=0;o<i.keyIds.length;o++)if(i.keyIds[o]===e&&n(i.visibilities[o],r))return this.objs[o]===t.UNDEFINED&&(this.objs[o]=this.injector._new(i.bindings[o],i.visibilities[o])),this.objs[o];return t.UNDEFINED},e.prototype.getObjAtIndex=function(e){if(0>e||e>=this.objs.length)throw new u.OutOfBoundsError(e);return this.objs[e]},e.prototype.getMaxNumberOfObjects=function(){return this.objs.length},e}();t.InjectorDynamicStrategy=_;var b=function(){function e(e,t){this.binding=e,this.visibility=t}return e.prototype.getKeyId=function(){return this.binding.key.id},e}();t.BindingWithVisibility=b;var x=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._proto=e,this._parent=t,this._depProvider=r,this._debugContext=n,this._isHost=!1,this._constructionCounter=0,this._strategy=e._strategy.createInjectorStrategy(this)}return e.resolve=function(e){return c.resolveBindings(e)},e.resolveAndCreate=function(t){var r=e.resolve(t);return e.fromResolvedBindings(r)},e.fromResolvedBindings=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new y(r);return new e(n,null,null)},e.prototype.debugContext=function(){return this._debugContext()},e.prototype.get=function(e){return this._getByKey(p.Key.get(e),null,null,!1,h.PublicAndPrivate)},e.prototype.getOptional=function(e){return this._getByKey(p.Key.get(e),null,null,!0,h.PublicAndPrivate)},e.prototype.getAt=function(e){return this._strategy.getObjAtIndex(e)},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"internalStrategy",{get:function(){return this._strategy},enumerable:!0,configurable:!0}),e.prototype.resolveAndCreateChild=function(t){var r=e.resolve(t);return this.createChildFromResolved(r)},e.prototype.createChildFromResolved=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new y(r),i=new e(n,null,null);return i._parent=this,i},e.prototype.resolveAndInstantiate=function(t){return this.instantiateResolved(e.resolve([t])[0])},e.prototype.instantiateResolved=function(e){return this._instantiateBinding(e,h.PublicAndPrivate)},e.prototype._new=function(e,t){if(this._constructionCounter++>this._strategy.getMaxNumberOfObjects())throw new u.CyclicDependencyError(this,e.key);return this._instantiateBinding(e,t)},e.prototype._instantiateBinding=function(e,t){if(e.multiBinding){for(var r=s.ListWrapper.createFixedSize(e.resolvedFactories.length),n=0;n<e.resolvedFactories.length;++n)r[n]=this._instantiate(e,e.resolvedFactories[n],t);return r}return this._instantiate(e,e.resolvedFactories[0],t)},e.prototype._instantiate=function(e,t,r){var n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_,b,x,w,j,S=t.factory,C=t.dependencies,E=C.length;try{n=E>0?this._getByDependency(e,C[0],r):null,i=E>1?this._getByDependency(e,C[1],r):null,o=E>2?this._getByDependency(e,C[2],r):null,a=E>3?this._getByDependency(e,C[3],r):null,s=E>4?this._getByDependency(e,C[4],r):null,c=E>5?this._getByDependency(e,C[5],r):null,l=E>6?this._getByDependency(e,C[6],r):null,p=E>7?this._getByDependency(e,C[7],r):null,f=E>8?this._getByDependency(e,C[8],r):null,d=E>9?this._getByDependency(e,C[9],r):null,h=E>10?this._getByDependency(e,C[10],r):null,g=E>11?this._getByDependency(e,C[11],r):null,v=E>12?this._getByDependency(e,C[12],r):null,y=E>13?this._getByDependency(e,C[13],r):null,m=E>14?this._getByDependency(e,C[14],r):null,_=E>15?this._getByDependency(e,C[15],r):null,b=E>16?this._getByDependency(e,C[16],r):null,x=E>17?this._getByDependency(e,C[17],r):null,w=E>18?this._getByDependency(e,C[18],r):null,j=E>19?this._getByDependency(e,C[19],r):null}catch(R){throw(R instanceof u.AbstractBindingError||R instanceof u.InstantiationError)&&R.addKey(this,e.key),R}var O;try{switch(E){case 0:O=S();break;case 1:O=S(n);break;case 2:O=S(n,i);break;case 3:O=S(n,i,o);break;case 4:O=S(n,i,o,a);break;case 5:O=S(n,i,o,a,s);break;case 6:O=S(n,i,o,a,s,c);break;case 7:O=S(n,i,o,a,s,c,l);break;case 8:O=S(n,i,o,a,s,c,l,p);break;case 9:O=S(n,i,o,a,s,c,l,p,f);break;case 10:O=S(n,i,o,a,s,c,l,p,f,d);break;case 11:O=S(n,i,o,a,s,c,l,p,f,d,h);break;case 12:O=S(n,i,o,a,s,c,l,p,f,d,h,g);break;case 13:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v);break;case 14:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y);break;case 15:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m);break;case 16:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_);break;case 17:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_,b);break;case 18:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_,b,x);break;case 19:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_,b,x,w);break;case 20:O=S(n,i,o,a,s,c,l,p,f,d,h,g,v,y,m,_,b,x,w,j)}}catch(R){throw new u.InstantiationError(this,R,R.stack,e.key)}return O},e.prototype._getByDependency=function(e,r,n){var i=l.isPresent(this._depProvider)?this._depProvider.getDependency(this,e,r):t.UNDEFINED;return i!==t.UNDEFINED?i:this._getByKey(r.key,r.lowerBoundVisibility,r.upperBoundVisibility,r.optional,n)},e.prototype._getByKey=function(e,t,r,n,i){return e===w?this:r instanceof f.SelfMetadata?this._getByKeySelf(e,n,i):r instanceof f.HostMetadata?this._getByKeyHost(e,n,i,t):this._getByKeyDefault(e,n,i,t)},e.prototype._throwOrNull=function(e,t){if(t)return null;throw new u.NoBindingError(this,e)},e.prototype._getByKeySelf=function(e,r,n){var i=this._strategy.getObjByKeyId(e.id,n);return i!==t.UNDEFINED?i:this._throwOrNull(e,r)},e.prototype._getByKeyHost=function(e,r,n,i){var o=this;if(i instanceof f.SkipSelfMetadata){if(o._isHost)return this._getPrivateDependency(e,r,o);o=o._parent}for(;null!=o;){var a=o._strategy.getObjByKeyId(e.id,n);if(a!==t.UNDEFINED)return a;if(l.isPresent(o._parent)&&o._isHost)return this._getPrivateDependency(e,r,o);o=o._parent}return this._throwOrNull(e,r)},e.prototype._getPrivateDependency=function(e,r,n){var i=n._parent._strategy.getObjByKeyId(e.id,h.Private);return i!==t.UNDEFINED?i:this._throwOrNull(e,r)},e.prototype._getByKeyDefault=function(e,r,n,i){var o=this;for(i instanceof f.SkipSelfMetadata&&(n=o._isHost?h.PublicAndPrivate:h.Public,o=o._parent);null!=o;){var a=o._strategy.getObjByKeyId(e.id,n);if(a!==t.UNDEFINED)return a;n=o._isHost?h.PublicAndPrivate:h.Public,o=o._parent}return this._throwOrNull(e,r)},Object.defineProperty(e.prototype,"displayName",{get:function(){return"Injector(bindings: ["+i(this,function(e){return' "'+e.key.displayName+'" '}).join(", ")+"])"},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.displayName},e}();t.Injector=x;var w=p.Key.get(x);return o.define=a,r.exports}),System.register("angular2/src/core/change_detection/dynamic_change_detector",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/abstract_change_detector","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/constants","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){function n(e,t){return e===t?!0:e instanceof String&&t instanceof String&&e==t?!0:e!==e&&t!==t?!0:!1}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/exceptions"),u=e("angular2/src/core/facade/collection"),l=e("angular2/src/core/change_detection/abstract_change_detector"),p=e("angular2/src/core/change_detection/change_detection_util"),f=e("angular2/src/core/change_detection/constants"),d=e("angular2/src/core/change_detection/proto_record"),h=function(e){function t(t,r,n,i,o,a,s,c,l,p){e.call(this,t,r,n,i,o,a),this._records=s,this._eventBindings=c,this._directiveRecords=l,this._genConfig=p,this.directives=null;var f=s.length+1;this.values=u.ListWrapper.createFixedSize(f),this.localPipes=u.ListWrapper.createFixedSize(f),this.prevContexts=u.ListWrapper.createFixedSize(f),this.changes=u.ListWrapper.createFixedSize(f),this.dehydrateDirectives(!1)}return a(t,e),t.prototype.handleEventInternal=function(e,t,r){var n=this,i=!1;return this._matchingEventBindings(e,t).forEach(function(e){var t=n._processEventBinding(e,r);t===!1&&(i=!0)}),i},t.prototype._processEventBinding=function(e,t){var r=u.ListWrapper.createFixedSize(e.records.length);r[0]=this.values[0];for(var n=0;n<e.records.length;++n){var i=e.records[n],o=this._calculateCurrValue(i,r,t);if(i.lastInBinding)return this._markPathAsCheckOnce(i),o;this._writeSelf(i,o,r)}throw new c.BaseException("Cannot be reached")},t.prototype._markPathAsCheckOnce=function(e){if(!e.bindingRecord.isDefaultChangeDetection()){var t=e.bindingRecord.directiveRecord;this._getDetectorFor(t.directiveIndex).markPathToRootAsCheckOnce()}},t.prototype._matchingEventBindings=function(e,t){return u.ListWrapper.filter(this._eventBindings,function(r){return r.eventName==e&&r.elIndex===t})},t.prototype.hydrateDirectives=function(t){if(this.values[0]=this.context,this.directives=t,this.strategy===f.ChangeDetectionStrategy.OnPushObserve)for(var r=0;r<this.directiveIndices.length;++r){var n=this.directiveIndices[r];e.prototype.observeDirective.call(this,t.getDirectiveFor(n),r)}},t.prototype.dehydrateDirectives=function(e){e&&this._destroyPipes(),this.values[0]=null,this.directives=null,u.ListWrapper.fill(this.values,p.ChangeDetectionUtil.uninitialized,1),u.ListWrapper.fill(this.changes,!1),u.ListWrapper.fill(this.localPipes,null),u.ListWrapper.fill(this.prevContexts,p.ChangeDetectionUtil.uninitialized)},t.prototype._destroyPipes=function(){for(var e=0;e<this.localPipes.length;++e)s.isPresent(this.localPipes[e])&&p.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[e])},t.prototype.checkNoChanges=function(){this.runDetectChanges(!0)},t.prototype.detectChangesInRecordsInternal=function(e){for(var t=this._records,r=null,n=!1,i=0;i<t.length;++i){var o=t[i],a=o.bindingRecord,c=a.directiveRecord;if(this._firstInBinding(o)&&(this.propertyBindingIndex=o.propertyBindingIndex),o.isLifeCycleRecord())"DoCheck"!==o.name||e?"OnInit"!==o.name||e||this.alreadyChecked?"OnChanges"===o.name&&s.isPresent(r)&&!e&&this._getDirectiveFor(c.directiveIndex).onChanges(r):this._getDirectiveFor(c.directiveIndex).onInit():this._getDirectiveFor(c.directiveIndex).doCheck();else{var u=this._check(o,e,this.values,this.locals);s.isPresent(u)&&(this._updateDirectiveOrElement(u,a),n=!0,r=this._addChange(a,u,r))}o.lastInDirective&&(r=null,n&&!a.isDefaultChangeDetection()&&this._getDetectorFor(c.directiveIndex).markAsCheckOnce(),n=!1)}},t.prototype._firstInBinding=function(e){var t=p.ChangeDetectionUtil.protoByIndex(this._records,e.selfIndex-1);return s.isBlank(t)||t.bindingRecord!==e.bindingRecord},t.prototype.afterContentLifecycleCallbacksInternal=function(){for(var e=this._directiveRecords,t=e.length-1;t>=0;--t){var r=e[t];r.callAfterContentInit&&!this.alreadyChecked&&this._getDirectiveFor(r.directiveIndex).afterContentInit(),r.callAfterContentChecked&&this._getDirectiveFor(r.directiveIndex).afterContentChecked()}},t.prototype.afterViewLifecycleCallbacksInternal=function(){for(var e=this._directiveRecords,t=e.length-1;t>=0;--t){var r=e[t];r.callAfterViewInit&&!this.alreadyChecked&&this._getDirectiveFor(r.directiveIndex).afterViewInit(),r.callAfterViewChecked&&this._getDirectiveFor(r.directiveIndex).afterViewChecked()}},t.prototype._updateDirectiveOrElement=function(t,r){if(s.isBlank(r.directiveRecord))e.prototype.notifyDispatcher.call(this,t.currentValue);else{var n=r.directiveRecord.directiveIndex;r.setter(this._getDirectiveFor(n),t.currentValue)}this._genConfig.logBindingUpdate&&e.prototype.logBindingUpdate.call(this,t.currentValue)},t.prototype._addChange=function(t,r,n){return t.callOnChanges()?e.prototype.addChange.call(this,n,r.previousValue,r.currentValue):n},t.prototype._getDirectiveFor=function(e){return this.directives.getDirectiveFor(e)},t.prototype._getDetectorFor=function(e){return this.directives.getDetectorFor(e)},t.prototype._check=function(e,t,r,n){return e.isPipeRecord()?this._pipeCheck(e,t,r):this._referenceCheck(e,t,r,n)},t.prototype._referenceCheck=function(t,r,i,o){if(this._pureFuncAndArgsDidNotChange(t))return this._setChanged(t,!1),null;var a=this._calculateCurrValue(t,i,o);if(this.strategy===f.ChangeDetectionStrategy.OnPushObserve&&e.prototype.observeValue.call(this,a,t.selfIndex),t.shouldBeChecked()){var s=this._readSelf(t,i);if(n(s,a))return this._setChanged(t,!1),null;if(t.lastInBinding){var c=p.ChangeDetectionUtil.simpleChange(s,a);return r&&this.throwOnChangeError(s,a),this._writeSelf(t,a,i),this._setChanged(t,!0),c}return this._writeSelf(t,a,i),this._setChanged(t,!0),null}return this._writeSelf(t,a,i),this._setChanged(t,!0),null},t.prototype._calculateCurrValue=function(e,t,r){switch(e.mode){case d.RecordType.Self:return this._readContext(e,t);case d.RecordType.Const:return e.funcOrValue;case d.RecordType.PropertyRead:var n=this._readContext(e,t);return e.funcOrValue(n);case d.RecordType.SafeProperty:var n=this._readContext(e,t);return s.isBlank(n)?null:e.funcOrValue(n);case d.RecordType.PropertyWrite:var n=this._readContext(e,t),i=this._readArgs(e,t)[0];return e.funcOrValue(n,i),i;case d.RecordType.KeyedWrite:var n=this._readContext(e,t),o=this._readArgs(e,t)[0],i=this._readArgs(e,t)[1];return n[o]=i,i;case d.RecordType.Local:return r.get(e.name);case d.RecordType.InvokeMethod:var n=this._readContext(e,t),a=this._readArgs(e,t);return e.funcOrValue(n,a);case d.RecordType.SafeMethodInvoke:var n=this._readContext(e,t);if(s.isBlank(n))return null;var a=this._readArgs(e,t);return e.funcOrValue(n,a);case d.RecordType.KeyedRead:var u=this._readArgs(e,t)[0];return this._readContext(e,t)[u];case d.RecordType.Chain:var a=this._readArgs(e,t);return a[a.length-1];case d.RecordType.InvokeClosure:return s.FunctionWrapper.apply(this._readContext(e,t),this._readArgs(e,t));case d.RecordType.Interpolate:case d.RecordType.PrimitiveOp:case d.RecordType.CollectionLiteral:return s.FunctionWrapper.apply(e.funcOrValue,this._readArgs(e,t));default:throw new c.BaseException("Unknown operation "+e.mode)}},t.prototype._pipeCheck=function(e,t,r){var i=this._readContext(e,r),o=this._pipeFor(e,i);if(!o.pure||this._argsOrContextChanged(e)){var a=this._readArgs(e,r),s=o.pipe.transform(i,a);if(e.shouldBeChecked()){var c=this._readSelf(e,r);if(n(c,s))return this._setChanged(e,!1),null;if(s=p.ChangeDetectionUtil.unwrapValue(s),e.lastInBinding){var u=p.ChangeDetectionUtil.simpleChange(c,s);return t&&this.throwOnChangeError(c,s),this._writeSelf(e,s,r),this._setChanged(e,!0),u}return this._writeSelf(e,s,r),this._setChanged(e,!0),null}return this._writeSelf(e,s,r),this._setChanged(e,!0),null}},t.prototype._pipeFor=function(e,t){var r=this._readPipe(e);if(s.isPresent(r))return r;var n=this.pipes.get(e.name);return this._writePipe(e,n),n},t.prototype._readContext=function(e,t){return-1==e.contextIndex?this._getDirectiveFor(e.directiveIndex):t[e.contextIndex]},t.prototype._readSelf=function(e,t){return t[e.selfIndex]},t.prototype._writeSelf=function(e,t,r){r[e.selfIndex]=t},t.prototype._readPipe=function(e){return this.localPipes[e.selfIndex]},t.prototype._writePipe=function(e,t){this.localPipes[e.selfIndex]=t},t.prototype._setChanged=function(e,t){e.argumentToPureFunction&&(this.changes[e.selfIndex]=t)},t.prototype._pureFuncAndArgsDidNotChange=function(e){return e.isPureFunction()&&!this._argsChanged(e)},t.prototype._argsChanged=function(e){for(var t=e.args,r=0;r<t.length;++r)if(this.changes[t[r]])return!0;return!1},t.prototype._argsOrContextChanged=function(e){return this._argsChanged(e)||this.changes[e.contextIndex]},t.prototype._readArgs=function(e,t){for(var r=u.ListWrapper.createFixedSize(e.args.length),n=e.args,i=0;i<n.length;++i)r[i]=t[n[i]];return r},t}(l.AbstractChangeDetector);return t.DynamicChangeDetector=h,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/jit_proto_change_detector",["angular2/src/core/change_detection/change_detection_jit_generator"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/change_detection/change_detection_jit_generator"),a=function(){
function e(e){this.definition=e,this._factory=this._createFactory(e)}return e.isSupported=function(){return!0},e.prototype.instantiate=function(e){return this._factory(e)},e.prototype._createFactory=function(e){return new o.ChangeDetectorJITGenerator(e,"util","AbstractChangeDetector").generate()},e}();return t.JitProtoChangeDetector=a,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Subject",["@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"],!0,function(e,t,r){function n(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("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=System.global,s=a.define;a.define=void 0,t.__esModule=!0;var c=e("@reactivex/rxjs/dist/cjs/Observable"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/Subscriber"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/Subscription"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/subjects/SubjectSubscription"),g=n(h),v=d["default"].prototype.add,y=d["default"].prototype.remove,m=d["default"].prototype.unsubscribe,_=p["default"].prototype.next,b=p["default"].prototype.error,x=p["default"].prototype.complete,w=p["default"].prototype._next,j=p["default"].prototype._error,S=p["default"].prototype._complete,C=u["default"].prototype._subscribe,E=function(e){function t(){i(this,t);for(var r=arguments.length,n=Array(r),o=0;r>o;o++)n[o]=arguments[o];e.call.apply(e,[this].concat(n)),this.observers=[],this.isUnsubscribed=!1,this.dispatching=!1,this.errorSignal=!1,this.completeSignal=!1}return o(t,e),t.create=function(e,t){return new R(e,t)},t.prototype.lift=function(e){var t=new R(this,this.destination||this);return t.operator=e,t},t.prototype._subscribe=function(e){if(!e.isUnsubscribed){if(this.errorSignal)return void e.error(this.errorInstance);if(this.completeSignal)return void e.complete();if(this.isUnsubscribed)throw new Error("Cannot subscribe to a disposed Subject.");return this.observers.push(e),new g["default"](this,e)}},t.prototype.add=function(e){v.call(this,e)},t.prototype.remove=function(e){y.call(this,e)},t.prototype.unsubscribe=function(){this.observers=void 0,m.call(this)},t.prototype.next=function(e){this.isUnsubscribed||(this.dispatching=!0,this._next(e),this.dispatching=!1,this.errorSignal?this.error(this.errorInstance):this.completeSignal&&this.complete())},t.prototype.error=function(e){this.isUnsubscribed||this.completeSignal||(this.errorSignal=!0,this.errorInstance=e,this.dispatching||(this._error(e),this.unsubscribe()))},t.prototype.complete=function(){this.isUnsubscribed||this.errorSignal||(this.completeSignal=!0,this.dispatching||(this._complete(),this.unsubscribe()))},t.prototype._next=function(e){for(var t=-1,r=this.observers.slice(0),n=r.length;++t<n;)r[t].next(e)},t.prototype._error=function(e){var t=-1,r=this.observers,n=r.length;for(this.observers=void 0,this.isUnsubscribed=!0;++t<n;)r[t].error(e);this.isUnsubscribed=!1},t.prototype._complete=function(){var e=-1,t=this.observers,r=t.length;for(this.observers=void 0,this.isUnsubscribed=!0;++e<r;)t[e].complete();this.isUnsubscribed=!1},t}(u["default"]);t["default"]=E;var R=function(e){function t(r,n){i(this,t),e.call(this),this.source=r,this.destination=n}return o(t,e),t.prototype._subscribe=function(e){return C.call(this,e)},t.prototype.next=function(e){_.call(this,e)},t.prototype.error=function(e){b.call(this,e)},t.prototype.complete=function(){x.call(this)},t.prototype._next=function(e){w.call(this,e)},t.prototype._error=function(e){j.call(this,e)},t.prototype._complete=function(){S.call(this)},t}(E);return r.exports=t["default"],a.define=s,r.exports}),System.register("angular2/src/core/compiler/template_compiler",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/facade/async","angular2/src/core/linker/template_commands","angular2/src/core/compiler/directive_metadata","angular2/src/core/di","angular2/src/core/compiler/source_module","angular2/src/core/compiler/change_detector_compiler","angular2/src/core/compiler/style_compiler","angular2/src/core/compiler/command_compiler","angular2/src/core/compiler/template_parser","angular2/src/core/compiler/template_normalizer","angular2/src/core/compiler/runtime_metadata","angular2/src/core/application_tokens","angular2/src/core/compiler/command_compiler","angular2/src/core/compiler/util","angular2/src/core/di"],!0,function(e,t,r){function n(e){if(!e.isComponent)throw new h.BaseException("Could not compile '"+e.type.name+"' because it is not a component.")}function i(e){return e.name+"Template"}function o(e){var t=e.substring(0,e.length-P.MODULE_SUFFIX.length);return t+".template"+P.MODULE_SUFFIX}function a(e,t){for(var r=0;r<e.length;r++)t.push(e[r])}function s(e){return""+b.moduleRef(o(e.type.moduleUrl))+i(e.type)}var c=System.global,u=c.define;c.define=void 0;var l=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},p=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},d=e("angular2/src/core/facade/lang"),h=e("angular2/src/core/facade/exceptions"),g=e("angular2/src/core/facade/collection"),v=e("angular2/src/core/facade/async"),y=e("angular2/src/core/linker/template_commands"),m=e("angular2/src/core/compiler/directive_metadata"),_=e("angular2/src/core/di"),b=e("angular2/src/core/compiler/source_module"),x=e("angular2/src/core/compiler/change_detector_compiler"),w=e("angular2/src/core/compiler/style_compiler"),j=e("angular2/src/core/compiler/command_compiler"),S=e("angular2/src/core/compiler/template_parser"),C=e("angular2/src/core/compiler/template_normalizer"),E=e("angular2/src/core/compiler/runtime_metadata"),R=e("angular2/src/core/application_tokens"),O=e("angular2/src/core/compiler/command_compiler"),P=e("angular2/src/core/compiler/util"),I=e("angular2/src/core/di"),D=function(){function e(e,t,r,n,i,o,a){this._runtimeMetadataResolver=e,this._templateNormalizer=t,this._templateParser=r,this._styleCompiler=n,this._commandCompiler=i,this._cdCompiler=o,this._hostCacheKeys=new Map,this._compiledTemplateCache=new Map,this._compiledTemplateDone=new Map,this._appId=a}return e.prototype.normalizeDirectiveMetadata=function(e){if(!e.isComponent)return v.PromiseWrapper.resolve(e);var t;return t=e.isComponent?this._templateNormalizer.normalizeTemplate(e.type,e.template):v.PromiseWrapper.resolve(null),t.then(function(t){return new m.CompileDirectiveMetadata({type:e.type,isComponent:e.isComponent,dynamicLoadable:e.dynamicLoadable,selector:e.selector,exportAs:e.exportAs,changeDetection:e.changeDetection,inputs:e.inputs,outputs:e.outputs,hostListeners:e.hostListeners,hostProperties:e.hostProperties,hostAttributes:e.hostAttributes,lifecycleHooks:e.lifecycleHooks,template:t})})},e.prototype.compileHostComponentRuntime=function(e){var t=this._hostCacheKeys.get(e);if(d.isBlank(t)){t=new Object,this._hostCacheKeys.set(e,t);var r=this._runtimeMetadataResolver.getMetadata(e);n(r);var i=m.createHostComponentMeta(r.type,r.selector);this._compileComponentRuntime(t,i,[r],new Set)}return this._compiledTemplateDone.get(t).then(function(e){return new y.CompiledHostTemplate(function(){return e})})},e.prototype.clearCache=function(){this._hostCacheKeys.clear(),this._styleCompiler.clearCache(),this._compiledTemplateCache.clear(),this._compiledTemplateDone.clear()},e.prototype._compileComponentRuntime=function(e,t,r,n){var i=this,o=this._compiledTemplateCache.get(e),a=this._compiledTemplateDone.get(e);if(d.isBlank(o)){var s,c,u,l=y.nextTemplateId();o=new y.CompiledTemplate(l,function(e,t){return[c,u,s]}),this._compiledTemplateCache.set(e,o),n.add(e),a=v.PromiseWrapper.all([this._styleCompiler.compileComponentRuntime(this._appId,l,t.template)].concat(r.map(function(e){return i.normalizeDirectiveMetadata(e)}))).then(function(e){var r=[],o=e.slice(1),a=i._templateParser.parse(t.template.template,o,t.type.name),p=i._cdCompiler.compileComponentRuntime(t.type,t.changeDetection,a);return c=p[0],s=e[0],u=i._compileCommandsRuntime(t,l,a,p,n,r),v.PromiseWrapper.all(r)}).then(function(t){return g.SetWrapper["delete"](n,e),o}),this._compiledTemplateDone.set(e,a)}return o},e.prototype._compileCommandsRuntime=function(e,t,r,n,i,o){var a=this;return this._commandCompiler.compileComponentRuntime(e,this._appId,t,r,n,function(e){var t=e.type.runtime,r=a._runtimeMetadataResolver.getViewDirectivesMetadata(e.type.runtime),n=g.SetWrapper.has(i,t),s=a._compileComponentRuntime(t,e,r,i);return n||o.push(a._compiledTemplateDone.get(t)),s})},e.prototype.compileTemplatesCodeGen=function(e){var t=this;if(0===e.length)throw new h.BaseException("No components given");var r=[],a=[],s=[],c="templateId",u="appId";e.forEach(function(e){var i=e.component;if(n(i),s.push(i),t._processTemplateCodeGen(i,u,c,e.directives,r,a),i.dynamicLoadable){var o=m.createHostComponentMeta(i.type,i.selector);s.push(o),t._processTemplateCodeGen(o,u,c,[i],r,a)}}),g.ListWrapper.forEachWithIndex(s,function(e,t){var n,o=P.codeGenValueFn([u,c],"["+a[t].join(",")+"]"),s="new "+O.TEMPLATE_COMMANDS_MODULE_REF+"CompiledTemplate("+O.TEMPLATE_COMMANDS_MODULE_REF+"nextTemplateId(),"+o+")";if(e.type.isHost){var l="_hostTemplateFactory"+t;r.push(P.codeGenValueFn([],s,l)+";");var p=P.IS_DART?"const":"new";n=p+" "+O.TEMPLATE_COMMANDS_MODULE_REF+"CompiledHostTemplate("+l+")"}else n=s;r.push(""+P.codeGenExportVariable(i(e.type),e.type.isHost)+n+";")});var l=e[0].component.type.moduleUrl;return new b.SourceModule(""+o(l),r.join("\n"))},e.prototype.compileStylesheetCodeGen=function(e,t){return this._styleCompiler.compileStylesheetCodeGen(e,t)},e.prototype._processTemplateCodeGen=function(e,t,r,n,i,o){var c=this._styleCompiler.compileComponentCodeGen(t,r,e.template),u=this._templateParser.parse(e.template.template,n,e.type.name),l=this._cdCompiler.compileComponentCodeGen(e.type,e.changeDetection,u),p=this._commandCompiler.compileComponentCodeGen(e,t,r,u,l.expressions,s);a(c.declarations,i),a(l.declarations,i),a(p.declarations,i),o.push([l.expressions[0],p.expression,c.expression])},e=l([_.Injectable(),f(6,I.Inject(R.APP_ID)),p("design:paramtypes",[E.RuntimeMetadataResolver,C.TemplateNormalizer,S.TemplateParser,w.StyleCompiler,j.CommandCompiler,x.ChangeDetectionCompiler,String])],e)}();t.TemplateCompiler=D;var T=function(){function e(e,t){this.component=e,this.directives=t}return e}();return t.NormalizedComponentWithViewDirectives=T,c.define=u,r.exports}),System.register("angular2/src/core/linker/element_injector",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/async","angular2/src/core/facade/collection","angular2/src/core/di","angular2/src/core/di/injector","angular2/src/core/di/binding","angular2/src/core/metadata/di","angular2/src/core/linker/view_manager","angular2/src/core/linker/view_container_ref","angular2/src/core/linker/element_ref","angular2/src/core/linker/template_ref","angular2/src/core/metadata/directives","angular2/src/core/linker/directive_lifecycle_reflector","angular2/src/core/change_detection/change_detection","angular2/src/core/linker/query_list","angular2/src/core/reflection/reflection","angular2/src/core/linker/event_config","angular2/src/core/pipes/pipe_binding","angular2/src/core/linker/interfaces"],!0,function(e,t,r){function n(e){var t=e.binding;if(!(t instanceof T))return[];var r=t;return f.ListWrapper.map(r.eventEmitters,function(e){var t=E.EventConfig.parse(e);return new A(t.eventName,C.reflector.getter(t.fieldName))})}function i(e){var t=[];return f.ListWrapper.forEachWithIndex(e,function(e,r){if(e.binding instanceof T){var n=e.binding.queries;n.forEach(function(e){return t.push(new K(r,e.setter,e.metadata))});var i=e.binding.resolvedFactories[0].dependencies;i.forEach(function(e){u.isPresent(e.queryDecorator)&&t.push(new K(r,null,e.queryDecorator))})}}),t}var o=System.global,a=o.define;o.define=void 0;var s,c=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/exceptions"),p=e("angular2/src/core/facade/async"),f=e("angular2/src/core/facade/collection"),d=e("angular2/src/core/di"),h=e("angular2/src/core/di/injector"),g=e("angular2/src/core/di/binding"),v=e("angular2/src/core/metadata/di"),y=e("angular2/src/core/linker/view_manager"),m=e("angular2/src/core/linker/view_container_ref"),_=e("angular2/src/core/linker/element_ref"),b=e("angular2/src/core/linker/template_ref"),x=e("angular2/src/core/metadata/directives"),w=e("angular2/src/core/linker/directive_lifecycle_reflector"),j=e("angular2/src/core/change_detection/change_detection"),S=e("angular2/src/core/linker/query_list"),C=e("angular2/src/core/reflection/reflection"),E=e("angular2/src/core/linker/event_config"),R=e("angular2/src/core/pipes/pipe_binding"),O=e("angular2/src/core/linker/interfaces"),P=function(){function e(){this.viewManagerId=d.Key.get(y.AppViewManager).id,this.templateRefId=d.Key.get(b.TemplateRef).id,this.viewContainerId=d.Key.get(m.ViewContainerRef).id,this.changeDetectorRefId=d.Key.get(j.ChangeDetectorRef).id,this.elementRefId=d.Key.get(_.ElementRef).id}return e.instance=function(){return u.isBlank(s)&&(s=new e),s},e}();t.StaticKeys=P;var I=function(){function e(e){u.isPresent(e)?e.addChild(this):this._parent=null}return e.prototype.addChild=function(e){e._parent=this},e.prototype.remove=function(){this._parent=null},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),e}();t.TreeNode=I;var D=function(e){function t(t,r,n,i,o,a,s){e.call(this,t,r,n,i,o),this.attributeName=a,this.queryDecorator=s,this._verify()}return c(t,e),t.prototype._verify=function(){var e=0;if(u.isPresent(this.queryDecorator)&&e++,u.isPresent(this.attributeName)&&e++,e>1)throw new l.BaseException("A directive injectable can contain only one of the following @Attribute or @Query.")},t.createFrom=function(e){return new t(e.key,e.optional,e.lowerBoundVisibility,e.upperBoundVisibility,e.properties,t._attributeName(e.properties),t._query(e.properties))},t._attributeName=function(e){var t=f.ListWrapper.find(e,function(e){return e instanceof v.AttributeMetadata});return u.isPresent(t)?t.attributeName:null},t._query=function(e){return f.ListWrapper.find(e,function(e){return e instanceof v.QueryMetadata})},t}(d.Dependency);t.DirectiveDependency=D;var T=function(e){function t(t,r,n,i,o,a){e.call(this,t,[new g.ResolvedFactory(r,n)],!1),this.metadata=i,this.bindings=o,this.viewBindings=a,this.callOnDestroy=w.hasLifecycleHook(O.LifecycleHooks.OnDestroy,t.token)}return c(t,e),Object.defineProperty(t.prototype,"displayName",{get:function(){return this.key.displayName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queries",{get:function(){if(u.isBlank(this.metadata.queries))return[];var e=[];return f.StringMapWrapper.forEach(this.metadata.queries,function(t,r){var n=C.reflector.setter(r);e.push(new M(n,t))}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventEmitters",{get:function(){return u.isPresent(this.metadata)&&u.isPresent(this.metadata.outputs)?this.metadata.outputs:[]},enumerable:!0,configurable:!0}),t.createFromBinding=function(e,r){u.isBlank(r)&&(r=new x.DirectiveMetadata);var n=g.resolveBinding(e),i=n.resolvedFactories[0],o=i.dependencies.map(D.createFrom),a=u.isPresent(r.bindings)?r.bindings:[],s=r instanceof x.ComponentMetadata&&u.isPresent(r.viewBindings)?r.viewBindings:[];return new t(n.key,i.factory,o,r,a,s)},t.createFromType=function(e,r){var n=new d.Binding(e,{toClass:e});return t.createFromBinding(n,r)},t}(d.ResolvedBinding);t.DirectiveBinding=T;var k=function(){function e(e,t,r,n){this.viewManager=e,this.view=t,this.elementRef=r,this.templateRef=n,this.nestedView=null}return e}();t.PreBuiltObjects=k;var M=function(){function e(e,t){this.setter=e,this.metadata=t}return e}();t.QueryMetadataWithSetter=M;var A=function(){function e(e,t){this.eventName=e,this.getter=t}return e.prototype.subscribe=function(e,t,r){var n=this,i=this.getter(r);return p.ObservableWrapper.subscribe(i,function(r){return e.triggerEventHandlers(n.eventName,r,t)})},e}();t.EventEmitterAccessor=A;var N=function(){function e(e,t,r,o,a,s){this.parent=e,this.index=t,this.distanceToParent=o,this._firstBindingIsComponent=a,this.directiveVariableBindings=s;var c=r.length;this.protoInjector=new h.ProtoInjector(r),this.eventEmitterAccessors=f.ListWrapper.createFixedSize(c);for(var u=0;c>u;++u)this.eventEmitterAccessors[u]=n(r[u]);this.protoQueryRefs=i(r)}return e.create=function(t,r,n,i,o,a){var s=[];return e._createDirectiveBindingWithVisibility(n,s,i),i&&e._createViewBindingsWithVisibility(n,s),e._createBindingsWithVisibility(n,s),new e(t,r,s,o,i,a)},e._createDirectiveBindingWithVisibility=function(t,r,n){t.forEach(function(i){r.push(e._createBindingWithVisibility(n,i,t,i))})},e._createBindingsWithVisibility=function(e,t){var r=[];e.forEach(function(e){r=f.ListWrapper.concat(r,e.bindings)});var n=d.Injector.resolve(r);n.forEach(function(e){return t.push(new h.BindingWithVisibility(e,h.Visibility.Public))})},e._createBindingWithVisibility=function(e,t,r,n){var i=e&&r[0]===t;return new h.BindingWithVisibility(n,i?h.Visibility.PublicAndPrivate:h.Visibility.Public)},e._createViewBindingsWithVisibility=function(e,t){var r=d.Injector.resolve(e[0].viewBindings);r.forEach(function(e){return t.push(new h.BindingWithVisibility(e,h.Visibility.Private))})},e.prototype.instantiate=function(e){return new B(this,e)},e.prototype.directParent=function(){return this.distanceToParent<2?this.parent:null},Object.defineProperty(e.prototype,"hasBindings",{get:function(){return this.eventEmitterAccessors.length>0},enumerable:!0,configurable:!0}),e.prototype.getBindingAtIndex=function(e){return this.protoInjector.getBindingAtIndex(e)},e}();t.ProtoElementInjector=N;var V=function(){function e(e,t,r){this.element=e,this.componentElement=t,this.injector=r}return e}(),B=function(e){function t(t,r){var n=this;e.call(this,r),this._proto=t,this._preBuiltObjects=null,this._injector=new d.Injector(this._proto.protoInjector,null,this,function(){return n._debugContext()});var i=this._injector.internalStrategy;this._strategy=i instanceof h.InjectorInlineStrategy?new H(i,this):new q(i,this),this.hydrated=!1,this._queryStrategy=this._buildQueryStrategy()}return c(t,e),t.prototype.dehydrate=function(){this.hydrated=!1,this._host=null,this._preBuiltObjects=null,this._strategy.callOnDestroy(),this._strategy.dehydrate(),this._queryStrategy.dehydrate()},t.prototype.hydrate=function(e,t,r){this._host=t,this._preBuiltObjects=r,this._reattachInjectors(e),this._queryStrategy.hydrate(),this._strategy.hydrate(),this.hydrated=!0},t.prototype._debugContext=function(){var e=this._preBuiltObjects,t=e.elementRef.boundElementIndex-e.view.elementOffset,r=this._preBuiltObjects.view.getDebugContext(t,null);return u.isPresent(r)?new V(r.element,r.componentElement,r.injector):null},t.prototype._reattachInjectors=function(e){u.isPresent(this._parent)?u.isPresent(e)?(this._reattachInjector(this._injector,e,!1),this._reattachInjector(e,this._parent._injector,!1)):this._reattachInjector(this._injector,this._parent._injector,!1):u.isPresent(this._host)?u.isPresent(e)?(this._reattachInjector(this._injector,e,!1),this._reattachInjector(e,this._host._injector,!0)):this._reattachInjector(this._injector,this._host._injector,!0):u.isPresent(e)&&this._reattachInjector(this._injector,e,!0)},t.prototype._reattachInjector=function(e,t,r){e.internalStrategy.attach(t,r)},t.prototype.hasVariableBinding=function(e){var t=this._proto.directiveVariableBindings;return u.isPresent(t)&&t.has(e)},t.prototype.getVariableBinding=function(e){var t=this._proto.directiveVariableBindings.get(e);return u.isPresent(t)?this.getDirectiveAtIndex(t):this.getElementRef()},t.prototype.get=function(e){return this._injector.get(e)},t.prototype.hasDirective=function(e){return u.isPresent(this._injector.getOptional(e))},t.prototype.getEventEmitterAccessors=function(){return this._proto.eventEmitterAccessors},t.prototype.getDirectiveVariableBindings=function(){return this._proto.directiveVariableBindings},t.prototype.getComponent=function(){return this._strategy.getComponent()},t.prototype.getInjector=function(){return this._injector},t.prototype.getElementRef=function(){return this._preBuiltObjects.elementRef},t.prototype.getViewContainerRef=function(){return new m.ViewContainerRef(this._preBuiltObjects.viewManager,this.getElementRef())},t.prototype.getNestedView=function(){return this._preBuiltObjects.nestedView},t.prototype.getView=function(){return this._preBuiltObjects.view},t.prototype.directParent=function(){return this._proto.distanceToParent<2?this.parent:null},t.prototype.isComponentKey=function(e){return this._strategy.isComponentKey(e)},t.prototype.getDependency=function(e,t,r){var n=r.key;if(t instanceof T){var i=r,o=t,a=P.instance();if(n.id===a.viewManagerId)return this._preBuiltObjects.viewManager;if(u.isPresent(i.attributeName))return this._buildAttribute(i);if(u.isPresent(i.queryDecorator))return this._queryStrategy.findQuery(i.queryDecorator).list;if(i.key.id===P.instance().changeDetectorRefId){if(o.metadata instanceof x.ComponentMetadata){var s=this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex);return s.changeDetector.ref}return this._preBuiltObjects.view.changeDetector.ref}if(i.key.id===P.instance().elementRefId)return this.getElementRef();if(i.key.id===P.instance().viewContainerId)return this.getViewContainerRef();if(i.key.id===P.instance().templateRefId){if(u.isBlank(this._preBuiltObjects.templateRef)){if(i.optional)return null;throw new d.NoBindingError(null,i.key)}return this._preBuiltObjects.templateRef}}else if(t instanceof R.PipeBinding&&r.key.id===P.instance().changeDetectorRefId){var s=this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex);return s.changeDetector.ref}return h.UNDEFINED},t.prototype._buildAttribute=function(e){var t=this._proto.attributes;return u.isPresent(t)&&t.has(e.attributeName)?t.get(e.attributeName):null},t.prototype.addDirectivesMatchingQuery=function(e,t){var r=u.isBlank(this._preBuiltObjects)?null:this._preBuiltObjects.templateRef;e.selector===b.TemplateRef&&u.isPresent(r)&&t.push(r),this._strategy.addDirectivesMatchingQuery(e,t)},t.prototype._buildQueryStrategy=function(){return 0===this._proto.protoQueryRefs.length?F:this._proto.protoQueryRefs.length<=W.NUMBER_OF_SUPPORTED_QUERIES?new W(this):new U(this)},t.prototype.link=function(e){e.addChild(this)},t.prototype.unlink=function(){this.remove()},t.prototype.getDirectiveAtIndex=function(e){return this._injector.getAt(e)},t.prototype.hasInstances=function(){return this._proto.hasBindings&&this.hydrated},t.prototype.getHost=function(){return this._host},t.prototype.getBoundElementIndex=function(){return this._proto.index},t.prototype.getRootViewInjectors=function(){if(!this.hydrated)return[];var e=this._preBuiltObjects.view,t=e.getNestedView(e.elementOffset+this.getBoundElementIndex());return u.isPresent(t)?t.rootElementInjectors:[]},t.prototype.afterViewChecked=function(){this._queryStrategy.updateViewQueries()},t.prototype.afterContentChecked=function(){this._queryStrategy.updateContentQueries()},t.prototype.traverseAndSetQueriesAsDirty=function(){for(var e=this;u.isPresent(e);)e._setQueriesAsDirty(),e=e.parent},t.prototype._setQueriesAsDirty=function(){this._queryStrategy.setContentQueriesAsDirty(),u.isPresent(this._host)&&this._host._queryStrategy.setViewQueriesAsDirty()},t}(I);t.ElementInjector=B;var L=function(){function e(){}return e.prototype.setContentQueriesAsDirty=function(){},e.prototype.setViewQueriesAsDirty=function(){},e.prototype.hydrate=function(){},e.prototype.dehydrate=function(){},e.prototype.updateContentQueries=function(){},e.prototype.updateViewQueries=function(){},e.prototype.findQuery=function(e){throw new l.BaseException("Cannot find query for directive "+e+".")},e}(),F=new L,W=function(){function e(e){var t=e._proto.protoQueryRefs;t.length>0&&(this.query0=new z(t[0],e)),t.length>1&&(this.query1=new z(t[1],e)),t.length>2&&(this.query2=new z(t[2],e))}return e.prototype.setContentQueriesAsDirty=function(){u.isPresent(this.query0)&&!this.query0.isViewQuery&&(this.query0.dirty=!0),u.isPresent(this.query1)&&!this.query1.isViewQuery&&(this.query1.dirty=!0),u.isPresent(this.query2)&&!this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.setViewQueriesAsDirty=function(){u.isPresent(this.query0)&&this.query0.isViewQuery&&(this.query0.dirty=!0),u.isPresent(this.query1)&&this.query1.isViewQuery&&(this.query1.dirty=!0),u.isPresent(this.query2)&&this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.hydrate=function(){u.isPresent(this.query0)&&this.query0.hydrate(),u.isPresent(this.query1)&&this.query1.hydrate(),u.isPresent(this.query2)&&this.query2.hydrate()},e.prototype.dehydrate=function(){u.isPresent(this.query0)&&this.query0.dehydrate(),u.isPresent(this.query1)&&this.query1.dehydrate(),u.isPresent(this.query2)&&this.query2.dehydrate()},e.prototype.updateContentQueries=function(){u.isPresent(this.query0)&&!this.query0.isViewQuery&&this.query0.update(),u.isPresent(this.query1)&&!this.query1.isViewQuery&&this.query1.update(),u.isPresent(this.query2)&&!this.query2.isViewQuery&&this.query2.update()},e.prototype.updateViewQueries=function(){u.isPresent(this.query0)&&this.query0.isViewQuery&&this.query0.update(),u.isPresent(this.query1)&&this.query1.isViewQuery&&this.query1.update(),u.isPresent(this.query2)&&this.query2.isViewQuery&&this.query2.update()},e.prototype.findQuery=function(e){if(u.isPresent(this.query0)&&this.query0.protoQueryRef.query===e)return this.query0;if(u.isPresent(this.query1)&&this.query1.protoQueryRef.query===e)return this.query1;if(u.isPresent(this.query2)&&this.query2.protoQueryRef.query===e)return this.query2;throw new l.BaseException("Cannot find query for directive "+e+".")},e.NUMBER_OF_SUPPORTED_QUERIES=3,e}(),U=function(){function e(e){this.queries=e._proto.protoQueryRefs.map(function(t){return new z(t,e)})}return e.prototype.setContentQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery||(t.dirty=!0)}},e.prototype.setViewQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery&&(t.dirty=!0)}},e.prototype.hydrate=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.hydrate()}},e.prototype.dehydrate=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.dehydrate()}},e.prototype.updateContentQueries=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery||t.update()}},e.prototype.updateViewQueries=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery&&t.update()}},e.prototype.findQuery=function(e){for(var t=0;t<this.queries.length;++t){var r=this.queries[t];if(r.protoQueryRef.query===e)return r}throw new l.BaseException("Cannot find query for directive "+e+".")},e}(),H=function(){function e(e,t){this.injectorStrategy=e,this._ei=t}return e.prototype.hydrate=function(){var e=this.injectorStrategy,t=e.protoStrategy;e.resetConstructionCounter(),t.binding0 instanceof T&&u.isPresent(t.keyId0)&&e.obj0===h.UNDEFINED&&(e.obj0=e.instantiateBinding(t.binding0,t.visibility0)),t.binding1 instanceof T&&u.isPresent(t.keyId1)&&e.obj1===h.UNDEFINED&&(e.obj1=e.instantiateBinding(t.binding1,t.visibility1)),t.binding2 instanceof T&&u.isPresent(t.keyId2)&&e.obj2===h.UNDEFINED&&(e.obj2=e.instantiateBinding(t.binding2,t.visibility2)),t.binding3 instanceof T&&u.isPresent(t.keyId3)&&e.obj3===h.UNDEFINED&&(e.obj3=e.instantiateBinding(t.binding3,t.visibility3)),t.binding4 instanceof T&&u.isPresent(t.keyId4)&&e.obj4===h.UNDEFINED&&(e.obj4=e.instantiateBinding(t.binding4,t.visibility4)),t.binding5 instanceof T&&u.isPresent(t.keyId5)&&e.obj5===h.UNDEFINED&&(e.obj5=e.instantiateBinding(t.binding5,t.visibility5)),t.binding6 instanceof T&&u.isPresent(t.keyId6)&&e.obj6===h.UNDEFINED&&(e.obj6=e.instantiateBinding(t.binding6,t.visibility6)),t.binding7 instanceof T&&u.isPresent(t.keyId7)&&e.obj7===h.UNDEFINED&&(e.obj7=e.instantiateBinding(t.binding7,t.visibility7)),t.binding8 instanceof T&&u.isPresent(t.keyId8)&&e.obj8===h.UNDEFINED&&(e.obj8=e.instantiateBinding(t.binding8,t.visibility8)),t.binding9 instanceof T&&u.isPresent(t.keyId9)&&e.obj9===h.UNDEFINED&&(e.obj9=e.instantiateBinding(t.binding9,t.visibility9))},e.prototype.dehydrate=function(){var e=this.injectorStrategy;e.obj0=h.UNDEFINED,e.obj1=h.UNDEFINED,e.obj2=h.UNDEFINED,e.obj3=h.UNDEFINED,e.obj4=h.UNDEFINED,e.obj5=h.UNDEFINED,e.obj6=h.UNDEFINED,e.obj7=h.UNDEFINED,e.obj8=h.UNDEFINED,e.obj9=h.UNDEFINED},e.prototype.callOnDestroy=function(){var e=this.injectorStrategy,t=e.protoStrategy;t.binding0 instanceof T&&t.binding0.callOnDestroy&&e.obj0.onDestroy(),t.binding1 instanceof T&&t.binding1.callOnDestroy&&e.obj1.onDestroy(),t.binding2 instanceof T&&t.binding2.callOnDestroy&&e.obj2.onDestroy(),t.binding3 instanceof T&&t.binding3.callOnDestroy&&e.obj3.onDestroy(),t.binding4 instanceof T&&t.binding4.callOnDestroy&&e.obj4.onDestroy(),t.binding5 instanceof T&&t.binding5.callOnDestroy&&e.obj5.onDestroy(),t.binding6 instanceof T&&t.binding6.callOnDestroy&&e.obj6.onDestroy(),t.binding7 instanceof T&&t.binding7.callOnDestroy&&e.obj7.onDestroy(),t.binding8 instanceof T&&t.binding8.callOnDestroy&&e.obj8.onDestroy(),t.binding9 instanceof T&&t.binding9.callOnDestroy&&e.obj9.onDestroy()},e.prototype.getComponent=function(){return this.injectorStrategy.obj0},e.prototype.isComponentKey=function(e){return this._ei._proto._firstBindingIsComponent&&u.isPresent(e)&&e.id===this.injectorStrategy.protoStrategy.keyId0},e.prototype.addDirectivesMatchingQuery=function(e,t){var r=this.injectorStrategy,n=r.protoStrategy;u.isPresent(n.binding0)&&n.binding0.key.token===e.selector&&(r.obj0===h.UNDEFINED&&(r.obj0=r.instantiateBinding(n.binding0,n.visibility0)),t.push(r.obj0)),u.isPresent(n.binding1)&&n.binding1.key.token===e.selector&&(r.obj1===h.UNDEFINED&&(r.obj1=r.instantiateBinding(n.binding1,n.visibility1)),t.push(r.obj1)),u.isPresent(n.binding2)&&n.binding2.key.token===e.selector&&(r.obj2===h.UNDEFINED&&(r.obj2=r.instantiateBinding(n.binding2,n.visibility2)),t.push(r.obj2)),u.isPresent(n.binding3)&&n.binding3.key.token===e.selector&&(r.obj3===h.UNDEFINED&&(r.obj3=r.instantiateBinding(n.binding3,n.visibility3)),t.push(r.obj3)),u.isPresent(n.binding4)&&n.binding4.key.token===e.selector&&(r.obj4===h.UNDEFINED&&(r.obj4=r.instantiateBinding(n.binding4,n.visibility4)),t.push(r.obj4)),u.isPresent(n.binding5)&&n.binding5.key.token===e.selector&&(r.obj5===h.UNDEFINED&&(r.obj5=r.instantiateBinding(n.binding5,n.visibility5)),t.push(r.obj5)),u.isPresent(n.binding6)&&n.binding6.key.token===e.selector&&(r.obj6===h.UNDEFINED&&(r.obj6=r.instantiateBinding(n.binding6,n.visibility6)),t.push(r.obj6)),u.isPresent(n.binding7)&&n.binding7.key.token===e.selector&&(r.obj7===h.UNDEFINED&&(r.obj7=r.instantiateBinding(n.binding7,n.visibility7)),t.push(r.obj7)),
u.isPresent(n.binding8)&&n.binding8.key.token===e.selector&&(r.obj8===h.UNDEFINED&&(r.obj8=r.instantiateBinding(n.binding8,n.visibility8)),t.push(r.obj8)),u.isPresent(n.binding9)&&n.binding9.key.token===e.selector&&(r.obj9===h.UNDEFINED&&(r.obj9=r.instantiateBinding(n.binding9,n.visibility9)),t.push(r.obj9))},e}(),q=function(){function e(e,t){this.injectorStrategy=e,this._ei=t}return e.prototype.hydrate=function(){var e=this.injectorStrategy,t=e.protoStrategy;e.resetConstructionCounter();for(var r=0;r<t.keyIds.length;r++)t.bindings[r]instanceof T&&u.isPresent(t.keyIds[r])&&e.objs[r]===h.UNDEFINED&&(e.objs[r]=e.instantiateBinding(t.bindings[r],t.visibilities[r]))},e.prototype.dehydrate=function(){var e=this.injectorStrategy;f.ListWrapper.fill(e.objs,h.UNDEFINED)},e.prototype.callOnDestroy=function(){for(var e=this.injectorStrategy,t=e.protoStrategy,r=0;r<t.bindings.length;r++)t.bindings[r]instanceof T&&t.bindings[r].callOnDestroy&&e.objs[r].onDestroy()},e.prototype.getComponent=function(){return this.injectorStrategy.objs[0]},e.prototype.isComponentKey=function(e){var t=this.injectorStrategy.protoStrategy;return this._ei._proto._firstBindingIsComponent&&u.isPresent(e)&&e.id===t.keyIds[0]},e.prototype.addDirectivesMatchingQuery=function(e,t){for(var r=this.injectorStrategy,n=r.protoStrategy,i=0;i<n.bindings.length;i++)n.bindings[i].key.token===e.selector&&(r.objs[i]===h.UNDEFINED&&(r.objs[i]=r.instantiateBinding(n.bindings[i],n.visibilities[i])),t.push(r.objs[i]))},e}(),K=function(){function e(e,t,r){this.dirIndex=e,this.setter=t,this.query=r}return Object.defineProperty(e.prototype,"usesPropertySyntax",{get:function(){return u.isPresent(this.setter)},enumerable:!0,configurable:!0}),e}();t.ProtoQueryRef=K;var z=function(){function e(e,t){this.protoQueryRef=e,this.originator=t}return Object.defineProperty(e.prototype,"isViewQuery",{get:function(){return this.protoQueryRef.query.isViewQuery},enumerable:!0,configurable:!0}),e.prototype.update=function(){if(this.dirty){if(this._update(),this.dirty=!1,this.protoQueryRef.usesPropertySyntax){var e=this.originator.getDirectiveAtIndex(this.protoQueryRef.dirIndex);this.protoQueryRef.query.first?this.protoQueryRef.setter(e,this.list.length>0?this.list.first:null):this.protoQueryRef.setter(e,this.list)}this.list.notifyOnChanges()}},e.prototype._update=function(){var e=[];if(this.protoQueryRef.query.isViewQuery){var t=this.originator.getView(),r=t.getNestedView(t.elementOffset+this.originator.getBoundElementIndex());u.isPresent(r)&&this._visitView(r,e)}else this._visit(this.originator,e);this.list.reset(e)},e.prototype._visit=function(e,t){for(var r=e.getView(),n=r.elementOffset+e._proto.index,i=n;i<r.elementOffset+r.ownBindersCount;i++){var o=r.elementInjectors[i];if(!u.isBlank(o)){if(i>n&&(u.isBlank(o)||u.isBlank(o.parent)||r.elementOffset+o.parent._proto.index<n))break;if(this.protoQueryRef.query.descendants||o.parent==this.originator||o==this.originator){this._visitInjector(o,t);var a=r.viewContainers[i];u.isPresent(a)&&this._visitViewContainer(a,t)}}}},e.prototype._visitInjector=function(e,t){this.protoQueryRef.query.isVarBindingQuery?this._aggregateVariableBindings(e,t):this._aggregateDirective(e,t)},e.prototype._visitViewContainer=function(e,t){for(var r=0;r<e.views.length;r++)this._visitView(e.views[r],t)},e.prototype._visitView=function(e,t){for(var r=e.elementOffset;r<e.elementOffset+e.ownBindersCount;r++){var n=e.elementInjectors[r];if(!u.isBlank(n)){this._visitInjector(n,t);var i=e.viewContainers[r];u.isPresent(i)&&this._visitViewContainer(i,t)}}},e.prototype._aggregateVariableBindings=function(e,t){for(var r=this.protoQueryRef.query.varBindings,n=0;n<r.length;++n)e.hasVariableBinding(r[n])&&t.push(e.getVariableBinding(r[n]))},e.prototype._aggregateDirective=function(e,t){e.addDirectivesMatchingQuery(this.protoQueryRef.query,t)},e.prototype.dehydrate=function(){this.list=null},e.prototype.hydrate=function(){this.list=new S.QueryList,this.dirty=!0},e}();return t.QueryRef=z,o.define=a,r.exports}),System.register("angular2/src/animate/animation_builder",["angular2/src/core/di","angular2/src/animate/css_animation_builder","angular2/src/animate/browser_details"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/di"),c=e("angular2/src/animate/css_animation_builder"),u=e("angular2/src/animate/browser_details"),l=function(){function e(e){this.browserDetails=e}return e.prototype.css=function(){return new c.CssAnimationBuilder(this.browserDetails)},e=o([s.Injectable(),a("design:paramtypes",[u.BrowserDetails])],e)}();return t.AnimationBuilder=l,n.define=i,r.exports}),System.register("angular2/src/core/forms/directives/shared",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/forms/validators","angular2/src/core/forms/directives/default_value_accessor","angular2/src/core/forms/directives/checkbox_value_accessor","angular2/src/core/forms/directives/select_control_value_accessor"],!0,function(e,t,r){function n(e,t){var r=p.ListWrapper.clone(t.path);return r.push(e),r}function i(e,t){f.isBlank(e)&&o(t,"Cannot find control"),f.isBlank(t.valueAccessor)&&o(t,"No value accessor for"),e.validator=h.Validators.compose([e.validator,t.validator]),t.valueAccessor.writeValue(e.value),t.valueAccessor.registerOnChange(function(r){t.viewToModelUpdate(r),e.updateValue(r,{emitModelToViewChange:!1}),e.markAsDirty()}),e.registerOnChange(function(e){return t.valueAccessor.writeValue(e)}),t.valueAccessor.registerOnTouched(function(){return e.markAsTouched()})}function o(e,t){var r=p.ListWrapper.join(e.path," -> ");throw new d.BaseException(t+" '"+r+"'")}function a(e,t,r,n){e.setElementProperty(t,r,n)}function s(e,t){if(!p.StringMapWrapper.contains(e,"model"))return!1;var r=e.model;return r.isFirstChange()?!0:!f.looseIdentical(t,r.currentValue)}function c(e,t){if(f.isBlank(t))return null;var r,n,i;return t.forEach(function(t){t instanceof g.DefaultValueAccessor?r=t:t instanceof v.CheckboxControlValueAccessor||t instanceof y.SelectControlValueAccessor?(f.isPresent(n)&&o(e,"More than one built-in value accessor matches"),n=t):(f.isPresent(i)&&o(e,"More than one custom value accessor matches"),i=t)}),f.isPresent(i)?i:f.isPresent(n)?n:f.isPresent(r)?r:(o(e,"No valid value accessor for"),null)}var u=System.global,l=u.define;u.define=void 0;var p=e("angular2/src/core/facade/collection"),f=e("angular2/src/core/facade/lang"),d=e("angular2/src/core/facade/exceptions"),h=e("angular2/src/core/forms/validators"),g=e("angular2/src/core/forms/directives/default_value_accessor"),v=e("angular2/src/core/forms/directives/checkbox_value_accessor"),y=e("angular2/src/core/forms/directives/select_control_value_accessor");return t.controlPath=n,t.setUpControl=i,t.setProperty=a,t.isPropertyUpdated=s,t.selectValueAccessor=c,u.define=l,r.exports}),System.register("angular2/src/http/http",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/di/decorators","angular2/src/http/interfaces","angular2/src/http/static_request","angular2/src/http/base_request_options","angular2/src/http/enums"],!0,function(e,t,r){function n(e,t){return e.createConnection(t).response}function i(e,t,r,n){var i=e;return l.isPresent(t)&&(i=i.merge(new g.RequestOptions({method:t.method,url:t.url,search:t.search,headers:t.headers,body:t.body}))),i.merge(new g.RequestOptions(l.isPresent(r)?{method:r,url:n}:{url:n}))}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},u=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/facade/exceptions"),f=e("angular2/src/core/di/decorators"),d=e("angular2/src/http/interfaces"),h=e("angular2/src/http/static_request"),g=e("angular2/src/http/base_request_options"),v=e("angular2/src/http/enums"),y=function(){function e(e,t){this._backend=e,this._defaultOptions=t}return e.prototype.request=function(e,t){var r;if(l.isString(e))r=n(this._backend,new h.Request(i(this._defaultOptions,t,v.RequestMethods.Get,e)));else{if(!(e instanceof h.Request))throw p.makeTypeError("First argument must be a url string or Request instance.");r=n(this._backend,e)}return r},e.prototype.get=function(e,t){return n(this._backend,new h.Request(i(this._defaultOptions,t,v.RequestMethods.Get,e)))},e.prototype.post=function(e,t,r){return n(this._backend,new h.Request(i(this._defaultOptions.merge(new g.RequestOptions({body:t})),r,v.RequestMethods.Post,e)))},e.prototype.put=function(e,t,r){return n(this._backend,new h.Request(i(this._defaultOptions.merge(new g.RequestOptions({body:t})),r,v.RequestMethods.Put,e)))},e.prototype["delete"]=function(e,t){return n(this._backend,new h.Request(i(this._defaultOptions,t,v.RequestMethods.Delete,e)))},e.prototype.patch=function(e,t,r){return n(this._backend,new h.Request(i(this._defaultOptions.merge(new g.RequestOptions({body:t})),r,v.RequestMethods.Patch,e)))},e.prototype.head=function(e,t){return n(this._backend,new h.Request(i(this._defaultOptions,t,v.RequestMethods.Head,e)))},e=c([f.Injectable(),u("design:paramtypes",[d.ConnectionBackend,g.RequestOptions])],e)}();t.Http=y;var m=function(e){function t(t,r){e.call(this,t,r)}return s(t,e),t.prototype.request=function(e,t){var r;if(l.isString(e)&&(e=new h.Request(i(this._defaultOptions,t,v.RequestMethods.Get,e))),!(e instanceof h.Request))throw p.makeTypeError("First argument must be a url string or Request instance.");return e.method!==v.RequestMethods.Get&&p.makeTypeError("JSONP requests must use GET request method."),r=n(this._backend,e)},t=c([f.Injectable(),u("design:paramtypes",[d.ConnectionBackend,g.RequestOptions])],t)}(y);return t.Jsonp=m,o.define=a,r.exports}),System.register("@reactivex/rxjs/dist/cjs/schedulers/nextTick",["@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var a=e("@reactivex/rxjs/dist/cjs/schedulers/NextTickScheduler"),s=n(a);return t["default"]=new s["default"],r.exports=t["default"],i.define=o,r.exports}),System.register("angular2/src/core/di",["angular2/src/core/di/metadata","angular2/src/core/di/decorators","angular2/src/core/di/forward_ref","angular2/src/core/di/injector","angular2/src/core/di/binding","angular2/src/core/di/key","angular2/src/core/di/exceptions","angular2/src/core/di/opaque_token"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/di/metadata");t.InjectMetadata=a.InjectMetadata,t.OptionalMetadata=a.OptionalMetadata,t.InjectableMetadata=a.InjectableMetadata,t.SelfMetadata=a.SelfMetadata,t.HostMetadata=a.HostMetadata,t.SkipSelfMetadata=a.SkipSelfMetadata,t.DependencyMetadata=a.DependencyMetadata,n(e("angular2/src/core/di/decorators"));var s=e("angular2/src/core/di/forward_ref");t.forwardRef=s.forwardRef,t.resolveForwardRef=s.resolveForwardRef;var c=e("angular2/src/core/di/injector");t.Injector=c.Injector;var u=e("angular2/src/core/di/binding");t.Binding=u.Binding,t.BindingBuilder=u.BindingBuilder,t.ResolvedBinding=u.ResolvedBinding,t.ResolvedFactory=u.ResolvedFactory,t.Dependency=u.Dependency,t.bind=u.bind;var l=e("angular2/src/core/di/key");t.Key=l.Key,t.TypeLiteral=l.TypeLiteral;var p=e("angular2/src/core/di/exceptions");t.NoBindingError=p.NoBindingError,t.AbstractBindingError=p.AbstractBindingError,t.CyclicDependencyError=p.CyclicDependencyError,t.InstantiationError=p.InstantiationError,t.InvalidBindingError=p.InvalidBindingError,t.NoAnnotationError=p.NoAnnotationError,t.OutOfBoundsError=p.OutOfBoundsError;var f=e("angular2/src/core/di/opaque_token");return t.OpaqueToken=f.OpaqueToken,i.define=o,r.exports}),System.register("angular2/src/core/change_detection/proto_change_detector",["angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/collection","angular2/src/core/change_detection/parser/ast","angular2/src/core/change_detection/change_detection_util","angular2/src/core/change_detection/dynamic_change_detector","angular2/src/core/change_detection/directive_record","angular2/src/core/change_detection/event_binding","angular2/src/core/change_detection/coalesce","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){function n(e){var t=new S;return g.ListWrapper.forEachWithIndex(e.bindingRecords,function(r,n){return t.add(r,e.variableNames,n)}),x.coalesce(t.records)}function i(e){var t=g.ListWrapper.concat(["$event"],e.variableNames);return e.eventRecords.map(function(e){var r=C.create(e,t),n=e.implicitReceiver instanceof _.DirectiveIndex?e.implicitReceiver:null;return new b.EventBinding(e.target.name,e.target.elementIndex,n,r)})}function o(e){switch(e){case 0:return y.ChangeDetectionUtil.arrayFn0;case 1:return y.ChangeDetectionUtil.arrayFn1;case 2:return y.ChangeDetectionUtil.arrayFn2;case 3:return y.ChangeDetectionUtil.arrayFn3;case 4:return y.ChangeDetectionUtil.arrayFn4;case 5:return y.ChangeDetectionUtil.arrayFn5;case 6:return y.ChangeDetectionUtil.arrayFn6;case 7:return y.ChangeDetectionUtil.arrayFn7;case 8:return y.ChangeDetectionUtil.arrayFn8;case 9:return y.ChangeDetectionUtil.arrayFn9;default:throw new h.BaseException("Does not support literal maps with more than 9 elements")}}function a(e){var t=g.ListWrapper.join(g.ListWrapper.map(e,function(e){return d.isString(e)?'"'+e+'"':""+e}),", ");return"mapFn(["+t+"])"}function s(e){switch(e){case"+":return"operation_add";case"-":return"operation_subtract";case"*":return"operation_multiply";case"/":return"operation_divide";case"%":return"operation_remainder";case"==":return"operation_equals";case"!=":return"operation_not_equals";case"===":return"operation_identical";case"!==":return"operation_not_identical";case"<":return"operation_less_then";case">":return"operation_greater_then";case"<=":return"operation_less_or_equals_then";case">=":return"operation_greater_or_equals_then";case"&&":return"operation_logical_and";case"||":return"operation_logical_or";default:throw new h.BaseException("Unsupported operation "+e)}}function c(e){switch(e){case"+":return y.ChangeDetectionUtil.operation_add;case"-":return y.ChangeDetectionUtil.operation_subtract;case"*":return y.ChangeDetectionUtil.operation_multiply;case"/":return y.ChangeDetectionUtil.operation_divide;case"%":return y.ChangeDetectionUtil.operation_remainder;case"==":return y.ChangeDetectionUtil.operation_equals;case"!=":return y.ChangeDetectionUtil.operation_not_equals;case"===":return y.ChangeDetectionUtil.operation_identical;case"!==":return y.ChangeDetectionUtil.operation_not_identical;case"<":return y.ChangeDetectionUtil.operation_less_then;case">":return y.ChangeDetectionUtil.operation_greater_then;case"<=":return y.ChangeDetectionUtil.operation_less_or_equals_then;case">=":return y.ChangeDetectionUtil.operation_greater_or_equals_then;case"&&":return y.ChangeDetectionUtil.operation_logical_and;case"||":return y.ChangeDetectionUtil.operation_logical_or;default:throw new h.BaseException("Unsupported operation "+e)}}function u(e){return d.isPresent(e)?""+e:""}function l(e){var t=e.length,r=t>0?e[0]:null,n=t>1?e[1]:null,i=t>2?e[2]:null,o=t>3?e[3]:null,a=t>4?e[4]:null,s=t>5?e[5]:null,c=t>6?e[6]:null,l=t>7?e[7]:null,p=t>8?e[8]:null,f=t>9?e[9]:null;switch(t-1){case 1:return function(e){return r+u(e)+n};case 2:return function(e,t){return r+u(e)+n+u(t)+i};case 3:return function(e,t,a){return r+u(e)+n+u(t)+i+u(a)+o};case 4:return function(e,t,s,c){return r+u(e)+n+u(t)+i+u(s)+o+u(c)+a};case 5:return function(e,t,c,l,p){return r+u(e)+n+u(t)+i+u(c)+o+u(l)+a+u(p)+s};case 6:return function(e,t,l,p,f,d){return r+u(e)+n+u(t)+i+u(l)+o+u(p)+a+u(f)+s+u(d)+c};case 7:return function(e,t,p,f,d,h,g){return r+u(e)+n+u(t)+i+u(p)+o+u(f)+a+u(d)+s+u(h)+c+u(g)+l};case 8:return function(e,t,f,d,h,g,v,y){return r+u(e)+n+u(t)+i+u(f)+o+u(d)+a+u(h)+s+u(g)+c+u(v)+l+u(y)+p};case 9:return function(e,t,d,h,g,v,y,m,_){return r+u(e)+n+u(t)+i+u(d)+o+u(h)+a+u(g)+s+u(v)+c+u(y)+l+u(m)+p+u(_)+f};default:throw new h.BaseException("Does not support more than 9 expressions")}}var p=System.global,f=p.define;p.define=void 0;var d=e("angular2/src/core/facade/lang"),h=e("angular2/src/core/facade/exceptions"),g=e("angular2/src/core/facade/collection"),v=e("angular2/src/core/change_detection/parser/ast"),y=e("angular2/src/core/change_detection/change_detection_util"),m=e("angular2/src/core/change_detection/dynamic_change_detector"),_=e("angular2/src/core/change_detection/directive_record"),b=e("angular2/src/core/change_detection/event_binding"),x=e("angular2/src/core/change_detection/coalesce"),w=e("angular2/src/core/change_detection/proto_record"),j=function(){function e(e){this._definition=e,this._propertyBindingRecords=n(e),this._eventBindingRecords=i(e),this._propertyBindingTargets=this._definition.bindingRecords.map(function(e){return e.target}),this._directiveIndices=this._definition.directiveRecords.map(function(e){return e.directiveIndex})}return e.prototype.instantiate=function(e){return new m.DynamicChangeDetector(this._definition.id,e,this._propertyBindingRecords.length,this._propertyBindingTargets,this._directiveIndices,this._definition.strategy,this._propertyBindingRecords,this._eventBindingRecords,this._definition.directiveRecords,this._definition.genConfig)},e}();t.DynamicProtoChangeDetector=j,t.createPropertyRecords=n,t.createEventRecords=i;var S=function(){function e(){this.records=[]}return e.prototype.add=function(e,t,r){var n=g.ListWrapper.last(this.records);d.isPresent(n)&&n.bindingRecord.directiveRecord==e.directiveRecord&&(n.lastInDirective=!1);var i=this.records.length;this._appendRecords(e,t,r);var o=g.ListWrapper.last(this.records);d.isPresent(o)&&o!==n&&(o.lastInBinding=!0,o.lastInDirective=!0,this._setArgumentToPureFunction(i))},e.prototype._setArgumentToPureFunction=function(e){for(var t=this,r=e;r<this.records.length;++r){var n=this.records[r];n.isPureFunction()&&n.args.forEach(function(e){return t.records[e-1].argumentToPureFunction=!0}),n.mode===w.RecordType.Pipe&&(n.args.forEach(function(e){return t.records[e-1].argumentToPureFunction=!0}),this.records[n.contextIndex-1].argumentToPureFunction=!0)}},e.prototype._appendRecords=function(e,t,r){e.isDirectiveLifecycle()?this.records.push(new w.ProtoRecord(w.RecordType.DirectiveLifecycle,e.lifecycleEvent,null,[],[],-1,null,this.records.length+1,e,!1,!1,!1,!1,null)):C.append(this.records,e,t,r)},e}();t.ProtoRecordBuilder=S;var C=function(){function e(e,t,r,n){this._records=e,this._bindingRecord=t,this._variableNames=r,this._bindingIndex=n}return e.append=function(t,r,n,i){var o=new e(t,r,n,i);r.ast.visit(o)},e.create=function(t,r){var n=[];return e.append(n,t,r,null),n[n.length-1].lastInBinding=!0,n},e.prototype.visitImplicitReceiver=function(e){return this._bindingRecord.implicitReceiver},e.prototype.visitInterpolation=function(e){var t=this._visitAll(e.expressions);return this._addRecord(w.RecordType.Interpolate,"interpolate",l(e.strings),t,e.strings,0)},e.prototype.visitLiteralPrimitive=function(e){return this._addRecord(w.RecordType.Const,"literal",e.value,[],null,0)},e.prototype.visitPropertyRead=function(e){var t=e.receiver.visit(this);return d.isPresent(this._variableNames)&&g.ListWrapper.contains(this._variableNames,e.name)&&e.receiver instanceof v.ImplicitReceiver?this._addRecord(w.RecordType.Local,e.name,e.name,[],null,t):this._addRecord(w.RecordType.PropertyRead,e.name,e.getter,[],null,t)},e.prototype.visitPropertyWrite=function(e){if(d.isPresent(this._variableNames)&&g.ListWrapper.contains(this._variableNames,e.name)&&e.receiver instanceof v.ImplicitReceiver)throw new h.BaseException("Cannot reassign a variable binding "+e.name);var t=e.receiver.visit(this),r=e.value.visit(this);return this._addRecord(w.RecordType.PropertyWrite,e.name,e.setter,[r],null,t)},e.prototype.visitKeyedWrite=function(e){var t=e.obj.visit(this),r=e.key.visit(this),n=e.value.visit(this);return this._addRecord(w.RecordType.KeyedWrite,null,null,[r,n],null,t)},e.prototype.visitSafePropertyRead=function(e){var t=e.receiver.visit(this);return this._addRecord(w.RecordType.SafeProperty,e.name,e.getter,[],null,t)},e.prototype.visitMethodCall=function(e){var t=e.receiver.visit(this),r=this._visitAll(e.args);if(d.isPresent(this._variableNames)&&g.ListWrapper.contains(this._variableNames,e.name)){var n=this._addRecord(w.RecordType.Local,e.name,e.name,[],null,t);return this._addRecord(w.RecordType.InvokeClosure,"closure",null,r,null,n)}return this._addRecord(w.RecordType.InvokeMethod,e.name,e.fn,r,null,t)},e.prototype.visitSafeMethodCall=function(e){var t=e.receiver.visit(this),r=this._visitAll(e.args);return this._addRecord(w.RecordType.SafeMethodInvoke,e.name,e.fn,r,null,t)},e.prototype.visitFunctionCall=function(e){var t=e.target.visit(this),r=this._visitAll(e.args);return this._addRecord(w.RecordType.InvokeClosure,"closure",null,r,null,t)},e.prototype.visitLiteralArray=function(e){var t="arrayFn"+e.expressions.length;return this._addRecord(w.RecordType.CollectionLiteral,t,o(e.expressions.length),this._visitAll(e.expressions),null,0)},e.prototype.visitLiteralMap=function(e){return this._addRecord(w.RecordType.CollectionLiteral,a(e.keys),y.ChangeDetectionUtil.mapFn(e.keys),this._visitAll(e.values),null,0)},e.prototype.visitBinary=function(e){var t=e.left.visit(this),r=e.right.visit(this);return this._addRecord(w.RecordType.PrimitiveOp,s(e.operation),c(e.operation),[t,r],null,0)},e.prototype.visitPrefixNot=function(e){var t=e.expression.visit(this);return this._addRecord(w.RecordType.PrimitiveOp,"operation_negate",y.ChangeDetectionUtil.operation_negate,[t],null,0)},e.prototype.visitConditional=function(e){var t=e.condition.visit(this),r=e.trueExp.visit(this),n=e.falseExp.visit(this);return this._addRecord(w.RecordType.PrimitiveOp,"cond",y.ChangeDetectionUtil.cond,[t,r,n],null,0)},e.prototype.visitPipe=function(e){var t=e.exp.visit(this),r=this._visitAll(e.args);return this._addRecord(w.RecordType.Pipe,e.name,e.name,r,null,t)},e.prototype.visitKeyedRead=function(e){var t=e.obj.visit(this),r=e.key.visit(this);return this._addRecord(w.RecordType.KeyedRead,"keyedAccess",y.ChangeDetectionUtil.keyedAccess,[r],null,t)},e.prototype.visitChain=function(e){var t=this,r=e.expressions.map(function(e){return e.visit(t)});return this._addRecord(w.RecordType.Chain,"chain",null,r,null,0)},e.prototype.visitIf=function(e){throw new h.BaseException("Not supported")},e.prototype._visitAll=function(e){for(var t=g.ListWrapper.createFixedSize(e.length),r=0;r<e.length;++r)t[r]=e[r].visit(this);return t},e.prototype._addRecord=function(e,t,r,n,i,o){var a=this._records.length+1;return this._records.push(o instanceof _.DirectiveIndex?new w.ProtoRecord(e,t,r,n,i,-1,o,a,this._bindingRecord,!1,!1,!1,!1,this._bindingIndex):new w.ProtoRecord(e,t,r,n,i,o,null,a,this._bindingRecord,!1,!1,!1,!1,this._bindingIndex)),a},e}();return p.define=f,r.exports}),System.register("angular2/src/core/facade/async",["angular2/src/core/facade/lang","@reactivex/rxjs/dist/cjs/Subject"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/core/facade/lang"),s=e("@reactivex/rxjs/dist/cjs/Subject"),c=function(){function e(){}return e.resolve=function(e){return Promise.resolve(e)},e.reject=function(e,t){return Promise.reject(e)},e.catchError=function(e,t){return e["catch"](t)},e.all=function(e){return 0==e.length?Promise.resolve([]):Promise.all(e)},e.then=function(e,t,r){return e.then(t,r)},e.wrap=function(e){return new Promise(function(t,r){try{t(e())}catch(n){r(n)}})},e.completer=function(){var e,t,r=new Promise(function(r,n){e=r,t=n});return{promise:r,resolve:e,reject:t}},e}();t.PromiseWrapper=c;var u=function(){function e(){}return e.setTimeout=function(e,t){return a.global.setTimeout(e,t)},e.clearTimeout=function(e){a.global.clearTimeout(e)},e.setInterval=function(e,t){return a.global.setInterval(e,t)},e.clearInterval=function(e){a.global.clearInterval(e)},e}();t.TimerWrapper=u;var l=function(){function e(){}return e.subscribe=function(e,t,r,n){return void 0===r&&(r=null),void 0===n&&(n=null),e.observer({next:t,"throw":r,"return":n})},e.isObservable=function(e){return e instanceof p},e.dispose=function(e){e.unsubscribe()},e.callNext=function(e,t){e.next(t)},e.callThrow=function(e,t){e["throw"](t)},e.callReturn=function(e){e["return"](null)},e}();t.ObservableWrapper=l;var p=function(){function e(){}return e.prototype.observer=function(e){return null},e}();t.Observable=p;var f=function(e){function t(){e.apply(this,arguments),this._subject=new s}return o(t,e),t.prototype.observer=function(e){return this._subject.subscribe(function(t){setTimeout(function(){return e.next(t)})},function(t){return e["throw"]?e["throw"](t):null},function(){return e["return"]?e["return"]():null})},t.prototype.toRx=function(){return this},t.prototype.next=function(e){this._subject.next(e)},t.prototype["throw"]=function(e){this._subject.error(e)},t.prototype["return"]=function(e){this._subject.complete()},t}(p);return t.EventEmitter=f,n.define=i,r.exports}),System.register("angular2/src/core/render/dom/dom_renderer",["angular2/src/core/di","angular2/src/animate/animation_builder","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/dom/dom_adapter","angular2/src/core/render/dom/events/event_manager","angular2/src/core/render/dom/shared_styles_host","angular2/src/core/profile/profile","angular2/src/core/render/api","angular2/src/core/render/dom/dom_tokens","angular2/src/core/render/view_factory","angular2/src/core/render/view","angular2/src/core/render/dom/util"],!0,function(e,t,r){function n(e){return e}function i(e){return e.nodes}function o(e,t){if(t.length>0&&h.isPresent(v.DOM.parentElement(e))){for(var r=0;r<t.length;r++)v.DOM.insertBefore(e,t[r]);v.DOM.insertBefore(t[0],e)}}function a(e){return function(t){var r=e(t);r||v.DOM.preventDefault(t)}}var s=System.global,c=s.define;s.define=void 0;var u=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},l=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},p=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},f=e("angular2/src/core/di"),d=e("angular2/src/animate/animation_builder"),h=e("angular2/src/core/facade/lang"),g=e("angular2/src/core/facade/exceptions"),v=e("angular2/src/core/dom/dom_adapter"),y=e("angular2/src/core/render/dom/events/event_manager"),m=e("angular2/src/core/render/dom/shared_styles_host"),_=e("angular2/src/core/profile/profile"),b=e("angular2/src/core/render/api"),x=e("angular2/src/core/render/dom/dom_tokens"),w=e("angular2/src/core/render/view_factory"),j=e("angular2/src/core/render/view"),S=e("angular2/src/core/render/dom/util"),C=function(){function e(e,t,r,n){this._eventManager=e,this._domSharedStylesHost=t,this._animate=r,this._componentCmds=new Map,this._nativeShadowStyles=new Map,this._createRootHostViewScope=_.wtfCreateScope("DomRenderer#createRootHostView()"),this._createViewScope=_.wtfCreateScope("DomRenderer#createView()"),this._detachFragmentScope=_.wtfCreateScope("DomRenderer#detachFragment()"),this._document=n}return e.prototype.registerComponentTemplate=function(e,t,r,n){this._componentCmds.set(e,t),n?this._nativeShadowStyles.set(e,r):this._domSharedStylesHost.addStyles(r)},e.prototype.resolveComponentTemplate=function(e){return this._componentCmds.get(e)},e.prototype.createProtoView=function(e){return new j.DefaultProtoViewRef(e)},e.prototype.createRootHostView=function(e,t,r){var n=this._createRootHostViewScope(),i=v.DOM.querySelector(this._document,r);if(h.isBlank(i))throw _.wtfLeave(n),new g.BaseException('The selector "'+r+'" did not match any elements');return _.wtfLeave(n,this._createView(e,i))},e.prototype.createView=function(e,t){var r=this._createViewScope();return _.wtfLeave(r,this._createView(e,null))},e.prototype._createView=function(e,t){for(var r=w.createRenderView(e.cmds,t,this),n=r.nativeShadowRoots,i=0;i<n.length;i++)this._domSharedStylesHost.addHost(n[i]);return new b.RenderViewWithFragments(r,r.fragments)},e.prototype.destroyView=function(e){for(var t=e,r=t.nativeShadowRoots,n=0;n<r.length;n++)this._domSharedStylesHost.removeHost(r[n])},e.prototype.getNativeElementSync=function(e){return n(e.renderView).boundElements[e.boundElementIndex]},e.prototype.getRootNodes=function(e){return i(e)},e.prototype.attachFragmentAfterFragment=function(e,t){var r=i(e);if(r.length>0){var n=r[r.length-1],a=i(t);o(n,a),this.animateNodesEnter(a)}},e.prototype.animateNodesEnter=function(e){for(var t=0;t<e.length;t++)this.animateNodeEnter(e[t])},e.prototype.animateNodeEnter=function(e){v.DOM.isElementNode(e)&&v.DOM.hasClass(e,"ng-animate")&&(v.DOM.addClass(e,"ng-enter"),this._animate.css().addAnimationClass("ng-enter-active").start(e).onComplete(function(){v.DOM.removeClass(e,"ng-enter")}))},e.prototype.animateNodeLeave=function(e){v.DOM.isElementNode(e)&&v.DOM.hasClass(e,"ng-animate")?(v.DOM.addClass(e,"ng-leave"),this._animate.css().addAnimationClass("ng-leave-active").start(e).onComplete(function(){v.DOM.removeClass(e,"ng-leave"),v.DOM.remove(e)})):v.DOM.remove(e)},e.prototype.attachFragmentAfterElement=function(e,t){var r=n(e.renderView),a=r.boundElements[e.boundElementIndex],s=i(t);o(a,s),this.animateNodesEnter(s)},e.prototype.detachFragment=function(e){for(var t=this._detachFragmentScope(),r=i(e),n=0;n<r.length;n++)this.animateNodeLeave(r[n]);_.wtfLeave(t)},e.prototype.hydrateView=function(e){n(e).hydrate()},e.prototype.dehydrateView=function(e){n(e).dehydrate()},e.prototype.createTemplateAnchor=function(e){return this.createElement("script",e)},e.prototype.createElement=function(e,t){var r=v.DOM.createElement(e);return this._setAttributes(r,t),r},e.prototype.mergeElement=function(e,t){v.DOM.clearNodes(e),this._setAttributes(e,t)},e.prototype._setAttributes=function(e,t){for(var r=0;r<t.length;r+=2)v.DOM.setAttribute(e,t[r],t[r+1])},e.prototype.createShadowRoot=function(e,t){for(var r=v.DOM.createShadowRoot(e),n=this._nativeShadowStyles.get(t),i=0;i<n.length;i++)v.DOM.appendChild(r,v.DOM.createStyleElement(n[i]));return r},e.prototype.createText=function(e){return v.DOM.createTextNode(h.isPresent(e)?e:"")},e.prototype.appendChild=function(e,t){v.DOM.appendChild(e,t)},e.prototype.on=function(e,t,r){
this._eventManager.addEventListener(e,t,a(r))},e.prototype.globalOn=function(e,t,r){return this._eventManager.addGlobalEventListener(e,t,a(r))},e.prototype.setElementProperty=function(e,t,r){var i=n(e.renderView);v.DOM.setProperty(i.boundElements[e.boundElementIndex],t,r)},e.prototype.setElementAttribute=function(e,t,r){var i=n(e.renderView),o=i.boundElements[e.boundElementIndex],a=S.camelCaseToDashCase(t);h.isPresent(r)?v.DOM.setAttribute(o,a,h.stringify(r)):v.DOM.removeAttribute(o,a)},e.prototype.setElementClass=function(e,t,r){var i=n(e.renderView),o=i.boundElements[e.boundElementIndex];r?v.DOM.addClass(o,t):v.DOM.removeClass(o,t)},e.prototype.setElementStyle=function(e,t,r){var i=n(e.renderView),o=i.boundElements[e.boundElementIndex],a=S.camelCaseToDashCase(t);h.isPresent(r)?v.DOM.setStyle(o,a,h.stringify(r)):v.DOM.removeStyle(o,a)},e.prototype.invokeElementMethod=function(e,t,r){var i=n(e.renderView),o=i.boundElements[e.boundElementIndex];v.DOM.invoke(o,t,r)},e.prototype.setText=function(e,t,r){var i=n(e);v.DOM.setText(i.boundTextNodes[t],r)},e.prototype.setEventDispatcher=function(e,t){n(e).setEventDispatcher(t)},e=u([f.Injectable(),p(3,f.Inject(x.DOCUMENT)),l("design:paramtypes",[y.EventManager,m.DomSharedStylesHost,d.AnimationBuilder,Object])],e)}();return t.DomRenderer=C,s.define=c,r.exports}),System.register("angular2/src/core/forms/directives/ng_control_name",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/forms/directives/control_container","angular2/src/core/forms/directives/ng_control","angular2/src/core/forms/directives/control_value_accessor","angular2/src/core/forms/directives/shared","angular2/src/core/forms/validators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/facade/async"),p=e("angular2/src/core/metadata"),f=e("angular2/src/core/di"),d=e("angular2/src/core/forms/directives/control_container"),h=e("angular2/src/core/forms/directives/ng_control"),g=e("angular2/src/core/forms/directives/control_value_accessor"),v=e("angular2/src/core/forms/directives/shared"),y=e("angular2/src/core/forms/validators"),m=u.CONST_EXPR(new f.Binding(h.NgControl,{toAlias:f.forwardRef(function(){return _})})),_=function(e){function t(t,r,n){e.call(this),this.update=new l.EventEmitter,this._added=!1,this._parent=t,this.validators=r,this.valueAccessor=v.selectValueAccessor(this,n)}return o(t,e),t.prototype.onChanges=function(e){this._added||(this.formDirective.addControl(this),this._added=!0),v.isPropertyUpdated(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},t.prototype.onDestroy=function(){this.formDirective.removeControl(this)},t.prototype.viewToModelUpdate=function(e){this.viewModel=e,l.ObservableWrapper.callNext(this.update,e)},Object.defineProperty(t.prototype,"path",{get:function(){return v.controlPath(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent.formDirective},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.formDirective.getControl(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return y.Validators.compose(this.validators)},enumerable:!0,configurable:!0}),t=a([p.Directive({selector:"[ng-control]",bindings:[m],inputs:["name: ngControl","model: ngModel"],outputs:["update: ngModel"],exportAs:"form"}),c(0,f.Host()),c(0,f.SkipSelf()),c(1,f.Optional()),c(1,f.Inject(y.NG_VALIDATORS)),c(2,f.Optional()),c(2,f.Inject(g.NG_VALUE_ACCESSOR)),s("design:paramtypes",[d.ControlContainer,Array,Array])],t)}(h.NgControl);return t.NgControlName=_,n.define=i,r.exports}),System.register("@reactivex/rxjs/dist/cjs/Rx",["@reactivex/rxjs/dist/cjs/Subject","@reactivex/rxjs/dist/cjs/schedulers/VirtualTimeScheduler","@reactivex/rxjs/dist/cjs/schedulers/TestScheduler","@reactivex/rxjs/dist/cjs/schedulers/immediate","@reactivex/rxjs/dist/cjs/schedulers/nextTick","@reactivex/rxjs/dist/cjs/Observable","@reactivex/rxjs/dist/cjs/Subscriber","@reactivex/rxjs/dist/cjs/Subscription","@reactivex/rxjs/dist/cjs/Notification","@reactivex/rxjs/dist/cjs/subjects/ReplaySubject","@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject","@reactivex/rxjs/dist/cjs/observables/ConnectableObservable","@reactivex/rxjs/dist/cjs/observables/ArrayObservable","@reactivex/rxjs/dist/cjs/observables/DeferObservable","@reactivex/rxjs/dist/cjs/observables/EmptyObservable","@reactivex/rxjs/dist/cjs/observables/ErrorObservable","@reactivex/rxjs/dist/cjs/observables/InfiniteObservable","@reactivex/rxjs/dist/cjs/observables/IntervalObservable","@reactivex/rxjs/dist/cjs/observables/PromiseObservable","@reactivex/rxjs/dist/cjs/observables/RangeObservable","@reactivex/rxjs/dist/cjs/observables/TimerObservable","@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable","@reactivex/rxjs/dist/cjs/observables/FromEventObservable","@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable","@reactivex/rxjs/dist/cjs/observables/FromObservable","@reactivex/rxjs/dist/cjs/operators/concat-static","@reactivex/rxjs/dist/cjs/operators/concat","@reactivex/rxjs/dist/cjs/operators/concatAll","@reactivex/rxjs/dist/cjs/operators/concatMap","@reactivex/rxjs/dist/cjs/operators/concatMapTo","@reactivex/rxjs/dist/cjs/operators/merge","@reactivex/rxjs/dist/cjs/operators/merge-static","@reactivex/rxjs/dist/cjs/operators/mergeAll","@reactivex/rxjs/dist/cjs/operators/flatMap","@reactivex/rxjs/dist/cjs/operators/flatMapTo","@reactivex/rxjs/dist/cjs/operators/switchAll","@reactivex/rxjs/dist/cjs/operators/switchLatest","@reactivex/rxjs/dist/cjs/operators/switchLatestTo","@reactivex/rxjs/dist/cjs/operators/expand","@reactivex/rxjs/dist/cjs/operators/do","@reactivex/rxjs/dist/cjs/operators/map","@reactivex/rxjs/dist/cjs/operators/mapTo","@reactivex/rxjs/dist/cjs/operators/toArray","@reactivex/rxjs/dist/cjs/operators/count","@reactivex/rxjs/dist/cjs/operators/scan","@reactivex/rxjs/dist/cjs/operators/reduce","@reactivex/rxjs/dist/cjs/operators/startWith","@reactivex/rxjs/dist/cjs/operators/take","@reactivex/rxjs/dist/cjs/operators/skip","@reactivex/rxjs/dist/cjs/operators/skipUntil","@reactivex/rxjs/dist/cjs/operators/takeUntil","@reactivex/rxjs/dist/cjs/operators/filter","@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged","@reactivex/rxjs/dist/cjs/operators/distinctUntilKeyChanged","@reactivex/rxjs/dist/cjs/operators/combineLatest","@reactivex/rxjs/dist/cjs/operators/combineLatest-static","@reactivex/rxjs/dist/cjs/operators/combineAll","@reactivex/rxjs/dist/cjs/operators/withLatestFrom","@reactivex/rxjs/dist/cjs/operators/zip","@reactivex/rxjs/dist/cjs/operators/zip-static","@reactivex/rxjs/dist/cjs/operators/zipAll","@reactivex/rxjs/dist/cjs/operators/publish","@reactivex/rxjs/dist/cjs/operators/publishBehavior","@reactivex/rxjs/dist/cjs/operators/publishReplay","@reactivex/rxjs/dist/cjs/operators/multicast","@reactivex/rxjs/dist/cjs/operators/observeOn","@reactivex/rxjs/dist/cjs/operators/subscribeOn","@reactivex/rxjs/dist/cjs/operators/partition","@reactivex/rxjs/dist/cjs/operators/toPromise","@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty","@reactivex/rxjs/dist/cjs/operators/materialize","@reactivex/rxjs/dist/cjs/operators/catch","@reactivex/rxjs/dist/cjs/operators/retry","@reactivex/rxjs/dist/cjs/operators/retryWhen","@reactivex/rxjs/dist/cjs/operators/repeat","@reactivex/rxjs/dist/cjs/operators/finally","@reactivex/rxjs/dist/cjs/operators/timeout","@reactivex/rxjs/dist/cjs/operators/timeoutWith","@reactivex/rxjs/dist/cjs/operators/groupBy","@reactivex/rxjs/dist/cjs/operators/window","@reactivex/rxjs/dist/cjs/operators/windowWhen","@reactivex/rxjs/dist/cjs/operators/windowToggle","@reactivex/rxjs/dist/cjs/operators/windowTime","@reactivex/rxjs/dist/cjs/operators/windowCount","@reactivex/rxjs/dist/cjs/operators/delay","@reactivex/rxjs/dist/cjs/operators/throttle","@reactivex/rxjs/dist/cjs/operators/debounce","@reactivex/rxjs/dist/cjs/operators/buffer","@reactivex/rxjs/dist/cjs/operators/bufferCount","@reactivex/rxjs/dist/cjs/operators/bufferTime","@reactivex/rxjs/dist/cjs/operators/bufferToggle","@reactivex/rxjs/dist/cjs/operators/bufferWhen","@reactivex/rxjs/dist/cjs/operators/sample","@reactivex/rxjs/dist/cjs/operators/sampleTime"],!0,function(e,t,r){function n(e){return e&&e.__esModule?e:{"default":e}}var i=System.global,o=i.define;i.define=void 0,t.__esModule=!0;var a=e("@reactivex/rxjs/dist/cjs/Subject"),s=n(a),c=e("@reactivex/rxjs/dist/cjs/schedulers/VirtualTimeScheduler"),u=n(c),l=e("@reactivex/rxjs/dist/cjs/schedulers/TestScheduler"),p=n(l),f=e("@reactivex/rxjs/dist/cjs/schedulers/immediate"),d=n(f),h=e("@reactivex/rxjs/dist/cjs/schedulers/nextTick"),g=n(h),v=e("@reactivex/rxjs/dist/cjs/Observable"),y=n(v),m=e("@reactivex/rxjs/dist/cjs/Subscriber"),_=n(m),b=e("@reactivex/rxjs/dist/cjs/Subscription"),x=n(b),w=e("@reactivex/rxjs/dist/cjs/Notification"),j=n(w),S=e("@reactivex/rxjs/dist/cjs/subjects/ReplaySubject"),C=n(S),E=e("@reactivex/rxjs/dist/cjs/subjects/BehaviorSubject"),R=n(E),O=e("@reactivex/rxjs/dist/cjs/observables/ConnectableObservable"),P=n(O),I=e("@reactivex/rxjs/dist/cjs/observables/ArrayObservable"),D=n(I),T=e("@reactivex/rxjs/dist/cjs/observables/DeferObservable"),k=n(T),M=e("@reactivex/rxjs/dist/cjs/observables/EmptyObservable"),A=n(M),N=e("@reactivex/rxjs/dist/cjs/observables/ErrorObservable"),V=n(N),B=e("@reactivex/rxjs/dist/cjs/observables/InfiniteObservable"),L=n(B),F=e("@reactivex/rxjs/dist/cjs/observables/IntervalObservable"),W=n(F),U=e("@reactivex/rxjs/dist/cjs/observables/PromiseObservable"),H=n(U),q=e("@reactivex/rxjs/dist/cjs/observables/RangeObservable"),K=n(q),z=e("@reactivex/rxjs/dist/cjs/observables/TimerObservable"),G=n(z),$=e("@reactivex/rxjs/dist/cjs/observables/FromEventPatternObservable"),Q=n($),X=e("@reactivex/rxjs/dist/cjs/observables/FromEventObservable"),J=n(X),Z=e("@reactivex/rxjs/dist/cjs/observables/ForkJoinObservable"),Y=n(Z),ee=e("@reactivex/rxjs/dist/cjs/observables/FromObservable"),te=n(ee),re=e("@reactivex/rxjs/dist/cjs/operators/concat-static"),ne=n(re),ie=e("@reactivex/rxjs/dist/cjs/operators/concat"),oe=n(ie),ae=e("@reactivex/rxjs/dist/cjs/operators/concatAll"),se=n(ae),ce=e("@reactivex/rxjs/dist/cjs/operators/concatMap"),ue=n(ce),le=e("@reactivex/rxjs/dist/cjs/operators/concatMapTo"),pe=n(le),fe=e("@reactivex/rxjs/dist/cjs/operators/merge"),de=n(fe),he=e("@reactivex/rxjs/dist/cjs/operators/merge-static"),ge=n(he),ve=e("@reactivex/rxjs/dist/cjs/operators/mergeAll"),ye=n(ve),me=e("@reactivex/rxjs/dist/cjs/operators/flatMap"),_e=n(me),be=e("@reactivex/rxjs/dist/cjs/operators/flatMapTo"),xe=n(be),we=e("@reactivex/rxjs/dist/cjs/operators/switchAll"),je=n(we),Se=e("@reactivex/rxjs/dist/cjs/operators/switchLatest"),Ce=n(Se),Ee=e("@reactivex/rxjs/dist/cjs/operators/switchLatestTo"),Re=n(Ee),Oe=e("@reactivex/rxjs/dist/cjs/operators/expand"),Pe=n(Oe),Ie=e("@reactivex/rxjs/dist/cjs/operators/do"),De=n(Ie),Te=e("@reactivex/rxjs/dist/cjs/operators/map"),ke=n(Te),Me=e("@reactivex/rxjs/dist/cjs/operators/mapTo"),Ae=n(Me),Ne=e("@reactivex/rxjs/dist/cjs/operators/toArray"),Ve=n(Ne),Be=e("@reactivex/rxjs/dist/cjs/operators/count"),Le=n(Be),Fe=e("@reactivex/rxjs/dist/cjs/operators/scan"),We=n(Fe),Ue=e("@reactivex/rxjs/dist/cjs/operators/reduce"),He=n(Ue),qe=e("@reactivex/rxjs/dist/cjs/operators/startWith"),Ke=n(qe),ze=e("@reactivex/rxjs/dist/cjs/operators/take"),Ge=n(ze),$e=e("@reactivex/rxjs/dist/cjs/operators/skip"),Qe=n($e),Xe=e("@reactivex/rxjs/dist/cjs/operators/skipUntil"),Je=n(Xe),Ze=e("@reactivex/rxjs/dist/cjs/operators/takeUntil"),Ye=n(Ze),et=e("@reactivex/rxjs/dist/cjs/operators/filter"),tt=n(et),rt=e("@reactivex/rxjs/dist/cjs/operators/distinctUntilChanged"),nt=n(rt),it=e("@reactivex/rxjs/dist/cjs/operators/distinctUntilKeyChanged"),ot=n(it),at=e("@reactivex/rxjs/dist/cjs/operators/combineLatest"),st=n(at),ct=e("@reactivex/rxjs/dist/cjs/operators/combineLatest-static"),ut=n(ct),lt=e("@reactivex/rxjs/dist/cjs/operators/combineAll"),pt=n(lt),ft=e("@reactivex/rxjs/dist/cjs/operators/withLatestFrom"),dt=n(ft),ht=e("@reactivex/rxjs/dist/cjs/operators/zip"),gt=n(ht),vt=e("@reactivex/rxjs/dist/cjs/operators/zip-static"),yt=n(vt),mt=e("@reactivex/rxjs/dist/cjs/operators/zipAll"),_t=n(mt),bt=e("@reactivex/rxjs/dist/cjs/operators/publish"),xt=n(bt),wt=e("@reactivex/rxjs/dist/cjs/operators/publishBehavior"),jt=n(wt),St=e("@reactivex/rxjs/dist/cjs/operators/publishReplay"),Ct=n(St),Et=e("@reactivex/rxjs/dist/cjs/operators/multicast"),Rt=n(Et),Ot=e("@reactivex/rxjs/dist/cjs/operators/observeOn"),Pt=n(Ot),It=e("@reactivex/rxjs/dist/cjs/operators/subscribeOn"),Dt=n(It),Tt=e("@reactivex/rxjs/dist/cjs/operators/partition"),kt=n(Tt),Mt=e("@reactivex/rxjs/dist/cjs/operators/toPromise"),At=n(Mt),Nt=e("@reactivex/rxjs/dist/cjs/operators/defaultIfEmpty"),Vt=n(Nt),Bt=e("@reactivex/rxjs/dist/cjs/operators/materialize"),Lt=n(Bt),Ft=e("@reactivex/rxjs/dist/cjs/operators/catch"),Wt=n(Ft),Ut=e("@reactivex/rxjs/dist/cjs/operators/retry"),Ht=n(Ut),qt=e("@reactivex/rxjs/dist/cjs/operators/retryWhen"),Kt=n(qt),zt=e("@reactivex/rxjs/dist/cjs/operators/repeat"),Gt=n(zt),$t=e("@reactivex/rxjs/dist/cjs/operators/finally"),Qt=n($t),Xt=e("@reactivex/rxjs/dist/cjs/operators/timeout"),Jt=n(Xt),Zt=e("@reactivex/rxjs/dist/cjs/operators/timeoutWith"),Yt=n(Zt),er=e("@reactivex/rxjs/dist/cjs/operators/groupBy"),tr=n(er),rr=e("@reactivex/rxjs/dist/cjs/operators/window"),nr=n(rr),ir=e("@reactivex/rxjs/dist/cjs/operators/windowWhen"),or=n(ir),ar=e("@reactivex/rxjs/dist/cjs/operators/windowToggle"),sr=n(ar),cr=e("@reactivex/rxjs/dist/cjs/operators/windowTime"),ur=n(cr),lr=e("@reactivex/rxjs/dist/cjs/operators/windowCount"),pr=n(lr),fr=e("@reactivex/rxjs/dist/cjs/operators/delay"),dr=n(fr),hr=e("@reactivex/rxjs/dist/cjs/operators/throttle"),gr=n(hr),vr=e("@reactivex/rxjs/dist/cjs/operators/debounce"),yr=n(vr),mr=e("@reactivex/rxjs/dist/cjs/operators/buffer"),_r=n(mr),br=e("@reactivex/rxjs/dist/cjs/operators/bufferCount"),xr=n(br),wr=e("@reactivex/rxjs/dist/cjs/operators/bufferTime"),jr=n(wr),Sr=e("@reactivex/rxjs/dist/cjs/operators/bufferToggle"),Cr=n(Sr),Er=e("@reactivex/rxjs/dist/cjs/operators/bufferWhen"),Rr=n(Er),Or=e("@reactivex/rxjs/dist/cjs/operators/sample"),Pr=n(Or),Ir=e("@reactivex/rxjs/dist/cjs/operators/sampleTime"),Dr=n(Ir);y["default"].defer=k["default"].create,y["default"].from=te["default"].create,y["default"].fromArray=D["default"].create,y["default"].fromPromise=H["default"].create,y["default"].of=D["default"].of,y["default"].range=K["default"].create,y["default"].fromEventPattern=Q["default"].create,y["default"].forkJoin=Y["default"].create,y["default"]["throw"]=V["default"].create,y["default"].empty=A["default"].create,y["default"].never=L["default"].create,y["default"].timer=G["default"].create,y["default"].interval=W["default"].create,y["default"].fromEvent=J["default"].create;var Tr=y["default"].prototype;y["default"].concat=ne["default"],Tr.concat=oe["default"],Tr.concatAll=se["default"],Tr.concatMap=ue["default"],Tr.concatMapTo=pe["default"],y["default"].merge=ge["default"],Tr.merge=de["default"],Tr.mergeAll=ye["default"],Tr.flatMap=_e["default"],Tr.flatMapTo=xe["default"],Tr.switchAll=je["default"],Tr.switchLatest=Ce["default"],Tr.switchLatestTo=Re["default"],Tr.expand=Pe["default"],Tr["do"]=De["default"],Tr.map=ke["default"],Tr.mapTo=Ae["default"],Tr.toArray=Ve["default"],Tr.count=Le["default"],Tr.scan=We["default"],Tr.reduce=He["default"],Tr.startWith=Ke["default"],Tr.take=Ge["default"],Tr.skip=Qe["default"],Tr.takeUntil=Ye["default"],Tr.skipUntil=Je["default"],Tr.filter=tt["default"],Tr.distinctUntilChanged=nt["default"],Tr.distinctUntilKeyChanged=ot["default"],y["default"].combineLatest=ut["default"],Tr.combineLatest=st["default"],Tr.combineAll=pt["default"],Tr.withLatestFrom=dt["default"],y["default"].zip=yt["default"],Tr.zip=gt["default"],Tr.zipAll=_t["default"],Tr.publish=xt["default"],Tr.publishBehavior=jt["default"],Tr.publishReplay=Ct["default"],Tr.multicast=Rt["default"],Tr.observeOn=Pt["default"],Tr.subscribeOn=Dt["default"],Tr.partition=kt["default"],Tr.toPromise=At["default"],Tr.defaultIfEmpty=Vt["default"],Tr.materialize=Lt["default"],Tr["catch"]=Wt["default"],Tr.retry=Ht["default"],Tr.retryWhen=Kt["default"],Tr.repeat=Gt["default"],Tr["finally"]=Qt["default"],Tr.timeout=Jt["default"],Tr.timeoutWith=Yt["default"],Tr.groupBy=tr["default"],Tr.window=nr["default"],Tr.windowWhen=or["default"],Tr.windowToggle=sr["default"],Tr.windowTime=ur["default"],Tr.windowCount=pr["default"],Tr.delay=dr["default"],Tr.throttle=gr["default"],Tr.debounce=yr["default"],Tr.buffer=_r["default"],Tr.bufferCount=xr["default"],Tr.bufferTime=jr["default"],Tr.bufferToggle=Cr["default"],Tr.bufferWhen=Rr["default"],Tr.sample=Pr["default"],Tr.sampleTime=Dr["default"];var kr={nextTick:g["default"],immediate:d["default"]};return t.Subject=s["default"],t.Scheduler=kr,t.Observable=y["default"],t.Subscriber=_["default"],t.Subscription=x["default"],t.ReplaySubject=C["default"],t.BehaviorSubject=R["default"],t.ConnectableObservable=P["default"],t.Notification=j["default"],t.VirtualTimeScheduler=u["default"],t.TestScheduler=p["default"],i.define=o,r.exports}),System.register("angular2/src/core/metadata/di",["angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/di/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/di"),l=e("angular2/src/core/di/metadata"),p=function(e){function t(t){e.call(this),this.attributeName=t}return o(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@Attribute("+c.stringify(this.attributeName)+")"},t=a([c.CONST(),s("design:paramtypes",[String])],t)}(l.DependencyMetadata);t.AttributeMetadata=p;var f=function(e){function t(t,r){var n=void 0===r?{}:r,i=n.descendants,o=void 0===i?!1:i,a=n.first,s=void 0===a?!1:a;e.call(this),this._selector=t,this.descendants=o,this.first=s}return o(t,e),Object.defineProperty(t.prototype,"isViewQuery",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return u.resolveForwardRef(this._selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVarBindingQuery",{get:function(){return c.isString(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"varBindings",{get:function(){return c.StringWrapper.split(this.selector,new RegExp(","))},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@Query("+c.stringify(this.selector)+")"},t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(l.DependencyMetadata);t.QueryMetadata=f;var d=function(e){function t(t,r){var n=(void 0===r?{}:r).descendants,i=void 0===n?!1:n;e.call(this,t,{descendants:i})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(f);t.ContentChildrenMetadata=d;var h=function(e){function t(t){e.call(this,t,{descendants:!0,first:!0})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(f);t.ContentChildMetadata=h;var g=function(e){function t(t,r){var n=void 0===r?{}:r,i=n.descendants,o=void 0===i?!1:i,a=n.first,s=void 0===a?!1:a;e.call(this,t,{descendants:o,first:s})}return o(t,e),Object.defineProperty(t.prototype,"isViewQuery",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@ViewQuery("+c.stringify(this.selector)+")"},t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(f);t.ViewQueryMetadata=g;var v=function(e){function t(t){e.call(this,t,{descendants:!0})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(g);t.ViewChildrenMetadata=v;var y=function(e){function t(t){e.call(this,t,{descendants:!0,first:!0})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(g);return t.ViewChildMetadata=y,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/change_detection",["angular2/src/core/change_detection/differs/iterable_differs","angular2/src/core/change_detection/differs/default_iterable_differ","angular2/src/core/change_detection/differs/keyvalue_differs","angular2/src/core/change_detection/differs/default_keyvalue_differ","angular2/src/core/facade/lang","angular2/src/core/change_detection/parser/ast","angular2/src/core/change_detection/parser/lexer","angular2/src/core/change_detection/parser/parser","angular2/src/core/change_detection/parser/locals","angular2/src/core/change_detection/exceptions","angular2/src/core/change_detection/interfaces","angular2/src/core/change_detection/constants","angular2/src/core/change_detection/proto_change_detector","angular2/src/core/change_detection/jit_proto_change_detector","angular2/src/core/change_detection/binding_record","angular2/src/core/change_detection/directive_record","angular2/src/core/change_detection/dynamic_change_detector","angular2/src/core/change_detection/change_detector_ref","angular2/src/core/change_detection/differs/iterable_differs","angular2/src/core/change_detection/differs/keyvalue_differs","angular2/src/core/change_detection/change_detection_util"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/change_detection/differs/iterable_differs"),a=e("angular2/src/core/change_detection/differs/default_iterable_differ"),s=e("angular2/src/core/change_detection/differs/keyvalue_differs"),c=e("angular2/src/core/change_detection/differs/default_keyvalue_differ"),u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/change_detection/parser/ast");t.ASTWithSource=l.ASTWithSource,t.AST=l.AST,t.AstTransformer=l.AstTransformer,t.PropertyRead=l.PropertyRead,t.LiteralArray=l.LiteralArray,t.ImplicitReceiver=l.ImplicitReceiver;var p=e("angular2/src/core/change_detection/parser/lexer");t.Lexer=p.Lexer;var f=e("angular2/src/core/change_detection/parser/parser");t.Parser=f.Parser;var d=e("angular2/src/core/change_detection/parser/locals");t.Locals=d.Locals;var h=e("angular2/src/core/change_detection/exceptions");t.DehydratedException=h.DehydratedException,t.ExpressionChangedAfterItHasBeenCheckedException=h.ExpressionChangedAfterItHasBeenCheckedException,t.ChangeDetectionError=h.ChangeDetectionError;var g=e("angular2/src/core/change_detection/interfaces");t.ChangeDetectorDefinition=g.ChangeDetectorDefinition,t.DebugContext=g.DebugContext,t.ChangeDetectorGenConfig=g.ChangeDetectorGenConfig;var v=e("angular2/src/core/change_detection/constants");t.ChangeDetectionStrategy=v.ChangeDetectionStrategy,t.CHANGE_DECTION_STRATEGY_VALUES=v.CHANGE_DECTION_STRATEGY_VALUES;var y=e("angular2/src/core/change_detection/proto_change_detector");t.DynamicProtoChangeDetector=y.DynamicProtoChangeDetector;var m=e("angular2/src/core/change_detection/jit_proto_change_detector");t.JitProtoChangeDetector=m.JitProtoChangeDetector;var _=e("angular2/src/core/change_detection/binding_record");t.BindingRecord=_.BindingRecord,t.BindingTarget=_.BindingTarget;var b=e("angular2/src/core/change_detection/directive_record");t.DirectiveIndex=b.DirectiveIndex,t.DirectiveRecord=b.DirectiveRecord;var x=e("angular2/src/core/change_detection/dynamic_change_detector");t.DynamicChangeDetector=x.DynamicChangeDetector;var w=e("angular2/src/core/change_detection/change_detector_ref");t.ChangeDetectorRef=w.ChangeDetectorRef;var j=e("angular2/src/core/change_detection/differs/iterable_differs");t.IterableDiffers=j.IterableDiffers;var S=e("angular2/src/core/change_detection/differs/keyvalue_differs");t.KeyValueDiffers=S.KeyValueDiffers;var C=e("angular2/src/core/change_detection/change_detection_util");return t.WrappedValue=C.WrappedValue,t.SimpleChange=C.SimpleChange,t.keyValDiff=u.CONST_EXPR([u.CONST_EXPR(new c.DefaultKeyValueDifferFactory)]),t.iterableDiff=u.CONST_EXPR([u.CONST_EXPR(new a.DefaultIterableDifferFactory)]),t.defaultIterableDiffers=u.CONST_EXPR(new o.IterableDiffers(t.iterableDiff)),t.defaultKeyValueDiffers=u.CONST_EXPR(new s.KeyValueDiffers(t.keyValDiff)),n.define=i,r.exports}),System.register("angular2/src/core/pipes/async_pipe",["angular2/src/core/facade/lang","angular2/src/core/facade/async","angular2/src/core/metadata","angular2/src/core/di","angular2/src/core/change_detection","angular2/src/core/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/core/facade/lang"),c=e("angular2/src/core/facade/async"),u=e("angular2/src/core/metadata"),l=e("angular2/src/core/di"),p=e("angular2/src/core/change_detection"),f=e("angular2/src/core/pipes/invalid_pipe_argument_exception"),d=function(){function e(){}return e.prototype.createSubscription=function(e,t){return c.ObservableWrapper.subscribe(e,t,function(e){throw e})},e.prototype.dispose=function(e){c.ObservableWrapper.dispose(e)},e.prototype.onDestroy=function(e){c.ObservableWrapper.dispose(e)},e}(),h=function(){function e(){}return e.prototype.createSubscription=function(e,t){return e.then(t)},e.prototype.dispose=function(e){},e.prototype.onDestroy=function(e){},e}(),g=new h,v=new d,y=function(){function e(e){this._ref=e,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}return e.prototype.onDestroy=function(){s.isPresent(this._subscription)&&this._dispose()},e.prototype.transform=function(e,t){return s.isBlank(this._obj)?(s.isPresent(e)&&this._subscribe(e),null):e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,p.WrappedValue.wrap(this._latestValue))},e.prototype._subscribe=function(e){var t=this;this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,function(r){return t._updateLatestValue(e,r)})},e.prototype._selectStrategy=function(t){if(s.isPromise(t))return g;if(c.ObservableWrapper.isObservable(t))return v;throw new f.InvalidPipeArgumentException(e,t)},e.prototype._dispose=function(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},e.prototype._updateLatestValue=function(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())},e=o([u.Pipe({name:"async",pure:!1}),l.Injectable(),a("design:paramtypes",[p.ChangeDetectorRef])],e)}();return t.AsyncPipe=y,n.define=i,r.exports}),System.register("angular2/src/core/render/render",["angular2/src/core/render/dom/shared_styles_host","angular2/src/core/render/dom/dom_renderer","angular2/src/core/render/dom/dom_tokens","angular2/src/core/render/api"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;return i.define=void 0,n(e("angular2/src/core/render/dom/shared_styles_host")),n(e("angular2/src/core/render/dom/dom_renderer")),n(e("angular2/src/core/render/dom/dom_tokens")),n(e("angular2/src/core/render/api")),i.define=o,r.exports}),System.register("angular2/src/core/forms",["angular2/src/core/forms/model","angular2/src/core/forms/directives/abstract_control_directive","angular2/src/core/forms/directives/control_container","angular2/src/core/forms/directives/ng_control_name","angular2/src/core/forms/directives/ng_form_control","angular2/src/core/forms/directives/ng_model","angular2/src/core/forms/directives/ng_control","angular2/src/core/forms/directives/ng_control_group","angular2/src/core/forms/directives/ng_form_model","angular2/src/core/forms/directives/ng_form","angular2/src/core/forms/directives/default_value_accessor","angular2/src/core/forms/directives/ng_control_status","angular2/src/core/forms/directives/checkbox_value_accessor","angular2/src/core/forms/directives/select_control_value_accessor","angular2/src/core/forms/directives","angular2/src/core/forms/validators","angular2/src/core/forms/directives/validators","angular2/src/core/forms/form_builder","angular2/src/core/forms/form_builder","angular2/src/core/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/forms/model");t.AbstractControl=o.AbstractControl,t.Control=o.Control,t.ControlGroup=o.ControlGroup,t.ControlArray=o.ControlArray;var a=e("angular2/src/core/forms/directives/abstract_control_directive");t.AbstractControlDirective=a.AbstractControlDirective;var s=e("angular2/src/core/forms/directives/control_container");t.ControlContainer=s.ControlContainer;var c=e("angular2/src/core/forms/directives/ng_control_name");t.NgControlName=c.NgControlName;var u=e("angular2/src/core/forms/directives/ng_form_control");t.NgFormControl=u.NgFormControl;var l=e("angular2/src/core/forms/directives/ng_model");t.NgModel=l.NgModel;var p=e("angular2/src/core/forms/directives/ng_control");t.NgControl=p.NgControl;var f=e("angular2/src/core/forms/directives/ng_control_group");t.NgControlGroup=f.NgControlGroup;var d=e("angular2/src/core/forms/directives/ng_form_model");t.NgFormModel=d.NgFormModel;var h=e("angular2/src/core/forms/directives/ng_form");t.NgForm=h.NgForm;var g=e("angular2/src/core/forms/directives/default_value_accessor");t.DefaultValueAccessor=g.DefaultValueAccessor;var v=e("angular2/src/core/forms/directives/ng_control_status");t.NgControlStatus=v.NgControlStatus;var y=e("angular2/src/core/forms/directives/checkbox_value_accessor");t.CheckboxControlValueAccessor=y.CheckboxControlValueAccessor;var m=e("angular2/src/core/forms/directives/select_control_value_accessor");t.NgSelectOption=m.NgSelectOption,t.SelectControlValueAccessor=m.SelectControlValueAccessor;var _=e("angular2/src/core/forms/directives");t.FORM_DIRECTIVES=_.FORM_DIRECTIVES;var b=e("angular2/src/core/forms/validators");t.NG_VALIDATORS=b.NG_VALIDATORS,t.Validators=b.Validators;var x=e("angular2/src/core/forms/directives/validators");t.DefaultValidators=x.DefaultValidators;
var w=e("angular2/src/core/forms/form_builder");t.FormBuilder=w.FormBuilder;var j=e("angular2/src/core/forms/form_builder"),S=e("angular2/src/core/facade/lang");return t.FORM_BINDINGS=S.CONST_EXPR([j.FormBuilder]),n.define=i,r.exports}),System.register("angular2/src/http/backends/xhr_backend",["angular2/src/http/enums","angular2/src/http/static_response","angular2/src/http/base_response_options","angular2/src/core/di","angular2/src/http/backends/browser_xhr","angular2/src/core/facade/lang","@reactivex/rxjs/dist/cjs/Rx"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/http/enums"),c=e("angular2/src/http/static_response"),u=e("angular2/src/http/base_response_options"),l=e("angular2/src/core/di"),p=e("angular2/src/http/backends/browser_xhr"),f=e("angular2/src/core/facade/lang"),d=e("@reactivex/rxjs/dist/cjs/Rx"),h=d.Observable,g=function(){function e(e,t,r){var n=this;this.request=e,this.response=new h(function(i){var o=t.build();o.open(s.RequestMethods[e.method].toUpperCase(),e.url);var a=function(){var e=f.isPresent(o.response)?o.response:o.responseText,t=1223===o.status?204:o.status;0===t&&(t=e?200:0);var n=new u.ResponseOptions({body:e,status:t});f.isPresent(r)&&(n=r.merge(n)),i.next(new c.Response(n)),i.complete()},l=function(e){var t=new u.ResponseOptions({body:e,type:s.ResponseTypes.Error});f.isPresent(r)&&(t=r.merge(t)),i.error(new c.Response(t))};return f.isPresent(e.headers)&&e.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.addEventListener("load",a),o.addEventListener("error",l),o.send(n.request.text()),function(){o.removeEventListener("load",a),o.removeEventListener("error",l),o.abort()}})}return e}();t.XHRConnection=g;var v=function(){function e(e,t){this._browserXHR=e,this._baseResponseOptions=t}return e.prototype.createConnection=function(e){return new g(e,this._browserXHR,this._baseResponseOptions)},e=o([l.Injectable(),a("design:paramtypes",[p.BrowserXhr,u.ResponseOptions])],e)}();return t.XHRBackend=v,n.define=i,r.exports}),System.register("angular2/src/core/change_detection",["angular2/src/core/change_detection/change_detection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/change_detection/change_detection");return t.ChangeDetectionStrategy=o.ChangeDetectionStrategy,t.ExpressionChangedAfterItHasBeenCheckedException=o.ExpressionChangedAfterItHasBeenCheckedException,t.ChangeDetectionError=o.ChangeDetectionError,t.ChangeDetectorRef=o.ChangeDetectorRef,t.WrappedValue=o.WrappedValue,t.SimpleChange=o.SimpleChange,t.IterableDiffers=o.IterableDiffers,t.KeyValueDiffers=o.KeyValueDiffers,n.define=i,r.exports}),System.register("angular2/src/core/pipes",["angular2/src/core/pipes/async_pipe","angular2/src/core/pipes/date_pipe","angular2/src/core/pipes/default_pipes","angular2/src/core/pipes/json_pipe","angular2/src/core/pipes/slice_pipe","angular2/src/core/pipes/lowercase_pipe","angular2/src/core/pipes/number_pipe","angular2/src/core/pipes/uppercase_pipe"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/pipes/async_pipe");t.AsyncPipe=o.AsyncPipe;var a=e("angular2/src/core/pipes/date_pipe");t.DatePipe=a.DatePipe;var s=e("angular2/src/core/pipes/default_pipes");t.DEFAULT_PIPES=s.DEFAULT_PIPES,t.DEFAULT_PIPES_TOKEN=s.DEFAULT_PIPES_TOKEN;var c=e("angular2/src/core/pipes/json_pipe");t.JsonPipe=c.JsonPipe;var u=e("angular2/src/core/pipes/slice_pipe");t.SlicePipe=u.SlicePipe;var l=e("angular2/src/core/pipes/lowercase_pipe");t.LowerCasePipe=l.LowerCasePipe;var p=e("angular2/src/core/pipes/number_pipe");t.NumberPipe=p.NumberPipe,t.DecimalPipe=p.DecimalPipe,t.PercentPipe=p.PercentPipe,t.CurrencyPipe=p.CurrencyPipe;var f=e("angular2/src/core/pipes/uppercase_pipe");return t.UpperCasePipe=f.UpperCasePipe,n.define=i,r.exports}),System.register("angular2/src/core/render",["angular2/src/core/render/render"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/render/render");return t.Renderer=o.Renderer,t.RenderViewRef=o.RenderViewRef,t.RenderProtoViewRef=o.RenderProtoViewRef,t.RenderFragmentRef=o.RenderFragmentRef,t.RenderViewWithFragments=o.RenderViewWithFragments,t.DOCUMENT=o.DOCUMENT,n.define=i,r.exports}),System.register("angular2/src/core/application_common",["angular2/src/core/forms","angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/dom/browser_adapter","angular2/src/core/testability/browser_testability","angular2/src/core/dom/dom_adapter","angular2/src/core/compiler/xhr","angular2/src/core/compiler/xhr_impl","angular2/src/core/render/dom/events/event_manager","angular2/src/core/render/dom/events/key_events","angular2/src/core/render/dom/events/hammer_gestures","angular2/src/core/testability/testability","angular2/src/core/render/api","angular2/src/core/render/render","angular2/src/core/render/dom/shared_styles_host","angular2/src/core/platform_bindings","angular2/src/animate/animation_builder","angular2/src/animate/browser_details","angular2/src/core/profile/wtf_init","angular2/src/core/application_ref"],!0,function(e,t,r){function n(){if(l.isBlank(d.DOM))throw"Must set a root DOM adapter first.";return[u.bind(x.DOCUMENT).toValue(d.DOM.defaultDoc()),v.EventManager,new u.Binding(v.EVENT_MANAGER_PLUGINS,{toClass:v.DomEventsPlugin,multi:!0}),new u.Binding(v.EVENT_MANAGER_PLUGINS,{toClass:y.KeyEventsPlugin,multi:!0}),new u.Binding(v.EVENT_MANAGER_PLUGINS,{toClass:m.HammerGesturesPlugin,multi:!0}),x.DomRenderer,u.bind(b.Renderer).toAlias(x.DomRenderer),w.DomSharedStylesHost,u.bind(w.SharedStylesHost).toAlias(w.DomSharedStylesHost),j.EXCEPTION_BINDING,u.bind(h.XHR).toValue(new g.XHRImpl),_.Testability,C.BrowserDetails,S.AnimationBuilder,c.FORM_BINDINGS]}function i(e){return R.platformCommon(e,function(){p.BrowserDomAdapter.makeCurrent(),E.wtfInit(),f.BrowserGetTestability.init()})}function o(e,t){void 0===t&&(t=null);var r=i(),o=[R.applicationCommonBindings(),n()];return l.isPresent(t)&&o.push(t),r.application(o).bootstrap(e)}var a=System.global,s=a.define;a.define=void 0;var c=e("angular2/src/core/forms"),u=e("angular2/src/core/di"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/dom/browser_adapter"),f=e("angular2/src/core/testability/browser_testability"),d=e("angular2/src/core/dom/dom_adapter"),h=e("angular2/src/core/compiler/xhr"),g=e("angular2/src/core/compiler/xhr_impl"),v=e("angular2/src/core/render/dom/events/event_manager"),y=e("angular2/src/core/render/dom/events/key_events"),m=e("angular2/src/core/render/dom/events/hammer_gestures"),_=e("angular2/src/core/testability/testability"),b=e("angular2/src/core/render/api"),x=e("angular2/src/core/render/render"),w=e("angular2/src/core/render/dom/shared_styles_host"),j=e("angular2/src/core/platform_bindings"),S=e("angular2/src/animate/animation_builder"),C=e("angular2/src/animate/browser_details"),E=e("angular2/src/core/profile/wtf_init"),R=e("angular2/src/core/application_ref");return t.applicationDomBindings=n,t.platform=i,t.commonBootstrap=o,a.define=s,r.exports}),System.register("angular2/src/core/metadata/directives",["angular2/src/core/facade/lang","angular2/src/core/di/metadata","angular2/src/core/change_detection"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/facade/lang"),u=e("angular2/src/core/di/metadata"),l=e("angular2/src/core/change_detection"),p=function(e){function t(t){var r=void 0===t?{}:t,n=r.selector,i=r.inputs,o=r.outputs,a=r.properties,s=r.events,c=r.host,u=r.bindings,l=r.exportAs,p=r.moduleId,f=r.queries;e.call(this),this.selector=n,this.inputs=i,this.outputs=o,this.host=c,this.properties=a,this.events=s,this.exportAs=l,this.moduleId=p,this.queries=f,this.bindings=u}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(u.InjectableMetadata);t.DirectiveMetadata=p;var f=function(e){function t(t){var r=void 0===t?{}:t,n=r.selector,i=r.inputs,o=r.outputs,a=r.properties,s=r.events,c=r.host,u=r.exportAs,p=r.moduleId,f=r.bindings,d=r.viewBindings,h=r.changeDetection,g=void 0===h?l.ChangeDetectionStrategy.Default:h,v=r.queries;e.call(this,{selector:n,inputs:i,outputs:o,properties:a,events:s,host:c,exportAs:u,moduleId:p,bindings:f,queries:v}),this.changeDetection=g,this.viewBindings=d}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(p);t.ComponentMetadata=f;var d=function(e){function t(t){var r=t.name,n=t.pure;e.call(this),this.name=r,this._pure=n}return o(t,e),Object.defineProperty(t.prototype,"pure",{get:function(){return c.isPresent(this._pure)?this._pure:!0},enumerable:!0,configurable:!0}),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(u.InjectableMetadata);t.PipeMetadata=d;var h=function(){function e(e){this.bindingPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.InputMetadata=h;var g=function(){function e(e){this.bindingPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.OutputMetadata=g;var v=function(){function e(e){this.hostPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.HostBindingMetadata=v;var y=function(){function e(e,t){this.eventName=e,this.args=t}return e=a([c.CONST(),s("design:paramtypes",[String,Array])],e)}();return t.HostListenerMetadata=y,n.define=i,r.exports}),System.register("angular2/render",["angular2/src/core/render"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;return i.define=void 0,n(e("angular2/src/core/render")),i.define=o,r.exports}),System.register("angular2/src/core/metadata",["angular2/src/core/metadata/di","angular2/src/core/metadata/directives","angular2/src/core/metadata/view","angular2/src/core/metadata/di","angular2/src/core/metadata/directives","angular2/src/core/metadata/view","angular2/src/core/util/decorators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/metadata/di");t.QueryMetadata=o.QueryMetadata,t.ContentChildrenMetadata=o.ContentChildrenMetadata,t.ContentChildMetadata=o.ContentChildMetadata,t.ViewChildrenMetadata=o.ViewChildrenMetadata,t.ViewQueryMetadata=o.ViewQueryMetadata,t.ViewChildMetadata=o.ViewChildMetadata,t.AttributeMetadata=o.AttributeMetadata;var a=e("angular2/src/core/metadata/directives");t.ComponentMetadata=a.ComponentMetadata,t.DirectiveMetadata=a.DirectiveMetadata,t.PipeMetadata=a.PipeMetadata,t.InputMetadata=a.InputMetadata,t.OutputMetadata=a.OutputMetadata,t.HostBindingMetadata=a.HostBindingMetadata,t.HostListenerMetadata=a.HostListenerMetadata;var s=e("angular2/src/core/metadata/view");t.ViewMetadata=s.ViewMetadata,t.ViewEncapsulation=s.ViewEncapsulation;var c=e("angular2/src/core/metadata/di"),u=e("angular2/src/core/metadata/directives"),l=e("angular2/src/core/metadata/view"),p=e("angular2/src/core/util/decorators");return t.Component=p.makeDecorator(u.ComponentMetadata,function(e){return e.View=t.View}),t.Directive=p.makeDecorator(u.DirectiveMetadata),t.View=p.makeDecorator(l.ViewMetadata,function(e){return e.View=t.View}),t.Attribute=p.makeParamDecorator(c.AttributeMetadata),t.Query=p.makeParamDecorator(c.QueryMetadata),t.ContentChildren=p.makePropDecorator(c.ContentChildrenMetadata),t.ContentChild=p.makePropDecorator(c.ContentChildMetadata),t.ViewChildren=p.makePropDecorator(c.ViewChildrenMetadata),t.ViewChild=p.makePropDecorator(c.ViewChildMetadata),t.ViewQuery=p.makeParamDecorator(c.ViewQueryMetadata),t.Pipe=p.makeDecorator(u.PipeMetadata),t.Input=p.makePropDecorator(u.InputMetadata),t.Output=p.makePropDecorator(u.OutputMetadata),t.HostBinding=p.makePropDecorator(u.HostBindingMetadata),t.HostListener=p.makePropDecorator(u.HostListenerMetadata),n.define=i,r.exports}),System.register("angular2/src/core/linker/proto_view_factory",["angular2/src/core/facade/collection","angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/pipes/pipe_binding","angular2/src/core/pipes/pipes","angular2/src/core/linker/view","angular2/src/core/linker/element_binder","angular2/src/core/linker/element_injector","angular2/src/core/linker/directive_resolver","angular2/src/core/linker/view_resolver","angular2/src/core/linker/pipe_resolver","angular2/src/core/pipes","angular2/src/core/linker/template_commands","angular2/render","angular2/src/core/application_tokens"],!0,function(e,t,r){function n(e,t){return e._createComponent(t)}function i(e,t,r){return e._createEmbeddedTemplate(t,r)}function o(e,t,r,n,i,o,u){var l=null,p=null;if(i>0&&(l=r[r.length-i]),v.isBlank(l)&&(i=-1),o>0){var f=r[r.length-o];v.isPresent(f)&&(p=f.protoElementInjector)}v.isBlank(p)&&(o=-1);var d=null,h=!1,g=u.directives.map(function(t){return a(e,t)});u instanceof R.BeginComponentCmd?d=g[0]:u instanceof R.EmbeddedTemplateCmd&&(h=!0);var y=null,m=u.variableNameAndValues.length>0;if(g.length>0||m||h){var _=new Map;h||(_=s(u.variableNameAndValues,g)),y=w.ProtoElementInjector.create(p,n,g,v.isPresent(d),o,_),y.attributes=c(u.attrNameAndValues,!1)}return new x.ElementBinder(n,l,i,y,d,t)}function a(e,t){var r=e.resolve(t);return w.DirectiveBinding.createFromType(t,r)}function s(e,t){for(var r=new Map,n=0;n<e.length;n+=2){var i=e[n],o=e[n+1];v.isNumber(o)?r.set(i,o):r.set(i,null)}return r}function c(e,t){for(var r=new Map,n=0;n<e.length;n+=2)t?r.set(e[n+1],e[n]):r.set(e[n],e[n+1]);return r}function u(e,t){for(var r=0;r<e.length;r++){var n=y.resolveForwardRef(e[r]);v.isArray(n)?u(n,t):t.push(n)}}var l=System.global,p=l.define;l.define=void 0;var f=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},d=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},h=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},g=e("angular2/src/core/facade/collection"),v=e("angular2/src/core/facade/lang"),y=e("angular2/src/core/di"),m=e("angular2/src/core/pipes/pipe_binding"),_=e("angular2/src/core/pipes/pipes"),b=e("angular2/src/core/linker/view"),x=e("angular2/src/core/linker/element_binder"),w=e("angular2/src/core/linker/element_injector"),j=e("angular2/src/core/linker/directive_resolver"),S=e("angular2/src/core/linker/view_resolver"),C=e("angular2/src/core/linker/pipe_resolver"),E=e("angular2/src/core/pipes"),R=e("angular2/src/core/linker/template_commands"),O=e("angular2/render"),P=e("angular2/src/core/application_tokens"),I=function(){function e(e,t,r,n,i,o){this._renderer=e,this._directiveResolver=r,this._viewResolver=n,this._pipeResolver=i,this._cache=new Map,this._defaultPipes=t,this._appId=o}return e.prototype.clearCache=function(){this._cache.clear()},e.prototype.createHost=function(e){var t=e.getTemplate(),r=this._cache.get(t.id);if(v.isBlank(r)){var n=t.getData(this._appId),i={};r=new b.AppProtoView(n.commands,b.ViewType.HOST,!0,n.changeDetectorFactory,null,new _.ProtoPipes(i)),this._cache.set(t.id,r)}return r},e.prototype._createComponent=function(e){var t=this,r=this._cache.get(e.templateId);if(v.isBlank(r)){var n=e.directives[0],i=this._viewResolver.resolve(n),o=e.template.getData(this._appId);this._renderer.registerComponentTemplate(e.templateId,o.commands,o.styles,e.nativeShadow);var a=this._flattenPipes(i).map(function(e){return t._bindPipe(e)});r=new b.AppProtoView(o.commands,b.ViewType.COMPONENT,!0,o.changeDetectorFactory,null,_.ProtoPipes.fromBindings(a)),this._cache.set(e.template.id,r),this._initializeProtoView(r,null)}return r},e.prototype._createEmbeddedTemplate=function(e,t){var r=new b.AppProtoView(e.children,b.ViewType.EMBEDDED,e.isMerged,e.changeDetectorFactory,c(e.variableNameAndValues,!0),new _.ProtoPipes(t.pipes.config));return e.isMerged&&this.initializeProtoViewIfNeeded(r),r},e.prototype.initializeProtoViewIfNeeded=function(e){if(!e.isInitialized()){var t=this._renderer.createProtoView(e.templateCmds);this._initializeProtoView(e,t)}},e.prototype._initializeProtoView=function(e,t){var r=new D(e,this._directiveResolver,this);R.visitAllCommands(r,e.templateCmds);var n=new b.AppProtoViewMergeInfo(r.mergeEmbeddedViewCount,r.mergeElementCount,r.mergeViewCount);e.init(t,r.elementBinders,r.boundTextCount,n,r.variableLocations)},e.prototype._bindPipe=function(e){var t=this._pipeResolver.resolve(e);return m.PipeBinding.createFromType(e,t)},e.prototype._flattenPipes=function(e){if(v.isBlank(e.pipes))return this._defaultPipes;var t=g.ListWrapper.clone(this._defaultPipes);return u(e.pipes,t),t},e=f([y.Injectable(),h(1,y.Inject(E.DEFAULT_PIPES_TOKEN)),h(5,y.Inject(P.APP_ID)),d("design:paramtypes",[O.Renderer,Array,j.DirectiveResolver,S.ViewResolver,C.PipeResolver,String])],e)}();t.ProtoViewFactory=I;var D=function(){function e(e,t,r){this._protoView=e,this._directiveResolver=t,this._protoViewFactory=r,this.variableLocations=new Map,this.boundTextCount=0,this.boundElementIndex=0,this.elementBinderStack=[],this.distanceToParentElementBinder=0,this.distanceToParentProtoElementInjector=0,this.elementBinders=[],this.mergeEmbeddedViewCount=0,this.mergeElementCount=0,this.mergeViewCount=1}return e.prototype.visitText=function(e,t){return e.isBound&&this.boundTextCount++,null},e.prototype.visitNgContent=function(e,t){return null},e.prototype.visitBeginElement=function(e,t){return e.isBound?this._visitBeginBoundElement(e,null):this._visitBeginElement(e,null,null),null},e.prototype.visitEndElement=function(e){return this._visitEndElement()},e.prototype.visitBeginComponent=function(e,t){var r=n(this._protoViewFactory,e);return this._visitBeginBoundElement(e,r)},e.prototype.visitEndComponent=function(e){return this._visitEndElement()},e.prototype.visitEmbeddedTemplate=function(e,t){var r=i(this._protoViewFactory,e,this._protoView);return e.isMerged&&this.mergeEmbeddedViewCount++,this._visitBeginBoundElement(e,r),this._visitEndElement()},e.prototype._visitBeginBoundElement=function(e,t){v.isPresent(t)&&t.isMergable&&(this.mergeElementCount+=t.mergeInfo.elementCount,this.mergeViewCount+=t.mergeInfo.viewCount,this.mergeEmbeddedViewCount+=t.mergeInfo.embeddedViewCount);var r=o(this._directiveResolver,t,this.elementBinderStack,this.boundElementIndex,this.distanceToParentElementBinder,this.distanceToParentProtoElementInjector,e);this.elementBinders.push(r);for(var n=r.protoElementInjector,i=0;i<e.variableNameAndValues.length;i+=2)this.variableLocations.set(e.variableNameAndValues[i],this.boundElementIndex);return this.boundElementIndex++,this.mergeElementCount++,this._visitBeginElement(e,r,n)},e.prototype._visitBeginElement=function(e,t,r){return this.distanceToParentElementBinder=v.isPresent(t)?1:this.distanceToParentElementBinder+1,this.distanceToParentProtoElementInjector=v.isPresent(r)?1:this.distanceToParentProtoElementInjector+1,this.elementBinderStack.push(t),null},e.prototype._visitEndElement=function(){var e=this.elementBinderStack.pop(),t=v.isPresent(e)?e.protoElementInjector:null;return this.distanceToParentElementBinder=v.isPresent(e)?e.distanceToParent:this.distanceToParentElementBinder-1,this.distanceToParentProtoElementInjector=v.isPresent(t)?t.distanceToParent:this.distanceToParentProtoElementInjector-1,null},e}();return t.createDirectiveVariableBindings=s,l.define=p,r.exports}),System.register("angular2/src/core/linker/compiler",["angular2/src/core/linker/proto_view_factory","angular2/src/core/di","angular2/src/core/facade/lang","angular2/src/core/facade/exceptions","angular2/src/core/facade/async","angular2/src/core/reflection/reflection","angular2/src/core/linker/template_commands"],!0,function(e,t,r){function n(e,t){return e._createProtoView(t)}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__decorate||function(e,t,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,r,n);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,n){return void(n&&n(t,r))},void 0);case 4:return e.reduceRight(function(e,n){return n&&n(t,r,e)||e},n)}},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/core/linker/proto_view_factory"),u=e("angular2/src/core/di"),l=e("angular2/src/core/facade/lang"),p=e("angular2/src/core/facade/exceptions"),f=e("angular2/src/core/facade/async"),d=e("angular2/src/core/reflection/reflection"),h=e("angular2/src/core/linker/template_commands"),g=function(){function e(e){this._protoViewFactory=e}return e.prototype.compileInHost=function(e){for(var t=d.reflector.annotations(e),r=null,n=0;n<t.length;n++){var i=t[n];if(i instanceof h.CompiledHostTemplate){r=i;break}}if(l.isBlank(r))throw new p.BaseException("No precompiled template for component "+l.stringify(e)+" found");return f.PromiseWrapper.resolve(this._createProtoView(r))},e.prototype._createProtoView=function(e){return this._protoViewFactory.createHost(e).ref},e.prototype.clearCache=function(){this._protoViewFactory.clearCache()},e=a([u.Injectable(),s("design:paramtypes",[c.ProtoViewFactory])],e)}();return t.Compiler=g,t.internalCreateProtoView=n,i.define=o,r.exports}),System.register("angular2/src/core/compiler/compiler",["angular2/src/core/compiler/template_compiler","angular2/src/core/compiler/directive_metadata","angular2/src/core/compiler/source_module","angular2/src/core/facade/lang","angular2/src/core/di","angular2/src/core/compiler/template_parser","angular2/src/core/compiler/html_parser","angular2/src/core/compiler/template_normalizer","angular2/src/core/compiler/runtime_metadata","angular2/src/core/compiler/change_detector_compiler","angular2/src/core/compiler/style_compiler","angular2/src/core/compiler/command_compiler","angular2/src/core/compiler/template_compiler","angular2/src/core/change_detection/change_detection","angular2/src/core/linker/compiler","angular2/src/core/compiler/runtime_compiler","angular2/src/core/compiler/schema/element_schema_registry","angular2/src/core/compiler/schema/dom_element_schema_registry","angular2/src/core/compiler/url_resolver","angular2/src/core/compiler/app_root_url","angular2/src/core/compiler/anchor_based_app_root_url","angular2/src/core/change_detection/change_detection"],!0,function(e,t,r){function n(){return[R.Lexer,R.Parser,f.HtmlParser,p.TemplateParser,d.TemplateNormalizer,h.RuntimeMetadataResolver,v.StyleCompiler,y.CommandCompiler,g.ChangeDetectionCompiler,l.bind(_.ChangeDetectorGenConfig).toValue(new _.ChangeDetectorGenConfig(u.assertionsEnabled(),u.assertionsEnabled(),!1,!0)),m.TemplateCompiler,x.RuntimeCompiler,l.bind(b.Compiler).toAlias(x.RuntimeCompiler),j.DomElementSchemaRegistry,l.bind(w.ElementSchemaRegistry).toAlias(j.DomElementSchemaRegistry),E.AnchorBasedAppRootUrl,l.bind(C.AppRootUrl).toAlias(E.AnchorBasedAppRootUrl),S.UrlResolver]}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/compiler/template_compiler");t.TemplateCompiler=a.TemplateCompiler;var s=e("angular2/src/core/compiler/directive_metadata");t.CompileDirectiveMetadata=s.CompileDirectiveMetadata,t.CompileTypeMetadata=s.CompileTypeMetadata,t.CompileTemplateMetadata=s.CompileTemplateMetadata;var c=e("angular2/src/core/compiler/source_module");t.SourceModule=c.SourceModule,t.SourceWithImports=c.SourceWithImports;var u=e("angular2/src/core/facade/lang"),l=e("angular2/src/core/di"),p=e("angular2/src/core/compiler/template_parser"),f=e("angular2/src/core/compiler/html_parser"),d=e("angular2/src/core/compiler/template_normalizer"),h=e("angular2/src/core/compiler/runtime_metadata"),g=e("angular2/src/core/compiler/change_detector_compiler"),v=e("angular2/src/core/compiler/style_compiler"),y=e("angular2/src/core/compiler/command_compiler"),m=e("angular2/src/core/compiler/template_compiler"),_=e("angular2/src/core/change_detection/change_detection"),b=e("angular2/src/core/linker/compiler"),x=e("angular2/src/core/compiler/runtime_compiler"),w=e("angular2/src/core/compiler/schema/element_schema_registry"),j=e("angular2/src/core/compiler/schema/dom_element_schema_registry"),S=e("angular2/src/core/compiler/url_resolver"),C=e("angular2/src/core/compiler/app_root_url"),E=e("angular2/src/core/compiler/anchor_based_app_root_url"),R=e("angular2/src/core/change_detection/change_detection");return t.compilerBindings=n,i.define=o,r.exports}),System.register("angular2/src/core/application",["angular2/src/core/facade/lang","angular2/src/core/compiler/compiler","angular2/src/core/application_common","angular2/src/core/application_tokens","angular2/src/core/application_common","angular2/src/core/application_ref"],!0,function(e,t,r){function n(e,t){void 0===t&&(t=null);var r=[s.compilerBindings()];return a.isPresent(t)&&r.push(t),c.commonBootstrap(e,r)}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/facade/lang"),s=e("angular2/src/core/compiler/compiler"),c=e("angular2/src/core/application_common"),u=e("angular2/src/core/application_tokens");t.APP_COMPONENT=u.APP_COMPONENT,t.APP_ID=u.APP_ID;var l=e("angular2/src/core/application_common");t.platform=l.platform;var p=e("angular2/src/core/application_ref");return t.PlatformRef=p.PlatformRef,t.ApplicationRef=p.ApplicationRef,t.applicationCommonBindings=p.applicationCommonBindings,t.createNgZone=p.createNgZone,t.platformCommon=p.platformCommon,t.platformBindings=p.platformBindings,t.bootstrap=n,i.define=o,r.exports}),System.register("angular2/core",["angular2/src/core/metadata","angular2/src/core/util","angular2/src/core/di","angular2/src/core/pipes","angular2/src/core/facade","angular2/src/core/application","angular2/src/core/bootstrap","angular2/src/core/services","angular2/src/core/linker","angular2/src/core/lifecycle","angular2/src/core/zone","angular2/src/core/render","angular2/src/core/directives","angular2/src/core/forms","angular2/src/core/debug","angular2/src/core/change_detection"],!0,function(e,t,r){function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;return i.define=void 0,n(e("angular2/src/core/metadata")),n(e("angular2/src/core/util")),n(e("angular2/src/core/di")),n(e("angular2/src/core/pipes")),n(e("angular2/src/core/facade")),n(e("angular2/src/core/application")),n(e("angular2/src/core/bootstrap")),n(e("angular2/src/core/services")),n(e("angular2/src/core/linker")),n(e("angular2/src/core/lifecycle")),n(e("angular2/src/core/zone")),n(e("angular2/src/core/render")),n(e("angular2/src/core/directives")),n(e("angular2/src/core/forms")),n(e("angular2/src/core/debug")),n(e("angular2/src/core/change_detection")),i.define=o,r.exports}),System.register("angular2/http",["angular2/core","angular2/src/http/http","angular2/src/http/backends/xhr_backend","angular2/src/http/backends/jsonp_backend","angular2/src/http/backends/browser_xhr","angular2/src/http/backends/browser_jsonp","angular2/src/http/base_request_options","angular2/src/http/base_response_options","angular2/src/http/backends/mock_backend","angular2/src/http/static_request","angular2/src/http/static_response","angular2/src/http/interfaces","angular2/src/http/backends/browser_xhr","angular2/src/http/base_request_options","angular2/src/http/base_response_options","angular2/src/http/backends/xhr_backend","angular2/src/http/backends/jsonp_backend","angular2/src/http/http","angular2/src/http/headers","angular2/src/http/enums","angular2/src/http/url_search_params"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/core"),a=e("angular2/src/http/http"),s=e("angular2/src/http/backends/xhr_backend"),c=e("angular2/src/http/backends/jsonp_backend"),u=e("angular2/src/http/backends/browser_xhr"),l=e("angular2/src/http/backends/browser_jsonp"),p=e("angular2/src/http/base_request_options"),f=e("angular2/src/http/base_response_options"),d=e("angular2/src/http/backends/mock_backend");t.MockConnection=d.MockConnection,t.MockBackend=d.MockBackend;var h=e("angular2/src/http/static_request");t.Request=h.Request;var g=e("angular2/src/http/static_response");t.Response=g.Response;var v=e("angular2/src/http/interfaces");t.Connection=v.Connection,t.ConnectionBackend=v.ConnectionBackend;var y=e("angular2/src/http/backends/browser_xhr");t.BrowserXhr=y.BrowserXhr;var m=e("angular2/src/http/base_request_options");t.BaseRequestOptions=m.BaseRequestOptions,t.RequestOptions=m.RequestOptions;var _=e("angular2/src/http/base_response_options");t.BaseResponseOptions=_.BaseResponseOptions,t.ResponseOptions=_.ResponseOptions;var b=e("angular2/src/http/backends/xhr_backend");t.XHRBackend=b.XHRBackend,t.XHRConnection=b.XHRConnection;var x=e("angular2/src/http/backends/jsonp_backend");t.JSONPBackend=x.JSONPBackend,t.JSONPConnection=x.JSONPConnection;var w=e("angular2/src/http/http");t.Http=w.Http,t.Jsonp=w.Jsonp;var j=e("angular2/src/http/headers");t.Headers=j.Headers;var S=e("angular2/src/http/enums");t.ResponseTypes=S.ResponseTypes,t.ReadyStates=S.ReadyStates,t.RequestMethods=S.RequestMethods;var C=e("angular2/src/http/url_search_params");return t.URLSearchParams=C.URLSearchParams,t.HTTP_BINDINGS=[o.bind(a.Http).toFactory(function(e,t){return new a.Http(e,t)},[s.XHRBackend,p.RequestOptions]),u.BrowserXhr,o.bind(p.RequestOptions).toClass(p.BaseRequestOptions),o.bind(f.ResponseOptions).toClass(f.BaseResponseOptions),s.XHRBackend],t.JSONP_BINDINGS=[o.bind(a.Jsonp).toFactory(function(e,t){return new a.Jsonp(e,t)},[c.JSONPBackend,p.RequestOptions]),l.BrowserJsonp,o.bind(p.RequestOptions).toClass(p.BaseRequestOptions),o.bind(f.ResponseOptions).toClass(f.BaseResponseOptions),c.JSONPBackend],n.define=i,r.exports}); |
src/components/Static/Address/index.js | jmikrut/keen-2017 | import React from 'react';
export default () => {
return (
<div className="studio">
<h5>Studio</h5>
<p>
<a href="https://goo.gl/maps/qqpUKto1ZP12" target="_blank" rel="noopener noreferrer">
500 Stocking Ave NW<br/>
Grand Rapids, MI 49504<br/>
United States
</a>
</p>
</div>
)
} |
src/containers/Players_Page.js | giladgreen/pokerStats | import React, { Component } from 'react';
import { changeSelectedPlayer } from '../actions/index';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import { Link } from 'react-router';
import xxx from '../dateHelper';
import Sizes from '../sizes';
import { browserHistory } from 'react-router';
import {find} from 'lodash';
const getAsDate = (stringDate)=>{
//stringDate:02-05-2017
if (!stringDate || stringDate.trim().length!=10){
return new Date();
}
const day = parseInt(stringDate.substr(0,2));
const month = parseInt(stringDate.substr(3,2)) -1;
const year = parseInt(stringDate.substr(6,4));
return new Date(year,month,day);
}
const getDaysDiff = (date)=>{
var difMs = Date.now() - date;
return difMs = Math.floor( difMs / (1000 * 60 * 60 * 24));
}
class PlayersPage extends Component {
componentWillMount(){
this.props.changeSelectedPlayer(null);
}
onPlayerClick(playerId){
const state = this.props.pokerStats;
// console.log("click on id:",playerId);
const playersObject = this.props.pokerStats.playersObject;
const selectedPlayer = playersObject[playerId];
this.props.changeSelectedPlayer(selectedPlayer);
browserHistory.push('/newPlayerForm');
}
constructor(props){
super(props);
this.onPlayerClick= this.onPlayerClick.bind(this);
this.getExtraData = this.getExtraData.bind(this);
this.comparePlayersByGamesCount = this.comparePlayersByGamesCount.bind(this);
}
comparePlayersByGamesCount(playerA,playerB){
const playerAgamesCount = this.getExtraData(playerA).gamesCount;
const playerBgamesCount = this.getExtraData(playerB).gamesCount;
return playerAgamesCount > playerBgamesCount ? -1 : 1;
}
getExtraData(p){
//console.log('player',p);
const playerId = p.id;
let gamesCount = 0;
let sum = 0;
let lastGameDate =0;
const {games} = this.props.pokerStats;
games.forEach((game)=>{
const players = game.players;
const player = find(players,(pl)=> {return pl.id == playerId});
if (player){
gamesCount ++;
const {enter,exit} = player;
const dif = exit - enter;
sum+= dif;
lastGameDate =getAsDate(game.name);
}
});
//console.log(playerId,"lastGameDate:",lastGameDate);
let lastGameDaysCount =getDaysDiff(lastGameDate);
let avarage = sum / gamesCount;
avarage = Math.floor(avarage * 100) / 100;
return {
bottomLine:sum,
avarage:avarage,
gamesCount:gamesCount,
lastGameDaysCount:lastGameDaysCount
};
}
getAge(player){
if (!player.birthdate) return "";
const year = player.birthdate.substr(6,4);
const month = player.birthdate.substr(3,2);
const day = player.birthdate.substr(0,2);
const birthday = new Date(year,month,day);
var ageDifMs = Date.now() - birthday.getTime();
var ageDate = new Date(ageDifMs); // miliseconds from epoch
const age = Math.abs(ageDate.getUTCFullYear() - 1970);
return age <10 ? "Unknown":age;
}
render(){
// console.log("players page render");
const state = this.props.pokerStats;
const {playersObject,groupCurrencySign , isAdmin} = state;
if (!playersObject){
return <div/>;
}
const thClassName = isAdmin ? "" : "HIDDEN" ;
const players = isAdmin ? Object.values(playersObject).filter((playersInfo)=>!playersInfo.private) : [];
players.sort(this.comparePlayersByGamesCount);
const body = players.map(player => {
const {bottomLine,avarage,gamesCount,lastGameDaysCount} = this.getExtraData(player);
let fullName = player.firstName+" "+player.familyName;
fullName = player.private ?<u>{fullName}</u> : fullName;
return (
<tr key={player.id} onClick={()=>this.onPlayerClick(player.id)}>
<th >{fullName}</th>
<th className={thClassName}>{player.phone}</th>
<th className={thClassName} >{player.email}</th>
<th ><img className="playersTableImage" src={player.imageUrl} /></th>
<th >{this.getAge(player)} </th>
<th >{bottomLine}{groupCurrencySign} </th>
<th >{avarage}{groupCurrencySign} </th>
<th >{gamesCount} </th>
<th >{lastGameDaysCount} days ago</th>
</tr>
);
})
const linksDiv = (
<div className="row links" >
<div className="col-xs-6" >
<Link to="/">
<button type="button" className="btn btn-default">
<span className="glyphicon glyphicon-arrow-left" aria-hidden="true" > </span>
Back to main page
</button>
</Link>
</div>
<div className="col-xs-6 rightLink" >
<Link to="newPlayerForm" >
<button type="button" className="btn btn-primary" >
<span className="glyphicon glyphicon-user" aria-hidden="true" > </span>
Add New Player
</button>
</Link>
</div>
</div>
);
if (players.length == 0){
return (
<div id="gamesTables">
{linksDiv}
<div className="NoDataYet">No Players yet</div>
</div>
);
}
const tableDiv = (
<div className="table-responsive">
<table className="table table-hover table-bordered table-striped" >
<caption>Players Details</caption>
<thead>
<tr>
<th >Full Name</th>
<th className={thClassName}> <span className="glyphicon glyphicon-phone" aria-hidden="true" > </span>Phone</th>
<th className={thClassName}> <span className="glyphicon glyphicon-envelope" aria-hidden="true" > </span>E-Mail</th>
<th > <span className="glyphicon glyphicon-picture" aria-hidden="true" > </span>Image</th>
<th > Age</th>
<th > Current status</th>
<th > Avarage per game</th>
<th > Games played</th>
<th > Last Game</th>
</tr>
</thead>
<tbody>
{body}
</tbody>
</table>
</div>
);
const smartphoneDivContent = players.map(player => {
const {bottomLine,avarage,gamesCount} = this.getExtraData(player);
let fullName = player.firstName+" "+player.familyName;
fullName = player.private ?<u>{fullName}</u> : fullName;
return (
<div className="col-xs-12 col-md-12 col-sm-12 playersDivSmartphone" key={player.id} onClick={()=>this.onPlayerClick(player.id)}>
<div className="row">
<div className="col-xs-7">
<div className="fullNameSmartphone" >{fullName}</div>
<div className={thClassName}>{player.phone} </div>
<div className={thClassName}> {player.email}</div>
<div >Age: {this.getAge(player)} </div>
<div >bottomLine:{bottomLine}{groupCurrencySign} </div>
<div> avarage per game:{avarage}{groupCurrencySign} </div>
<div >Games Count:{gamesCount} </div>
</div>
<div className="col-xs-5">
<div className="playersDivImageSmartphone">
<img className="playersImageSmartphone" src={player.imageUrl} />
</div>
</div>
</div>
</div>
);
})
const smartphoneDiv = (
<div className="row">
{smartphoneDivContent}
</div>
);
const data = Sizes.SmartPhone ? smartphoneDiv : tableDiv;
return (
<div className="form-group" >
{linksDiv}
{data}
</div>
);
}
}
function mapStateToProps(state){
return {pokerStats:state.pokerStats};
}
function mapDispatchToProps(dispatch){
return bindActionCreators({changeSelectedPlayer},dispatch);
}
export default connect(mapStateToProps,mapDispatchToProps)(PlayersPage);
|
ajax/libs/clappr/0.0.77/clappr.js | shelsonjava/cdnjs | require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
"use strict";
var Player = require('./components/player');
var IframePlayer = require('./components/iframe_player');
var Mediator = require('mediator');
var version = require('../package.json').version;
global.DEBUG = false;
window.Clappr = {
Player: Player,
Mediator: Mediator,
IframePlayer: IframePlayer
};
window.Clappr.version = version;
module.exports = window.Clappr;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../package.json":6,"./components/iframe_player":17,"./components/player":21,"mediator":"mediator"}],2:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
process.nextTick = (function () {
var canSetImmediate = typeof window !== 'undefined'
&& window.setImmediate;
var canMutationObserver = typeof window !== 'undefined'
&& window.MutationObserver;
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
;
if (canSetImmediate) {
return function (f) { return window.setImmediate(f) };
}
var queue = [];
if (canMutationObserver) {
var hiddenDiv = document.createElement("div");
var observer = new MutationObserver(function () {
var queueList = queue.slice();
queue.length = 0;
queueList.forEach(function (fn) {
fn();
});
});
observer.observe(hiddenDiv, { attributes: true });
return function nextTick(fn) {
if (!queue.length) {
hiddenDiv.setAttribute('yes', 'no');
}
queue.push(fn);
};
}
if (canPost) {
window.addEventListener('message', function (ev) {
var source = ev.source;
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
return function nextTick(fn) {
queue.push(fn);
window.postMessage('process-tick', '*');
};
}
return function nextTick(fn) {
setTimeout(fn, 0);
};
})();
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
},{}],3:[function(require,module,exports){
(function (process,global){
(function(global) {
'use strict';
if (global.$traceurRuntime) {
return;
}
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $Object.defineProperties;
var $defineProperty = $Object.defineProperty;
var $freeze = $Object.freeze;
var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $Object.getOwnPropertyNames;
var $keys = $Object.keys;
var $hasOwnProperty = $Object.prototype.hasOwnProperty;
var $toString = $Object.prototype.toString;
var $preventExtensions = Object.preventExtensions;
var $seal = Object.seal;
var $isExtensible = Object.isExtensible;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var types = {
void: function voidType() {},
any: function any() {},
string: function string() {},
number: function number() {},
boolean: function boolean() {}
};
var method = nonEnum;
var counter = 0;
function newUniqueString() {
return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__';
}
var symbolInternalProperty = newUniqueString();
var symbolDescriptionProperty = newUniqueString();
var symbolDataProperty = newUniqueString();
var symbolValues = $create(null);
var privateNames = $create(null);
function createPrivateName() {
var s = newUniqueString();
privateNames[s] = true;
return s;
}
function isSymbol(symbol) {
return typeof symbol === 'object' && symbol instanceof SymbolValue;
}
function typeOf(v) {
if (isSymbol(v))
return 'symbol';
return typeof v;
}
function Symbol(description) {
var value = new SymbolValue(description);
if (!(this instanceof Symbol))
return value;
throw new TypeError('Symbol cannot be new\'ed');
}
$defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(Symbol.prototype, 'toString', method(function() {
var symbolValue = this[symbolDataProperty];
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
var desc = symbolValue[symbolDescriptionProperty];
if (desc === undefined)
desc = '';
return 'Symbol(' + desc + ')';
}));
$defineProperty(Symbol.prototype, 'valueOf', method(function() {
var symbolValue = this[symbolDataProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
return symbolValue;
}));
function SymbolValue(description) {
var key = newUniqueString();
$defineProperty(this, symbolDataProperty, {value: this});
$defineProperty(this, symbolInternalProperty, {value: key});
$defineProperty(this, symbolDescriptionProperty, {value: description});
freeze(this);
symbolValues[key] = this;
}
$defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(SymbolValue.prototype, 'toString', {
value: Symbol.prototype.toString,
enumerable: false
});
$defineProperty(SymbolValue.prototype, 'valueOf', {
value: Symbol.prototype.valueOf,
enumerable: false
});
var hashProperty = createPrivateName();
var hashPropertyDescriptor = {value: undefined};
var hashObjectProperties = {
hash: {value: undefined},
self: {value: undefined}
};
var hashCounter = 0;
function getOwnHashObject(object) {
var hashObject = object[hashProperty];
if (hashObject && hashObject.self === object)
return hashObject;
if ($isExtensible(object)) {
hashObjectProperties.hash.value = hashCounter++;
hashObjectProperties.self.value = object;
hashPropertyDescriptor.value = $create(null, hashObjectProperties);
$defineProperty(object, hashProperty, hashPropertyDescriptor);
return hashPropertyDescriptor.value;
}
return undefined;
}
function freeze(object) {
getOwnHashObject(object);
return $freeze.apply(this, arguments);
}
function preventExtensions(object) {
getOwnHashObject(object);
return $preventExtensions.apply(this, arguments);
}
function seal(object) {
getOwnHashObject(object);
return $seal.apply(this, arguments);
}
Symbol.iterator = Symbol();
freeze(SymbolValue.prototype);
function toProperty(name) {
if (isSymbol(name))
return name[symbolInternalProperty];
return name;
}
function getOwnPropertyNames(object) {
var rv = [];
var names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var name = names[i];
if (!symbolValues[name] && !privateNames[name])
rv.push(name);
}
return rv;
}
function getOwnPropertyDescriptor(object, name) {
return $getOwnPropertyDescriptor(object, toProperty(name));
}
function getOwnPropertySymbols(object) {
var rv = [];
var names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var symbol = symbolValues[names[i]];
if (symbol)
rv.push(symbol);
}
return rv;
}
function hasOwnProperty(name) {
return $hasOwnProperty.call(this, toProperty(name));
}
function getOption(name) {
return global.traceur && global.traceur.options[name];
}
function setProperty(object, name, value) {
var sym,
desc;
if (isSymbol(name)) {
sym = name;
name = name[symbolInternalProperty];
}
object[name] = value;
if (sym && (desc = $getOwnPropertyDescriptor(object, name)))
$defineProperty(object, name, {enumerable: false});
return value;
}
function defineProperty(object, name, descriptor) {
if (isSymbol(name)) {
if (descriptor.enumerable) {
descriptor = $create(descriptor, {enumerable: {value: false}});
}
name = name[symbolInternalProperty];
}
$defineProperty(object, name, descriptor);
return object;
}
function polyfillObject(Object) {
$defineProperty(Object, 'defineProperty', {value: defineProperty});
$defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames});
$defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor});
$defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty});
$defineProperty(Object, 'freeze', {value: freeze});
$defineProperty(Object, 'preventExtensions', {value: preventExtensions});
$defineProperty(Object, 'seal', {value: seal});
Object.getOwnPropertySymbols = getOwnPropertySymbols;
}
function exportStar(object) {
for (var i = 1; i < arguments.length; i++) {
var names = $getOwnPropertyNames(arguments[i]);
for (var j = 0; j < names.length; j++) {
var name = names[j];
if (privateNames[name])
continue;
(function(mod, name) {
$defineProperty(object, name, {
get: function() {
return mod[name];
},
enumerable: true
});
})(arguments[i], names[j]);
}
}
return object;
}
function isObject(x) {
return x != null && (typeof x === 'object' || typeof x === 'function');
}
function toObject(x) {
if (x == null)
throw $TypeError();
return $Object(x);
}
function checkObjectCoercible(argument) {
if (argument == null) {
throw new TypeError('Value cannot be converted to an Object');
}
return argument;
}
function setupGlobals(global) {
global.Symbol = Symbol;
global.Reflect = global.Reflect || {};
global.Reflect.global = global.Reflect.global || global;
polyfillObject(global.Object);
}
setupGlobals(global);
global.$traceurRuntime = {
createPrivateName: createPrivateName,
exportStar: exportStar,
getOwnHashObject: getOwnHashObject,
privateNames: privateNames,
setProperty: setProperty,
setupGlobals: setupGlobals,
toObject: toObject,
isObject: isObject,
toProperty: toProperty,
type: types,
typeof: typeOf,
checkObjectCoercible: checkObjectCoercible,
hasOwnProperty: function(o, p) {
return hasOwnProperty.call(o, p);
},
defineProperties: $defineProperties,
defineProperty: $defineProperty,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
getOwnPropertyNames: $getOwnPropertyNames,
keys: $keys
};
})(typeof global !== 'undefined' ? global : this);
(function() {
'use strict';
function spread() {
var rv = [],
j = 0,
iterResult;
for (var i = 0; i < arguments.length; i++) {
var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]);
if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') {
throw new TypeError('Cannot spread non-iterable object.');
}
var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)]();
while (!(iterResult = iter.next()).done) {
rv[j++] = iterResult.value;
}
}
return rv;
}
$traceurRuntime.spread = spread;
})();
(function() {
'use strict';
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames;
var $getPrototypeOf = Object.getPrototypeOf;
function superDescriptor(homeObject, name) {
var proto = $getPrototypeOf(homeObject);
do {
var result = $getOwnPropertyDescriptor(proto, name);
if (result)
return result;
proto = $getPrototypeOf(proto);
} while (proto);
return undefined;
}
function superCall(self, homeObject, name, args) {
return superGet(self, homeObject, name).apply(self, args);
}
function superGet(self, homeObject, name) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor) {
if (!descriptor.get)
return descriptor.value;
return descriptor.get.call(self);
}
return undefined;
}
function superSet(self, homeObject, name, value) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor && descriptor.set) {
descriptor.set.call(self, value);
return value;
}
throw $TypeError("super has no setter '" + name + "'.");
}
function getDescriptors(object) {
var descriptors = {},
name,
names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var name = names[i];
descriptors[name] = $getOwnPropertyDescriptor(object, name);
}
return descriptors;
}
function createClass(ctor, object, staticObject, superClass) {
$defineProperty(object, 'constructor', {
value: ctor,
configurable: true,
enumerable: false,
writable: true
});
if (arguments.length > 3) {
if (typeof superClass === 'function')
ctor.__proto__ = superClass;
ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object));
} else {
ctor.prototype = object;
}
$defineProperty(ctor, 'prototype', {
configurable: false,
writable: false
});
return $defineProperties(ctor, getDescriptors(staticObject));
}
function getProtoParent(superClass) {
if (typeof superClass === 'function') {
var prototype = superClass.prototype;
if ($Object(prototype) === prototype || prototype === null)
return superClass.prototype;
throw new $TypeError('super prototype must be an Object or null');
}
if (superClass === null)
return null;
throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + "."));
}
function defaultSuperCall(self, homeObject, args) {
if ($getPrototypeOf(homeObject) !== null)
superCall(self, homeObject, 'constructor', args);
}
$traceurRuntime.createClass = createClass;
$traceurRuntime.defaultSuperCall = defaultSuperCall;
$traceurRuntime.superCall = superCall;
$traceurRuntime.superGet = superGet;
$traceurRuntime.superSet = superSet;
})();
(function() {
'use strict';
var createPrivateName = $traceurRuntime.createPrivateName;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $create = Object.create;
var $TypeError = TypeError;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var ST_NEWBORN = 0;
var ST_EXECUTING = 1;
var ST_SUSPENDED = 2;
var ST_CLOSED = 3;
var END_STATE = -2;
var RETHROW_STATE = -3;
function getInternalError(state) {
return new Error('Traceur compiler bug: invalid state in state machine: ' + state);
}
function GeneratorContext() {
this.state = 0;
this.GState = ST_NEWBORN;
this.storedException = undefined;
this.finallyFallThrough = undefined;
this.sent_ = undefined;
this.returnValue = undefined;
this.tryStack_ = [];
}
GeneratorContext.prototype = {
pushTry: function(catchState, finallyState) {
if (finallyState !== null) {
var finallyFallThrough = null;
for (var i = this.tryStack_.length - 1; i >= 0; i--) {
if (this.tryStack_[i].catch !== undefined) {
finallyFallThrough = this.tryStack_[i].catch;
break;
}
}
if (finallyFallThrough === null)
finallyFallThrough = RETHROW_STATE;
this.tryStack_.push({
finally: finallyState,
finallyFallThrough: finallyFallThrough
});
}
if (catchState !== null) {
this.tryStack_.push({catch: catchState});
}
},
popTry: function() {
this.tryStack_.pop();
},
get sent() {
this.maybeThrow();
return this.sent_;
},
set sent(v) {
this.sent_ = v;
},
get sentIgnoreThrow() {
return this.sent_;
},
maybeThrow: function() {
if (this.action === 'throw') {
this.action = 'next';
throw this.sent_;
}
},
end: function() {
switch (this.state) {
case END_STATE:
return this;
case RETHROW_STATE:
throw this.storedException;
default:
throw getInternalError(this.state);
}
},
handleException: function(ex) {
this.GState = ST_CLOSED;
this.state = END_STATE;
throw ex;
}
};
function nextOrThrow(ctx, moveNext, action, x) {
switch (ctx.GState) {
case ST_EXECUTING:
throw new Error(("\"" + action + "\" on executing generator"));
case ST_CLOSED:
if (action == 'next') {
return {
value: undefined,
done: true
};
}
throw x;
case ST_NEWBORN:
if (action === 'throw') {
ctx.GState = ST_CLOSED;
throw x;
}
if (x !== undefined)
throw $TypeError('Sent value to newborn generator');
case ST_SUSPENDED:
ctx.GState = ST_EXECUTING;
ctx.action = action;
ctx.sent = x;
var value = moveNext(ctx);
var done = value === ctx;
if (done)
value = ctx.returnValue;
ctx.GState = done ? ST_CLOSED : ST_SUSPENDED;
return {
value: value,
done: done
};
}
}
var ctxName = createPrivateName();
var moveNextName = createPrivateName();
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
GeneratorFunction.prototype = GeneratorFunctionPrototype;
$defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction));
GeneratorFunctionPrototype.prototype = {
constructor: GeneratorFunctionPrototype,
next: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'next', v);
},
throw: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v);
}
};
$defineProperties(GeneratorFunctionPrototype.prototype, {
constructor: {enumerable: false},
next: {enumerable: false},
throw: {enumerable: false}
});
Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() {
return this;
}));
function createGeneratorInstance(innerFunction, functionObject, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new GeneratorContext();
var object = $create(functionObject.prototype);
object[ctxName] = ctx;
object[moveNextName] = moveNext;
return object;
}
function initGeneratorFunction(functionObject) {
functionObject.prototype = $create(GeneratorFunctionPrototype.prototype);
functionObject.__proto__ = GeneratorFunctionPrototype;
return functionObject;
}
function AsyncFunctionContext() {
GeneratorContext.call(this);
this.err = undefined;
var ctx = this;
ctx.result = new Promise(function(resolve, reject) {
ctx.resolve = resolve;
ctx.reject = reject;
});
}
AsyncFunctionContext.prototype = $create(GeneratorContext.prototype);
AsyncFunctionContext.prototype.end = function() {
switch (this.state) {
case END_STATE:
this.resolve(this.returnValue);
break;
case RETHROW_STATE:
this.reject(this.storedException);
break;
default:
this.reject(getInternalError(this.state));
}
};
AsyncFunctionContext.prototype.handleException = function() {
this.state = RETHROW_STATE;
};
function asyncWrap(innerFunction, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new AsyncFunctionContext();
ctx.createCallback = function(newState) {
return function(value) {
ctx.state = newState;
ctx.value = value;
moveNext(ctx);
};
};
ctx.errback = function(err) {
handleCatch(ctx, err);
moveNext(ctx);
};
moveNext(ctx);
return ctx.result;
}
function getMoveNext(innerFunction, self) {
return function(ctx) {
while (true) {
try {
return innerFunction.call(self, ctx);
} catch (ex) {
handleCatch(ctx, ex);
}
}
};
}
function handleCatch(ctx, ex) {
ctx.storedException = ex;
var last = ctx.tryStack_[ctx.tryStack_.length - 1];
if (!last) {
ctx.handleException(ex);
return;
}
ctx.state = last.catch !== undefined ? last.catch : last.finally;
if (last.finallyFallThrough !== undefined)
ctx.finallyFallThrough = last.finallyFallThrough;
}
$traceurRuntime.asyncWrap = asyncWrap;
$traceurRuntime.initGeneratorFunction = initGeneratorFunction;
$traceurRuntime.createGeneratorInstance = createGeneratorInstance;
})();
(function() {
function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
var out = [];
if (opt_scheme) {
out.push(opt_scheme, ':');
}
if (opt_domain) {
out.push('//');
if (opt_userInfo) {
out.push(opt_userInfo, '@');
}
out.push(opt_domain);
if (opt_port) {
out.push(':', opt_port);
}
}
if (opt_path) {
out.push(opt_path);
}
if (opt_queryData) {
out.push('?', opt_queryData);
}
if (opt_fragment) {
out.push('#', opt_fragment);
}
return out.join('');
}
;
var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$');
var ComponentIndex = {
SCHEME: 1,
USER_INFO: 2,
DOMAIN: 3,
PORT: 4,
PATH: 5,
QUERY_DATA: 6,
FRAGMENT: 7
};
function split(uri) {
return (uri.match(splitRe));
}
function removeDotSegments(path) {
if (path === '/')
return '/';
var leadingSlash = path[0] === '/' ? '/' : '';
var trailingSlash = path.slice(-1) === '/' ? '/' : '';
var segments = path.split('/');
var out = [];
var up = 0;
for (var pos = 0; pos < segments.length; pos++) {
var segment = segments[pos];
switch (segment) {
case '':
case '.':
break;
case '..':
if (out.length)
out.pop();
else
up++;
break;
default:
out.push(segment);
}
}
if (!leadingSlash) {
while (up-- > 0) {
out.unshift('..');
}
if (out.length === 0)
out.push('.');
}
return leadingSlash + out.join('/') + trailingSlash;
}
function joinAndCanonicalizePath(parts) {
var path = parts[ComponentIndex.PATH] || '';
path = removeDotSegments(path);
parts[ComponentIndex.PATH] = path;
return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]);
}
function canonicalizeUrl(url) {
var parts = split(url);
return joinAndCanonicalizePath(parts);
}
function resolveUrl(base, url) {
var parts = split(url);
var baseParts = split(base);
if (parts[ComponentIndex.SCHEME]) {
return joinAndCanonicalizePath(parts);
} else {
parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME];
}
for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) {
if (!parts[i]) {
parts[i] = baseParts[i];
}
}
if (parts[ComponentIndex.PATH][0] == '/') {
return joinAndCanonicalizePath(parts);
}
var path = baseParts[ComponentIndex.PATH];
var index = path.lastIndexOf('/');
path = path.slice(0, index + 1) + parts[ComponentIndex.PATH];
parts[ComponentIndex.PATH] = path;
return joinAndCanonicalizePath(parts);
}
function isAbsolute(name) {
if (!name)
return false;
if (name[0] === '/')
return true;
var parts = split(name);
if (parts[ComponentIndex.SCHEME])
return true;
return false;
}
$traceurRuntime.canonicalizeUrl = canonicalizeUrl;
$traceurRuntime.isAbsolute = isAbsolute;
$traceurRuntime.removeDotSegments = removeDotSegments;
$traceurRuntime.resolveUrl = resolveUrl;
})();
(function(global) {
'use strict';
var $__2 = $traceurRuntime,
canonicalizeUrl = $__2.canonicalizeUrl,
resolveUrl = $__2.resolveUrl,
isAbsolute = $__2.isAbsolute;
var moduleInstantiators = Object.create(null);
var baseURL;
if (global.location && global.location.href)
baseURL = resolveUrl(global.location.href, './');
else
baseURL = '';
var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) {
this.url = url;
this.value_ = uncoatedModule;
};
($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {});
var ModuleEvaluationError = function ModuleEvaluationError(erroneousModuleName, cause) {
this.message = this.constructor.name + ': ' + this.stripCause(cause) + ' in ' + erroneousModuleName;
if (!(cause instanceof $ModuleEvaluationError) && cause.stack)
this.stack = this.stripStack(cause.stack);
else
this.stack = '';
};
var $ModuleEvaluationError = ModuleEvaluationError;
($traceurRuntime.createClass)(ModuleEvaluationError, {
stripError: function(message) {
return message.replace(/.*Error:/, this.constructor.name + ':');
},
stripCause: function(cause) {
if (!cause)
return '';
if (!cause.message)
return cause + '';
return this.stripError(cause.message);
},
loadedBy: function(moduleName) {
this.stack += '\n loaded by ' + moduleName;
},
stripStack: function(causeStack) {
var stack = [];
causeStack.split('\n').some((function(frame) {
if (/UncoatedModuleInstantiator/.test(frame))
return true;
stack.push(frame);
}));
stack[0] = this.stripError(stack[0]);
return stack.join('\n');
}
}, {}, Error);
var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) {
$traceurRuntime.superCall(this, $UncoatedModuleInstantiator.prototype, "constructor", [url, null]);
this.func = func;
};
var $UncoatedModuleInstantiator = UncoatedModuleInstantiator;
($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() {
if (this.value_)
return this.value_;
try {
return this.value_ = this.func.call(global);
} catch (ex) {
if (ex instanceof ModuleEvaluationError) {
ex.loadedBy(this.url);
throw ex;
}
throw new ModuleEvaluationError(this.url, ex);
}
}}, {}, UncoatedModuleEntry);
function getUncoatedModuleInstantiator(name) {
if (!name)
return;
var url = ModuleStore.normalize(name);
return moduleInstantiators[url];
}
;
var moduleInstances = Object.create(null);
var liveModuleSentinel = {};
function Module(uncoatedModule) {
var isLive = arguments[1];
var coatedModule = Object.create(null);
Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) {
var getter,
value;
if (isLive === liveModuleSentinel) {
var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name);
if (descr.get)
getter = descr.get;
}
if (!getter) {
value = uncoatedModule[name];
getter = function() {
return value;
};
}
Object.defineProperty(coatedModule, name, {
get: getter,
enumerable: true
});
}));
Object.preventExtensions(coatedModule);
return coatedModule;
}
var ModuleStore = {
normalize: function(name, refererName, refererAddress) {
if (typeof name !== "string")
throw new TypeError("module name must be a string, not " + typeof name);
if (isAbsolute(name))
return canonicalizeUrl(name);
if (/[^\.]\/\.\.\//.test(name)) {
throw new Error('module name embeds /../: ' + name);
}
if (name[0] === '.' && refererName)
return resolveUrl(refererName, name);
return canonicalizeUrl(name);
},
get: function(normalizedName) {
var m = getUncoatedModuleInstantiator(normalizedName);
if (!m)
return undefined;
var moduleInstance = moduleInstances[m.url];
if (moduleInstance)
return moduleInstance;
moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel);
return moduleInstances[m.url] = moduleInstance;
},
set: function(normalizedName, module) {
normalizedName = String(normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() {
return module;
}));
moduleInstances[normalizedName] = module;
},
get baseURL() {
return baseURL;
},
set baseURL(v) {
baseURL = String(v);
},
registerModule: function(name, func) {
var normalizedName = ModuleStore.normalize(name);
if (moduleInstantiators[normalizedName])
throw new Error('duplicate module named ' + normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func);
},
bundleStore: Object.create(null),
register: function(name, deps, func) {
if (!deps || !deps.length && !func.length) {
this.registerModule(name, func);
} else {
this.bundleStore[name] = {
deps: deps,
execute: function() {
var $__0 = arguments;
var depMap = {};
deps.forEach((function(dep, index) {
return depMap[dep] = $__0[index];
}));
var registryEntry = func.call(this, depMap);
registryEntry.execute.call(this);
return registryEntry.exports;
}
};
}
},
getAnonymousModule: function(func) {
return new Module(func.call(global), liveModuleSentinel);
},
getForTesting: function(name) {
var $__0 = this;
if (!this.testingPrefix_) {
Object.keys(moduleInstances).some((function(key) {
var m = /(traceur@[^\/]*\/)/.exec(key);
if (m) {
$__0.testingPrefix_ = m[1];
return true;
}
}));
}
return this.get(this.testingPrefix_ + name);
}
};
ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore}));
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
};
$traceurRuntime.ModuleStore = ModuleStore;
global.System = {
register: ModuleStore.register.bind(ModuleStore),
get: ModuleStore.get,
set: ModuleStore.set,
normalize: ModuleStore.normalize
};
$traceurRuntime.getModuleImpl = function(name) {
var instantiator = getUncoatedModuleInstantiator(name);
return instantiator && instantiator.getUncoatedModule();
};
})(typeof global !== 'undefined' ? global : this);
System.register("[email protected]/src/runtime/polyfills/utils", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/utils";
var $ceil = Math.ceil;
var $floor = Math.floor;
var $isFinite = isFinite;
var $isNaN = isNaN;
var $pow = Math.pow;
var $min = Math.min;
var toObject = $traceurRuntime.toObject;
function toUint32(x) {
return x >>> 0;
}
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function isCallable(x) {
return typeof x === 'function';
}
function isNumber(x) {
return typeof x === 'number';
}
function toInteger(x) {
x = +x;
if ($isNaN(x))
return 0;
if (x === 0 || !$isFinite(x))
return x;
return x > 0 ? $floor(x) : $ceil(x);
}
var MAX_SAFE_LENGTH = $pow(2, 53) - 1;
function toLength(x) {
var len = toInteger(x);
return len < 0 ? 0 : $min(len, MAX_SAFE_LENGTH);
}
function checkIterable(x) {
return !isObject(x) ? undefined : x[Symbol.iterator];
}
function isConstructor(x) {
return isCallable(x);
}
function createIteratorResultObject(value, done) {
return {
value: value,
done: done
};
}
function maybeDefine(object, name, descr) {
if (!(name in object)) {
Object.defineProperty(object, name, descr);
}
}
function maybeDefineMethod(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: true,
enumerable: false,
writable: true
});
}
function maybeDefineConst(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: false,
enumerable: false,
writable: false
});
}
function maybeAddFunctions(object, functions) {
for (var i = 0; i < functions.length; i += 2) {
var name = functions[i];
var value = functions[i + 1];
maybeDefineMethod(object, name, value);
}
}
function maybeAddConsts(object, consts) {
for (var i = 0; i < consts.length; i += 2) {
var name = consts[i];
var value = consts[i + 1];
maybeDefineConst(object, name, value);
}
}
function maybeAddIterator(object, func, Symbol) {
if (!Symbol || !Symbol.iterator || object[Symbol.iterator])
return;
if (object['@@iterator'])
func = object['@@iterator'];
Object.defineProperty(object, Symbol.iterator, {
value: func,
configurable: true,
enumerable: false,
writable: true
});
}
var polyfills = [];
function registerPolyfill(func) {
polyfills.push(func);
}
function polyfillAll(global) {
polyfills.forEach((function(f) {
return f(global);
}));
}
return {
get toObject() {
return toObject;
},
get toUint32() {
return toUint32;
},
get isObject() {
return isObject;
},
get isCallable() {
return isCallable;
},
get isNumber() {
return isNumber;
},
get toInteger() {
return toInteger;
},
get toLength() {
return toLength;
},
get checkIterable() {
return checkIterable;
},
get isConstructor() {
return isConstructor;
},
get createIteratorResultObject() {
return createIteratorResultObject;
},
get maybeDefine() {
return maybeDefine;
},
get maybeDefineMethod() {
return maybeDefineMethod;
},
get maybeDefineConst() {
return maybeDefineConst;
},
get maybeAddFunctions() {
return maybeAddFunctions;
},
get maybeAddConsts() {
return maybeAddConsts;
},
get maybeAddIterator() {
return maybeAddIterator;
},
get registerPolyfill() {
return registerPolyfill;
},
get polyfillAll() {
return polyfillAll;
}
};
});
System.register("[email protected]/src/runtime/polyfills/Map", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Map";
var $__3 = System.get("[email protected]/src/runtime/polyfills/utils"),
isObject = $__3.isObject,
maybeAddIterator = $__3.maybeAddIterator,
registerPolyfill = $__3.registerPolyfill;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
var deletedSentinel = {};
function lookupIndex(map, key) {
if (isObject(key)) {
var hashObject = getOwnHashObject(key);
return hashObject && map.objectIndex_[hashObject.hash];
}
if (typeof key === 'string')
return map.stringIndex_[key];
return map.primitiveIndex_[key];
}
function initMap(map) {
map.entries_ = [];
map.objectIndex_ = Object.create(null);
map.stringIndex_ = Object.create(null);
map.primitiveIndex_ = Object.create(null);
map.deletedCount_ = 0;
}
var Map = function Map() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Map called on incompatible type');
if ($hasOwnProperty.call(this, 'entries_')) {
throw new TypeError('Map can not be reentrantly initialised');
}
initMap(this);
if (iterable !== null && iterable !== undefined) {
for (var $__5 = iterable[Symbol.iterator](),
$__6; !($__6 = $__5.next()).done; ) {
var $__7 = $__6.value,
key = $__7[0],
value = $__7[1];
{
this.set(key, value);
}
}
}
};
($traceurRuntime.createClass)(Map, {
get size() {
return this.entries_.length / 2 - this.deletedCount_;
},
get: function(key) {
var index = lookupIndex(this, key);
if (index !== undefined)
return this.entries_[index + 1];
},
set: function(key, value) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index = lookupIndex(this, key);
if (index !== undefined) {
this.entries_[index + 1] = value;
} else {
index = this.entries_.length;
this.entries_[index] = key;
this.entries_[index + 1] = value;
if (objectMode) {
var hashObject = getOwnHashObject(key);
var hash = hashObject.hash;
this.objectIndex_[hash] = index;
} else if (stringMode) {
this.stringIndex_[key] = index;
} else {
this.primitiveIndex_[key] = index;
}
}
return this;
},
has: function(key) {
return lookupIndex(this, key) !== undefined;
},
delete: function(key) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index;
var hash;
if (objectMode) {
var hashObject = getOwnHashObject(key);
if (hashObject) {
index = this.objectIndex_[hash = hashObject.hash];
delete this.objectIndex_[hash];
}
} else if (stringMode) {
index = this.stringIndex_[key];
delete this.stringIndex_[key];
} else {
index = this.primitiveIndex_[key];
delete this.primitiveIndex_[key];
}
if (index !== undefined) {
this.entries_[index] = deletedSentinel;
this.entries_[index + 1] = undefined;
this.deletedCount_++;
return true;
}
return false;
},
clear: function() {
initMap(this);
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
for (var i = 0; i < this.entries_.length; i += 2) {
var key = this.entries_[i];
var value = this.entries_[i + 1];
if (key === deletedSentinel)
continue;
callbackFn.call(thisArg, value, key, this);
}
},
entries: $traceurRuntime.initGeneratorFunction(function $__8() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return [key, value];
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__8, this);
}),
keys: $traceurRuntime.initGeneratorFunction(function $__9() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return key;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__9, this);
}),
values: $traceurRuntime.initGeneratorFunction(function $__10() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return value;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__10, this);
})
}, {});
Object.defineProperty(Map.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Map.prototype.entries
});
function polyfillMap(global) {
var $__7 = global,
Object = $__7.Object,
Symbol = $__7.Symbol;
if (!global.Map)
global.Map = Map;
var mapPrototype = global.Map.prototype;
if (mapPrototype.entries) {
maybeAddIterator(mapPrototype, mapPrototype.entries, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Map().entries()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillMap);
return {
get Map() {
return Map;
},
get polyfillMap() {
return polyfillMap;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Map" + '');
System.register("[email protected]/src/runtime/polyfills/Set", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Set";
var $__11 = System.get("[email protected]/src/runtime/polyfills/utils"),
isObject = $__11.isObject,
maybeAddIterator = $__11.maybeAddIterator,
registerPolyfill = $__11.registerPolyfill;
var Map = System.get("[email protected]/src/runtime/polyfills/Map").Map;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
function initSet(set) {
set.map_ = new Map();
}
var Set = function Set() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Set called on incompatible type');
if ($hasOwnProperty.call(this, 'map_')) {
throw new TypeError('Set can not be reentrantly initialised');
}
initSet(this);
if (iterable !== null && iterable !== undefined) {
for (var $__15 = iterable[Symbol.iterator](),
$__16; !($__16 = $__15.next()).done; ) {
var item = $__16.value;
{
this.add(item);
}
}
}
};
($traceurRuntime.createClass)(Set, {
get size() {
return this.map_.size;
},
has: function(key) {
return this.map_.has(key);
},
add: function(key) {
this.map_.set(key, key);
return this;
},
delete: function(key) {
return this.map_.delete(key);
},
clear: function() {
return this.map_.clear();
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
var $__13 = this;
return this.map_.forEach((function(value, key) {
callbackFn.call(thisArg, key, key, $__13);
}));
},
values: $traceurRuntime.initGeneratorFunction(function $__18() {
var $__19,
$__20;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__19 = this.map_.keys()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__20 = $__19[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__20.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__20.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__20.value;
default:
return $ctx.end();
}
}, $__18, this);
}),
entries: $traceurRuntime.initGeneratorFunction(function $__21() {
var $__22,
$__23;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__22 = this.map_.entries()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__23 = $__22[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__23.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__23.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__23.value;
default:
return $ctx.end();
}
}, $__21, this);
})
}, {});
Object.defineProperty(Set.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Set.prototype.values
});
Object.defineProperty(Set.prototype, 'keys', {
configurable: true,
writable: true,
value: Set.prototype.values
});
function polyfillSet(global) {
var $__17 = global,
Object = $__17.Object,
Symbol = $__17.Symbol;
if (!global.Set)
global.Set = Set;
var setPrototype = global.Set.prototype;
if (setPrototype.values) {
maybeAddIterator(setPrototype, setPrototype.values, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Set().values()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillSet);
return {
get Set() {
return Set;
},
get polyfillSet() {
return polyfillSet;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Set" + '');
System.register("[email protected]/node_modules/rsvp/lib/rsvp/asap", [], function() {
"use strict";
var __moduleName = "[email protected]/node_modules/rsvp/lib/rsvp/asap";
var len = 0;
function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
scheduleFlush();
}
}
var $__default = asap;
var browserGlobal = (typeof window !== 'undefined') ? window : {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
function useNextTick() {
return function() {
process.nextTick(flush);
};
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, {characterData: true});
return function() {
node.data = (iterations = ++iterations % 2);
};
}
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function() {
channel.port2.postMessage(0);
};
}
function useSetTimeout() {
return function() {
setTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i += 2) {
var callback = queue[i];
var arg = queue[i + 1];
callback(arg);
queue[i] = undefined;
queue[i + 1] = undefined;
}
len = 0;
}
var scheduleFlush;
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else {
scheduleFlush = useSetTimeout();
}
return {get default() {
return $__default;
}};
});
System.register("[email protected]/src/runtime/polyfills/Promise", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Promise";
var async = System.get("[email protected]/node_modules/rsvp/lib/rsvp/asap").default;
var registerPolyfill = System.get("[email protected]/src/runtime/polyfills/utils").registerPolyfill;
var promiseRaw = {};
function isPromise(x) {
return x && typeof x === 'object' && x.status_ !== undefined;
}
function idResolveHandler(x) {
return x;
}
function idRejectHandler(x) {
throw x;
}
function chain(promise) {
var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler;
var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler;
var deferred = getDeferred(promise.constructor);
switch (promise.status_) {
case undefined:
throw TypeError;
case 0:
promise.onResolve_.push(onResolve, deferred);
promise.onReject_.push(onReject, deferred);
break;
case +1:
promiseEnqueue(promise.value_, [onResolve, deferred]);
break;
case -1:
promiseEnqueue(promise.value_, [onReject, deferred]);
break;
}
return deferred.promise;
}
function getDeferred(C) {
if (this === $Promise) {
var promise = promiseInit(new $Promise(promiseRaw));
return {
promise: promise,
resolve: (function(x) {
promiseResolve(promise, x);
}),
reject: (function(r) {
promiseReject(promise, r);
})
};
} else {
var result = {};
result.promise = new C((function(resolve, reject) {
result.resolve = resolve;
result.reject = reject;
}));
return result;
}
}
function promiseSet(promise, status, value, onResolve, onReject) {
promise.status_ = status;
promise.value_ = value;
promise.onResolve_ = onResolve;
promise.onReject_ = onReject;
return promise;
}
function promiseInit(promise) {
return promiseSet(promise, 0, undefined, [], []);
}
var Promise = function Promise(resolver) {
if (resolver === promiseRaw)
return;
if (typeof resolver !== 'function')
throw new TypeError;
var promise = promiseInit(this);
try {
resolver((function(x) {
promiseResolve(promise, x);
}), (function(r) {
promiseReject(promise, r);
}));
} catch (e) {
promiseReject(promise, e);
}
};
($traceurRuntime.createClass)(Promise, {
catch: function(onReject) {
return this.then(undefined, onReject);
},
then: function(onResolve, onReject) {
if (typeof onResolve !== 'function')
onResolve = idResolveHandler;
if (typeof onReject !== 'function')
onReject = idRejectHandler;
var that = this;
var constructor = this.constructor;
return chain(this, function(x) {
x = promiseCoerce(constructor, x);
return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x);
}, onReject);
}
}, {
resolve: function(x) {
if (this === $Promise) {
if (isPromise(x)) {
return x;
}
return promiseSet(new $Promise(promiseRaw), +1, x);
} else {
return new this(function(resolve, reject) {
resolve(x);
});
}
},
reject: function(r) {
if (this === $Promise) {
return promiseSet(new $Promise(promiseRaw), -1, r);
} else {
return new this((function(resolve, reject) {
reject(r);
}));
}
},
all: function(values) {
var deferred = getDeferred(this);
var resolutions = [];
try {
var count = values.length;
if (count === 0) {
deferred.resolve(resolutions);
} else {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then(function(i, x) {
resolutions[i] = x;
if (--count === 0)
deferred.resolve(resolutions);
}.bind(undefined, i), (function(r) {
deferred.reject(r);
}));
}
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
},
race: function(values) {
var deferred = getDeferred(this);
try {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then((function(x) {
deferred.resolve(x);
}), (function(r) {
deferred.reject(r);
}));
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
});
var $Promise = Promise;
var $PromiseReject = $Promise.reject;
function promiseResolve(promise, x) {
promiseDone(promise, +1, x, promise.onResolve_);
}
function promiseReject(promise, r) {
promiseDone(promise, -1, r, promise.onReject_);
}
function promiseDone(promise, status, value, reactions) {
if (promise.status_ !== 0)
return;
promiseEnqueue(value, reactions);
promiseSet(promise, status, value);
}
function promiseEnqueue(value, tasks) {
async((function() {
for (var i = 0; i < tasks.length; i += 2) {
promiseHandle(value, tasks[i], tasks[i + 1]);
}
}));
}
function promiseHandle(value, handler, deferred) {
try {
var result = handler(value);
if (result === deferred.promise)
throw new TypeError;
else if (isPromise(result))
chain(result, deferred.resolve, deferred.reject);
else
deferred.resolve(result);
} catch (e) {
try {
deferred.reject(e);
} catch (e) {}
}
}
var thenableSymbol = '@@thenable';
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function promiseCoerce(constructor, x) {
if (!isPromise(x) && isObject(x)) {
var then;
try {
then = x.then;
} catch (r) {
var promise = $PromiseReject.call(constructor, r);
x[thenableSymbol] = promise;
return promise;
}
if (typeof then === 'function') {
var p = x[thenableSymbol];
if (p) {
return p;
} else {
var deferred = getDeferred(constructor);
x[thenableSymbol] = deferred.promise;
try {
then.call(x, deferred.resolve, deferred.reject);
} catch (r) {
deferred.reject(r);
}
return deferred.promise;
}
}
}
return x;
}
function polyfillPromise(global) {
if (!global.Promise)
global.Promise = Promise;
}
registerPolyfill(polyfillPromise);
return {
get Promise() {
return Promise;
},
get polyfillPromise() {
return polyfillPromise;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Promise" + '');
System.register("[email protected]/src/runtime/polyfills/StringIterator", [], function() {
"use strict";
var $__29;
var __moduleName = "[email protected]/src/runtime/polyfills/StringIterator";
var $__27 = System.get("[email protected]/src/runtime/polyfills/utils"),
createIteratorResultObject = $__27.createIteratorResultObject,
isObject = $__27.isObject;
var $__30 = $traceurRuntime,
hasOwnProperty = $__30.hasOwnProperty,
toProperty = $__30.toProperty;
var iteratedString = Symbol('iteratedString');
var stringIteratorNextIndex = Symbol('stringIteratorNextIndex');
var StringIterator = function StringIterator() {};
($traceurRuntime.createClass)(StringIterator, ($__29 = {}, Object.defineProperty($__29, "next", {
value: function() {
var o = this;
if (!isObject(o) || !hasOwnProperty(o, iteratedString)) {
throw new TypeError('this must be a StringIterator object');
}
var s = o[toProperty(iteratedString)];
if (s === undefined) {
return createIteratorResultObject(undefined, true);
}
var position = o[toProperty(stringIteratorNextIndex)];
var len = s.length;
if (position >= len) {
o[toProperty(iteratedString)] = undefined;
return createIteratorResultObject(undefined, true);
}
var first = s.charCodeAt(position);
var resultString;
if (first < 0xD800 || first > 0xDBFF || position + 1 === len) {
resultString = String.fromCharCode(first);
} else {
var second = s.charCodeAt(position + 1);
if (second < 0xDC00 || second > 0xDFFF) {
resultString = String.fromCharCode(first);
} else {
resultString = String.fromCharCode(first) + String.fromCharCode(second);
}
}
o[toProperty(stringIteratorNextIndex)] = position + resultString.length;
return createIteratorResultObject(resultString, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__29, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__29), {});
function createStringIterator(string) {
var s = String(string);
var iterator = Object.create(StringIterator.prototype);
iterator[toProperty(iteratedString)] = s;
iterator[toProperty(stringIteratorNextIndex)] = 0;
return iterator;
}
return {get createStringIterator() {
return createStringIterator;
}};
});
System.register("[email protected]/src/runtime/polyfills/String", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/String";
var createStringIterator = System.get("[email protected]/src/runtime/polyfills/StringIterator").createStringIterator;
var $__32 = System.get("[email protected]/src/runtime/polyfills/utils"),
maybeAddFunctions = $__32.maybeAddFunctions,
maybeAddIterator = $__32.maybeAddIterator,
registerPolyfill = $__32.registerPolyfill;
var $toString = Object.prototype.toString;
var $indexOf = String.prototype.indexOf;
var $lastIndexOf = String.prototype.lastIndexOf;
function startsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) == start;
}
function endsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var pos = stringLength;
if (arguments.length > 1) {
var position = arguments[1];
if (position !== undefined) {
pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
}
}
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchLength;
if (start < 0) {
return false;
}
return $lastIndexOf.call(string, searchString, start) == start;
}
function contains(search) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) != -1;
}
function repeat(count) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var n = count ? Number(count) : 0;
if (isNaN(n)) {
n = 0;
}
if (n < 0 || n == Infinity) {
throw RangeError();
}
if (n == 0) {
return '';
}
var result = '';
while (n--) {
result += string;
}
return result;
}
function codePointAt(position) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var size = string.length;
var index = position ? Number(position) : 0;
if (isNaN(index)) {
index = 0;
}
if (index < 0 || index >= size) {
return undefined;
}
var first = string.charCodeAt(index);
var second;
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
}
function raw(callsite) {
var raw = callsite.raw;
var len = raw.length >>> 0;
if (len === 0)
return '';
var s = '';
var i = 0;
while (true) {
s += raw[i];
if (i + 1 === len)
return s;
s += arguments[++i];
}
}
function fromCodePoint() {
var codeUnits = [];
var floor = Math.floor;
var highSurrogate;
var lowSurrogate;
var index = -1;
var length = arguments.length;
if (!length) {
return '';
}
while (++index < length) {
var codePoint = Number(arguments[index]);
if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
throw RangeError('Invalid code point: ' + codePoint);
}
if (codePoint <= 0xFFFF) {
codeUnits.push(codePoint);
} else {
codePoint -= 0x10000;
highSurrogate = (codePoint >> 10) + 0xD800;
lowSurrogate = (codePoint % 0x400) + 0xDC00;
codeUnits.push(highSurrogate, lowSurrogate);
}
}
return String.fromCharCode.apply(null, codeUnits);
}
function stringPrototypeIterator() {
var o = $traceurRuntime.checkObjectCoercible(this);
var s = String(o);
return createStringIterator(s);
}
function polyfillString(global) {
var String = global.String;
maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]);
maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]);
maybeAddIterator(String.prototype, stringPrototypeIterator, Symbol);
}
registerPolyfill(polyfillString);
return {
get startsWith() {
return startsWith;
},
get endsWith() {
return endsWith;
},
get contains() {
return contains;
},
get repeat() {
return repeat;
},
get codePointAt() {
return codePointAt;
},
get raw() {
return raw;
},
get fromCodePoint() {
return fromCodePoint;
},
get stringPrototypeIterator() {
return stringPrototypeIterator;
},
get polyfillString() {
return polyfillString;
}
};
});
System.get("[email protected]/src/runtime/polyfills/String" + '');
System.register("[email protected]/src/runtime/polyfills/ArrayIterator", [], function() {
"use strict";
var $__36;
var __moduleName = "[email protected]/src/runtime/polyfills/ArrayIterator";
var $__34 = System.get("[email protected]/src/runtime/polyfills/utils"),
toObject = $__34.toObject,
toUint32 = $__34.toUint32,
createIteratorResultObject = $__34.createIteratorResultObject;
var ARRAY_ITERATOR_KIND_KEYS = 1;
var ARRAY_ITERATOR_KIND_VALUES = 2;
var ARRAY_ITERATOR_KIND_ENTRIES = 3;
var ArrayIterator = function ArrayIterator() {};
($traceurRuntime.createClass)(ArrayIterator, ($__36 = {}, Object.defineProperty($__36, "next", {
value: function() {
var iterator = toObject(this);
var array = iterator.iteratorObject_;
if (!array) {
throw new TypeError('Object is not an ArrayIterator');
}
var index = iterator.arrayIteratorNextIndex_;
var itemKind = iterator.arrayIterationKind_;
var length = toUint32(array.length);
if (index >= length) {
iterator.arrayIteratorNextIndex_ = Infinity;
return createIteratorResultObject(undefined, true);
}
iterator.arrayIteratorNextIndex_ = index + 1;
if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
return createIteratorResultObject(array[index], false);
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
return createIteratorResultObject([index, array[index]], false);
return createIteratorResultObject(index, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__36, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__36), {});
function createArrayIterator(array, kind) {
var object = toObject(array);
var iterator = new ArrayIterator;
iterator.iteratorObject_ = object;
iterator.arrayIteratorNextIndex_ = 0;
iterator.arrayIterationKind_ = kind;
return iterator;
}
function entries() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES);
}
function keys() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS);
}
function values() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES);
}
return {
get entries() {
return entries;
},
get keys() {
return keys;
},
get values() {
return values;
}
};
});
System.register("[email protected]/src/runtime/polyfills/Array", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Array";
var $__37 = System.get("[email protected]/src/runtime/polyfills/ArrayIterator"),
entries = $__37.entries,
keys = $__37.keys,
values = $__37.values;
var $__38 = System.get("[email protected]/src/runtime/polyfills/utils"),
checkIterable = $__38.checkIterable,
isCallable = $__38.isCallable,
isConstructor = $__38.isConstructor,
maybeAddFunctions = $__38.maybeAddFunctions,
maybeAddIterator = $__38.maybeAddIterator,
registerPolyfill = $__38.registerPolyfill,
toInteger = $__38.toInteger,
toLength = $__38.toLength,
toObject = $__38.toObject;
function from(arrLike) {
var mapFn = arguments[1];
var thisArg = arguments[2];
var C = this;
var items = toObject(arrLike);
var mapping = mapFn !== undefined;
var k = 0;
var arr,
len;
if (mapping && !isCallable(mapFn)) {
throw TypeError();
}
if (checkIterable(items)) {
arr = isConstructor(C) ? new C() : [];
for (var $__39 = items[Symbol.iterator](),
$__40; !($__40 = $__39.next()).done; ) {
var item = $__40.value;
{
if (mapping) {
arr[k] = mapFn.call(thisArg, item, k);
} else {
arr[k] = item;
}
k++;
}
}
arr.length = k;
return arr;
}
len = toLength(items.length);
arr = isConstructor(C) ? new C(len) : new Array(len);
for (; k < len; k++) {
if (mapping) {
arr[k] = typeof thisArg === 'undefined' ? mapFn(items[k], k) : mapFn.call(thisArg, items[k], k);
} else {
arr[k] = items[k];
}
}
arr.length = len;
return arr;
}
function of() {
for (var items = [],
$__41 = 0; $__41 < arguments.length; $__41++)
items[$__41] = arguments[$__41];
var C = this;
var len = items.length;
var arr = isConstructor(C) ? new C(len) : new Array(len);
for (var k = 0; k < len; k++) {
arr[k] = items[k];
}
arr.length = len;
return arr;
}
function fill(value) {
var start = arguments[1] !== (void 0) ? arguments[1] : 0;
var end = arguments[2];
var object = toObject(this);
var len = toLength(object.length);
var fillStart = toInteger(start);
var fillEnd = end !== undefined ? toInteger(end) : len;
fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len);
fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len);
while (fillStart < fillEnd) {
object[fillStart] = value;
fillStart++;
}
return object;
}
function find(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg);
}
function findIndex(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg, true);
}
function findHelper(self, predicate) {
var thisArg = arguments[2];
var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false;
var object = toObject(self);
var len = toLength(object.length);
if (!isCallable(predicate)) {
throw TypeError();
}
for (var i = 0; i < len; i++) {
if (i in object) {
var value = object[i];
if (predicate.call(thisArg, value, i, object)) {
return returnIndex ? i : value;
}
}
}
return returnIndex ? -1 : undefined;
}
function polyfillArray(global) {
var $__42 = global,
Array = $__42.Array,
Object = $__42.Object,
Symbol = $__42.Symbol;
maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]);
maybeAddFunctions(Array, ['from', from, 'of', of]);
maybeAddIterator(Array.prototype, values, Symbol);
maybeAddIterator(Object.getPrototypeOf([].values()), function() {
return this;
}, Symbol);
}
registerPolyfill(polyfillArray);
return {
get from() {
return from;
},
get of() {
return of;
},
get fill() {
return fill;
},
get find() {
return find;
},
get findIndex() {
return findIndex;
},
get polyfillArray() {
return polyfillArray;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Array" + '');
System.register("[email protected]/src/runtime/polyfills/Object", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Object";
var $__43 = System.get("[email protected]/src/runtime/polyfills/utils"),
maybeAddFunctions = $__43.maybeAddFunctions,
registerPolyfill = $__43.registerPolyfill;
var $__44 = $traceurRuntime,
defineProperty = $__44.defineProperty,
getOwnPropertyDescriptor = $__44.getOwnPropertyDescriptor,
getOwnPropertyNames = $__44.getOwnPropertyNames,
keys = $__44.keys,
privateNames = $__44.privateNames;
function is(left, right) {
if (left === right)
return left !== 0 || 1 / left === 1 / right;
return left !== left && right !== right;
}
function assign(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
var props = keys(source);
var p,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (privateNames[name])
continue;
target[name] = source[name];
}
}
return target;
}
function mixin(target, source) {
var props = getOwnPropertyNames(source);
var p,
descriptor,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (privateNames[name])
continue;
descriptor = getOwnPropertyDescriptor(source, props[p]);
defineProperty(target, props[p], descriptor);
}
return target;
}
function polyfillObject(global) {
var Object = global.Object;
maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]);
}
registerPolyfill(polyfillObject);
return {
get is() {
return is;
},
get assign() {
return assign;
},
get mixin() {
return mixin;
},
get polyfillObject() {
return polyfillObject;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Object" + '');
System.register("[email protected]/src/runtime/polyfills/Number", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/Number";
var $__46 = System.get("[email protected]/src/runtime/polyfills/utils"),
isNumber = $__46.isNumber,
maybeAddConsts = $__46.maybeAddConsts,
maybeAddFunctions = $__46.maybeAddFunctions,
registerPolyfill = $__46.registerPolyfill,
toInteger = $__46.toInteger;
var $abs = Math.abs;
var $isFinite = isFinite;
var $isNaN = isNaN;
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
var MIN_SAFE_INTEGER = -Math.pow(2, 53) + 1;
var EPSILON = Math.pow(2, -52);
function NumberIsFinite(number) {
return isNumber(number) && $isFinite(number);
}
;
function isInteger(number) {
return NumberIsFinite(number) && toInteger(number) === number;
}
function NumberIsNaN(number) {
return isNumber(number) && $isNaN(number);
}
;
function isSafeInteger(number) {
if (NumberIsFinite(number)) {
var integral = toInteger(number);
if (integral === number)
return $abs(integral) <= MAX_SAFE_INTEGER;
}
return false;
}
function polyfillNumber(global) {
var Number = global.Number;
maybeAddConsts(Number, ['MAX_SAFE_INTEGER', MAX_SAFE_INTEGER, 'MIN_SAFE_INTEGER', MIN_SAFE_INTEGER, 'EPSILON', EPSILON]);
maybeAddFunctions(Number, ['isFinite', NumberIsFinite, 'isInteger', isInteger, 'isNaN', NumberIsNaN, 'isSafeInteger', isSafeInteger]);
}
registerPolyfill(polyfillNumber);
return {
get MAX_SAFE_INTEGER() {
return MAX_SAFE_INTEGER;
},
get MIN_SAFE_INTEGER() {
return MIN_SAFE_INTEGER;
},
get EPSILON() {
return EPSILON;
},
get isFinite() {
return NumberIsFinite;
},
get isInteger() {
return isInteger;
},
get isNaN() {
return NumberIsNaN;
},
get isSafeInteger() {
return isSafeInteger;
},
get polyfillNumber() {
return polyfillNumber;
}
};
});
System.get("[email protected]/src/runtime/polyfills/Number" + '');
System.register("[email protected]/src/runtime/polyfills/polyfills", [], function() {
"use strict";
var __moduleName = "[email protected]/src/runtime/polyfills/polyfills";
var polyfillAll = System.get("[email protected]/src/runtime/polyfills/utils").polyfillAll;
polyfillAll(this);
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
polyfillAll(global);
};
return {};
});
System.get("[email protected]/src/runtime/polyfills/polyfills" + '');
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":2}],4:[function(require,module,exports){
/*global define:false */
/**
* Copyright 2013 Craig Campbell
*
* 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.
*
* Mousetrap is a simple keyboard shortcut library for Javascript with
* no external dependencies
*
* @version 1.4.6
* @url craig.is/killing/mice
*/
(function(window, document, undefined) {
/**
* mapping of special keycodes to their corresponding keys
*
* everything in this dictionary cannot use keypress events
* so it has to be here to map to the correct keycodes for
* keyup/keydown events
*
* @type {Object}
*/
var _MAP = {
8: 'backspace',
9: 'tab',
13: 'enter',
16: 'shift',
17: 'ctrl',
18: 'alt',
20: 'capslock',
27: 'esc',
32: 'space',
33: 'pageup',
34: 'pagedown',
35: 'end',
36: 'home',
37: 'left',
38: 'up',
39: 'right',
40: 'down',
45: 'ins',
46: 'del',
91: 'meta',
93: 'meta',
224: 'meta'
},
/**
* mapping for special characters so they can support
*
* this dictionary is only used incase you want to bind a
* keyup or keydown event to one of these keys
*
* @type {Object}
*/
_KEYCODE_MAP = {
106: '*',
107: '+',
109: '-',
110: '.',
111 : '/',
186: ';',
187: '=',
188: ',',
189: '-',
190: '.',
191: '/',
192: '`',
219: '[',
220: '\\',
221: ']',
222: '\''
},
/**
* this is a mapping of keys that require shift on a US keypad
* back to the non shift equivelents
*
* this is so you can use keyup events with these keys
*
* note that this will only work reliably on US keyboards
*
* @type {Object}
*/
_SHIFT_MAP = {
'~': '`',
'!': '1',
'@': '2',
'#': '3',
'$': '4',
'%': '5',
'^': '6',
'&': '7',
'*': '8',
'(': '9',
')': '0',
'_': '-',
'+': '=',
':': ';',
'\"': '\'',
'<': ',',
'>': '.',
'?': '/',
'|': '\\'
},
/**
* this is a list of special strings you can use to map
* to modifier keys when you specify your keyboard shortcuts
*
* @type {Object}
*/
_SPECIAL_ALIASES = {
'option': 'alt',
'command': 'meta',
'return': 'enter',
'escape': 'esc',
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
},
/**
* variable to store the flipped version of _MAP from above
* needed to check if we should use keypress or not when no action
* is specified
*
* @type {Object|undefined}
*/
_REVERSE_MAP,
/**
* a list of all the callbacks setup via Mousetrap.bind()
*
* @type {Object}
*/
_callbacks = {},
/**
* direct map of string combinations to callbacks used for trigger()
*
* @type {Object}
*/
_directMap = {},
/**
* keeps track of what level each sequence is at since multiple
* sequences can start out with the same sequence
*
* @type {Object}
*/
_sequenceLevels = {},
/**
* variable to store the setTimeout call
*
* @type {null|number}
*/
_resetTimer,
/**
* temporary state where we will ignore the next keyup
*
* @type {boolean|string}
*/
_ignoreNextKeyup = false,
/**
* temporary state where we will ignore the next keypress
*
* @type {boolean}
*/
_ignoreNextKeypress = false,
/**
* are we currently inside of a sequence?
* type of action ("keyup" or "keydown" or "keypress") or false
*
* @type {boolean|string}
*/
_nextExpectedAction = false;
/**
* loop through the f keys, f1 to f19 and add them to the map
* programatically
*/
for (var i = 1; i < 20; ++i) {
_MAP[111 + i] = 'f' + i;
}
/**
* loop through to map numbers on the numeric keypad
*/
for (i = 0; i <= 9; ++i) {
_MAP[i + 96] = i;
}
/**
* cross browser add event method
*
* @param {Element|HTMLDocument} object
* @param {string} type
* @param {Function} callback
* @returns void
*/
function _addEvent(object, type, callback) {
if (object.addEventListener) {
object.addEventListener(type, callback, false);
return;
}
object.attachEvent('on' + type, callback);
}
/**
* takes the event and returns the key character
*
* @param {Event} e
* @return {string}
*/
function _characterFromEvent(e) {
// for keypress events we should return the character as is
if (e.type == 'keypress') {
var character = String.fromCharCode(e.which);
// if the shift key is not pressed then it is safe to assume
// that we want the character to be lowercase. this means if
// you accidentally have caps lock on then your key bindings
// will continue to work
//
// the only side effect that might not be desired is if you
// bind something like 'A' cause you want to trigger an
// event when capital A is pressed caps lock will no longer
// trigger the event. shift+a will though.
if (!e.shiftKey) {
character = character.toLowerCase();
}
return character;
}
// for non keypress events the special maps are needed
if (_MAP[e.which]) {
return _MAP[e.which];
}
if (_KEYCODE_MAP[e.which]) {
return _KEYCODE_MAP[e.which];
}
// if it is not in the special map
// with keydown and keyup events the character seems to always
// come in as an uppercase character whether you are pressing shift
// or not. we should make sure it is always lowercase for comparisons
return String.fromCharCode(e.which).toLowerCase();
}
/**
* checks if two arrays are equal
*
* @param {Array} modifiers1
* @param {Array} modifiers2
* @returns {boolean}
*/
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
}
/**
* resets all sequence counters except for the ones passed in
*
* @param {Object} doNotReset
* @returns void
*/
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false,
key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
_sequenceLevels[key] = 0;
}
if (!activeSequences) {
_nextExpectedAction = false;
}
}
/**
* finds all callbacks that match based on the keycode, modifiers,
* and action
*
* @param {string} character
* @param {Array} modifiers
* @param {Event|Object} e
* @param {string=} sequenceName - name of the sequence we are looking for
* @param {string=} combination
* @param {number=} level
* @returns {Array}
*/
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
var i,
callback,
matches = [],
action = e.type;
// if there are no events related to this keycode
if (!_callbacks[character]) {
return [];
}
// if a modifier key is coming up on its own we should allow it
if (action == 'keyup' && _isModifier(character)) {
modifiers = [character];
}
// loop through all callbacks for the key that was pressed
// and see if any of them match
for (i = 0; i < _callbacks[character].length; ++i) {
callback = _callbacks[character][i];
// if a sequence name is not specified, but this is a sequence at
// the wrong level then move onto the next match
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
continue;
}
// if the action we are looking for doesn't match the action we got
// then we should keep going
if (action != callback.action) {
continue;
}
// if this is a keypress event and the meta key and control key
// are not pressed that means that we need to only look at the
// character, otherwise check the modifiers as well
//
// chrome will not fire a keypress if meta or control is down
// safari will fire a keypress if meta or meta+shift is down
// firefox will fire a keypress if meta or control is down
if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {
// when you bind a combination or sequence a second time it
// should overwrite the first one. if a sequenceName or
// combination is specified in this call it does just that
//
// @todo make deleting its own method?
var deleteCombo = !sequenceName && callback.combo == combination;
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
if (deleteCombo || deleteSequence) {
_callbacks[character].splice(i, 1);
}
matches.push(callback);
}
}
return matches;
}
/**
* takes a key event and figures out what the modifiers are
*
* @param {Event} e
* @returns {Array}
*/
function _eventModifiers(e) {
var modifiers = [];
if (e.shiftKey) {
modifiers.push('shift');
}
if (e.altKey) {
modifiers.push('alt');
}
if (e.ctrlKey) {
modifiers.push('ctrl');
}
if (e.metaKey) {
modifiers.push('meta');
}
return modifiers;
}
/**
* prevents default for this event
*
* @param {Event} e
* @returns void
*/
function _preventDefault(e) {
if (e.preventDefault) {
e.preventDefault();
return;
}
e.returnValue = false;
}
/**
* stops propogation for this event
*
* @param {Event} e
* @returns void
*/
function _stopPropagation(e) {
if (e.stopPropagation) {
e.stopPropagation();
return;
}
e.cancelBubble = true;
}
/**
* actually calls the callback function
*
* if your callback function returns false this will use the jquery
* convention - prevent default and stop propogation on the event
*
* @param {Function} callback
* @param {Event} e
* @returns void
*/
function _fireCallback(callback, e, combo, sequence) {
// if this event should not happen stop here
if (Mousetrap.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
return;
}
if (callback(e, combo) === false) {
_preventDefault(e);
_stopPropagation(e);
}
}
/**
* handles a character key event
*
* @param {string} character
* @param {Array} modifiers
* @param {Event} e
* @returns void
*/
function _handleKey(character, modifiers, e) {
var callbacks = _getMatches(character, modifiers, e),
i,
doNotReset = {},
maxLevel = 0,
processedSequenceCallback = false;
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
for (i = 0; i < callbacks.length; ++i) {
if (callbacks[i].seq) {
maxLevel = Math.max(maxLevel, callbacks[i].level);
}
}
// loop through matching callbacks for this key event
for (i = 0; i < callbacks.length; ++i) {
// fire for all sequence callbacks
// this is because if for example you have multiple sequences
// bound such as "g i" and "g t" they both need to fire the
// callback for matching g cause otherwise you can only ever
// match the first one
if (callbacks[i].seq) {
// only fire callbacks for the maxLevel to prevent
// subsequences from also firing
//
// for example 'a option b' should not cause 'option b' to fire
// even though 'option b' is part of the other sequence
//
// any sequences that do not match here will be discarded
// below by the _resetSequences call
if (callbacks[i].level != maxLevel) {
continue;
}
processedSequenceCallback = true;
// keep a list of which sequences were matches for later
doNotReset[callbacks[i].seq] = 1;
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
continue;
}
// if there were no sequence matches but we are still here
// that means this is a regular match so we should fire that
if (!processedSequenceCallback) {
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
}
}
// if the key you pressed matches the type of sequence without
// being a modifier (ie "keyup" or "keypress") then we should
// reset all sequences that were not matched by this event
//
// this is so, for example, if you have the sequence "h a t" and you
// type "h e a r t" it does not match. in this case the "e" will
// cause the sequence to reset
//
// modifier keys are ignored because you can have a sequence
// that contains modifiers such as "enter ctrl+space" and in most
// cases the modifier key will be pressed before the next key
//
// also if you have a sequence such as "ctrl+b a" then pressing the
// "b" key will trigger a "keypress" and a "keydown"
//
// the "keydown" is expected when there is a modifier, but the
// "keypress" ends up matching the _nextExpectedAction since it occurs
// after and that causes the sequence to reset
//
// we ignore keypresses in a sequence that directly follow a keydown
// for the same character
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
_resetSequences(doNotReset);
}
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
}
/**
* handles a keydown event
*
* @param {Event} e
* @returns void
*/
function _handleKeyEvent(e) {
// normalize e.which for key events
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
if (typeof e.which !== 'number') {
e.which = e.keyCode;
}
var character = _characterFromEvent(e);
// no character found then stop
if (!character) {
return;
}
// need to use === for the character check because the character can be 0
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
_ignoreNextKeyup = false;
return;
}
Mousetrap.handleKey(character, _eventModifiers(e), e);
}
/**
* determines if the keycode specified is a modifier key or not
*
* @param {string} key
* @returns {boolean}
*/
function _isModifier(key) {
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
}
/**
* called to set a 1 second timeout on the specified sequence
*
* this is so after each key press in the sequence you have 1 second
* to press the next key before you have to start over
*
* @returns void
*/
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1000);
}
/**
* reverses the map lookup so that we can look for specific keys
* to see what can and can't use keypress
*
* @return {Object}
*/
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
// pull out the numeric keypad from here cause keypress should
// be able to detect the keys from the character
if (key > 95 && key < 112) {
continue;
}
if (_MAP.hasOwnProperty(key)) {
_REVERSE_MAP[_MAP[key]] = key;
}
}
}
return _REVERSE_MAP;
}
/**
* picks the best action based on the key combination
*
* @param {string} key - character for key
* @param {Array} modifiers
* @param {string=} action passed in
*/
function _pickBestAction(key, modifiers, action) {
// if no action was picked in we should try to pick the one
// that we think would work best for this key
if (!action) {
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
}
// modifier keys don't work as expected with keypress,
// switch to keydown
if (action == 'keypress' && modifiers.length) {
action = 'keydown';
}
return action;
}
/**
* binds a key sequence to an event
*
* @param {string} combo - combo specified in bind call
* @param {Array} keys
* @param {Function} callback
* @param {string=} action
* @returns void
*/
function _bindSequence(combo, keys, callback, action) {
// start off by adding a sequence level record for this combination
// and setting the level to 0
_sequenceLevels[combo] = 0;
/**
* callback to increase the sequence level for this sequence and reset
* all other sequences that were active
*
* @param {string} nextAction
* @returns {Function}
*/
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
}
/**
* wraps the specified callback inside of another function in order
* to reset all sequence counters as soon as this sequence is done
*
* @param {Event} e
* @returns void
*/
function _callbackAndReset(e) {
_fireCallback(callback, e, combo);
// we should ignore the next key up if the action is key down
// or keypress. this is so if you finish a sequence and
// release the key the final key will not trigger a keyup
if (action !== 'keyup') {
_ignoreNextKeyup = _characterFromEvent(e);
}
// weird race condition if a sequence ends with the key
// another sequence begins with
setTimeout(_resetSequences, 10);
}
// loop through keys one at a time and bind the appropriate callback
// function. for any key leading up to the final one it should
// increase the sequence. after the final, it should reset all sequences
//
// if an action is specified in the original bind call then that will
// be used throughout. otherwise we will pass the action that the
// next key in the sequence should match. this allows a sequence
// to mix and match keypress and keydown events depending on which
// ones are better suited to the key provided
for (var i = 0; i < keys.length; ++i) {
var isFinal = i + 1 === keys.length;
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
_bindSingle(keys[i], wrappedCallback, action, combo, i);
}
}
/**
* Converts from a string key combination to an array
*
* @param {string} combination like "command+shift+l"
* @return {Array}
*/
function _keysFromString(combination) {
if (combination === '+') {
return ['+'];
}
return combination.split('+');
}
/**
* Gets info for a specific key combination
*
* @param {string} combination key combination ("command+s" or "a" or "*")
* @param {string=} action
* @returns {Object}
*/
function _getKeyInfo(combination, action) {
var keys,
key,
i,
modifiers = [];
// take the keys from this pattern and figure out what the actual
// pattern is all about
keys = _keysFromString(combination);
for (i = 0; i < keys.length; ++i) {
key = keys[i];
// normalize key names
if (_SPECIAL_ALIASES[key]) {
key = _SPECIAL_ALIASES[key];
}
// if this is not a keypress event then we should
// be smart about using shift keys
// this will only work for US keyboards however
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
key = _SHIFT_MAP[key];
modifiers.push('shift');
}
// if this key is a modifier then add it to the list of modifiers
if (_isModifier(key)) {
modifiers.push(key);
}
}
// depending on what the key combination is
// we will try to pick the best event for it
action = _pickBestAction(key, modifiers, action);
return {
key: key,
modifiers: modifiers,
action: action
};
}
/**
* binds a single keyboard combination
*
* @param {string} combination
* @param {Function} callback
* @param {string=} action
* @param {string=} sequenceName - name of sequence if part of sequence
* @param {number=} level - what part of the sequence the command is
* @returns void
*/
function _bindSingle(combination, callback, action, sequenceName, level) {
// store a direct mapped reference for use with Mousetrap.trigger
_directMap[combination + ':' + action] = callback;
// make sure multiple spaces in a row become a single space
combination = combination.replace(/\s+/g, ' ');
var sequence = combination.split(' '),
info;
// if this pattern is a sequence of keys then run through this method
// to reprocess each pattern one key at a time
if (sequence.length > 1) {
_bindSequence(combination, sequence, callback, action);
return;
}
info = _getKeyInfo(combination, action);
// make sure to initialize array if this is the first time
// a callback is added for this key
_callbacks[info.key] = _callbacks[info.key] || [];
// remove an existing match if there is one
_getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
// add this call back to the array
// if it is a sequence put it at the beginning
// if not put it at the end
//
// this is important because the way these are processed expects
// the sequence ones to come first
_callbacks[info.key][sequenceName ? 'unshift' : 'push']({
callback: callback,
modifiers: info.modifiers,
action: info.action,
seq: sequenceName,
level: level,
combo: combination
});
}
/**
* binds multiple combinations to the same callback
*
* @param {Array} combinations
* @param {Function} callback
* @param {string|undefined} action
* @returns void
*/
function _bindMultiple(combinations, callback, action) {
for (var i = 0; i < combinations.length; ++i) {
_bindSingle(combinations[i], callback, action);
}
}
// start!
_addEvent(document, 'keypress', _handleKeyEvent);
_addEvent(document, 'keydown', _handleKeyEvent);
_addEvent(document, 'keyup', _handleKeyEvent);
var Mousetrap = {
/**
* binds an event to mousetrap
*
* can be a single key, a combination of keys separated with +,
* an array of keys, or a sequence of keys separated by spaces
*
* be sure to list the modifier keys first to make sure that the
* correct key ends up getting bound (the last key in the pattern)
*
* @param {string|Array} keys
* @param {Function} callback
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
* @returns void
*/
bind: function(keys, callback, action) {
keys = keys instanceof Array ? keys : [keys];
_bindMultiple(keys, callback, action);
return this;
},
/**
* unbinds an event to mousetrap
*
* the unbinding sets the callback function of the specified key combo
* to an empty function and deletes the corresponding key in the
* _directMap dict.
*
* TODO: actually remove this from the _callbacks dictionary instead
* of binding an empty function
*
* the keycombo+action has to be exactly the same as
* it was defined in the bind method
*
* @param {string|Array} keys
* @param {string} action
* @returns void
*/
unbind: function(keys, action) {
return Mousetrap.bind(keys, function() {}, action);
},
/**
* triggers an event that has already been bound
*
* @param {string} keys
* @param {string=} action
* @returns void
*/
trigger: function(keys, action) {
if (_directMap[keys + ':' + action]) {
_directMap[keys + ':' + action]({}, keys);
}
return this;
},
/**
* resets the library back to its initial state. this is useful
* if you want to clear out the current keyboard shortcuts and bind
* new ones - for example if you switch to another page
*
* @returns void
*/
reset: function() {
_callbacks = {};
_directMap = {};
return this;
},
/**
* should we stop this event before firing off callbacks
*
* @param {Event} e
* @param {Element} element
* @return {boolean}
*/
stopCallback: function(e, element) {
// if the element has the class "mousetrap" then no need to stop
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
return false;
}
// stop for input, select, and textarea
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
},
/**
* exposes _handleKey publicly so it can be overwritten by extensions
*/
handleKey: _handleKey
};
// expose mousetrap to the global object
window.Mousetrap = Mousetrap;
// expose mousetrap as an AMD module
if (typeof define === 'function' && define.amd) {
define(Mousetrap);
}
}) (window, document);
},{}],5:[function(require,module,exports){
(function( factory ) {
if (typeof define !== 'undefined' && define.amd) {
define([], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory();
} else {
window.scrollMonitor = factory();
}
})(function() {
var scrollTop = function() {
return window.pageYOffset ||
(document.documentElement && document.documentElement.scrollTop) ||
document.body.scrollTop;
};
var exports = {};
var watchers = [];
var VISIBILITYCHANGE = 'visibilityChange';
var ENTERVIEWPORT = 'enterViewport';
var FULLYENTERVIEWPORT = 'fullyEnterViewport';
var EXITVIEWPORT = 'exitViewport';
var PARTIALLYEXITVIEWPORT = 'partiallyExitViewport';
var LOCATIONCHANGE = 'locationChange';
var STATECHANGE = 'stateChange';
var eventTypes = [
VISIBILITYCHANGE,
ENTERVIEWPORT,
FULLYENTERVIEWPORT,
EXITVIEWPORT,
PARTIALLYEXITVIEWPORT,
LOCATIONCHANGE,
STATECHANGE
];
var defaultOffsets = {top: 0, bottom: 0};
var getViewportHeight = function() {
return window.innerHeight || document.documentElement.clientHeight;
};
var getDocumentHeight = function() {
// jQuery approach
// whichever is greatest
return Math.max(
document.body.scrollHeight, document.documentElement.scrollHeight,
document.body.offsetHeight, document.documentElement.offsetHeight,
document.documentElement.clientHeight
);
};
exports.viewportTop = null;
exports.viewportBottom = null;
exports.documentHeight = null;
exports.viewportHeight = getViewportHeight();
var previousDocumentHeight;
var latestEvent;
var calculateViewportI;
function calculateViewport() {
exports.viewportTop = scrollTop();
exports.viewportBottom = exports.viewportTop + exports.viewportHeight;
exports.documentHeight = getDocumentHeight();
if (exports.documentHeight !== previousDocumentHeight) {
calculateViewportI = watchers.length;
while( calculateViewportI-- ) {
watchers[calculateViewportI].recalculateLocation();
}
previousDocumentHeight = exports.documentHeight;
}
}
function recalculateWatchLocationsAndTrigger() {
exports.viewportHeight = getViewportHeight();
calculateViewport();
updateAndTriggerWatchers();
}
var recalculateAndTriggerTimer;
function debouncedRecalcuateAndTrigger() {
clearTimeout(recalculateAndTriggerTimer);
recalculateAndTriggerTimer = setTimeout( recalculateWatchLocationsAndTrigger, 100 );
}
var updateAndTriggerWatchersI;
function updateAndTriggerWatchers() {
// update all watchers then trigger the events so one can rely on another being up to date.
updateAndTriggerWatchersI = watchers.length;
while( updateAndTriggerWatchersI-- ) {
watchers[updateAndTriggerWatchersI].update();
}
updateAndTriggerWatchersI = watchers.length;
while( updateAndTriggerWatchersI-- ) {
watchers[updateAndTriggerWatchersI].triggerCallbacks();
}
}
function ElementWatcher( watchItem, offsets ) {
var self = this;
this.watchItem = watchItem;
if (!offsets) {
this.offsets = defaultOffsets;
} else if (offsets === +offsets) {
this.offsets = {top: offsets, bottom: offsets};
} else {
this.offsets = {
top: offsets.top || defaultOffsets.top,
bottom: offsets.bottom || defaultOffsets.bottom
};
}
this.callbacks = {}; // {callback: function, isOne: true }
for (var i = 0, j = eventTypes.length; i < j; i++) {
self.callbacks[eventTypes[i]] = [];
}
this.locked = false;
var wasInViewport;
var wasFullyInViewport;
var wasAboveViewport;
var wasBelowViewport;
var listenerToTriggerListI;
var listener;
function triggerCallbackArray( listeners ) {
if (listeners.length === 0) {
return;
}
listenerToTriggerListI = listeners.length;
while( listenerToTriggerListI-- ) {
listener = listeners[listenerToTriggerListI];
listener.callback.call( self, latestEvent );
if (listener.isOne) {
listeners.splice(listenerToTriggerListI, 1);
}
}
}
this.triggerCallbacks = function triggerCallbacks() {
if (this.isInViewport && !wasInViewport) {
triggerCallbackArray( this.callbacks[ENTERVIEWPORT] );
}
if (this.isFullyInViewport && !wasFullyInViewport) {
triggerCallbackArray( this.callbacks[FULLYENTERVIEWPORT] );
}
if (this.isAboveViewport !== wasAboveViewport &&
this.isBelowViewport !== wasBelowViewport) {
triggerCallbackArray( this.callbacks[VISIBILITYCHANGE] );
// if you skip completely past this element
if (!wasFullyInViewport && !this.isFullyInViewport) {
triggerCallbackArray( this.callbacks[FULLYENTERVIEWPORT] );
triggerCallbackArray( this.callbacks[PARTIALLYEXITVIEWPORT] );
}
if (!wasInViewport && !this.isInViewport) {
triggerCallbackArray( this.callbacks[ENTERVIEWPORT] );
triggerCallbackArray( this.callbacks[EXITVIEWPORT] );
}
}
if (!this.isFullyInViewport && wasFullyInViewport) {
triggerCallbackArray( this.callbacks[PARTIALLYEXITVIEWPORT] );
}
if (!this.isInViewport && wasInViewport) {
triggerCallbackArray( this.callbacks[EXITVIEWPORT] );
}
if (this.isInViewport !== wasInViewport) {
triggerCallbackArray( this.callbacks[VISIBILITYCHANGE] );
}
switch( true ) {
case wasInViewport !== this.isInViewport:
case wasFullyInViewport !== this.isFullyInViewport:
case wasAboveViewport !== this.isAboveViewport:
case wasBelowViewport !== this.isBelowViewport:
triggerCallbackArray( this.callbacks[STATECHANGE] );
}
wasInViewport = this.isInViewport;
wasFullyInViewport = this.isFullyInViewport;
wasAboveViewport = this.isAboveViewport;
wasBelowViewport = this.isBelowViewport;
};
this.recalculateLocation = function() {
if (this.locked) {
return;
}
var previousTop = this.top;
var previousBottom = this.bottom;
if (this.watchItem.nodeName) { // a dom element
var cachedDisplay = this.watchItem.style.display;
if (cachedDisplay === 'none') {
this.watchItem.style.display = '';
}
var boundingRect = this.watchItem.getBoundingClientRect();
this.top = boundingRect.top + exports.viewportTop;
this.bottom = boundingRect.bottom + exports.viewportTop;
if (cachedDisplay === 'none') {
this.watchItem.style.display = cachedDisplay;
}
} else if (this.watchItem === +this.watchItem) { // number
if (this.watchItem > 0) {
this.top = this.bottom = this.watchItem;
} else {
this.top = this.bottom = exports.documentHeight - this.watchItem;
}
} else { // an object with a top and bottom property
this.top = this.watchItem.top;
this.bottom = this.watchItem.bottom;
}
this.top -= this.offsets.top;
this.bottom += this.offsets.bottom;
this.height = this.bottom - this.top;
if ( (previousTop !== undefined || previousBottom !== undefined) && (this.top !== previousTop || this.bottom !== previousBottom) ) {
triggerCallbackArray( this.callbacks[LOCATIONCHANGE] );
}
};
this.recalculateLocation();
this.update();
wasInViewport = this.isInViewport;
wasFullyInViewport = this.isFullyInViewport;
wasAboveViewport = this.isAboveViewport;
wasBelowViewport = this.isBelowViewport;
}
ElementWatcher.prototype = {
on: function( event, callback, isOne ) {
// trigger the event if it applies to the element right now.
switch( true ) {
case event === VISIBILITYCHANGE && !this.isInViewport && this.isAboveViewport:
case event === ENTERVIEWPORT && this.isInViewport:
case event === FULLYENTERVIEWPORT && this.isFullyInViewport:
case event === EXITVIEWPORT && this.isAboveViewport && !this.isInViewport:
case event === PARTIALLYEXITVIEWPORT && this.isAboveViewport:
callback.call( this, latestEvent );
if (isOne) {
return;
}
}
if (this.callbacks[event]) {
this.callbacks[event].push({callback: callback, isOne: isOne||false});
} else {
throw new Error('Tried to add a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));
}
},
off: function( event, callback ) {
if (this.callbacks[event]) {
for (var i = 0, item; item = this.callbacks[event][i]; i++) {
if (item.callback === callback) {
this.callbacks[event].splice(i, 1);
break;
}
}
} else {
throw new Error('Tried to remove a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));
}
},
one: function( event, callback ) {
this.on( event, callback, true);
},
recalculateSize: function() {
this.height = this.watchItem.offsetHeight + this.offsets.top + this.offsets.bottom;
this.bottom = this.top + this.height;
},
update: function() {
this.isAboveViewport = this.top < exports.viewportTop;
this.isBelowViewport = this.bottom > exports.viewportBottom;
this.isInViewport = (this.top <= exports.viewportBottom && this.bottom >= exports.viewportTop);
this.isFullyInViewport = (this.top >= exports.viewportTop && this.bottom <= exports.viewportBottom) ||
(this.isAboveViewport && this.isBelowViewport);
},
destroy: function() {
var index = watchers.indexOf(this),
self = this;
watchers.splice(index, 1);
for (var i = 0, j = eventTypes.length; i < j; i++) {
self.callbacks[eventTypes[i]].length = 0;
}
},
// prevent recalculating the element location
lock: function() {
this.locked = true;
},
unlock: function() {
this.locked = false;
}
};
var eventHandlerFactory = function (type) {
return function( callback, isOne ) {
this.on.call(this, type, callback, isOne);
};
};
for (var i = 0, j = eventTypes.length; i < j; i++) {
var type = eventTypes[i];
ElementWatcher.prototype[type] = eventHandlerFactory(type);
}
try {
calculateViewport();
} catch (e) {
try {
window.$(calculateViewport);
} catch (e) {
throw new Error('If you must put scrollMonitor in the <head>, you must use jQuery.');
}
}
function scrollMonitorListener(event) {
latestEvent = event;
calculateViewport();
updateAndTriggerWatchers();
}
if (window.addEventListener) {
window.addEventListener('scroll', scrollMonitorListener);
window.addEventListener('resize', debouncedRecalcuateAndTrigger);
} else {
// Old IE support
window.attachEvent('onscroll', scrollMonitorListener);
window.attachEvent('onresize', debouncedRecalcuateAndTrigger);
}
exports.beget = exports.create = function( element, offsets ) {
if (typeof element === 'string') {
element = document.querySelector(element);
} else if (element && element.length > 0) {
element = element[0];
}
var watcher = new ElementWatcher( element, offsets );
watchers.push(watcher);
watcher.update();
return watcher;
};
exports.update = function() {
latestEvent = null;
calculateViewport();
updateAndTriggerWatchers();
};
exports.recalculateLocations = function() {
exports.documentHeight = 0;
exports.update();
};
return exports;
});
},{}],6:[function(require,module,exports){
module.exports={
"name": "clappr",
"version": "0.0.77",
"description": "An extensible media player for the web",
"main": "dist/clappr.min.js",
"scripts": {
"test": "./node_modules/.bin/gulp release && ./node_modules/.bin/karma start --single-run --browsers Firefox"
},
"repository": {
"type": "git",
"url": "[email protected]:globocom/clappr.git"
},
"author": "Globo.com",
"license": "BSD",
"bugs": {
"url": "https://github.com/globocom/clappr/issues"
},
"browser": {
"zepto": "clappr-zepto"
},
"homepage": "https://github.com/globocom/clappr",
"devDependencies": {
"browserify": "^8.0.3",
"chai": "1.10.0",
"compass-mixins": "0.12.3",
"dotenv": "^0.4.0",
"es6ify": "~1.4.0",
"exorcist": "^0.1.6",
"express": "^4.6.1",
"express-alias": "0.4.0",
"glob": "^4.0.2",
"gulp": "^3.8.1",
"clappr-zepto": "0.0.3",
"gulp-compressor": "^0.1.0",
"gulp-jshint": "1.9.0",
"gulp-livereload": "^2.1.0",
"gulp-minify-css": "~0.3.5",
"gulp-rename": "^1.2.0",
"gulp-sass": "1.0.0",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^1.0.1",
"gulp-util": "3.0.1",
"karma": "^0.12.17",
"karma-browserify": "^1.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^0.1.4",
"karma-cli": "0.0.4",
"karma-firefox-launcher": "^0.1.3",
"karma-jasmine": "^0.2.2",
"karma-jquery": "^0.1.0",
"karma-mocha": "^0.1.4",
"karma-safari-launcher": "^0.1.1",
"karma-sinon": "^1.0.3",
"karma-sinon-chai": "^0.2.0",
"mkdirp": "^0.5.0",
"s3": "^4.1.1",
"scp": "0.0.3",
"sinon": "^1.10.2",
"traceur": "0.0.72",
"vinyl-source-stream": "^1.0.0",
"vinyl-transform": "0.0.1",
"watchify": "^2.0.0",
"yargs": "1.3.3"
},
"dependencies": {
"underscore": "1.7.0",
"mousetrap": "^1.4.6",
"scrollmonitor": "^1.0.8"
}
}
},{}],7:[function(require,module,exports){
"use strict";
var _ = require('underscore');
module.exports = {
'media_control': _.template('<div class="media-control-background" data-background></div><div class="media-control-layer" data-controls><% var renderBar=function(name) { %><div class="bar-container" data-<%= name %>><div class="bar-background" data-<%= name %>><div class="bar-fill-1" data-<%= name %>></div><div class="bar-fill-2" data-<%= name %>></div><div class="bar-hover" data-<%= name %>></div></div><div class="bar-scrubber" data-<%= name %>><div class="bar-scrubber-icon" data-<%= name %>></div></div></div><% }; %><% var renderSegmentedBar=function(name, segments) { segments=segments || 10; %><div class="bar-container" data-<%= name %>><% for (var i = 0; i < segments; i++) { %><div class="segmented-bar-element" data-<%= name %>></div><% } %></div><% }; %><% var renderDrawer=function(name, renderContent) { %><div class="drawer-container" data-<%= name %>><div class="drawer-icon-container" data-<%= name %>><div class="drawer-icon media-control-icon" data-<%= name %>></div><span class="drawer-text" data-<%= name %>></span></div><% renderContent(name); %></div><% }; %><% var renderIndicator=function(name) { %><div class="media-control-indicator" data-<%= name %>></div><% }; %><% var renderButton=function(name) { %><button class="media-control-button media-control-icon" data-<%= name %>></button><% }; %><% var templates={ bar: renderBar, segmentedBar: renderSegmentedBar, }; var render=function(settingsList) { _.each(settingsList, function(setting) { if(setting === "seekbar") { renderBar(setting); } else if (setting === "volume") { renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); }); } else if (setting === "duration" || setting=== "position") { renderIndicator(setting); } else { renderButton(setting); } }); }; %><% if (settings.default && settings.default.length) { %><div class="media-control-center-panel" data-media-control><% render(settings.default); %></div><% } %><% if (settings.left && settings.left.length) { %><div class="media-control-left-panel" data-media-control><% render(settings.left); %></div><% } %><% if (settings.right && settings.right.length) { %><div class="media-control-right-panel" data-media-control><% render(settings.right); %></div><% } %></div>'),
'seek_time': _.template('<span data-seek-time></span>'),
'flash': _.template('<param name="movie" value="<%= swfPath %>"><param name="quality" value="autohigh"><param name="swliveconnect" value="true"><param name="allowScriptAccess" value="always"><param name="bgcolor" value="#001122"><param name="allowFullScreen" value="false"><param name="wmode" value="transparent"><param name="tabindex" value="1"><param name=FlashVars value="playbackId=<%= playbackId %>" /><embed type="application/x-shockwave-flash" disabled tabindex="-1" enablecontextmenu="false" allowScriptAccess="always" quality="autohight" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"></embed>'),
'hls': _.template('<param name="movie" value="<%= swfPath %>?inline=1"><param name="quality" value="autohigh"><param name="swliveconnect" value="true"><param name="allowScriptAccess" value="always"><param name="bgcolor" value="#001122"><param name="allowFullScreen" value="false"><param name="wmode" value="transparent"><param name="tabindex" value="1"><param name=FlashVars value="playbackId=<%= playbackId %>" /><embed type="application/x-shockwave-flash" tabindex="1" enablecontextmenu="false" allowScriptAccess="always" quality="autohigh" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"></embed>'),
'html5_video': _.template('<source src="<%=src%>" type="<%=type%>">'),
'no_op': _.template('<p data-no-op-msg>Something went wrong :(</p>'),
'background_button': _.template('<div class="background-button-wrapper" data-background-button><button class="background-button-icon" data-background-button></button></div>'),
'dvr_controls': _.template('<div class="live-info">LIVE</div><button class="live-button">BACK TO LIVE</button>'),
'poster': _.template('<div class="play-wrapper" data-poster><span class="poster-icon play" data-poster/></div>'),
'spinner_three_bounce': _.template('<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>'),
'watermark': _.template('<div data-watermark data-watermark-<%=position %>><img src="<%= imageUrl %>"></div>'),
CSS: {
'container': '.container[data-container]{position:absolute;background-color:#000;height:100%;width:100%}.container[data-container].pointer-enabled{cursor:pointer}',
'core': '[data-player]{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;margin:0;padding:0;border:0;height:594px;width:1055px;font-style:normal;font-weight:400;text-align:center;overflow:hidden;font-size:100%;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] a,[data-player] abbr,[data-player] acronym,[data-player] address,[data-player] applet,[data-player] article,[data-player] aside,[data-player] audio,[data-player] b,[data-player] big,[data-player] blockquote,[data-player] canvas,[data-player] caption,[data-player] center,[data-player] cite,[data-player] code,[data-player] dd,[data-player] del,[data-player] details,[data-player] dfn,[data-player] div,[data-player] dl,[data-player] dt,[data-player] em,[data-player] embed,[data-player] fieldset,[data-player] figcaption,[data-player] figure,[data-player] footer,[data-player] form,[data-player] h1,[data-player] h2,[data-player] h3,[data-player] h4,[data-player] h5,[data-player] h6,[data-player] header,[data-player] hgroup,[data-player] i,[data-player] iframe,[data-player] img,[data-player] ins,[data-player] kbd,[data-player] label,[data-player] legend,[data-player] li,[data-player] mark,[data-player] menu,[data-player] nav,[data-player] object,[data-player] ol,[data-player] output,[data-player] p,[data-player] pre,[data-player] q,[data-player] ruby,[data-player] s,[data-player] samp,[data-player] section,[data-player] small,[data-player] span,[data-player] strike,[data-player] strong,[data-player] sub,[data-player] summary,[data-player] sup,[data-player] table,[data-player] tbody,[data-player] td,[data-player] tfoot,[data-player] th,[data-player] thead,[data-player] time,[data-player] tr,[data-player] tt,[data-player] u,[data-player] ul,[data-player] var,[data-player] video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] table{border-collapse:collapse;border-spacing:0}[data-player] caption,[data-player] td,[data-player] th{text-align:left;font-weight:400;vertical-align:middle}[data-player] blockquote,[data-player] q{quotes:none}[data-player] blockquote:after,[data-player] blockquote:before,[data-player] q:after,[data-player] q:before{content:"";content:none}[data-player] a img{border:none}[data-player] *{max-width:initial;box-sizing:inherit;float:initial}[data-player].fullscreen{width:100%;height:100%}[data-player].nocursor{cursor:none}[data-player] .clappr-style{display:none!important}@media screen{[data-player]{opacity:.99}}',
'media_control': '@font-face{font-family:Player;src:url(http://cdn.clappr.io/latest/assets/Player-Regular.eot);src:url(http://cdn.clappr.io/latest/assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(http://cdn.clappr.io/latest/assets/Player-Regular.ttf) format("truetype"),url(http://cdn.clappr.io/latest/assets/Player-Regular.svg#player) format("svg")}.media-control-notransition{-webkit-transition:none!important;-webkit-transition-delay:0s;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.media-control[data-media-control]{position:absolute;width:100%;height:100%;z-index:9999;pointer-events:none}.media-control[data-media-control].dragging{pointer-events:auto;cursor:-webkit-grabbing!important;cursor:grabbing!important}.media-control[data-media-control].dragging *{cursor:-webkit-grabbing!important;cursor:grabbing!important}.media-control[data-media-control] .media-control-background[data-background]{position:absolute;height:40%;width:100%;bottom:0;background-image:-owg(linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.9)));background-image:-webkit(linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.9)));background-image:-moz(linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.9)));background-image:-o(linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.9)));background-image:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.9));-webkit-transition:opacity .6s;-webkit-transition-delay:ease-out;-moz-transition:opacity .6s ease-out;-o-transition:opacity .6s ease-out;transition:opacity .6s ease-out}.media-control[data-media-control] .media-control-icon{font-family:Player;font-weight:400;font-style:normal;font-size:26px;line-height:32px;letter-spacing:0;speak:none;color:#fff;opacity:.5;vertical-align:middle;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transition:all .1s;-webkit-transition-delay:ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;transition:all .1s ease}.media-control[data-media-control] .media-control-icon:hover{color:#fff;opacity:.75;text-shadow:rgba(255,255,255,.8) 0 0 5px}.media-control[data-media-control].media-control-hide .media-control-background[data-background]{opacity:0}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls]{bottom:-50px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:absolute;bottom:7px;width:100%;height:32px;vertical-align:middle;pointer-events:auto;-webkit-transition:bottom .4s;-webkit-transition-delay:ease-out;-moz-transition:bottom .4s ease-out;-o-transition:bottom .4s ease-out;transition:bottom .4s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:4px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 6px;padding:0;cursor:pointer;display:inline-block}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]{float:left;height:100%;font-size:20px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]{float:left;height:100%;font-size:20px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;height:100%;font-size:20px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]:before{content:"\\e006"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen].shrink:before{content:"\\e007"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{cursor:default;float:right;background-color:transparent;border:0;height:100%;opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]:before{content:"\\e008"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover{opacity:1;text-shadow:none}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]{float:left;height:100%;font-size:20px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].playing:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].paused:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left;height:100%;font-size:20px}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].playing:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].stopped:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:10px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{margin-left:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]{color:rgba(255,255,255,.5);margin-right:6px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"|";margin:0 3px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:25px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:1px;position:relative;top:12px;background-color:#666}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#c2c2c2;-webkit-transition:all .1s;-webkit-transition-delay:ease-out;-moz-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#005aff;-webkit-transition:all .1s;-webkit-transition-delay:ease-out;-moz-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0;position:absolute;top:-3px;width:5px;height:7px;background-color:rgba(255,255,255,.5);-webkit-transition:opacity .1s;-webkit-transition-delay:ease;-moz-transition:opacity .1s ease;-o-transition:opacity .1s ease;transition:opacity .1s ease}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled{cursor:default}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;top:2px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s;-webkit-transition-delay:ease-out;-moz-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:10px;box-shadow:0 0 0 6px rgba(255,255,255,.2);background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;height:32px;cursor:pointer;margin:0 6px;box-sizing:border-box}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{float:left;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;box-sizing:content-box;width:16px;height:32px;margin-right:6px;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:before{content:"\\e004"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted{opacity:.5}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted:hover{opacity:.7}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted:before{content:"\\e005"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{float:left;position:relative;top:6px;width:42px;height:18px;padding:3px 0;overflow:hidden;-webkit-transition:width .2s;-webkit-transition-delay:ease-out;-moz-transition:width .2s ease-out;-o-transition:width .2s ease-out;transition:width .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]{float:left;width:4px;padding-left:2px;height:12px;opacity:.5;-webkit-box-shadow:inset 2px 0 0 #fff;-moz-box-shadow:inset 2px 0 0 #fff;-ms-box-shadow:inset 2px 0 0 #fff;-o-box-shadow:inset 2px 0 0 #fff;box-shadow:inset 2px 0 0 #fff;-webkit-transition:-webkit-transform .2s;-webkit-transition-delay:ease-out;-moz-transition:-moz-transform .2s ease-out;-o-transition:-o-transform .2s ease-out;transition:transform .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill{-webkit-box-shadow:inset 2px 0 0 #fff;-moz-box-shadow:inset 2px 0 0 #fff;-ms-box-shadow:inset 2px 0 0 #fff;-o-box-shadow:inset 2px 0 0 #fff;box-shadow:inset 2px 0 0 #fff;opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1){padding-left:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover{-webkit-transform:scaleY(1.5);-moz-transform:scaleY(1.5);-ms-transform:scaleY(1.5);-o-transform:scaleY(1.5);transform:scaleY(1.5)}.media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{height:12px;top:9px;padding:0;width:0}',
'seek_time': '.seek-time[data-seek-time]{position:absolute;width:auto;height:20px;line-height:20px;bottom:55px;background-color:rgba(2,2,2,.5);z-index:9999;-webkit-transition:opacity .1s;-webkit-transition-delay:ease;-moz-transition:opacity .1s ease;-o-transition:opacity .1s ease;transition:opacity .1s ease}.seek-time[data-seek-time].hidden[data-seek-time]{opacity:0}.seek-time[data-seek-time] span[data-seek-time]{position:relative;color:#fff;font-size:10px;padding-left:7px;padding-right:7px}',
'flash': '[data-flash]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none}',
'hls': '[data-hls]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none;top:0}',
'html5_video': '[data-html5-video]{position:absolute;height:100%;width:100%;display:block}',
'html_img': '[data-html-img]{max-width:100%;max-height:100%}',
'no_op': '[data-no-op]{z-index:1000;position:absolute;background-color:#222;height:100%;width:100%}[data-no-op] p[data-no-op-msg]{position:relative;font-size:25px;top:50%;color:#fff}',
'background_button': '.background-button[data-background-button]{font-family:Player;position:absolute;height:100%;width:100%;background-color:rgba(0,0,0,.2);pointer-events:none;-webkit-transition:all .4s;-webkit-transition-delay:ease-out;-moz-transition:all .4s ease-out;-o-transition:all .4s ease-out;transition:all .4s ease-out}.background-button[data-background-button].hide{background-color:transparent}.background-button[data-background-button].hide .background-button-wrapper[data-background-button]{opacity:0}.background-button[data-background-button] .background-button-wrapper[data-background-button]{position:absolute;overflow:hidden;width:100%;height:25%;line-height:100%;font-size:25%;top:50%;text-align:center}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button]{cursor:pointer;pointer-events:auto;font-family:Player;font-weight:400;font-style:normal;line-height:1;letter-spacing:0;speak:none;color:#fff;opacity:.75;border:0;outline:0;background-color:transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transition:all .1s;-webkit-transition-delay:ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;transition:all .1s ease}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button]:hover{opacity:1;text-shadow:rgba(255,255,255,.8) 0 0 15px}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button].playing:before{content:"\\e002"}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button].notplaying:before{content:"\\e001"}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button].playstop.playing:before{content:"\\e003"}.background-button[data-background-button] .background-button-wrapper[data-background-button] .background-button-icon[data-background-button].playstop.notplaying:before{content:"\\e001"}.media-control.media-control-hide[data-media-control] .background-button[data-background-button]{opacity:0}',
'dvr_controls': '@import url(http://fonts.googleapis.com/css?family=Roboto);.dvr-controls[data-dvr-controls]{display:inline-block;float:left;color:#fff;line-height:32px;font-size:10px;font-weight:700;margin-left:6px}.dvr-controls[data-dvr-controls] .live-info{cursor:default;font-family:Roboto,"Open Sans",Arial,sans-serif}.dvr-controls[data-dvr-controls] .live-info:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#ff0101}.dvr-controls[data-dvr-controls] .live-info.disabled{opacity:.3}.dvr-controls[data-dvr-controls] .live-info.disabled:before{background-color:#fff}.dvr-controls[data-dvr-controls] .live-button{cursor:pointer;outline:0;display:none;border:0;color:#fff;background-color:transparent;height:32px;padding:0;opacity:.7;font-family:Roboto,"Open Sans",Arial,sans-serif;-webkit-transition:all .1s;-webkit-transition-delay:ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;transition:all .1s ease}.dvr-controls[data-dvr-controls] .live-button:before{content:"";display:inline-block;position:relative;width:7px;height:7px;border-radius:3.5px;margin-right:3.5px;background-color:#fff}.dvr-controls[data-dvr-controls] .live-button:hover{opacity:1;text-shadow:rgba(255,255,255,.75) 0 0 5px}.dvr .dvr-controls[data-dvr-controls] .live-info{display:none}.dvr .dvr-controls[data-dvr-controls] .live-button{display:block}.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#005aff}.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{background-color:#ff0101}.seek-time[data-seek-time] span[data-duration]{position:relative;color:rgba(255,255,255,.5);font-size:10px;padding-right:7px}.seek-time[data-seek-time] span[data-duration]:before{content:"|";margin-right:7px}',
'poster': '@font-face{font-family:Player;src:url(http://cdn.clappr.io/latest/assets/Player-Regular.eot);src:url(http://cdn.clappr.io/latest/assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(http://cdn.clappr.io/latest/assets/Player-Regular.ttf) format("truetype"),url(http://cdn.clappr.io/latest/assets/Player-Regular.svg#player) format("svg")}.player-poster[data-poster]{cursor:pointer;position:absolute;height:100%;width:100%;z-index:998;top:0}.player-poster[data-poster] .poster-background[data-poster]{width:100%;height:100%}.player-poster[data-poster] .play-wrapper[data-poster]{position:absolute;width:100%;height:25%;line-height:100%;font-size:25%;top:50%;text-align:center}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]{font-family:Player;font-weight:400;font-style:normal;line-height:1;letter-spacing:0;speak:none;color:#fff;opacity:.75;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transition:opacity text-shadow;-webkit-transition-delay:.1s;-moz-transition:opacity text-shadow .1s;-o-transition:opacity text-shadow .1s;transition:opacity text-shadow .1s ease}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster].play[data-poster]:before{content:"\\e001"}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]:hover{opacity:1;text-shadow:rgba(255,255,255,.8) 0 0 15px}',
'spinner_three_bounce': '.spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:999;top:47%;left:0;right:0}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#FFF;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;-moz-animation:bouncedelay 1.4s infinite ease-in-out;-ms-animation:bouncedelay 1.4s infinite ease-in-out;-o-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1],.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.32s;-moz-animation-delay:-.32s;-ms-animation-delay:-.32s;-o-animation-delay:-.32s;animation-delay:-.32s}@-moz-keyframes bouncedelay{0%,100%,80%{-moz-transform:scale(0);transform:scale(0)}40%{-moz-transform:scale(1);transform:scale(1)}}@-webkit-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@-o-keyframes bouncedelay{0%,100%,80%{-o-transform:scale(0);transform:scale(0)}40%{-o-transform:scale(1);transform:scale(1)}}@-ms-keyframes bouncedelay{0%,100%,80%{-ms-transform:scale(0);transform:scale(0)}40%{-ms-transform:scale(1);transform:scale(1)}}@keyframes bouncedelay{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}',
'watermark': '[data-watermark]{position:absolute;margin:100px auto 0;width:70px;text-align:center;z-index:10}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:-95px;left:10px}[data-watermark-top-right]{top:-95px;right:37px}'
}
};
},{"underscore":"underscore"}],8:[function(require,module,exports){
"use strict";
var $ = require('zepto');
var _ = require('underscore');
var JST = require('./jst');
var Styler = {getStyleFor: function(name, options) {
options = options || {};
return $('<style class="clappr-style"></style>').html(_.template(JST.CSS[name])(options))[0];
}};
module.exports = Styler;
},{"./jst":7,"underscore":"underscore","zepto":"zepto"}],9:[function(require,module,exports){
"use strict";
var _ = require('underscore');
var Browser = require('browser');
var extend = function(protoProps, staticProps) {
var parent = this;
var child;
if (protoProps && _.has(protoProps, 'constructor')) {
child = protoProps.constructor;
} else {
child = function() {
return parent.apply(this, arguments);
};
}
_.extend(child, parent, staticProps);
var Surrogate = function() {
this.constructor = child;
};
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate();
if (protoProps)
_.extend(child.prototype, protoProps);
child.__super__ = parent.prototype;
child.super = function(name) {
return parent.prototype[name];
};
child.prototype.getClass = function() {
return child;
};
return child;
};
var formatTime = function(time) {
time = time * 1000;
time = parseInt(time / 1000);
var seconds = time % 60;
time = parseInt(time / 60);
var minutes = time % 60;
time = parseInt(time / 60);
var hours = time % 24;
var out = "";
if (hours && hours > 0)
out += ("0" + hours).slice(-2) + ":";
out += ("0" + minutes).slice(-2) + ":";
out += ("0" + seconds).slice(-2);
return out.trim();
};
var Fullscreen = {
isFullscreen: function() {
return document.webkitIsFullScreen || document.mozFullScreen || !!document.msFullscreenElement || window.iframeFullScreen;
},
requestFullscreen: function(el) {
if (el.requestFullscreen) {
el.requestFullscreen();
} else if (el.webkitRequestFullscreen) {
el.webkitRequestFullscreen();
} else if (el.mozRequestFullScreen) {
el.mozRequestFullScreen();
} else if (el.msRequestFullscreen) {
el.msRequestFullscreen();
}
},
cancelFullscreen: function() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
};
var Config = function Config() {};
($traceurRuntime.createClass)(Config, {}, {
_defaultConfig: function() {
return {volume: {
value: 100,
parse: parseInt
}};
},
_defaultValueFor: function(key) {
try {
return this._defaultConfig()[key]['parse'](this._defaultConfig()[key]['value']);
} catch (e) {
return undefined;
}
},
_create_keyspace: function(key) {
return 'clappr.' + document.domain + '.' + key;
},
restore: function(key) {
if (Browser.hasLocalstorage && localStorage[this._create_keyspace(key)]) {
return this._defaultConfig()[key]['parse'](localStorage[this._create_keyspace(key)]);
}
return this._defaultValueFor(key);
},
persist: function(key, value) {
if (Browser.hasLocalstorage) {
try {
localStorage[this._create_keyspace(key)] = value;
return true;
} catch (e) {
return false;
}
}
}
});
var seekStringToSeconds = function(url) {
var elements = _.rest(_.compact(url.match(/t=([0-9]*)h?([0-9]*)m?([0-9]*)s/))).reverse();
var seconds = 0;
var factor = 1;
_.each(elements, function(el) {
seconds += (parseInt(el) * factor);
factor = factor * 60;
}, this);
return seconds;
};
module.exports = {
extend: extend,
formatTime: formatTime,
Fullscreen: Fullscreen,
Config: Config,
seekStringToSeconds: seekStringToSeconds
};
},{"browser":"browser","underscore":"underscore"}],10:[function(require,module,exports){
"use strict";
var UIObject = require('ui_object');
var Styler = require('../../base/styler');
var _ = require('underscore');
var Events = require('events');
var Container = function Container(options) {
$traceurRuntime.superCall(this, $Container.prototype, "constructor", [options]);
this.playback = options.playback;
this.settings = this.playback.settings;
this.isReady = false;
this.mediaControlDisabled = false;
this.plugins = [this.playback];
this.bindEvents();
};
var $Container = Container;
($traceurRuntime.createClass)(Container, {
get name() {
return 'Container';
},
get attributes() {
return {
class: 'container',
'data-container': ''
};
},
get events() {
return {'click': 'clicked'};
},
bindEvents: function() {
this.listenTo(this.playback, Events.PLAYBACK_PROGRESS, this.progress);
this.listenTo(this.playback, Events.PLAYBACK_TIMEUPDATE, this.timeUpdated);
this.listenTo(this.playback, Events.PLAYBACK_READY, this.ready);
this.listenTo(this.playback, Events.PLAYBACK_BUFFERING, this.buffering);
this.listenTo(this.playback, Events.PLAYBACK_BUFFERFULL, this.bufferfull);
this.listenTo(this.playback, Events.PLAYBACK_SETTINGSUPDATE, this.settingsUpdate);
this.listenTo(this.playback, Events.PLAYBACK_LOADEDMETADATA, this.loadedMetadata);
this.listenTo(this.playback, Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
this.listenTo(this.playback, Events.PLAYBACK_BITRATE, this.updateBitrate);
this.listenTo(this.playback, Events.PLAYBACK_PLAYBACKSTATE, this.playbackStateChanged);
this.listenTo(this.playback, Events.PLAYBACK_DVR, this.playbackDvrStateChanged);
this.listenTo(this.playback, Events.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl);
this.listenTo(this.playback, Events.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl);
this.listenTo(this.playback, Events.PLAYBACK_ENDED, this.ended);
this.listenTo(this.playback, Events.PLAYBACK_PLAY, this.playing);
this.listenTo(this.playback, Events.PLAYBACK_ERROR, this.error);
},
with: function(klass) {
_.extend(this, klass);
return this;
},
playbackStateChanged: function() {
this.trigger(Events.CONTAINER_PLAYBACKSTATE);
},
playbackDvrStateChanged: function(dvrInUse) {
this.settings = this.playback.settings;
this.dvrInUse = dvrInUse;
this.trigger(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, dvrInUse);
},
updateBitrate: function(newBitrate) {
this.trigger(Events.CONTAINER_BITRATE, newBitrate);
},
statsReport: function(metrics) {
this.trigger(Events.CONTAINER_STATS_REPORT, metrics);
},
getPlaybackType: function() {
return this.playback.getPlaybackType();
},
isDvrEnabled: function() {
return !!this.playback.dvrEnabled;
},
isDvrInUse: function() {
return !!this.dvrInUse;
},
destroy: function() {
this.trigger(Events.CONTAINER_DESTROYED, this, this.name);
this.playback.destroy();
_(this.plugins).each((function(plugin) {
return plugin.destroy();
}));
this.$el.remove();
},
setStyle: function(style) {
this.$el.css(style);
},
animate: function(style, duration) {
return this.$el.animate(style, duration).promise();
},
ready: function() {
this.isReady = true;
this.trigger(Events.CONTAINER_READY, this.name);
},
isPlaying: function() {
return this.playback.isPlaying();
},
getDuration: function() {
return this.playback.getDuration();
},
error: function(errorObj) {
this.$el.append(errorObj.render().el);
this.trigger(Events.CONTAINER_ERROR, {
error: errorObj,
container: this
}, this.name);
},
loadedMetadata: function(duration) {
this.trigger(Events.CONTAINER_LOADEDMETADATA, duration);
},
timeUpdated: function(position, duration) {
this.trigger(Events.CONTAINER_TIMEUPDATE, position, duration, this.name);
},
progress: function(startPosition, endPosition, duration) {
this.trigger(Events.CONTAINER_PROGRESS, startPosition, endPosition, duration, this.name);
},
playing: function() {
this.trigger(Events.CONTAINER_PLAY, this.name);
},
play: function() {
this.playback.play();
},
stop: function() {
this.trigger(Events.CONTAINER_STOP, this.name);
this.playback.stop();
},
pause: function() {
this.trigger(Events.CONTAINER_PAUSE, this.name);
this.playback.pause();
},
ended: function() {
this.trigger(Events.CONTAINER_ENDED, this, this.name);
},
clicked: function() {
this.trigger(Events.CONTAINER_CLICK, this, this.name);
},
setCurrentTime: function(time) {
this.trigger(Events.CONTAINER_SEEK, time, this.name);
this.playback.seek(time);
},
setVolume: function(value) {
this.trigger(Events.CONTAINER_VOLUME, value, this.name);
this.playback.volume(value);
},
fullscreen: function() {
this.trigger(Events.CONTAINER_FULLSCREEN, this.name);
},
buffering: function() {
this.trigger(Events.CONTAINER_STATE_BUFFERING, this.name);
},
bufferfull: function() {
this.trigger(Events.CONTAINER_STATE_BUFFERFULL, this.name);
},
addPlugin: function(plugin) {
this.plugins.push(plugin);
},
hasPlugin: function(name) {
return !!this.getPlugin(name);
},
getPlugin: function(name) {
return _(this.plugins).find(function(plugin) {
return plugin.name === name;
});
},
settingsUpdate: function() {
this.settings = this.playback.settings;
this.trigger(Events.CONTAINER_SETTINGSUPDATE);
},
highDefinitionUpdate: function() {
this.trigger(Events.CONTAINER_HIGHDEFINITIONUPDATE);
},
isHighDefinitionInUse: function() {
return this.playback.isHighDefinitionInUse();
},
disableMediaControl: function() {
this.mediaControlDisabled = true;
this.trigger(Events.CONTAINER_MEDIACONTROL_DISABLE);
},
enableMediaControl: function() {
this.mediaControlDisabled = false;
this.trigger(Events.CONTAINER_MEDIACONTROL_ENABLE);
},
render: function() {
var style = Styler.getStyleFor('container');
this.$el.append(style);
this.$el.append(this.playback.render().el);
return this;
}
}, {}, UIObject);
module.exports = Container;
},{"../../base/styler":8,"events":"events","ui_object":"ui_object","underscore":"underscore"}],11:[function(require,module,exports){
"use strict";
var _ = require('underscore');
var BaseObject = require('base_object');
var Container = require('container');
var $ = require('zepto');
var Events = require('events');
var ContainerFactory = function ContainerFactory(options, loader) {
$traceurRuntime.superCall(this, $ContainerFactory.prototype, "constructor", [options]);
this.options = options;
this.loader = loader;
};
var $ContainerFactory = ContainerFactory;
($traceurRuntime.createClass)(ContainerFactory, {
createContainers: function() {
var $__0 = this;
return $.Deferred((function(promise) {
promise.resolve(_.map($__0.options.sources, (function(source) {
return $__0.createContainer(source);
}), $__0));
}));
},
findPlaybackPlugin: function(source) {
return _.find(this.loader.playbackPlugins, (function(p) {
return p.canPlay(source.toString());
}), this);
},
createContainer: function(source) {
var playbackPlugin = this.findPlaybackPlugin(source);
var options = _.extend({}, this.options, {
src: source,
autoPlay: !!this.options.autoPlay
});
var playback = new playbackPlugin(options);
var container = new Container({playback: playback});
var defer = $.Deferred();
defer.promise(container);
this.addContainerPlugins(container, source);
this.listenToOnce(container, Events.CONTAINER_READY, (function() {
return defer.resolve(container);
}));
return container;
},
addContainerPlugins: function(container, source) {
_.each(this.loader.containerPlugins, function(Plugin) {
var options = _.extend(this.options, {
container: container,
src: source
});
container.addPlugin(new Plugin(options));
}, this);
}
}, {}, BaseObject);
module.exports = ContainerFactory;
},{"base_object":"base_object","container":"container","events":"events","underscore":"underscore","zepto":"zepto"}],12:[function(require,module,exports){
"use strict";
module.exports = require('./container_factory');
},{"./container_factory":11}],13:[function(require,module,exports){
"use strict";
var _ = require('underscore');
var $ = require('zepto');
var UIObject = require('ui_object');
var ContainerFactory = require('../container_factory');
var Fullscreen = require('../../base/utils').Fullscreen;
var Styler = require('../../base/styler');
var MediaControl = require('media_control');
var PlayerInfo = require('player_info');
var Mediator = require('mediator');
var Events = require('events');
var Core = function Core(options) {
var $__0 = this;
$traceurRuntime.superCall(this, $Core.prototype, "constructor", [options]);
PlayerInfo.options = options;
this.options = options;
this.plugins = [];
this.containers = [];
this.createContainers(options);
$(document).bind('fullscreenchange', (function() {
return $__0.exit();
}));
$(document).bind('MSFullscreenChange', (function() {
return $__0.exit();
}));
$(document).bind('mozfullscreenchange', (function() {
return $__0.exit();
}));
};
var $Core = Core;
($traceurRuntime.createClass)(Core, {
get events() {
return {
'webkitfullscreenchange': 'exit',
'mousemove': 'showMediaControl',
'mouseleave': 'hideMediaControl'
};
},
get attributes() {
return {'data-player': ''};
},
createContainers: function(options) {
var $__0 = this;
this.defer = $.Deferred();
this.defer.promise(this);
this.containerFactory = new ContainerFactory(options, options.loader);
this.containerFactory.createContainers().then((function(containers) {
return $__0.setupContainers(containers);
})).then((function(containers) {
return $__0.resolveOnContainersReady(containers);
}));
},
updateSize: function() {
if (Fullscreen.isFullscreen()) {
this.setFullscreen();
} else {
this.setPlayerSize();
}
Mediator.trigger(Events.PLAYER_RESIZE);
},
setFullscreen: function() {
this.$el.addClass('fullscreen');
this.$el.removeAttr('style');
PlayerInfo.previousSize = PlayerInfo.currentSize;
PlayerInfo.currentSize = {
width: $(window).width(),
height: $(window).height()
};
},
setPlayerSize: function() {
this.$el.removeClass('fullscreen');
PlayerInfo.currentSize = PlayerInfo.previousSize;
PlayerInfo.previousSize = {
width: $(window).width(),
height: $(window).height()
};
this.resize(PlayerInfo.currentSize);
},
resize: function(options) {
var size = _.pick(options, 'width', 'height');
this.$el.css(size);
PlayerInfo.previousSize = PlayerInfo.currentSize;
PlayerInfo.currentSize = size;
Mediator.trigger(Events.PLAYER_RESIZE);
},
resolveOnContainersReady: function(containers) {
var $__0 = this;
$.when.apply($, containers).done((function() {
return $__0.defer.resolve($__0);
}));
},
addPlugin: function(plugin) {
this.plugins.push(plugin);
},
hasPlugin: function(name) {
return !!this.getPlugin(name);
},
getPlugin: function(name) {
return _(this.plugins).find((function(plugin) {
return plugin.name === name;
}));
},
load: function(sources) {
var $__0 = this;
sources = _.isArray(sources) ? sources : [sources.toString()];
_(this.containers).each((function(container) {
return container.destroy();
}));
this.containerFactory.options = _(this.options).extend({sources: sources});
this.containerFactory.createContainers().then((function(containers) {
$__0.setupContainers(containers);
}));
},
destroy: function() {
_(this.containers).each((function(container) {
return container.destroy();
}));
_(this.plugins).each((function(plugin) {
return plugin.destroy();
}));
this.$el.remove();
this.mediaControl.destroy();
$(document).unbind('fullscreenchange');
$(document).unbind('MSFullscreenChange');
$(document).unbind('mozfullscreenchange');
},
exit: function() {
this.updateSize();
this.mediaControl.show();
},
setMediaControlContainer: function(container) {
this.mediaControl.setContainer(container);
this.mediaControl.render();
},
disableMediaControl: function() {
this.mediaControl.disable();
this.$el.removeClass('nocursor');
},
enableMediaControl: function() {
this.mediaControl.enable();
},
removeContainer: function(container) {
this.stopListening(container);
this.containers = _.without(this.containers, container);
},
appendContainer: function(container) {
this.listenTo(container, Events.CONTAINER_DESTROYED, this.removeContainer);
this.el.appendChild(container.render().el);
this.containers.push(container);
},
setupContainers: function(containers) {
_.map(containers, this.appendContainer, this);
this.setupMediaControl(this.getCurrentContainer());
this.render();
this.$el.appendTo(this.options.parentElement);
return containers;
},
createContainer: function(source) {
var container = this.containerFactory.createContainer(source);
this.appendContainer(container);
return container;
},
setupMediaControl: function(container) {
if (this.mediaControl) {
this.mediaControl.setContainer(container);
} else {
this.mediaControl = this.createMediaControl(_.extend({container: container}, this.options));
this.listenTo(this.mediaControl, Events.MEDIACONTROL_FULLSCREEN, this.toggleFullscreen);
this.listenTo(this.mediaControl, Events.MEDIACONTROL_SHOW, this.onMediaControlShow.bind(this, true));
this.listenTo(this.mediaControl, Events.MEDIACONTROL_HIDE, this.onMediaControlShow.bind(this, false));
}
},
createMediaControl: function(options) {
if (options.mediacontrol && options.mediacontrol.external) {
return new options.mediacontrol.external(options);
} else {
return new MediaControl(options);
}
},
getCurrentContainer: function() {
return this.containers[0];
},
toggleFullscreen: function() {
if (!Fullscreen.isFullscreen()) {
Fullscreen.requestFullscreen(this.el);
this.$el.addClass('fullscreen');
} else {
Fullscreen.cancelFullscreen();
this.$el.removeClass('fullscreen nocursor');
}
this.mediaControl.show();
},
showMediaControl: function(event) {
this.mediaControl.show(event);
},
hideMediaControl: function(event) {
this.mediaControl.hide(event);
},
onMediaControlShow: function(showing) {
if (showing)
this.$el.removeClass('nocursor');
else if (Fullscreen.isFullscreen())
this.$el.addClass('nocursor');
},
render: function() {
var style = Styler.getStyleFor('core');
this.$el.append(style);
this.$el.append(this.mediaControl.render().el);
this.options.width = this.options.width || this.$el.width();
this.options.height = this.options.height || this.$el.height();
PlayerInfo.previousSize = PlayerInfo.currentSize = _.pick(this.options, 'width', 'height');
this.updateSize();
return this;
}
}, {}, UIObject);
module.exports = Core;
},{"../../base/styler":8,"../../base/utils":9,"../container_factory":12,"events":"events","media_control":"media_control","mediator":"mediator","player_info":"player_info","ui_object":"ui_object","underscore":"underscore","zepto":"zepto"}],14:[function(require,module,exports){
"use strict";
var _ = require('underscore');
var BaseObject = require('base_object');
var Core = require('core');
var CoreFactory = function CoreFactory(player, loader) {
this.player = player;
this.options = player.options;
this.loader = loader;
this.options.loader = this.loader;
};
($traceurRuntime.createClass)(CoreFactory, {
create: function() {
this.core = new Core(this.options);
this.core.then(this.addCorePlugins.bind(this));
return this.core;
},
addCorePlugins: function() {
_.each(this.loader.corePlugins, function(Plugin) {
var plugin = new Plugin(this.core);
this.core.addPlugin(plugin);
this.setupExternalInterface(plugin);
}, this);
return this.core;
},
setupExternalInterface: function(plugin) {
_.each(plugin.getExternalInterface(), function(value, key) {
this.player[key] = value.bind(plugin);
}, this);
}
}, {}, BaseObject);
module.exports = CoreFactory;
},{"base_object":"base_object","core":"core","underscore":"underscore"}],15:[function(require,module,exports){
"use strict";
module.exports = require('./core_factory');
},{"./core_factory":14}],16:[function(require,module,exports){
"use strict";
var BaseObject = require('base_object');
var $ = require('zepto');
var Player = require('../player');
var IframePlayer = function IframePlayer(options) {
$traceurRuntime.superCall(this, $IframePlayer.prototype, "constructor", [options]);
this.options = options;
this.createIframe();
};
var $IframePlayer = IframePlayer;
($traceurRuntime.createClass)(IframePlayer, {
createIframe: function() {
this.iframe = document.createElement("iframe");
this.iframe.setAttribute("frameborder", 0);
this.iframe.setAttribute("id", this.uniqueId);
this.iframe.setAttribute("allowfullscreen", true);
this.iframe.setAttribute("scrolling", "no");
this.iframe.setAttribute("src", "http://cdn.clappr.io/latest/assets/iframe.htm" + this.buildQueryString());
this.iframe.setAttribute('width', this.options.width);
this.iframe.setAttribute('height', this.options.height);
},
attachTo: function(element) {
element.appendChild(this.iframe);
},
addEventListeners: function() {
var $__0 = this;
this.iframe.contentWindow.addEventListener("fullscreenchange", (function() {
return $__0.updateSize();
}));
this.iframe.contentWindow.addEventListener("webkitfullscreenchange", (function() {
return $__0.updateSize();
}));
this.iframe.contentWindow.addEventListener("mozfullscreenchange", (function() {
return $__0.updateSize();
}));
},
buildQueryString: function() {
var result = "";
for (var param in this.options) {
result += !!result ? "&" : "?";
result += encodeURIComponent(param) + "=" + encodeURIComponent(this.options[param]);
}
return result;
}
}, {}, BaseObject);
module.exports = IframePlayer;
},{"../player":21,"base_object":"base_object","zepto":"zepto"}],17:[function(require,module,exports){
"use strict";
module.exports = require('./iframe_player');
},{"./iframe_player":16}],18:[function(require,module,exports){
"use strict";
module.exports = require('./loader');
},{"./loader":19}],19:[function(require,module,exports){
"use strict";
var BaseObject = require('base_object');
var _ = require('underscore');
var PlayerInfo = require('player_info');
var HTML5VideoPlayback = require('html5_video');
var FlashVideoPlayback = require('flash');
var HTML5AudioPlayback = require('html5_audio');
var HLSVideoPlayback = require('hls');
var HTMLImgPlayback = require('html_img');
var NoOp = require('../../playbacks/no_op');
var SpinnerThreeBouncePlugin = require('../../plugins/spinner_three_bounce');
var StatsPlugin = require('../../plugins/stats');
var WaterMarkPlugin = require('../../plugins/watermark');
var PosterPlugin = require('poster');
var GoogleAnalyticsPlugin = require('../../plugins/google_analytics');
var ClickToPausePlugin = require('../../plugins/click_to_pause');
var BackgroundButton = require('../../plugins/background_button');
var DVRControls = require('../../plugins/dvr_controls');
var Loader = function Loader(externalPlugins) {
$traceurRuntime.superCall(this, $Loader.prototype, "constructor", []);
this.playbackPlugins = [FlashVideoPlayback, HTML5VideoPlayback, HTML5AudioPlayback, HLSVideoPlayback, HTMLImgPlayback, NoOp];
this.containerPlugins = [SpinnerThreeBouncePlugin, WaterMarkPlugin, PosterPlugin, StatsPlugin, GoogleAnalyticsPlugin, ClickToPausePlugin];
this.corePlugins = [BackgroundButton, DVRControls];
if (externalPlugins) {
this.addExternalPlugins(externalPlugins);
}
};
var $Loader = Loader;
($traceurRuntime.createClass)(Loader, {
addExternalPlugins: function(plugins) {
var pluginName = function(plugin) {
return plugin.prototype.name;
};
if (plugins.playback) {
this.playbackPlugins = _.uniq(plugins.playback.concat(this.playbackPlugins), pluginName);
}
if (plugins.container) {
this.containerPlugins = _.uniq(plugins.container.concat(this.containerPlugins), pluginName);
}
if (plugins.core) {
this.corePlugins = _.uniq(plugins.core.concat(this.corePlugins), pluginName);
}
PlayerInfo.playbackPlugins = this.playbackPlugins;
},
getPlugin: function(name) {
var allPlugins = _.union(this.containerPlugins, this.playbackPlugins, this.corePlugins);
return _.find(allPlugins, function(plugin) {
return plugin.prototype.name === name;
});
}
}, {}, BaseObject);
module.exports = Loader;
},{"../../playbacks/no_op":29,"../../plugins/background_button":32,"../../plugins/click_to_pause":34,"../../plugins/dvr_controls":36,"../../plugins/google_analytics":38,"../../plugins/spinner_three_bounce":42,"../../plugins/stats":44,"../../plugins/watermark":46,"base_object":"base_object","flash":"flash","hls":"hls","html5_audio":"html5_audio","html5_video":"html5_video","html_img":"html_img","player_info":"player_info","poster":"poster","underscore":"underscore"}],20:[function(require,module,exports){
"use strict";
var _ = require('underscore');
var $ = require('zepto');
var JST = require('../../base/jst');
var Styler = require('../../base/styler');
var UIObject = require('ui_object');
var Utils = require('../../base/utils');
var SeekTime = require('../seek_time');
var Mediator = require('mediator');
var PlayerInfo = require('player_info');
var Events = require('events');
require('mousetrap');
var MediaControl = function MediaControl(options) {
var $__0 = this;
$traceurRuntime.superCall(this, $MediaControl.prototype, "constructor", [options]);
this.seekTime = new SeekTime(this);
this.options = options;
this.mute = this.options.mute;
this.persistConfig = this.options.persistConfig;
this.container = options.container;
var initialVolume = (this.persistConfig) ? Utils.Config.restore("volume") : 100;
this.setVolume(this.mute ? 0 : initialVolume);
this.keepVisible = false;
this.addEventListeners();
this.settings = {
left: ['play', 'stop', 'pause'],
right: ['volume'],
default: ['position', 'seekbar', 'duration']
};
this.settings = _.isEmpty(this.container.settings) ? this.settings : this.container.settings;
this.disabled = false;
if (this.container.mediaControlDisabled || this.options.chromeless) {
this.disable();
}
$(document).bind('mouseup', (function(event) {
return $__0.stopDrag(event);
}));
$(document).bind('mousemove', (function(event) {
return $__0.updateDrag(event);
}));
Mediator.on(Events.PLAYER_RESIZE, (function() {
return $__0.playerResize();
}));
};
var $MediaControl = MediaControl;
($traceurRuntime.createClass)(MediaControl, {
get name() {
return 'MediaControl';
},
get attributes() {
return {
class: 'media-control',
'data-media-control': ''
};
},
get events() {
return {
'click [data-play]': 'play',
'click [data-pause]': 'pause',
'click [data-playpause]': 'togglePlayPause',
'click [data-stop]': 'stop',
'click [data-playstop]': 'togglePlayStop',
'click [data-fullscreen]': 'toggleFullscreen',
'click .bar-container[data-seekbar]': 'seek',
'click .bar-container[data-volume]': 'volume',
'click .drawer-icon[data-volume]': 'toggleMute',
'mouseenter .drawer-container[data-volume]': 'showVolumeBar',
'mouseleave .drawer-container[data-volume]': 'hideVolumeBar',
'mousedown .bar-scrubber[data-volume]': 'startVolumeDrag',
'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag',
'mousemove .bar-container[data-seekbar]': 'mousemoveOnSeekBar',
'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',
'mouseenter .media-control-layer[data-controls]': 'setKeepVisible',
'mouseleave .media-control-layer[data-controls]': 'resetKeepVisible'
};
},
get template() {
return JST.media_control;
},
addEventListeners: function() {
this.listenTo(this.container, Events.CONTAINER_PLAY, this.changeTogglePlay);
this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.updateSeekBar);
this.listenTo(this.container, Events.CONTAINER_PROGRESS, this.updateProgressBar);
this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
this.listenTo(this.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate);
this.listenTo(this.container, Events.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
this.listenTo(this.container, Events.CONTAINER_MEDIACONTROL_DISABLE, this.disable);
this.listenTo(this.container, Events.CONTAINER_MEDIACONTROL_ENABLE, this.enable);
this.listenTo(this.container, Events.CONTAINER_ENDED, this.ended);
},
disable: function() {
this.disabled = true;
this.hide();
this.$el.hide();
},
enable: function() {
if (this.options.chromeless)
return;
this.disabled = false;
this.show();
},
play: function() {
this.container.play();
},
pause: function() {
this.container.pause();
},
stop: function() {
this.container.stop();
},
changeTogglePlay: function() {
if (this.container.isPlaying()) {
this.$playPauseToggle.removeClass('paused').addClass('playing');
this.$playStopToggle.removeClass('stopped').addClass('playing');
this.trigger(Events.MEDIACONTROL_PLAYING);
} else {
this.$playPauseToggle.removeClass('playing').addClass('paused');
this.$playStopToggle.removeClass('playing').addClass('stopped');
this.trigger(Events.MEDIACONTROL_NOTPLAYING);
}
},
mousemoveOnSeekBar: function(event) {
if (this.container.settings.seekEnabled) {
var offsetX = event.pageX - this.$seekBarContainer.offset().left - (this.$seekBarHover.width() / 2);
this.$seekBarHover.css({left: offsetX});
}
this.trigger(Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, event);
},
mouseleaveOnSeekBar: function(event) {
this.trigger(Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, event);
},
playerResize: function() {
if (Utils.Fullscreen.isFullscreen()) {
this.$fullscreenToggle.addClass('shrink');
} else {
this.$fullscreenToggle.removeClass('shrink');
}
this.$el.removeClass('w320');
if (PlayerInfo.currentSize.width <= 320) {
this.$el.addClass('w320');
}
},
togglePlayPause: function() {
if (this.container.isPlaying()) {
this.container.pause();
} else {
this.container.play();
}
this.changeTogglePlay();
},
togglePlayStop: function() {
if (this.container.isPlaying()) {
this.container.stop();
} else {
this.container.play();
}
this.changeTogglePlay();
},
startSeekDrag: function(event) {
if (!this.container.settings.seekEnabled)
return;
this.draggingSeekBar = true;
this.$el.addClass('dragging');
this.$seekBarLoaded.addClass('media-control-notransition');
this.$seekBarPosition.addClass('media-control-notransition');
this.$seekBarScrubber.addClass('media-control-notransition');
if (event) {
event.preventDefault();
}
},
startVolumeDrag: function(event) {
this.draggingVolumeBar = true;
this.$el.addClass('dragging');
if (event) {
event.preventDefault();
}
},
stopDrag: function(event) {
if (this.draggingSeekBar) {
this.seek(event);
}
this.$el.removeClass('dragging');
this.$seekBarLoaded.removeClass('media-control-notransition');
this.$seekBarPosition.removeClass('media-control-notransition');
this.$seekBarScrubber.removeClass('media-control-notransition dragging');
this.draggingSeekBar = false;
this.draggingVolumeBar = false;
},
updateDrag: function(event) {
if (event) {
event.preventDefault();
}
if (this.draggingSeekBar) {
var offsetX = event.pageX - this.$seekBarContainer.offset().left;
var pos = offsetX / this.$seekBarContainer.width() * 100;
pos = Math.min(100, Math.max(pos, 0));
this.setSeekPercentage(pos);
} else if (this.draggingVolumeBar) {
this.volume(event);
}
},
volume: function(event) {
var offsetY = event.pageX - this.$volumeBarContainer.offset().left;
var volumeFromUI = (offsetY / this.$volumeBarContainer.width()) * 100;
this.setVolume(volumeFromUI);
},
toggleMute: function() {
if (this.mute) {
if (this.currentVolume <= 0) {
this.currentVolume = 100;
}
this.setVolume(this.currentVolume);
} else {
this.setVolume(0);
}
},
setVolume: function(value) {
this.currentVolume = Math.min(100, Math.max(value, 0));
this.container.setVolume(this.currentVolume);
this.setVolumeLevel(this.currentVolume);
this.mute = this.currentVolume === 0;
this.persistConfig && Utils.Config.persist("volume", this.currentVolume);
},
toggleFullscreen: function() {
this.trigger(Events.MEDIACONTROL_FULLSCREEN, this.name);
this.container.fullscreen();
this.resetKeepVisible();
},
setContainer: function(container) {
this.stopListening(this.container);
this.container = container;
this.changeTogglePlay();
this.addEventListeners();
this.settingsUpdate();
this.container.trigger(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse());
this.setVolume(this.currentVolume);
if (this.container.mediaControlDisabled) {
this.disable();
}
this.trigger(Events.MEDIACONTROL_CONTAINERCHANGED);
},
showVolumeBar: function() {
if (this.hideVolumeId) {
clearTimeout(this.hideVolumeId);
}
this.$volumeBarContainer.removeClass('volume-bar-hide');
},
hideVolumeBar: function() {
var $__0 = this;
var timeout = 400;
if (!this.$volumeBarContainer)
return;
if (this.draggingVolumeBar) {
this.hideVolumeId = setTimeout((function() {
return $__0.hideVolumeBar();
}), timeout);
} else {
if (this.hideVolumeId) {
clearTimeout(this.hideVolumeId);
}
this.hideVolumeId = setTimeout((function() {
return $__0.$volumeBarContainer.addClass('volume-bar-hide');
}), timeout);
}
},
ended: function() {
this.changeTogglePlay();
},
updateProgressBar: function(startPosition, endPosition, duration) {
var loadedStart = startPosition / duration * 100;
var loadedEnd = endPosition / duration * 100;
this.$seekBarLoaded.css({
left: loadedStart + '%',
width: (loadedEnd - loadedStart) + '%'
});
},
updateSeekBar: function(position, duration) {
if (this.draggingSeekBar)
return;
if (position < 0)
position = duration;
this.$seekBarPosition.removeClass('media-control-notransition');
this.$seekBarScrubber.removeClass('media-control-notransition');
var seekbarValue = (100 / duration) * position;
this.setSeekPercentage(seekbarValue);
this.$('[data-position]').html(Utils.formatTime(position));
this.$('[data-duration]').html(Utils.formatTime(duration));
},
seek: function(event) {
if (!this.container.settings.seekEnabled)
return;
var offsetX = event.pageX - this.$seekBarContainer.offset().left;
var pos = offsetX / this.$seekBarContainer.width() * 100;
pos = Math.min(100, Math.max(pos, 0));
this.container.setCurrentTime(pos);
this.setSeekPercentage(pos);
return false;
},
setKeepVisible: function() {
this.keepVisible = true;
},
resetKeepVisible: function() {
this.keepVisible = false;
},
isVisible: function() {
return !this.$el.hasClass('media-control-hide');
},
show: function(event) {
var $__0 = this;
if (this.disabled || this.container.getPlaybackType() === null)
return;
var timeout = 2000;
if (!event || (event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY) || navigator.userAgent.match(/firefox/i)) {
clearTimeout(this.hideId);
this.$el.show();
this.trigger(Events.MEDIACONTROL_SHOW, this.name);
this.$el.removeClass('media-control-hide');
this.hideId = setTimeout((function() {
return $__0.hide();
}), timeout);
if (event) {
this.lastMouseX = event.clientX;
this.lastMouseY = event.clientY;
}
}
},
hide: function() {
var $__0 = this;
var timeout = 2000;
clearTimeout(this.hideId);
if (!this.isVisible() || this.options.hideMediaControl === false)
return;
if (this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar) {
this.hideId = setTimeout((function() {
return $__0.hide();
}), timeout);
} else {
this.trigger(Events.MEDIACONTROL_HIDE, this.name);
this.$el.addClass('media-control-hide');
this.hideVolumeBar();
}
},
settingsUpdate: function() {
if (this.container.getPlaybackType() !== null && !_.isEmpty(this.container.settings)) {
this.settings = this.container.settings;
this.render();
this.enable();
} else {
this.disable();
}
},
highDefinitionUpdate: function() {
if (this.container.isHighDefinitionInUse()) {
this.$el.find('button[data-hd-indicator]').addClass("enabled");
} else {
this.$el.find('button[data-hd-indicator]').removeClass("enabled");
}
},
createCachedElements: function() {
this.$playPauseToggle = this.$el.find('button.media-control-button[data-playpause]');
this.$playStopToggle = this.$el.find('button.media-control-button[data-playstop]');
this.$fullscreenToggle = this.$el.find('button.media-control-button[data-fullscreen]');
this.$seekBarContainer = this.$el.find('.bar-container[data-seekbar]');
this.$seekBarLoaded = this.$el.find('.bar-fill-1[data-seekbar]');
this.$seekBarPosition = this.$el.find('.bar-fill-2[data-seekbar]');
this.$seekBarScrubber = this.$el.find('.bar-scrubber[data-seekbar]');
this.$seekBarHover = this.$el.find('.bar-hover[data-seekbar]');
this.$volumeBarContainer = this.$el.find('.bar-container[data-volume]');
this.$volumeIcon = this.$el.find('.drawer-icon[data-volume]');
},
setVolumeLevel: function(value) {
var $__0 = this;
if (!this.container.isReady || !this.$volumeBarContainer) {
this.listenToOnce(this.container, Events.CONTAINER_READY, (function() {
return $__0.setVolumeLevel(value);
}));
} else {
this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill');
var item = Math.ceil(value / 10.0);
this.$volumeBarContainer.find('.segmented-bar-element').slice(0, item).addClass('fill');
if (value > 0) {
this.$volumeIcon.removeClass('muted');
} else {
this.$volumeIcon.addClass('muted');
}
}
},
setSeekPercentage: function(value) {
if (value > 100)
return;
var pos = this.$seekBarContainer.width() * value / 100.0 - (this.$seekBarScrubber.width() / 2.0);
this.currentSeekPercentage = value;
this.$seekBarPosition.css({width: value + '%'});
this.$seekBarScrubber.css({left: pos});
},
bindKeyEvents: function() {
var $__0 = this;
Mousetrap.bind(['space'], (function() {
return $__0.togglePlayPause();
}));
},
unbindKeyEvents: function() {
Mousetrap.unbind('space');
},
parseColors: function() {
if (this.options.mediacontrol) {
var buttonsColor = this.options.mediacontrol.buttons;
var seekbarColor = this.options.mediacontrol.seekbar;
this.$el.find('.bar-fill-2[data-seekbar]').css('background-color', seekbarColor);
this.$el.find('[data-media-control] > .media-control-icon, .drawer-icon').css('color', buttonsColor);
this.$el.find('.segmented-bar-element[data-volume]').css('boxShadow', "inset 2px 0 0 " + buttonsColor);
}
},
render: function() {
var $__0 = this;
var timeout = 1000;
var style = Styler.getStyleFor('media_control');
this.$el.html(this.template({settings: this.settings}));
this.$el.append(style);
this.createCachedElements();
this.$playPauseToggle.addClass('paused');
this.$playStopToggle.addClass('stopped');
this.changeTogglePlay();
this.hideId = setTimeout((function() {
return $__0.hide();
}), timeout);
if (this.disabled) {
this.hide();
}
this.$seekBarPosition.addClass('media-control-notransition');
this.$seekBarScrubber.addClass('media-control-notransition');
if (!this.currentSeekPercentage) {
this.currentSeekPercentage = 0;
}
this.setSeekPercentage(this.currentSeekPercentage);
this.$el.ready((function() {
if (!$__0.container.settings.seekEnabled) {
$__0.$seekBarContainer.addClass('seek-disabled');
}
$__0.setVolume($__0.currentVolume);
$__0.bindKeyEvents();
$__0.hideVolumeBar();
}));
this.parseColors();
this.seekTime.render();
this.trigger(Events.MEDIACONTROL_RENDERED);
return this;
},
destroy: function() {
$(document).unbind('mouseup');
$(document).unbind('mousemove');
this.unbindKeyEvents();
}
}, {}, UIObject);
module.exports = MediaControl;
},{"../../base/jst":7,"../../base/styler":8,"../../base/utils":9,"../seek_time":22,"events":"events","mediator":"mediator","mousetrap":4,"player_info":"player_info","ui_object":"ui_object","underscore":"underscore","zepto":"zepto"}],21:[function(require,module,exports){
"use strict";
var BaseObject = require('base_object');
var CoreFactory = require('./core_factory');
var Loader = require('./loader');
var _ = require('underscore');
var ScrollMonitor = require('scrollmonitor');
var PlayerInfo = require('player_info');
var Player = function Player(options) {
$traceurRuntime.superCall(this, $Player.prototype, "constructor", [options]);
window.p = this;
var DEFAULT_OPTIONS = {persistConfig: true};
this.options = _.extend(DEFAULT_OPTIONS, options);
this.options.sources = this.normalizeSources(options);
this.loader = new Loader(this.options.plugins || {});
this.coreFactory = new CoreFactory(this, this.loader);
this.setCurrentSize(options.height, options.width);
if (this.options.parentId) {
this.setParentId(this.options.parentId);
}
};
var $Player = Player;
($traceurRuntime.createClass)(Player, {
setCurrentSize: function() {
var height = arguments[0] !== (void 0) ? arguments[0] : 360;
var width = arguments[1] !== (void 0) ? arguments[1] : 640;
PlayerInfo.currentSize = {
width: width,
height: height
};
},
setParentId: function(parentId) {
var el = document.querySelector(parentId);
if (el) {
this.attachTo(el);
}
},
attachTo: function(element) {
this.options.parentElement = element;
this.core = this.coreFactory.create();
if (this.options.autoPlayVisible) {
this.bindAutoPlayVisible(this.options.autoPlayVisible);
}
},
bindAutoPlayVisible: function(option) {
var $__0 = this;
this.elementWatcher = ScrollMonitor.create(this.core.$el);
if (option === 'full') {
this.elementWatcher.fullyEnterViewport((function() {
return $__0.enterViewport();
}));
} else if (option === 'partial') {
this.elementWatcher.enterViewport((function() {
return $__0.enterViewport();
}));
}
},
enterViewport: function() {
if (this.elementWatcher.top !== 0 && !this.isPlaying()) {
this.play();
}
},
normalizeSources: function(options) {
var sources = _.compact(_.flatten([options.source, options.sources]));
return _.isEmpty(sources) ? ['no.op'] : sources;
},
resize: function(size) {
this.core.resize(size);
},
load: function(sources) {
this.core.load(sources);
},
destroy: function() {
this.core.destroy();
},
play: function() {
this.core.mediaControl.container.play();
},
pause: function() {
this.core.mediaControl.container.pause();
},
stop: function() {
this.core.mediaControl.container.stop();
},
seek: function(time) {
this.core.mediaControl.container.setCurrentTime(time);
},
setVolume: function(volume) {
this.core.mediaControl.container.setVolume(volume);
},
mute: function() {
this.core.mediaControl.container.setVolume(0);
},
unmute: function() {
this.core.mediaControl.container.setVolume(100);
},
isPlaying: function() {
return this.core.mediaControl.container.isPlaying();
}
}, {}, BaseObject);
module.exports = Player;
},{"./core_factory":15,"./loader":18,"base_object":"base_object","player_info":"player_info","scrollmonitor":5,"underscore":"underscore"}],22:[function(require,module,exports){
"use strict";
module.exports = require('./seek_time');
},{"./seek_time":23}],23:[function(require,module,exports){
"use strict";
var UIObject = require('ui_object');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var formatTime = require('../../base/utils').formatTime;
var Events = require('events');
var SeekTime = function SeekTime(mediaControl) {
$traceurRuntime.superCall(this, $SeekTime.prototype, "constructor", []);
this.mediaControl = mediaControl;
this.addEventListeners();
};
var $SeekTime = SeekTime;
($traceurRuntime.createClass)(SeekTime, {
get name() {
return 'seek_time';
},
get template() {
return JST.seek_time;
},
get attributes() {
return {
'class': 'seek-time hidden',
'data-seek-time': ''
};
},
addEventListeners: function() {
this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime);
this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime);
},
showTime: function(event) {
var offset = event.pageX - this.mediaControl.$seekBarContainer.offset().left;
var timePosition = Math.min(100, Math.max((offset) / this.mediaControl.$seekBarContainer.width() * 100, 0));
var pointerPosition = event.pageX - this.mediaControl.$el.offset().left - (this.$el.width() / 2);
pointerPosition = Math.min(Math.max(0, pointerPosition), this.mediaControl.$el.width() - this.$el.width());
var currentTime = timePosition * this.mediaControl.container.getDuration() / 100;
var options = {
timestamp: currentTime,
formattedTime: formatTime(currentTime),
pointerPosition: pointerPosition
};
this.update(options);
},
hideTime: function() {
this.$el.addClass('hidden');
this.$el.css('left', '-100%');
},
update: function(options) {
if (this.mediaControl.container.getPlaybackType() === 'vod' || this.mediaControl.container.isDvrInUse()) {
this.$el.find('[data-seek-time]').text(options.formattedTime);
this.$el.css('left', options.pointerPosition);
this.$el.removeClass('hidden');
}
},
render: function() {
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template());
this.$el.append(style);
this.mediaControl.$el.append(this.el);
}
}, {}, UIObject);
module.exports = SeekTime;
},{"../../base/jst":7,"../../base/styler":8,"../../base/utils":9,"events":"events","ui_object":"ui_object"}],24:[function(require,module,exports){
"use strict";
var Playback = require('playback');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var Mediator = require('mediator');
var _ = require('underscore');
var $ = require('zepto');
var Browser = require('browser');
var seekStringToSeconds = require('../../base/utils').seekStringToSeconds;
var Events = require('events');
require('mousetrap');
var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-flash-vod=""><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="gpu"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> </object>';
var Flash = function Flash(options) {
$traceurRuntime.superCall(this, $Flash.prototype, "constructor", [options]);
this.src = options.src;
this.defaultBaseSwfPath = "http://cdn.clappr.io/" + Clappr.version + "/assets/";
this.swfPath = (options.swfBasePath || this.defaultBaseSwfPath) + "Player.swf";
this.autoPlay = options.autoPlay;
this.settings = {default: ['seekbar']};
this.settings.left = ["playpause", "position", "duration"];
this.settings.right = ["fullscreen", "volume"];
this.settings.seekEnabled = true;
this.isReady = false;
this.addListeners();
};
var $Flash = Flash;
($traceurRuntime.createClass)(Flash, {
get name() {
return 'flash';
},
get tagName() {
return 'object';
},
get template() {
return JST.flash;
},
bootstrap: function() {
this.el.width = "100%";
this.el.height = "100%";
this.isReady = true;
if (this.currentState === 'PLAYING') {
this.firstPlay();
} else {
this.currentState = "IDLE";
this.autoPlay && this.play();
}
$('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el);
this.trigger(Events.PLAYBACK_READY, this.name);
},
getPlaybackType: function() {
return 'vod';
},
setupFirefox: function() {
var $el = this.$('embed');
$el.attr('data-flash', '');
this.setElement($el[0]);
},
isHighDefinitionInUse: function() {
return false;
},
updateTime: function() {
this.trigger(Events.PLAYBACK_TIMEUPDATE, this.el.getPosition(), this.el.getDuration(), this.name);
},
addListeners: function() {
Mediator.on(this.uniqueId + ':progress', this.progress, this);
Mediator.on(this.uniqueId + ':timeupdate', this.updateTime, this);
Mediator.on(this.uniqueId + ':statechanged', this.checkState, this);
Mediator.on(this.uniqueId + ':flashready', this.bootstrap, this);
_.each(_.range(1, 10), function(i) {
var $__0 = this;
Mousetrap.bind([i.toString()], (function() {
return $__0.seek(i * 10);
}));
}.bind(this));
},
stopListening: function() {
$traceurRuntime.superCall(this, $Flash.prototype, "stopListening", []);
Mediator.off(this.uniqueId + ':progress');
Mediator.off(this.uniqueId + ':timeupdate');
Mediator.off(this.uniqueId + ':statechanged');
Mediator.off(this.uniqueId + ':flashready');
_.each(_.range(1, 10), function(i) {
var $__0 = this;
Mousetrap.unbind([i.toString()], (function() {
return $__0.seek(i * 10);
}));
}.bind(this));
},
checkState: function() {
if (this.currentState === "PAUSED") {
return;
} else if (this.currentState !== "PLAYING_BUFFERING" && this.el.getState() === "PLAYING_BUFFERING") {
this.trigger(Events.PLAYBACK_BUFFERING, this.name);
this.currentState = "PLAYING_BUFFERING";
} else if (this.currentState === "PLAYING_BUFFERING" && this.el.getState() === "PLAYING") {
this.trigger(Events.PLAYBACK_BUFFERFULL, this.name);
this.currentState = "PLAYING";
} else if (this.el.getState() === "IDLE") {
this.currentState = "IDLE";
} else if (this.el.getState() === "ENDED") {
this.trigger(Events.PLAYBACK_ENDED, this.name);
this.trigger(Events.PLAYBACK_TIMEUPDATE, 0, this.el.getDuration(), this.name);
this.currentState = "ENDED";
}
},
progress: function() {
if (this.currentState !== "IDLE" && this.currentState !== "ENDED") {
this.trigger(Events.PLAYBACK_PROGRESS, 0, this.el.getBytesLoaded(), this.el.getBytesTotal(), this.name);
}
},
firstPlay: function() {
var $__0 = this;
this.currentState = "PLAYING";
if (this.el.playerPlay) {
this.el.playerPlay(this.src);
this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, (function() {
return $__0.checkInitialSeek();
}));
} else {
this.listenToOnce(this, EVENTS.PLAYBACK_READY, this.firstPlay);
}
},
checkInitialSeek: function() {
var seekTime = seekStringToSeconds(window.location.href);
this.seekSeconds(seekTime);
},
play: function() {
if (this.el.getState() === 'PAUSED' || this.el.getState() === 'PLAYING_BUFFERING') {
this.currentState = "PLAYING";
this.el.playerResume();
} else if (this.el.getState() !== 'PLAYING') {
this.firstPlay();
}
this.trigger(Events.PLAYBACK_PLAY, this.name);
},
volume: function(value) {
var $__0 = this;
if (this.isReady) {
this.el.playerVolume(value);
} else {
this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, (function() {
return $__0.volume(value);
}));
}
},
pause: function() {
this.currentState = "PAUSED";
this.el.playerPause();
},
stop: function() {
this.el.playerStop();
this.trigger(Events.PLAYBACK_TIMEUPDATE, 0, this.name);
},
isPlaying: function() {
return !!(this.isReady && this.currentState === "PLAYING");
},
getDuration: function() {
return this.el.getDuration();
},
seek: function(seekBarValue) {
var seekTo = this.el.getDuration() * (seekBarValue / 100);
this.seekSeconds(seekTo);
},
seekSeconds: function(seekTo) {
this.el.playerSeek(seekTo);
this.trigger(Events.PLAYBACK_TIMEUPDATE, seekTo, this.el.getDuration(), this.name);
if (this.currentState === "PAUSED") {
this.el.playerPause();
}
},
destroy: function() {
clearInterval(this.bootstrapId);
this.stopListening();
this.$el.remove();
},
setupIE: function() {
this.setElement($(_.template(objectIE)({
cid: this.cid,
swfPath: this.swfPath,
playbackId: this.uniqueId
})));
},
render: function() {
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template({
cid: this.cid,
swfPath: this.swfPath,
playbackId: this.uniqueId
}));
if (Browser.isFirefox) {
this.setupFirefox();
} else if (Browser.isLegacyIE) {
this.setupIE();
}
this.$el.append(style);
return this;
}
}, {}, Playback);
Flash.canPlay = function(resource) {
if ((!Browser.isMobile && Browser.isFirefox) || Browser.isLegacyIE) {
return _.isString(resource) && !!resource.match(/(.*)\.(mp4|mov|f4v|3gpp|3gp)/);
} else {
return _.isString(resource) && !!resource.match(/(.*)\.(mov|f4v|3gpp|3gp)/);
}
};
module.exports = Flash;
},{"../../base/jst":7,"../../base/styler":8,"../../base/utils":9,"browser":"browser","events":"events","mediator":"mediator","mousetrap":4,"playback":"playback","underscore":"underscore","zepto":"zepto"}],25:[function(require,module,exports){
"use strict";
var Playback = require('playback');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var _ = require("underscore");
var Mediator = require('mediator');
var Browser = require('browser');
var Events = require('events');
var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" class="hls-playback" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-hls="" width="100%" height="100%"><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="transparent"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> </object>';
var HLS = function HLS(options) {
$traceurRuntime.superCall(this, $HLS.prototype, "constructor", [options]);
this.src = options.src;
this.defaultBaseSwfPath = "http://cdn.clappr.io/" + Clappr.version + "/assets/";
this.swfPath = (options.swfBasePath || this.defaultBaseSwfPath) + "HLSPlayer.swf";
this.flushLiveURLCache = (options.flushLiveURLCache === undefined) ? true : options.flushLiveURLCache;
this.capLevelToStage = (options.capLevelToStage === undefined) ? false : options.capLevelToStage;
this.highDefinition = false;
this.autoPlay = options.autoPlay;
this.defaultSettings = {
left: ["playstop"],
default: ['seekbar'],
right: ["fullscreen", "volume", "hd-indicator"],
seekEnabled: false
};
this.settings = _.extend({}, this.defaultSettings);
this.playbackType = 'live';
this.addListeners();
};
var $HLS = HLS;
($traceurRuntime.createClass)(HLS, {
get name() {
return 'hls';
},
get tagName() {
return 'object';
},
get template() {
return JST.hls;
},
get attributes() {
return {
'class': 'hls-playback',
'data-hls': '',
'type': 'application/x-shockwave-flash'
};
},
addListeners: function() {
var $__0 = this;
Mediator.on(this.uniqueId + ':flashready', (function() {
return $__0.bootstrap();
}));
Mediator.on(this.uniqueId + ':timeupdate', (function() {
return $__0.updateTime();
}));
Mediator.on(this.uniqueId + ':playbackstate', (function(state) {
return $__0.setPlaybackState(state);
}));
Mediator.on(this.uniqueId + ':highdefinition', (function(isHD) {
return $__0.updateHighDefinition(isHD);
}));
Mediator.on(this.uniqueId + ':playbackerror', (function() {
return $__0.flashPlaybackError();
}));
},
stopListening: function() {
$traceurRuntime.superCall(this, $HLS.prototype, "stopListening", []);
Mediator.off(this.uniqueId + ':flashready');
Mediator.off(this.uniqueId + ':timeupdate');
Mediator.off(this.uniqueId + ':playbackstate');
Mediator.off(this.uniqueId + ':highdefinition');
Mediator.off(this.uniqueId + ':playbackerror');
},
bootstrap: function() {
this.el.width = "100%";
this.el.height = "100%";
this.isReady = true;
this.trigger(Events.PLAYBACK_READY, this.name);
this.currentState = "IDLE";
this.setFlashSettings();
this.autoPlay && this.play();
},
setFlashSettings: function() {
this.el.globoPlayerSetflushLiveURLCache(this.flushLiveURLCache);
this.el.globoPlayerCapLeveltoStage(this.capLevelToStage);
this.el.globoPlayerSetmaxBufferLength(0);
},
updateHighDefinition: function(isHD) {
this.highDefinition = (isHD === "true");
this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE);
this.trigger(Events.PLAYBACK_BITRATE, {'bitrate': this.getCurrentBitrate()});
},
updateTime: function() {
var duration = this.getDuration();
var position = Math.min(Math.max(this.el.globoGetPosition(), 0), duration);
var previousDVRStatus = this.dvrEnabled;
var livePlayback = (this.playbackType === 'live');
this.dvrEnabled = (livePlayback && duration > 240);
if (duration === 100 || livePlayback === undefined) {
return;
}
if (this.dvrEnabled !== previousDVRStatus) {
this.updateSettings();
this.trigger(Events.PLAYBACK_SETTINGSUPDATE, this.name);
}
if (livePlayback && (!this.dvrEnabled || !this.dvrInUse)) {
position = duration;
}
this.trigger(Events.PLAYBACK_TIMEUPDATE, position, duration, this.name);
},
play: function() {
if (this.currentState === 'PAUSED') {
this.el.globoPlayerResume();
} else if (this.currentState !== "PLAYING") {
this.firstPlay();
}
this.trigger(Events.PLAYBACK_PLAY, this.name);
},
getPlaybackType: function() {
return this.playbackType ? this.playbackType : null;
},
getCurrentBitrate: function() {
var currentLevel = this.getLevels()[this.el.globoGetLevel()];
return currentLevel.bitrate;
},
getLastProgramDate: function() {
var programDate = this.el.globoGetLastProgramDate();
return programDate - 1.08e+7;
},
isHighDefinitionInUse: function() {
return this.highDefinition;
},
getLevels: function() {
if (!this.levels || this.levels.length === 0) {
this.levels = this.el.globoGetLevels();
}
return this.levels;
},
setPlaybackState: function(state) {
var bufferLength = this.el.globoGetbufferLength();
if (state === "PLAYING_BUFFERING" && bufferLength < 1) {
this.trigger(Events.PLAYBACK_BUFFERING, this.name);
this.updateCurrentState(state);
} else if (state === "PLAYING") {
if (_.contains(["PLAYING_BUFFERING", "PAUSED", "IDLE"], this.currentState)) {
this.trigger(Events.PLAYBACK_BUFFERFULL, this.name);
this.updateCurrentState(state);
}
} else if (state === "PAUSED") {
this.updateCurrentState(state);
} else if (state === "IDLE") {
this.trigger(Events.PLAYBACK_ENDED, this.name);
this.trigger(Events.PLAYBACK_TIMEUPDATE, 0, this.el.globoGetDuration(), this.name);
this.updateCurrentState(state);
}
this.lastBufferLength = bufferLength;
},
updateCurrentState: function(state) {
this.currentState = state;
this.updatePlaybackType();
},
updatePlaybackType: function() {
this.playbackType = this.el.globoGetType();
if (this.playbackType) {
this.playbackType = this.playbackType.toLowerCase();
if (this.playbackType === 'vod') {
this.startReportingProgress();
} else {
this.stopReportingProgress();
}
}
this.trigger(Events.PLAYBACK_PLAYBACKSTATE);
},
startReportingProgress: function() {
if (!this.reportingProgress) {
this.reportingProgress = true;
Mediator.on(this.uniqueId + ':fragmentloaded', this.onFragmentLoaded);
}
},
stopReportingProgress: function() {
Mediator.off(this.uniqueId + ':fragmentloaded', this.onFragmentLoaded, this);
},
onFragmentLoaded: function() {
var buffered = this.el.globoGetPosition() + this.el.globoGetbufferLength();
this.trigger(Events.PLAYBACK_PROGRESS, this.el.globoGetPosition(), buffered, this.getDuration(), this.name);
},
firstPlay: function() {
this.el.globoPlayerLoad(this.src);
this.el.globoPlayerPlay();
},
volume: function(value) {
var $__0 = this;
if (this.isReady) {
this.el.globoPlayerVolume(value);
} else {
this.listenToOnce(this, Events.PLAYBACK_BUFFERFULL, (function() {
return $__0.volume(value);
}));
}
},
pause: function() {
if (this.playbackType !== 'live' || this.dvrEnabled) {
this.el.globoPlayerPause();
if (this.playbackType === 'live' && this.dvrEnabled) {
this.updateDvr(true);
}
}
},
stop: function() {
this.el.globoPlayerStop();
this.trigger(Events.PLAYBACK_TIMEUPDATE, 0, this.name);
},
isPlaying: function() {
if (this.currentState) {
return !!(this.currentState.match(/playing/i));
}
return false;
},
getDuration: function() {
var duration = this.el.globoGetDuration();
if (this.playbackType === 'live') {
duration = duration - 10;
}
return duration;
},
seek: function(time) {
var duration = this.getDuration();
if (time > 0) {
time = duration * time / 100;
}
if (this.playbackType === 'live') {
var dvrInUse = (time >= 0 && duration - time > 5);
if (!dvrInUse) {
time = -1;
}
this.updateDvr(dvrInUse);
}
this.el.globoPlayerSeek(time);
this.trigger(Events.PLAYBACK_TIMEUPDATE, time, duration, this.name);
},
updateDvr: function(dvrInUse) {
var previousDvrInUse = !!this.dvrInUse;
this.dvrInUse = dvrInUse;
if (this.dvrInUse !== previousDvrInUse) {
this.updateSettings();
this.trigger(Events.PLAYBACK_DVR, this.dvrInUse);
this.trigger(Events.PLAYBACK_STATS_ADD, {'dvr': this.dvrInUse});
}
},
flashPlaybackError: function() {
this.trigger(Events.PLAYBACK_STOP);
},
timeUpdate: function(time, duration) {
this.trigger(Events.PLAYBACK_TIMEUPDATE, time, duration, this.name);
},
destroy: function() {
this.stopListening();
this.$el.remove();
},
setupFirefox: function() {
var $el = this.$('embed');
$el.attr('data-hls', '');
this.setElement($el);
},
setupIE: function() {
this.setElement($(_.template(objectIE)({
cid: this.cid,
swfPath: this.swfPath,
playbackId: this.uniqueId
})));
},
updateSettings: function() {
this.settings = _.extend({}, this.defaultSettings);
if (this.playbackType === "vod" || this.dvrInUse) {
this.settings.left = ["playpause", "position", "duration"];
this.settings.seekEnabled = true;
} else if (this.dvrEnabled) {
this.settings.left = ["playpause"];
this.settings.seekEnabled = true;
} else {
this.settings.seekEnabled = false;
}
},
setElement: function(element) {
this.$el = element;
this.el = element[0];
},
render: function() {
var style = Styler.getStyleFor(this.name);
if (Browser.isLegacyIE) {
this.setupIE();
} else {
this.$el.html(this.template({
cid: this.cid,
swfPath: this.swfPath,
playbackId: this.uniqueId
}));
if (Browser.isFirefox) {
this.setupFirefox();
} else if (Browser.isIE) {
this.$('embed').remove();
}
}
this.el.id = this.cid;
this.$el.append(style);
return this;
}
}, {}, Playback);
HLS.canPlay = function(resource) {
return !!resource.match(/^http(.*).m3u8?/);
};
module.exports = HLS;
},{"../../base/jst":7,"../../base/styler":8,"browser":"browser","events":"events","mediator":"mediator","playback":"playback","underscore":"underscore"}],26:[function(require,module,exports){
"use strict";
var Playback = require('playback');
var Events = require('events');
var HTML5Audio = function HTML5Audio(params) {
$traceurRuntime.superCall(this, $HTML5Audio.prototype, "constructor", [params]);
this.el.src = params.src;
this.settings = {
left: ['playpause', 'position', 'duration'],
right: ['fullscreen', 'volume'],
default: ['seekbar']
};
this.render();
params.autoPlay && this.play();
};
var $HTML5Audio = HTML5Audio;
($traceurRuntime.createClass)(HTML5Audio, {
get name() {
return 'html5_audio';
},
get tagName() {
return 'audio';
},
get events() {
return {
'timeupdate': 'timeUpdated',
'ended': 'ended',
'canplaythrough': 'bufferFull'
};
},
bindEvents: function() {
this.listenTo(this.container, Events.CONTAINER_PLAY, this.play);
this.listenTo(this.container, Events.CONTAINER_PAUSE, this.pause);
this.listenTo(this.container, Events.CONTAINER_SEEK, this.seek);
this.listenTo(this.container, Events.CONTAINER_VOLUME, this.volume);
this.listenTo(this.container, Events.CONTAINER_STOP, this.stop);
},
getPlaybackType: function() {
return "aod";
},
play: function() {
this.el.play();
this.trigger(Events.PLAYBACK_PLAY);
},
pause: function() {
this.el.pause();
},
stop: function() {
this.pause();
this.el.currentTime = 0;
},
volume: function(value) {
this.el.volume = value / 100;
},
mute: function() {
this.el.volume = 0;
},
unmute: function() {
this.el.volume = 1;
},
isMuted: function() {
return !!this.el.volume;
},
ended: function() {
this.trigger(Events.CONTAINER_TIMEUPDATE, 0);
},
seek: function(seekBarValue) {
var time = this.el.duration * (seekBarValue / 100);
this.el.currentTime = time;
},
getCurrentTime: function() {
return this.el.currentTime;
},
getDuration: function() {
return this.el.duration;
},
isPlaying: function() {
return !this.el.paused && !this.el.ended;
},
timeUpdated: function() {
this.trigger(Events.PLAYBACK_TIMEUPDATE, this.el.currentTime, this.el.duration, this.name);
},
bufferFull: function() {
this.trigger(Events.PLAYBACK_TIMEUPDATE, this.el.currentTime, this.el.duration, this.name);
this.trigger(Events.PLAYBACK_BUFFERFULL);
},
render: function() {
this.trigger(Events.PLAYBACK_READY, this.name);
return this;
}
}, {}, Playback);
HTML5Audio.canPlay = function(resource) {
return !!resource.match(/(.*).mp3/);
};
module.exports = HTML5Audio;
},{"events":"events","playback":"playback"}],27:[function(require,module,exports){
(function (process){
"use strict";
var Playback = require('playback');
var JST = require('../../base/jst');
var Styler = require('../../base/styler');
var Browser = require('browser');
var seekStringToSeconds = require('../../base/utils').seekStringToSeconds;
var Events = require('events');
var _ = require('underscore');
require('mousetrap');
var HTML5Video = function HTML5Video(options) {
$traceurRuntime.superCall(this, $HTML5Video.prototype, "constructor", [options]);
this.options = options;
this.src = options.src;
this.el.src = options.src;
this.el.loop = options.loop;
this.firstBuffer = true;
this.isHLS = (this.src.indexOf('m3u8') > -1);
this.settings = {default: ['seekbar']};
if (this.isHLS && Browser.isSafari) {
this.settings.left = ["playstop"];
this.settings.right = ["fullscreen", "volume"];
} else {
this.el.preload = options.preload ? options.preload : 'metadata';
this.settings.left = ["playpause", "position", "duration"];
this.settings.right = ["fullscreen", "volume"];
this.settings.seekEnabled = true;
}
this.bindEvents();
};
var $HTML5Video = HTML5Video;
($traceurRuntime.createClass)(HTML5Video, {
get name() {
return 'html5_video';
},
get tagName() {
return 'video';
},
get template() {
return JST.html5_video;
},
get attributes() {
return {'data-html5-video': ''};
},
get events() {
return {
'timeupdate': 'timeUpdated',
'progress': 'progress',
'ended': 'ended',
'stalled': 'stalled',
'waiting': 'waiting',
'canplaythrough': 'bufferFull',
'loadedmetadata': 'loadedMetadata'
};
},
bindEvents: function() {
_.each(_.range(1, 10), function(i) {
var $__0 = this;
Mousetrap.bind([i.toString()], (function() {
return $__0.seek(i * 10);
}));
}.bind(this));
},
loadedMetadata: function(e) {
this.trigger(Events.PLAYBACK_LOADEDMETADATA, e.target.duration);
this.trigger(Events.PLAYBACK_SETTINGSUPDATE);
this.checkInitialSeek();
},
getPlaybackType: function() {
return this.isHLS && _.contains([0, undefined, Infinity], this.el.duration) ? 'live' : 'vod';
},
isHighDefinitionInUse: function() {
return false;
},
play: function() {
this.el.play();
this.trigger(Events.PLAYBACK_PLAY);
if (this.isHLS) {
this.trigger(Events.PLAYBACK_TIMEUPDATE, 1, 1, this.name);
}
},
pause: function() {
this.el.pause();
},
stop: function() {
this.pause();
if (this.el.readyState !== 0) {
this.el.currentTime = 0;
}
},
volume: function(value) {
this.el.volume = value / 100;
},
mute: function() {
this.el.volume = 0;
},
unmute: function() {
this.el.volume = 1;
},
isMuted: function() {
return !!this.el.volume;
},
isPlaying: function() {
return !this.el.paused && !this.el.ended;
},
ended: function() {
this.trigger(Events.PLAYBACK_ENDED, this.name);
this.trigger(Events.PLAYBACK_TIMEUPDATE, 0, this.el.duration, this.name);
},
stalled: function() {
if (this.getPlaybackType() === 'vod' && this.el.readyState < this.el.HAVE_FUTURE_DATA) {
this.trigger(Events.PLAYBACK_BUFFERING, this.name);
}
},
waiting: function() {
if (this.el.readyState < this.el.HAVE_FUTURE_DATA) {
this.trigger(Events.PLAYBACK_BUFFERING, this.name);
}
},
bufferFull: function() {
if (this.options.poster && this.firstBuffer) {
this.firstBuffer = false;
if (!this.isPlaying()) {
this.el.poster = this.options.poster;
}
} else {
this.el.poster = '';
}
this.trigger(Events.PLAYBACK_BUFFERFULL, this.name);
},
destroy: function() {
this.stop();
this.el.src = '';
this.$el.remove();
},
seek: function(seekBarValue) {
var time = this.el.duration * (seekBarValue / 100);
this.seekSeconds(time);
},
seekSeconds: function(time) {
this.el.currentTime = time;
},
checkInitialSeek: function() {
var seekTime = seekStringToSeconds(window.location.href);
this.seekSeconds(seekTime);
},
getCurrentTime: function() {
return this.el.currentTime;
},
getDuration: function() {
return this.el.duration;
},
timeUpdated: function() {
if (this.getPlaybackType() !== 'live') {
this.trigger(Events.PLAYBACK_TIMEUPDATE, this.el.currentTime, this.el.duration, this.name);
}
},
progress: function() {
if (!this.el.buffered.length)
return;
var bufferedPos = 0;
for (var i = 0; i < this.el.buffered.length; i++) {
if (this.el.currentTime >= this.el.buffered.start(i) && this.el.currentTime <= this.el.buffered.end(i)) {
bufferedPos = i;
break;
}
}
this.trigger(Events.PLAYBACK_PROGRESS, this.el.buffered.start(bufferedPos), this.el.buffered.end(bufferedPos), this.el.duration, this.name);
},
typeFor: function(src) {
return (src.indexOf('.m3u8') > 0) ? 'application/vnd.apple.mpegurl' : 'video/mp4';
},
render: function() {
var $__0 = this;
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template({
src: this.src,
type: this.typeFor(this.src)
}));
this.$el.append(style);
this.trigger(Events.PLAYBACK_READY, this.name);
process.nextTick((function() {
return $__0.options.autoPlay && $__0.play();
}));
return this;
}
}, {}, Playback);
HTML5Video.canPlay = function(resource) {
var mimetypes = {
'mp4': _.map(["avc1.42E01E", "avc1.58A01E", "avc1.4D401E", "avc1.64001E", "mp4v.20.8", "mp4v.20.240"], function(codec) {
return 'video/mp4; codecs=' + codec + ', mp4a.40.2';
}),
'ogg': ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'],
'3gpp': ['video/3gpp; codecs="mp4v.20.8, samr"'],
'webm': ['video/webm; codecs="vp8, vorbis"'],
'mkv': ['video/x-matroska; codecs="theora, vorbis"'],
'm3u8': ['application/x-mpegURL']
};
mimetypes['ogv'] = mimetypes['ogg'];
mimetypes['3gp'] = mimetypes['3gpp'];
var extension = resource.split('?')[0].match(/.*\.(.*)$/)[1];
if (_.has(mimetypes, extension)) {
var v = document.createElement('video');
return !!_.find(mimetypes[extension], function(ext) {
return !!v.canPlayType(ext).replace(/no/, '');
});
}
return false;
};
module.exports = HTML5Video;
}).call(this,require('_process'))
},{"../../base/jst":7,"../../base/styler":8,"../../base/utils":9,"_process":2,"browser":"browser","events":"events","mousetrap":4,"playback":"playback","underscore":"underscore"}],28:[function(require,module,exports){
"use strict";
var Playback = require('playback');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var Events = require('events');
var HTMLImg = function HTMLImg(params) {
$traceurRuntime.superCall(this, $HTMLImg.prototype, "constructor", [params]);
this.el.src = params.src;
setTimeout(function() {
this.trigger(Events.PLAYBACK_BUFFERFULL, this.name);
}.bind(this), 1);
};
var $HTMLImg = HTMLImg;
($traceurRuntime.createClass)(HTMLImg, {
get name() {
return 'html_img';
},
get tagName() {
return 'img';
},
get attributes() {
return {'data-html-img': ''};
},
getPlaybackType: function() {
return null;
},
render: function() {
var style = Styler.getStyleFor(this.name);
this.$el.append(style);
return this;
}
}, {}, Playback);
HTMLImg.canPlay = function(resource) {
return !!resource.match(/(.*).(png|jpg|jpeg|gif|bmp)/);
};
module.exports = HTMLImg;
},{"../../base/jst":7,"../../base/styler":8,"events":"events","playback":"playback"}],29:[function(require,module,exports){
"use strict";
module.exports = require('./no_op');
},{"./no_op":30}],30:[function(require,module,exports){
"use strict";
var Playback = require('playback');
var JST = require('../../base/jst');
var Styler = require('../../base/styler');
var NoOp = function NoOp(options) {
$traceurRuntime.superCall(this, $NoOp.prototype, "constructor", [options]);
};
var $NoOp = NoOp;
($traceurRuntime.createClass)(NoOp, {
get name() {
return 'no_op';
},
get template() {
return JST.no_op;
},
get attributes() {
return {'data-no-op': ''};
},
render: function() {
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template());
this.$el.append(style);
return this;
}
}, {}, Playback);
NoOp.canPlay = (function(source) {
return true;
});
module.exports = NoOp;
},{"../../base/jst":7,"../../base/styler":8,"playback":"playback"}],31:[function(require,module,exports){
(function (process){
"use strict";
var UICorePlugin = require('ui_core_plugin');
var JST = require('../../base/jst');
var Styler = require('../../base/styler');
var Events = require('events');
var Browser = require('browser');
var Mediator = require('mediator');
var PlayerInfo = require('player_info');
var BackgroundButton = function BackgroundButton(core) {
$traceurRuntime.superCall(this, $BackgroundButton.prototype, "constructor", [core]);
this.core = core;
this.settingsUpdate();
};
var $BackgroundButton = BackgroundButton;
($traceurRuntime.createClass)(BackgroundButton, {
get template() {
return JST.background_button;
},
get name() {
return 'background_button';
},
get attributes() {
return {
'class': 'background-button',
'data-background-button': ''
};
},
get events() {
return {'click .background-button-icon': 'click'};
},
bindEvents: function() {
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_STATE_BUFFERING, this.hide);
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_STATE_BUFFERFULL, this.show);
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate);
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_SHOW, this.updateSize);
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_PLAYING, this.playing);
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_NOTPLAYING, this.notplaying);
Mediator.on(Events.PLAYER_RESIZE, this.updateSize, this);
},
stopListening: function() {
$traceurRuntime.superCall(this, $BackgroundButton.prototype, "stopListening", []);
Mediator.off(Events.PLAYER_RESIZE, this.updateSize, this);
},
settingsUpdate: function() {
this.stopListening();
if (this.shouldRender()) {
this.render();
this.bindEvents();
if (this.core.mediaControl.container.isPlaying()) {
this.playing();
} else {
this.notplaying();
}
} else {
this.$el.remove();
this.$playPauseButton.show();
this.$playStopButton.show();
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate);
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.settingsUpdate);
}
},
shouldRender: function() {
var useBackgroundButton = (this.core.options.useBackgroundButton === undefined && Browser.isMobile) || !!this.core.options.useBackgroundButton;
return useBackgroundButton && (this.core.mediaControl.$el.find('[data-playstop]').length > 0 || this.core.mediaControl.$el.find('[data-playpause]').length > 0);
},
click: function() {
this.core.mediaControl.show();
if (this.shouldStop) {
this.core.mediaControl.togglePlayStop();
} else {
this.core.mediaControl.togglePlayPause();
}
},
show: function() {
this.$el.removeClass('hide');
},
hide: function() {
this.$el.addClass('hide');
},
enable: function() {
this.stopListening();
$traceurRuntime.superCall(this, $BackgroundButton.prototype, "enable", []);
this.settingsUpdate();
},
disable: function() {
$traceurRuntime.superCall(this, $BackgroundButton.prototype, "disable", []);
this.$playPauseButton.show();
this.$playStopButton.show();
},
playing: function() {
this.$buttonIcon.removeClass('notplaying').addClass('playing');
},
notplaying: function() {
this.$buttonIcon.removeClass('playing').addClass('notplaying');
},
getExternalInterface: function() {},
updateSize: function() {
if (!this.$el)
return;
var height = PlayerInfo.currentSize ? PlayerInfo.currentSize.height : this.$el.height();
this.$el.css({fontSize: height});
this.$buttonWrapper.css({marginTop: -(this.$buttonWrapper.height() / 2)});
},
render: function() {
var $__0 = this;
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template());
this.$el.append(style);
this.$playPauseButton = this.core.mediaControl.$el.find('[data-playpause]');
this.$playStopButton = this.core.mediaControl.$el.find('[data-playstop]');
this.$buttonWrapper = this.$el.find('.background-button-wrapper[data-background-button]');
this.$buttonIcon = this.$el.find('.background-button-icon[data-background-button]');
this.shouldStop = this.$playStopButton.length > 0;
this.$el.insertBefore(this.core.mediaControl.$el.find('.media-control-layer[data-controls]'));
this.$el.click((function() {
return $__0.click($__0.$el);
}));
process.nextTick((function() {
return $__0.updateSize();
}));
if (this.core.options.useBackgroundButton) {
this.$playPauseButton.hide();
this.$playStopButton.hide();
}
if (this.shouldStop) {
this.$buttonIcon.addClass('playstop');
}
if (this.core.mediaControl.isVisible()) {
this.show();
}
return this;
}
}, {}, UICorePlugin);
module.exports = BackgroundButton;
}).call(this,require('_process'))
},{"../../base/jst":7,"../../base/styler":8,"_process":2,"browser":"browser","events":"events","mediator":"mediator","player_info":"player_info","ui_core_plugin":"ui_core_plugin"}],32:[function(require,module,exports){
"use strict";
module.exports = require('./background_button');
},{"./background_button":31}],33:[function(require,module,exports){
"use strict";
var ContainerPlugin = require('container_plugin');
var Events = require('events');
var ClickToPausePlugin = function ClickToPausePlugin() {
$traceurRuntime.defaultSuperCall(this, $ClickToPausePlugin.prototype, arguments);
};
var $ClickToPausePlugin = ClickToPausePlugin;
($traceurRuntime.createClass)(ClickToPausePlugin, {
get name() {
return 'click_to_pause';
},
bindEvents: function() {
this.listenTo(this.container, Events.CONTAINER_CLICK, this.click);
this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
},
click: function() {
if (this.container.getPlaybackType() !== 'live' || this.container.isDvrEnabled()) {
if (this.container.isPlaying()) {
this.container.pause();
} else {
this.container.play();
}
}
},
settingsUpdate: function() {
this.container.$el.removeClass('pointer-enabled');
if (this.container.getPlaybackType() !== 'live' || this.container.isDvrEnabled()) {
this.container.$el.addClass('pointer-enabled');
}
}
}, {}, ContainerPlugin);
module.exports = ClickToPausePlugin;
},{"container_plugin":"container_plugin","events":"events"}],34:[function(require,module,exports){
"use strict";
module.exports = require('./click_to_pause');
},{"./click_to_pause":33}],35:[function(require,module,exports){
"use strict";
var UICorePlugin = require('ui_core_plugin');
var JST = require('../../base/jst');
var Styler = require('../../base/styler');
var Events = require('events');
var DVRControls = function DVRControls(core) {
$traceurRuntime.superCall(this, $DVRControls.prototype, "constructor", [core]);
this.core = core;
this.settingsUpdate();
};
var $DVRControls = DVRControls;
($traceurRuntime.createClass)(DVRControls, {
get template() {
return JST.dvr_controls;
},
get name() {
return 'dvr_controls';
},
get events() {
return {'click .live-button': 'click'};
},
get attributes() {
return {
'class': 'dvr-controls',
'data-dvr-controls': ''
};
},
bindEvents: function() {
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate);
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
},
dvrChanged: function(dvrEnabled) {
this.settingsUpdate();
this.core.mediaControl.$el.addClass('live');
if (dvrEnabled) {
this.core.mediaControl.$el.addClass('dvr');
this.core.mediaControl.$el.find('.media-control-indicator[data-position], .media-control-indicator[data-duration]').hide();
} else {
this.core.mediaControl.$el.removeClass('dvr');
}
},
click: function() {
if (!this.core.mediaControl.container.isPlaying()) {
this.core.mediaControl.container.play();
}
if (this.core.mediaControl.$el.hasClass('dvr')) {
this.core.mediaControl.container.setCurrentTime(-1);
}
},
settingsUpdate: function() {
var $__0 = this;
this.stopListening();
if (this.shouldRender()) {
this.render();
this.$el.click((function() {
return $__0.click();
}));
}
this.bindEvents();
},
shouldRender: function() {
var useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;
return useDvrControls && this.core.mediaControl.container.getPlaybackType() === 'live';
},
render: function() {
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template());
this.$el.append(style);
if (this.shouldRender()) {
this.core.mediaControl.$el.addClass('live');
this.core.mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
if (this.$duration) {
this.$duration.remove();
}
this.$duration = $('<span data-duration></span>');
this.core.mediaControl.seekTime.$el.append(this.$duration);
}
return this;
}
}, {}, UICorePlugin);
module.exports = DVRControls;
},{"../../base/jst":7,"../../base/styler":8,"events":"events","ui_core_plugin":"ui_core_plugin"}],36:[function(require,module,exports){
"use strict";
module.exports = require('./dvr_controls');
},{"./dvr_controls":35}],37:[function(require,module,exports){
"use strict";
var ContainerPlugin = require('container_plugin');
var Events = require('events');
var GoogleAnalytics = function GoogleAnalytics(options) {
$traceurRuntime.superCall(this, $GoogleAnalytics.prototype, "constructor", [options]);
if (options.gaAccount) {
this.embedScript();
this.account = options.gaAccount;
this.trackerName = options.gaTrackerName + "." || 'Clappr.';
this.currentHDState = undefined;
}
};
var $GoogleAnalytics = GoogleAnalytics;
($traceurRuntime.createClass)(GoogleAnalytics, {
get name() {
return 'google_analytics';
},
embedScript: function() {
var $__0 = this;
if (!window._gat) {
var script = document.createElement('script');
script.setAttribute("type", "text/javascript");
script.setAttribute("async", "async");
script.setAttribute("src", "http://www.google-analytics.com/ga.js");
script.onload = (function() {
return $__0.addEventListeners();
});
document.body.appendChild(script);
} else {
this.addEventListeners();
}
},
addEventListeners: function() {
var $__0 = this;
this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay);
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
this.listenTo(this.container, Events.CONTAINER_PAUSE, this.onPause);
this.listenTo(this.container, Events.CONTAINER_ENDED, this.onEnded);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);
this.listenTo(this.container, Events.CONTAINER_ENDED, this.onEnded);
this.listenTo(this.container, Events.CONTAINER_ERROR, this.onError);
this.listenTo(this.container, Events.CONTAINER_PLAYBACKSTATE, this.onPlaybackChanged);
this.listenTo(this.container, Events.CONTAINER_VOLUME, (function(event) {
return $__0.onVolumeChanged(event);
}));
this.listenTo(this.container, Events.CONTAINER_SEEK, (function(event) {
return $__0.onSeek(event);
}));
this.listenTo(this.container, Events.CONTAINER_FULL_SCREEN, this.onFullscreen);
this.listenTo(this.container, Events.CONTAINER_HIGHDEFINITIONUPDATE, this.onHD);
this.listenTo(this.container.playback, Events.PLAYBACK_DVR, this.onDVR);
_gaq.push([this.trackerName + '_setAccount', this.account]);
},
onPlay: function() {
this.push(["Video", "Play", this.container.playback.src]);
},
onStop: function() {
this.push(["Video", "Stop", this.container.playback.src]);
},
onEnded: function() {
this.push(["Video", "Ended", this.container.playback.src]);
},
onBuffering: function() {
this.push(["Video", "Buffering", this.container.playback.src]);
},
onBufferFull: function() {
this.push(["Video", "Bufferfull", this.container.playback.src]);
},
onError: function() {
this.push(["Video", "Error", this.container.playback.src]);
},
onHD: function() {
var status = this.container.isHighDefinitionInUse() ? "ON" : "OFF";
if (status !== this.currentHDState) {
this.currentHDState = status;
this.push(["Video", "HD - " + status, this.container.playback.src]);
}
},
onPlaybackChanged: function() {
var type = this.container.getPlaybackType();
if (type !== null) {
this.push(["Video", "Playback Type - " + type, this.container.playback.src]);
}
},
onDVR: function() {
var status = this.container.isHighDefinitionInUse();
this.push(["Interaction", "DVR - " + status, this.container.playback.src]);
},
onPause: function() {
this.push(["Video", "Pause", this.container.playback.src]);
},
onSeek: function() {
this.push(["Video", "Seek", this.container.playback.src]);
},
onVolumeChanged: function() {
this.push(["Interaction", "Volume", this.container.playback.src]);
},
onFullscreen: function() {
this.push(["Interaction", "Fullscreen", this.container.playback.src]);
},
push: function(array) {
var res = [this.trackerName + "_trackEvent"].concat(array);
_gaq.push(res);
}
}, {}, ContainerPlugin);
module.exports = GoogleAnalytics;
},{"container_plugin":"container_plugin","events":"events"}],38:[function(require,module,exports){
"use strict";
module.exports = require('./google_analytics');
},{"./google_analytics":37}],39:[function(require,module,exports){
"use strict";
module.exports = require('./log');
},{"./log":40}],40:[function(require,module,exports){
"use strict";
var _ = require('underscore');
require('mousetrap');
var Log = function Log() {
var $__0 = this;
Mousetrap.bind(['ctrl+shift+d'], (function() {
return $__0.onOff();
}));
this.BLACKLIST = ['playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress'];
};
($traceurRuntime.createClass)(Log, {
info: function(klass, message) {
this.log(klass, 'info', message);
},
warn: function(klass, message) {
this.log(klass, 'warn', message);
},
debug: function(klass, message) {
this.log(klass, 'debug', message);
},
onOff: function() {
window.DEBUG = !window.DEBUG;
if (window.DEBUG) {
console.log('log enabled');
} else {
console.log('log disabled');
}
},
log: function(klass, level, message) {
if (!window.DEBUG || _.contains(this.BLACKLIST, message))
return;
var color;
if (level === 'warn') {
color = '#FF8000';
} else if (level === 'info') {
color = '#006600';
} else if (level === 'error') {
color = '#FF0000';
}
console.log("%c [" + klass + "] [" + level + "] " + message, 'color: ' + color);
}
}, {});
Log.getInstance = function() {
if (this._instance === undefined) {
this._instance = new this();
}
return this._instance;
};
module.exports = Log;
},{"mousetrap":4,"underscore":"underscore"}],41:[function(require,module,exports){
(function (process){
"use strict";
var UIContainerPlugin = require('ui_container_plugin');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var Events = require('events');
var Mediator = require('mediator');
var PlayerInfo = require('player_info');
var $ = require('zepto');
var _ = require('underscore');
var PosterPlugin = function PosterPlugin(options) {
$traceurRuntime.superCall(this, $PosterPlugin.prototype, "constructor", [options]);
this.options = options;
_.defaults(this.options, {disableControlsOnPoster: true});
if (this.options.disableControlsOnPoster) {
this.container.disableMediaControl();
}
this.render();
};
var $PosterPlugin = PosterPlugin;
($traceurRuntime.createClass)(PosterPlugin, {
get name() {
return 'poster';
},
get template() {
return JST.poster;
},
get attributes() {
return {
'class': 'player-poster',
'data-poster': ''
};
},
get events() {
return {'click': 'clicked'};
},
bindEvents: function() {
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
this.listenTo(this.container, Events.CONTAINER_ENDED, this.onStop);
Mediator.on(Events.PLAYER_RESIZE, this.updateSize, this);
},
stopListening: function() {
$traceurRuntime.superCall(this, $PosterPlugin.prototype, "stopListening", []);
Mediator.off(Events.PLAYER_RESIZE, this.updateSize, this);
},
onBuffering: function() {
this.hidePlayButton();
},
onBufferfull: function() {
this.$el.hide();
if (this.options.disableControlsOnPoster) {
this.container.enableMediaControl();
}
},
onStop: function() {
this.$el.show();
if (this.options.disableControlsOnPoster) {
this.container.disableMediaControl();
}
if (!this.options.hidePlayButton) {
this.showPlayButton();
}
},
hidePlayButton: function() {
this.$playButton.hide();
},
showPlayButton: function() {
this.$playButton.show();
this.updateSize();
},
clicked: function() {
this.container.play();
return false;
},
updateSize: function() {
if (!this.$el)
return;
var height = PlayerInfo.currentSize ? PlayerInfo.currentSize.height : this.$el.height();
this.$el.css({fontSize: height});
if (this.$playWrapper.is(':visible')) {
this.$playWrapper.css({marginTop: -(this.$playWrapper.height() / 2)});
if (!this.options.hidePlayButton) {
this.$playButton.show();
}
} else {
this.$playButton.hide();
}
},
render: function() {
var $__0 = this;
var style = Styler.getStyleFor(this.name);
this.$el.html(this.template());
this.$el.append(style);
this.$playButton = this.$el.find('.poster-icon');
this.$playWrapper = this.$el.find('.play-wrapper');
if (this.options.poster !== undefined) {
var imgEl = $('<img data-poster class="poster-background"></img>');
imgEl.attr('src', this.options.poster);
this.$el.prepend(imgEl);
}
this.container.$el.append(this.el);
if (!!this.options.hidePlayButton) {
this.hidePlayButton();
}
process.nextTick((function() {
return $__0.updateSize();
}));
return this;
}
}, {}, UIContainerPlugin);
module.exports = PosterPlugin;
}).call(this,require('_process'))
},{"../../base/jst":7,"../../base/styler":8,"_process":2,"events":"events","mediator":"mediator","player_info":"player_info","ui_container_plugin":"ui_container_plugin","underscore":"underscore","zepto":"zepto"}],42:[function(require,module,exports){
"use strict";
module.exports = require('./spinner_three_bounce');
},{"./spinner_three_bounce":43}],43:[function(require,module,exports){
"use strict";
var UIContainerPlugin = require('ui_container_plugin');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var Events = require('events');
var SpinnerThreeBouncePlugin = function SpinnerThreeBouncePlugin(options) {
$traceurRuntime.superCall(this, $SpinnerThreeBouncePlugin.prototype, "constructor", [options]);
this.template = JST.spinner_three_bounce;
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
this.render();
};
var $SpinnerThreeBouncePlugin = SpinnerThreeBouncePlugin;
($traceurRuntime.createClass)(SpinnerThreeBouncePlugin, {
get name() {
return 'spinner';
},
get attributes() {
return {
'data-spinner': '',
'class': 'spinner-three-bounce'
};
},
onBuffering: function() {
this.$el.show();
},
onBufferFull: function() {
this.$el.hide();
},
onStop: function() {
this.$el.hide();
},
render: function() {
this.$el.html(this.template());
var style = Styler.getStyleFor('spinner_three_bounce');
this.container.$el.append(style);
this.container.$el.append(this.$el);
this.$el.hide();
return this;
}
}, {}, UIContainerPlugin);
module.exports = SpinnerThreeBouncePlugin;
},{"../../base/jst":7,"../../base/styler":8,"events":"events","ui_container_plugin":"ui_container_plugin"}],44:[function(require,module,exports){
"use strict";
module.exports = require('./stats');
},{"./stats":45}],45:[function(require,module,exports){
"use strict";
var ContainerPlugin = require('container_plugin');
var $ = require("zepto");
var Events = require('events');
var StatsPlugin = function StatsPlugin(options) {
$traceurRuntime.superCall(this, $StatsPlugin.prototype, "constructor", [options]);
this.setInitialAttrs();
this.reportInterval = options.reportInterval || 5000;
this.state = "IDLE";
};
var $StatsPlugin = StatsPlugin;
($traceurRuntime.createClass)(StatsPlugin, {
get name() {
return 'stats';
},
bindEvents: function() {
this.listenTo(this.container.playback, Events.PLAYBACK_PLAY, this.onPlay);
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
this.listenTo(this.container, Events.CONTAINER_DESTROYED, this.onStop);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering);
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);
this.listenTo(this.container, Events.CONTAINER_STATS_ADD, this.onStatsAdd);
this.listenTo(this.container, Events.CONTAINER_BITRATE, this.onStatsAdd);
this.listenTo(this.container.playback, Events.PLAYBACK_STATS_ADD, this.onStatsAdd);
},
setInitialAttrs: function() {
this.firstPlay = true;
this.startupTime = 0;
this.rebufferingTime = 0;
this.watchingTime = 0;
this.rebuffers = 0;
this.externalMetrics = {};
},
onPlay: function() {
this.state = "PLAYING";
this.watchingTimeInit = Date.now();
if (!this.intervalId) {
this.intervalId = setInterval(this.report.bind(this), this.reportInterval);
}
},
onStop: function() {
clearInterval(this.intervalId);
this.intervalId = undefined;
this.state = "STOPPED";
},
onBuffering: function() {
if (this.firstPlay) {
this.startupTimeInit = Date.now();
} else {
this.rebufferingTimeInit = Date.now();
}
this.state = "BUFFERING";
this.rebuffers++;
},
onBufferFull: function() {
if (this.firstPlay && !!this.startupTimeInit) {
this.firstPlay = false;
this.startupTime = Date.now() - this.startupTimeInit;
this.watchingTimeInit = Date.now();
} else if (!!this.rebufferingTimeInit) {
this.rebufferingTime += this.getRebufferingTime();
}
this.rebufferingTimeInit = undefined;
this.state = "PLAYING";
},
getRebufferingTime: function() {
return Date.now() - this.rebufferingTimeInit;
},
getWatchingTime: function() {
var totalTime = (Date.now() - this.watchingTimeInit);
return totalTime - this.rebufferingTime;
},
isRebuffering: function() {
return !!this.rebufferingTimeInit;
},
onStatsAdd: function(metric) {
$.extend(this.externalMetrics, metric);
},
getStats: function() {
var metrics = {
startupTime: this.startupTime,
rebuffers: this.rebuffers,
rebufferingTime: this.isRebuffering() ? this.rebufferingTime + this.getRebufferingTime() : this.rebufferingTime,
watchingTime: this.isRebuffering() ? this.getWatchingTime() - this.getRebufferingTime() : this.getWatchingTime()
};
$.extend(metrics, this.externalMetrics);
return metrics;
},
report: function() {
this.container.statsReport(this.getStats());
}
}, {}, ContainerPlugin);
module.exports = StatsPlugin;
},{"container_plugin":"container_plugin","events":"events","zepto":"zepto"}],46:[function(require,module,exports){
"use strict";
module.exports = require('./watermark');
},{"./watermark":47}],47:[function(require,module,exports){
"use strict";
var UIContainerPlugin = require('ui_container_plugin');
var Styler = require('../../base/styler');
var JST = require('../../base/jst');
var Events = require('events');
var WaterMarkPlugin = function WaterMarkPlugin(options) {
$traceurRuntime.superCall(this, $WaterMarkPlugin.prototype, "constructor", [options]);
this.template = JST[this.name];
this.position = options.position || "bottom-right";
if (options.watermark) {
this.imageUrl = options.watermark;
this.render();
} else {
this.$el.remove();
}
};
var $WaterMarkPlugin = WaterMarkPlugin;
($traceurRuntime.createClass)(WaterMarkPlugin, {
get name() {
return 'watermark';
},
bindEvents: function() {
this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay);
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
},
onPlay: function() {
if (!this.hidden)
this.$el.show();
},
onStop: function() {
this.$el.hide();
},
render: function() {
this.$el.hide();
var templateOptions = {
position: this.position,
imageUrl: this.imageUrl
};
this.$el.html(this.template(templateOptions));
var style = Styler.getStyleFor(this.name);
this.container.$el.append(style);
this.container.$el.append(this.$el);
return this;
}
}, {}, UIContainerPlugin);
module.exports = WaterMarkPlugin;
},{"../../base/jst":7,"../../base/styler":8,"events":"events","ui_container_plugin":"ui_container_plugin"}],"base_object":[function(require,module,exports){
"use strict";
var _ = require('underscore');
var extend = require('./utils').extend;
var Events = require('events');
var pluginOptions = ['container'];
var BaseObject = function BaseObject(options) {
this.uniqueId = _.uniqueId('o');
options || (options = {});
_.extend(this, _.pick(options, pluginOptions));
};
($traceurRuntime.createClass)(BaseObject, {}, {}, Events);
BaseObject.extend = extend;
module.exports = BaseObject;
},{"./utils":9,"events":"events","underscore":"underscore"}],"browser":[function(require,module,exports){
"use strict";
var Browser = function Browser() {};
($traceurRuntime.createClass)(Browser, {}, {});
var hasLocalstorage = function() {
try {
localStorage.setItem('clappr', 'clappr');
localStorage.removeItem('clappr');
return true;
} catch (e) {
return false;
}
};
Browser.isSafari = (!!navigator.userAgent.match(/safari/i) && navigator.userAgent.indexOf('Chrome') === -1);
Browser.isChrome = !!(navigator.userAgent.match(/chrome/i));
Browser.isFirefox = !!(navigator.userAgent.match(/firefox/i));
Browser.isLegacyIE = !!(window.ActiveXObject);
Browser.isIE = Browser.isLegacyIE || !!(navigator.userAgent.match(/trident.*rv:1\d/i));
Browser.isIE11 = !!(navigator.userAgent.match(/trident.*rv:11/i));
Browser.isMobile = !!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent));
Browser.isWin8App = !!(/MSAppHost/i.test(navigator.userAgent));
Browser.isWiiU = !!(/WiiU/i.test(navigator.userAgent));
Browser.isPS4 = !!(/PlayStation 4/i.test(navigator.userAgent));
Browser.hasLocalstorage = hasLocalstorage();
module.exports = Browser;
},{}],"container_plugin":[function(require,module,exports){
"use strict";
var BaseObject = require('base_object');
var ContainerPlugin = function ContainerPlugin(options) {
$traceurRuntime.superCall(this, $ContainerPlugin.prototype, "constructor", [options]);
this.bindEvents();
};
var $ContainerPlugin = ContainerPlugin;
($traceurRuntime.createClass)(ContainerPlugin, {
enable: function() {
this.bindEvents();
},
disable: function() {
this.stopListening();
},
bindEvents: function() {},
destroy: function() {
this.stopListening();
}
}, {}, BaseObject);
module.exports = ContainerPlugin;
},{"base_object":"base_object"}],"container":[function(require,module,exports){
"use strict";
module.exports = require('./container');
},{"./container":10}],"core_plugin":[function(require,module,exports){
"use strict";
var BaseObject = require('base_object');
var CorePlugin = function CorePlugin(core) {
$traceurRuntime.superCall(this, $CorePlugin.prototype, "constructor", [core]);
this.core = core;
};
var $CorePlugin = CorePlugin;
($traceurRuntime.createClass)(CorePlugin, {
getExternalInterface: function() {
return {};
},
destroy: function() {}
}, {}, BaseObject);
module.exports = CorePlugin;
},{"base_object":"base_object"}],"core":[function(require,module,exports){
"use strict";
module.exports = require('./core');
},{"./core":13}],"events":[function(require,module,exports){
"use strict";
var _ = require('underscore');
var Log = require('../plugins/log').getInstance();
var slice = Array.prototype.slice;
var Events = function Events() {};
($traceurRuntime.createClass)(Events, {
on: function(name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback)
return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({
callback: callback,
context: context,
ctx: context || this
});
return this;
},
once: function(name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback)
return this;
var self = this;
var once = _.once(function() {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
},
off: function(name, callback, context) {
var retain,
ev,
events,
names,
i,
l,
j,
k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context]))
return this;
if (!name && !callback && !context) {
this._events = void 0;
return this;
}
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
events = this._events[name];
if (events) {
this._events[name] = retain = [];
if (callback || context) {
for (j = 0, k = events.length; j < k; j++) {
ev = events[j];
if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) {
retain.push(ev);
}
}
}
if (!retain.length)
delete this._events[name];
}
}
return this;
},
trigger: function(name) {
var klass = arguments[arguments.length - 1];
Log.info(klass, name);
if (!this._events)
return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args))
return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events)
triggerEvents(events, args);
if (allEvents)
triggerEvents(allEvents, arguments);
return this;
},
stopListening: function(obj, name, callback) {
var listeningTo = this._listeningTo;
if (!listeningTo)
return this;
var remove = !name && !callback;
if (!callback && typeof name === 'object')
callback = this;
if (obj)
(listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) {
obj = listeningTo[id];
obj.off(name, callback, this);
if (remove || _.isEmpty(obj._events))
delete this._listeningTo[id];
}
return this;
}
}, {});
var eventSplitter = /\s+/;
var eventsApi = function(obj, action, name, rest) {
if (!name)
return true;
if (typeof name === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0,
l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
var triggerEvents = function(events, args) {
var ev,
i = -1,
l = events.length,
a1 = args[0],
a2 = args[1],
a3 = args[2];
switch (args.length) {
case 0:
while (++i < l)
(ev = events[i]).callback.call(ev.ctx);
return;
case 1:
while (++i < l)
(ev = events[i]).callback.call(ev.ctx, a1);
return;
case 2:
while (++i < l)
(ev = events[i]).callback.call(ev.ctx, a1, a2);
return;
case 3:
while (++i < l)
(ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
return;
default:
while (++i < l)
(ev = events[i]).callback.apply(ev.ctx, args);
return;
}
};
var listenMethods = {
listenTo: 'on',
listenToOnce: 'once'
};
_.each(listenMethods, function(implementation, method) {
Events.prototype[method] = function(obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
listeningTo[id] = obj;
if (!callback && typeof name === 'object')
callback = this;
obj[implementation](name, callback, this);
return this;
};
});
Events.PLAYER_RESIZE = 'player:resize';
Events.PLAYBACK_PROGRESS = 'playback:progress';
Events.PLAYBACK_TIMEUPDATE = 'playback:timeupdate';
Events.PLAYBACK_READY = 'playback:ready';
Events.PLAYBACK_BUFFERING = 'playback:buffering';
Events.PLAYBACK_BUFFERFULL = 'playback:bufferfull';
Events.PLAYBACK_SETTINGSUPDATE = 'playback:settingsupdate';
Events.PLAYBACK_LOADEDMETADATA = 'playback:loadedmetadata';
Events.PLAYBACK_HIGHDEFINITIONUPDATE = 'playback:highdefinitionupdate';
Events.PLAYBACK_BITRATE = 'playback:bitrate';
Events.PLAYBACK_PLAYBACKSTATE = 'playback:playbackstate';
Events.PLAYBACK_DVR = 'playback:dvr';
Events.PLAYBACK_MEDIACONTROL_DISABLE = 'playback:mediacontrol:disable';
Events.PLAYBACK_MEDIACONTROL_ENABLE = 'playback:mediacontrol:enable';
Events.PLAYBACK_ENDED = 'playback:ended';
Events.PLAYBACK_PLAY = 'playback:play';
Events.PLAYBACK_ERROR = 'playback:error';
Events.PLAYBACK_STATS_ADD = 'playback:stats:add';
Events.CONTAINER_PLAYBACKSTATE = 'container:playbackstate';
Events.CONTAINER_PLAYBACKDVRSTATECHANGED = 'container:dvr';
Events.CONTAINER_BITRATE = 'container:bitrate';
Events.CONTAINER_STATS_REPORT = 'container:stats:report';
Events.CONTAINER_DESTROYED = 'container:destroyed';
Events.CONTAINER_READY = 'container:ready';
Events.CONTAINER_ERROR = 'container:error';
Events.CONTAINER_LOADEDMETADATA = 'container:loadedmetadata';
Events.CONTAINER_TIMEUPDATE = 'container:timeupdate';
Events.CONTAINER_PROGRESS = 'container:progress';
Events.CONTAINER_PLAY = 'container:play';
Events.CONTAINER_STOP = 'container:stop';
Events.CONTAINER_PAUSE = 'container:pause';
Events.CONTAINER_ENDED = 'container:ended';
Events.CONTAINER_CLICK = 'container:click';
Events.CONTAINER_SEEK = 'container:seek';
Events.CONTAINER_VOLUME = 'container:volume';
Events.CONTAINER_FULLSCREEN = 'container:fullscreen';
Events.CONTAINER_STATE_BUFFERING = 'container:state:buffering';
Events.CONTAINER_STATE_BUFFERFULL = 'container:state:bufferfull';
Events.CONTAINER_SETTINGSUPDATE = 'container:settingsupdate';
Events.CONTAINER_HIGHDEFINITIONUPDATE = 'container:highdefinitionupdate';
Events.CONTAINER_MEDIACONTROL_DISABLE = 'container:mediacontrol:disable';
Events.CONTAINER_MEDIACONTROL_ENABLE = 'container:mediacontrol:enable';
Events.CONTAINER_STATS_ADD = 'container:stats:add';
Events.MEDIACONTROL_RENDERED = 'mediacontrol:rendered';
Events.MEDIACONTROL_FULLSCREEN = 'mediacontrol:fullscreen';
Events.MEDIACONTROL_SHOW = 'mediacontrol:show';
Events.MEDIACONTROL_HIDE = 'mediacontrol:hide';
Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR = 'mediacontrol:mousemove:seekbar';
Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR = 'mediacontrol:mouseleave:seekbar';
Events.MEDIACONTROL_PLAYING = 'mediacontrol:playing';
Events.MEDIACONTROL_NOTPLAYING = 'mediacontrol:notplaying';
Events.MEDIACONTROL_CONTAINERCHANGED = 'mediacontrol:containerchanged';
module.exports = Events;
},{"../plugins/log":39,"underscore":"underscore"}],"flash":[function(require,module,exports){
"use strict";
module.exports = require('./flash');
},{"./flash":24}],"hls":[function(require,module,exports){
"use strict";
module.exports = require('./hls');
},{"./hls":25}],"html5_audio":[function(require,module,exports){
"use strict";
module.exports = require('./html5_audio');
},{"./html5_audio":26}],"html5_video":[function(require,module,exports){
"use strict";
module.exports = require('./html5_video');
},{"./html5_video":27}],"html_img":[function(require,module,exports){
"use strict";
module.exports = require('./html_img');
},{"./html_img":28}],"media_control":[function(require,module,exports){
"use strict";
module.exports = require('./media_control');
},{"./media_control":20}],"mediator":[function(require,module,exports){
"use strict";
var Events = require('events');
var events = new Events();
var Mediator = function Mediator() {};
($traceurRuntime.createClass)(Mediator, {}, {});
Mediator.on = function(name, callback, context) {
events.on(name, callback, context);
return;
};
Mediator.once = function(name, callback, context) {
events.once(name, callback, context);
return;
};
Mediator.off = function(name, callback, context) {
events.off(name, callback, context);
return;
};
Mediator.trigger = function(name, opts) {
events.trigger(name, opts);
return;
};
Mediator.stopListening = function(obj, name, callback) {
events.stopListening(obj, name, callback);
return;
};
module.exports = Mediator;
},{"events":"events"}],"playback":[function(require,module,exports){
"use strict";
var UIObject = require('ui_object');
var Playback = function Playback(options) {
$traceurRuntime.superCall(this, $Playback.prototype, "constructor", [options]);
this.settings = {};
};
var $Playback = Playback;
($traceurRuntime.createClass)(Playback, {
play: function() {},
pause: function() {},
stop: function() {},
seek: function(time) {},
getDuration: function() {
return 0;
},
isPlaying: function() {
return false;
},
getPlaybackType: function() {
return 'no_op';
},
isHighDefinitionInUse: function() {
return false;
},
volume: function(value) {},
destroy: function() {
this.$el.remove();
}
}, {}, UIObject);
Playback.canPlay = (function(source) {
return false;
});
module.exports = Playback;
},{"ui_object":"ui_object"}],"player_info":[function(require,module,exports){
"use strict";
var PlayerInfo = {
options: {},
playbackPlugins: [],
currentSize: {
width: 0,
height: 0
}
};
module.exports = PlayerInfo;
},{}],"poster":[function(require,module,exports){
"use strict";
module.exports = require('./poster');
},{"./poster":41}],"ui_container_plugin":[function(require,module,exports){
"use strict";
var UIObject = require('ui_object');
var UIContainerPlugin = function UIContainerPlugin(options) {
$traceurRuntime.superCall(this, $UIContainerPlugin.prototype, "constructor", [options]);
this.enabled = true;
this.bindEvents();
};
var $UIContainerPlugin = UIContainerPlugin;
($traceurRuntime.createClass)(UIContainerPlugin, {
enable: function() {
this.bindEvents();
this.$el.show();
this.enabled = true;
},
disable: function() {
this.stopListening();
this.$el.hide();
this.enabled = false;
},
bindEvents: function() {},
destroy: function() {
this.remove();
}
}, {}, UIObject);
module.exports = UIContainerPlugin;
},{"ui_object":"ui_object"}],"ui_core_plugin":[function(require,module,exports){
"use strict";
var UIObject = require('ui_object');
var UICorePlugin = function UICorePlugin(core) {
$traceurRuntime.superCall(this, $UICorePlugin.prototype, "constructor", [core]);
this.core = core;
this.enabled = true;
this.bindEvents();
this.render();
};
var $UICorePlugin = UICorePlugin;
($traceurRuntime.createClass)(UICorePlugin, {
bindEvents: function() {},
getExternalInterface: function() {
return {};
},
enable: function() {
this.bindEvents();
this.$el.show();
this.enabled = true;
},
disable: function() {
this.stopListening();
this.$el.hide();
this.enabled = false;
},
destroy: function() {
this.remove();
},
render: function() {
this.$el.html(this.template());
this.$el.append(this.styler.getStyleFor(this.name));
this.core.$el.append(this.el);
return this;
}
}, {}, UIObject);
module.exports = UICorePlugin;
},{"ui_object":"ui_object"}],"ui_object":[function(require,module,exports){
"use strict";
var $ = require('zepto');
var _ = require('underscore');
var extend = require('./utils').extend;
var BaseObject = require('base_object');
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
var UIObject = function UIObject(options) {
$traceurRuntime.superCall(this, $UIObject.prototype, "constructor", [options]);
this.cid = _.uniqueId('c');
this._ensureElement();
this.delegateEvents();
};
var $UIObject = UIObject;
($traceurRuntime.createClass)(UIObject, {
get tagName() {
return 'div';
},
$: function(selector) {
return this.$el.find(selector);
},
render: function() {
return this;
},
remove: function() {
this.$el.remove();
this.stopListening();
return this;
},
setElement: function(element, delegate) {
if (this.$el)
this.undelegateEvents();
this.$el = element instanceof $ ? element : $(element);
this.el = this.$el[0];
if (delegate !== false)
this.delegateEvents();
return this;
},
delegateEvents: function(events) {
if (!(events || (events = _.result(this, 'events'))))
return this;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
if (!_.isFunction(method))
method = this[events[key]];
if (!method)
continue;
var match = key.match(delegateEventSplitter);
var eventName = match[1],
selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
this.$el.on(eventName, method);
} else {
this.$el.on(eventName, selector, method);
}
}
return this;
},
undelegateEvents: function() {
this.$el.off('.delegateEvents' + this.cid);
return this;
},
_ensureElement: function() {
if (!this.el) {
var attrs = _.extend({}, _.result(this, 'attributes'));
if (this.id)
attrs.id = _.result(this, 'id');
if (this.className)
attrs['class'] = _.result(this, 'className');
var $el = $('<' + _.result(this, 'tagName') + '>').attr(attrs);
this.setElement($el, false);
} else {
this.setElement(_.result(this, 'el'), false);
}
}
}, {}, BaseObject);
UIObject.extend = extend;
module.exports = UIObject;
},{"./utils":9,"base_object":"base_object","underscore":"underscore","zepto":"zepto"}],"underscore":[function(require,module,exports){
// Underscore.js 1.7.0
// http://underscorejs.org
// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `exports` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var
push = ArrayProto.push,
slice = ArrayProto.slice,
concat = ArrayProto.concat,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root._ = _;
}
// Current version.
_.VERSION = '1.7.0';
// Internal function that returns an efficient (for current engines) version
// of the passed-in callback, to be repeatedly applied in other Underscore
// functions.
var createCallback = function(func, context, argCount) {
if (context === void 0) return func;
switch (argCount == null ? 3 : argCount) {
case 1: return function(value) {
return func.call(context, value);
};
case 2: return function(value, other) {
return func.call(context, value, other);
};
case 3: return function(value, index, collection) {
return func.call(context, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(context, accumulator, value, index, collection);
};
}
return function() {
return func.apply(context, arguments);
};
};
// A mostly-internal function to generate callbacks that can be applied
// to each element in a collection, returning the desired result — either
// identity, an arbitrary callback, a property matcher, or a property accessor.
_.iteratee = function(value, context, argCount) {
if (value == null) return _.identity;
if (_.isFunction(value)) return createCallback(value, context, argCount);
if (_.isObject(value)) return _.matches(value);
return _.property(value);
};
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
_.each = _.forEach = function(obj, iteratee, context) {
if (obj == null) return obj;
iteratee = createCallback(iteratee, context);
var i, length = obj.length;
if (length === +length) {
for (i = 0; i < length; i++) {
iteratee(obj[i], i, obj);
}
} else {
var keys = _.keys(obj);
for (i = 0, length = keys.length; i < length; i++) {
iteratee(obj[keys[i]], keys[i], obj);
}
}
return obj;
};
// Return the results of applying the iteratee to each element.
_.map = _.collect = function(obj, iteratee, context) {
if (obj == null) return [];
iteratee = _.iteratee(iteratee, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
results = Array(length),
currentKey;
for (var index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
results[index] = iteratee(obj[currentKey], currentKey, obj);
}
return results;
};
var reduceError = 'Reduce of empty array with no initial value';
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`.
_.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
if (obj == null) obj = [];
iteratee = createCallback(iteratee, context, 4);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index = 0, currentKey;
if (arguments.length < 3) {
if (!length) throw new TypeError(reduceError);
memo = obj[keys ? keys[index++] : index++];
}
for (; index < length; index++) {
currentKey = keys ? keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
_.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
if (obj == null) obj = [];
iteratee = createCallback(iteratee, context, 4);
var keys = obj.length !== + obj.length && _.keys(obj),
index = (keys || obj).length,
currentKey;
if (arguments.length < 3) {
if (!index) throw new TypeError(reduceError);
memo = obj[keys ? keys[--index] : --index];
}
while (index--) {
currentKey = keys ? keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, predicate, context) {
var result;
predicate = _.iteratee(predicate, context);
_.some(obj, function(value, index, list) {
if (predicate(value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Aliased as `select`.
_.filter = _.select = function(obj, predicate, context) {
var results = [];
if (obj == null) return results;
predicate = _.iteratee(predicate, context);
_.each(obj, function(value, index, list) {
if (predicate(value, index, list)) results.push(value);
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, predicate, context) {
return _.filter(obj, _.negate(_.iteratee(predicate)), context);
};
// Determine whether all of the elements match a truth test.
// Aliased as `all`.
_.every = _.all = function(obj, predicate, context) {
if (obj == null) return true;
predicate = _.iteratee(predicate, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index, currentKey;
for (index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
if (!predicate(obj[currentKey], currentKey, obj)) return false;
}
return true;
};
// Determine if at least one element in the object matches a truth test.
// Aliased as `any`.
_.some = _.any = function(obj, predicate, context) {
if (obj == null) return false;
predicate = _.iteratee(predicate, context);
var keys = obj.length !== +obj.length && _.keys(obj),
length = (keys || obj).length,
index, currentKey;
for (index = 0; index < length; index++) {
currentKey = keys ? keys[index] : index;
if (predicate(obj[currentKey], currentKey, obj)) return true;
}
return false;
};
// Determine if the array or object contains a given value (using `===`).
// Aliased as `include`.
_.contains = _.include = function(obj, target) {
if (obj == null) return false;
if (obj.length !== +obj.length) obj = _.values(obj);
return _.indexOf(obj, target) >= 0;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
var isFunc = _.isFunction(method);
return _.map(obj, function(value) {
return (isFunc ? method : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, _.property(key));
};
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
_.where = function(obj, attrs) {
return _.filter(obj, _.matches(attrs));
};
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
_.findWhere = function(obj, attrs) {
return _.find(obj, _.matches(attrs));
};
// Return the maximum element (or element-based computation).
_.max = function(obj, iteratee, context) {
var result = -Infinity, lastComputed = -Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = obj.length === +obj.length ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value > result) {
result = value;
}
}
} else {
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iteratee, context) {
var result = Infinity, lastComputed = Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = obj.length === +obj.length ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value < result) {
result = value;
}
}
} else {
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed < lastComputed || computed === Infinity && result === Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Shuffle a collection, using the modern version of the
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
_.shuffle = function(obj) {
var set = obj && obj.length === +obj.length ? obj : _.values(obj);
var length = set.length;
var shuffled = Array(length);
for (var index = 0, rand; index < length; index++) {
rand = _.random(0, index);
if (rand !== index) shuffled[index] = shuffled[rand];
shuffled[rand] = set[index];
}
return shuffled;
};
// Sample **n** random values from a collection.
// If **n** is not specified, returns a single random element.
// The internal `guard` argument allows it to work with `map`.
_.sample = function(obj, n, guard) {
if (n == null || guard) {
if (obj.length !== +obj.length) obj = _.values(obj);
return obj[_.random(obj.length - 1)];
}
return _.shuffle(obj).slice(0, Math.max(0, n));
};
// Sort the object's values by a criterion produced by an iteratee.
_.sortBy = function(obj, iteratee, context) {
iteratee = _.iteratee(iteratee, context);
return _.pluck(_.map(obj, function(value, index, list) {
return {
value: value,
index: index,
criteria: iteratee(value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria;
var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
if (a < b || b === void 0) return -1;
}
return left.index - right.index;
}), 'value');
};
// An internal function used for aggregate "group by" operations.
var group = function(behavior) {
return function(obj, iteratee, context) {
var result = {};
iteratee = _.iteratee(iteratee, context);
_.each(obj, function(value, index) {
var key = iteratee(value, index, obj);
behavior(result, value, key);
});
return result;
};
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = group(function(result, value, key) {
if (_.has(result, key)) result[key].push(value); else result[key] = [value];
});
// Indexes the object's values by a criterion, similar to `groupBy`, but for
// when you know that your index values will be unique.
_.indexBy = group(function(result, value, key) {
result[key] = value;
});
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
_.countBy = group(function(result, value, key) {
if (_.has(result, key)) result[key]++; else result[key] = 1;
});
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iteratee, context) {
iteratee = _.iteratee(iteratee, context, 1);
var value = iteratee(obj);
var low = 0, high = array.length;
while (low < high) {
var mid = low + high >>> 1;
if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
}
return low;
};
// Safely create a real, live array from anything iterable.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
if (obj.length === +obj.length) return _.map(obj, _.identity);
return _.values(obj);
};
// Return the number of elements in an object.
_.size = function(obj) {
if (obj == null) return 0;
return obj.length === +obj.length ? obj.length : _.keys(obj).length;
};
// Split a collection into two arrays: one whose elements all satisfy the given
// predicate, and one whose elements all do not satisfy the predicate.
_.partition = function(obj, predicate, context) {
predicate = _.iteratee(predicate, context);
var pass = [], fail = [];
_.each(obj, function(value, key, obj) {
(predicate(value, key, obj) ? pass : fail).push(value);
});
return [pass, fail];
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[0];
if (n < 0) return [];
return slice.call(array, 0, n);
};
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[array.length - 1];
return slice.call(array, Math.max(array.length - n, 0));
};
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = _.drop = function(array, n, guard) {
return slice.call(array, n == null || guard ? 1 : n);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
};
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, strict, output) {
if (shallow && _.every(input, _.isArray)) {
return concat.apply(output, input);
}
for (var i = 0, length = input.length; i < length; i++) {
var value = input[i];
if (!_.isArray(value) && !_.isArguments(value)) {
if (!strict) output.push(value);
} else if (shallow) {
push.apply(output, value);
} else {
flatten(value, shallow, strict, output);
}
}
return output;
};
// Flatten out an array, either recursively (by default), or just one level.
_.flatten = function(array, shallow) {
return flatten(array, shallow, false, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iteratee, context) {
if (array == null) return [];
if (!_.isBoolean(isSorted)) {
context = iteratee;
iteratee = isSorted;
isSorted = false;
}
if (iteratee != null) iteratee = _.iteratee(iteratee, context);
var result = [];
var seen = [];
for (var i = 0, length = array.length; i < length; i++) {
var value = array[i];
if (isSorted) {
if (!i || seen !== value) result.push(value);
seen = value;
} else if (iteratee) {
var computed = iteratee(value, i, array);
if (_.indexOf(seen, computed) < 0) {
seen.push(computed);
result.push(value);
}
} else if (_.indexOf(result, value) < 0) {
result.push(value);
}
}
return result;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(flatten(arguments, true, true, []));
};
// Produce an array that contains every item shared between all the
// passed-in arrays.
_.intersection = function(array) {
if (array == null) return [];
var result = [];
var argsLength = arguments.length;
for (var i = 0, length = array.length; i < length; i++) {
var item = array[i];
if (_.contains(result, item)) continue;
for (var j = 1; j < argsLength; j++) {
if (!_.contains(arguments[j], item)) break;
}
if (j === argsLength) result.push(item);
}
return result;
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = flatten(slice.call(arguments, 1), true, true, []);
return _.filter(array, function(value){
return !_.contains(rest, value);
});
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function(array) {
if (array == null) return [];
var length = _.max(arguments, 'length').length;
var results = Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(arguments, i);
}
return results;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
_.object = function(list, values) {
if (list == null) return {};
var result = {};
for (var i = 0, length = list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
};
// Return the position of the first occurrence of an item in an array,
// or -1 if the item is not included in the array.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i = 0, length = array.length;
if (isSorted) {
if (typeof isSorted == 'number') {
i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
} else {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
}
for (; i < length; i++) if (array[i] === item) return i;
return -1;
};
_.lastIndexOf = function(array, item, from) {
if (array == null) return -1;
var idx = array.length;
if (typeof from == 'number') {
idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
}
while (--idx >= 0) if (array[idx] === item) return idx;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = step || 1;
var length = Math.max(Math.ceil((stop - start) / step), 0);
var range = Array(length);
for (var idx = 0; idx < length; idx++, start += step) {
range[idx] = start;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Reusable constructor function for prototype setting.
var Ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
_.bind = function(func, context) {
var args, bound;
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
args = slice.call(arguments, 2);
bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
Ctor.prototype = func.prototype;
var self = new Ctor;
Ctor.prototype = null;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (_.isObject(result)) return result;
return self;
};
return bound;
};
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context. _ acts
// as a placeholder, allowing any combination of arguments to be pre-filled.
_.partial = function(func) {
var boundArgs = slice.call(arguments, 1);
return function() {
var position = 0;
var args = boundArgs.slice();
for (var i = 0, length = args.length; i < length; i++) {
if (args[i] === _) args[i] = arguments[position++];
}
while (position < arguments.length) args.push(arguments[position++]);
return func.apply(this, args);
};
};
// Bind a number of an object's methods to that object. Remaining arguments
// are the method names to be bound. Useful for ensuring that all callbacks
// defined on an object belong to it.
_.bindAll = function(obj) {
var i, length = arguments.length, key;
if (length <= 1) throw new Error('bindAll must be passed function names');
for (i = 1; i < length; i++) {
key = arguments[i];
obj[key] = _.bind(obj[key], obj);
}
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memoize = function(key) {
var cache = memoize.cache;
var address = hasher ? hasher.apply(this, arguments) : key;
if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
return cache[address];
};
memoize.cache = {};
return memoize;
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){
return func.apply(null, args);
}, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
// but if you'd like to disable the execution on the leading edge, pass
// `{leading: false}`. To disable execution on the trailing edge, ditto.
_.throttle = function(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function() {
previous = options.leading === false ? 0 : _.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
return function() {
var now = _.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, args, context, timestamp, result;
var later = function() {
var last = _.now() - timestamp;
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
};
return function() {
context = this;
args = arguments;
timestamp = _.now();
var callNow = immediate && !timeout;
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return _.partial(wrapper, func);
};
// Returns a negated version of the passed-in predicate.
_.negate = function(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var args = arguments;
var start = args.length - 1;
return function() {
var i = start;
var result = args[start].apply(this, arguments);
while (i--) result = args[i].call(this, result);
return result;
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
// Returns a function that will only be executed before being called N times.
_.before = function(times, func) {
var memo;
return function() {
if (--times > 0) {
memo = func.apply(this, arguments);
} else {
func = null;
}
return memo;
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = _.partial(_.before, 2);
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = function(obj) {
if (!_.isObject(obj)) return [];
if (nativeKeys) return nativeKeys(obj);
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys.push(key);
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var values = Array(length);
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
// Convert an object into a list of `[key, value]` pairs.
_.pairs = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var pairs = Array(length);
for (var i = 0; i < length; i++) {
pairs[i] = [keys[i], obj[keys[i]]];
}
return pairs;
};
// Invert the keys and values of an object. The values must be serializable.
_.invert = function(obj) {
var result = {};
var keys = _.keys(obj);
for (var i = 0, length = keys.length; i < length; i++) {
result[obj[keys[i]]] = keys[i];
}
return result;
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
if (!_.isObject(obj)) return obj;
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
if (hasOwnProperty.call(source, prop)) {
obj[prop] = source[prop];
}
}
}
return obj;
};
// Return a copy of the object only containing the whitelisted properties.
_.pick = function(obj, iteratee, context) {
var result = {}, key;
if (obj == null) return result;
if (_.isFunction(iteratee)) {
iteratee = createCallback(iteratee, context);
for (key in obj) {
var value = obj[key];
if (iteratee(value, key, obj)) result[key] = value;
}
} else {
var keys = concat.apply([], slice.call(arguments, 1));
obj = new Object(obj);
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
if (key in obj) result[key] = obj[key];
}
}
return result;
};
// Return a copy of the object without the blacklisted properties.
_.omit = function(obj, iteratee, context) {
if (_.isFunction(iteratee)) {
iteratee = _.negate(iteratee);
} else {
var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
iteratee = function(value, key) {
return !_.contains(keys, key);
};
}
return _.pick(obj, iteratee, context);
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
if (!_.isObject(obj)) return obj;
for (var i = 1, length = arguments.length; i < length; i++) {
var source = arguments[i];
for (var prop in source) {
if (obj[prop] === void 0) obj[prop] = source[prop];
}
}
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className !== toString.call(b)) return false;
switch (className) {
// Strings, numbers, regular expressions, dates, and booleans are compared by value.
case '[object RegExp]':
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return '' + a === '' + b;
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive.
// Object(NaN) is equivalent to NaN
if (+a !== +a) return +b !== +b;
// An `egal` comparison is performed for other numeric values.
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a === +b;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] === a) return bStack[length] === b;
}
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (
aCtor !== bCtor &&
// Handle Object.create(x) cases
'constructor' in a && 'constructor' in b &&
!(_.isFunction(aCtor) && aCtor instanceof aCtor &&
_.isFunction(bCtor) && bCtor instanceof bCtor)
) {
return false;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
var size, result;
// Recursively compare objects and arrays.
if (className === '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size === b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
if (!(result = eq(a[size], b[size], aStack, bStack))) break;
}
}
} else {
// Deep compare objects.
var keys = _.keys(a), key;
size = keys.length;
// Ensure that both objects contain the same number of properties before comparing deep equality.
result = _.keys(b).length === size;
if (result) {
while (size--) {
// Deep compare each member
key = keys[size];
if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
}
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return result;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, [], []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (obj == null) return true;
if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType === 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) === '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) === '[object ' + name + ']';
};
});
// Define a fallback version of the method in browsers (ahem, IE), where
// there isn't any inspectable "Arguments" type.
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return _.has(obj, 'callee');
};
}
// Optimize `isFunction` if appropriate. Work around an IE 11 bug.
if (typeof /./ !== 'function') {
_.isFunction = function(obj) {
return typeof obj == 'function' || false;
};
}
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj !== +obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
_.has = function(obj, key) {
return obj != null && hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iteratees.
_.identity = function(value) {
return value;
};
_.constant = function(value) {
return function() {
return value;
};
};
_.noop = function(){};
_.property = function(key) {
return function(obj) {
return obj[key];
};
};
// Returns a predicate for checking whether an object has a given set of `key:value` pairs.
_.matches = function(attrs) {
var pairs = _.pairs(attrs), length = pairs.length;
return function(obj) {
if (obj == null) return !length;
obj = new Object(obj);
for (var i = 0; i < length; i++) {
var pair = pairs[i], key = pair[0];
if (pair[1] !== obj[key] || !(key in obj)) return false;
}
return true;
};
};
// Run a function **n** times.
_.times = function(n, iteratee, context) {
var accum = Array(Math.max(0, n));
iteratee = createCallback(iteratee, context, 1);
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
return accum;
};
// Return a random integer between min and max (inclusive).
_.random = function(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
};
// A (possibly faster) way to get the current timestamp as an integer.
_.now = Date.now || function() {
return new Date().getTime();
};
// List of HTML entities for escaping.
var escapeMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
var unescapeMap = _.invert(escapeMap);
// Functions for escaping and unescaping strings to/from HTML interpolation.
var createEscaper = function(map) {
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped
var source = '(?:' + _.keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
return function(string) {
string = string == null ? '' : '' + string;
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
};
};
_.escape = createEscaper(escapeMap);
_.unescape = createEscaper(unescapeMap);
// If the value of the named `property` is a function then invoke it with the
// `object` as context; otherwise, return it.
_.result = function(object, property) {
if (object == null) return void 0;
var value = object[property];
return _.isFunction(value) ? object[property]() : value;
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
var escapeChar = function(match) {
return '\\' + escapes[match];
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
// NB: `oldSettings` only exists for backwards compatibility.
_.template = function(text, settings, oldSettings) {
if (!settings && oldSettings) settings = oldSettings;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset).replace(escaper, escapeChar);
index = offset + match.length;
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
} else if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
} else if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
// Adobe VMs need the match returned to produce the correct offest.
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + 'return __p;\n';
try {
var render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled source as a convenience for precompilation.
var argument = settings.variable || 'obj';
template.source = 'function(' + argument + '){\n' + source + '}';
return template;
};
// Add a "chain" function. Start chaining a wrapped Underscore object.
_.chain = function(obj) {
var instance = _(obj);
instance._chain = true;
return instance;
};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var result = function(obj) {
return this._chain ? _(obj).chain() : obj;
};
// Add your own custom functions to the Underscore object.
_.mixin = function(obj) {
_.each(_.functions(obj), function(name) {
var func = _[name] = obj[name];
_.prototype[name] = function() {
var args = [this._wrapped];
push.apply(args, arguments);
return result.call(this, func.apply(_, args));
};
});
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
var obj = this._wrapped;
method.apply(obj, arguments);
if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
return result.call(this, obj);
};
});
// Add all accessor Array functions to the wrapper.
_.each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
return result.call(this, method.apply(this._wrapped, arguments));
};
});
// Extracts the result from a wrapped and chained object.
_.prototype.value = function() {
return this._wrapped;
};
// AMD registration happens at the end for compatibility with AMD loaders
// that may not enforce next-turn semantics on modules. Even though general
// practice for AMD registration is to be anonymous, underscore registers
// as a named module because, like jQuery, it is a base library that is
// popular enough to be bundled in a third party lib, but not be part of
// an AMD load request. Those cases could generate an error when an
// anonymous define() is called outside of a loader request.
if (typeof define === 'function' && define.amd) {
define('underscore', [], function() {
return _;
});
}
}.call(this));
},{}],"zepto":[function(require,module,exports){
/* Zepto v1.1.4-76-g2bd5d7a - zepto event ajax callbacks deferred touch selector - zeptojs.com/license */
var Zepto=function(){function D(t){return null==t?String(t):j[S.call(t)]||"object"}function L(t){return"function"==D(t)}function k(t){return null!=t&&t==t.window}function Z(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function $(t){return"object"==D(t)}function F(t){return $(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function R(t){return"number"==typeof t.length}function q(t){return s.call(t,function(t){return null!=t})}function W(t){return t.length>0?n.fn.concat.apply([],t):t}function z(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function H(t){return t in c?c[t]:c[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function _(t,e){return"number"!=typeof e||l[z(t)]?e:e+"px"}function I(t){var e,n;return f[t]||(e=u.createElement(t),u.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),f[t]=n),f[t]}function U(t){return"children"in t?a.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,i=t?t.length:0;for(n=0;i>n;n++)this[n]=t[n];this.length=i,this.selector=e||""}function B(n,i,r){for(e in i)r&&(F(i[e])||A(i[e]))?(F(i[e])&&!F(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),B(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function V(t,e){return null==e?n(t):n(t).filter(e)}function Y(t,e,n,i){return L(e)?e.call(t,n,i):e}function J(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function G(e,n){var i=e.className||"",r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function K(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?n.parseJSON(t):t):t}catch(e){return t}}function Q(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)Q(t.childNodes[n],e)}var t,e,n,i,N,P,r=[],o=r.concat,s=r.filter,a=r.slice,u=window.document,f={},c={},l={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,d=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,m=/^(?:body|html)$/i,g=/([A-Z])/g,v=["val","css","html","text","data","width","height","offset"],y=["after","prepend","before","append"],w=u.createElement("table"),x=u.createElement("tr"),b={tr:u.createElement("tbody"),tbody:w,thead:w,tfoot:w,td:x,th:x,"*":u.createElement("div")},E=/complete|loaded|interactive/,T=/^[\w-]*$/,j={},S=j.toString,C={},O=u.createElement("div"),M={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},A=Array.isArray||function(t){return t instanceof Array};return C.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~C.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},N=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},P=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},C.fragment=function(e,i,r){var o,s,f;return p.test(e)&&(o=n(u.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(d,"<$1></$2>")),i===t&&(i=h.test(e)&&RegExp.$1),i in b||(i="*"),f=b[i],f.innerHTML=""+e,o=n.each(a.call(f.childNodes),function(){f.removeChild(this)})),F(r)&&(s=n(o),n.each(r,function(t,e){v.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},C.Z=function(t,e){return new X(t,e)},C.isZ=function(t){return t instanceof C.Z},C.init=function(e,i){var r;if(!e)return C.Z();if("string"==typeof e)if(e=e.trim(),"<"==e[0]&&h.test(e))r=C.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}else{if(L(e))return n(u).ready(e);if(C.isZ(e))return e;if(A(e))r=q(e);else if($(e))r=[e],e=null;else if(h.test(e))r=C.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}}return C.Z(r,e)},n=function(t,e){return C.init(t,e)},n.extend=function(t){var e,n=a.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){B(t,n,e)}),t},C.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],o=i||r?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:a.call(s&&!i&&t.getElementsByClassName?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=u.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},n.type=D,n.isFunction=L,n.isWindow=k,n.isArray=A,n.isPlainObject=F,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=N,n.trim=function(t){return null==t?"":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.noop=function(){},n.map=function(t,e){var n,r,o,i=[];if(R(t))for(r=0;r<t.length;r++)n=e(t[r],r),null!=n&&i.push(n);else for(o in t)n=e(t[o],o),null!=n&&i.push(n);return W(i)},n.each=function(t,e){var n,i;if(R(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(i in t)if(e.call(t[i],i,t[i])===!1)return t;return t},n.grep=function(t,e){return s.call(t,e)},window.JSON&&(n.parseJSON=JSON.parse),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){j["[object "+e+"]"]=e.toLowerCase()}),n.fn={constructor:C.Z,length:0,forEach:r.forEach,reduce:r.reduce,push:r.push,sort:r.sort,splice:r.splice,indexOf:r.indexOf,concat:function(){var t,e,n=[];for(t=0;t<arguments.length;t++)e=arguments[t],n[t]=C.isZ(e)?e.toArray():e;return o.apply(C.isZ(this)?this.toArray():this,n)},map:function(t){return n(n.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return n(a.apply(this,arguments))},ready:function(t){return E.test(u.readyState)&&u.body?t(n):u.addEventListener("DOMContentLoaded",function(){t(n)},!1),this},get:function(e){return e===t?a.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return L(t)?this.not(this.not(t)):n(s.call(this,function(e){return C.matches(e,t)}))},add:function(t,e){return n(P(this.concat(n(t,e))))},is:function(t){return this.length>0&&C.matches(this[0],t)},not:function(e){var i=[];if(L(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r="string"==typeof e?this.filter(e):R(e)&&L(e.item)?a.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return $(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!$(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!$(t)?t:n(t)},find:function(t){var e,i=this;return e=t?"object"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(C.qsa(this[0],t)):this.map(function(){return C.qsa(this,t)}):n()},closest:function(t,e){var i=this[0],r=!1;for("object"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:C.matches(i,t));)i=i!==e&&!Z(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!Z(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return V(e,t)},parent:function(t){return V(P(this.pluck("parentNode")),t)},children:function(t){return V(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||a.call(this.childNodes)})},siblings:function(t){return V(this.map(function(t,e){return s.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=L(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=L(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?"none"==i.css("display"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return n(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;n(this).empty().append(Y(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(n,i){var r;return"string"!=typeof n||1 in arguments?this.each(function(t){if(1===this.nodeType)if($(n))for(e in n)J(this,e,n[e]);else J(this,n,Y(this,i,t,this.getAttribute(n)))}):this.length&&1===this[0].nodeType?!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:t},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){J(this,t)},this)})},prop:function(t,e){return t=M[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(e,n){var i="data-"+e.replace(g,"-$1").toLowerCase(),r=1 in arguments?this.attr(i,n):this.attr(i);return null!==r?K(r):t},val:function(t){return 0 in arguments?this.each(function(e){this.value=Y(this,t,e,this.value)}):this[0]&&(this[0].multiple?n(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=Y(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(!this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,""),"string"==typeof t)return o.style[N(t)]||r.getPropertyValue(t);if(A(t)){var s={};return n.each(t,function(t,e){s[e]=o.style[N(e)]||r.getPropertyValue(e)}),s}}var a="";if("string"==D(t))i||0===i?a=z(t)+":"+_(t,i):this.each(function(){this.style.removeProperty(z(t))});else for(e in t)t[e]||0===t[e]?a+=z(e)+":"+_(e,t[e])+";":this.each(function(){this.style.removeProperty(z(e))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(G(t))},H(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){i=[];var r=G(this),o=Y(this,t,e,r);o.split(/\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&G(this,r+(r?" ":"")+i.join(" "))}}):this},removeClass:function(e){return this.each(function(n){if("className"in this){if(e===t)return G(this,"");i=G(this),Y(this,e,n,i).split(/\s+/g).forEach(function(t){i=i.replace(H(t)," ")}),G(this,i.trim())}})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=Y(this,e,r,G(this));s.split(/\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=m.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css("margin-top"))||0,i.left-=parseFloat(n(t).css("margin-left"))||0,r.top+=parseFloat(n(e[0]).css("border-top-width"))||0,r.left+=parseFloat(n(e[0]).css("border-left-width"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||u.body;t&&!m.test(t.nodeName)&&"static"==n(t).css("position");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,["width","height"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?k(s)?s["inner"+i]:Z(s)?s.documentElement["scroll"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,Y(this,r,t,s[e]()))})}}),y.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=D(e),"object"==t||"array"==t||null==e?e:C.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,a){o=i?a:a.parentNode,a=0==e?a.nextSibling:1==e?a.firstChild:2==e?a:null;var f=n.contains(u.documentElement,o);r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();o.insertBefore(t,a),f&&Q(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+"To":"insert"+(e?"Before":"After")]=function(e){return n(e)[t](this),this}}),C.Z.prototype=X.prototype=n.fn,C.uniq=P,C.deserializeValue=K,n.zepto=C,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function d(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\s/).forEach(function(i){if("ready"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=T(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),"addEventListener"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||"").split(/\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],"removeEventListener"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function T(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=w,r&&r.apply(i,arguments)},e[n]=x}),(i.defaultPrevented!==n?i.defaultPrevented:"returnValue"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function j(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===n||(i[e]=t[e]);return T(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return"string"==typeof t},s={},a={},u="onfocusin"in window,f={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){var s=2 in arguments&&i.call(arguments,2);if(r(e)){var a=function(){return e.apply(n,s?s.concat(i.call(arguments)):arguments)};return a._zid=l(e),a}if(o(n))return s?(s.unshift(e[n],e),t.proxy.apply(null,s)):t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var w=function(){return!0},x=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(u===n||a===!1)&&(u=a,a=n),u===!1&&(u=x),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(j(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=x),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):T(e),e._args=n,this.each(function(){e.type in f&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=j(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),T(n)}}(Zepto),function(t){function h(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function p(t,e,i,r){return t.global?h(e||n,i,r):void 0}function d(e){e.global&&0===t.active++&&p(e,null,"ajaxStart")}function m(e){e.global&&!--t.active&&p(e,null,"ajaxStop")}function g(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||p(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void p(e,n,"ajaxSend",[t,e])}function v(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),p(n,r,"ajaxSuccess",[e,n,t]),w(o,e,n)}function y(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),p(i,o,"ajaxError",[n,i,t||e]),w(e,n,i)}function w(t,e,n){var i=n.context;n.complete.call(i,e,t),p(n,i,"ajaxComplete",[e,n]),m(n)}function x(){}function b(t){return t&&(t=t.split(";",2)[0]),t&&(t==f?"html":t==u?"json":s.test(t)?"script":a.test(t)&&"xml")||"text"}function E(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function T(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=E(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function C(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(a||"object"==o||"array"==o?n:"")+"]"),!r&&s?e.add(u.name,u.value):"array"==o||!i&&"object"==o?C(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i,a=/^(?:text|application)\/xml/i,u="application/json",f="text/html",c=/^\s*$/,l=n.createElement("a");l.href=window.location.href,t.active=0,t.ajaxJSONP=function(i,r){if(!("type"in i))return t.ajax(i);var f,h,o=i.jsonpCallback,s=(t.isFunction(o)?o():o)||"jsonp"+ ++e,a=n.createElement("script"),u=window[s],c=function(e){t(a).triggerHandler("error",e||"abort")},l={abort:c};return r&&r.promise(l),t(a).on("load error",function(e,n){clearTimeout(h),t(a).off().remove(),"error"!=e.type&&f?v(f[0],l,i,r):y(null,n||"error",l,i,r),window[s]=u,f&&t.isFunction(u)&&u(f[0]),u=f=void 0}),g(l,i)===!1?(c("abort"),l):(window[s]=function(){f=arguments},a.src=i.url.replace(/\?(.+)=\?/,"?$1="+s),n.head.appendChild(a),i.timeout>0&&(h=setTimeout(function(){c("timeout")},i.timeout)),l)},t.ajaxSettings={type:"GET",beforeSend:x,success:x,error:x,complete:x,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:u,xml:"application/xml, text/xml",html:f,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var a,u,o=t.extend({},e||{}),s=t.Deferred&&t.Deferred();for(i in t.ajaxSettings)void 0===o[i]&&(o[i]=t.ajaxSettings[i]);d(o),o.crossDomain||(a=n.createElement("a"),a.href=o.url,a.href=a.href,o.crossDomain=l.protocol+"//"+l.host!=a.protocol+"//"+a.host),o.url||(o.url=window.location.toString()),(u=o.url.indexOf("#"))>-1&&(o.url=o.url.slice(0,u)),T(o);var f=o.dataType,h=/\?.+=\?/.test(o.url);if(h&&(f="jsonp"),o.cache!==!1&&(e&&e.cache===!0||"script"!=f&&"jsonp"!=f)||(o.url=E(o.url,"_="+Date.now())),"jsonp"==f)return h||(o.url=E(o.url,o.jsonp?o.jsonp+"=?":o.jsonp===!1?"":"callback=?")),t.ajaxJSONP(o,s);var N,p=o.accepts[f],m={},w=function(t,e){m[t.toLowerCase()]=[t,e]},j=/^([\w-]+:)\/\//.test(o.url)?RegExp.$1:window.location.protocol,S=o.xhr(),C=S.setRequestHeader;if(s&&s.promise(S),o.crossDomain||w("X-Requested-With","XMLHttpRequest"),w("Accept",p||"*/*"),(p=o.mimeType||p)&&(p.indexOf(",")>-1&&(p=p.split(",",2)[0]),S.overrideMimeType&&S.overrideMimeType(p)),(o.contentType||o.contentType!==!1&&o.data&&"GET"!=o.type.toUpperCase())&&w("Content-Type",o.contentType||"application/x-www-form-urlencoded"),o.headers)for(r in o.headers)w(r,o.headers[r]);if(S.setRequestHeader=w,S.onreadystatechange=function(){if(4==S.readyState){S.onreadystatechange=x,clearTimeout(N);var e,n=!1;if(S.status>=200&&S.status<300||304==S.status||0==S.status&&"file:"==j){f=f||b(o.mimeType||S.getResponseHeader("content-type")),e=S.responseText;try{"script"==f?(1,eval)(e):"xml"==f?e=S.responseXML:"json"==f&&(e=c.test(e)?null:t.parseJSON(e))}catch(i){n=i}n?y(n,"parsererror",S,o,s):v(e,S,o,s)}else y(S.statusText||null,S.status?"error":"abort",S,o,s)}},g(S,o)===!1)return S.abort(),y(null,"abort",S,o,s),S;if(o.xhrFields)for(r in o.xhrFields)S[r]=o.xhrFields[r];var P="async"in o?o.async:!0;S.open(o.type,o.url,P,o.username,o.password);for(r in m)C.apply(S,m[r]);return o.timeout>0&&(N=setTimeout(function(){S.onreadystatechange=x,S.abort(),y(null,"timeout",S,o,s)},o.timeout)),S.send(o.data?o.data:null),S},t.get=function(){return t.ajax(j.apply(null,arguments))},t.post=function(){var e=j.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=j.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var a,r=this,s=e.split(/\s/),u=j(e,n,i),f=u.success;return s.length>1&&(u.url=s[0],a=s[1]),u.success=function(e){r.html(a?t("<div>").html(e.replace(o,"")).find(a):e),f&&f.apply(r,arguments)},t.ajax(u),this};var S=encodeURIComponent;t.param=function(e,n){var i=[];return i.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(S(e)+"="+S(n))},C(i,e,n),i.join("&").replace(/%20/g,"+")}}(Zepto),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,i,r,o,s,a,u=[],f=!e.once&&[],c=function(t){for(n=e.memory&&t,i=!0,a=o||0,o=0,s=u.length,r=!0;u&&s>a;++a)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,u&&(f?f.length&&c(f.shift()):n?u.length=0:l.disable())},l={add:function(){if(u){var i=u.length,a=function(n){t.each(n,function(t,n){"function"==typeof n?e.unique&&l.has(n)||u.push(n):n&&n.length&&"string"!=typeof n&&a(n)})};a(arguments),r?s=u.length:n&&(o=i,c(n))}return this},remove:function(){return u&&t.each(arguments,function(e,n){for(var i;(i=t.inArray(n,u,i))>-1;)u.splice(i,1),r&&(s>=i&&--s,a>=i&&--a)}),this},has:function(e){return!(!u||!(e?t.inArray(e,u)>-1:u.length))},empty:function(){return s=u.length=0,this},disable:function(){return u=f=n=void 0,this},disabled:function(){return!u},lock:function(){return f=void 0,n||l.disable(),this},locked:function(){return!f},fireWith:function(t,e){return!u||i&&!f||(e=e||[],e=[t,e.slice?e.slice():e],r?f.push(e):c(e)),this},fire:function(){return l.fireWith(this,arguments)},fired:function(){return!!i}};return l}}(Zepto),function(t){function n(e){var i=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],r="pending",o={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return n(function(n){t.each(i,function(i,r){var a=t.isFunction(e[i])&&e[i];s[r[1]](function(){var e=a&&a.apply(this,arguments);if(e&&t.isFunction(e.promise))e.promise().done(n.resolve).fail(n.reject).progress(n.notify);else{var i=this===o?n.promise():this,s=a?[e]:arguments;n[r[0]+"With"](i,s)}})}),e=null}).promise()},promise:function(e){return null!=e?t.extend(e,o):o}},s={};return t.each(i,function(t,e){var n=e[2],a=e[3];o[e[1]]=n.add,a&&n.add(function(){r=a},i[1^t][2].disable,i[2][2].lock),s[e[0]]=function(){return s[e[0]+"With"](this===s?o:this,arguments),this},s[e[0]+"With"]=n.fireWith}),o.promise(s),e&&e.call(s,s),s}var e=Array.prototype.slice;t.when=function(i){var f,c,l,r=e.call(arguments),o=r.length,s=0,a=1!==o||i&&t.isFunction(i.promise)?o:0,u=1===a?i:n(),h=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?e.call(arguments):r,i===f?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(o>1)for(f=new Array(o),c=new Array(o),l=new Array(o);o>s;++s)r[s]&&t.isFunction(r[s].promise)?r[s].promise().done(h(s,l,r)).fail(u.reject).progress(h(s,c,f)):--a;return a||u.resolveWith(l,r),u.promise()},t.Deferred=n}(Zepto),function(t){function u(t,e,n,i){return Math.abs(t-e)>=Math.abs(n-i)?t-e>0?"Left":"Right":n-i>0?"Up":"Down"}function f(){o=null,e.last&&(e.el.trigger("longTap"),e={})}function c(){o&&clearTimeout(o),o=null}function l(){n&&clearTimeout(n),i&&clearTimeout(i),r&&clearTimeout(r),o&&clearTimeout(o),n=i=r=o=null,e={}}function h(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function p(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var n,i,r,o,a,e={},s=750;t(document).ready(function(){var d,m,y,w,g=0,v=0;"MSGesture"in window&&(a=new MSGesture,a.target=document.body),t(document).bind("MSGestureEnd",function(t){var n=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;n&&(e.el.trigger("swipe"),e.el.trigger("swipe"+n))}).on("touchstart MSPointerDown pointerdown",function(i){(!(w=p(i,"down"))||h(i))&&(y=w?i:i.touches[0],i.touches&&1===i.touches.length&&e.x2&&(e.x2=void 0,e.y2=void 0),d=Date.now(),m=d-(e.last||d),e.el=t("tagName"in y.target?y.target:y.target.parentNode),n&&clearTimeout(n),e.x1=y.pageX,e.y1=y.pageY,m>0&&250>=m&&(e.isDoubleTap=!0),e.last=d,o=setTimeout(f,s),a&&w&&a.addPointer(i.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(w=p(t,"move"))||h(t))&&(y=w?t:t.touches[0],c(),e.x2=y.pageX,e.y2=y.pageY,g+=Math.abs(e.x1-e.x2),v+=Math.abs(e.y1-e.y2))}).on("touchend MSPointerUp pointerup",function(o){(!(w=p(o,"up"))||h(o))&&(c(),e.x2&&Math.abs(e.x1-e.x2)>30||e.y2&&Math.abs(e.y1-e.y2)>30?r=setTimeout(function(){e.el.trigger("swipe"),e.el.trigger("swipe"+u(e.x1,e.x2,e.y1,e.y2)),e={}},0):"last"in e&&(30>g&&30>v?i=setTimeout(function(){var i=t.Event("tap");i.cancelTouch=l,e.el.trigger(i),e.isDoubleTap?(e.el&&e.el.trigger("doubleTap"),e={}):n=setTimeout(function(){n=null,e.el&&e.el.trigger("singleTap"),e={}},250)},0):e={}),g=v=0)}).on("touchcancel MSPointerCancel pointercancel",l),t(window).on("scroll",l)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(Zepto),function(t){function r(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function f(t,e){t=t.replace(/=#\]/g,'="#"]');var n,i,r=s.exec(t);if(r&&r[2]in o&&(n=o[r[2]],i=r[3],t=r[1],i)){var a=Number(i);i=isNaN(a)?i.replace(/^["']|["']$/g,""):a}return e(t,n,i)}var e=t.zepto,n=e.qsa,i=e.matches,o=t.expr[":"]={visible:function(){return r(this)?this:void 0},hidden:function(){return r(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,i){return t(this).text().indexOf(i)>-1?this:void 0},has:function(t,n,i){return e.qsa(this,i).length?this:void 0}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),a=/^\s*>/,u="Zepto"+ +new Date;e.qsa=function(i,r){return f(r,function(o,s,f){try{var c;!o&&s?o="*":a.test(o)&&(c=t(i).addClass(u),o="."+u+" "+o);var l=n(i,o)}catch(h){throw console.error("error performing selector: %o",r),h}finally{c&&c.removeClass(u)}return s?e.uniq(t.map(l,function(t,e){return s.call(t,e,l,f)})):l})},e.matches=function(t,e){return f(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(Zepto);
module.exports = Zepto;
},{}]},{},[3,1])
//# sourceMappingURL=clappr.map |
src/components/Board/addVideoIcon.js | motion123/mbookmakerUI | /**
* Created by tomihei on 17/03/21.
*/
import React from 'react';
import styles from './addVideoIcon.css';
import ContentAdd from 'material-ui/svg-icons/av/playlist-add';
import IconButton from 'material-ui/IconButton';
export default class AddVideo extends React.Component {
render() {
const {
openDialog,
urlId,
title,
pattern,
description,
} = this.props;
const postdata = {
url_id: urlId,
pattern: pattern,
video_title: title,
video_description: description,
};
return (
<IconButton
onTouchTap={() => openDialog(postdata)}
className={styles.buttonbox}
>
<ContentAdd/>
</IconButton>
);
}
}
|
Examples/UIExplorer/TabBarIOSExample.js | spicyj/react-native | /**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @flow
*/
'use strict';
var React = require('react-native');
var {
StyleSheet,
TabBarIOS,
Text,
View,
} = React;
var base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg==';
var TabBarExample = React.createClass({
statics: {
title: '<TabBarIOS>',
description: 'Tab-based navigation.',
},
displayName: 'TabBarExample',
getInitialState: function() {
return {
selectedTab: 'redTab',
notifCount: 0,
presses: 0,
};
},
_renderContent: function(color: string, pageText: string, num?: number) {
return (
<View style={[styles.tabContent, {backgroundColor: color}]}>
<Text style={styles.tabText}>{pageText}</Text>
<Text style={styles.tabText}>{num} re-renders of the {pageText}</Text>
</View>
);
},
render: function() {
return (
<TabBarIOS
tintColor="white"
barTintColor="darkslateblue">
<TabBarIOS.Item
title="Blue Tab"
icon={{uri: base64Icon, scale: 3}}
selected={this.state.selectedTab === 'blueTab'}
onPress={() => {
this.setState({
selectedTab: 'blueTab',
});
}}>
{this._renderContent('#414A8C', 'Blue Tab')}
</TabBarIOS.Item>
<TabBarIOS.Item
systemIcon="history"
badge={this.state.notifCount > 0 ? this.state.notifCount : undefined}
selected={this.state.selectedTab === 'redTab'}
onPress={() => {
this.setState({
selectedTab: 'redTab',
notifCount: this.state.notifCount + 1,
});
}}>
{this._renderContent('#783E33', 'Red Tab', this.state.notifCount)}
</TabBarIOS.Item>
<TabBarIOS.Item
icon={require('./flux.png')}
title="More"
selected={this.state.selectedTab === 'greenTab'}
onPress={() => {
this.setState({
selectedTab: 'greenTab',
presses: this.state.presses + 1
});
}}>
{this._renderContent('#21551C', 'Green Tab', this.state.presses)}
</TabBarIOS.Item>
</TabBarIOS>
);
},
});
var styles = StyleSheet.create({
tabContent: {
flex: 1,
alignItems: 'center',
},
tabText: {
color: 'white',
margin: 50,
},
});
module.exports = TabBarExample;
|
src/index.js | dcritchlow/reading-timer | import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';
import './index.css';
ReactDOM.render(
<App />,
document.getElementById('root')
);
|
ajax/libs/semantic-ui-react/0.67.2/semantic-ui-react.min.js | extend1994/cdnjs | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.semanticUIReact=t(require("React"),require("ReactDOM")):e.semanticUIReact=t(e.React,e.ReactDOM)}(this,function(e,t){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)}([/*!********************!*\
!*** ./src/umd.js ***!
\********************/
function(e,t,n){"use strict";function r(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}function o(e){return e&&e.__esModule?e:{default:e}}var a=n(/*! babel-runtime/helpers/extends */2),l=o(a),u=n(/*! ./index */382),s=r(u);e.exports=(0,l.default)({},s)},/*!************************!*\
!*** external "React" ***!
\************************/
function(t,n){t.exports=e},/*!********************************************!*\
!*** ./~/babel-runtime/helpers/extends.js ***!
\********************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/object/assign */424),a=r(o);t.default=a.default||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}},/*!******************************!*\
!*** ./~/process/browser.js ***!
\******************************/
function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function l(){m&&f&&(m=!1,f.length?y=f.concat(y):h=-1,y.length&&u())}function u(){if(!m){var e=o(l);m=!0;for(var t=y.length;t;){for(f=y,y=[];++h<t;)f&&f[h].run();h=-1,t=y.length}f=null,m=!1,a(e)}}function s(e,t){this.fun=e,this.array=t}function i(){}var c,d,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var f,y=[],m=!1,h=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new s(e,t)),1!==y.length||m||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=i,p.addListener=i,p.once=i,p.off=i,p.removeListener=i,p.removeAllListeners=i,p.emit=i,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},/*!**************************!*\
!*** ./src/lib/index.js ***!
\**************************/
function(e,t,n){"use strict";function r(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}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.objectDiff=t.numberToWord=t.numberToWordMap=t.keyboardKey=t.SUI=t.META=t.leven=t.isBrowser=t.partitionHTMLInputProps=t.htmlInputProps=t.htmlInputEvents=t.htmlInputAttrs=t.getElementType=t.getUnhandledProps=t.makeDebugger=t.debug=t.customPropTypes=t.useWidthProp=t.useVerticalAlignProp=t.useTextAlignProp=t.useOnlyProp=t.useValueAndKey=t.useKeyOrValueAndKey=t.useKeyOnly=t.childrenUtils=t.AutoControlledComponent=void 0;var a=n(/*! ./AutoControlledComponent */383);Object.defineProperty(t,"AutoControlledComponent",{enumerable:!0,get:function(){return o(a).default}});var l=n(/*! ./classNameBuilders */387);Object.defineProperty(t,"useKeyOnly",{enumerable:!0,get:function(){return l.useKeyOnly}}),Object.defineProperty(t,"useKeyOrValueAndKey",{enumerable:!0,get:function(){return l.useKeyOrValueAndKey}}),Object.defineProperty(t,"useValueAndKey",{enumerable:!0,get:function(){return l.useValueAndKey}}),Object.defineProperty(t,"useOnlyProp",{enumerable:!0,get:function(){return l.useOnlyProp}}),Object.defineProperty(t,"useTextAlignProp",{enumerable:!0,get:function(){return l.useTextAlignProp}}),Object.defineProperty(t,"useVerticalAlignProp",{enumerable:!0,get:function(){return l.useVerticalAlignProp}}),Object.defineProperty(t,"useWidthProp",{enumerable:!0,get:function(){return l.useWidthProp}});var u=n(/*! ./debug */389);Object.defineProperty(t,"debug",{enumerable:!0,get:function(){return u.debug}}),Object.defineProperty(t,"makeDebugger",{enumerable:!0,get:function(){return u.makeDebugger}});var s=n(/*! ./factories */390);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var i=n(/*! ./getUnhandledProps */392);Object.defineProperty(t,"getUnhandledProps",{enumerable:!0,get:function(){return o(i).default}});var c=n(/*! ./getElementType */391);Object.defineProperty(t,"getElementType",{enumerable:!0,get:function(){return o(c).default}});var d=n(/*! ./htmlInputPropsUtils */393);Object.defineProperty(t,"htmlInputAttrs",{enumerable:!0,get:function(){return d.htmlInputAttrs}}),Object.defineProperty(t,"htmlInputEvents",{enumerable:!0,get:function(){return d.htmlInputEvents}}),Object.defineProperty(t,"htmlInputProps",{enumerable:!0,get:function(){return d.htmlInputProps}}),Object.defineProperty(t,"partitionHTMLInputProps",{enumerable:!0,get:function(){return d.partitionHTMLInputProps}});var p=n(/*! ./isBrowser */223);Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o(p).default}});var f=n(/*! ./leven */224);Object.defineProperty(t,"leven",{enumerable:!0,get:function(){return o(f).default}});var y=n(/*! ./keyboardKey */394);Object.defineProperty(t,"keyboardKey",{enumerable:!0,get:function(){return o(y).default}});var m=n(/*! ./numberToWord */117);Object.defineProperty(t,"numberToWordMap",{enumerable:!0,get:function(){return m.numberToWordMap}}),Object.defineProperty(t,"numberToWord",{enumerable:!0,get:function(){return m.numberToWord}});var h=n(/*! ./objectDiff */395);Object.defineProperty(t,"objectDiff",{enumerable:!0,get:function(){return h.objectDiff}});var v=n(/*! ./childrenUtils */386),P=r(v),g=n(/*! ./customPropTypes */388),T=r(g),b=n(/*! ./META */384),O=r(b),_=n(/*! ./SUI */385),E=r(_);t.childrenUtils=P,t.customPropTypes=T,t.META=O,t.SUI=E},/*!*******************************!*\
!*** ./~/classnames/index.js ***!
\*******************************/
function(e,t,n){var r,o;/*!
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;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var l in r)a.call(r,l)&&r[l]&&e.push(l)}}return e.join(" ")}var a={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=n:(r=[],o=function(){return n}.apply(t,r),!(void 0!==o&&(e.exports=o)))}()},/*!***************************!*\
!*** ./~/lodash/isNil.js ***!
\***************************/
function(e,t){function n(e){return null==e}e.exports=n},/*!***************************************************!*\
!*** ./~/babel-runtime/helpers/classCallCheck.js ***!
\***************************************************/
function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},/*!************************************************!*\
!*** ./~/babel-runtime/helpers/createClass.js ***!
\************************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/object/define-property */426),a=r(o);t.default=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),(0,a.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},/*!*********************************************!*\
!*** ./~/babel-runtime/helpers/inherits.js ***!
\*********************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/object/set-prototype-of */429),a=r(o),l=n(/*! ../core-js/object/create */425),u=r(l),s=n(/*! ../helpers/typeof */56),i=r(s);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":(0,i.default)(t)));e.prototype=(0,u.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.default?(0,a.default)(e,t):e.__proto__=t)}},/*!**************************************************************!*\
!*** ./~/babel-runtime/helpers/possibleConstructorReturn.js ***!
\**************************************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../helpers/typeof */56),a=r(o);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":(0,a.default)(t))&&"function"!=typeof t?e:t}},/*!************************************!*\
!*** ./~/lodash/fp/placeholder.js ***!
\************************************/
function(e,t){e.exports={}},/*!*****************************!*\
!*** ./~/lodash/isArray.js ***!
\*****************************/
function(e,t){var n=Array.isArray;e.exports=n},/*!*****************************!*\
!*** ./~/lodash/without.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./_baseDifference */288),o=n(/*! ./_baseRest */35),a=n(/*! ./isArrayLikeObject */102),l=o(function(e,t){return a(e)?r(e,t):[]});e.exports=l},/*!********************************!*\
!*** ./~/lodash/fp/convert.js ***!
\********************************/
function(e,t,n){function r(e,t,n){return o(a,e,t,n)}var o=n(/*! ./_baseConvert */612),a=n(/*! ./_util */614);e.exports=r},/*!************************************!*\
!*** ./src/elements/Icon/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Icon */68),a=r(o);t.default=a.default},/*!*************************!*\
!*** ./~/lodash/map.js ***!
\*************************/
function(e,t,n){function r(e,t){var n=u(e)?o:l;return n(e,a(t,3))}var o=n(/*! ./_arrayMap */26),a=n(/*! ./_baseIteratee */22),l=n(/*! ./_baseMap */291),u=n(/*! ./isArray */12);e.exports=r},/*!********************************************!*\
!*** ./~/core-js/library/modules/_core.js ***!
\********************************************/
function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},/*!***************************!*\
!*** ./~/lodash/_root.js ***!
\***************************/
function(e,t,n){var r=n(/*! ./_freeGlobal */302),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},/*!******************************!*\
!*** ./~/lodash/isObject.js ***!
\******************************/
function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},/*!**************************!*\
!*** ./~/lodash/keys.js ***!
\**************************/
function(e,t,n){function r(e){return l(e)?o(e):a(e)}var o=n(/*! ./_arrayLikeKeys */284),a=n(/*! ./_baseKeys */161),l=n(/*! ./isArrayLike */23);e.exports=r},/*!*******************************************!*\
!*** ./~/core-js/library/modules/_wks.js ***!
\*******************************************/
function(e,t,n){var r=n(/*! ./_shared */144)("wks"),o=n(/*! ./_uid */76),a=n(/*! ./_global */31).Symbol,l="function"==typeof a,u=e.exports=function(e){return r[e]||(r[e]=l&&a[e]||(l?a:o)("Symbol."+e))};u.store=r},/*!***********************************!*\
!*** ./~/lodash/_baseIteratee.js ***!
\***********************************/
function(e,t,n){function r(e){return"function"==typeof e?e:null==e?l:"object"==typeof e?u(e)?a(e[0],e[1]):o(e):s(e)}var o=n(/*! ./_baseMatches */505),a=n(/*! ./_baseMatchesProperty */506),l=n(/*! ./identity */37),u=n(/*! ./isArray */12),s=n(/*! ./property */642);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/isArrayLike.js ***!
\*********************************/
function(e,t,n){function r(e){return null!=e&&a(e.length)&&!o(e)}var o=n(/*! ./isFunction */38),a=n(/*! ./isLength */175);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/isObjectLike.js ***!
\**********************************/
function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},/*!*******************************************!*\
!*** ./src/collections/Form/FormField.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.control,a=e.disabled,u=e.error,i=e.inline,y=e.label,h=e.required,P=e.type,g=e.width,T=(0,c.default)((0,f.useKeyOnly)(a,"disabled"),(0,f.useKeyOnly)(u,"error"),(0,f.useKeyOnly)(i,"inline"),(0,f.useKeyOnly)(h,"required"),(0,f.useWidthProp)(g,"wide"),"field",n),b=(0,f.getUnhandledProps)(o,e),O=(0,f.getElementType)(o,e);if((0,s.default)(r))return(0,s.default)(y)?p.default.createElement(O,(0,l.default)({},b,{className:T}),t):p.default.createElement(O,(0,l.default)({},b,{className:T}),(0,f.createHTMLLabel)(y));var _=(0,l.default)({},b,{children:t,required:h,type:P});return"input"!==r||"checkbox"!==P&&"radio"!==P?r===m.default||r===v.default?p.default.createElement(O,{className:T},(0,d.createElement)(r,(0,l.default)({},_,{label:y}))):p.default.createElement(O,{className:T},(0,f.createHTMLLabel)(y),(0,d.createElement)(r,_)):p.default.createElement(O,{className:T},p.default.createElement("label",null,(0,d.createElement)(r,_)," ",y))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../modules/Checkbox */72),m=r(y),h=n(/*! ../../addons/Radio */107),v=r(h);o.handledProps=["as","children","className","control","disabled","error","inline","label","required","type","width"],o._meta={name:"FormField",parent:"Form",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,control:f.customPropTypes.some([d.PropTypes.func,d.PropTypes.oneOf(["button","input","select","textarea"])]),disabled:d.PropTypes.bool,error:d.PropTypes.bool,inline:d.PropTypes.bool,label:d.PropTypes.oneOfType([d.PropTypes.node,d.PropTypes.object]),required:d.PropTypes.bool,type:f.customPropTypes.every([f.customPropTypes.demand(["control"])]),width:d.PropTypes.oneOf(f.SUI.WIDTHS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************!*\
!*** ./~/lodash/_arrayMap.js ***!
\*******************************/
function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}e.exports=n},/*!**************************************!*\
!*** ./~/lodash/fp/_falseOptions.js ***!
\**************************************/
function(e,t){e.exports={cap:!1,curry:!1,fixed:!1,immutable:!1,rearg:!1}},/*!*******************************!*\
!*** ./~/lodash/toInteger.js ***!
\*******************************/
function(e,t,n){function r(e){var t=o(e),n=t%1;return t===t?n?t-n:t:0}var o=n(/*! ./toFinite */344);e.exports=r},/*!******************************!*\
!*** ./~/lodash/toString.js ***!
\******************************/
function(e,t,n){function r(e){return null==e?"":o(e)}var o=n(/*! ./_baseToString */163);e.exports=r},/*!**********************************************!*\
!*** ./~/core-js/library/modules/_export.js ***!
\**********************************************/
function(e,t,n){var r=n(/*! ./_global */31),o=n(/*! ./_core */17),a=n(/*! ./_ctx */135),l=n(/*! ./_hide */48),u="prototype",s=function(e,t,n){var i,c,d,p=e&s.F,f=e&s.G,y=e&s.S,m=e&s.P,h=e&s.B,v=e&s.W,P=f?o:o[t]||(o[t]={}),g=P[u],T=f?r:y?r[t]:(r[t]||{})[u];f&&(n=t);for(i in n)c=!p&&T&&void 0!==T[i],c&&i in P||(d=c?T[i]:n[i],P[i]=f&&"function"!=typeof T[i]?n[i]:h&&c?a(d,r):v&&T[i]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[u]=e[u],t}(d):m&&"function"==typeof d?a(Function.call,d):d,m&&((P.virtual||(P.virtual={}))[i]=d,e&s.R&&g&&!g[i]&&l(g,i,d)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},/*!**********************************************!*\
!*** ./~/core-js/library/modules/_global.js ***!
\**********************************************/
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)},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_object-dp.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_an-object */40),o=n(/*! ./_ie8-dom-define */270),a=n(/*! ./_to-primitive */146),l=Object.defineProperty;t.f=n(/*! ./_descriptors */41)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),o)try{return l(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}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_to-iobject.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_iobject */271),o=n(/*! ./_defined */136);e.exports=function(e){return r(o(e))}},/*!*********************************!*\
!*** ./~/lodash/_baseGetTag.js ***!
\*********************************/
function(e,t,n){function r(e){return null==e?void 0===e?s:u:i&&i in Object(e)?a(e):l(e)}var o=n(/*! ./_Symbol */50),a=n(/*! ./_getRawTag */555),l=n(/*! ./_objectToString */586),u="[object Null]",s="[object Undefined]",i=o?o.toStringTag:void 0;e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_baseRest.js ***!
\*******************************/
function(e,t,n){function r(e,t){return l(a(e,t,o),e+"")}var o=n(/*! ./identity */37),a=n(/*! ./_overRest */315),l=n(/*! ./_setToString */170);e.exports=r},/*!****************************!*\
!*** ./~/lodash/_toKey.js ***!
\****************************/
function(e,t,n){function r(e){if("string"==typeof e||o(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}var o=n(/*! ./isSymbol */45),a=1/0;e.exports=r},/*!******************************!*\
!*** ./~/lodash/identity.js ***!
\******************************/
function(e,t){function n(e){return e}e.exports=n},/*!********************************!*\
!*** ./~/lodash/isFunction.js ***!
\********************************/
function(e,t,n){function r(e){if(!a(e))return!1;var t=o(e);return t==u||t==s||t==l||t==i}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isObject */19),l="[object AsyncFunction]",u="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";e.exports=r},/*!******************************************************!*\
!*** ./~/babel-runtime/helpers/toConsumableArray.js ***!
\******************************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/array/from */421),a=r(o);t.default=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(0,a.default)(e)}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_an-object.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_is-object */57);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_descriptors.js ***!
\***************************************************/
function(e,t,n){e.exports=!n(/*! ./_fails */47)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},/*!*******************************************!*\
!*** ./~/core-js/library/modules/_has.js ***!
\*******************************************/
function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},/*!*******************************!*\
!*** ./~/lodash/_castPath.js ***!
\*******************************/
function(e,t,n){function r(e,t){return o(e)?e:a(e,t)?[e]:l(u(e))}var o=n(/*! ./isArray */12),a=n(/*! ./_isKey */169),l=n(/*! ./_stringToPath */321),u=n(/*! ./toString */29);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_getNative.js ***!
\********************************/
function(e,t,n){function r(e,t){var n=a(e,t);return o(n)?n:void 0}var o=n(/*! ./_baseIsNative */501),a=n(/*! ./_getValue */556);e.exports=r},/*!******************************!*\
!*** ./~/lodash/isSymbol.js ***!
\******************************/
function(e,t,n){function r(e){return"symbol"==typeof e||a(e)&&o(e)==l}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isObjectLike */24),l="[object Symbol]";e.exports=r},/*!*************************************!*\
!*** ./src/elements/Image/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Image */212),a=r(o);t.default=a.default},/*!*********************************************!*\
!*** ./~/core-js/library/modules/_fails.js ***!
\*********************************************/
function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},/*!********************************************!*\
!*** ./~/core-js/library/modules/_hide.js ***!
\********************************************/
function(e,t,n){var r=n(/*! ./_object-dp */32),o=n(/*! ./_property-desc */59);e.exports=n(/*! ./_descriptors */41)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_iterators.js ***!
\*************************************************/
function(e,t){e.exports={}},/*!*****************************!*\
!*** ./~/lodash/_Symbol.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./_root */18),o=r.Symbol;e.exports=o},/*!*******************************!*\
!*** ./~/lodash/_baseEach.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./_baseForOwn */159),o=n(/*! ./_createBaseEach */539),a=o(r);e.exports=a},/*!*********************************!*\
!*** ./~/lodash/_copyObject.js ***!
\*********************************/
function(e,t,n){function r(e,t,n,r){var l=!n;n||(n={});for(var u=-1,s=t.length;++u<s;){var i=t[u],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),l?a(n,i,c):o(n,i,c)}return n}var o=n(/*! ./_assignValue */83),a=n(/*! ./_baseAssignValue */157);e.exports=r},/*!*************************!*\
!*** ./~/lodash/get.js ***!
\*************************/
function(e,t,n){function r(e,t,n){var r=null==e?void 0:o(e,t);return void 0===r?n:r}var o=n(/*! ./_baseGet */86);e.exports=r},/*!*************************!*\
!*** ./~/lodash/has.js ***!
\*************************/
function(e,t,n){function r(e,t){return null!=e&&a(e,t,o)}var o=n(/*! ./_baseHas */492),a=n(/*! ./_hasPath */307);e.exports=r},/*!******************************!*\
!*** ./~/lodash/includes.js ***!
\******************************/
function(e,t,n){function r(e,t,n,r){e=a(e)?e:s(e),n=n&&!r?u(n):0;var c=e.length;return n<0&&(n=i(c+n,0)),l(e)?n<=c&&e.indexOf(t,n)>-1:!!c&&o(e,t,n)>-1}var o=n(/*! ./_baseIndexOf */87),a=n(/*! ./isArrayLike */23),l=n(/*! ./isString */335),u=n(/*! ./toInteger */28),s=n(/*! ./values */178),i=Math.max;e.exports=r},/*!*******************************************!*\
!*** ./~/babel-runtime/helpers/typeof.js ***!
\*******************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/symbol/iterator */431),a=r(o),l=n(/*! ../core-js/symbol */430),u=r(l),s="function"==typeof u.default&&"symbol"==typeof a.default?function(e){return typeof e}:function(e){return e&&"function"==typeof u.default&&e.constructor===u.default&&e!==u.default.prototype?"symbol":typeof e};t.default="function"==typeof u.default&&"symbol"===s(a.default)?function(e){return"undefined"==typeof e?"undefined":s(e)}:function(e){return e&&"function"==typeof u.default&&e.constructor===u.default&&e!==u.default.prototype?"symbol":"undefined"==typeof e?"undefined":s(e)}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_is-object.js ***!
\*************************************************/
function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_object-keys.js ***!
\***************************************************/
function(e,t,n){var r=n(/*! ./_object-keys-internal */275),o=n(/*! ./_enum-bug-keys */137);e.exports=Object.keys||function(e){return r(e,o)}},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/_property-desc.js ***!
\*****************************************************/
function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},/*!********************************!*\
!*** ./~/lodash/_arrayEach.js ***!
\********************************/
function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_baseCreate.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./isObject */19),o=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},/*!******************************!*\
!*** ./~/lodash/_isIndex.js ***!
\******************************/
function(e,t){function n(e,t){return t=null==t?r:t,!!t&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&e<t}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_isPrototype.js ***!
\**********************************/
function(e,t){function n(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||r;return e===n}var r=Object.prototype;e.exports=n},/*!************************!*\
!*** ./~/lodash/eq.js ***!
\************************/
function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},/*!******************************!*\
!*** ./~/lodash/isBuffer.js ***!
\******************************/
function(e,t,n){(function(e){var r=n(/*! ./_root */18),o=n(/*! ./stubFalse */647),a="object"==typeof t&&t&&!t.nodeType&&t,l=a&&"object"==typeof e&&e&&!e.nodeType&&e,u=l&&l.exports===a,s=u?r.Buffer:void 0,i=s?s.isBuffer:void 0,c=i||o;e.exports=c}).call(t,n(/*! ./../webpack/buildin/module.js */179)(e))},/*!************************************!*\
!*** ./src/addons/Portal/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Portal */347),a=r(o);t.default=a.default},/*!********************************************!*\
!*** ./src/collections/Table/TableCell.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.children,r=e.className,a=e.collapsing,u=e.content,s=e.disabled,i=e.error,d=e.icon,f=e.negative,h=e.positive,P=e.selectable,g=e.singleLine,T=e.textAlign,b=e.verticalAlign,O=e.warning,_=e.width,E=(0,p.default)((0,m.useKeyOnly)(t,"active"),(0,m.useKeyOnly)(a,"collapsing"),(0,m.useKeyOnly)(s,"disabled"),(0,m.useKeyOnly)(i,"error"),(0,m.useKeyOnly)(f,"negative"),(0,m.useKeyOnly)(h,"positive"),(0,m.useKeyOnly)(P,"selectable"),(0,m.useKeyOnly)(g,"single line"),(0,m.useKeyOnly)(O,"warning"),(0,m.useTextAlignProp)(T),(0,m.useVerticalAlignProp)(b),(0,m.useWidthProp)(_,"wide"),r),N=(0,m.getUnhandledProps)(o,e),S=(0,m.getElementType)(o,e);return(0,c.default)(n)?y.default.createElement(S,(0,l.default)({},N,{className:E}),v.default.create(d),u):y.default.createElement(S,(0,l.default)({},N,{className:E}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ../../elements/Icon */15),v=r(h);o.handledProps=["active","as","children","className","collapsing","content","disabled","error","icon","negative","positive","selectable","singleLine","textAlign","verticalAlign","warning","width"],o._meta={name:"TableCell",type:m.META.TYPES.COLLECTION,parent:"Table"},o.defaultProps={as:"td"},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,active:f.PropTypes.bool,children:f.PropTypes.node,className:f.PropTypes.string,collapsing:f.PropTypes.bool,content:m.customPropTypes.contentShorthand,disabled:f.PropTypes.bool,error:f.PropTypes.bool,icon:m.customPropTypes.itemShorthand,negative:f.PropTypes.bool,positive:f.PropTypes.bool,selectable:f.PropTypes.bool,singleLine:f.PropTypes.bool,textAlign:f.PropTypes.oneOf((0,s.default)(m.SUI.TEXT_ALIGNMENTS,"justified")),verticalAlign:f.PropTypes.oneOf(m.SUI.VERTICAL_ALIGNMENTS),warning:f.PropTypes.bool,width:f.PropTypes.oneOf(m.SUI.WIDTHS)}:void 0,o.create=(0,m.createShorthandFactory)(o,function(e){return{content:e}},!0),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************!*\
!*** ./src/elements/Icon/Icon.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.bordered,n=e.circular,r=e.className,a=e.color,u=e.corner,s=e.disabled,i=e.fitted,d=e.flipped,y=e.inverted,m=e.link,h=e.loading,v=e.name,P=e.rotated,g=e.size,T=(0,c.default)(a,v,g,(0,f.useKeyOnly)(t,"bordered"),(0,f.useKeyOnly)(n,"circular"),(0,f.useKeyOnly)(u,"corner"),(0,f.useKeyOnly)(s,"disabled"),(0,f.useKeyOnly)(i,"fitted"),(0,f.useKeyOnly)(y,"inverted"),(0,f.useKeyOnly)(m,"link"),(0,f.useKeyOnly)(h,"loading"),(0,f.useValueAndKey)(d,"flipped"),(0,f.useValueAndKey)(P,"rotated"),"icon",r),b=(0,f.getUnhandledProps)(o,e),O=(0,f.getElementType)(o,e);return p.default.createElement(O,(0,l.default)({},b,{"aria-hidden":"true",className:T}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./IconGroup */211),m=r(y);o.handledProps=["as","bordered","circular","className","color","corner","disabled","fitted","flipped","inverted","link","loading","name","rotated","size"],o.Group=m.default,o._meta={name:"Icon",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,bordered:d.PropTypes.bool,circular:d.PropTypes.bool,className:d.PropTypes.string,color:d.PropTypes.oneOf(f.SUI.COLORS),corner:d.PropTypes.bool,disabled:d.PropTypes.bool,fitted:d.PropTypes.bool,flipped:d.PropTypes.oneOf(["horizontally","vertically"]),inverted:d.PropTypes.bool,link:d.PropTypes.bool,loading:d.PropTypes.bool,name:f.customPropTypes.suggest(f.SUI.ALL_ICONS_IN_ALL_CONTEXTS),rotated:d.PropTypes.oneOf(["clockwise","counterclockwise"]),size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium"))}:void 0,o.defaultProps={as:"i"},o.create=(0,f.createShorthandFactory)(o,function(e){return{name:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/elements/Label/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Label */112),a=r(o);t.default=a.default},/*!**********************************************!*\
!*** ./src/elements/List/ListDescription.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)(n,"description"),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ListDescription",parent:"List",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*****************************************!*\
!*** ./src/elements/List/ListHeader.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("header",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ListHeader",parent:"List",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/modules/Checkbox/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Checkbox */397),a=r(o);t.default=a.default},/*!************************************!*\
!*** ./src/views/Feed/FeedDate.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("date",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"FeedDate",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_object-pie.js ***!
\**************************************************/
function(e,t){t.f={}.propertyIsEnumerable},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_to-object.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_defined */136);e.exports=function(e){return Object(r(e))}},/*!*******************************************!*\
!*** ./~/core-js/library/modules/_uid.js ***!
\*******************************************/
function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},/*!**********************************************************!*\
!*** ./~/core-js/library/modules/es6.string.iterator.js ***!
\**********************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_string-at */461)(!0);n(/*! ./_iter-define */272)(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})})},/*!********************************!*\
!*** ./~/lodash/_ListCache.js ***!
\********************************/
function(e,t,n){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 o=n(/*! ./_listCacheClear */571),a=n(/*! ./_listCacheDelete */572),l=n(/*! ./_listCacheGet */573),u=n(/*! ./_listCacheHas */574),s=n(/*! ./_listCacheSet */575);r.prototype.clear=o,r.prototype.delete=a,r.prototype.get=l,r.prototype.has=u,r.prototype.set=s,e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_SetCache.js ***!
\*******************************/
function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new o;++t<n;)this.add(e[t])}var o=n(/*! ./_MapCache */153),a=n(/*! ./_setCacheAdd */589),l=n(/*! ./_setCacheHas */590);r.prototype.add=r.prototype.push=a,r.prototype.has=l,e.exports=r},/*!****************************!*\
!*** ./~/lodash/_apply.js ***!
\****************************/
function(e,t){function n(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)}e.exports=n},/*!************************************!*\
!*** ./~/lodash/_arrayIncludes.js ***!
\************************************/
function(e,t,n){function r(e,t){var n=null==e?0:e.length;return!!n&&o(e,t,0)>-1}var o=n(/*! ./_baseIndexOf */87);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_arrayReduce.js ***!
\**********************************/
function(e,t){function n(e,t,n,r){var o=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);return n}e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_assignValue.js ***!
\**********************************/
function(e,t,n){function r(e,t,n){var r=e[t];u.call(e,t)&&a(r,n)&&(void 0!==n||t in e)||o(e,t,n)}var o=n(/*! ./_baseAssignValue */157),a=n(/*! ./eq */64),l=Object.prototype,u=l.hasOwnProperty;e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_assocIndexOf.js ***!
\***********************************/
function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}var o=n(/*! ./eq */64);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseFlatten.js ***!
\**********************************/
function(e,t,n){function r(e,t,n,l,u){var s=-1,i=e.length;for(n||(n=a),u||(u=[]);++s<i;){var c=e[s];t>0&&n(c)?t>1?r(c,t-1,n,l,u):o(u,c):l||(u[u.length]=c)}return u}var o=n(/*! ./_arrayPush */156),a=n(/*! ./_isFlattenable */568);e.exports=r},/*!******************************!*\
!*** ./~/lodash/_baseGet.js ***!
\******************************/
function(e,t,n){function r(e,t){t=o(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[a(t[n++])];return n&&n==r?e:void 0}var o=n(/*! ./_castPath */43),a=n(/*! ./_toKey */36);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseIndexOf.js ***!
\**********************************/
function(e,t,n){function r(e,t,n){return t===t?l(e,t,n):o(e,a,n)}var o=n(/*! ./_baseFindIndex */289),a=n(/*! ./_baseIsNaN */500),l=n(/*! ./_strictIndexOf */596);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseSlice.js ***!
\********************************/
function(e,t){function n(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}e.exports=n},/*!********************************!*\
!*** ./~/lodash/_baseUnary.js ***!
\********************************/
function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_cacheHas.js ***!
\*******************************/
function(e,t){function n(e,t){return e.has(t)}e.exports=n},/*!********************************!*\
!*** ./~/lodash/_copyArray.js ***!
\********************************/
function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_createCtor.js ***!
\*********************************/
function(e,t,n){function r(e){return function(){var t=arguments;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]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=o(e.prototype),r=e.apply(n,t);return a(r)?r:n}}var o=n(/*! ./_baseCreate */61),a=n(/*! ./isObject */19);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_createWrap.js ***!
\*********************************/
function(e,t,n){function r(e,t,n,r,O,_,E,N){var S=t&h;if(!S&&"function"!=typeof e)throw new TypeError(y);var M=r?r.length:0;if(M||(t&=~(g|T),r=O=void 0),E=void 0===E?E:b(f(E),0),N=void 0===N?N:f(N),M-=O?O.length:0,t&T){var x=r,w=O;r=O=void 0}var C=S?void 0:i(e),I=[e,t,n,r,O,x,w,_,E,N];if(C&&c(I,C),e=I[0],t=I[1],n=I[2],r=I[3],O=I[4],N=I[9]=void 0===I[9]?S?0:e.length:b(I[9]-M,0),!N&&t&(v|P)&&(t&=~(v|P)),t&&t!=m)A=t==v||t==P?l(e,t,N):t!=g&&t!=(m|g)||O.length?u.apply(void 0,I):s(e,t,n,r);else var A=a(e,t,n);var j=C?o:d;return p(j(A,I),e,t)}var o=n(/*! ./_baseSetData */292),a=n(/*! ./_createBind */541),l=n(/*! ./_createCurry */544),u=n(/*! ./_createHybrid */298),s=n(/*! ./_createPartial */547),i=n(/*! ./_getData */165),c=n(/*! ./_mergeData */582),d=n(/*! ./_setData */317),p=n(/*! ./_setWrapToString */318),f=n(/*! ./toInteger */28),y="Expected a function",m=1,h=2,v=8,P=16,g=32,T=64,b=Math.max;e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_flatRest.js ***!
\*******************************/
function(e,t,n){function r(e){return l(a(e,void 0,o),e+"")}var o=n(/*! ./flatten */610),a=n(/*! ./_overRest */315),l=n(/*! ./_setToString */170);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_getMapData.js ***!
\*********************************/
function(e,t,n){function r(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}var o=n(/*! ./_isKeyable */569);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_getPrototype.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./_overArg */314),o=r(Object.getPrototypeOf,Object);e.exports=o},/*!*************************************!*\
!*** ./~/lodash/_isIterateeCall.js ***!
\*************************************/
function(e,t,n){function r(e,t,n){if(!u(n))return!1;var r=typeof t;return!!("number"==r?a(n)&&l(t,n.length):"string"==r&&t in n)&&o(n[t],e)}var o=n(/*! ./eq */64),a=n(/*! ./isArrayLike */23),l=n(/*! ./_isIndex */62),u=n(/*! ./isObject */19);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_nativeCreate.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=r(Object,"create");e.exports=o},/*!*************************************!*\
!*** ./~/lodash/_replaceHolders.js ***!
\*************************************/
function(e,t){function n(e,t){for(var n=-1,o=e.length,a=0,l=[];++n<o;){var u=e[n];u!==t&&u!==r||(e[n]=r,l[a++]=n)}return l}var r="__lodash_placeholder__";e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_setToArray.js ***!
\*********************************/
function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/isArguments.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./_baseIsArguments */497),o=n(/*! ./isObjectLike */24),a=Object.prototype,l=a.hasOwnProperty,u=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&l.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},/*!***************************************!*\
!*** ./~/lodash/isArrayLikeObject.js ***!
\***************************************/
function(e,t,n){function r(e){return a(e)&&o(e)}var o=n(/*! ./isArrayLike */23),a=n(/*! ./isObjectLike */24);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/isPlainObject.js ***!
\***********************************/
function(e,t,n){function r(e){if(!l(e)||o(e)!=u)return!1;var t=a(e);if(null===t)return!0;var n=d.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./_getPrototype */96),l=n(/*! ./isObjectLike */24),u="[object Object]",s=Function.prototype,i=Object.prototype,c=s.toString,d=i.hasOwnProperty,p=c.call(Object);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/isTypedArray.js ***!
\**********************************/
function(e,t,n){var r=n(/*! ./_baseIsTypedArray */502),o=n(/*! ./_baseUnary */89),a=n(/*! ./_nodeUtil */585),l=a&&a.isTypedArray,u=l?o(l):r;e.exports=u},/*!*********************************!*\
!*** ./~/lodash/isUndefined.js ***!
\*********************************/
function(e,t){function n(e){return void 0===e}e.exports=n},/*!******************************!*\
!*** ./~/lodash/toNumber.js ***!
\******************************/
function(e,t,n){function r(e){if("number"==typeof e)return e;if(a(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(u,"");var n=i.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):s.test(e)?l:+e}var o=n(/*! ./isObject */19),a=n(/*! ./isSymbol */45),l=NaN,u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt;e.exports=r},/*!***********************************!*\
!*** ./src/addons/Radio/index.js ***!
\***********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Radio */348),a=r(o);t.default=a.default},/*!************************************************!*\
!*** ./src/collections/Message/MessageItem.js ***!
\************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("content",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"MessageItem",parent:"Message",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.itemShorthand}:void 0,o.defaultProps={as:"li"},o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}},!0),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/collections/Table/TableHeader.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.fullWidth,a=(0,s.default)((0,d.useKeyOnly)(r,"full-width"),n),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","fullWidth"],o._meta={name:"TableHeader",type:d.META.TYPES.COLLECTION,parent:"Table"},o.defaultProps={as:"thead"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,fullWidth:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/elements/Button/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Button */204),a=r(o);t.default=a.default},/*!*************************************!*\
!*** ./src/elements/Input/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Input */370),a=r(o);t.default=a.default},/*!*************************************!*\
!*** ./src/elements/Label/Label.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isUndefined */105),m=r(y),h=n(/*! lodash/isNil */6),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=n(/*! ../Icon/Icon */68),E=r(_),N=n(/*! ../Image/Image */212),S=r(N),M=n(/*! ./LabelDetail */214),x=r(M),w=n(/*! ./LabelGroup */215),C=r(w),I=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},r.handleRemove=function(e){var t=r.props.onRemove;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.attached,o=e.basic,l=e.children,u=e.circular,s=e.className,i=e.color,c=e.content,d=e.corner,p=e.detail,f=e.empty,y=e.floating,h=e.horizontal,P=e.icon,T=e.image,_=e.onRemove,N=e.pointing,M=e.removeIcon,w=e.ribbon,C=e.size,I=e.tag,A=N===!0&&"pointing"||("left"===N||"right"===N)&&N+" pointing"||("above"===N||"below"===N)&&"pointing "+N,j=(0,g.default)("ui",i,A,C,(0,O.useKeyOnly)(n,"active"),(0,O.useKeyOnly)(o,"basic"),(0,O.useKeyOnly)(u,"circular"),(0,O.useKeyOnly)(f,"empty"),(0,O.useKeyOnly)(y,"floating"),(0,O.useKeyOnly)(h,"horizontal"),(0,O.useKeyOnly)(T===!0,"image"),(0,O.useKeyOnly)(I,"tag"),(0,O.useKeyOrValueAndKey)(d,"corner"),(0,O.useKeyOrValueAndKey)(w,"ribbon"),(0,O.useValueAndKey)(r,"attached"),"label",s),k=(0,O.getUnhandledProps)(t,this.props),D=(0,O.getElementType)(t,this.props);if(!(0,v.default)(l))return b.default.createElement(D,(0,a.default)({},k,{className:j,onClick:this.handleClick}),l);var L=(0,m.default)(M)?"delete":M;return b.default.createElement(D,(0,a.default)({className:j,onClick:this.handleClick},k),E.default.create(P),"boolean"!=typeof T&&S.default.create(T),c,(0,O.createShorthand)(x.default,function(e){return{content:e}},p),_&&E.default.create(L,{onClick:this.handleRemove}))}}]),t}(T.Component);I._meta={name:"Label",type:O.META.TYPES.ELEMENT},I.Detail=x.default,I.Group=C.default,t.default=I,"production"!==e.env.NODE_ENV?I.propTypes={as:O.customPropTypes.as,active:T.PropTypes.bool,attached:T.PropTypes.oneOf(["top","bottom","top right","top left","bottom left","bottom right"]),basic:T.PropTypes.bool,children:T.PropTypes.node,circular:T.PropTypes.bool,className:T.PropTypes.string,color:T.PropTypes.oneOf(O.SUI.COLORS),content:O.customPropTypes.contentShorthand,corner:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["left","right"])]),detail:O.customPropTypes.itemShorthand,empty:O.customPropTypes.every([T.PropTypes.bool,O.customPropTypes.demand(["circular"])]),floating:T.PropTypes.bool,horizontal:T.PropTypes.bool,icon:O.customPropTypes.itemShorthand,image:T.PropTypes.oneOfType([T.PropTypes.bool,O.customPropTypes.itemShorthand]),onClick:T.PropTypes.func,onRemove:T.PropTypes.func,pointing:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["above","below","left","right"])]),removeIcon:O.customPropTypes.itemShorthand,ribbon:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["right"])]),size:T.PropTypes.oneOf(O.SUI.SIZES),tag:T.PropTypes.bool}:void 0,I.handledProps=["active","as","attached","basic","children","circular","className","color","content","corner","detail","empty","floating","horizontal","icon","image","onClick","onRemove","pointing","removeIcon","ribbon","size","tag"],I.create=(0,O.createShorthandFactory)(I,function(e){return{content:e}})}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/elements/List/ListContent.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.description,u=e.floated,i=e.header,d=e.verticalAlign,y=(0,c.default)((0,f.useValueAndKey)(u,"floated"),(0,f.useVerticalAlignProp)(d),"content",n),h=(0,f.getUnhandledProps)(o,e),P=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(P,(0,l.default)({},h,{className:y}),v.default.create(i),m.default.create(a),r):p.default.createElement(P,(0,l.default)({},h,{className:y}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./ListDescription */70),m=r(y),h=n(/*! ./ListHeader */71),v=r(h);o.handledProps=["as","children","className","content","description","floated","header","verticalAlign"],o._meta={name:"ListContent",parent:"List",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,description:f.customPropTypes.itemShorthand,floated:d.PropTypes.oneOf(f.SUI.FLOATS),header:f.customPropTypes.itemShorthand,verticalAlign:d.PropTypes.oneOf(f.SUI.VERTICAL_ALIGNMENTS)}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/List/ListIcon.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.verticalAlign,r=(0,s.default)((0,d.useVerticalAlignProp)(n),t),a=(0,d.getUnhandledProps)(o,e);return c.default.createElement(f.default,(0,l.default)({},a,{className:r}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=n(/*! ../Icon/Icon */68),f=r(p);o.handledProps=["className","verticalAlign"],o._meta={name:"ListIcon",parent:"List",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={className:i.PropTypes.string,verticalAlign:i.PropTypes.oneOf(d.SUI.VERTICAL_ALIGNMENTS)}:void 0,o.create=(0,d.createShorthandFactory)(o,function(e){return{name:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/elements/Step/StepDescription.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.description,a=(0,c.default)("description",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","description"],o._meta={name:"StepDescription",parent:"Step",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,className:d.PropTypes.string,children:d.PropTypes.node,description:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!****************************************!*\
!*** ./src/elements/Step/StepTitle.js ***!
\****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.title,a=(0,c.default)("title",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","title"],o._meta={name:"StepTitle",parent:"Step",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,className:d.PropTypes.string,children:d.PropTypes.node,title:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************!*\
!*** ./src/lib/numberToWord.js ***!
\*********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t="undefined"==typeof e?"undefined":(0,l.default)(e);return"string"===t||"number"===t?u[e]||e:""}Object.defineProperty(t,"__esModule",{value:!0}),t.numberToWordMap=void 0;var a=n(/*! babel-runtime/helpers/typeof */56),l=r(a);t.numberToWord=o;var u=t.numberToWordMap={1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven",12:"twelve",13:"thirteen",14:"fourteen",15:"fifteen",16:"sixteen"}},/*!***************************************!*\
!*** ./src/modules/Dropdown/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Dropdown */399),a=r(o);t.default=a.default},/*!*******************************************!*\
!*** ./src/views/Card/CardDescription.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)(n,"description"),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"CardDescription",parent:"Card",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/views/Card/CardHeader.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)(n,"header"),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"CardHeader",parent:"Card",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Card/CardMeta.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)(n,"meta"),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"CardMeta",parent:"Card",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/views/Feed/FeedContent.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.extraImages,u=e.extraText,i=e.date,d=e.meta,y=e.summary,h=(0,c.default)("content",n),P=(0,f.getUnhandledProps)(o,e),T=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(T,(0,l.default)({},P,{className:h}),(0,f.createShorthand)(m.default,function(e){return{content:e}},i),(0,f.createShorthand)(b.default,function(e){return{content:e}},y),r,(0,f.createShorthand)(v.default,function(e){return{text:!0,content:e}},u),(0,f.createShorthand)(v.default,function(e){return{images:e}},a),(0,f.createShorthand)(g.default,function(e){return{content:e}},d)):p.default.createElement(T,(0,l.default)({},P,{className:h}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./FeedDate */73),m=r(y),h=n(/*! ./FeedExtra */123),v=r(h),P=n(/*! ./FeedMeta */126),g=r(P),T=n(/*! ./FeedSummary */127),b=r(T);o.handledProps=["as","children","className","content","date","extraImages","extraText","meta","summary"],o._meta={name:"FeedContent",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,date:f.customPropTypes.itemShorthand,extraImages:v.default.propTypes.images,extraText:f.customPropTypes.itemShorthand,meta:f.customPropTypes.itemShorthand,summary:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Feed/FeedExtra.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.images,u=e.text,i=(0,p.default)((0,m.useKeyOnly)(a,"images"),(0,m.useKeyOnly)(r||u,"text"),"extra",n),d=(0,m.getUnhandledProps)(o,e),f=(0,m.getElementType)(o,e);if(!(0,c.default)(t))return y.default.createElement(f,(0,l.default)({},d,{className:i}),t);var h=(0,s.default)(a,function(e,t){var n=[t,e].join("-");return(0,m.createHTMLImage)(e,{key:n})});return y.default.createElement(f,(0,l.default)({},d,{className:i}),r,h)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/map */16),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4);o.handledProps=["as","children","className","content","images","text"],o._meta={name:"FeedExtra",parent:"Feed",type:m.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,children:f.PropTypes.node,className:f.PropTypes.string,content:m.customPropTypes.contentShorthand,images:m.customPropTypes.every([m.customPropTypes.disallow(["text"]),f.PropTypes.oneOfType([f.PropTypes.bool,m.customPropTypes.collectionShorthand])]),text:f.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Feed/FeedLabel.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.icon,u=e.image,i=(0,c.default)("label",n),d=(0,f.getUnhandledProps)(o,e),y=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(y,(0,l.default)({},d,{className:i}),r,m.default.create(a),(0,f.createHTMLImage)(u)):p.default.createElement(y,(0,l.default)({},d,{className:i}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../elements/Icon */15),m=r(y);o.handledProps=["as","children","className","content","icon","image"],o._meta={name:"FeedLabel",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,icon:f.customPropTypes.itemShorthand,image:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Feed/FeedLike.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.icon,u=(0,c.default)("like",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(d,(0,l.default)({},i,{className:u}),m.default.create(a),r):p.default.createElement(d,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../elements/Icon */15),m=r(y);o.handledProps=["as","children","className","content","icon"],o._meta={name:"FeedLike",parent:"Feed",type:f.META.TYPES.VIEW},o.defaultProps={as:"a"},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,icon:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Feed/FeedMeta.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.like,u=(0,c.default)("meta",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(d,(0,l.default)({},i,{className:u}),(0,f.createShorthand)(m.default,function(e){return{content:e}},a),r):p.default.createElement(d,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./FeedLike */125),m=r(y);o.handledProps=["as","children","className","content","like"],o._meta={name:"FeedMeta",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,like:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/views/Feed/FeedSummary.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.date,u=e.user,i=(0,c.default)("summary",n),d=(0,f.getUnhandledProps)(o,e),y=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(y,(0,l.default)({},d,{className:i}),(0,f.createShorthand)(v.default,function(e){return{content:e}},u),r,(0,f.createShorthand)(m.default,function(e){return{content:e}},a)):p.default.createElement(y,(0,l.default)({},d,{className:i}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./FeedDate */73),m=r(y),h=n(/*! ./FeedUser */128),v=r(h);o.handledProps=["as","children","className","content","date","user"],o._meta={name:"FeedSummary",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,date:f.customPropTypes.itemShorthand,user:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Feed/FeedUser.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("user",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"FeedUser",parent:"Feed",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.defaultProps={as:"a"},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/views/Item/ItemDescription.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("description",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ItemDescription",parent:"Item",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Item/ItemExtra.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("extra",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ItemExtra",parent:"Item",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/views/Item/ItemHeader.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("header",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ItemHeader",parent:"Item",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Item/ItemMeta.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("meta",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ItemMeta",parent:"Item",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************************************!*\
!*** ./~/babel-runtime/helpers/objectWithoutProperties.js ***!
\************************************************************/
function(e,t){"use strict";t.__esModule=!0,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}},/*!*******************************************!*\
!*** ./~/core-js/library/modules/_cof.js ***!
\*******************************************/
function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},/*!*******************************************!*\
!*** ./~/core-js/library/modules/_ctx.js ***!
\*******************************************/
function(e,t,n){var r=n(/*! ./_a-function */443);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,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},/*!***********************************************!*\
!*** ./~/core-js/library/modules/_defined.js ***!
\***********************************************/
function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/_enum-bug-keys.js ***!
\*****************************************************/
function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},/*!***********************************************!*\
!*** ./~/core-js/library/modules/_library.js ***!
\***********************************************/
function(e,t){e.exports=!0},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/_object-create.js ***!
\*****************************************************/
function(e,t,n){var r=n(/*! ./_an-object */40),o=n(/*! ./_object-dps */458),a=n(/*! ./_enum-bug-keys */137),l=n(/*! ./_shared-key */143)("IE_PROTO"),u=function(){},s="prototype",i=function(){var e,t=n(/*! ./_dom-create */269)("iframe"),r=a.length,o="<",l=">";for(t.style.display="none",n(/*! ./_html */448).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+l+"document.F=Object"+o+"/script"+l),e.close(),i=e.F;r--;)delete i[s][a[r]];return i()};e.exports=Object.create||function(e,t){var n;return null!==e?(u[s]=r(e),n=new u,u[s]=null,n[l]=e):n=i(),void 0===t?n:o(n,t)}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_object-gopd.js ***!
\***************************************************/
function(e,t,n){var r=n(/*! ./_object-pie */74),o=n(/*! ./_property-desc */59),a=n(/*! ./_to-iobject */33),l=n(/*! ./_to-primitive */146),u=n(/*! ./_has */42),s=n(/*! ./_ie8-dom-define */270),i=Object.getOwnPropertyDescriptor;t.f=n(/*! ./_descriptors */41)?i:function(e,t){if(e=a(e),t=l(t,!0),s)try{return i(e,t)}catch(e){}if(u(e,t))return o(!r.f.call(e,t),e[t])}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_object-gops.js ***!
\***************************************************/
function(e,t){t.f=Object.getOwnPropertySymbols},/*!*********************************************************!*\
!*** ./~/core-js/library/modules/_set-to-string-tag.js ***!
\*********************************************************/
function(e,t,n){var r=n(/*! ./_object-dp */32).f,o=n(/*! ./_has */42),a=n(/*! ./_wks */21)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_shared-key.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_shared */144)("keys"),o=n(/*! ./_uid */76);e.exports=function(e){return r[e]||(r[e]=o(e))}},/*!**********************************************!*\
!*** ./~/core-js/library/modules/_shared.js ***!
\**********************************************/
function(e,t,n){var r=n(/*! ./_global */31),o="__core-js_shared__",a=r[o]||(r[o]={});e.exports=function(e){return a[e]||(a[e]={})}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_to-integer.js ***!
\**************************************************/
function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},/*!****************************************************!*\
!*** ./~/core-js/library/modules/_to-primitive.js ***!
\****************************************************/
function(e,t,n){var r=n(/*! ./_is-object */57);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_wks-define.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_global */31),o=n(/*! ./_core */17),a=n(/*! ./_library */138),l=n(/*! ./_wks-ext */148),u=n(/*! ./_object-dp */32).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:l.f(e)})}},/*!***********************************************!*\
!*** ./~/core-js/library/modules/_wks-ext.js ***!
\***********************************************/
function(e,t,n){t.f=n(/*! ./_wks */21)},/*!*******************************************************!*\
!*** ./~/core-js/library/modules/web.dom.iterable.js ***!
\*******************************************************/
function(e,t,n){n(/*! ./es6.array.iterator */466);for(var r=n(/*! ./_global */31),o=n(/*! ./_hide */48),a=n(/*! ./_iterators */49),l=n(/*! ./_wks */21)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],s=0;s<5;s++){var i=u[s],c=r[i],d=c&&c.prototype;d&&!d[l]&&o(d,l,i),a[i]=a.Array}},/*!**********************************!*\
!*** ./~/lodash/_LazyWrapper.js ***!
\**********************************/
function(e,t,n){function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l,this.__views__=[]}var o=n(/*! ./_baseCreate */61),a=n(/*! ./_baseLodash */162),l=4294967295;r.prototype=o(a.prototype),r.prototype.constructor=r,e.exports=r},/*!************************************!*\
!*** ./~/lodash/_LodashWrapper.js ***!
\************************************/
function(e,t,n){function r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}var o=n(/*! ./_baseCreate */61),a=n(/*! ./_baseLodash */162);r.prototype=o(a.prototype),r.prototype.constructor=r,e.exports=r},/*!**************************!*\
!*** ./~/lodash/_Map.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=n(/*! ./_root */18),a=r(o,"Map");e.exports=a},/*!*******************************!*\
!*** ./~/lodash/_MapCache.js ***!
\*******************************/
function(e,t,n){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 o=n(/*! ./_mapCacheClear */576),a=n(/*! ./_mapCacheDelete */577),l=n(/*! ./_mapCacheGet */578),u=n(/*! ./_mapCacheHas */579),s=n(/*! ./_mapCacheSet */580);r.prototype.clear=o,r.prototype.delete=a,r.prototype.get=l,r.prototype.has=u,r.prototype.set=s,e.exports=r},/*!****************************!*\
!*** ./~/lodash/_Stack.js ***!
\****************************/
function(e,t,n){function r(e){var t=this.__data__=new o(e);this.size=t.size}var o=n(/*! ./_ListCache */78),a=n(/*! ./_stackClear */591),l=n(/*! ./_stackDelete */592),u=n(/*! ./_stackGet */593),s=n(/*! ./_stackHas */594),i=n(/*! ./_stackSet */595);r.prototype.clear=a,r.prototype.delete=l,r.prototype.get=u,r.prototype.has=s,r.prototype.set=i,e.exports=r},/*!****************************************!*\
!*** ./~/lodash/_arrayIncludesWith.js ***!
\****************************************/
function(e,t){function n(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}e.exports=n},/*!********************************!*\
!*** ./~/lodash/_arrayPush.js ***!
\********************************/
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},/*!**************************************!*\
!*** ./~/lodash/_baseAssignValue.js ***!
\**************************************/
function(e,t,n){function r(e,t,n){"__proto__"==t&&o?o(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var o=n(/*! ./_defineProperty */300);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseClone.js ***!
\********************************/
function(e,t,n){function r(e,t,n,M,x,w){var C,j=t&_,k=t&E,L=t&N;if(n&&(C=x?n(e,M,x,w):n(e)),void 0!==C)return C;if(!b(e))return e;var K=g(e);if(K){if(C=h(e),!j)return c(e,C)}else{var U=m(e),V=U==I||U==A;if(T(e))return i(e,j);if(U==D||U==S||V&&!x){if(C=k||V?{}:P(e),!j)return k?p(e,s(C,e)):d(e,u(C,e))}else{if(!J[U])return x?e:{};C=v(e,U,r,j)}}w||(w=new o);var R=w.get(e);if(R)return R;w.set(e,C);var z=L?k?y:f:k?keysIn:O,F=K?void 0:z(e);return a(F||e,function(o,a){F&&(a=o,o=e[a]),l(C,a,r(o,t,n,a,e,w))}),C}var o=n(/*! ./_Stack */154),a=n(/*! ./_arrayEach */60),l=n(/*! ./_assignValue */83),u=n(/*! ./_baseAssign */286),s=n(/*! ./_baseAssignIn */487),i=n(/*! ./_cloneBuffer */525),c=n(/*! ./_copyArray */91),d=n(/*! ./_copySymbols */534),p=n(/*! ./_copySymbolsIn */535),f=n(/*! ./_getAllKeys */303),y=n(/*! ./_getAllKeysIn */304),m=n(/*! ./_getTag */168),h=n(/*! ./_initCloneArray */564),v=n(/*! ./_initCloneByTag */565),P=n(/*! ./_initCloneObject */566),g=n(/*! ./isArray */12),T=n(/*! ./isBuffer */65),b=n(/*! ./isObject */19),O=n(/*! ./keys */20),_=1,E=2,N=4,S="[object Arguments]",M="[object Array]",x="[object Boolean]",w="[object Date]",C="[object Error]",I="[object Function]",A="[object GeneratorFunction]",j="[object Map]",k="[object Number]",D="[object Object]",L="[object RegExp]",K="[object Set]",U="[object String]",V="[object Symbol]",R="[object WeakMap]",z="[object ArrayBuffer]",F="[object DataView]",W="[object Float32Array]",B="[object Float64Array]",Y="[object Int8Array]",H="[object Int16Array]",q="[object Int32Array]",G="[object Uint8Array]",Z="[object Uint8ClampedArray]",$="[object Uint16Array]",X="[object Uint32Array]",J={};J[S]=J[M]=J[z]=J[F]=J[x]=J[w]=J[W]=J[B]=J[Y]=J[H]=J[q]=J[j]=J[k]=J[D]=J[L]=J[K]=J[U]=J[V]=J[G]=J[Z]=J[$]=J[X]=!0,J[C]=J[I]=J[R]=!1,e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseForOwn.js ***!
\*********************************/
function(e,t,n){function r(e,t){return e&&o(e,t,a)}var o=n(/*! ./_baseFor */491),a=n(/*! ./keys */20);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseIsEqual.js ***!
\**********************************/
function(e,t,n){function r(e,t,n,l,u){return e===t||(null==e||null==t||!a(e)&&!a(t)?e!==e&&t!==t:o(e,t,n,l,r,u))}var o=n(/*! ./_baseIsEqualDeep */498),a=n(/*! ./isObjectLike */24);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_baseKeys.js ***!
\*******************************/
function(e,t,n){function r(e){if(!o(e))return a(e);var t=[];for(var n in Object(e))u.call(e,n)&&"constructor"!=n&&t.push(n);return t}var o=n(/*! ./_isPrototype */63),a=n(/*! ./_nativeKeys */583),l=Object.prototype,u=l.hasOwnProperty;e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseLodash.js ***!
\*********************************/
function(e,t){function n(){}e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_baseToString.js ***!
\***********************************/
function(e,t,n){function r(e){if("string"==typeof e)return e;if(l(e))return a(e,r)+"";if(u(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}var o=n(/*! ./_Symbol */50),a=n(/*! ./_arrayMap */26),l=n(/*! ./isArray */12),u=n(/*! ./isSymbol */45),s=1/0,i=o?o.prototype:void 0,c=i?i.toString:void 0;e.exports=r},/*!***************************************!*\
!*** ./~/lodash/_cloneArrayBuffer.js ***!
\***************************************/
function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new o(t).set(new o(e)),t}var o=n(/*! ./_Uint8Array */281);e.exports=r},/*!******************************!*\
!*** ./~/lodash/_getData.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_metaMap */313),o=n(/*! ./noop */338),a=r?function(e){return r.get(e)}:o;e.exports=a},/*!********************************!*\
!*** ./~/lodash/_getHolder.js ***!
\********************************/
function(e,t){function n(e){var t=e;return t.placeholder}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_getSymbols.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./_arrayFilter */283),o=n(/*! ./stubArray */342),a=Object.prototype,l=a.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=u?function(e){return null==e?[]:(e=Object(e),r(u(e),function(t){return l.call(e,t)}))}:o;e.exports=s},/*!*****************************!*\
!*** ./~/lodash/_getTag.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./_DataView */479),o=n(/*! ./_Map */152),a=n(/*! ./_Promise */481),l=n(/*! ./_Set */280),u=n(/*! ./_WeakMap */282),s=n(/*! ./_baseGetTag */34),i=n(/*! ./_toSource */322),c="[object Map]",d="[object Object]",p="[object Promise]",f="[object Set]",y="[object WeakMap]",m="[object DataView]",h=i(r),v=i(o),P=i(a),g=i(l),T=i(u),b=s;(r&&b(new r(new ArrayBuffer(1)))!=m||o&&b(new o)!=c||a&&b(a.resolve())!=p||l&&b(new l)!=f||u&&b(new u)!=y)&&(b=function(e){var t=s(e),n=t==d?e.constructor:void 0,r=n?i(n):"";if(r)switch(r){case h:return m;case v:return c;case P:return p;case g:return f;case T:return y}return t}),e.exports=b},/*!****************************!*\
!*** ./~/lodash/_isKey.js ***!
\****************************/
function(e,t,n){function r(e,t){if(o(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!a(e))||(u.test(e)||!l.test(e)||null!=t&&e in Object(t))}var o=n(/*! ./isArray */12),a=n(/*! ./isSymbol */45),l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_setToString.js ***!
\**********************************/
function(e,t,n){var r=n(/*! ./_baseSetToString */515),o=n(/*! ./_shortOut */319),a=o(r);e.exports=a},/*!**************************!*\
!*** ./~/lodash/each.js ***!
\**************************/
function(e,t,n){e.exports=n(/*! ./forEach */329)},/*!****************************!*\
!*** ./~/lodash/invoke.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./_baseInvoke */496),o=n(/*! ./_baseRest */35),a=o(r);e.exports=a},/*!*****************************!*\
!*** ./~/lodash/isEmpty.js ***!
\*****************************/
function(e,t,n){function r(e){if(null==e)return!0;if(s(e)&&(u(e)||"string"==typeof e||"function"==typeof e.splice||i(e)||d(e)||l(e)))return!e.length;var t=a(e);if(t==p||t==f)return!e.size;if(c(e))return!o(e).length;for(var n in e)if(m.call(e,n))return!1;return!0}var o=n(/*! ./_baseKeys */161),a=n(/*! ./_getTag */168),l=n(/*! ./isArguments */101),u=n(/*! ./isArray */12),s=n(/*! ./isArrayLike */23),i=n(/*! ./isBuffer */65),c=n(/*! ./_isPrototype */63),d=n(/*! ./isTypedArray */104),p="[object Map]",f="[object Set]",y=Object.prototype,m=y.hasOwnProperty;e.exports=r},/*!*****************************!*\
!*** ./~/lodash/isEqual.js ***!
\*****************************/
function(e,t,n){function r(e,t){return o(e,t)}var o=n(/*! ./_baseIsEqual */160);e.exports=r},/*!******************************!*\
!*** ./~/lodash/isLength.js ***!
\******************************/
function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},/*!**************************!*\
!*** ./~/lodash/omit.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_arrayMap */26),o=n(/*! ./_baseClone */158),a=n(/*! ./_baseUnset */520),l=n(/*! ./_castPath */43),u=n(/*! ./_copyObject */52),s=n(/*! ./_customOmitClone */550),i=n(/*! ./_flatRest */94),c=n(/*! ./_getAllKeysIn */304),d=1,p=2,f=4,y=i(function(e,t){var n={};if(null==e)return n;var i=!1;t=r(t,function(t){return t=l(t,e),i||(i=t.length>1),t}),u(e,c(e),n),i&&(n=o(n,d|p|f,s));for(var y=t.length;y--;)a(n,t[y]);return n});e.exports=y},/*!**************************!*\
!*** ./~/lodash/pick.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_basePick */508),o=n(/*! ./_flatRest */94),a=o(function(e,t){return null==e?{}:r(e,t)});e.exports=a},/*!****************************!*\
!*** ./~/lodash/values.js ***!
\****************************/
function(e,t,n){function r(e){return null==e?[]:o(e,a(e))}var o=n(/*! ./_baseValues */521),a=n(/*! ./keys */20);e.exports=r},/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},/*!************************************!*\
!*** ./src/addons/Select/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Select */349),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/addons/TextArea/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./TextArea */350),a=r(o);t.default=a.default},/*!*********************************************************!*\
!*** ./src/collections/Breadcrumb/BreadcrumbDivider.js ***!
\*********************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.icon,u=(0,c.default)("divider",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e),y=m.default.create(a,(0,l.default)({},i,{className:u}));if(y)return y;var h=r;return(0,s.default)(r)&&(h=(0,s.default)(t)?"/":t),p.default.createElement(d,(0,l.default)({},i,{className:u}),h)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../elements/Icon */15),m=r(y);o.handledProps=["as","children","className","content","icon"],o._meta={name:"BreadcrumbDivider",type:f.META.TYPES.COLLECTION,parent:"Breadcrumb"},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,icon:f.customPropTypes.itemShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{icon:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************************************!*\
!*** ./src/collections/Breadcrumb/BreadcrumbSection.js ***!
\*********************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.content,u=e.href,s=e.link,i=e.onClick,c=(0,v.default)((0,T.useKeyOnly)(n,"active"),"section",o),d=(0,T.getUnhandledProps)(t,this.props),p=(0,T.getElementType)(t,this.props,function(){if(s||i)return"a"});return g.default.createElement(p,(0,a.default)({},d,{className:c,href:u,onClick:this.handleClick}),(0,m.default)(r)?l:r)}}]),t}(P.Component);b._meta={name:"BreadcrumbSection",type:T.META.TYPES.COLLECTION,parent:"Breadcrumb"},t.default=b,"production"!==e.env.NODE_ENV?b.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,content:T.customPropTypes.contentShorthand,href:T.customPropTypes.every([T.customPropTypes.disallow(["link"]),P.PropTypes.string]),link:T.customPropTypes.every([T.customPropTypes.disallow(["href"]),P.PropTypes.bool]),onClick:P.PropTypes.func}:void 0,b.handledProps=["active","as","children","className","content","href","link","onClick"],b.create=(0,T.createShorthandFactory)(b,function(e){return{content:e,link:!0}},!0)}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/collections/Form/FormButton.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../elements/Button */110),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormButton",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/collections/Form/FormCheckbox.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../modules/Checkbox */72),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormCheckbox",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/collections/Form/FormDropdown.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../modules/Dropdown */118),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormDropdown",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/collections/Form/FormGroup.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.grouped,a=e.inline,l=e.widths,u=(0,c.default)((0,f.useKeyOnly)(r,"grouped"),(0,f.useKeyOnly)(a,"inline"),(0,f.useWidthProp)(l,null,!0),"fields",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return p.default.createElement(d,(0,s.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/toConsumableArray */39),l=r(a),u=n(/*! babel-runtime/helpers/extends */2),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","grouped","inline","widths"],o._meta={name:"FormGroup",parent:"Form",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,grouped:f.customPropTypes.every([f.customPropTypes.disallow(["inline"]),d.PropTypes.bool]),inline:f.customPropTypes.every([f.customPropTypes.disallow(["grouped"]),d.PropTypes.bool]),widths:d.PropTypes.oneOf([].concat((0,l.default)(f.SUI.WIDTHS),["equal"]))}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/collections/Form/FormInput.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../elements/Input */111),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormInput",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/collections/Form/FormRadio.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../addons/Radio */107),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormRadio",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/collections/Form/FormSelect.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../addons/Select */180),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormSelect",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/collections/Form/FormTextArea.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.control,n=(0,i.getUnhandledProps)(o,e),r=(0,i.getElementType)(o,e);return s.default.createElement(r,(0,l.default)({},n,{control:t}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../addons/TextArea */181),d=r(c),p=n(/*! ./FormField */25),f=r(p);o.handledProps=["as","control"],o._meta={name:"FormTextArea",parent:"Form",type:i.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:i.customPropTypes.as,control:f.default.propTypes.control}:void 0,o.defaultProps={as:f.default,control:d.default},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/collections/Grid/GridColumn.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.computer,a=e.color,u=e.floated,i=e.largeScreen,p=e.mobile,f=e.only,y=e.stretched,m=e.tablet,h=e.textAlign,v=e.verticalAlign,P=e.widescreen,g=e.width,T=(0,s.default)(a,(0,d.useKeyOnly)(y,"stretched"),(0,d.useOnlyProp)(f,"only"),(0,d.useTextAlignProp)(h),(0,d.useValueAndKey)(u,"floated"),(0,d.useVerticalAlignProp)(v),(0,d.useWidthProp)(r,"wide computer"),(0,d.useWidthProp)(i,"wide large screen"),(0,d.useWidthProp)(p,"wide mobile"),(0,d.useWidthProp)(m,"wide tablet"),(0,d.useWidthProp)(P,"wide widescreen"),(0,d.useWidthProp)(g,"wide"),"column",n),b=(0,d.getUnhandledProps)(o,e),O=(0,d.getElementType)(o,e);return c.default.createElement(O,(0,l.default)({},b,{className:T}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","color","computer","floated","largeScreen","mobile","only","stretched","tablet","textAlign","verticalAlign","widescreen","width"],o._meta={name:"GridColumn",parent:"Grid",type:d.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,color:i.PropTypes.oneOf(d.SUI.COLORS),computer:i.PropTypes.oneOf(d.SUI.WIDTHS),floated:i.PropTypes.oneOf(d.SUI.FLOATS),largeScreen:i.PropTypes.oneOf(d.SUI.WIDTHS),mobile:i.PropTypes.oneOf(d.SUI.WIDTHS),only:d.customPropTypes.onlyProp(d.SUI.VISIBILITY),stretched:i.PropTypes.bool,tablet:i.PropTypes.oneOf(d.SUI.WIDTHS),textAlign:i.PropTypes.oneOf(d.SUI.TEXT_ALIGNMENTS),verticalAlign:i.PropTypes.oneOf(d.SUI.VERTICAL_ALIGNMENTS),widescreen:i.PropTypes.oneOf(d.SUI.WIDTHS),width:i.PropTypes.oneOf(d.SUI.WIDTHS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*****************************************!*\
!*** ./src/collections/Grid/GridRow.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.centered,n=e.children,r=e.className,a=e.color,l=e.columns,u=e.divided,i=e.only,d=e.reversed,y=e.stretched,m=e.textAlign,h=e.verticalAlign,v=(0,c.default)(a,(0,f.useKeyOnly)(t,"centered"),(0,f.useKeyOnly)(u,"divided"),(0,f.useKeyOnly)(y,"stretched"),(0,f.useOnlyProp)(i),(0,f.useTextAlignProp)(m),(0,f.useValueAndKey)(d,"reversed"),(0,f.useVerticalAlignProp)(h),(0,f.useWidthProp)(l,"column",!0),"row",r),P=(0,f.getUnhandledProps)(o,e),g=(0,f.getElementType)(o,e);return p.default.createElement(g,(0,s.default)({},P,{className:v}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/toConsumableArray */39),l=r(a),u=n(/*! babel-runtime/helpers/extends */2),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","centered","children","className","color","columns","divided","only","reversed","stretched","textAlign","verticalAlign"],o._meta={name:"GridRow",parent:"Grid",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,centered:d.PropTypes.bool,children:d.PropTypes.node,className:d.PropTypes.string,color:d.PropTypes.oneOf(f.SUI.COLORS),columns:d.PropTypes.oneOf([].concat((0,l.default)(f.SUI.WIDTHS),["equal"])),divided:d.PropTypes.bool,only:f.customPropTypes.onlyProp(f.SUI.VISIBILITY),reversed:d.PropTypes.oneOf(["computer","computer vertically","mobile","mobile vertically","tablet","tablet vertically"]),stretched:d.PropTypes.bool,textAlign:d.PropTypes.oneOf(f.SUI.TEXT_ALIGNMENTS),verticalAlign:d.PropTypes.oneOf(f.SUI.VERTICAL_ALIGNMENTS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/collections/Menu/MenuHeader.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("header",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"MenuHeader",type:f.META.TYPES.COLLECTION,parent:"Menu"},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/collections/Menu/MenuItem.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/startCase */646),m=r(y),h=n(/*! lodash/isNil */6),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=n(/*! ../../elements/Icon */15),E=r(_),N=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.color,u=e.content,s=e.disabled,i=e.fitted,c=e.header,d=e.icon,p=e.link,f=e.name,y=e.onClick,h=e.position,P=(0,g.default)(l,h,(0,O.useKeyOnly)(n,"active"),(0,O.useKeyOnly)(s,"disabled"),(0,O.useKeyOnly)(d===!0||d&&!(f||u),"icon"),(0,O.useKeyOnly)(c,"header"),(0,O.useKeyOnly)(p,"link"),(0,O.useKeyOrValueAndKey)(i,"fitted"),"item",o),T=(0,O.getElementType)(t,this.props,function(){if(y)return"a"}),_=(0,O.getUnhandledProps)(t,this.props);return(0,v.default)(r)?b.default.createElement(T,(0,a.default)({},_,{className:P,onClick:this.handleClick}),E.default.create(d),u||(0,m.default)(f)):b.default.createElement(T,(0,a.default)({},_,{className:P,onClick:this.handleClick}),r)}}]),t}(T.Component);N._meta={name:"MenuItem",type:O.META.TYPES.COLLECTION,parent:"Menu"},t.default=N,"production"!==e.env.NODE_ENV?N.propTypes={as:O.customPropTypes.as,active:T.PropTypes.bool,children:T.PropTypes.node,className:T.PropTypes.string,color:T.PropTypes.oneOf(O.SUI.COLORS),content:O.customPropTypes.contentShorthand,disabled:T.PropTypes.bool,fitted:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["horizontally","vertically"])]),header:T.PropTypes.bool,icon:T.PropTypes.oneOfType([T.PropTypes.bool,O.customPropTypes.itemShorthand]),index:T.PropTypes.number,link:T.PropTypes.bool,name:T.PropTypes.string,onClick:T.PropTypes.func,position:T.PropTypes.oneOf(["right"])}:void 0,N.handledProps=["active","as","children","className","color","content","disabled","fitted","header","icon","index","link","name","onClick","position"],N.create=(0,O.createShorthandFactory)(N,function(e){return{content:e,name:e}},!0)}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/collections/Menu/MenuMenu.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.position,a=(0,s.default)(r,"menu",n),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","position"],o._meta={name:"MenuMenu",type:d.META.TYPES.COLLECTION,parent:"Menu"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,position:i.PropTypes.oneOf(["right"])}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************************!*\
!*** ./src/collections/Message/MessageContent.js ***!
\***************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("content",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"MessageContent",parent:"Message",type:d.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************************!*\
!*** ./src/collections/Message/MessageHeader.js ***!
\**************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("header",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"MessageHeader",parent:"Message",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.itemShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************************!*\
!*** ./src/collections/Message/MessageList.js ***!
\************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.items,a=(0,p.default)("list",n),u=(0,m.getUnhandledProps)(o,e),i=(0,m.getElementType)(o,e);return y.default.createElement(i,(0,l.default)({},u,{className:a}),(0,c.default)(t)?(0,s.default)(r,v.default.create):t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/map */16),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ./MessageItem */108),v=r(h);o.handledProps=["as","children","className","items"],o._meta={name:"MessageList",parent:"Message",type:m.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,children:f.PropTypes.node,className:f.PropTypes.string,items:m.customPropTypes.collectionShorthand}:void 0,o.defaultProps={as:"ul"},o.create=(0,m.createShorthandFactory)(o,function(e){return{items:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/collections/Table/TableBody.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)(n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"TableBody",type:d.META.TYPES.COLLECTION,parent:"Table"},o.defaultProps={as:"tbody"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/collections/Table/TableFooter.js ***!
\**********************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return l.default.createElement(i.default,e)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! react */1),l=r(a),u=n(/*! ../../lib */4),s=n(/*! ./TableHeader */109),i=r(s);o.handledProps=["as"],o._meta={name:"TableFooter",type:u.META.TYPES.COLLECTION,parent:"Table"},o.defaultProps={as:"tfoot"},t.default=o},/*!**************************************************!*\
!*** ./src/collections/Table/TableHeaderCell.js ***!
\**************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.as,n=e.className,r=e.sorted,a=(0,s.default)((0,d.useValueAndKey)(r,"sorted"),n),u=(0,d.getUnhandledProps)(o,e);return c.default.createElement(f.default,(0,l.default)({},u,{as:t,className:a}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=n(/*! ./TableCell */67),f=r(p);o.handledProps=["as","className","sorted"],o._meta={name:"TableHeaderCell",type:d.META.TYPES.COLLECTION,parent:"Table"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,className:i.PropTypes.string,sorted:i.PropTypes.oneOf(["ascending","descending"])}:void 0,o.defaultProps={as:"th"},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/collections/Table/TableRow.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.cellAs,r=e.cells,a=e.children,u=e.className,s=e.disabled,i=e.error,d=e.negative,f=e.positive,m=e.textAlign,P=e.verticalAlign,T=e.warning,b=(0,y.default)((0,v.useKeyOnly)(t,"active"),(0,v.useKeyOnly)(s,"disabled"),(0,v.useKeyOnly)(i,"error"),(0,v.useKeyOnly)(d,"negative"),(0,v.useKeyOnly)(f,"positive"),(0,v.useKeyOnly)(T,"warning"),(0,v.useTextAlignProp)(m),(0,v.useVerticalAlignProp)(P),u),O=(0,v.getUnhandledProps)(o,e),_=(0,v.getElementType)(o,e);return(0,p.default)(a)?h.default.createElement(_,(0,l.default)({},O,{className:b}),(0,c.default)(r,function(e){return g.default.create(e,{as:n})})):h.default.createElement(_,(0,l.default)({},O,{className:b}),a)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/isNil */6),p=r(d),f=n(/*! classnames */5),y=r(f),m=n(/*! react */1),h=r(m),v=n(/*! ../../lib */4),P=n(/*! ./TableCell */67),g=r(P);o.handledProps=["active","as","cellAs","cells","children","className","disabled","error","negative","positive","textAlign","verticalAlign","warning"],o._meta={name:"TableRow",type:v.META.TYPES.COLLECTION,parent:"Table"},o.defaultProps={as:"tr",cellAs:"td"},"production"!==e.env.NODE_ENV?o.propTypes={as:v.customPropTypes.as,active:m.PropTypes.bool,cellAs:v.customPropTypes.as,cells:v.customPropTypes.collectionShorthand,children:m.PropTypes.node,className:m.PropTypes.string,disabled:m.PropTypes.bool,error:m.PropTypes.bool,negative:m.PropTypes.bool,positive:m.PropTypes.bool,textAlign:m.PropTypes.oneOf((0,s.default)(v.SUI.TEXT_ALIGNMENTS,"justified")),verticalAlign:m.PropTypes.oneOf(v.SUI.VERTICAL_ALIGNMENTS),warning:m.PropTypes.bool}:void 0,o.create=(0,v.createShorthandFactory)(o,function(e){return{cells:e}},!0),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/Button/Button.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/toConsumableArray */39),a=r(o),l=n(/*! babel-runtime/helpers/extends */2),u=r(l),s=n(/*! babel-runtime/helpers/classCallCheck */7),i=r(s),c=n(/*! babel-runtime/helpers/createClass */8),d=r(c),p=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),f=r(p),y=n(/*! babel-runtime/helpers/inherits */9),m=r(y),h=n(/*! lodash/isNil */6),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=n(/*! ../Icon/Icon */68),E=r(_),N=n(/*! ../Label/Label */112),S=r(N),M=n(/*! ./ButtonContent */205),x=r(M),w=n(/*! ./ButtonGroup */206),C=r(w),I=n(/*! ./ButtonOr */207),A=r(I),j=(0,O.makeDebugger)("button"),k=function(e){function t(){var e,n,r,o;(0,i.default)(this,t);for(var a=arguments.length,l=Array(a),u=0;u<a;u++)l[u]=arguments[u];return n=r=(0,f.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.computeElementType=function(){var e=r.props,t=e.attached,n=e.label;if(!(0,v.default)(t)||!(0,v.default)(n))return"div"},r.computeTabIndex=function(e){var t=r.props,n=t.disabled,o=t.tabIndex;return(0,v.default)(o)?n?-1:"div"===e?0:void 0:o},r.handleClick=function(e){var t=r.props,n=t.disabled,o=t.onClick;return n?void e.preventDefault():void(o&&o(e,r.props))},o=n,(0,f.default)(r,o)}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.animated,o=e.attached,a=e.basic,l=e.children,s=e.circular,i=e.className,c=e.color,d=e.compact,p=e.content,f=e.disabled,y=e.floated,m=e.fluid,h=e.icon,P=e.inverted,T=e.label,_=e.labelPosition,N=e.loading,M=e.negative,x=e.positive,w=e.primary,C=e.secondary,I=e.size,A=e.toggle,k=(0,g.default)(c,I,(0,O.useKeyOnly)(n,"active"),(0,O.useKeyOnly)(a,"basic"),(0,O.useKeyOnly)(s,"circular"),(0,O.useKeyOnly)(d,"compact"),(0,O.useKeyOnly)(m,"fluid"),(0,O.useKeyOnly)(h===!0||h&&(_||!l&&!p),"icon"),(0,O.useKeyOnly)(P,"inverted"),(0,O.useKeyOnly)(N,"loading"),(0,O.useKeyOnly)(M,"negative"),(0,O.useKeyOnly)(x,"positive"),(0,O.useKeyOnly)(w,"primary"),(0,O.useKeyOnly)(C,"secondary"),(0,O.useKeyOnly)(A,"toggle"),(0,O.useKeyOrValueAndKey)(r,"animated"),(0,O.useKeyOrValueAndKey)(o,"attached")),D=(0,g.default)((0,O.useKeyOrValueAndKey)(_||!!T,"labeled")),L=(0,g.default)((0,O.useKeyOnly)(f,"disabled"),(0,O.useValueAndKey)(y,"floated")),K=(0,O.getUnhandledProps)(t,this.props),U=(0,O.getElementType)(t,this.props,this.computeElementType),V=this.computeTabIndex(U);if(!(0,v.default)(l)){var R=(0,g.default)("ui",k,L,D,"button",i);return j("render children:",{classes:R}),b.default.createElement(U,(0,u.default)({},K,{className:R,tabIndex:V,onClick:this.handleClick}),l)}var z=S.default.create(T,{basic:!0,pointing:"left"===_?"right":"left"});if(z){var F=(0,g.default)("ui",k,"button",i),W=(0,g.default)("ui",D,"button",i,L);return j("render label:",{classes:F,containerClasses:W},this.props),b.default.createElement(U,(0,u.default)({},K,{className:W,onClick:this.handleClick}),"left"===_&&z,b.default.createElement("button",{className:F,tabIndex:V},E.default.create(h)," ",p),("right"===_||!_)&&z)}if(!(0,v.default)(h)&&(0,v.default)(T)){var B=(0,g.default)("ui",D,k,"button",i,L);return j("render icon && !label:",{classes:B}),b.default.createElement(U,(0,u.default)({},K,{className:B,tabIndex:V,onClick:this.handleClick}),E.default.create(h)," ",p)}var Y=(0,g.default)("ui",D,k,"button",i,L);return j("render default:",{classes:Y}),b.default.createElement(U,(0,u.default)({},K,{className:Y,tabIndex:V,onClick:this.handleClick}),p)}}]),t}(T.Component);k.defaultProps={as:"button"},k._meta={name:"Button",type:O.META.TYPES.ELEMENT},k.Content=x.default,k.Group=C.default,k.Or=A.default,"production"!==e.env.NODE_ENV?k.propTypes={as:O.customPropTypes.as,active:T.PropTypes.bool,animated:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["fade","vertical"])]),attached:T.PropTypes.oneOf(["left","right","top","bottom"]),basic:T.PropTypes.bool,children:O.customPropTypes.every([T.PropTypes.node,O.customPropTypes.disallow(["label"]),O.customPropTypes.givenProps({icon:T.PropTypes.oneOfType([T.PropTypes.string.isRequired,T.PropTypes.object.isRequired,T.PropTypes.element.isRequired])},O.customPropTypes.disallow(["icon"]))]),className:T.PropTypes.string,circular:T.PropTypes.bool,color:T.PropTypes.oneOf([].concat((0,a.default)(O.SUI.COLORS),["facebook","google plus","instagram","linkedin","twitter","vk","youtube"])),compact:T.PropTypes.bool,content:O.customPropTypes.contentShorthand,disabled:T.PropTypes.bool,floated:T.PropTypes.oneOf(O.SUI.FLOATS),fluid:T.PropTypes.bool,icon:O.customPropTypes.some([T.PropTypes.bool,T.PropTypes.string,T.PropTypes.object,T.PropTypes.element]),inverted:T.PropTypes.bool,label:O.customPropTypes.some([T.PropTypes.string,T.PropTypes.object,T.PropTypes.element]),labelPosition:T.PropTypes.oneOf(["right","left"]),loading:T.PropTypes.bool,negative:T.PropTypes.bool,onClick:T.PropTypes.func,positive:T.PropTypes.bool,primary:T.PropTypes.bool,secondary:T.PropTypes.bool,size:T.PropTypes.oneOf(O.SUI.SIZES),tabIndex:T.PropTypes.oneOfType([T.PropTypes.number,T.PropTypes.string]),toggle:T.PropTypes.bool}:void 0,k.handledProps=["active","animated","as","attached","basic","children","circular","className","color","compact","content","disabled","floated","fluid","icon","inverted","label","labelPosition","loading","negative","onClick","positive","primary","secondary","size","tabIndex","toggle"],k.create=(0,O.createShorthandFactory)(k,function(e){return{content:e}}),t.default=k}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/elements/Button/ButtonContent.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.hidden,a=e.visible,u=(0,s.default)((0,d.useKeyOnly)(a,"visible"),(0,d.useKeyOnly)(r,"hidden"),"content",n),i=(0,d.getUnhandledProps)(o,e),p=(0,d.getElementType)(o,e);return c.default.createElement(p,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","hidden","visible"],o._meta={name:"ButtonContent",parent:"Button",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,hidden:i.PropTypes.bool,visible:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/elements/Button/ButtonGroup.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.attached,n=e.basic,r=e.children,a=e.className,u=e.color,i=e.compact,p=e.floated,f=e.fluid,y=e.icon,m=e.inverted,h=e.labeled,v=e.negative,P=e.positive,g=e.primary,T=e.secondary,b=e.size,O=e.toggle,_=e.vertical,E=e.widths,N=(0,s.default)("ui",u,b,(0,d.useKeyOnly)(n,"basic"),(0,d.useKeyOnly)(i,"compact"),(0,d.useKeyOnly)(f,"fluid"),(0,d.useKeyOnly)(y,"icon"),(0,d.useKeyOnly)(m,"inverted"),(0,d.useKeyOnly)(h,"labeled"),(0,d.useKeyOnly)(v,"negative"),(0,d.useKeyOnly)(P,"positive"),(0,d.useKeyOnly)(g,"primary"),(0,d.useKeyOnly)(T,"secondary"),(0,d.useKeyOnly)(O,"toggle"),(0,d.useKeyOnly)(_,"vertical"),(0,d.useValueAndKey)(t,"attached"),(0,d.useValueAndKey)(p,"floated"),(0,d.useWidthProp)(E),"buttons",a),S=(0,d.getUnhandledProps)(o,e),M=(0,d.getElementType)(o,e);return c.default.createElement(M,(0,l.default)({},S,{className:N}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","attached","basic","children","className","color","compact","floated","fluid","icon","inverted","labeled","negative","positive","primary","secondary","size","toggle","vertical","widths"],o._meta={name:"ButtonGroup",parent:"Button",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,attached:i.PropTypes.oneOf(["left","right","top","bottom"]),basic:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string,color:i.PropTypes.oneOf(d.SUI.COLORS),compact:i.PropTypes.bool,floated:i.PropTypes.oneOf(d.SUI.FLOATS),fluid:i.PropTypes.bool,icon:i.PropTypes.bool,inverted:i.PropTypes.bool,labeled:i.PropTypes.bool,negative:i.PropTypes.bool,positive:i.PropTypes.bool,primary:i.PropTypes.bool,secondary:i.PropTypes.bool,size:i.PropTypes.oneOf(d.SUI.SIZES),toggle:i.PropTypes.bool,vertical:i.PropTypes.bool,widths:i.PropTypes.oneOf(d.SUI.WIDTHS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*****************************************!*\
!*** ./src/elements/Button/ButtonOr.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.text,r=(0,s.default)("or",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r,"data-text":n}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","className","text"],o._meta={name:"ButtonOr",parent:"Button",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,className:i.PropTypes.string,text:i.PropTypes.oneOfType([i.PropTypes.number,i.PropTypes.string])}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/elements/Flag/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Flag */367),a=r(o);t.default=a.default},/*!**********************************************!*\
!*** ./src/elements/Header/HeaderContent.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("content",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"HeaderContent",parent:"Header",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************************!*\
!*** ./src/elements/Header/HeaderSubheader.js ***!
\************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("sub header",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"HeaderSubheader",parent:"Header",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!****************************************!*\
!*** ./src/elements/Icon/IconGroup.js ***!
\****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.size,a=(0,c.default)(r,"icons",n),u=(0,f.getUnhandledProps)(o,e),s=(0,f.getElementType)(o,e);return p.default.createElement(s,(0,l.default)({},u,{className:a}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","size"],o._meta={name:"IconGroup",parent:"Icon",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium"))}:void 0,o.defaultProps={as:"i"},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/elements/Image/Image.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.alt,n=e.avatar,r=e.bordered,a=e.centered,u=e.children,i=e.className,d=e.dimmer,y=e.disabled,h=e.floated,P=e.fluid,g=e.height,T=e.hidden,b=e.href,O=e.inline,_=e.label,E=e.shape,N=e.size,S=e.spaced,M=e.src,x=e.verticalAlign,w=e.width,C=e.wrapped,I=e.ui,A=(0,c.default)((0,f.useKeyOnly)(I,"ui"),N,E,(0,f.useKeyOnly)(n,"avatar"),(0,f.useKeyOnly)(r,"bordered"),(0,f.useKeyOnly)(a,"centered"),(0,f.useKeyOnly)(y,"disabled"),(0,f.useKeyOnly)(P,"fluid"),(0,f.useKeyOnly)(T,"hidden"),(0,f.useKeyOnly)(O,"inline"),(0,f.useKeyOrValueAndKey)(S,"spaced"),(0,f.useValueAndKey)(h,"floated"),(0,f.useVerticalAlignProp)(x,"aligned"),"image",i),j=(0,f.getUnhandledProps)(o,e),k=(0,f.getElementType)(o,e,function(){if(!((0,s.default)(d)&&(0,s.default)(_)&&(0,s.default)(C)&&(0,s.default)(u)))return"div"});if(!(0,s.default)(u))return p.default.createElement(k,(0,l.default)({},j,{className:A}),u);var D=(0,l.default)({},j,{className:A}),L={alt:t,src:M,height:g,width:w};return"img"===k?p.default.createElement(k,(0,l.default)({},D,L)):p.default.createElement(k,(0,l.default)({},D,{href:b}),m.default.create(d),v.default.create(_),p.default.createElement("img",L))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../modules/Dimmer */228),m=r(y),h=n(/*! ../Label/Label */112),v=r(h),P=n(/*! ./ImageGroup */213),g=r(P);o.handledProps=["alt","as","avatar","bordered","centered","children","className","dimmer","disabled","floated","fluid","height","hidden","href","inline","label","shape","size","spaced","src","ui","verticalAlign","width","wrapped"],o.Group=g.default,o._meta={name:"Image",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,alt:d.PropTypes.string,avatar:d.PropTypes.bool,bordered:d.PropTypes.bool,centered:d.PropTypes.bool,children:d.PropTypes.node,className:d.PropTypes.string,disabled:d.PropTypes.bool,dimmer:f.customPropTypes.itemShorthand,floated:d.PropTypes.oneOf(f.SUI.FLOATS),fluid:f.customPropTypes.every([d.PropTypes.bool,f.customPropTypes.disallow(["size"])]),height:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]),hidden:d.PropTypes.bool,href:d.PropTypes.string,inline:d.PropTypes.bool,label:f.customPropTypes.itemShorthand,shape:d.PropTypes.oneOf(["rounded","circular"]),size:d.PropTypes.oneOf(f.SUI.SIZES),spaced:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["left","right"])]),src:d.PropTypes.string,ui:d.PropTypes.bool,verticalAlign:d.PropTypes.oneOf(f.SUI.VERTICAL_ALIGNMENTS),width:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]),wrapped:f.customPropTypes.every([d.PropTypes.bool,f.customPropTypes.disallow(["href"])])}:void 0,o.defaultProps={as:"img",ui:!0},o.create=(0,f.createShorthandFactory)(o,function(e){return{src:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/elements/Image/ImageGroup.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.size,a=(0,c.default)("ui",r,n,"images"),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return s.default.createElement(i,(0,l.default)({},u,{className:a}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","size"],o._meta={name:"ImageGroup",parent:"Image",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:u.PropTypes.node,className:u.PropTypes.string,size:u.PropTypes.oneOf(d.SUI.SIZES)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/elements/Label/LabelDetail.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)("detail",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"LabelDetail",parent:"Label",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/elements/Label/LabelGroup.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.circular,r=e.className,a=e.color,u=e.size,i=e.tag,p=(0,s.default)("ui",a,u,(0,d.useKeyOnly)(n,"circular"),(0,d.useKeyOnly)(i,"tag"),"labels",r),f=(0,d.getUnhandledProps)(o,e),y=(0,d.getElementType)(o,e);return c.default.createElement(y,(0,l.default)({},f,{className:p}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","circular","className","color","size","tag"],o._meta={name:"LabelGroup",parent:"Label",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,circular:i.PropTypes.bool,className:i.PropTypes.string,color:i.PropTypes.oneOf(d.SUI.COLORS),size:i.PropTypes.oneOf(d.SUI.SIZES),tag:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/List/ListItem.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.children,r=e.className,a=e.content,u=e.description,i=e.disabled,d=e.header,h=e.icon,P=e.image,T=e.value,O=(0,m.getElementType)(o,e),E=(0,p.default)((0,m.useKeyOnly)(t,"active"),(0,m.useKeyOnly)(i,"disabled"),(0,m.useKeyOnly)("li"!==O,"item"),r),S=(0,m.getUnhandledProps)(o,e),M="li"===O?{value:T}:{"data-value":T};if(!(0,c.default)(n))return y.default.createElement(O,(0,l.default)({},S,M,{role:"listitem",className:E}),n);var x=N.default.create(h),w=v.default.create(P);if(!(0,f.isValidElement)(a)&&(0,s.default)(a))return y.default.createElement(O,(0,l.default)({},S,M,{role:"listitem",className:E}),x||w,g.default.create(a,{header:d,description:u}));var C=_.default.create(d),I=b.default.create(u);return x||w?y.default.createElement(O,(0,l.default)({},S,M,{role:"listitem",className:E}),x||w,(a||C||I)&&y.default.createElement(g.default,null,C,I,a)):y.default.createElement(O,(0,l.default)({},S,M,{role:"listitem",className:E}),C,I,a)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isPlainObject */103),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ../../elements/Image */46),v=r(h),P=n(/*! ./ListContent */113),g=r(P),T=n(/*! ./ListDescription */70),b=r(T),O=n(/*! ./ListHeader */71),_=r(O),E=n(/*! ./ListIcon */114),N=r(E);o.handledProps=["active","as","children","className","content","description","disabled","header","icon","image","value"],o._meta={name:"ListItem",parent:"List",type:m.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,active:f.PropTypes.bool,children:f.PropTypes.node,className:f.PropTypes.string,content:m.customPropTypes.itemShorthand,description:m.customPropTypes.itemShorthand,disabled:f.PropTypes.bool,header:m.customPropTypes.itemShorthand,icon:m.customPropTypes.every([m.customPropTypes.disallow(["image"]),m.customPropTypes.itemShorthand]),image:m.customPropTypes.every([m.customPropTypes.disallow(["icon"]),m.customPropTypes.itemShorthand]),value:f.PropTypes.string}:void 0,o.create=(0,m.createShorthandFactory)(o,function(e){return{content:e}},!0),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/List/ListList.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,d.getUnhandledProps)(o,e),a=(0,d.getElementType)(o,e),u=(0,s.default)((0,d.useKeyOnly)("ul"!==a&&"ol"!==a,"list"),n);return c.default.createElement(a,(0,l.default)({},r,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"ListList",parent:"List",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/elements/Reveal/RevealContent.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.hidden,a=e.visible,u=(0,s.default)("ui",(0,d.useKeyOnly)(r,"hidden"),(0,d.useKeyOnly)(a,"visible"),"content",n),i=(0,d.getUnhandledProps)(o,e),p=(0,d.getElementType)(o,e);return c.default.createElement(p,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","hidden","visible"],o._meta={name:"RevealContent",parent:"Reveal",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,hidden:i.PropTypes.bool,visible:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/elements/Segment/SegmentGroup.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.compact,a=e.horizontal,u=e.piled,s=e.raised,i=e.size,d=e.stacked,y=(0,c.default)("ui",i,(0,f.useKeyOnly)(r,"compact"),(0,f.useKeyOnly)(a,"horizontal"),(0,f.useKeyOnly)(u,"piled"),(0,f.useKeyOnly)(s,"raised"),(0,f.useKeyOnly)(d,"stacked"),"segments",n),m=(0,f.getUnhandledProps)(o,e),h=(0,f.getElementType)(o,e);return p.default.createElement(h,(0,l.default)({},m,{className:y}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","compact","horizontal","piled","raised","size","stacked"],o._meta={name:"SegmentGroup",parent:"Segment",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,compact:d.PropTypes.bool,horizontal:d.PropTypes.bool,piled:d.PropTypes.bool,raised:d.PropTypes.bool,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium")),stacked:d.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************!*\
!*** ./src/elements/Step/Step.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../elements/Icon */15),O=r(b),_=n(/*! ./StepContent */221),E=r(_),N=n(/*! ./StepDescription */115),S=r(N),M=n(/*! ./StepGroup */222),x=r(M),w=n(/*! ./StepTitle */116),C=r(w),I=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.completed,u=e.description,s=e.disabled,i=e.href,c=e.icon,d=e.link,p=e.onClick,f=e.title,y=(0,v.default)((0,T.useKeyOnly)(n,"active"),(0,T.useKeyOnly)(l,"completed"),(0,T.useKeyOnly)(s,"disabled"),(0,T.useKeyOnly)(d,"link"),"step",o),h=(0,T.getUnhandledProps)(t,this.props),P=(0,T.getElementType)(t,this.props,function(){if(p)return"a"});return(0,m.default)(r)?g.default.createElement(P,(0,a.default)({},h,{className:y,href:i,onClick:this.handleClick}),O.default.create(c),g.default.createElement(E.default,{description:u,title:f})):g.default.createElement(P,(0,a.default)({},h,{className:y,href:i,onClick:this.handleClick}),r)}}]),t}(P.Component);I._meta={name:"Step",type:T.META.TYPES.ELEMENT},I.Content=E.default,I.Description=S.default,I.Group=x.default,I.Title=C.default,t.default=I,"production"!==e.env.NODE_ENV?I.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,completed:P.PropTypes.bool,description:T.customPropTypes.itemShorthand,disabled:P.PropTypes.bool,href:P.PropTypes.string,icon:T.customPropTypes.itemShorthand,link:P.PropTypes.bool,onClick:P.PropTypes.func,ordered:P.PropTypes.bool,title:T.customPropTypes.itemShorthand}:void 0,I.handledProps=["active","as","children","className","completed","description","disabled","href","icon","link","onClick","ordered","title"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/elements/Step/StepContent.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.description,a=e.title,u=(0,c.default)("content",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(d,(0,l.default)({},i,{className:u}),(0,f.createShorthand)(v.default,function(e){return{title:e}},a),(0,f.createShorthand)(m.default,function(e){return{description:e}},r)):p.default.createElement(d,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./StepDescription */115),m=r(y),h=n(/*! ./StepTitle */116),v=r(h);o.handledProps=["as","children","className","description","title"],o._meta={name:"StepContent",parent:"Step",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,className:d.PropTypes.string,children:d.PropTypes.node,description:f.customPropTypes.itemShorthand,title:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!****************************************!*\
!*** ./src/elements/Step/StepGroup.js ***!
\****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.fluid,a=e.items,u=e.ordered,s=e.size,i=e.stackable,d=e.vertical,f=(0,y.default)("ui",s,(0,v.useKeyOnly)(r,"fluid"),(0,v.useKeyOnly)(u,"ordered"),(0,v.useKeyOnly)(d,"vertical"),(0,v.useValueAndKey)(i,"stackable"),"steps",n),m=(0,v.getUnhandledProps)(o,e),P=(0,v.getElementType)(o,e);if(!(0,p.default)(t))return h.default.createElement(P,(0,l.default)({},m,{className:f}),t);var T=(0,c.default)(a,function(e){var t=e.key||[e.title,e.description].join("-");return h.default.createElement(g.default,(0,l.default)({key:t},e))});return h.default.createElement(P,(0,l.default)({},m,{className:f}),T)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/isNil */6),p=r(d),f=n(/*! classnames */5),y=r(f),m=n(/*! react */1),h=r(m),v=n(/*! ../../lib */4),P=n(/*! ./Step */220),g=r(P);o.handledProps=["as","children","className","fluid","items","ordered","size","stackable","vertical"],o._meta={name:"StepGroup",parent:"Step",type:v.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:v.customPropTypes.as,children:m.PropTypes.node,className:m.PropTypes.string,fluid:m.PropTypes.bool,items:v.customPropTypes.collectionShorthand,ordered:m.PropTypes.bool,size:m.PropTypes.oneOf((0,s.default)(v.SUI.SIZES,"medium")),stackable:m.PropTypes.oneOf(["tablet"]),vertical:m.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************!*\
!*** ./src/lib/isBrowser.js ***!
\******************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/typeof */56),a=r(o),l="object"===("undefined"==typeof document?"undefined":(0,a.default)(document))&&null!==document,u="object"===("undefined"==typeof window?"undefined":(0,a.default)(window))&&null!==window&&window.self===window;t.default=l&&u},/*!**************************!*\
!*** ./src/lib/leven.js ***!
\**************************/
function(e,t,n){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return 0};if("production"!==e.env.NODE_ENV){var r=[],o=[];n=function(e,t){if(e===t)return 0;var n=e.length,a=t.length;if(0===n)return a;if(0===a)return n;for(var l=void 0,u=void 0,s=void 0,i=void 0,c=0,d=0;c<n;)o[c]=e.charCodeAt(c),r[c]=++c;for(;d<a;)for(l=t.charCodeAt(d),s=d++,u=d,c=0;c<n;c++)i=l===o[c]?s:s+1,s=r[c],u=r[c]=s>u?i>u?u+1:i:i>s?s+1:i;return u}}t.default=n}).call(t,n(/*! ./../../~/process/browser.js */3))},/*!***************************************************!*\
!*** ./src/modules/Accordion/AccordionContent.js ***!
\***************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.children,r=e.className,a=e.content,u=(0,p.default)("content",(0,f.useKeyOnly)(t,"active"),r),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return c.default.createElement(d,(0,l.default)({},i,{className:u}),(0,s.default)(n)?a:n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["active","as","children","className","content"],"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,active:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o._meta={name:"AccordionContent",type:f.META.TYPES.MODULE,parent:"Accordion"},o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************************!*\
!*** ./src/modules/Accordion/AccordionTitle.js ***!
\*************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../elements/Icon */15),O=r(b),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.content,u=(0,v.default)((0,T.useKeyOnly)(n,"active"),"title",o),s=(0,T.getUnhandledProps)(t,this.props),i=(0,T.getElementType)(t,this.props);return(0,m.default)(l)?g.default.createElement(i,(0,a.default)({},s,{className:u,onClick:this.handleClick}),r):g.default.createElement(i,(0,a.default)({},s,{className:u,onClick:this.handleClick}),g.default.createElement(O.default,{name:"dropdown"}),l)}}]),t}(P.Component);_._meta={name:"AccordionTitle",type:T.META.TYPES.MODULE,parent:"Accordion"},t.default=_,"production"!==e.env.NODE_ENV?_.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,content:T.customPropTypes.contentShorthand,onClick:P.PropTypes.func}:void 0,_.handledProps=["active","as","children","className","content","onClick"],_.create=(0,T.createShorthandFactory)(_,function(e){return{content:e}})}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/modules/Dimmer/DimmerDimmable.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.blurring,n=e.className,r=e.children,a=e.dimmed,u=(0,s.default)((0,d.useKeyOnly)(t,"blurring"),(0,d.useKeyOnly)(a,"dimmed"),"dimmable",n),i=(0,d.getUnhandledProps)(o,e),p=(0,d.getElementType)(o,e);return c.default.createElement(p,(0,l.default)({},i,{className:u}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","blurring","children","className","dimmed"],o._meta={name:"DimmerDimmable",type:d.META.TYPES.MODULE,parent:"Dimmer"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,blurring:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string,dimmed:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/modules/Dimmer/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Dimmer */398),a=r(o);t.default=a.default},/*!*************************************************!*\
!*** ./src/modules/Dropdown/DropdownDivider.js ***!
\*************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=(0,s.default)("divider",t),r=(0,d.getUnhandledProps)(o,e),a=(0,d.getElementType)(o,e);return c.default.createElement(a,(0,l.default)({},r,{className:n}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","className"],o._meta={name:"DropdownDivider",parent:"Dropdown",type:d.META.TYPES.MODULE},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************************!*\
!*** ./src/modules/Dropdown/DropdownHeader.js ***!
\************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.icon,u=(0,c.default)("header",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(d,(0,l.default)({},i,{className:u}),m.default.create(a),r):p.default.createElement(d,(0,l.default)({},i,{className:u}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ../../elements/Icon */15),m=r(y);o.handledProps=["as","children","className","content","icon"],o._meta={name:"DropdownHeader",parent:"Dropdown",type:f.META.TYPES.MODULE},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,icon:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/modules/Dropdown/DropdownItem.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../elements/Flag */208),O=r(b),_=n(/*! ../../elements/Icon */15),E=r(_),N=n(/*! ../../elements/Image */46),S=r(N),M=n(/*! ../../elements/Label */69),x=r(M),w=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.content,u=e.disabled,s=e.description,i=e.flag,c=e.icon,d=e.image,p=e.label,f=e.selected,y=e.text,h=(0,v.default)((0,T.useKeyOnly)(n,"active"),(0,T.useKeyOnly)(u,"disabled"),(0,T.useKeyOnly)(f,"selected"),"item",o),P=(0,m.default)(c)?T.childrenUtils.someByType(r,"DropdownMenu")&&"dropdown":c,b=(0,T.getUnhandledProps)(t,this.props),_=(0,T.getElementType)(t,this.props),N={role:"option","aria-disabled":u,"aria-checked":n,"aria-selected":f};if(!(0,m.default)(r))return g.default.createElement(_,(0,a.default)({},b,N,{className:h,onClick:this.handleClick}),r);var M=O.default.create(i),w=E.default.create(P),C=S.default.create(d),I=x.default.create(p),A=(0,T.createShorthand)("span",function(e){return{children:e}},s,function(e){return{className:"description"}}),j=(0,T.createShorthand)("span",function(e){return{children:e}},l||y,function(e){return{className:"text"}});return g.default.createElement(_,(0,a.default)({},b,N,{className:h,onClick:this.handleClick}),C,w,M,I,A,j)}}]),t}(P.Component);w._meta={name:"DropdownItem",parent:"Dropdown",type:T.META.TYPES.MODULE},t.default=w,"production"!==e.env.NODE_ENV?w.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,content:T.customPropTypes.contentShorthand,description:T.customPropTypes.itemShorthand,disabled:P.PropTypes.bool,flag:T.customPropTypes.itemShorthand,icon:T.customPropTypes.itemShorthand,image:T.customPropTypes.itemShorthand,label:T.customPropTypes.itemShorthand,onClick:P.PropTypes.func,selected:P.PropTypes.bool,text:T.customPropTypes.contentShorthand,value:P.PropTypes.oneOfType([P.PropTypes.number,P.PropTypes.string])}:void 0,w.handledProps=["active","as","children","className","content","description","disabled","flag","icon","image","label","onClick","selected","text","value"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/modules/Dropdown/DropdownMenu.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.scrolling,a=(0,s.default)((0,d.useKeyOnly)(r,"scrolling"),"menu transition",n),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","scrolling"],o._meta={name:"DropdownMenu",parent:"Dropdown",type:d.META.TYPES.MODULE},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,scrolling:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/modules/Modal/ModalActions.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("actions",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"ModalActions",type:d.META.TYPES.MODULE,parent:"Modal"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/modules/Modal/ModalContent.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.image,u=(0,c.default)(n,(0,f.useKeyOnly)(a,"image"),"content"),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return p.default.createElement(d,(0,l.default)({},i,{className:u}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content","image"],o._meta={name:"ModalContent",type:f.META.TYPES.MODULE,parent:"Modal"},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,image:d.PropTypes.bool}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************************!*\
!*** ./src/modules/Modal/ModalDescription.js ***!
\***********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("description",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"ModalDescription",type:d.META.TYPES.MODULE,parent:"Modal"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/modules/Modal/ModalHeader.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=(0,c.default)(n,"header"),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","content"],o._meta={name:"ModalHeader",type:f.META.TYPES.MODULE,parent:"Modal"},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand}:void 0,o.create=(0,f.createShorthandFactory)(o,function(e){return{content:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/modules/Modal/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Modal */402),a=r(o);t.default=a.default},/*!*******************************************!*\
!*** ./src/modules/Popup/PopupContent.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("content",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a);t.default=o;var u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,o._meta={name:"PopupContent",type:d.META.TYPES.MODULE,parent:"Popup"},o.create=(0,d.createShorthandFactory)(o,function(e){return{children:e}})}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/modules/Popup/PopupHeader.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("header",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a);t.default=o;var u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,o._meta={name:"PopupHeader",type:d.META.TYPES.MODULE,parent:"Popup"},o.create=(0,d.createShorthandFactory)(o,function(e){return{children:e}})}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/modules/Rating/RatingIcon.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! classnames */5),m=r(y),h=n(/*! react */1),v=r(h),P=n(/*! ../../lib */4),g=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.defaultProps={as:"i"},r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},r.handleKeyUp=function(e){var t=r.props,n=t.onClick,o=t.onKeyUp;if(o&&o(e,r.props),n)switch(P.keyboardKey.getCode(e)){case P.keyboardKey.Enter:case P.keyboardKey.Spacebar:e.preventDefault(),n(e,r.props);break;default:return}},r.handleMouseEnter=function(e){var t=r.props.onMouseEnter;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.className,o=e.selected,l=(0,m.default)((0,P.useKeyOnly)(n,"active"),(0,P.useKeyOnly)(o,"selected"),"icon",r),u=(0,P.getUnhandledProps)(t,this.props),s=(0,P.getElementType)(t,this.props);return v.default.createElement(s,(0,a.default)({},u,{className:l,onClick:this.handleClick,onKeyUp:this.handleKeyUp,onMouseEnter:this.handleMouseEnter,tabIndex:0,role:"radio"}))}}]),t}(h.Component);g._meta={name:"RatingIcon",parent:"Rating",type:P.META.TYPES.MODULE},t.default=g,"production"!==e.env.NODE_ENV?g.propTypes={as:P.customPropTypes.as,active:h.PropTypes.bool,className:h.PropTypes.string,index:h.PropTypes.number,onClick:h.PropTypes.func,onKeyUp:h.PropTypes.func,onMouseEnter:h.PropTypes.func,selected:h.PropTypes.bool}:void 0,g.handledProps=["active","as","className","index","onClick","onKeyUp","onMouseEnter","selected"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/modules/Search/SearchCategory.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.children,r=e.className,a=e.renderer,u=(0,s.default)((0,d.useKeyOnly)(t,"active"),"category",r),i=(0,d.getUnhandledProps)(o,e),p=(0,d.getElementType)(o,e);return c.default.createElement(p,(0,l.default)({},i,{className:u}),c.default.createElement("div",{className:"name"},a(e)),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["active","as","children","className","name","renderer","results"],o._meta={name:"SearchCategory",parent:"Search",type:d.META.TYPES.MODULE},o.defaultProps={renderer:function(e){var t=e.name;return t}},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,active:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string,name:i.PropTypes.string,renderer:i.PropTypes.func,results:i.PropTypes.array}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/modules/Search/SearchResult.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! classnames */5),m=r(y),h=n(/*! react */1),v=r(h),P=n(/*! ../../lib */4),g=function(e){var t=e.image,n=e.price,r=e.title,o=e.description;return[t&&v.default.createElement("div",{key:"image",className:"image"},(0,P.createHTMLImage)(t)),v.default.createElement("div",{key:"content",className:"content"},n&&v.default.createElement("div",{className:"price"},n),r&&v.default.createElement("div",{className:"title"},r),o&&v.default.createElement("div",{className:"description"},o))]};g.handledProps=[];var T=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.className,o=e.renderer,l=(0,m.default)((0,P.useKeyOnly)(n,"active"),"result",r),u=(0,P.getUnhandledProps)(t,this.props),s=(0,P.getElementType)(t,this.props);return v.default.createElement(s,(0,a.default)({},u,{className:l,onClick:this.handleClick}),o(this.props))}}]),t}(h.Component);T.defaultProps={renderer:g},T._meta={name:"SearchResult",parent:"Search",type:P.META.TYPES.MODULE},t.default=T,"production"!==e.env.NODE_ENV?T.propTypes={as:P.customPropTypes.as,active:h.PropTypes.bool,className:h.PropTypes.string,description:h.PropTypes.string,id:h.PropTypes.number,image:h.PropTypes.string,onClick:h.PropTypes.func,price:h.PropTypes.string,renderer:h.PropTypes.func,title:h.PropTypes.string}:void 0,T.handledProps=["active","as","className","description","id","image","onClick","price","renderer","title"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************************!*\
!*** ./src/modules/Search/SearchResults.js ***!
\*********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=(0,s.default)("results transition",n),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"SearchResults",parent:"Search",type:d.META.TYPES.MODULE},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************************!*\
!*** ./src/modules/Sidebar/SidebarPushable.js ***!
\************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)("pushable",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"SidebarPushable",type:d.META.TYPES.MODULE,parent:"Sidebar"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/modules/Sidebar/SidebarPusher.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.dimmed,r=e.children,a=(0,s.default)("pusher",(0,d.useKeyOnly)(n,"dimmed"),t),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","dimmed"],o._meta={name:"SidebarPusher",type:d.META.TYPES.MODULE,parent:"Sidebar"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,dimmed:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************!*\
!*** ./src/views/Card/Card.js ***!
\********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../elements/Image */46),O=r(b),_=n(/*! ./CardContent */247),E=r(_),N=n(/*! ./CardDescription */119),S=r(N),M=n(/*! ./CardGroup */248),x=r(M),w=n(/*! ./CardHeader */120),C=r(w),I=n(/*! ./CardMeta */121),A=r(I),j=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleClick=function(e){var t=r.props.onClick;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.centered,r=e.children,o=e.className,l=e.color,u=e.description,s=e.extra,i=e.fluid,c=e.header,d=e.href,p=e.image,f=e.link,y=e.meta,h=e.onClick,P=e.raised,b=(0,v.default)("ui",l,(0,T.useKeyOnly)(n,"centered"),(0,T.useKeyOnly)(i,"fluid"),(0,T.useKeyOnly)(f,"link"),(0,T.useKeyOnly)(P,"raised"),"card",o),_=(0,T.getUnhandledProps)(t,this.props),N=(0,T.getElementType)(t,this.props,function(){if(h)return"a"});return(0,m.default)(r)?g.default.createElement(N,(0,a.default)({},_,{className:b,href:d,onClick:this.handleClick}),O.default.create(p),(u||c||y)&&g.default.createElement(E.default,{description:u,header:c,meta:y}),s&&g.default.createElement(E.default,{extra:!0},s)):g.default.createElement(N,(0,a.default)({},_,{className:b,href:d,onClick:this.handleClick}),r)}}]),t}(P.Component);j._meta={name:"Card",type:T.META.TYPES.VIEW},j.Content=E.default,j.Description=S.default,j.Group=x.default,j.Header=C.default,j.Meta=A.default,t.default=j,"production"!==e.env.NODE_ENV?j.propTypes={as:T.customPropTypes.as,centered:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,color:P.PropTypes.oneOf(T.SUI.COLORS),description:T.customPropTypes.itemShorthand,extra:T.customPropTypes.contentShorthand,fluid:P.PropTypes.bool,header:T.customPropTypes.itemShorthand,href:P.PropTypes.string,image:T.customPropTypes.itemShorthand,link:P.PropTypes.bool,meta:T.customPropTypes.itemShorthand,onClick:P.PropTypes.func,raised:P.PropTypes.bool}:void 0,j.handledProps=["as","centered","children","className","color","description","extra","fluid","header","href","image","link","meta","onClick","raised"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/views/Card/CardContent.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.description,a=e.extra,u=e.header,i=e.meta,d=(0,c.default)(n,(0,f.useKeyOnly)(a,"extra"),"content"),y=(0,f.getUnhandledProps)(o,e),h=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(h,(0,l.default)({},y,{className:d}),(0,f.createShorthand)(v.default,function(e){return{content:e}},u),(0,f.createShorthand)(g.default,function(e){return{content:e}},i),(0,f.createShorthand)(m.default,function(e){return{content:e}},r)):p.default.createElement(h,(0,l.default)({},y,{className:d}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./CardDescription */119),m=r(y),h=n(/*! ./CardHeader */120),v=r(h),P=n(/*! ./CardMeta */121),g=r(P);o.handledProps=["as","children","className","description","extra","header","meta"],o._meta={name:"CardContent",parent:"Card",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,description:f.customPropTypes.itemShorthand,extra:d.PropTypes.bool,header:f.customPropTypes.itemShorthand,meta:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Card/CardGroup.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.doubling,a=e.items,u=e.itemsPerRow,i=e.stackable,d=(0,p.default)("ui",(0,m.useKeyOnly)(r,"doubling"),(0,m.useKeyOnly)(i,"stackable"),(0,m.useWidthProp)(u),n,"cards"),f=(0,m.getUnhandledProps)(o,e),h=(0,m.getElementType)(o,e);if(!(0,c.default)(t))return y.default.createElement(h,(0,l.default)({},f,{className:d}),t);var P=(0,s.default)(a,function(e){var t=e.key||[e.header,e.description].join("-");return y.default.createElement(v.default,(0,l.default)({key:t},e))});return y.default.createElement(h,(0,l.default)({},f,{className:d}),P)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/map */16),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ./Card */246),v=r(h);o.handledProps=["as","children","className","doubling","items","itemsPerRow","stackable"],o._meta={name:"CardGroup",parent:"Card",type:m.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,children:f.PropTypes.node,className:f.PropTypes.string,doubling:f.PropTypes.bool,items:m.customPropTypes.collectionShorthand,itemsPerRow:f.PropTypes.oneOf(m.SUI.WIDTHS),stackable:f.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/views/Comment/CommentAction.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.className,r=e.children,a=(0,s.default)((0,d.useKeyOnly)(t,"active"),n),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["active","as","children","className"],o._meta={name:"CommentAction",parent:"Comment",type:d.META.TYPES.VIEW},o.defaultProps={as:"a"},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,active:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************************!*\
!*** ./src/views/Comment/CommentActions.js ***!
\*********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)("actions",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"CommentActions",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/views/Comment/CommentAuthor.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)("author",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"CommentAuthor",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************************!*\
!*** ./src/views/Comment/CommentAvatar.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.src,r=(0,s.default)("avatar",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),(0,d.createHTMLImage)(n))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","className","src"],o._meta={name:"CommentAvatar",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,className:i.PropTypes.string,src:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************************!*\
!*** ./src/views/Comment/CommentContent.js ***!
\*********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)(t,"content"),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"CommentContent",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*******************************************!*\
!*** ./src/views/Comment/CommentGroup.js ***!
\*******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=e.collapsed,a=e.minimal,u=e.size,s=e.threaded,i=(0,c.default)("ui",u,(0,f.useKeyOnly)(r,"collapsed"),(0,f.useKeyOnly)(a,"minimal"),(0,f.useKeyOnly)(s,"threaded"),"comments",t),d=(0,f.getUnhandledProps)(o,e),y=(0,f.getElementType)(o,e);return p.default.createElement(y,(0,l.default)({},d,{className:i}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","collapsed","minimal","size","threaded"],o._meta={name:"CommentGroup",parent:"Comment",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,collapsed:d.PropTypes.bool,minimal:d.PropTypes.bool,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium")),threaded:d.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**********************************************!*\
!*** ./src/views/Comment/CommentMetadata.js ***!
\**********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)("metadata",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"CommentMetadata",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/views/Comment/CommentText.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=(0,s.default)(t,"text"),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className"],o._meta={name:"CommentText",parent:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Feed/FeedEvent.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.content,n=e.children,r=e.className,a=e.date,u=e.extraImages,i=e.extraText,p=e.image,y=e.icon,h=e.meta,v=e.summary,P=(0,s.default)("event",r),g=(0,d.getUnhandledProps)(o,e),T=(0,d.getElementType)(o,e),b=t||a||u||i||h||v,O={content:t,date:a,extraImages:u,extraText:i,meta:h,summary:v};return c.default.createElement(T,(0,l.default)({},g,{className:P}),(0,d.createShorthand)(m.default,function(e){return{icon:e}},y),(0,d.createShorthand)(m.default,function(e){return{image:e}},p),b&&c.default.createElement(f.default,O),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=n(/*! ./FeedContent */122),f=r(p),y=n(/*! ./FeedLabel */124),m=r(y);o.handledProps=["as","children","className","content","date","extraImages","extraText","icon","image","meta","summary"],o._meta={name:"FeedEvent",parent:"Feed",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,content:d.customPropTypes.itemShorthand,date:d.customPropTypes.itemShorthand,extraImages:d.customPropTypes.itemShorthand,extraText:d.customPropTypes.itemShorthand,icon:d.customPropTypes.itemShorthand,image:d.customPropTypes.itemShorthand,meta:d.customPropTypes.itemShorthand,summary:d.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!********************************!*\
!*** ./src/views/Item/Item.js ***!
\********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.description,u=e.extra,i=e.header,d=e.image,y=e.meta,h=(0,c.default)("item",n),v=(0,f.getUnhandledProps)(o,e),P=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(P,(0,l.default)({},v,{className:h}),N.default.create(d),p.default.createElement(m.default,{content:r,description:a,extra:u,header:i,meta:y})):p.default.createElement(P,(0,l.default)({},v,{className:h}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./ItemContent */259),m=r(y),h=n(/*! ./ItemDescription */129),v=r(h),P=n(/*! ./ItemExtra */130),g=r(P),T=n(/*! ./ItemGroup */260),b=r(T),O=n(/*! ./ItemHeader */131),_=r(O),E=n(/*! ./ItemImage */261),N=r(E),S=n(/*! ./ItemMeta */132),M=r(S);o.handledProps=["as","children","className","content","description","extra","header","image","meta"],o._meta={name:"Item",type:f.META.TYPES.VIEW},o.Content=m.default,o.Description=v.default,o.Extra=g.default,o.Group=b.default,o.Header=_.default,o.Image=N.default,o.Meta=M.default,"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,description:f.customPropTypes.itemShorthand,extra:f.customPropTypes.itemShorthand,image:f.customPropTypes.itemShorthand,header:f.customPropTypes.itemShorthand,meta:f.customPropTypes.itemShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/views/Item/ItemContent.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.content,a=e.description,u=e.extra,i=e.header,d=e.meta,y=e.verticalAlign,h=(0,c.default)((0,f.useVerticalAlignProp)(y),"content",n),P=(0,f.getUnhandledProps)(o,e),T=(0,f.getElementType)(o,e);return(0,s.default)(t)?p.default.createElement(T,(0,l.default)({},P,{className:h}),m.default.create(i),b.default.create(d),v.default.create(a),g.default.create(u),r):p.default.createElement(T,(0,l.default)({},P,{className:h}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./ItemHeader */131),m=r(y),h=n(/*! ./ItemDescription */129),v=r(h),P=n(/*! ./ItemExtra */130),g=r(P),T=n(/*! ./ItemMeta */132),b=r(T);o.handledProps=["as","children","className","content","description","extra","header","meta","verticalAlign"],o._meta={name:"ItemContent",parent:"Item",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,description:f.customPropTypes.itemShorthand,extra:f.customPropTypes.itemShorthand,header:f.customPropTypes.itemShorthand,meta:f.customPropTypes.itemShorthand,verticalAlign:d.PropTypes.oneOf(f.SUI.VERTICAL_ALIGNMENTS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Item/ItemGroup.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.divided,a=e.items,u=e.link,i=e.relaxed,d=(0,y.default)("ui",(0,v.useKeyOnly)(r,"divided"),(0,v.useKeyOnly)(u,"link"),(0,v.useKeyOrValueAndKey)(i,"relaxed"),"items",n),f=(0,v.getUnhandledProps)(o,e),m=(0,v.getElementType)(o,e);if(!(0,p.default)(t))return h.default.createElement(m,(0,s.default)({},f,{className:d}),t);var P=(0,c.default)(a,function(e){var t=e.childKey,n=(0,l.default)(e,["childKey"]),r=t||[n.content,n.description,n.header,n.meta].join("-");return h.default.createElement(g.default,(0,s.default)({},n,{key:r}))});return h.default.createElement(m,(0,s.default)({},f,{className:d}),P)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/objectWithoutProperties */133),l=r(a),u=n(/*! babel-runtime/helpers/extends */2),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/isNil */6),p=r(d),f=n(/*! classnames */5),y=r(f),m=n(/*! react */1),h=r(m),v=n(/*! ../../lib */4),P=n(/*! ./Item */258),g=r(P);o.handledProps=["as","children","className","divided","items","link","relaxed"],o._meta={name:"ItemGroup",type:v.META.TYPES.VIEW,parent:"Item"},"production"!==e.env.NODE_ENV?o.propTypes={as:v.customPropTypes.as,children:m.PropTypes.node,className:m.PropTypes.string,divided:m.PropTypes.bool,items:v.customPropTypes.collectionShorthand,link:m.PropTypes.bool,relaxed:m.PropTypes.oneOfType([m.PropTypes.bool,m.PropTypes.oneOf(["very"])])}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/views/Item/ItemImage.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.size,n=(0,i.getUnhandledProps)(o,e);return s.default.createElement(d.default,(0,l.default)({},n,{size:t,ui:!!t,wrapped:!0}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../elements/Image */46),d=r(c);o.handledProps=["size"],o._meta={name:"ItemImage",parent:"Item",type:i.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={size:d.default.propTypes.size}:void 0,o.create=(0,i.createShorthandFactory)(o,function(e){return{src:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/views/Statistic/Statistic.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.color,a=e.floated,u=e.horizontal,s=e.inverted,i=e.label,d=e.size,f=e.text,h=e.value,v=(0,p.default)("ui",r,d,(0,m.useValueAndKey)(a,"floated"),(0,m.useKeyOnly)(u,"horizontal"),(0,m.useKeyOnly)(s,"inverted"),"statistic",n),P=(0,m.getUnhandledProps)(o,e),T=(0,m.getElementType)(o,e);return(0,c.default)(t)?y.default.createElement(T,(0,l.default)({},P,{className:v}),y.default.createElement(b.default,{text:f,value:h}),y.default.createElement(g.default,{label:i})):y.default.createElement(T,(0,l.default)({},P,{className:v}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ./StatisticGroup */263),v=r(h),P=n(/*! ./StatisticLabel */264),g=r(P),T=n(/*! ./StatisticValue */265),b=r(T);o.handledProps=["as","children","className","color","floated","horizontal","inverted","label","size","text","value"],o._meta={name:"Statistic",type:m.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,children:f.PropTypes.node,className:f.PropTypes.string,color:f.PropTypes.oneOf(m.SUI.COLORS),floated:f.PropTypes.oneOf(m.SUI.FLOATS),horizontal:f.PropTypes.bool,inverted:f.PropTypes.bool,label:m.customPropTypes.contentShorthand,size:f.PropTypes.oneOf((0,s.default)(m.SUI.SIZES,"big","massive","medium")),text:f.PropTypes.bool,value:m.customPropTypes.contentShorthand}:void 0,o.Group=v.default,o.Label=g.default,o.Value=b.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************************!*\
!*** ./src/views/Statistic/StatisticGroup.js ***!
\***********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.color,a=e.horizontal,u=e.inverted,s=e.items,i=e.size,d=e.widths,f=(0,y.default)("ui",r,i,(0,v.useKeyOnly)(a,"horizontal"),(0,v.useKeyOnly)(u,"inverted"),(0,v.useWidthProp)(d),"statistics",n),m=(0,v.getUnhandledProps)(o,e),P=(0,v.getElementType)(o,e);if(!(0,p.default)(t))return h.default.createElement(P,(0,l.default)({},m,{className:f}),t);var T=(0,c.default)(s,function(e){return h.default.createElement(g.default,(0,l.default)({key:e.childKey||[e.label,e.title].join("-")},e))});return h.default.createElement(P,(0,l.default)({},m,{className:f}),T)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/isNil */6),p=r(d),f=n(/*! classnames */5),y=r(f),m=n(/*! react */1),h=r(m),v=n(/*! ../../lib */4),P=n(/*! ./Statistic */262),g=r(P);o.handledProps=["as","children","className","color","horizontal","inverted","items","size","widths"],o._meta={name:"StatisticGroup",type:v.META.TYPES.VIEW,parent:"Statistic"},"production"!==e.env.NODE_ENV?o.propTypes={as:v.customPropTypes.as,children:m.PropTypes.node,className:m.PropTypes.string,color:m.PropTypes.oneOf(v.SUI.COLORS),horizontal:m.PropTypes.bool,inverted:m.PropTypes.bool,items:v.customPropTypes.collectionShorthand,size:m.PropTypes.oneOf((0,s.default)(v.SUI.SIZES,"big","massive","medium")),widths:m.PropTypes.oneOf(v.SUI.WIDTHS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************************!*\
!*** ./src/views/Statistic/StatisticLabel.js ***!
\***********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.label,a=(0,c.default)("label",n),u=(0,f.getUnhandledProps)(o,e),i=(0,f.getElementType)(o,e);return p.default.createElement(i,(0,l.default)({},u,{className:a}),(0,s.default)(t)?r:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","label"],o._meta={name:"StatisticLabel",parent:"Statistic",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,label:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************************!*\
!*** ./src/views/Statistic/StatisticValue.js ***!
\***********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.text,a=e.value,u=(0,c.default)((0,f.useKeyOnly)(r,"text"),"value",n),i=(0,f.getUnhandledProps)(o,e),d=(0,f.getElementType)(o,e);return p.default.createElement(d,(0,l.default)({},i,{className:u}),(0,s.default)(t)?a:t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","children","className","text","value"],o._meta={name:"StatisticValue",parent:"Statistic",type:f.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,text:d.PropTypes.bool,value:f.customPropTypes.contentShorthand}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!****************************************!*\
!*** ./~/babel-runtime/helpers/get.js ***!
\****************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/object/get-prototype-of */428),a=r(o),l=n(/*! ../core-js/object/get-own-property-descriptor */427),u=r(l);t.default=function e(t,n,r){null===t&&(t=Function.prototype);var o=(0,u.default)(t,n);if(void 0===o){var l=(0,a.default)(t);return null===l?void 0:e(l,n,r)}if("value"in o)return o.value;var s=o.get;if(void 0!==s)return s.call(r)}},/*!**************************************************!*\
!*** ./~/babel-runtime/helpers/slicedToArray.js ***!
\**************************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(/*! ../core-js/is-iterable */423),a=r(o),l=n(/*! ../core-js/get-iterator */422),u=r(l);t.default=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var l,s=(0,u.default)(e);!(r=(l=s.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,a.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},/*!***********************************************!*\
!*** ./~/core-js/library/modules/_classof.js ***!
\***********************************************/
function(e,t,n){var r=n(/*! ./_cof */134),o=n(/*! ./_wks */21)("toStringTag"),a="Arguments"==r(function(){return arguments}()),l=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=l(t=Object(e),o))?n:a?r(t):"Object"==(u=r(t))&&"function"==typeof t.callee?"Arguments":u}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_dom-create.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_is-object */57),o=n(/*! ./_global */31).document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},/*!******************************************************!*\
!*** ./~/core-js/library/modules/_ie8-dom-define.js ***!
\******************************************************/
function(e,t,n){e.exports=!n(/*! ./_descriptors */41)&&!n(/*! ./_fails */47)(function(){/*! ./_dom-create */
return 7!=Object.defineProperty(n(269)("div"),"a",{get:function(){return 7}}).a})},/*!***********************************************!*\
!*** ./~/core-js/library/modules/_iobject.js ***!
\***********************************************/
function(e,t,n){var r=n(/*! ./_cof */134);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_iter-define.js ***!
\***************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_library */138),o=n(/*! ./_export */30),a=n(/*! ./_redefine */277),l=n(/*! ./_hide */48),u=n(/*! ./_has */42),s=n(/*! ./_iterators */49),i=n(/*! ./_iter-create */452),c=n(/*! ./_set-to-string-tag */142),d=n(/*! ./_object-gpo */274),p=n(/*! ./_wks */21)("iterator"),f=!([].keys&&"next"in[].keys()),y="@@iterator",m="keys",h="values",v=function(){return this};e.exports=function(e,t,n,P,g,T,b){i(n,t,P);var O,_,E,N=function(e){if(!f&&e in w)return w[e];switch(e){case m:return function(){return new n(this,e)};case h:return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",M=g==h,x=!1,w=e.prototype,C=w[p]||w[y]||g&&w[g],I=C||N(g),A=g?M?N("entries"):I:void 0,j="Array"==t?w.entries||C:C;if(j&&(E=d(j.call(new e)),E!==Object.prototype&&(c(E,S,!0),r||u(E,p)||l(E,p,v))),M&&C&&C.name!==h&&(x=!0,I=function(){return C.call(this)}),r&&!b||!f&&!x&&w[p]||l(w,p,I),s[t]=I,s[S]=v,g)if(O={values:M?I:N(h),keys:T?I:N(m),entries:A},b)for(_ in O)_ in w||a(w,_,O[_]);else o(o.P+o.F*(f||x),t,O);return O}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_object-gopn.js ***!
\***************************************************/
function(e,t,n){var r=n(/*! ./_object-keys-internal */275),o=n(/*! ./_enum-bug-keys */137).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_object-gpo.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_has */42),o=n(/*! ./_to-object */75),a=n(/*! ./_shared-key */143)("IE_PROTO"),l=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},/*!************************************************************!*\
!*** ./~/core-js/library/modules/_object-keys-internal.js ***!
\************************************************************/
function(e,t,n){var r=n(/*! ./_has */42),o=n(/*! ./_to-iobject */33),a=n(/*! ./_array-includes */445)(!1),l=n(/*! ./_shared-key */143)("IE_PROTO");e.exports=function(e,t){var n,u=o(e),s=0,i=[];for(n in u)n!=l&&r(u,n)&&i.push(n);for(;t.length>s;)r(u,n=t[s++])&&(~a(i,n)||i.push(n));return i}},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_object-sap.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_export */30),o=n(/*! ./_core */17),a=n(/*! ./_fails */47);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],l={};l[e]=t(n),r(r.S+r.F*a(function(){n(1)}),"Object",l)}},/*!************************************************!*\
!*** ./~/core-js/library/modules/_redefine.js ***!
\************************************************/
function(e,t,n){e.exports=n(/*! ./_hide */48)},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_to-length.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_to-integer */145),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},/*!***************************************************************!*\
!*** ./~/core-js/library/modules/core.get-iterator-method.js ***!
\***************************************************************/
function(e,t,n){var r=n(/*! ./_classof */268),o=n(/*! ./_wks */21)("iterator"),a=n(/*! ./_iterators */49);e.exports=n(/*! ./_core */17).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||a[r(e)]}},/*!**************************!*\
!*** ./~/lodash/_Set.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=n(/*! ./_root */18),a=r(o,"Set");e.exports=a},/*!*********************************!*\
!*** ./~/lodash/_Uint8Array.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./_root */18),o=r.Uint8Array;e.exports=o},/*!******************************!*\
!*** ./~/lodash/_WeakMap.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=n(/*! ./_root */18),a=r(o,"WeakMap");e.exports=a},/*!**********************************!*\
!*** ./~/lodash/_arrayFilter.js ***!
\**********************************/
function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var l=e[n];t(l,n,e)&&(a[o++]=l)}return a}e.exports=n},/*!************************************!*\
!*** ./~/lodash/_arrayLikeKeys.js ***!
\************************************/
function(e,t,n){function r(e,t){var n=l(e),r=!n&&a(e),c=!n&&!r&&u(e),p=!n&&!r&&!c&&i(e),f=n||r||c||p,y=f?o(e.length,String):[],m=y.length;for(var h in e)!t&&!d.call(e,h)||f&&("length"==h||c&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||s(h,m))||y.push(h);return y}var o=n(/*! ./_baseTimes */293),a=n(/*! ./isArguments */101),l=n(/*! ./isArray */12),u=n(/*! ./isBuffer */65),s=n(/*! ./_isIndex */62),i=n(/*! ./isTypedArray */104),c=Object.prototype,d=c.hasOwnProperty;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_arraySome.js ***!
\********************************/
function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_baseAssign.js ***!
\*********************************/
function(e,t,n){function r(e,t){return e&&o(t,a(t),e)}var o=n(/*! ./_copyObject */52),a=n(/*! ./keys */20);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseClamp.js ***!
\********************************/
function(e,t){function n(e,t,n){return e===e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_baseDifference.js ***!
\*************************************/
function(e,t,n){function r(e,t,n,r){var d=-1,p=a,f=!0,y=e.length,m=[],h=t.length;if(!y)return m;n&&(t=u(t,s(n))),r?(p=l,f=!1):t.length>=c&&(p=i,f=!1,t=new o(t));e:for(;++d<y;){var v=e[d],P=null==n?v:n(v);if(v=r||0!==v?v:0,f&&P===P){for(var g=h;g--;)if(t[g]===P)continue e;m.push(v)}else p(t,P,r)||m.push(v)}return m}var o=n(/*! ./_SetCache */79),a=n(/*! ./_arrayIncludes */81),l=n(/*! ./_arrayIncludesWith */155),u=n(/*! ./_arrayMap */26),s=n(/*! ./_baseUnary */89),i=n(/*! ./_cacheHas */90),c=200;e.exports=r},/*!************************************!*\
!*** ./~/lodash/_baseFindIndex.js ***!
\************************************/
function(e,t){function n(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_baseGetAllKeys.js ***!
\*************************************/
function(e,t,n){function r(e,t,n){var r=t(e);return a(e)?r:o(r,n(e))}var o=n(/*! ./_arrayPush */156),a=n(/*! ./isArray */12);e.exports=r},/*!******************************!*\
!*** ./~/lodash/_baseMap.js ***!
\******************************/
function(e,t,n){function r(e,t){var n=-1,r=a(e)?Array(e.length):[];return o(e,function(e,o,a){r[++n]=t(e,o,a)}),r}var o=n(/*! ./_baseEach */51),a=n(/*! ./isArrayLike */23);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseSetData.js ***!
\**********************************/
function(e,t,n){var r=n(/*! ./identity */37),o=n(/*! ./_metaMap */313),a=o?function(e,t){return o.set(e,t),e}:r;e.exports=a},/*!********************************!*\
!*** ./~/lodash/_baseTimes.js ***!
\********************************/
function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_castFunction.js ***!
\***********************************/
function(e,t,n){function r(e){return"function"==typeof e?e:o}var o=n(/*! ./identity */37);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_castSlice.js ***!
\********************************/
function(e,t,n){function r(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:o(e,t,n)}var o=n(/*! ./_baseSlice */88);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_composeArgs.js ***!
\**********************************/
function(e,t){function n(e,t,n,o){for(var a=-1,l=e.length,u=n.length,s=-1,i=t.length,c=r(l-u,0),d=Array(i+c),p=!o;++s<i;)d[s]=t[s];for(;++a<u;)(p||a<l)&&(d[n[a]]=e[a]);for(;c--;)d[s++]=e[a++];return d}var r=Math.max;e.exports=n},/*!***************************************!*\
!*** ./~/lodash/_composeArgsRight.js ***!
\***************************************/
function(e,t){function n(e,t,n,o){for(var a=-1,l=e.length,u=-1,s=n.length,i=-1,c=t.length,d=r(l-s,0),p=Array(d+c),f=!o;++a<d;)p[a]=e[a];for(var y=a;++i<c;)p[y+i]=t[i];for(;++u<s;)(f||a<l)&&(p[y+n[u]]=e[a++]);return p}var r=Math.max;e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_createHybrid.js ***!
\***********************************/
function(e,t,n){function r(e,t,n,g,T,b,O,_,E,N){function S(){for(var f=arguments.length,y=Array(f),m=f;m--;)y[m]=arguments[m];if(C)var h=i(S),v=l(y,h);if(g&&(y=o(y,g,T,C)),b&&(y=a(y,b,O,C)),f-=v,C&&f<N){var P=d(y,h);return s(e,t,r,S.placeholder,n,y,P,_,E,N-f)}var j=x?n:this,k=w?j[e]:e;return f=y.length,_?y=c(y,_):I&&f>1&&y.reverse(),M&&E<f&&(y.length=E),this&&this!==p&&this instanceof S&&(k=A||u(k)),k.apply(j,y)}var M=t&v,x=t&f,w=t&y,C=t&(m|h),I=t&P,A=w?void 0:u(e);return S}var o=n(/*! ./_composeArgs */296),a=n(/*! ./_composeArgsRight */297),l=n(/*! ./_countHolders */537),u=n(/*! ./_createCtor */92),s=n(/*! ./_createRecurry */299),i=n(/*! ./_getHolder */166),c=n(/*! ./_reorder */588),d=n(/*! ./_replaceHolders */99),p=n(/*! ./_root */18),f=1,y=2,m=8,h=16,v=128,P=512;e.exports=r},/*!************************************!*\
!*** ./~/lodash/_createRecurry.js ***!
\************************************/
function(e,t,n){function r(e,t,n,r,f,y,m,h,v,P){var g=t&c,T=g?m:void 0,b=g?void 0:m,O=g?y:void 0,_=g?void 0:y;t|=g?d:p,t&=~(g?p:d),t&i||(t&=~(u|s));var E=[e,t,f,O,T,_,b,h,v,P],N=n.apply(void 0,E);return o(e)&&a(N,E),N.placeholder=r,l(N,e,t)}var o=n(/*! ./_isLaziable */309),a=n(/*! ./_setData */317),l=n(/*! ./_setWrapToString */318),u=1,s=2,i=4,c=8,d=32,p=64;e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_defineProperty.js ***!
\*************************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},/*!**********************************!*\
!*** ./~/lodash/_equalArrays.js ***!
\**********************************/
function(e,t,n){function r(e,t,n,r,i,c){var d=n&u,p=e.length,f=t.length;if(p!=f&&!(d&&f>p))return!1;var y=c.get(e);if(y&&c.get(t))return y==t;var m=-1,h=!0,v=n&s?new o:void 0;for(c.set(e,t),c.set(t,e);++m<p;){var P=e[m],g=t[m];if(r)var T=d?r(g,P,m,t,e,c):r(P,g,m,e,t,c);if(void 0!==T){if(T)continue;h=!1;break}if(v){if(!a(t,function(e,t){if(!l(v,t)&&(P===e||i(P,e,n,r,c)))return v.push(t)})){h=!1;break}}else if(P!==g&&!i(P,g,n,r,c)){h=!1;break}}return c.delete(e),c.delete(t),h}var o=n(/*! ./_SetCache */79),a=n(/*! ./_arraySome */285),l=n(/*! ./_cacheHas */90),u=1,s=2;e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_freeGlobal.js ***!
\*********************************/
function(e,t){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,function(){return this}())},/*!*********************************!*\
!*** ./~/lodash/_getAllKeys.js ***!
\*********************************/
function(e,t,n){function r(e){return o(e,l,a)}var o=n(/*! ./_baseGetAllKeys */290),a=n(/*! ./_getSymbols */167),l=n(/*! ./keys */20);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_getAllKeysIn.js ***!
\***********************************/
function(e,t,n){function r(e){return o(e,l,a)}var o=n(/*! ./_baseGetAllKeys */290),a=n(/*! ./_getSymbolsIn */306),l=n(/*! ./keysIn */336);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_getFuncName.js ***!
\**********************************/
function(e,t,n){function r(e){for(var t=e.name+"",n=o[t],r=l.call(o,t)?n.length:0;r--;){var a=n[r],u=a.func;if(null==u||u==e)return a.name}return t}var o=n(/*! ./_realNames */587),a=Object.prototype,l=a.hasOwnProperty;e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_getSymbolsIn.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./_arrayPush */156),o=n(/*! ./_getPrototype */96),a=n(/*! ./_getSymbols */167),l=n(/*! ./stubArray */342),u=Object.getOwnPropertySymbols,s=u?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:l;e.exports=s},/*!******************************!*\
!*** ./~/lodash/_hasPath.js ***!
\******************************/
function(e,t,n){function r(e,t,n){t=o(t,e);for(var r=-1,c=t.length,d=!1;++r<c;){var p=i(t[r]);if(!(d=null!=e&&n(e,p)))break;e=e[p]}return d||++r!=c?d:(c=null==e?0:e.length,!!c&&s(c)&&u(p,c)&&(l(e)||a(e)))}var o=n(/*! ./_castPath */43),a=n(/*! ./isArguments */101),l=n(/*! ./isArray */12),u=n(/*! ./_isIndex */62),s=n(/*! ./isLength */175),i=n(/*! ./_toKey */36);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_hasUnicode.js ***!
\*********************************/
function(e,t){function n(e){return c.test(e)}var r="\\ud800-\\udfff",o="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",l="\\u20d0-\\u20ff",u=o+a+l,s="\\ufe0e\\ufe0f",i="\\u200d",c=RegExp("["+i+r+u+s+"]");e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_isLaziable.js ***!
\*********************************/
function(e,t,n){function r(e){var t=l(e),n=u[t];if("function"!=typeof n||!(t in o.prototype))return!1;if(e===n)return!0;var r=a(n);return!!r&&e===r[0]}var o=n(/*! ./_LazyWrapper */150),a=n(/*! ./_getData */165),l=n(/*! ./_getFuncName */305),u=n(/*! ./wrapperLodash */656);e.exports=r},/*!*****************************************!*\
!*** ./~/lodash/_isStrictComparable.js ***!
\*****************************************/
function(e,t,n){function r(e){return e===e&&!o(e)}var o=n(/*! ./isObject */19);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_mapToArray.js ***!
\*********************************/
function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=n},/*!**********************************************!*\
!*** ./~/lodash/_matchesStrictComparable.js ***!
\**********************************************/
function(e,t){function n(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}e.exports=n},/*!******************************!*\
!*** ./~/lodash/_metaMap.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_WeakMap */282),o=r&&new r;e.exports=o},/*!******************************!*\
!*** ./~/lodash/_overArg.js ***!
\******************************/
function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_overRest.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,l=-1,u=a(r.length-t,0),s=Array(u);++l<u;)s[l]=r[t+l];l=-1;for(var i=Array(t+1);++l<t;)i[l]=r[l];return i[t]=n(s),o(e,this,i)}}var o=n(/*! ./_apply */80),a=Math.max;e.exports=r},/*!*****************************!*\
!*** ./~/lodash/_parent.js ***!
\*****************************/
function(e,t,n){function r(e,t){return t.length<2?e:o(e,a(t,0,-1))}var o=n(/*! ./_baseGet */86),a=n(/*! ./_baseSlice */88);e.exports=r},/*!******************************!*\
!*** ./~/lodash/_setData.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_baseSetData */292),o=n(/*! ./_shortOut */319),a=o(r);e.exports=a},/*!**************************************!*\
!*** ./~/lodash/_setWrapToString.js ***!
\**************************************/
function(e,t,n){function r(e,t,n){var r=t+"";return l(e,a(r,u(o(r),n)))}var o=n(/*! ./_getWrapDetails */557),a=n(/*! ./_insertWrapDetails */567),l=n(/*! ./_setToString */170),u=n(/*! ./_updateWrapDetails */599);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_shortOut.js ***!
\*******************************/
function(e,t){function n(e){var t=0,n=0;return function(){var l=a(),u=o-(l-n);if(n=l,u>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var r=800,o=16,a=Date.now;e.exports=n},/*!************************************!*\
!*** ./~/lodash/_stringToArray.js ***!
\************************************/
function(e,t,n){function r(e){return a(e)?l(e):o(e)}var o=n(/*! ./_asciiToArray */485),a=n(/*! ./_hasUnicode */308),l=n(/*! ./_unicodeToArray */597);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_stringToPath.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./_memoizeCapped */581),o=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,u=r(function(e){var t=[];return o.test(e)&&t.push(""),e.replace(a,function(e,n,r,o){t.push(r?o.replace(l,"$1"):n||e)}),t});e.exports=u},/*!*******************************!*\
!*** ./~/lodash/_toSource.js ***!
\*******************************/
function(e,t){function n(e){if(null!=e){try{return o.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var r=Function.prototype,o=r.toString;e.exports=n},/*!*****************************!*\
!*** ./~/lodash/compact.js ***!
\*****************************/
function(e,t){function n(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var a=e[t];a&&(o[r++]=a)}return o}e.exports=n},/*!***************************!*\
!*** ./~/lodash/curry.js ***!
\***************************/
function(e,t,n){function r(e,t,n){t=n?void 0:t;var l=o(e,a,void 0,void 0,void 0,void 0,void 0,t);return l.placeholder=r.placeholder,l}var o=n(/*! ./_createWrap */93),a=8;r.placeholder={},e.exports=r},/*!********************************!*\
!*** ./~/lodash/difference.js ***!
\********************************/
function(e,t,n){var r=n(/*! ./_baseDifference */288),o=n(/*! ./_baseFlatten */85),a=n(/*! ./_baseRest */35),l=n(/*! ./isArrayLikeObject */102),u=a(function(e,t){return l(e)?r(e,o(t,1,l,!0)):[]});e.exports=u},/*!****************************!*\
!*** ./~/lodash/filter.js ***!
\****************************/
function(e,t,n){function r(e,t){var n=u(e)?o:a;return n(e,l(t,3))}var o=n(/*! ./_arrayFilter */283),a=n(/*! ./_baseFilter */490),l=n(/*! ./_baseIteratee */22),u=n(/*! ./isArray */12);e.exports=r},/*!**************************!*\
!*** ./~/lodash/find.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_createFind */545),o=n(/*! ./findIndex */328),a=r(o);e.exports=a},/*!*******************************!*\
!*** ./~/lodash/findIndex.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var s=null==n?0:l(n);return s<0&&(s=u(r+s,0)),o(e,a(t,3),s)}var o=n(/*! ./_baseFindIndex */289),a=n(/*! ./_baseIteratee */22),l=n(/*! ./toInteger */28),u=Math.max;e.exports=r},/*!*****************************!*\
!*** ./~/lodash/forEach.js ***!
\*****************************/
function(e,t,n){function r(e,t){var n=u(e)?o:a;return n(e,l(t))}var o=n(/*! ./_arrayEach */60),a=n(/*! ./_baseEach */51),l=n(/*! ./_castFunction */294),u=n(/*! ./isArray */12);e.exports=r},/*!*****************************!*\
!*** ./~/lodash/fp/flow.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("flow",n(/*! ../flow */611));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*********************************!*\
!*** ./~/lodash/fp/includes.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("includes",n(/*! ../includes */55));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!******************************!*\
!*** ./~/lodash/fp/isNil.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("isNil",n(/*! ../isNil */6),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!***************************!*\
!*** ./~/lodash/hasIn.js ***!
\***************************/
function(e,t,n){function r(e,t){return null!=e&&a(e,t,o)}var o=n(/*! ./_baseHasIn */493),a=n(/*! ./_hasPath */307);e.exports=r},/*!******************************!*\
!*** ./~/lodash/isNumber.js ***!
\******************************/
function(e,t,n){function r(e){return"number"==typeof e||a(e)&&o(e)==l}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isObjectLike */24),l="[object Number]";e.exports=r},/*!******************************!*\
!*** ./~/lodash/isString.js ***!
\******************************/
function(e,t,n){function r(e){return"string"==typeof e||!a(e)&&l(e)&&o(e)==u}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isArray */12),l=n(/*! ./isObjectLike */24),u="[object String]";e.exports=r},/*!****************************!*\
!*** ./~/lodash/keysIn.js ***!
\****************************/
function(e,t,n){function r(e){return l(e)?o(e,!0):a(e)}var o=n(/*! ./_arrayLikeKeys */284),a=n(/*! ./_baseKeysIn */503),l=n(/*! ./isArrayLike */23);e.exports=r},/*!**************************!*\
!*** ./~/lodash/last.js ***!
\**************************/
function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},/*!**************************!*\
!*** ./~/lodash/noop.js ***!
\**************************/
function(e,t){function n(){}e.exports=n},/*!****************************!*\
!*** ./~/lodash/reduce.js ***!
\****************************/
function(e,t,n){function r(e,t,n){var r=s(e)?o:u,i=arguments.length<3;return r(e,l(t,4),n,i,a)}var o=n(/*! ./_arrayReduce */82),a=n(/*! ./_baseEach */51),l=n(/*! ./_baseIteratee */22),u=n(/*! ./_baseReduce */513),s=n(/*! ./isArray */12);e.exports=r},/*!**************************!*\
!*** ./~/lodash/some.js ***!
\**************************/
function(e,t,n){function r(e,t,n){var r=u(e)?o:l;return n&&s(e,t,n)&&(t=void 0),r(e,a(t,3))}var o=n(/*! ./_arraySome */285),a=n(/*! ./_baseIteratee */22),l=n(/*! ./_baseSome */516),u=n(/*! ./isArray */12),s=n(/*! ./_isIterateeCall */97);e.exports=r},/*!********************************!*\
!*** ./~/lodash/startsWith.js ***!
\********************************/
function(e,t,n){function r(e,t,n){return e=u(e),n=null==n?0:o(l(n),0,e.length),t=a(t),e.slice(n,n+t.length)==t}var o=n(/*! ./_baseClamp */287),a=n(/*! ./_baseToString */163),l=n(/*! ./toInteger */28),u=n(/*! ./toString */29);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/stubArray.js ***!
\*******************************/
function(e,t){function n(){return[]}e.exports=n},/*!***************************!*\
!*** ./~/lodash/times.js ***!
\***************************/
function(e,t,n){function r(e,t){if(e=l(e),e<1||e>u)return[];var n=s,r=i(e,s);t=a(t),e-=s;for(var c=o(r,t);++n<e;)t(n);return c}var o=n(/*! ./_baseTimes */293),a=n(/*! ./_castFunction */294),l=n(/*! ./toInteger */28),u=9007199254740991,s=4294967295,i=Math.min;e.exports=r},/*!******************************!*\
!*** ./~/lodash/toFinite.js ***!
\******************************/
function(e,t,n){function r(e){if(!e)return 0===e?e:0;if(e=o(e),e===a||e===-a){var t=e<0?-1:1;return t*l}return e===e?e:0}var o=n(/*! ./toNumber */106),a=1/0,l=1.7976931348623157e308;e.exports=r},/*!***************************************!*\
!*** ./src/addons/Confirm/Confirm.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/has */54),m=r(y),h=n(/*! react */1),v=r(h),P=n(/*! ../../lib */4),g=n(/*! ../../elements/Button */110),T=r(g),b=n(/*! ../../modules/Modal */237),O=r(b),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleCancel=function(e){var t=r.props.onCancel;t&&t(e,r.props)},r.handleConfirm=function(e){var t=r.props.onConfirm;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.cancelButton,r=e.confirmButton,o=e.content,l=e.header,u=e.open,s=(0,P.getUnhandledProps)(t,this.props),i={};return(0,m.default)(this.props,"open")&&(i.open=u),v.default.createElement(O.default,(0,a.default)({},s,i,{size:"small",onClose:this.handleCancel}),O.default.Header.create(l),O.default.Content.create(o),v.default.createElement(O.default.Actions,null,T.default.create(n,{onClick:this.handleCancel}),T.default.create(r,{onClick:this.handleConfirm,primary:!0})))}}]),t}(h.Component);_.defaultProps={cancelButton:"Cancel",confirmButton:"OK",content:"Are you sure?"},_._meta={name:"Confirm",type:P.META.TYPES.ADDON},"production"!==e.env.NODE_ENV?_.propTypes={cancelButton:P.customPropTypes.itemShorthand,confirmButton:P.customPropTypes.itemShorthand,content:P.customPropTypes.itemShorthand,header:P.customPropTypes.itemShorthand,onCancel:h.PropTypes.func,onConfirm:h.PropTypes.func,open:h.PropTypes.bool}:void 0,_.handledProps=["cancelButton","confirmButton","content","header","onCancel","onConfirm","open"],t.default=_}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/addons/Confirm/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Confirm */345),a=r(o);t.default=a.default},/*!*************************************!*\
!*** ./src/addons/Portal/Portal.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/invoke */172),m=r(y),h=n(/*! react */1),v=n(/*! react-dom */658),P=r(v),g=n(/*! ../../lib */4),T=(0,g.makeDebugger)("portal"),b=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var l=arguments.length,s=Array(l),i=0;i<l;i++)s[i]=arguments[i];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={},r.handleDocumentClick=function(e){var t=r.props,n=t.closeOnDocumentClick,o=t.closeOnRootNodeClick;if(r.rootNode&&r.portalNode&&!(0,m.default)(r,"triggerNode.contains",e.target)&&!(0,m.default)(r,"portalNode.contains",e.target)){var a=r.rootNode.contains(e.target);(n&&!a||o&&a)&&(T("handleDocumentClick()"),r.close(e))}},r.handleEscape=function(e){r.props.closeOnEscape&&g.keyboardKey.getCode(e)===g.keyboardKey.Escape&&(T("handleEscape()"),r.close(e))},r.handlePortalMouseLeave=function(e){var t=r.props,n=t.closeOnPortalMouseLeave,o=t.mouseLeaveDelay;n&&(T("handlePortalMouseLeave()"),r.mouseLeaveTimer=r.closeWithTimeout(e,o))},r.handlePortalMouseEnter=function(e){var t=r.props.closeOnPortalMouseLeave;t&&(T("handlePortalMouseEnter()"),clearTimeout(r.mouseLeaveTimer))},r.handleTriggerBlur=function(e){var t=r.props,n=t.trigger,o=t.closeOnTriggerBlur;(0,m.default)(n,"props.onBlur",e);var a=(0,m.default)(r,"rootNode.contains",e.relatedTarget);o&&!a&&(T("handleTriggerBlur()"),r.close(e))},r.handleTriggerClick=function(e){var t=r.props,n=t.trigger,o=t.closeOnTriggerClick,a=t.openOnTriggerClick,l=r.state.open;(0,m.default)(n,"props.onClick",e),l&&o?(T("handleTriggerClick() - close"),r.close(e)):!l&&a&&(T("handleTriggerClick() - open"),r.open(e))},r.handleTriggerFocus=function(e){var t=r.props,n=t.trigger,o=t.openOnTriggerFocus;(0,m.default)(n,"props.onFocus",e),o&&(T("handleTriggerFocus()"),r.open(e))},r.handleTriggerMouseLeave=function(e){clearTimeout(r.mouseEnterTimer);var t=r.props,n=t.trigger,o=t.closeOnTriggerMouseLeave,a=t.mouseLeaveDelay;(0,m.default)(n,"props.onMouseLeave",e),o&&(T("handleTriggerMouseLeave()"),r.mouseLeaveTimer=r.closeWithTimeout(e,a))},r.handleTriggerMouseEnter=function(e){clearTimeout(r.mouseLeaveTimer);var t=r.props,n=t.trigger,o=t.mouseEnterDelay,a=t.openOnTriggerMouseEnter;(0,m.default)(n,"props.onMouseEnter",r.handleTriggerMouseEnter),a&&(T("handleTriggerMouseEnter()"),r.mouseEnterTimer=r.openWithTimeout(e,o))},r.open=function(e){T("open()");var t=r.props.onOpen;t&&t(e,r.props),r.trySetState({open:!0})},r.openWithTimeout=function(e,t){T("openWithTimeout()",t);var n=(0,a.default)({},e);return setTimeout(function(){return r.open(n)},t||0)},r.close=function(e){T("close()");var t=r.props.onClose;t&&t(e,r.props),r.trySetState({open:!1})},r.closeWithTimeout=function(e,t){T("closeWithTimeout()",t);var n=(0,a.default)({},e);return setTimeout(function(){return r.close(n)},t||0)},r.mountPortal=function(){if(g.isBrowser&&!r.rootNode){T("mountPortal()");var e=r.props,t=e.mountNode,n=void 0===t?g.isBrowser?document.body:null:t,o=e.prepend;r.rootNode=document.createElement("div"),o?n.insertBefore(r.rootNode,n.firstElementChild):n.appendChild(r.rootNode),document.addEventListener("click",r.handleDocumentClick),document.addEventListener("keydown",r.handleEscape);var a=r.props.onMount;a&&a(null,r.props)}},r.unmountPortal=function(){if(g.isBrowser&&r.rootNode){T("unmountPortal()"),P.default.unmountComponentAtNode(r.rootNode),r.rootNode.parentNode.removeChild(r.rootNode),r.portalNode.removeEventListener("mouseleave",r.handlePortalMouseLeave),r.portalNode.removeEventListener("mouseenter",r.handlePortalMouseEnter),r.rootNode=null,r.portalNode=null,document.removeEventListener("click",r.handleDocumentClick),document.removeEventListener("keydown",r.handleEscape);var e=r.props.onUnmount;e&&e(null,r.props)}},r.handleRef=function(e){r.triggerNode=P.default.findDOMNode(e)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){T("componentDidMount()"),this.renderPortal()}},{key:"componentDidUpdate",value:function(e,t){T("componentDidUpdate()"),this.renderPortal(),t.open&&!this.state.open&&(T("portal closed"),this.unmountPortal())}},{key:"componentWillUnmount",value:function(){this.unmountPortal(),clearTimeout(this.mouseEnterTimer),clearTimeout(this.mouseLeaveTimer)}},{key:"renderPortal",value:function(){var e=this;if(this.state.open){T("renderPortal()");var t=this.props,n=t.children,r=t.className;if(this.mountPortal(),!g.isBrowser)return null;this.rootNode.className=r||"",this.portalNode&&(this.portalNode.removeEventListener("mouseleave",this.handlePortalMouseLeave),this.portalNode.removeEventListener("mouseenter",this.handlePortalMouseEnter)),P.default.unstable_renderSubtreeIntoContainer(this,h.Children.only(n),this.rootNode,function(){e.portalNode=e.rootNode.firstElementChild,e.portalNode.addEventListener("mouseleave",e.handlePortalMouseLeave),e.portalNode.addEventListener("mouseenter",e.handlePortalMouseEnter)})}}},{key:"render",value:function(){var e=this.props.trigger;return e?(0,h.cloneElement)(e,{ref:this.handleRef,onBlur:this.handleTriggerBlur,onClick:this.handleTriggerClick,onFocus:this.handleTriggerFocus,onMouseLeave:this.handleTriggerMouseLeave,onMouseEnter:this.handleTriggerMouseEnter}):null}}]),t}(g.AutoControlledComponent);b.defaultProps={closeOnDocumentClick:!0,closeOnEscape:!0,openOnTriggerClick:!0},b.autoControlledProps=["open"],b._meta={name:"Portal",type:g.META.TYPES.ADDON},"production"!==e.env.NODE_ENV?b.propTypes={children:h.PropTypes.node.isRequired,className:h.PropTypes.string,closeOnDocumentClick:h.PropTypes.bool,closeOnEscape:h.PropTypes.bool,closeOnPortalMouseLeave:h.PropTypes.bool,closeOnRootNodeClick:h.PropTypes.bool,closeOnTriggerBlur:h.PropTypes.bool,closeOnTriggerClick:h.PropTypes.bool,closeOnTriggerMouseLeave:h.PropTypes.bool,defaultOpen:h.PropTypes.bool,mountNode:h.PropTypes.any,mouseLeaveDelay:h.PropTypes.number,mouseEnterDelay:h.PropTypes.number,onClose:h.PropTypes.func,onMount:h.PropTypes.func,onOpen:h.PropTypes.func,onUnmount:h.PropTypes.func,open:h.PropTypes.bool,openOnTriggerClick:h.PropTypes.bool,openOnTriggerFocus:h.PropTypes.bool,openOnTriggerMouseEnter:h.PropTypes.bool,prepend:h.PropTypes.bool,trigger:h.PropTypes.node}:void 0,b.handledProps=["children","className","closeOnDocumentClick","closeOnEscape","closeOnPortalMouseLeave","closeOnRootNodeClick","closeOnTriggerBlur","closeOnTriggerClick","closeOnTriggerMouseLeave","defaultOpen","mountNode","mouseEnterDelay","mouseLeaveDelay","onClose","onMount","onOpen","onUnmount","open","openOnTriggerClick","openOnTriggerFocus","openOnTriggerMouseEnter","prepend","trigger"],t.default=b}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************!*\
!*** ./src/addons/Radio/Radio.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.slider,n=e.toggle,r=e.type,a=(0,i.getUnhandledProps)(o,e),u=!(t||n)||void 0;return s.default.createElement(d.default,(0,l.default)({},a,{type:r,radio:u,slider:t,toggle:n}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../modules/Checkbox */72),d=r(c);o.handledProps=["slider","toggle","type"],o._meta={name:"Radio",type:i.META.TYPES.ADDON},"production"!==e.env.NODE_ENV?o.propTypes={slider:d.default.propTypes.slider,toggle:d.default.propTypes.toggle,type:d.default.propTypes.type}:void 0,o.defaultProps={type:"radio"},t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/addons/Select/Select.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){return s.default.createElement(d.default,(0,l.default)({},e,{selection:!0}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! react */1),s=r(u),i=n(/*! ../../lib */4),c=n(/*! ../../modules/Dropdown */118),d=r(c);o.handledProps=[],o._meta={name:"Select",type:i.META.TYPES.ADDON},o.Divider=d.default.Divider,o.Header=d.default.Header,o.Item=d.default.Item,o.Menu=d.default.Menu,t.default=o},/*!*****************************************!*\
!*** ./src/addons/TextArea/TextArea.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! react */1),m=r(y),h=n(/*! ../../lib */4),v=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var l=arguments.length,s=Array(l),i=0;i<l;i++)s[i]=arguments[i];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.handleChange=function(e){var t=r.props.onChange;t&&t(e,(0,a.default)({},r.props,{value:e.target&&e.target.value})),r.updateHeight(e.target)},r.handleRef=function(e){return r.ref=e},r.removeAutoHeightStyles=function(){r.ref.removeAttribute("rows"),r.ref.style.height=null,r.ref.style.minHeight=null,r.ref.style.resize=null},r.updateHeight=function(){if(r.ref){var e=r.props.autoHeight;if(e){var t=window.getComputedStyle(r.ref),n=t.borderTopWidth,o=t.borderBottomWidth;n=parseInt(n,10),o=parseInt(o,10),r.ref.rows="1",r.ref.style.minHeight="0",r.ref.style.resize="none",r.ref.style.height="auto",r.ref.style.height=r.ref.scrollHeight+n+o+"px"}}},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){this.updateHeight()}},{key:"componentDidUpdate",value:function(e,t){!this.props.autoHeight&&e.autoHeight&&this.removeAutoHeightStyles(),(this.props.autoHeight&&!e.autoHeight||e.value!==this.props.value)&&this.updateHeight()}},{key:"render",value:function(){var e=this.props.value,n=(0,h.getUnhandledProps)(t,this.props),r=(0,h.getElementType)(t,this.props);return m.default.createElement(r,(0,a.default)({},n,{onChange:this.handleChange,ref:this.handleRef,value:e}))}}]),t}(y.Component);v._meta={name:"TextArea",type:h.META.TYPES.ADDON},v.defaultProps={as:"textarea"},"production"!==e.env.NODE_ENV?v.propTypes={as:h.customPropTypes.as,autoHeight:y.PropTypes.bool,onChange:y.PropTypes.func,value:y.PropTypes.string}:void 0,v.handledProps=["as","autoHeight","onChange","value"],t.default=v}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************************!*\
!*** ./src/collections/Breadcrumb/Breadcrumb.js ***!
\**************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.divider,a=e.icon,u=e.sections,s=e.size,i=(0,h.default)("ui",s,"breadcrumb",n),d=(0,g.getUnhandledProps)(o,e),f=(0,g.getElementType)(o,e);if(!(0,y.default)(t))return P.default.createElement(f,(0,l.default)({},d,{className:i}),t);var m=[];return(0,p.default)(u,function(e,t){var n=_.default.create(e);if(m.push(n),t!==u.length-1){var o=void 0;o=e.key?e.key+"_divider":(0,c.default)(n.props,function(e,t){return t+"="+("function"==typeof e?e.name||"func":e)}).join("|"),m.push(b.default.create({content:r,icon:a,key:o}))}}),P.default.createElement(f,(0,l.default)({},d,{className:i}),m)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/each */171),p=r(d),f=n(/*! lodash/isNil */6),y=r(f),m=n(/*! classnames */5),h=r(m),v=n(/*! react */1),P=r(v),g=n(/*! ../../lib */4),T=n(/*! ./BreadcrumbDivider */182),b=r(T),O=n(/*! ./BreadcrumbSection */183),_=r(O);o.handledProps=["as","children","className","divider","icon","sections","size"],o._meta={name:"Breadcrumb",type:g.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:g.customPropTypes.as,children:v.PropTypes.node,className:v.PropTypes.string,divider:g.customPropTypes.every([g.customPropTypes.disallow(["icon"]),g.customPropTypes.contentShorthand]),icon:g.customPropTypes.every([g.customPropTypes.disallow(["divider"]),g.customPropTypes.itemShorthand]),sections:g.customPropTypes.collectionShorthand,size:v.PropTypes.oneOf((0,s.default)(g.SUI.SIZES,"medium"))}:void 0,o.Divider=b.default,o.Section=_.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************************!*\
!*** ./src/collections/Breadcrumb/index.js ***!
\*********************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Breadcrumb */351),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/collections/Form/Form.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.error,a=e.inverted,u=e.loading,s=e.reply,i=e.size,d=e.success,y=e.warning,m=e.widths,h=(0,c.default)("ui",i,(0,f.useKeyOnly)(r,"error"),(0,f.useKeyOnly)(a,"inverted"),(0,f.useKeyOnly)(u,"loading"),(0,f.useKeyOnly)(s,"reply"),(0,f.useKeyOnly)(d,"success"),(0,f.useKeyOnly)(y,"warning"),(0,f.useWidthProp)(m,null,!0),"form",n),v=(0,f.getUnhandledProps)(o,e),P=(0,f.getElementType)(o,e);return p.default.createElement(P,(0,l.default)({},v,{className:h}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./FormButton */184),m=r(y),h=n(/*! ./FormCheckbox */185),v=r(h),P=n(/*! ./FormDropdown */186),g=r(P),T=n(/*! ./FormField */25),b=r(T),O=n(/*! ./FormGroup */187),_=r(O),E=n(/*! ./FormInput */188),N=r(E),S=n(/*! ./FormRadio */189),M=r(S),x=n(/*! ./FormSelect */190),w=r(x),C=n(/*! ./FormTextArea */191),I=r(C);o.handledProps=["as","children","className","error","inverted","loading","reply","size","success","warning","widths"],"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,children:d.PropTypes.node,className:d.PropTypes.string,error:d.PropTypes.bool,inverted:d.PropTypes.bool,loading:d.PropTypes.bool,reply:d.PropTypes.bool,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium")),success:d.PropTypes.bool,warning:d.PropTypes.bool,widths:d.PropTypes.oneOf(["equal"])}:void 0,o.defaultProps={as:"form"},o._meta={name:"Form",type:f.META.TYPES.COLLECTION},o.Field=b.default,o.Button=m.default,o.Checkbox=v.default,o.Dropdown=g.default,o.Group=_.default,o.Input=N.default,o.Radio=M.default,o.Select=w.default,o.TextArea=I.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/collections/Form/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Form */353),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/collections/Grid/Grid.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.celled,n=e.centered,r=e.children,a=e.className,l=e.columns,u=e.container,i=e.divided,d=e.doubling,y=e.padded,m=e.relaxed,h=e.reversed,v=e.stackable,P=e.stretched,g=e.textAlign,T=e.verticalAlign,b=(0,c.default)("ui",(0,f.useKeyOnly)(n,"centered"),(0,f.useKeyOnly)(u,"container"),(0,f.useKeyOnly)(d,"doubling"),(0,f.useKeyOnly)(v,"stackable"),(0,f.useKeyOnly)(P,"stretched"),(0,f.useKeyOrValueAndKey)(t,"celled"),(0,f.useKeyOrValueAndKey)(i,"divided"),(0,f.useKeyOrValueAndKey)(y,"padded"),(0,f.useKeyOrValueAndKey)(m,"relaxed"),(0,f.useTextAlignProp)(g),(0,f.useValueAndKey)(h,"reversed"),(0,f.useVerticalAlignProp)(T),(0,f.useWidthProp)(l,"column",!0),"grid",a),O=(0,f.getUnhandledProps)(o,e),_=(0,f.getElementType)(o,e);return p.default.createElement(_,(0,s.default)({},O,{className:b}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/toConsumableArray */39),l=r(a),u=n(/*! babel-runtime/helpers/extends */2),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./GridColumn */192),m=r(y),h=n(/*! ./GridRow */193),v=r(h);o.handledProps=["as","celled","centered","children","className","columns","container","divided","doubling","padded","relaxed","reversed","stackable","stretched","textAlign","verticalAlign"],o.Column=m.default,o.Row=v.default,o._meta={name:"Grid",type:f.META.TYPES.COLLECTION},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,celled:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["internally"])]),centered:d.PropTypes.bool,children:d.PropTypes.node,className:d.PropTypes.string,columns:d.PropTypes.oneOf([].concat((0,l.default)(f.SUI.WIDTHS),["equal"])),container:d.PropTypes.bool,divided:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["vertically"])]),doubling:d.PropTypes.bool,padded:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["horizontally","vertically"])]),relaxed:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["very"])]),reversed:d.PropTypes.oneOf(["computer","computer vertically","mobile","mobile vertically","tablet","tablet vertically"]),stackable:d.PropTypes.bool,stretched:d.PropTypes.bool,textAlign:d.PropTypes.oneOf(f.SUI.TEXT_ALIGNMENTS),verticalAlign:d.PropTypes.oneOf(f.SUI.VERTICAL_ALIGNMENTS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/collections/Grid/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Grid */355),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/collections/Menu/Menu.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! lodash/map */16),v=r(h),P=n(/*! lodash/get */53),g=r(P),T=n(/*! lodash/without */13),b=r(T),O=n(/*! classnames */5),_=r(O),E=n(/*! react */1),N=r(E),S=n(/*! ../../lib */4),M=n(/*! ./MenuHeader */194),x=r(M),w=n(/*! ./MenuItem */195),C=r(w),I=n(/*! ./MenuMenu */196),A=r(I),j=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleItemClick=function(e,t){var n=t.index,o=r.props,a=o.items,l=o.onItemClick;r.trySetState({activeIndex:n}),(0,g.default)(a[n],"onClick")&&a[n].onClick(e,t),l&&l(e,t)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"renderItems",value:function(){var e=this,t=this.props.items,n=this.state.activeIndex;return(0,v.default)(t,function(t,r){return C.default.create(t,{active:n===r,index:r,onClick:e.handleItemClick})})}},{key:"render",value:function(){var e=this.props,n=e.attached,r=e.borderless,o=e.children,l=e.className,u=e.color,s=e.compact,i=e.fixed,c=e.floated,d=e.fluid,p=e.icon,f=e.inverted,y=e.pagination,h=e.pointing,v=e.secondary,P=e.size,g=e.stackable,T=e.tabular,b=e.text,O=e.vertical,E=e.widths,M=(0,_.default)("ui",u,P,(0,S.useKeyOnly)(r,"borderless"),(0,S.useKeyOnly)(s,"compact"),(0,S.useKeyOnly)(d,"fluid"),(0,S.useKeyOnly)(f,"inverted"),(0,S.useKeyOnly)(y,"pagination"),(0,S.useKeyOnly)(h,"pointing"),(0,S.useKeyOnly)(v,"secondary"),(0,S.useKeyOnly)(g,"stackable"),(0,S.useKeyOnly)(b,"text"),(0,S.useKeyOnly)(O,"vertical"),(0,S.useKeyOrValueAndKey)(n,"attached"),(0,S.useKeyOrValueAndKey)(c,"floated"),(0,S.useKeyOrValueAndKey)(p,"icon"),(0,S.useKeyOrValueAndKey)(T,"tabular"),(0,S.useValueAndKey)(i,"fixed"),(0,S.useWidthProp)(E,"item"),l,"menu"),x=(0,S.getUnhandledProps)(t,this.props),w=(0,S.getElementType)(t,this.props);return N.default.createElement(w,(0,a.default)({},x,{className:M}),(0,m.default)(o)?this.renderItems():o)}}]),t}(S.AutoControlledComponent);j._meta={name:"Menu",type:S.META.TYPES.COLLECTION},j.autoControlledProps=["activeIndex"],j.Header=x.default,j.Item=C.default,j.Menu=A.default,"production"!==e.env.NODE_ENV?j.propTypes={as:S.customPropTypes.as,activeIndex:E.PropTypes.number,attached:E.PropTypes.oneOfType([E.PropTypes.bool,E.PropTypes.oneOf(["top","bottom"])]),borderless:E.PropTypes.bool,children:E.PropTypes.node,className:E.PropTypes.string,color:E.PropTypes.oneOf(S.SUI.COLORS),compact:E.PropTypes.bool,defaultActiveIndex:E.PropTypes.number,fixed:E.PropTypes.oneOf(["left","right","bottom","top"]),floated:E.PropTypes.oneOfType([E.PropTypes.bool,E.PropTypes.oneOf(["right"])]),fluid:E.PropTypes.bool,icon:E.PropTypes.oneOfType([E.PropTypes.bool,E.PropTypes.oneOf(["labeled"])]),inverted:E.PropTypes.bool,items:S.customPropTypes.collectionShorthand,onItemClick:S.customPropTypes.every([S.customPropTypes.disallow(["children"]),E.PropTypes.func]),pagination:E.PropTypes.bool,pointing:E.PropTypes.bool,secondary:E.PropTypes.bool,size:E.PropTypes.oneOf((0,b.default)(S.SUI.SIZES,"medium","big")),stackable:E.PropTypes.bool,tabular:E.PropTypes.oneOfType([E.PropTypes.bool,E.PropTypes.oneOf(["right"])]),text:E.PropTypes.bool,vertical:E.PropTypes.bool,widths:E.PropTypes.oneOf(S.SUI.WIDTHS)}:void 0,j.handledProps=["activeIndex","as","attached","borderless","children","className","color","compact","defaultActiveIndex","fixed","floated","fluid","icon","inverted","items","onItemClick","pagination","pointing","secondary","size","stackable","tabular","text","vertical","widths"],t.default=j}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/collections/Menu/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Menu */357),a=r(o);t.default=a.default},/*!********************************************!*\
!*** ./src/collections/Message/Message.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! lodash/without */13),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=n(/*! ../../elements/Icon */15),E=r(_),N=n(/*! ./MessageContent */197),S=r(N),M=n(/*! ./MessageHeader */198),x=r(M),w=n(/*! ./MessageList */199),C=r(w),I=n(/*! ./MessageItem */108),A=r(I),j=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleDismiss=function(e){var t=r.props.onDismiss;t&&t(e,r.props)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.attached,r=e.children,o=e.className,l=e.color,u=e.compact,s=e.content,i=e.error,c=e.floating,d=e.header,p=e.hidden,f=e.icon,y=e.info,h=e.list,v=e.negative,P=e.onDismiss,T=e.positive,_=e.size,N=e.success,M=e.visible,w=e.warning,I=(0,g.default)("ui",l,_,(0,O.useKeyOnly)(u,"compact"),(0,O.useKeyOnly)(i,"error"),(0,O.useKeyOnly)(c,"floating"),(0,O.useKeyOnly)(p,"hidden"),(0,O.useKeyOnly)(f,"icon"),(0,O.useKeyOnly)(y,"info"),(0,O.useKeyOnly)(v,"negative"),(0,O.useKeyOnly)(T,"positive"),(0,O.useKeyOnly)(N,"success"),(0,O.useKeyOnly)(M,"visible"),(0,O.useKeyOnly)(w,"warning"),(0,O.useKeyOrValueAndKey)(n,"attached"),"message",o),A=P&&b.default.createElement(E.default,{name:"close",onClick:this.handleDismiss}),j=(0,O.getUnhandledProps)(t,this.props),k=(0,O.getElementType)(t,this.props);return(0,m.default)(r)?b.default.createElement(k,(0,a.default)({},j,{className:I}),A,E.default.create(f),(!(0,m.default)(d)||!(0,m.default)(s)||!(0,m.default)(h))&&b.default.createElement(S.default,null,x.default.create(d),C.default.create(h),(0,O.createShorthand)("p",function(e){return{children:e}},s))):b.default.createElement(k,(0,a.default)({},j,{className:I}),A,r)}}]),t}(T.Component);j._meta={name:"Message",type:O.META.TYPES.COLLECTION},j.Content=S.default,j.Header=x.default,j.List=C.default,j.Item=A.default,t.default=j,"production"!==e.env.NODE_ENV?j.propTypes={as:O.customPropTypes.as,attached:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["bottom"])]),children:T.PropTypes.node,className:T.PropTypes.string,color:T.PropTypes.oneOf(O.SUI.COLORS),compact:T.PropTypes.bool,content:O.customPropTypes.contentShorthand,error:T.PropTypes.bool,floating:T.PropTypes.bool,header:O.customPropTypes.itemShorthand,hidden:T.PropTypes.bool,icon:T.PropTypes.oneOfType([O.customPropTypes.itemShorthand,T.PropTypes.bool]),info:T.PropTypes.bool,list:O.customPropTypes.collectionShorthand,negative:T.PropTypes.bool,onDismiss:T.PropTypes.func,positive:T.PropTypes.bool,success:T.PropTypes.bool,size:T.PropTypes.oneOf((0,v.default)(O.SUI.SIZES,"medium")),visible:T.PropTypes.bool,warning:T.PropTypes.bool}:void 0,j.handledProps=["as","attached","children","className","color","compact","content","error","floating","header","hidden","icon","info","list","negative","onDismiss","positive","size","success","visible","warning"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/collections/Message/index.js ***!
\******************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Message */359),a=r(o);t.default=a.default},/*!****************************************!*\
!*** ./src/collections/Table/Table.js ***!
\****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.attached,n=e.basic,r=e.celled,a=e.children,u=e.className,s=e.collapsing,i=e.color,d=e.columns,f=e.compact,m=e.definition,P=e.fixed,T=e.footerRow,b=e.headerRow,O=e.inverted,E=e.padded,S=e.renderBodyRow,M=e.selectable,x=e.singleLine,C=e.size,I=e.sortable,A=e.stackable,j=e.striped,k=e.structured,D=e.tableData,L=e.textAlign,K=e.unstackable,U=e.verticalAlign,V=(0,y.default)("ui",i,C,(0,v.useKeyOnly)(r,"celled"),(0,v.useKeyOnly)(s,"collapsing"),(0,v.useKeyOnly)(m,"definition"),(0,v.useKeyOnly)(P,"fixed"),(0,v.useKeyOnly)(O,"inverted"),(0,v.useKeyOnly)(M,"selectable"),(0,v.useKeyOnly)(x,"single line"),(0,v.useKeyOnly)(I,"sortable"),(0,v.useKeyOnly)(A,"stackable"),(0,v.useKeyOnly)(j,"striped"),(0,v.useKeyOnly)(k,"structured"),(0,v.useKeyOnly)(K,"unstackable"),(0,v.useKeyOrValueAndKey)(t,"attached"),(0,v.useKeyOrValueAndKey)(n,"basic"),(0,v.useKeyOrValueAndKey)(f,"compact"),(0,v.useKeyOrValueAndKey)(E,"padded"),(0,v.useTextAlignProp)(L),(0,v.useVerticalAlignProp)(U),(0,v.useWidthProp)(d,"column"),"table",u),R=(0,v.getUnhandledProps)(o,e),z=(0,v.getElementType)(o,e);return(0,p.default)(a)?h.default.createElement(z,(0,l.default)({},R,{className:V}),b&&h.default.createElement(N.default,null,w.default.create(b,{cellAs:"th"})),h.default.createElement(g.default,null,S&&(0,c.default)(D,function(e,t){return w.default.create(S(e,t))})),T&&h.default.createElement(_.default,null,w.default.create(T))):h.default.createElement(z,(0,l.default)({},R,{className:V}),a)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/map */16),c=r(i),d=n(/*! lodash/isNil */6),p=r(d),f=n(/*! classnames */5),y=r(f),m=n(/*! react */1),h=r(m),v=n(/*! ../../lib */4),P=n(/*! ./TableBody */200),g=r(P),T=n(/*! ./TableCell */67),b=r(T),O=n(/*! ./TableFooter */201),_=r(O),E=n(/*! ./TableHeader */109),N=r(E),S=n(/*! ./TableHeaderCell */202),M=r(S),x=n(/*! ./TableRow */203),w=r(x);o.handledProps=["as","attached","basic","celled","children","className","collapsing","color","columns","compact","definition","fixed","footerRow","headerRow","inverted","padded","renderBodyRow","selectable","singleLine","size","sortable","stackable","striped","structured","tableData","textAlign","unstackable","verticalAlign"],o._meta={name:"Table",type:v.META.TYPES.COLLECTION},o.defaultProps={as:"table"},"production"!==e.env.NODE_ENV?o.propTypes={as:v.customPropTypes.as,attached:m.PropTypes.oneOfType([m.PropTypes.bool,m.PropTypes.oneOf(["top","bottom"])]),basic:m.PropTypes.oneOfType([m.PropTypes.oneOf(["very"]),m.PropTypes.bool]),celled:m.PropTypes.bool,children:m.PropTypes.node,className:m.PropTypes.string,collapsing:m.PropTypes.bool,color:m.PropTypes.oneOf(v.SUI.COLORS),columns:m.PropTypes.oneOf(v.SUI.WIDTHS),compact:m.PropTypes.oneOfType([m.PropTypes.bool,m.PropTypes.oneOf(["very"])]),definition:m.PropTypes.bool,fixed:m.PropTypes.bool,footerRow:v.customPropTypes.itemShorthand,headerRow:v.customPropTypes.itemShorthand,inverted:m.PropTypes.bool,padded:m.PropTypes.oneOfType([m.PropTypes.bool,m.PropTypes.oneOf(["very"])]),renderBodyRow:v.customPropTypes.every([v.customPropTypes.disallow(["children"]),v.customPropTypes.demand(["tableData"]),m.PropTypes.func]),selectable:m.PropTypes.bool,singleLine:m.PropTypes.bool,size:m.PropTypes.oneOf((0,s.default)(v.SUI.SIZES,"mini","tiny","medium","big","huge","massive")),sortable:m.PropTypes.bool,stackable:m.PropTypes.bool,striped:m.PropTypes.bool,structured:m.PropTypes.bool,tableData:v.customPropTypes.every([v.customPropTypes.disallow(["children"]),v.customPropTypes.demand(["renderBodyRow"]),m.PropTypes.array]),textAlign:m.PropTypes.oneOf((0,s.default)(v.SUI.TEXT_ALIGNMENTS,"justified")),unstackable:m.PropTypes.bool,verticalAlign:m.PropTypes.oneOf(v.SUI.VERTICAL_ALIGNMENTS)}:void 0,o.Body=g.default,o.Cell=b.default,o.Footer=_.default,o.Header=N.default,o.HeaderCell=M.default,o.Row=w.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!****************************************!*\
!*** ./src/collections/Table/index.js ***!
\****************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Table */361),a=r(o);t.default=a.default},/*!*********************************************!*\
!*** ./src/elements/Container/Container.js ***!
\*********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.fluid,a=e.text,u=e.textAlign,i=(0,s.default)("ui",(0,d.useKeyOnly)(a,"text"),(0,d.useKeyOnly)(r,"fluid"),(0,d.useTextAlignProp)(u),"container",n),p=(0,d.getUnhandledProps)(o,e),f=(0,d.getElementType)(o,e);return c.default.createElement(f,(0,l.default)({},p,{className:i}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","fluid","text","textAlign"],o._meta={name:"Container",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,fluid:i.PropTypes.bool,text:i.PropTypes.bool,textAlign:i.PropTypes.oneOf(d.SUI.TEXT_ALIGNMENTS)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*****************************************!*\
!*** ./src/elements/Container/index.js ***!
\*****************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Container */363),a=r(o);t.default=a.default},/*!*****************************************!*\
!*** ./src/elements/Divider/Divider.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.clearing,a=e.fitted,u=e.hidden,i=e.horizontal,p=e.inverted,f=e.section,y=e.vertical,m=(0,s.default)("ui",(0,d.useKeyOnly)(r,"clearing"),(0,d.useKeyOnly)(a,"fitted"),(0,d.useKeyOnly)(u,"hidden"),(0,d.useKeyOnly)(i,"horizontal"),(0,d.useKeyOnly)(p,"inverted"),(0,d.useKeyOnly)(f,"section"),(0,d.useKeyOnly)(y,"vertical"),"divider",n),h=(0,d.getUnhandledProps)(o,e),v=(0,d.getElementType)(o,e);return c.default.createElement(v,(0,l.default)({},h,{className:m}),t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","children","className","clearing","fitted","hidden","horizontal","inverted","section","vertical"],o._meta={name:"Divider",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,clearing:i.PropTypes.bool,fitted:i.PropTypes.bool,hidden:i.PropTypes.bool,horizontal:i.PropTypes.bool,inverted:i.PropTypes.bool,section:i.PropTypes.bool,vertical:i.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/Divider/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Divider */365),a=r(o);t.default=a.default},/*!***********************************!*\
!*** ./src/elements/Flag/Flag.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.name,r=(0,s.default)(n,"flag",t),a=(0,d.getUnhandledProps)(o,e),u=(0,d.getElementType)(o,e);return c.default.createElement(u,(0,l.default)({},a,{className:r}))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=["ad","andorra","ae","united arab emirates","uae","af","afghanistan","ag","antigua","ai","anguilla","al","albania","am","armenia","an","netherlands antilles","ao","angola","ar","argentina","as","american samoa","at","austria","au","australia","aw","aruba","ax","aland islands","az","azerbaijan","ba","bosnia","bb","barbados","bd","bangladesh","be","belgium","bf","burkina faso","bg","bulgaria","bh","bahrain","bi","burundi","bj","benin","bm","bermuda","bn","brunei","bo","bolivia","br","brazil","bs","bahamas","bt","bhutan","bv","bouvet island","bw","botswana","by","belarus","bz","belize","ca","canada","cc","cocos islands","cd","congo","cf","central african republic","cg","congo brazzaville","ch","switzerland","ci","cote divoire","ck","cook islands","cl","chile","cm","cameroon","cn","china","co","colombia","cr","costa rica","cs","cu","cuba","cv","cape verde","cx","christmas island","cy","cyprus","cz","czech republic","de","germany","dj","djibouti","dk","denmark","dm","dominica","do","dominican republic","dz","algeria","ec","ecuador","ee","estonia","eg","egypt","eh","western sahara","er","eritrea","es","spain","et","ethiopia","eu","european union","fi","finland","fj","fiji","fk","falkland islands","fm","micronesia","fo","faroe islands","fr","france","ga","gabon","gb","united kingdom","gd","grenada","ge","georgia","gf","french guiana","gh","ghana","gi","gibraltar","gl","greenland","gm","gambia","gn","guinea","gp","guadeloupe","gq","equatorial guinea","gr","greece","gs","sandwich islands","gt","guatemala","gu","guam","gw","guinea-bissau","gy","guyana","hk","hong kong","hm","heard island","hn","honduras","hr","croatia","ht","haiti","hu","hungary","id","indonesia","ie","ireland","il","israel","in","india","io","indian ocean territory","iq","iraq","ir","iran","is","iceland","it","italy","jm","jamaica","jo","jordan","jp","japan","ke","kenya","kg","kyrgyzstan","kh","cambodia","ki","kiribati","km","comoros","kn","saint kitts and nevis","kp","north korea","kr","south korea","kw","kuwait","ky","cayman islands","kz","kazakhstan","la","laos","lb","lebanon","lc","saint lucia","li","liechtenstein","lk","sri lanka","lr","liberia","ls","lesotho","lt","lithuania","lu","luxembourg","lv","latvia","ly","libya","ma","morocco","mc","monaco","md","moldova","me","montenegro","mg","madagascar","mh","marshall islands","mk","macedonia","ml","mali","mm","myanmar","burma","mn","mongolia","mo","macau","mp","northern mariana islands","mq","martinique","mr","mauritania","ms","montserrat","mt","malta","mu","mauritius","mv","maldives","mw","malawi","mx","mexico","my","malaysia","mz","mozambique","na","namibia","nc","new caledonia","ne","niger","nf","norfolk island","ng","nigeria","ni","nicaragua","nl","netherlands","no","norway","np","nepal","nr","nauru","nu","niue","nz","new zealand","om","oman","pa","panama","pe","peru","pf","french polynesia","pg","new guinea","ph","philippines","pk","pakistan","pl","poland","pm","saint pierre","pn","pitcairn islands","pr","puerto rico","ps","palestine","pt","portugal","pw","palau","py","paraguay","qa","qatar","re","reunion","ro","romania","rs","serbia","ru","russia","rw","rwanda","sa","saudi arabia","sb","solomon islands","sc","seychelles","gb sct","scotland","sd","sudan","se","sweden","sg","singapore","sh","saint helena","si","slovenia","sj","svalbard","jan mayen","sk","slovakia","sl","sierra leone","sm","san marino","sn","senegal","so","somalia","sr","suriname","st","sao tome","sv","el salvador","sy","syria","sz","swaziland","tc","caicos islands","td","chad","tf","french territories","tg","togo","th","thailand","tj","tajikistan","tk","tokelau","tl","timorleste","tm","turkmenistan","tn","tunisia","to","tonga","tr","turkey","tt","trinidad","tv","tuvalu","tw","taiwan","tz","tanzania","ua","ukraine","ug","uganda","um","us minor islands","us","america","united states","uy","uruguay","uz","uzbekistan","va","vatican city","vc","saint vincent","ve","venezuela","vg","british virgin islands","vi","us virgin islands","vn","vietnam","vu","vanuatu","gb wls","wales","wf","wallis and futuna","ws","samoa","ye","yemen","yt","mayotte","za","south africa","zm","zambia","zw","zimbabwe"];o.handledProps=["as","className","name"],o._meta={name:"Flag",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,className:i.PropTypes.string,name:d.customPropTypes.suggest(p)}:void 0,o.defaultProps={as:"i"},o.create=(0,d.createShorthandFactory)(o,function(e){return{name:e}}),t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/Header/Header.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.attached,n=e.block,r=e.children,a=e.className,u=e.color,s=e.content,i=e.disabled,d=e.dividing,f=e.floated,h=e.icon,P=e.image,T=e.inverted,O=e.size,E=e.sub,N=e.subheader,S=e.textAlign,M=(0,p.default)("ui",u,O,(0,m.useKeyOnly)(n,"block"),(0,m.useKeyOnly)(i,"disabled"),(0,m.useKeyOnly)(d,"dividing"),(0,m.useValueAndKey)(f,"floated"),(0,m.useKeyOnly)(h===!0,"icon"),(0,m.useKeyOnly)(P===!0,"image"),(0,m.useKeyOnly)(T,"inverted"),(0,m.useKeyOnly)(E,"sub"),(0,m.useKeyOrValueAndKey)(t,"attached"),(0,m.useTextAlignProp)(S),"header",a),x=(0,m.getUnhandledProps)(o,e),w=(0,m.getElementType)(o,e);if(!(0,c.default)(r))return y.default.createElement(w,(0,l.default)({},x,{className:M}),r);var C=v.default.create(h),I=g.default.create(P),A=b.default.create(N);return C||I?y.default.createElement(w,(0,l.default)({},x,{className:M}),C||I,(s||A)&&y.default.createElement(_.default,null,s,A)):y.default.createElement(w,(0,l.default)({},x,{className:M}),s,A)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ../../elements/Icon */15),v=r(h),P=n(/*! ../../elements/Image */46),g=r(P),T=n(/*! ./HeaderSubheader */210),b=r(T),O=n(/*! ./HeaderContent */209),_=r(O);o.handledProps=["as","attached","block","children","className","color","content","disabled","dividing","floated","icon","image","inverted","size","sub","subheader","textAlign"],o._meta={name:"Header",type:m.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,attached:f.PropTypes.oneOfType([f.PropTypes.bool,f.PropTypes.oneOf(["top","bottom"])]),block:f.PropTypes.bool,children:f.PropTypes.node,className:f.PropTypes.string,color:f.PropTypes.oneOf(m.SUI.COLORS),content:m.customPropTypes.contentShorthand,disabled:f.PropTypes.bool,dividing:f.PropTypes.bool,floated:f.PropTypes.oneOf(m.SUI.FLOATS),icon:m.customPropTypes.every([m.customPropTypes.disallow(["image"]),f.PropTypes.oneOfType([f.PropTypes.bool,m.customPropTypes.itemShorthand])]),image:m.customPropTypes.every([m.customPropTypes.disallow(["icon"]),f.PropTypes.oneOfType([f.PropTypes.bool,m.customPropTypes.itemShorthand])]),inverted:f.PropTypes.bool,size:f.PropTypes.oneOf((0,s.default)(m.SUI.SIZES,"big","massive")),sub:f.PropTypes.bool,subheader:m.customPropTypes.itemShorthand,textAlign:f.PropTypes.oneOf(m.SUI.TEXT_ALIGNMENTS)}:void 0,o.Content=_.default,o.Subheader=b.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/elements/Header/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Header */368),a=r(o);t.default=a.default},/*!*************************************!*\
!*** ./src/elements/Input/Input.js ***!
\*************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/slicedToArray */267),a=r(o),l=n(/*! babel-runtime/helpers/extends */2),u=r(l),s=n(/*! babel-runtime/helpers/classCallCheck */7),i=r(s),c=n(/*! babel-runtime/helpers/createClass */8),d=r(c),p=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),f=r(p),y=n(/*! babel-runtime/helpers/inherits */9),m=r(y),h=n(/*! lodash/includes */55),v=r(h),P=n(/*! lodash/map */16),g=r(P),T=n(/*! lodash/isNil */6),b=r(T),O=n(/*! lodash/get */53),_=r(O),E=n(/*! react */1),N=r(E),S=n(/*! classnames */5),M=r(S),x=n(/*! ../../lib */4),w=n(/*! ../../elements/Button */110),C=r(w),I=n(/*! ../../elements/Icon */15),A=r(I),j=n(/*! ../../elements/Label */69),k=r(j),D=function(e){function t(){var e,n,r,o;(0,i.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,f.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleChange=function(e){var t=r.props.onChange,n=(0,_.default)(e,"target.value");t(e,(0,u.default)({},r.props,{value:n}))},r.focus=function(){r.inputRef.focus()},r.handleInputRef=function(e){return r.inputRef=e},o=n,(0,f.default)(r,o)}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,n=e.action,r=e.actionPosition,o=e.children,l=e.className,s=e.disabled,i=e.error,c=e.fluid,d=e.focus,p=e.icon,f=e.iconPosition,y=e.input,m=e.inverted,h=e.label,P=e.labelPosition,T=e.loading,O=e.onChange,_=e.size,S=e.tabIndex,w=e.transparent,I=e.type,j=(0,M.default)("ui",_,(0,x.useKeyOnly)(s,"disabled"),(0,x.useKeyOnly)(i,"error"),(0,x.useKeyOnly)(c,"fluid"),(0,x.useKeyOnly)(d,"focus"),(0,x.useKeyOnly)(m,"inverted"),(0,x.useKeyOnly)(T,"loading"),(0,x.useKeyOnly)(w,"transparent"),(0,x.useValueAndKey)(r,"action")||(0,x.useKeyOnly)(n,"action"),(0,x.useValueAndKey)(f,"icon")||(0,x.useKeyOnly)(p,"icon"),(0,x.useValueAndKey)(P,"labeled")||(0,x.useKeyOnly)(h,"labeled"),"input",l),D=(0,x.getUnhandledProps)(t,this.props),L=(0,x.getElementType)(t,this.props),K=(0,x.partitionHTMLInputProps)((0,u.default)({},D,{type:I})),U=(0,a.default)(K,2),V=U[0],R=U[1];if(O&&(V.onChange=this.handleChange),V.ref=this.handleInputRef,(0,b.default)(S)?s&&(V.tabIndex=-1):V.tabIndex=S,!(0,b.default)(o)){var z=(0,g.default)(E.Children.toArray(o),function(e){return"input"!==e.type?e:(0,E.cloneElement)(e,(0,u.default)({},V,e.props))});return N.default.createElement(L,(0,u.default)({},R,{className:j}),z)}var F=C.default.create(n,function(e){return{className:(0,M.default)(!(0,v.default)(e.className,"button")&&"button")}}),W=A.default.create(p),B=k.default.create(h,function(e){return{className:(0,M.default)(!(0,v.default)(e.className,"label")&&"label",(0,v.default)(P,"corner")&&P)}});return N.default.createElement(L,(0,u.default)({},R,{className:j}),"left"===r&&F,"left"===f&&W,"right"!==P&&B,(0,x.createHTMLInput)(y||I,V),"left"!==r&&F,"left"!==f&&W,"right"===P&&B)}}]),t}(E.Component);D.defaultProps={type:"text"},D._meta={name:"Input",type:x.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?D.propTypes={as:x.customPropTypes.as,action:E.PropTypes.oneOfType([E.PropTypes.bool,x.customPropTypes.itemShorthand]),actionPosition:E.PropTypes.oneOf(["left"]),children:E.PropTypes.node,className:E.PropTypes.string,disabled:E.PropTypes.bool,error:E.PropTypes.bool,fluid:E.PropTypes.bool,focus:E.PropTypes.bool,icon:E.PropTypes.oneOfType([E.PropTypes.bool,x.customPropTypes.itemShorthand]),iconPosition:E.PropTypes.oneOf(["left"]),input:x.customPropTypes.itemShorthand,inverted:E.PropTypes.bool,label:x.customPropTypes.itemShorthand,labelPosition:E.PropTypes.oneOf(["left","right","left corner","right corner"]),loading:E.PropTypes.bool,onChange:E.PropTypes.func,size:E.PropTypes.oneOf(x.SUI.SIZES),tabIndex:E.PropTypes.oneOfType([E.PropTypes.number,E.PropTypes.string]),transparent:E.PropTypes.bool,type:E.PropTypes.string}:void 0,D.handledProps=["action","actionPosition","as","children","className","disabled","error","fluid","focus","icon","iconPosition","input","inverted","label","labelPosition","loading","onChange","size","tabIndex","transparent","type"],D.create=(0,x.createShorthandFactory)(D,function(e){return{type:e}}),t.default=D}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***********************************!*\
!*** ./src/elements/List/List.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.animated,n=e.bulleted,r=e.celled,a=e.children,u=e.className,i=e.divided,d=e.floated,f=e.horizontal,h=e.inverted,v=e.items,P=e.link,g=e.ordered,T=e.relaxed,b=e.selection,O=e.size,_=e.verticalAlign,E=(0,p.default)("ui",O,(0,m.useKeyOnly)(t,"animated"),(0,m.useKeyOnly)(n,"bulleted"),(0,m.useKeyOnly)(r,"celled"),(0,m.useKeyOnly)(i,"divided"),(0,m.useKeyOnly)(f,"horizontal"),(0,m.useKeyOnly)(h,"inverted"),(0,m.useKeyOnly)(P,"link"),(0,m.useKeyOnly)(g,"ordered"),(0,m.useKeyOnly)(b,"selection"),(0,m.useKeyOrValueAndKey)(T,"relaxed"),(0,m.useValueAndKey)(d,"floated"),(0,m.useVerticalAlignProp)(_),"list",u),S=(0,m.getUnhandledProps)(o,e),M=(0,m.getElementType)(o,e);return(0,c.default)(a)?y.default.createElement(M,(0,l.default)({},S,{role:"list",className:E}),(0,s.default)(v,function(e){return N.default.create(e)})):y.default.createElement(M,(0,l.default)({},S,{role:"list",className:E}),a)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/map */16),s=r(u),i=n(/*! lodash/isNil */6),c=r(i),d=n(/*! classnames */5),p=r(d),f=n(/*! react */1),y=r(f),m=n(/*! ../../lib */4),h=n(/*! ./ListContent */113),v=r(h),P=n(/*! ./ListDescription */70),g=r(P),T=n(/*! ./ListHeader */71),b=r(T),O=n(/*! ./ListIcon */114),_=r(O),E=n(/*! ./ListItem */216),N=r(E),S=n(/*! ./ListList */217),M=r(S);o.handledProps=["animated","as","bulleted","celled","children","className","divided","floated","horizontal","inverted","items","link","ordered","relaxed","selection","size","verticalAlign"],o._meta={name:"List",type:m.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:m.customPropTypes.as,animated:f.PropTypes.bool,bulleted:f.PropTypes.bool,celled:f.PropTypes.bool,children:f.PropTypes.node,className:f.PropTypes.string,divided:f.PropTypes.bool,floated:f.PropTypes.oneOf(m.SUI.FLOATS),horizontal:f.PropTypes.bool,inverted:f.PropTypes.bool,items:m.customPropTypes.collectionShorthand,link:f.PropTypes.bool,ordered:f.PropTypes.bool,relaxed:f.PropTypes.oneOfType([f.PropTypes.bool,f.PropTypes.oneOf(["very"])]),selection:f.PropTypes.bool,size:f.PropTypes.oneOf(m.SUI.SIZES),verticalAlign:f.PropTypes.oneOf(m.SUI.VERTICAL_ALIGNMENTS)}:void 0,o.Content=v.default,o.Description=g.default,o.Header=b.default,o.Icon=_.default,o.Item=N.default,o.List=M.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/elements/List/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./List */371),a=r(o);t.default=a.default},/*!***************************************!*\
!*** ./src/elements/Loader/Loader.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.children,r=e.className,a=e.content,u=e.disabled,i=e.indeterminate,d=e.inline,y=e.inverted,m=e.size,h=(0,c.default)("ui",m,(0,f.useKeyOnly)(t,"active"),(0,f.useKeyOnly)(u,"disabled"),(0,f.useKeyOnly)(i,"indeterminate"),(0,f.useKeyOnly)(y,"inverted"),(0,f.useKeyOnly)(n||a,"text"),(0,f.useKeyOrValueAndKey)(d,"inline"),"loader",r),v=(0,f.getUnhandledProps)(o,e),P=(0,f.getElementType)(o,e);return p.default.createElement(P,(0,l.default)({},v,{className:h}),(0,s.default)(n)?a:n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/isNil */6),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["active","as","children","className","content","disabled","indeterminate","inline","inverted","size"],o._meta={name:"Loader",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,active:d.PropTypes.bool,children:d.PropTypes.node,className:d.PropTypes.string,content:f.customPropTypes.contentShorthand,disabled:d.PropTypes.bool,indeterminate:d.PropTypes.bool,inline:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["centered"])]),inverted:d.PropTypes.bool,size:d.PropTypes.oneOf(f.SUI.SIZES)}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/elements/Loader/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Loader */373),a=r(o);t.default=a.default},/*!***********************************!*\
!*** ./src/elements/Rail/Rail.js ***!
\***********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.attached,n=e.children,r=e.className,a=e.close,u=e.dividing,s=e.internal,i=e.position,d=e.size,y=(0,c.default)("ui",i,d,(0,f.useKeyOnly)(t,"attached"),(0,f.useKeyOnly)(u,"dividing"),(0,f.useKeyOnly)(s,"internal"),(0,f.useKeyOrValueAndKey)(a,"close"),"rail",r),m=(0,f.getUnhandledProps)(o,e),h=(0,f.getElementType)(o,e);return p.default.createElement(h,(0,l.default)({},m,{className:y}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4);o.handledProps=["as","attached","children","className","close","dividing","internal","position","size"],o._meta={name:"Rail",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,attached:d.PropTypes.bool,children:d.PropTypes.node,className:d.PropTypes.string,close:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["very"])]),dividing:d.PropTypes.bool,internal:d.PropTypes.bool,position:d.PropTypes.oneOf(f.SUI.FLOATS).isRequired,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium"))}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/elements/Rail/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Rail */375),a=r(o);t.default=a.default},/*!***************************************!*\
!*** ./src/elements/Reveal/Reveal.js ***!
\***************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.active,n=e.animated,r=e.children,a=e.className,u=e.disabled,i=e.instant,p=(0,s.default)("ui",n,(0,d.useKeyOnly)(t,"active"),(0,d.useKeyOnly)(u,"disabled"),(0,d.useKeyOnly)(i,"instant"),"reveal",a),f=(0,d.getUnhandledProps)(o,e),y=(0,d.getElementType)(o,e);return c.default.createElement(y,(0,l.default)({},f,{className:p}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=n(/*! ./RevealContent */218),f=r(p);o.handledProps=["active","animated","as","children","className","disabled","instant"],o._meta={name:"Reveal",type:d.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,active:i.PropTypes.bool,animated:i.PropTypes.oneOf(["fade","small fade","move","move right","move up","move down","rotate","rotate left"]),children:i.PropTypes.node,className:i.PropTypes.string,disabled:i.PropTypes.bool,instant:i.PropTypes.bool}:void 0,o.Content=f.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/elements/Reveal/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Reveal */377),a=r(o);t.default=a.default},/*!*****************************************!*\
!*** ./src/elements/Segment/Segment.js ***!
\*****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.attached,n=e.basic,r=e.children,a=e.circular,u=e.className,s=e.clearing,i=e.color,d=e.compact,y=e.disabled,m=e.floated,h=e.inverted,v=e.loading,P=e.padded,g=e.piled,T=e.raised,b=e.secondary,O=e.size,_=e.stacked,E=e.tertiary,N=e.textAlign,S=e.vertical,M=(0,c.default)("ui",i,O,(0,f.useKeyOnly)(n,"basic"),(0,f.useKeyOnly)(a,"circular"),(0,f.useKeyOnly)(s,"clearing"),(0,f.useKeyOnly)(d,"compact"),(0,f.useKeyOnly)(y,"disabled"),(0,f.useKeyOnly)(h,"inverted"),(0,f.useKeyOnly)(v,"loading"),(0,f.useKeyOnly)(g,"piled"),(0,f.useKeyOnly)(T,"raised"),(0,f.useKeyOnly)(b,"secondary"),(0,f.useKeyOnly)(_,"stacked"),(0,f.useKeyOnly)(E,"tertiary"),(0,f.useKeyOnly)(S,"vertical"),(0,f.useKeyOrValueAndKey)(t,"attached"),(0,f.useKeyOrValueAndKey)(P,"padded"),(0,f.useTextAlignProp)(N),(0,f.useValueAndKey)(m,"floated"),"segment",u),x=(0,f.getUnhandledProps)(o,e),w=(0,f.getElementType)(o,e);return p.default.createElement(w,(0,l.default)({},x,{className:M}),r)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! lodash/without */13),s=r(u),i=n(/*! classnames */5),c=r(i),d=n(/*! react */1),p=r(d),f=n(/*! ../../lib */4),y=n(/*! ./SegmentGroup */219),m=r(y);o.handledProps=["as","attached","basic","children","circular","className","clearing","color","compact","disabled","floated","inverted","loading","padded","piled","raised","secondary","size","stacked","tertiary","textAlign","vertical"],o.Group=m.default,o._meta={name:"Segment",type:f.META.TYPES.ELEMENT},"production"!==e.env.NODE_ENV?o.propTypes={as:f.customPropTypes.as,attached:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["top","bottom"])]),basic:d.PropTypes.bool,children:d.PropTypes.node,circular:d.PropTypes.bool,className:d.PropTypes.string,clearing:d.PropTypes.bool,color:d.PropTypes.oneOf(f.SUI.COLORS),compact:d.PropTypes.bool,disabled:d.PropTypes.bool,floated:d.PropTypes.oneOf(f.SUI.FLOATS),inverted:d.PropTypes.bool,loading:d.PropTypes.bool,padded:d.PropTypes.oneOfType([d.PropTypes.bool,d.PropTypes.oneOf(["very"])]),piled:d.PropTypes.bool,raised:d.PropTypes.bool,secondary:d.PropTypes.bool,size:d.PropTypes.oneOf((0,s.default)(f.SUI.SIZES,"medium")),stacked:d.PropTypes.bool,tertiary:d.PropTypes.bool,textAlign:d.PropTypes.oneOf((0,s.default)(f.SUI.TEXT_ALIGNMENTS,"justified")),vertical:d.PropTypes.bool}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/elements/Segment/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Segment */379),a=r(o);t.default=a.default},/*!************************************!*\
!*** ./src/elements/Step/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Step */220),a=r(o);t.default=a.default},/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! ./addons/Confirm */346);Object.defineProperty(t,"Confirm",{enumerable:!0,get:function(){return r(o).default}});var a=n(/*! ./addons/Portal */66);Object.defineProperty(t,"Portal",{enumerable:!0,get:function(){return r(a).default}});var l=n(/*! ./addons/Radio */107);Object.defineProperty(t,"Radio",{enumerable:!0,get:function(){return r(l).default}});var u=n(/*! ./addons/Select */180);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return r(u).default}});var s=n(/*! ./addons/TextArea */181);Object.defineProperty(t,"TextArea",{enumerable:!0,get:function(){return r(s).default}});var i=n(/*! ./collections/Breadcrumb */352);Object.defineProperty(t,"Breadcrumb",{enumerable:!0,get:function(){return r(i).default}});var c=n(/*! ./collections/Breadcrumb/BreadcrumbDivider */182);Object.defineProperty(t,"BreadcrumbDivider",{enumerable:!0,get:function(){return r(c).default}});var d=n(/*! ./collections/Breadcrumb/BreadcrumbSection */183);Object.defineProperty(t,"BreadcrumbSection",{enumerable:!0,get:function(){return r(d).default}});var p=n(/*! ./collections/Form */354);Object.defineProperty(t,"Form",{enumerable:!0,get:function(){return r(p).default}});var f=n(/*! ./collections/Form/FormButton */184);Object.defineProperty(t,"FormButton",{enumerable:!0,get:function(){return r(f).default}});var y=n(/*! ./collections/Form/FormCheckbox */185);Object.defineProperty(t,"FormCheckbox",{enumerable:!0,get:function(){return r(y).default}});var m=n(/*! ./collections/Form/FormDropdown */186);Object.defineProperty(t,"FormDropdown",{enumerable:!0,get:function(){return r(m).default}});var h=n(/*! ./collections/Form/FormField */25);Object.defineProperty(t,"FormField",{enumerable:!0,get:function(){return r(h).default}});var v=n(/*! ./collections/Form/FormGroup */187);Object.defineProperty(t,"FormGroup",{enumerable:!0,get:function(){return r(v).default}});var P=n(/*! ./collections/Form/FormInput */188);Object.defineProperty(t,"FormInput",{enumerable:!0,get:function(){return r(P).default}});var g=n(/*! ./collections/Form/FormRadio */189);Object.defineProperty(t,"FormRadio",{enumerable:!0,get:function(){return r(g).default}});var T=n(/*! ./collections/Form/FormSelect */190);Object.defineProperty(t,"FormSelect",{enumerable:!0,get:function(){return r(T).default}});var b=n(/*! ./collections/Form/FormTextArea */191);Object.defineProperty(t,"FormTextArea",{enumerable:!0,get:function(){return r(b).default}});var O=n(/*! ./collections/Grid */356);Object.defineProperty(t,"Grid",{enumerable:!0,get:function(){return r(O).default}});var _=n(/*! ./collections/Grid/GridColumn */192);Object.defineProperty(t,"GridColumn",{enumerable:!0,get:function(){return r(_).default}});var E=n(/*! ./collections/Grid/GridRow */193);Object.defineProperty(t,"GridRow",{enumerable:!0,get:function(){return r(E).default}});var N=n(/*! ./collections/Menu */358);Object.defineProperty(t,"Menu",{enumerable:!0,get:function(){return r(N).default}});var S=n(/*! ./collections/Menu/MenuHeader */194);Object.defineProperty(t,"MenuHeader",{enumerable:!0,get:function(){return r(S).default}});var M=n(/*! ./collections/Menu/MenuItem */195);Object.defineProperty(t,"MenuItem",{enumerable:!0,get:function(){return r(M).default}});var x=n(/*! ./collections/Menu/MenuMenu */196);Object.defineProperty(t,"MenuMenu",{enumerable:!0,get:function(){return r(x).default}});var w=n(/*! ./collections/Message */360);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return r(w).default}});var C=n(/*! ./collections/Message/MessageContent */197);Object.defineProperty(t,"MessageContent",{enumerable:!0,get:function(){return r(C).default}});var I=n(/*! ./collections/Message/MessageHeader */198);Object.defineProperty(t,"MessageHeader",{enumerable:!0,get:function(){return r(I).default}});var A=n(/*! ./collections/Message/MessageItem */108);Object.defineProperty(t,"MessageItem",{enumerable:!0,get:function(){return r(A).default}});var j=n(/*! ./collections/Message/MessageList */199);Object.defineProperty(t,"MessageList",{enumerable:!0,get:function(){return r(j).default}});var k=n(/*! ./collections/Table */362);Object.defineProperty(t,"Table",{enumerable:!0,get:function(){return r(k).default}});var D=n(/*! ./collections/Table/TableBody */200);Object.defineProperty(t,"TableBody",{enumerable:!0,get:function(){return r(D).default}});var L=n(/*! ./collections/Table/TableCell */67);Object.defineProperty(t,"TableCell",{enumerable:!0,get:function(){return r(L).default}});var K=n(/*! ./collections/Table/TableFooter */201);Object.defineProperty(t,"TableFooter",{enumerable:!0,get:function(){return r(K).default}});var U=n(/*! ./collections/Table/TableHeader */109);Object.defineProperty(t,"TableHeader",{enumerable:!0,get:function(){return r(U).default}});var V=n(/*! ./collections/Table/TableHeaderCell */202);Object.defineProperty(t,"TableHeaderCell",{enumerable:!0,get:function(){return r(V).default}});var R=n(/*! ./collections/Table/TableRow */203);Object.defineProperty(t,"TableRow",{enumerable:!0,get:function(){return r(R).default}});var z=n(/*! ./elements/Button/Button */204);Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return r(z).default}});var F=n(/*! ./elements/Button/ButtonContent */205);Object.defineProperty(t,"ButtonContent",{enumerable:!0,get:function(){return r(F).default}});var W=n(/*! ./elements/Button/ButtonGroup */206);Object.defineProperty(t,"ButtonGroup",{enumerable:!0,get:function(){return r(W).default}});var B=n(/*! ./elements/Button/ButtonOr */207);Object.defineProperty(t,"ButtonOr",{enumerable:!0,get:function(){return r(B).default}});var Y=n(/*! ./elements/Container */364);Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return r(Y).default}});var H=n(/*! ./elements/Divider */366);Object.defineProperty(t,"Divider",{enumerable:!0,get:function(){return r(H).default}});var q=n(/*! ./elements/Flag */208);Object.defineProperty(t,"Flag",{enumerable:!0,get:function(){return r(q).default}});var G=n(/*! ./elements/Header */369);Object.defineProperty(t,"Header",{enumerable:!0,get:function(){return r(G).default}});var Z=n(/*! ./elements/Header/HeaderContent */209);Object.defineProperty(t,"HeaderContent",{enumerable:!0,get:function(){return r(Z).default}});var $=n(/*! ./elements/Header/HeaderSubheader */210);Object.defineProperty(t,"HeaderSubheader",{enumerable:!0,get:function(){return r($).default}});var X=n(/*! ./elements/Icon */15);Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return r(X).default}});var J=n(/*! ./elements/Icon/IconGroup */211);Object.defineProperty(t,"IconGroup",{enumerable:!0,get:function(){return r(J).default}});var Q=n(/*! ./elements/Image */46);Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return r(Q).default}});var ee=n(/*! ./elements/Image/ImageGroup */213);Object.defineProperty(t,"ImageGroup",{enumerable:!0,get:function(){return r(ee).default}});var te=n(/*! ./elements/Input */111);Object.defineProperty(t,"Input",{enumerable:!0,get:function(){return r(te).default}});var ne=n(/*! ./elements/Label */69);Object.defineProperty(t,"Label",{enumerable:!0,get:function(){return r(ne).default}});var re=n(/*! ./elements/Label/LabelDetail */214);Object.defineProperty(t,"LabelDetail",{enumerable:!0,get:function(){return r(re).default}});var oe=n(/*! ./elements/Label/LabelGroup */215);Object.defineProperty(t,"LabelGroup",{enumerable:!0,get:function(){return r(oe).default}});var ae=n(/*! ./elements/List */372);Object.defineProperty(t,"List",{enumerable:!0,get:function(){return r(ae).default}});var le=n(/*! ./elements/List/ListContent */113);Object.defineProperty(t,"ListContent",{enumerable:!0,get:function(){return r(le).default}});var ue=n(/*! ./elements/List/ListDescription */70);Object.defineProperty(t,"ListDescription",{enumerable:!0,get:function(){return r(ue).default}});var se=n(/*! ./elements/List/ListHeader */71);Object.defineProperty(t,"ListHeader",{enumerable:!0,get:function(){return r(se).default}});var ie=n(/*! ./elements/List/ListIcon */114);Object.defineProperty(t,"ListIcon",{enumerable:!0,get:function(){return r(ie).default}});var ce=n(/*! ./elements/List/ListItem */216);Object.defineProperty(t,"ListItem",{enumerable:!0,get:function(){return r(ce).default}});var de=n(/*! ./elements/List/ListList */217);Object.defineProperty(t,"ListList",{enumerable:!0,get:function(){return r(de).default}});var pe=n(/*! ./elements/Loader */374);Object.defineProperty(t,"Loader",{enumerable:!0,get:function(){return r(pe).default}});var fe=n(/*! ./elements/Rail */376);Object.defineProperty(t,"Rail",{enumerable:!0,get:function(){return r(fe).default}});var ye=n(/*! ./elements/Reveal */378);Object.defineProperty(t,"Reveal",{enumerable:!0,get:function(){return r(ye).default}});var me=n(/*! ./elements/Reveal/RevealContent */218);Object.defineProperty(t,"RevealContent",{enumerable:!0,get:function(){return r(me).default}});var he=n(/*! ./elements/Segment */380);Object.defineProperty(t,"Segment",{enumerable:!0,get:function(){return r(he).default}});var ve=n(/*! ./elements/Segment/SegmentGroup */219);Object.defineProperty(t,"SegmentGroup",{enumerable:!0,get:function(){return r(ve).default}});var Pe=n(/*! ./elements/Step */381);Object.defineProperty(t,"Step",{enumerable:!0,get:function(){return r(Pe).default}});var ge=n(/*! ./elements/Step/StepContent */221);Object.defineProperty(t,"StepContent",{enumerable:!0,get:function(){return r(ge).default}});var Te=n(/*! ./elements/Step/StepDescription */115);Object.defineProperty(t,"StepDescription",{enumerable:!0,get:function(){return r(Te).default}});var be=n(/*! ./elements/Step/StepGroup */222);Object.defineProperty(t,"StepGroup",{enumerable:!0,get:function(){return r(be).default}});var Oe=n(/*! ./elements/Step/StepTitle */116);Object.defineProperty(t,"StepTitle",{enumerable:!0,get:function(){return r(Oe).default}});var _e=n(/*! ./modules/Accordion/Accordion */396);Object.defineProperty(t,"Accordion",{enumerable:!0,get:function(){return r(_e).default}});var Ee=n(/*! ./modules/Accordion/AccordionContent */225);Object.defineProperty(t,"AccordionContent",{enumerable:!0,get:function(){return r(Ee).default}});var Ne=n(/*! ./modules/Accordion/AccordionTitle */226);Object.defineProperty(t,"AccordionTitle",{enumerable:!0,get:function(){return r(Ne).default}});var Se=n(/*! ./modules/Checkbox */72);Object.defineProperty(t,"Checkbox",{enumerable:!0,get:function(){return r(Se).default}});var Me=n(/*! ./modules/Dimmer */228);Object.defineProperty(t,"Dimmer",{enumerable:!0,get:function(){return r(Me).default}});var xe=n(/*! ./modules/Dimmer/DimmerDimmable */227);Object.defineProperty(t,"DimmerDimmable",{enumerable:!0,get:function(){return r(xe).default}});var we=n(/*! ./modules/Dropdown */118);Object.defineProperty(t,"Dropdown",{enumerable:!0,get:function(){return r(we).default}});var Ce=n(/*! ./modules/Dropdown/DropdownDivider */229);Object.defineProperty(t,"DropdownDivider",{enumerable:!0,get:function(){return r(Ce).default}});var Ie=n(/*! ./modules/Dropdown/DropdownHeader */230);Object.defineProperty(t,"DropdownHeader",{enumerable:!0,get:function(){return r(Ie).default}});var Ae=n(/*! ./modules/Dropdown/DropdownItem */231);Object.defineProperty(t,"DropdownItem",{enumerable:!0,get:function(){return r(Ae).default}});var je=n(/*! ./modules/Dropdown/DropdownMenu */232);Object.defineProperty(t,"DropdownMenu",{enumerable:!0,get:function(){return r(je).default}});var ke=n(/*! ./modules/Embed */401);Object.defineProperty(t,"Embed",{enumerable:!0,get:function(){return r(ke).default}});var De=n(/*! ./modules/Modal */237);Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return r(De).default}});var Le=n(/*! ./modules/Modal/ModalActions */233);Object.defineProperty(t,"ModalActions",{enumerable:!0,get:function(){return r(Le).default}});var Ke=n(/*! ./modules/Modal/ModalContent */234);Object.defineProperty(t,"ModalContent",{enumerable:!0,get:function(){return r(Ke).default}});var Ue=n(/*! ./modules/Modal/ModalDescription */235);Object.defineProperty(t,"ModalDescription",{enumerable:!0,get:function(){return r(Ue).default}});var Ve=n(/*! ./modules/Modal/ModalHeader */236);Object.defineProperty(t,"ModalHeader",{enumerable:!0,get:function(){return r(Ve).default}});var Re=n(/*! ./modules/Popup */404);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return r(Re).default}});var ze=n(/*! ./modules/Popup/PopupContent */238);Object.defineProperty(t,"PopupContent",{enumerable:!0,get:function(){return r(ze).default}});var Fe=n(/*! ./modules/Popup/PopupHeader */239);Object.defineProperty(t,"PopupHeader",{enumerable:!0,get:function(){return r(Fe).default}});var We=n(/*! ./modules/Progress */406);Object.defineProperty(t,"Progress",{enumerable:!0,get:function(){return r(We).default}});var Be=n(/*! ./modules/Rating */408);Object.defineProperty(t,"Rating",{enumerable:!0,get:function(){return r(Be).default}});var Ye=n(/*! ./modules/Rating/RatingIcon */240);Object.defineProperty(t,"RatingIcon",{enumerable:!0,get:function(){return r(Ye).default}});var He=n(/*! ./modules/Search */410);Object.defineProperty(t,"Search",{enumerable:!0,get:function(){return r(He).default}});var qe=n(/*! ./modules/Search/SearchCategory */241);Object.defineProperty(t,"SearchCategory",{enumerable:!0,get:function(){return r(qe).default}});var Ge=n(/*! ./modules/Search/SearchResult */242);Object.defineProperty(t,"SearchResult",{enumerable:!0,get:function(){return r(Ge).default}});var Ze=n(/*! ./modules/Search/SearchResults */243);Object.defineProperty(t,"SearchResults",{enumerable:!0,get:function(){return r(Ze).default}});var $e=n(/*! ./modules/Sidebar */412);Object.defineProperty(t,"Sidebar",{enumerable:!0,get:function(){return r($e).default}});var Xe=n(/*! ./modules/Sidebar/SidebarPushable */244);Object.defineProperty(t,"SidebarPushable",{enumerable:!0,get:function(){return r(Xe).default}});var Je=n(/*! ./modules/Sidebar/SidebarPusher */245);Object.defineProperty(t,"SidebarPusher",{enumerable:!0,get:function(){return r(Je).default}});var Qe=n(/*! ./views/Advertisement */414);Object.defineProperty(t,"Advertisement",{enumerable:!0,get:function(){return r(Qe).default}});var et=n(/*! ./views/Card/Card */246);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return r(et).default}});var tt=n(/*! ./views/Card/CardContent */247);Object.defineProperty(t,"CardContent",{enumerable:!0,get:function(){return r(tt).default}});var nt=n(/*! ./views/Card/CardDescription */119);Object.defineProperty(t,"CardDescription",{enumerable:!0,get:function(){return r(nt).default}});var rt=n(/*! ./views/Card/CardGroup */248);Object.defineProperty(t,"CardGroup",{enumerable:!0,get:function(){return r(rt).default}});var ot=n(/*! ./views/Card/CardHeader */120);Object.defineProperty(t,"CardHeader",{enumerable:!0,get:function(){return r(ot).default}});var at=n(/*! ./views/Card/CardMeta */121);Object.defineProperty(t,"CardMeta",{enumerable:!0,get:function(){return r(at).default}});var lt=n(/*! ./views/Comment */416);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return r(lt).default}});var ut=n(/*! ./views/Comment/CommentAction */249);Object.defineProperty(t,"CommentAction",{enumerable:!0,get:function(){return r(ut).default}});var st=n(/*! ./views/Comment/CommentActions */250);Object.defineProperty(t,"CommentActions",{enumerable:!0,get:function(){return r(st).default}});var it=n(/*! ./views/Comment/CommentAuthor */251);Object.defineProperty(t,"CommentAuthor",{enumerable:!0,get:function(){return r(it).default}});var ct=n(/*! ./views/Comment/CommentAvatar */252);Object.defineProperty(t,"CommentAvatar",{enumerable:!0,get:function(){return r(ct).default}});var dt=n(/*! ./views/Comment/CommentContent */253);Object.defineProperty(t,"CommentContent",{enumerable:!0,get:function(){return r(dt).default}});var pt=n(/*! ./views/Comment/CommentGroup */254);Object.defineProperty(t,"CommentGroup",{enumerable:!0,get:function(){return r(pt).default}});var ft=n(/*! ./views/Comment/CommentMetadata */255);Object.defineProperty(t,"CommentMetadata",{enumerable:!0,get:function(){return r(ft).default}});var yt=n(/*! ./views/Comment/CommentText */256);Object.defineProperty(t,"CommentText",{enumerable:!0,get:function(){return r(yt).default}});var mt=n(/*! ./views/Feed */418);Object.defineProperty(t,"Feed",{enumerable:!0,get:function(){return r(mt).default}});var ht=n(/*! ./views/Feed/FeedContent */122);Object.defineProperty(t,"FeedContent",{enumerable:!0,get:function(){return r(ht).default}});var vt=n(/*! ./views/Feed/FeedDate */73);Object.defineProperty(t,"FeedDate",{enumerable:!0,get:function(){return r(vt).default}});var Pt=n(/*! ./views/Feed/FeedEvent */257);Object.defineProperty(t,"FeedEvent",{enumerable:!0,get:function(){return r(Pt).default}});var gt=n(/*! ./views/Feed/FeedExtra */123);Object.defineProperty(t,"FeedExtra",{enumerable:!0,get:function(){return r(gt).default}});var Tt=n(/*! ./views/Feed/FeedLabel */124);Object.defineProperty(t,"FeedLabel",{enumerable:!0,get:function(){return r(Tt).default}});var bt=n(/*! ./views/Feed/FeedLike */125);Object.defineProperty(t,"FeedLike",{enumerable:!0,get:function(){return r(bt).default}});var Ot=n(/*! ./views/Feed/FeedMeta */126);Object.defineProperty(t,"FeedMeta",{enumerable:!0,get:function(){return r(Ot).default}});var _t=n(/*! ./views/Feed/FeedSummary */127);Object.defineProperty(t,"FeedSummary",{enumerable:!0,get:function(){return r(_t).default}});var Et=n(/*! ./views/Feed/FeedUser */128);Object.defineProperty(t,"FeedUser",{enumerable:!0,get:function(){return r(Et).default}});var Nt=n(/*! ./views/Item */419);Object.defineProperty(t,"Item",{enumerable:!0,get:function(){return r(Nt).default}});var St=n(/*! ./views/Item/ItemContent */259);Object.defineProperty(t,"ItemContent",{enumerable:!0,get:function(){return r(St).default}});var Mt=n(/*! ./views/Item/ItemDescription */129);Object.defineProperty(t,"ItemDescription",{enumerable:!0,get:function(){return r(Mt).default}});var xt=n(/*! ./views/Item/ItemExtra */130);Object.defineProperty(t,"ItemExtra",{enumerable:!0,get:function(){return r(xt).default}});var wt=n(/*! ./views/Item/ItemGroup */260);Object.defineProperty(t,"ItemGroup",{enumerable:!0,get:function(){return r(wt).default}});var Ct=n(/*! ./views/Item/ItemHeader */131);Object.defineProperty(t,"ItemHeader",{enumerable:!0,get:function(){return r(Ct).default}});var It=n(/*! ./views/Item/ItemImage */261);Object.defineProperty(t,"ItemImage",{enumerable:!0,get:function(){return r(It).default}});var At=n(/*! ./views/Item/ItemMeta */132);Object.defineProperty(t,"ItemMeta",{enumerable:!0,get:function(){return r(At).default}});var jt=n(/*! ./views/Statistic */420);Object.defineProperty(t,"Statistic",{enumerable:!0,get:function(){return r(jt).default}});var kt=n(/*! ./views/Statistic/StatisticGroup */263);Object.defineProperty(t,"StatisticGroup",{enumerable:!0,get:function(){return r(kt).default}});var Dt=n(/*! ./views/Statistic/StatisticLabel */264);Object.defineProperty(t,"StatisticLabel",{enumerable:!0,get:function(){return r(Dt).default}});var Lt=n(/*! ./views/Statistic/StatisticValue */265);Object.defineProperty(t,"StatisticValue",{enumerable:!0,get:function(){return r(Lt).default}})},/*!********************************************!*\
!*** ./src/lib/AutoControlledComponent.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getAutoControlledStateValue=void 0;var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/difference */325),m=r(y),h=n(/*! lodash/isUndefined */105),v=r(h),P=n(/*! lodash/startsWith */341),g=r(P),T=n(/*! lodash/filter */326),b=r(T),O=n(/*! lodash/isEmpty */173),_=r(O),E=n(/*! lodash/keys */20),N=r(E),S=n(/*! lodash/intersection */636),M=r(S),x=n(/*! lodash/has */54),w=r(x),C=n(/*! lodash/each */171),I=r(C),A=n(/*! react */1),j=function(e){return"default"+(e[0].toUpperCase()+e.slice(1))},k=t.getAutoControlledStateValue=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=t[e];if(void 0!==o)return o;if(r){var a=t[j(e)];if(void 0!==a)return a;if(n){var l=n[e];if(void 0!==l)return l}}return"checked"!==e&&("value"===e?t.multiple?[]:"":void 0)},D=function(t){function n(){var t,r,o,l;(0,u.default)(this,n);for(var s=arguments.length,i=Array(s),c=0;c<s;c++)i[c]=arguments[c];return r=o=(0,d.default)(this,(t=n.__proto__||Object.getPrototypeOf(n)).call.apply(t,[this].concat(i))),o.trySetState=function(t,n){var r=o.constructor.autoControlledProps;if("production"!==e.env.NODE_ENV){var l=o.constructor.name,u=(0,m.default)((0,N.default)(t),r);(0,_.default)(u)||console.error([l+' called trySetState() with controlled props: "'+u+'".',"State will not be set.","Only props in static autoControlledProps will be set on state."].join(" "))}var s=Object.keys(t).reduce(function(e,n){return void 0!==o.props[n]?e:r.indexOf(n)===-1?e:(e[n]=t[n],e)},{});n&&(s=(0,a.default)({},s,n)),Object.keys(s).length>0&&o.setState(s)},l=r,(0,d.default)(o,l)}return(0,f.default)(n,t),(0,i.default)(n,[{key:"componentWillMount",value:function(){var t=this,n=this.constructor.autoControlledProps;if("production"!==e.env.NODE_ENV){var r=this.constructor,o=r.defaultProps,l=r.name,u=r.propTypes;n||console.error("Auto controlled "+l+" must specify a static autoControlledProps array."),(0,I.default)(n,function(e){var t=j(e);(0,w.default)(u,t)||console.error(l+' is missing "'+t+'" propTypes validation for auto controlled prop "'+e+'".'),(0,w.default)(u,e)||console.error(l+' is missing propTypes validation for auto controlled prop "'+e+'".')});var s=(0,M.default)(n,(0,N.default)(o));(0,_.default)(s)||console.error(["Do not set defaultProps for autoControlledProps. You can set defaults by","setting state in the constructor or using an ES7 property initializer","(https://babeljs.io/blog/2015/06/07/react-on-es6-plus#property-initializers)","See "+l+' props: "'+s+'".'].join(" "));var i=(0,b.default)(n,function(e){return(0,g.default)(e,"default")});(0,_.default)(i)||console.error(["Do not add default props to autoControlledProps.","Default props are automatically handled.","See "+l+' autoControlledProps: "'+i+'".'].join(" "))}var c=n.reduce(function(n,r){if(n[r]=k(r,t.props,t.state,!0),"production"!==e.env.NODE_ENV){var o=j(r),a=t.constructor.name;o in t.props&&r in t.props&&console.error(a+' prop "'+r+'" is auto controlled. Specify either '+o+" or "+r+", but not both.")}return n},{});this.state=(0,a.default)({},this.state,c)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.constructor.autoControlledProps,r=n.reduce(function(n,r){var o=(0,v.default)(e[r]),a=!(0,v.default)(t.props[r])&&o;return o?a&&(n[r]=k(r,e)):n[r]=e[r],n},{});Object.keys(r).length>0&&this.setState(r)}}]),n}(A.Component);t.default=D}).call(t,n(/*! ./../../~/process/browser.js */3))},/*!*************************!*\
!*** ./src/lib/META.js ***!
\*************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.isPrivate=t.isChild=t.isParent=t.isModule=t.isView=t.isElement=t.isCollection=t.isAddon=t.isType=t.isMeta=t.TYPES=void 0;var o=n(/*! lodash/fp/startsWith */630),a=r(o),l=n(/*! lodash/fp/has */620),u=r(l),s=n(/*! lodash/fp/eq */618),i=r(s),c=n(/*! lodash/fp/flow */330),d=r(c),p=n(/*! lodash/fp/curry */616),f=r(p),y=n(/*! lodash/fp/get */619),m=r(y),h=n(/*! lodash/fp/includes */331),v=r(h),P=n(/*! lodash/fp/values */634),g=r(P),T=t.TYPES={ADDON:"addon",COLLECTION:"collection",ELEMENT:"element",VIEW:"view",MODULE:"module"},b=(0,g.default)(T),O=t.isMeta=function(e){return(0,v.default)((0,m.default)("type",e),b)},_=function(e){return O(e)?e:O((0,m.default)("_meta",e))?e._meta:O((0,m.default)("constructor._meta",e))?e.constructor._meta:void 0},E=(0,f.default)(function(e,t,n){return(0,d.default)(_,(0,m.default)(e),(0,i.default)(t))(n)}),N=t.isType=E("type");t.isAddon=N(T.ADDON),t.isCollection=N(T.COLLECTION),t.isElement=N(T.ELEMENT),t.isView=N(T.VIEW),t.isModule=N(T.MODULE),t.isParent=(0,d.default)(_,(0,u.default)("parent"),(0,i.default)(!1)),t.isChild=(0,d.default)(_,(0,u.default)("parent")),t.isPrivate=(0,d.default)(_,(0,m.default)("name"),(0,a.default)("_"))},/*!************************!*\
!*** ./src/lib/SUI.js ***!
\************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_ICONS_IN_ALL_CONTEXTS=t.COMPONENT_CONTEXT_SPECIFIC_ICONS=t.ICONS_AND_ALIASES=t.ICON_ALIASES=t.ICONS=t.NETWORKS_AND_WEBSITE_ICONS=t.PAYMENT_OPTIONS_ICONS=t.CURRENCY_ICONS=t.TEXT_EDITOR_ICONS=t.TABLES_ICONS=t.MAP_LOCATIONS_TRANSPORTATION_ICONS=t.AUDIO_ICONS=t.RATING_ICONS=t.TECHNOLOGIES_ICONS=t.FILE_SYSTEM_ICONS=t.COMPUTER_ICONS=t.MOBILE_ICONS=t.POINTERS_ICONS=t.MEDIA_ICONS=t.ITEM_SELECTION_ICONS=t.SHAPES_ICONS=t.LITERAL_OBJECTS_ICONS=t.VIEW_ADJUSTMENT_ICONS=t.ACCESSIBILITY_ICONS=t.GENDER_SEXUALITY_ICONS=t.USERS_ICONS=t.MESSAGES_ICONS=t.USER_ACTIONS_ICONS=t.WEB_CONTENT_ICONS=t.WIDTHS=t.VISIBILITY=t.VERTICAL_ALIGNMENTS=t.TEXT_ALIGNMENTS=t.SIZES=t.FLOATS=t.COLORS=void 0;var o=n(/*! babel-runtime/helpers/toConsumableArray */39),a=r(o),l=n(/*! lodash/values */178),u=r(l),s=n(/*! lodash/keys */20),i=r(s),c=n(/*! ./numberToWord */117),d=(t.COLORS=["red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","black"],t.FLOATS=["left","right"],t.SIZES=["mini","tiny","small","medium","large","big","huge","massive"],t.TEXT_ALIGNMENTS=["left","center","right","justified"],t.VERTICAL_ALIGNMENTS=["bottom","middle","top"],t.VISIBILITY=["mobile","tablet","computer","large screen","widescreen"],t.WIDTHS=[].concat((0,a.default)((0,i.default)(c.numberToWordMap)),(0,a.default)((0,i.default)(c.numberToWordMap).map(Number)),(0,a.default)((0,u.default)(c.numberToWordMap))),t.WEB_CONTENT_ICONS=["search","mail outline","signal","setting","home","inbox","browser","tag","tags","image","calendar","comment","shop","comments","external","privacy","settings","comments","external","trophy","payment","feed","alarm outline","tasks","cloud","lab","mail","dashboard","comment outline","comments outline","sitemap","idea","alarm","terminal","code","protect","calendar outline","ticket","external square","bug","mail square","history","options","text telephone","find","wifi","alarm mute","alarm mute outline","copyright","at","eyedropper","paint brush","heartbeat","mouse pointer","hourglass empty","hourglass start","hourglass half","hourglass end","hourglass full","hand pointer","trademark","registered","creative commons","add to calendar","remove from calendar","delete calendar","checked calendar","industry","shopping bag","shopping basket","hashtag","percent","address book","address book outline","address card","address card outline","id badge","id card","id card outline","podcast","window close","window close outline","window maximize","window minimize","window restore"]),p=t.USER_ACTIONS_ICONS=["wait","download","repeat","refresh","lock","bookmark","print","write","adjust","theme","edit","external share","ban","mail forward","share","expand","compress","unhide","hide","random","retweet","sign out","pin","sign in","upload","call","remove bookmark","call square","unlock","configure","filter","wizard","undo","exchange","cloud download","cloud upload","reply","reply all","erase","unlock alternate","write square","share square","archive","translate","recycle","send","send outline","share alternate","share alternate square","add to cart","in cart","add user","remove user","object group","object ungroup","clone","talk","talk outline"],f=t.MESSAGES_ICONS=["help circle","info circle","warning circle","warning sign","announcement","help","info","warning","birthday","help circle outline"],y=t.USERS_ICONS=["user","users","doctor","handicap","student","child","spy","user circle","user circle outline","user outline"],m=t.GENDER_SEXUALITY_ICONS=["female","male","woman","man","non binary transgender","intergender","transgender","lesbian","gay","heterosexual","other gender","other gender vertical","other gender horizontal","neuter","genderless"],h=t.ACCESSIBILITY_ICONS=["universal access","wheelchair","blind","audio description","volume control phone","braille","asl","assistive listening systems","deafness","sign language","low vision"],v=t.VIEW_ADJUSTMENT_ICONS=["block layout","grid layout","list layout","zoom","zoom out","resize vertical","resize horizontal","maximize","crop"],P=t.LITERAL_OBJECTS_ICONS=["cocktail","road","flag","book","gift","leaf","fire","plane","magnet","lemon","world","travel","shipping","money","legal","lightning","umbrella","treatment","suitcase","bar","flag outline","flag checkered","puzzle","fire extinguisher","rocket","anchor","bullseye","sun","moon","fax","life ring","bomb","soccer","calculator","diamond","sticky note","sticky note outline","law","hand peace","hand rock","hand paper","hand scissors","hand lizard","hand spock","tv","thermometer empty","thermometer full","thermometer half","thermometer quarter","thermometer three quarters","bath","snowflake outline"],g=t.SHAPES_ICONS=["crosshairs","asterisk","square outline","certificate","square","quote left","quote right","spinner","circle","ellipsis horizontal","ellipsis vertical","cube","cubes","circle notched","circle thin"],T=t.ITEM_SELECTION_ICONS=["checkmark","remove","checkmark box","move","add circle","minus circle","remove circle","check circle","remove circle outline","check circle outline","plus","minus","add square","radio","minus square","minus square outline","check square","selected radio","plus square outline","toggle off","toggle on"],b=t.MEDIA_ICONS=["film","sound","photo","bar chart","camera retro","newspaper","area chart","pie chart","line chart"],O=t.POINTERS_ICONS=["arrow circle outline down","arrow circle outline up","chevron left","chevron right","arrow left","arrow right","arrow up","arrow down","chevron up","chevron down","pointing right","pointing left","pointing up","pointing down","arrow circle left","arrow circle right","arrow circle up","arrow circle down","caret down","caret up","caret left","caret right","angle double left","angle double right","angle double up","angle double down","angle left","angle right","angle up","angle down","chevron circle left","chevron circle right","chevron circle up","chevron circle down","toggle down","toggle up","toggle right","long arrow down","long arrow up","long arrow left","long arrow right","arrow circle outline right","arrow circle outline left","toggle left"],_=t.MOBILE_ICONS=["tablet","mobile","battery full","battery high","battery medium","battery low","battery empty"],E=t.COMPUTER_ICONS=["power","trash outline","disk outline","desktop","laptop","game","keyboard","plug"],N=t.FILE_SYSTEM_ICONS=["trash","file outline","folder","folder open","file text outline","folder outline","folder open outline","level up","level down","file","file text","file pdf outline","file word outline","file excel outline","file powerpoint outline","file image outline","file archive outline","file audio outline","file video outline","file code outline"],S=t.TECHNOLOGIES_ICONS=["qrcode","barcode","rss","fork","html5","css3","rss square","openid","database","server","usb","bluetooth","bluetooth alternative","microchip"],M=t.RATING_ICONS=["heart","star","empty star","thumbs outline up","thumbs outline down","star half","empty heart","smile","frown","meh","star half empty","thumbs up","thumbs down"],x=t.AUDIO_ICONS=["music","video play outline","volume off","volume down","volume up","record","step backward","fast backward","backward","play","pause","stop","forward","fast forward","step forward","eject","unmute","mute","video play","closed captioning","pause circle","pause circle outline","stop circle","stop circle outline"],w=t.MAP_LOCATIONS_TRANSPORTATION_ICONS=["marker","coffee","food","building outline","hospital","emergency","first aid","military","h","location arrow","compass","space shuttle","university","building","paw","spoon","car","taxi","tree","bicycle","bus","ship","motorcycle","street view","hotel","train","subway","map pin","map signs","map outline","map"],C=t.TABLES_ICONS=["table","columns","sort","sort descending","sort ascending","sort alphabet ascending","sort alphabet descending","sort content ascending","sort content descending","sort numeric ascending","sort numeric descending"],I=t.TEXT_EDITOR_ICONS=["font","bold","italic","text height","text width","align left","align center","align right","align justify","list","outdent","indent","linkify","cut","copy","attach","save","content","unordered list","ordered list","strikethrough","underline","paste","unlinkify","superscript","subscript","header","paragraph","text cursor"],A=t.CURRENCY_ICONS=["euro","pound","dollar","rupee","yen","ruble","won","bitcoin","lira","shekel"],j=t.PAYMENT_OPTIONS_ICONS=["paypal","google wallet","visa","mastercard","discover","american express","paypal card","stripe","japan credit bureau","diners club","credit card alternative"],k=t.NETWORKS_AND_WEBSITE_ICONS=["twitter square","facebook square","linkedin square","github square","twitter","facebook f","github","pinterest","pinterest square","google plus square","google plus","linkedin","github alternate","maxcdn","youtube square","youtube","xing","xing square","youtube play","dropbox","stack overflow","instagram","flickr","adn","bitbucket","bitbucket square","tumblr","tumblr square","apple","windows","android","linux","dribble","skype","foursquare","trello","gittip","vk","weibo","renren","pagelines","stack exchange","vimeo square","slack","wordpress","yahoo","google","reddit","reddit square","stumbleupon circle","stumbleupon","delicious","digg","pied piper","pied piper alternate","drupal","joomla","behance","behance square","steam","steam square","spotify","deviantart","soundcloud","vine","codepen","jsfiddle","rebel","empire","git square","git","hacker news","tencent weibo","qq","wechat","slideshare","twitch","yelp","lastfm","lastfm square","ioxhost","angellist","meanpath","buysellads","connectdevelop","dashcube","forumbee","leanpub","sellsy","shirtsinbulk","simplybuilt","skyatlas","facebook","pinterest","whatsapp","viacoin","medium","y combinator","optinmonster","opencart","expeditedssl","gg","gg circle","tripadvisor","odnoklassniki","odnoklassniki square","pocket","wikipedia","safari","chrome","firefox","opera","internet explorer","contao","500px","amazon","houzz","vimeo","black tie","fonticons","reddit alien","microsoft edge","codiepie","modx","fort awesome","product hunt","mixcloud","scribd","gitlab","wpbeginner","wpforms","envira gallery","glide","glide g","viadeo","viadeo square","snapchat","snapchat ghost","snapchat square","pied piper hat","first order","yoast","themeisle","google plus circle","font awesome","bandcamp","eercast","etsy","free code camp","grav","imdb","linode","meetup","quora","ravelry","superpowers","telegram","wpexplorer"],D=t.ICONS=[].concat(d,p,f,y,m,h,v,P,g,T,b,O,_,E,N,S,M,x,w,C,I,A,j,k),L=t.ICON_ALIASES=["like","favorite","video","check","close","cancel","delete","x","zoom in","magnify","shutdown","clock","time","play circle outline","headphone","camera","video camera","picture","pencil","compose","point","tint","signup","plus circle","question circle","dont","minimize","add","exclamation circle","attention","eye","exclamation triangle","shuffle","chat","cart","shopping cart","bar graph","key","cogs","discussions","like outline","dislike outline","heart outline","log out","thumb tack","winner","phone","bookmark outline","phone square","credit card","hdd outline","bullhorn","bell outline","hand outline right","hand outline left","hand outline up","hand outline down","globe","wrench","briefcase","group","linkify","chain","flask","sidebar","bars","list ul","list ol","numbered list","magic","truck","currency","triangle down","dropdown","triangle up","triangle left","triangle right","envelope","conversation","rain","clipboard","lightbulb","bell","ambulance","medkit","fighter jet","beer","plus square","computer","circle outline","gamepad","star half full","broken chain","question","exclamation","eraser","microphone","microphone slash","shield","target","play circle","pencil square","eur","gbp","usd","inr","cny","rmb","jpy","rouble","rub","krw","btc","gratipay","zip","dot circle outline","try","graduation","circle outline","sliders","weixin","tty","teletype","binoculars","power cord","wifi","visa card","mastercard card","discover card","amex","american express card","stripe card","bell slash","bell slash outline","area graph","pie graph","line graph","cc","sheqel","ils","plus cart","arrow down cart","detective","venus","mars","mercury","intersex","venus double","female homosexual","mars double","male homosexual","venus mars","mars stroke","mars alternate","mars vertical","mars stroke vertical","mars horizontal","mars stroke horizontal","asexual","facebook official","user plus","user times","user close","user cancel","user delete","user x","bed","yc","ycombinator","battery four","battery three","battery three quarters","battery two","battery half","battery one","battery quarter","battery zero","i cursor","jcb","japan credit bureau card","diners club card","balance","hourglass outline","hourglass zero","hourglass one","hourglass two","hourglass three","hourglass four","grab","hand victory","tm","r circle","television","five hundred pixels","calendar plus","calendar minus","calendar times","calendar check","factory","commenting","commenting outline","edge","ms edge","wordpress beginner","wordpress forms","envira","question circle outline","assistive listening devices","als","ald","asl interpreting","deaf","american sign language interpreting","hard of hearing","signing","new pied piper","theme isle","google plus official","fa","bathtub","drivers license","drivers license outline","s15","thermometer","times rectangle","times rectangle outline","vcard","vcard outline"],K=t.ICONS_AND_ALIASES=[].concat((0,a.default)(D),L),U=t.COMPONENT_CONTEXT_SPECIFIC_ICONS=["left dropdown"];t.ALL_ICONS_IN_ALL_CONTEXTS=[].concat((0,a.default)(K),U)},/*!**********************************!*\
!*** ./src/lib/childrenUtils.js ***!
\**********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.findByType=t.someByType=void 0;var o=n(/*! lodash/find */327),a=r(o),l=n(/*! lodash/some */340),u=r(l),s=n(/*! react */1);t.someByType=function(e,t){return(0,u.default)(s.Children.toArray(e),{type:t})},t.findByType=function(e,t){return(0,a.default)(s.Children.toArray(e),{type:t})}},/*!**************************************!*\
!*** ./src/lib/classNameBuilders.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.useWidthProp=t.useVerticalAlignProp=t.useTextAlignProp=t.useOnlyProp=t.useKeyOrValueAndKey=t.useValueAndKey=t.useKeyOnly=void 0;var o=n(/*! babel-runtime/helpers/typeof */56),a=r(o),l=n(/*! ./numberToWord */117),u=(t.useKeyOnly=function(e,t){return e&&t},t.useValueAndKey=function(e,t){return e&&e!==!0&&e+" "+t});t.useKeyOrValueAndKey=function(e,t){return e&&(e===!0?t:e+" "+t)},t.useOnlyProp=function(e){return e&&e!==!0?e.replace("large screen","large-screen").split(" ").map(function(e){return e.replace("-"," ")+" only"}).join(" "):null},t.useTextAlignProp=function(e){return"justified"===e?"justified":u(e,"aligned")},t.useVerticalAlignProp=function(e){return u(e,"aligned")},t.useWidthProp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n&&"equal"===e)return"equal width";var r="undefined"==typeof e?"undefined":(0,a.default)(e);return"string"!==r&&"number"!==r||!t?(0,l.numberToWord)(e):(0,l.numberToWord)(e)+" "+t}},/*!************************************!*\
!*** ./src/lib/customPropTypes.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.deprecate=t.collectionShorthand=t.itemShorthand=t.contentShorthand=t.onlyProp=t.demand=t.givenProps=t.some=t.every=t.disallow=t.suggest=t.as=void 0;var o=n(/*! babel-runtime/helpers/toConsumableArray */39),a=r(o),l=n(/*! lodash/fp/difference */617),u=r(l),s=n(/*! lodash/fp/trim */633),i=r(s),c=n(/*! lodash/fp/isObject */623),d=r(c),p=n(/*! lodash/fp/pick */628),f=r(p),y=n(/*! lodash/fp/keys */625),m=r(y),h=n(/*! lodash/fp/isPlainObject */624),v=r(h),P=n(/*! lodash/fp/isFunction */622),g=r(P),T=n(/*! lodash/fp/compact */615),b=r(T),O=n(/*! lodash/fp/take */632),_=r(O),E=n(/*! lodash/fp/sortBy */629),N=r(E),S=n(/*! lodash/fp/sum */631),M=r(S),x=n(/*! lodash/fp/min */627),w=r(x),C=n(/*! lodash/fp/map */626),I=r(C),A=n(/*! lodash/fp/flow */330),j=r(A),k=n(/*! lodash/fp/includes */331),D=r(k),L=n(/*! lodash/fp/isNil */332),K=r(L),U=n(/*! react */1),V=n(/*! ./leven */224),R=r(V),z=function(){var e;return(e=Object.prototype.toString).call.apply(e,arguments)},F=(t.as=function(){return U.PropTypes.oneOfType([U.PropTypes.string,U.PropTypes.func]).apply(void 0,arguments)},t.suggest=function(e){return function(t,n,r){if(!Array.isArray(e))throw new Error(["Invalid argument supplied to suggest, expected an instance of array."," See `"+n+"` prop in `"+r+"`."].join(""));var o=t[n];if(!(0,K.default)(o)&&o!==!1&&!(0,D.default)(o,e)){var a=o.split(" "),l=(0,j.default)((0,I.default)(function(e){var t=e.split(" "),n=(0,j.default)((0,I.default)(function(e){return(0,I.default)(function(t){return(0,R.default)(e,t)},t)}),(0,I.default)(w.default),M.default)(a),r=(0,j.default)((0,I.default)(function(e){return(0,I.default)(function(t){return(0,R.default)(e,t)},a)}),(0,I.default)(w.default),M.default)(t);return{suggestion:e,score:n+r}}),(0,N.default)(["score","suggestion"]),(0,_.default)(3))(e);if(!l.some(function(e){return 0===e.score}))return new Error(["Invalid prop `"+n+"` of value `"+o+"` supplied to `"+r+"`.","\n\nInstead of `"+o+"`, did you mean:",l.map(function(e){return"\n - "+e.suggestion}).join(""),"\n"].join(""))}}},t.disallow=function(e){return function(t,n,r){if(!Array.isArray(e))throw new Error(["Invalid argument supplied to disallow, expected an instance of array."," See `"+n+"` prop in `"+r+"`."].join(""));if(!(0,K.default)(t[n])&&t[n]!==!1){var o=e.reduce(function(e,n){return(0,K.default)(t[n])||t[n]===!1?e:[].concat((0,a.default)(e),[n])},[]);return o.length>0?new Error(["Prop `"+n+"` in `"+r+"` conflicts with props: `"+o.join("`, `")+"`.","They cannot be defined together, choose one or the other."].join(" ")):void 0}}}),W=t.every=function(e){return function(t,n,r){for(var o=arguments.length,a=Array(o>3?o-3:0),l=3;l<o;l++)a[l-3]=arguments[l];if(!Array.isArray(e))throw new Error(["Invalid argument supplied to every, expected an instance of array.","See `"+n+"` prop in `"+r+"`."].join(" "));var u=(0,j.default)((0,I.default)(function(e){if("function"!=typeof e)throw new Error('every() argument "validators" should contain functions, found: '+z(e)+".");return e.apply(void 0,[t,n,r].concat(a))}),b.default)(e);return u[0]}},B=(t.some=function(e){return function(t,n,r){for(var o=arguments.length,a=Array(o>3?o-3:0),l=3;l<o;l++)a[l-3]=arguments[l];if(!Array.isArray(e))throw new Error(["Invalid argument supplied to some, expected an instance of array.","See `"+n+"` prop in `"+r+"`."].join(" "));var u=(0,b.default)((0,I.default)(e,function(e){if(!(0,g.default)(e))throw new Error('some() argument "validators" should contain functions, found: '+z(e)+".");return e.apply(void 0,[t,n,r].concat(a))}));if(u.length===e.length){var s=new Error("One of these validators must pass:");return s.message+="\n"+(0,I.default)(u,function(e,t){return"["+(t+1)+"]: "+e.message}).join("\n"),s}}},t.givenProps=function(e,t){return function(n,r,o){for(var a=arguments.length,l=Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];if(!(0,v.default)(e))throw new Error(["Invalid argument supplied to givenProps, expected an object.","See `"+r+"` prop in `"+o+"`."].join(" "));if("function"!=typeof t)throw new Error(["Invalid argument supplied to givenProps, expected a function.","See `"+r+"` prop in `"+o+"`."].join(" "));var s=(0,m.default)(e).every(function(t){var a=e[t];return"function"==typeof a?!a.apply(void 0,[n,t,o].concat(l)):a===n[r]});if(s){var i=t.apply(void 0,[n,r,o].concat(l));if(i){var c="{ "+(0,m.default)((0,f.default)((0,m.default)(e),n)).map(function(e){var t=n[e],r=t;return"string"==typeof t?r='"'+t+'"':Array.isArray(t)?r="["+t.join(", ")+"]":(0,d.default)(t)&&(r="{...}"),e+": "+r}).join(", ")+" }";return i.message="Given props "+c+": "+i.message,i}}}},t.demand=function(e){return function(t,n,r){if(!Array.isArray(e))throw new Error(["Invalid `requiredProps` argument supplied to require, expected an instance of array."," See `"+n+"` prop in `"+r+"`."].join(""));if(void 0!==t[n]){var o=e.filter(function(e){return void 0===t[e]});return o.length>0?new Error("`"+n+"` prop in `"+r+"` requires props: `"+o.join("`, `")+"`."):void 0}}},t.onlyProp=function(e){return function(t,n,r){if(!Array.isArray(e))throw new Error(["Invalid argument supplied to some, expected an instance of array.","See `"+n+"` prop in `"+r+"`."].join(" "));var o=t[n];if(!(0,K.default)(o)&&o!==!1){var a=o.replace("large screen","large-screen").split(" ").map(function(e){return(0,i.default)(e).replace("-"," ")}),l=(0,u.default)(a,e);return l.length>0?new Error("`"+n+"` prop in `"+r+"` has invalid values: `"+l.join("`, `")+"`."):void 0}}},t.contentShorthand=function(){return W([F(["children"]),U.PropTypes.node]).apply(void 0,arguments)},t.itemShorthand=function(){return W([F(["children"]),U.PropTypes.oneOfType([U.PropTypes.array,U.PropTypes.node,U.PropTypes.object])]).apply(void 0,arguments)});t.collectionShorthand=function(){return W([F(["children"]),U.PropTypes.arrayOf(B)]).apply(void 0,arguments)},t.deprecate=function(e,t){return function(n,r,o){for(var a=arguments.length,l=Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];if("string"!=typeof e)throw new Error(["Invalid `help` argument supplied to deprecate, expected a string.","See `"+r+"` prop in `"+o+"`."].join(" "));if(void 0!==n[r]){var s=new Error("The `"+r+"` prop in `"+o+"` is deprecated.");if(e&&(s.message+=" "+e),t){if("function"!=typeof t)throw new Error(["Invalid argument supplied to deprecate, expected a function.","See `"+r+"` prop in `"+o+"`."].join(" "));var i=t.apply(void 0,[n,r,o].concat(l));i&&(s.message=s.message+" "+i.message)}return s}}}},/*!**************************!*\
!*** ./src/lib/debug.js ***!
\**************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.debug=t.makeDebugger=void 0;var o=n(/*! ./isBrowser */223),a=r(o),l=void 0,u=function(){};if(a.default&&"production"!==e.env.NODE_ENV&&"test"!==e.env.NODE_ENV){var s=void 0;try{s=window.localStorage.debug}catch(e){console.error("Semantic-UI-React could not enable debug."),console.error(e)}l=n(/*! debug */477),l.enable(s)}else l=function(){return u};var i=t.makeDebugger=function(e){return l("semanticUIReact:"+e)};t.debug=i("log")}).call(t,n(/*! ./../../~/process/browser.js */3))},/*!******************************!*\
!*** ./src/lib/factories.js ***!
\******************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("function"!=typeof e&&"string"!=typeof e)throw new Error("createShorthandFactory() Component must be a string or function.");if(null===n)return null;var a=(0,v.default)(n),l=(0,m.default)(n),s=(0,T.isValidElement)(n),c=(0,f.default)(n),p=a||l||(0,d.default)(n),y=s&&n.props||c&&n||p&&t(n);r=(0,i.default)(r)?r(y):r;var h=(0,u.default)({},r,y);if(y.className&&r.className&&(h.className=(0,g.default)(r.className,y.className)),y.style&&r.style&&(h.style=(0,u.default)({},r.style,y.style)),!h.key){var P=h.childKey;P?(h.key="function"==typeof P?P(h):P,delete h.childKey):o&&(a||l)&&(h.key=n)}return s?(0,T.cloneElement)(n,h):p||c?b.default.createElement(e,h):null}function a(e,t,n){if("function"!=typeof e&&"string"!=typeof e)throw new Error("createShorthandFactory() Component must be a string or function.");return function(r,a){return o(e,t,r,a,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createHTMLLabel=t.createHTMLInput=t.createHTMLImage=void 0;var l=n(/*! babel-runtime/helpers/extends */2),u=r(l),s=n(/*! lodash/isFunction */38),i=r(s),c=n(/*! lodash/isArray */12),d=r(c),p=n(/*! lodash/isPlainObject */103),f=r(p),y=n(/*! lodash/isNumber */334),m=r(y),h=n(/*! lodash/isString */335),v=r(h);t.createShorthand=o,t.createShorthandFactory=a;var P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T);o.handledProps=[];t.createHTMLImage=a("img",function(e){return{src:e}}),t.createHTMLInput=a("input",function(e){return{type:e}}),t.createHTMLLabel=a("label",function(e){return{children:e}})},/*!***********************************!*\
!*** ./src/lib/getElementType.js ***!
\***********************************/
function(e,t){"use strict";function n(e,t,n){var r=e.defaultProps,o=void 0===r?{}:r;if(t.as&&t.as!==o.as)return t.as;if(n){var a=n();if(a)return a}return t.href?"a":o.as||"div"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},/*!**************************************!*\
!*** ./src/lib/getUnhandledProps.js ***!
\**************************************/
function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var n=e.handledProps,r=void 0===n?[]:n;return Object.keys(t).reduce(function(e,n){return"childKey"===n?e:(r.indexOf(n)===-1&&(e[n]=t[n]),e)},{})};t.default=n},/*!****************************************!*\
!*** ./src/lib/htmlInputPropsUtils.js ***!
\****************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.partitionHTMLInputProps=t.htmlInputProps=t.htmlInputEvents=t.htmlInputAttrs=void 0;var o=n(/*! lodash/includes */55),a=r(o),l=n(/*! lodash/forEach */329),u=r(l),s=t.htmlInputAttrs=["selected","defaultValue","defaultChecked","autoCapitalize","autoComplete","autoFocus","checked","form","max","maxLength","min","multiple","name","pattern","placeholder","readOnly","required","step","type","value"],i=t.htmlInputEvents=["onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onClick","onContextMenu","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],c=t.htmlInputProps=[].concat(s,i);t.partitionHTMLInputProps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,n={},r={};return(0,u.default)(e,function(e,o){return(0,a.default)(t,o)?n[o]=e:r[o]=e}),[n,r]}},/*!********************************!*\
!*** ./src/lib/keyboardKey.js ***!
\********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! lodash/isObject */19),a=r(o),l=n(/*! lodash/times */343),u=r(l),s={3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"};(0,u.default)(24,function(e){return s[112+e]="F"+(e+1)}),(0,u.default)(26,function(e){var t=e+65;s[t]=[String.fromCharCode(t+32),String.fromCharCode(t)]});var i={codes:s,getCode:function(e){return(0,a.default)(e)?e.keyCode||e.which||this[e.key]:this[e]},getName:function(e){var t=(0,a.default)(e),n=s[t?e.keyCode||e.which:e];return Array.isArray(n)&&(n=t?n[e.shiftKey?1:0]:n[0]),n},Cancel:3,Help:6,Backspace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Convert:28,NonConvert:29,Accept:30,ModeChange:31," ":32,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Select:41,Print:42,Execute:43,PrintScreen:44,Insert:45,Delete:46,0:48,")":48,1:49,"!":49,2:50,"@":50,3:51,"#":51,4:52,$:52,5:53,"%":53,6:54,"^":54,7:55,"&":55,8:56,"*":56,9:57,"(":57,a:65,A:65,b:66,B:66,c:67,C:67,d:68,D:68,e:69,E:69,f:70,F:70,g:71,G:71,h:72,H:72,i:73,I:73,j:74,J:74,k:75,K:75,l:76,L:76,m:77,M:77,n:78,N:78,o:79,O:79,p:80,P:80,q:81,Q:81,r:82,R:82,s:83,S:83,t:84,T:84,u:85,U:85,v:86,V:86,w:87,W:87,x:88,X:88,y:89,Y:89,z:90,Z:90,OS:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,VolumeMute:181,VolumeDown:182,VolumeUp:183,";":186,":":186,"=":187,"+":187,",":188,"<":188,"-":189,_:189,".":190,">":190,"/":191,"?":191,"`":192,"~":192,"[":219,"{":219,"\\":220,"|":220,"]":221,"}":221,"'":222,'"':222,Meta:224,AltGraph:225,Attn:246,CrSel:247,ExSel:248,EraseEof:249,Play:250,ZoomOut:251};i.Spacebar=i[" "],i.Digit0=i[0],i.Digit1=i[1],i.Digit2=i[2],i.Digit3=i[3],i.Digit4=i[4],i.Digit5=i[5],i.Digit6=i[6],i.Digit7=i[7],i.Digit8=i[8],i.Digit9=i[9],i.Tilde=i["~"],i.GraveAccent=i["`"],i.ExclamationPoint=i["!"],i.AtSign=i["@"],i.PoundSign=i["#"],i.PercentSign=i["%"],i.Caret=i["^"],i.Ampersand=i["&"],i.PlusSign=i["+"],i.MinusSign=i["-"],i.EqualsSign=i["="],i.DivisionSign=i["/"],i.MultiplicationSign=i["*"],i.Comma=i[","],i.Decimal=i["."],i.Colon=i[":"],i.Semicolon=i[";"],i.Pipe=i["|"],i.BackSlash=i["\\"],i.QuestionMark=i["?"],i.SingleQuote=i['"'],i.DoubleQuote=i['"'],i.LeftCurlyBrace=i["{"],i.RightCurlyBrace=i["}"],i.LeftParenthesis=i["("],i.RightParenthesis=i[")"],i.LeftAngleBracket=i["<"],i.RightAngleBracket=i[">"],i.LeftSquareBracket=i["["],i.RightSquareBracket=i["]"],t.default=i},/*!*******************************!*\
!*** ./src/lib/objectDiff.js ***!
\*******************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.objectDiff=void 0;var o=n(/*! lodash/isEqual */174),a=r(o),l=n(/*! lodash/has */54),u=r(l),s=n(/*! lodash/transform */651),i=r(s);t.objectDiff=function(e,t){return(0,i.default)(e,function(e,n,r){(0,u.default)(t,r)?(0,a.default)(n,t[r])||(e[r]=t[r]):e[r]="[DELETED]"},{})}},/*!********************************************!*\
!*** ./src/modules/Accordion/Accordion.js ***!
\********************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/toConsumableArray */39),u=r(l),s=n(/*! babel-runtime/helpers/classCallCheck */7),i=r(s),c=n(/*! babel-runtime/helpers/createClass */8),d=r(c),p=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),f=r(p),y=n(/*! babel-runtime/helpers/inherits */9),m=r(y),h=n(/*! lodash/keys */20),v=r(h),P=n(/*! lodash/omit */176),g=r(P),T=n(/*! lodash/isFunction */38),b=r(T),O=n(/*! lodash/each */171),_=r(O),E=n(/*! lodash/has */54),N=r(E),S=n(/*! lodash/without */13),M=r(S),x=n(/*! lodash/includes */55),w=r(x),C=n(/*! classnames */5),I=r(C),A=n(/*! react */1),j=r(A),k=n(/*! ../../lib */4),D=n(/*! ./AccordionContent */225),L=r(D),K=n(/*! ./AccordionTitle */226),U=r(K),V=function(e){function t(){var e;(0,i.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var l=(0,f.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return l.state={},l.handleTitleClick=function(e,t){var n=l.props,r=n.onTitleClick,o=n.exclusive,a=l.state.activeIndex,s=void 0;s=o?t===a?-1:t:(0,w.default)(a,t)?(0,M.default)(a,t):[].concat((0,u.default)(a),[t]),l.trySetState({activeIndex:s}),r&&r(e,t)},l.isIndexActive=function(e){var t=l.props.exclusive,n=l.state.activeIndex;return t?n===e:(0,w.default)(n,e)},l.renderChildren=function(){var e=l.props.children,t=0,n=0;return A.Children.map(e,function(e){var r=e.type===U.default,o=e.type===L.default;if(r){var u=t,s=(0,N.default)(e,"props.active")?e.props.active:l.isIndexActive(t),i=function(t){l.handleTitleClick(t,u),e.props.onClick&&e.props.onClick(t,u)};return t++,(0,A.cloneElement)(e,(0,a.default)({},e.props,{active:s,onClick:i}))}if(o){var c=(0,N.default)(e,"props.active")?e.props.active:l.isIndexActive(n);return n++,(0,A.cloneElement)(e,(0,a.default)({},e.props,{active:c}))}return e})},l.renderPanels=function(){var e=l.props.panels,t=[];return(0,_.default)(e,function(e,n){var r=(0,N.default)(e,"active")?e.active:l.isIndexActive(n),o=function(t){l.handleTitleClick(t,n),e.onClick&&e.onClick(t,n)},a=e.key||(0,b.default)(e.childKey)&&e.childKey(e)||e.childKey&&e.childKey||e.title;t.push(U.default.create({active:r,onClick:o,key:a+"-title",content:e.title})),t.push(L.default.create({active:r,key:a+"-content",content:e.content}))}),t},l.state={activeIndex:l.props.exclusive?-1:[-1]},l}return(0,m.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,n=e.className,r=e.fluid,o=e.inverted,l=e.panels,u=e.styled,s=(0,I.default)("ui",(0,k.useKeyOnly)(r,"fluid"),(0,k.useKeyOnly)(o,"inverted"),(0,k.useKeyOnly)(u,"styled"),"accordion",n),i=(0,g.default)(this.props,(0,v.default)(t.propTypes)),c=(0,k.getElementType)(t,this.props);return j.default.createElement(c,(0,a.default)({},i,{className:s}),l?this.renderPanels():this.renderChildren())}}]),t}(k.AutoControlledComponent);V.defaultProps={exclusive:!0},V.autoControlledProps=["activeIndex"],V._meta={name:"Accordion",type:k.META.TYPES.MODULE},V.Content=L.default,V.Title=U.default,t.default=V,"production"!==e.env.NODE_ENV?V.propTypes={as:k.customPropTypes.as,activeIndex:A.PropTypes.oneOfType([A.PropTypes.arrayOf(A.PropTypes.number),A.PropTypes.number]),children:A.PropTypes.node,className:A.PropTypes.string,defaultActiveIndex:A.PropTypes.oneOfType([A.PropTypes.arrayOf(A.PropTypes.number),A.PropTypes.number]),exclusive:A.PropTypes.bool,fluid:A.PropTypes.bool,inverted:A.PropTypes.bool,onTitleClick:A.PropTypes.func,panels:k.customPropTypes.every([k.customPropTypes.disallow(["children"]),A.PropTypes.arrayOf(A.PropTypes.shape({key:A.PropTypes.string,active:A.PropTypes.bool,title:k.customPropTypes.contentShorthand,content:k.customPropTypes.contentShorthand,onClick:A.PropTypes.func}))]),styled:A.PropTypes.bool}:void 0,V.handledProps=["activeIndex","as","children","className","defaultActiveIndex","exclusive","fluid","inverted","onTitleClick","panels","styled"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/modules/Checkbox/Checkbox.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/fp/invoke */621),m=r(y),h=n(/*! lodash/fp/isNil */332),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=(0,O.makeDebugger)("checkbox"),E=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var l=arguments.length,s=Array(l),i=0;i<l;i++)s[i]=arguments[i];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={},r.canToggle=function(){var e=r.props,t=e.disabled,n=e.radio,o=e.readOnly,a=r.state.checked;return!(t||o||n&&a)},r.computeTabIndex=function(){var e=r.props,t=e.disabled,n=e.tabIndex;return(0,v.default)(n)?t?-1:0:n},r.handleInputRef=function(e){return r.inputRef=e},r.handleClick=function(e){_("handleClick()");var t=r.props,n=t.onChange,o=t.onClick,l=r.state,u=l.checked,s=l.indeterminate;r.canToggle()&&(o&&o(e,(0,a.default)({},r.props,{checked:!!u,indeterminate:!!s})),n&&n(e,(0,a.default)({},r.props,{checked:!u,indeterminate:!1})),r.trySetState({checked:!u,indeterminate:!1}))},r.handleMouseDown=function(e){_("handleMouseDown()");var t=r.props.onMouseDown,n=r.state,o=n.checked,l=n.indeterminate;(0,m.default)("focus",r.inputRef),t&&t(e,(0,a.default)({},r.props,{checked:!!o,indeterminate:!!l}))},r.setIndeterminate=function(){var e=r.state.indeterminate;r.inputRef&&(r.inputRef.indeterminate=!!e)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"componentDidMount",value:function(){this.setIndeterminate()}},{key:"componentDidUpdate",value:function(){this.setIndeterminate()}},{key:"render",value:function(){var e=this.props,n=e.className,r=e.disabled,o=e.label,l=e.name,u=e.radio,s=e.readOnly,i=e.slider,c=e.toggle,d=e.type,p=e.value,f=this.state,y=f.checked,m=f.indeterminate,h=(0,g.default)("ui",(0,O.useKeyOnly)(y,"checked"),(0,O.useKeyOnly)(r,"disabled"),(0,O.useKeyOnly)(m,"indeterminate"),(0,O.useKeyOnly)(!o,"fitted"),(0,O.useKeyOnly)(u,"radio"),(0,O.useKeyOnly)(s,"read-only"),(0,O.useKeyOnly)(i,"slider"),(0,O.useKeyOnly)(c,"toggle"),"checkbox",n),v=(0,O.getUnhandledProps)(t,this.props),P=(0,O.getElementType)(t,this.props);return b.default.createElement(P,(0,a.default)({},v,{className:h,onChange:this.handleClick,onClick:this.handleClick,onMouseDown:this.handleMouseDown}),b.default.createElement("input",{checked:y,className:"hidden",name:l,readOnly:!0,ref:this.handleInputRef,tabIndex:this.computeTabIndex(),type:d,value:p}),(0,O.createHTMLLabel)(o)||b.default.createElement("label",null))}}]),t}(O.AutoControlledComponent);E.defaultProps={type:"checkbox"},E.autoControlledProps=["checked","indeterminate"],E._meta={name:"Checkbox",type:O.META.TYPES.MODULE},t.default=E,"production"!==e.env.NODE_ENV?E.propTypes={as:O.customPropTypes.as,checked:T.PropTypes.bool,className:T.PropTypes.string,defaultChecked:T.PropTypes.bool,defaultIndeterminate:T.PropTypes.bool,disabled:T.PropTypes.bool,fitted:T.PropTypes.bool,indeterminate:T.PropTypes.bool,label:O.customPropTypes.itemShorthand,name:T.PropTypes.string,onChange:T.PropTypes.func,onClick:T.PropTypes.func,onMouseDown:T.PropTypes.func,radio:O.customPropTypes.every([T.PropTypes.bool,O.customPropTypes.disallow(["slider","toggle"])]),readOnly:T.PropTypes.bool,slider:O.customPropTypes.every([T.PropTypes.bool,O.customPropTypes.disallow(["radio","toggle"])]),toggle:O.customPropTypes.every([T.PropTypes.bool,O.customPropTypes.disallow(["radio","slider"])]),type:T.PropTypes.oneOf(["checkbox","radio"]),value:T.PropTypes.string,tabIndex:T.PropTypes.oneOfType([T.PropTypes.number,T.PropTypes.string])}:void 0,E.handledProps=["as","checked","className","defaultChecked","defaultIndeterminate","disabled","fitted","indeterminate","label","name","onChange","onClick","onMouseDown","radio","readOnly","slider","tabIndex","toggle","type","value"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/modules/Dimmer/Dimmer.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../addons/Portal */66),O=r(b),_=n(/*! ./DimmerDimmable */227),E=r(_),N=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handlePortalMount=function(){T.isBrowser&&document.body.classList.add("dimmed","dimmable")},r.handlePortalUnmount=function(){T.isBrowser&&document.body.classList.remove("dimmed","dimmable")},r.handleClick=function(e){var t=r.props,n=t.onClick,o=t.onClickOutside;n&&n(e,r.props),r.centerRef&&r.centerRef!==e.target&&r.centerRef.contains(e.target)||o&&o(e,r.props)},r.handleCenterRef=function(e){return r.centerRef=e},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.children,o=e.className,l=e.content,u=e.disabled,s=e.inverted,i=e.page,c=e.simple,d=(0,v.default)("ui",(0,T.useKeyOnly)(n,"active transition visible"),(0,T.useKeyOnly)(u,"disabled"),(0,T.useKeyOnly)(s,"inverted"),(0,T.useKeyOnly)(i,"page"),(0,T.useKeyOnly)(c,"simple"),"dimmer",o),p=(0,T.getUnhandledProps)(t,this.props),f=(0,T.getElementType)(t,this.props),y=(0,m.default)(r)?l:r,h=g.default.createElement(f,(0,a.default)({},p,{className:d,onClick:this.handleClick}),y&&g.default.createElement("div",{className:"content"},g.default.createElement("div",{className:"center",ref:this.handleCenterRef},y)));return i?g.default.createElement(O.default,{closeOnEscape:!1,closeOnDocumentClick:!1,onMount:this.handlePortalMount,onUnmount:this.handlePortalUnmount,open:n,openOnTriggerClick:!1},h):h}}]),t}(P.Component);N._meta={name:"Dimmer",type:T.META.TYPES.MODULE},N.Dimmable=E.default,t.default=N,"production"!==e.env.NODE_ENV?N.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,children:P.PropTypes.node,className:P.PropTypes.string,content:T.customPropTypes.contentShorthand,disabled:P.PropTypes.bool,onClick:P.PropTypes.func,onClickOutside:P.PropTypes.func,inverted:P.PropTypes.bool,page:P.PropTypes.bool,simple:P.PropTypes.bool}:void 0,N.handledProps=["active","as","children","className","content","disabled","inverted","onClick","onClickOutside","page","simple"],N.create=(0,T.createShorthandFactory)(N,function(e){return{content:e}})}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/modules/Dropdown/Dropdown.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/get */266),f=r(p),y=n(/*! babel-runtime/helpers/inherits */9),m=r(y),h=n(/*! lodash/compact */323),v=r(h),P=n(/*! lodash/map */16),g=r(P),T=n(/*! lodash/isNil */6),b=r(T),O=n(/*! lodash/every */609),_=r(O),E=n(/*! lodash/without */13),N=r(E),S=n(/*! lodash/findIndex */328),M=r(S),x=n(/*! lodash/find */327),w=r(x),C=n(/*! lodash/reduce */339),I=r(C),A=n(/*! lodash/some */340),j=r(A),k=n(/*! lodash/escapeRegExp */608),D=r(k),L=n(/*! lodash/filter */326),K=r(L),U=n(/*! lodash/isFunction */38),V=r(U),R=n(/*! lodash/dropRight */607),z=r(R),F=n(/*! lodash/isEmpty */173),W=r(F),B=n(/*! lodash/union */653),Y=r(B),H=n(/*! lodash/get */53),q=r(H),G=n(/*! lodash/includes */55),Z=r(G),$=n(/*! lodash/isUndefined */105),X=r($),J=n(/*! lodash/has */54),Q=r(J),ee=n(/*! lodash/isEqual */174),te=r(ee),ne=n(/*! classnames */5),re=r(ne),oe=n(/*! react */1),ae=r(oe),le=n(/*! ../../lib */4),ue=n(/*! ../../elements/Icon */15),se=r(ue),ie=n(/*! ../../elements/Label */69),ce=r(ie),de=n(/*! ./DropdownDivider */229),pe=r(de),fe=n(/*! ./DropdownItem */231),ye=r(fe),me=n(/*! ./DropdownHeader */230),he=r(me),ve=n(/*! ./DropdownMenu */232),Pe=r(ve),ge=(0,le.makeDebugger)("dropdown"),Te=function(t){function n(){var e,t,r,o;(0,u.default)(this,n);for(var l=arguments.length,s=Array(l),i=0;i<l;i++)s[i]=arguments[i];return t=r=(0,d.default)(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(s))),r.handleChange=function(e,t){ge("handleChange()"),ge(t);var n=r.props.onChange;n&&n(e,(0,a.default)({},r.props,{value:t}))},r.closeOnChange=function(e){var t=r.props,n=t.closeOnChange,o=t.multiple,a=(0,X.default)(n)?!o:n;a&&r.close(e)},r.closeOnEscape=function(e){le.keyboardKey.getCode(e)===le.keyboardKey.Escape&&(e.preventDefault(),r.close())},r.moveSelectionOnKeyDown=function(e){switch(ge("moveSelectionOnKeyDown()"),ge(le.keyboardKey.getName(e)),le.keyboardKey.getCode(e)){case le.keyboardKey.ArrowDown:e.preventDefault(),r.moveSelectionBy(1);break;case le.keyboardKey.ArrowUp:e.preventDefault(),r.moveSelectionBy(-1)}},r.openOnSpace=function(e){ge("openOnSpace()"),le.keyboardKey.getCode(e)===le.keyboardKey.Spacebar&&(r.state.open||(e.preventDefault(),r.open(e)))},r.openOnArrow=function(e){ge("openOnArrow()");var t=le.keyboardKey.getCode(e);(0,Z.default)([le.keyboardKey.ArrowDown,le.keyboardKey.ArrowUp],t)&&(r.state.open||(e.preventDefault(),r.open(e)))},r.makeSelectedItemActive=function(e){var t=r.state.open,n=r.props,o=n.multiple,l=n.onAddItem,u=r.getSelectedItem(),s=(0,q.default)(u,"value");if(s&&t)if(l&&u["data-additional"]&&l(e,(0,a.default)({},r.props,{value:s})),o){var i=(0,Y.default)(r.state.value,[s]);r.setValue(i),r.handleChange(e,i)}else r.setValue(s),r.handleChange(e,s)},r.selectItemOnEnter=function(e){ge("selectItemOnEnter()"),ge(le.keyboardKey.getName(e)),le.keyboardKey.getCode(e)===le.keyboardKey.Enter&&(e.preventDefault(),r.makeSelectedItemActive(e),r.closeOnChange(e))},r.removeItemOnBackspace=function(e){if(ge("removeItemOnBackspace()"),ge(le.keyboardKey.getName(e)),le.keyboardKey.getCode(e)===le.keyboardKey.Backspace){var t=r.props,n=t.multiple,o=t.search,a=r.state,l=a.searchQuery,u=a.value;if(!l&&o&&n&&!(0,W.default)(u)){e.preventDefault();var s=(0,z.default)(u);r.setValue(s),r.handleChange(e,s)}}},r.closeOnDocumentClick=function(e){ge("closeOnDocumentClick()"),ge(e),r.ref&&(0,V.default)(r.ref.contains)&&r.ref.contains(e.target)||r.close()},r.handleMouseDown=function(e){ge("handleMouseDown()");var t=r.props.onMouseDown;t&&t(e,r.props),r.isMouseDown=!0,le.isBrowser&&document.addEventListener("mouseup",r.handleDocumentMouseUp)},r.handleDocumentMouseUp=function(){ge("handleDocumentMouseUp()"),r.isMouseDown=!1,le.isBrowser&&document.removeEventListener("mouseup",r.handleDocumentMouseUp)},r.handleClick=function(e){ge("handleClick()",e);var t=r.props.onClick;t&&t(e,r.props),e.stopPropagation(),r.toggle(e)},r.handleItemClick=function(e,t){ge("handleItemClick()"),ge(t);var n=r.props,o=n.multiple,l=n.onAddItem,u=t.value;if(e.stopPropagation(),(o||t.disabled)&&e.nativeEvent.stopImmediatePropagation(),!t.disabled){if(l&&t["data-additional"]&&l(e,(0,a.default)({},r.props,{value:u})),o){var s=(0,Y.default)(r.state.value,[u]);r.setValue(s),r.handleChange(e,s)}else r.setValue(u),r.handleChange(e,u);r.closeOnChange(e)}},r.handleFocus=function(e){ge("handleFocus()");var t=r.props.onFocus,n=r.state.focus;n||(t&&t(e,r.props),r.setState({focus:!0}))},r.handleBlur=function(e){ge("handleBlur()");var t=r.props,n=t.closeOnBlur,o=t.multiple,a=t.onBlur,l=t.selectOnBlur;r.isMouseDown||(a&&a(e,r.props),l&&!o&&(r.makeSelectedItemActive(e),n&&r.close()),r.setState({focus:!1,searchQuery:""}))},r.handleSearchChange=function(e){ge("handleSearchChange()"),ge(e.target.value),e.stopPropagation();var t=r.props,n=t.search,o=t.onSearchChange,a=r.state.open,l=e.target.value;o&&o(e,l),n&&l&&!a&&r.open(),r.setState({selectedIndex:0,searchQuery:l})},r.getMenuOptions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.state.value,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.props.options,n=r.props,o=n.multiple,a=n.search,l=n.allowAdditions,u=n.additionPosition,s=n.additionLabel,i=r.state.searchQuery,c=t;if(o&&(c=(0,K.default)(c,function(t){return!(0,Z.default)(e,t.value)})),a&&i)if((0,V.default)(a))c=a(c,i);else{var d=new RegExp((0,D.default)(i),"i");c=(0,K.default)(c,function(e){return d.test(e.text)})}if(l&&a&&i&&!(0,j.default)(c,{text:i})){var p=ae.default.isValidElement(s)?ae.default.cloneElement(s,{key:"label"}):s||"",f={text:[p,ae.default.createElement("b",{key:"addition"},i)],value:i,className:"addition","data-additional":!0};"top"===u?c.unshift(f):c.push(f)}return c},r.getSelectedItem=function(){var e=r.state.selectedIndex,t=r.getMenuOptions();return(0,q.default)(t,"["+e+"]")},r.getEnabledIndices=function(e){var t=e||r.getMenuOptions();return(0,I.default)(t,function(e,t,n){return t.disabled||e.push(n),e},[])},r.getItemByValue=function(e){var t=r.props.options;return(0,w.default)(t,{value:e})},r.getMenuItemIndexByValue=function(e,t){var n=t||r.getMenuOptions();return(0,M.default)(n,["value",e])},r.getDropdownAriaOptions=function(e){var t=r.props,n=t.loading,o=t.disabled,a=t.search,l=t.multiple,u=r.state.open,s={role:a?"combobox":"listbox","aria-busy":n,"aria-disabled":o,"aria-expanded":!!u};return"listbox"===s.role&&(s["aria-multiselectable"]=l),s},r.setValue=function(e){ge("setValue()"),ge("value",e);var t={searchQuery:""},n=r.props,o=n.multiple,a=n.search;o&&a&&r.searchRef&&r.searchRef.focus(),r.trySetState({value:e},t),r.setSelectedIndex(e)},r.setSelectedIndex=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.state.value,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.props.options,n=r.props.multiple,o=r.state.selectedIndex,a=r.getMenuOptions(e,t),l=r.getEnabledIndices(a),u=void 0;if(!o||o<0){var s=l[0];u=n?s:r.getMenuItemIndexByValue(e,a)||l[0]}else if(n)o>=a.length-1&&(u=l[l.length-1]);else{var i=r.getMenuItemIndexByValue(e,a);u=(0,Z.default)(l,i)?i:void 0}(!u||u<0)&&(u=l[0]),r.setState({selectedIndex:u})},r.handleLabelClick=function(e,t){ge("handleLabelClick()"),e.stopPropagation(),r.setState({selectedLabel:t.value});var n=r.props.onLabelClick;n&&n(e,t)},r.handleLabelRemove=function(e,t){ge("handleLabelRemove()"),e.stopPropagation();var n=r.state.value,o=(0,N.default)(n,t.value);ge("label props:",t),ge("current value:",n),ge("remove value:",t.value),ge("new value:",o),r.setValue(o),r.handleChange(e,o)},r.moveSelectionBy=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.state.selectedIndex;ge("moveSelectionBy()"),ge("offset: "+e);var n=r.getMenuOptions(),o=n.length-1;if(!(0,_.default)(n,"disabled")){var a=t+e;if(a>o?a=0:a<0&&(a=o),n[a].disabled)return r.moveSelectionBy(e,a);r.setState({selectedIndex:a}),r.scrollSelectedItemIntoView()}},r.handleSearchRef=function(e){return r.searchRef=e},r.handleSizerRef=function(e){return r.sizerRef=e},r.handleRef=function(e){return r.ref=e},r.scrollSelectedItemIntoView=function(){if(ge("scrollSelectedItemIntoView()"),r.ref){var e=r.ref.querySelector(".menu.visible");if(e){var t=e.querySelector(".item.selected");if(t){ge("menu: "+e),ge("item: "+t);var n=t.offsetTop<e.scrollTop,o=t.offsetTop+t.clientHeight>e.scrollTop+e.clientHeight;n?e.scrollTop=t.offsetTop:o&&(e.scrollTop=t.offsetTop+t.clientHeight-e.clientHeight)}}}},r.open=function(e){ge("open()");var t=r.props,n=t.disabled,o=t.onOpen,a=t.search;n||(a&&r.searchRef&&r.searchRef.focus(),o&&o(e,r.props),r.trySetState({open:!0}),r.scrollSelectedItemIntoView())},r.close=function(e){ge("close()");var t=r.props.onClose;t&&t(e,r.props),r.trySetState({open:!1})},r.handleClose=function(){ge("handleClose()");var e=document.activeElement===r.searchRef,t=document.activeElement===r.ref,n=e||t;e||r.ref.blur(),r.setState({focus:n})},r.toggle=function(e){if(!r.state.open)return void r.open(e);var t=r.props.search,n=r.getMenuOptions();return t&&(0,W.default)(n)?void e.preventDefault():void r.close(e)},r.renderText=function(){var e=r.props,t=e.multiple,n=e.placeholder,o=e.search,a=e.text,l=r.state,u=l.searchQuery,s=l.value,i=l.open,c=t?!(0,W.default)(s):!(0,b.default)(s)&&""!==s,d=(0,re.default)(n&&!c&&"default","text",o&&u&&"filtered"),p=n;return u?p=null:a?p=a:i&&!t?p=(0,q.default)(r.getSelectedItem(),"text"):c&&(p=(0,q.default)(r.getItemByValue(s),"text")),ae.default.createElement("div",{className:d},p)},r.renderHiddenInput=function(){ge("renderHiddenInput()");var e=r.state.value,t=r.props,n=t.multiple,o=t.name,a=t.options,l=t.selection;return ge("name: "+o),ge("selection: "+l),ge("value: "+e),l?ae.default.createElement("select",{type:"hidden","aria-hidden":"true",name:o,value:e,multiple:n},ae.default.createElement("option",{value:""}),(0,g.default)(a,function(e){return ae.default.createElement("option",{key:e.value,value:e.value},e.text)})):null},r.renderSearchInput=function(){var e=r.props,t=e.disabled,n=e.search,o=e.name,a=e.tabIndex,l=r.state.searchQuery;if(!n)return null;var u=void 0;u=(0,b.default)(a)?t?-1:0:a;var s=void 0;return r.sizerRef&&l&&(r.sizerRef.style.display="inline",r.sizerRef.textContent=l,s=Math.ceil(r.sizerRef.getBoundingClientRect().width),r.sizerRef.style.removeProperty("display")),ae.default.createElement("input",{value:l,type:"text","aria-autocomplete":"list",onChange:r.handleSearchChange,className:"search",name:[o,"search"].join("-"),autoComplete:"off",tabIndex:u,style:{width:s},ref:r.handleSearchRef})},r.renderSearchSizer=function(){var e=r.props,t=e.search,n=e.multiple;return t&&n?ae.default.createElement("span",{className:"sizer",ref:r.handleSizerRef}):null},r.renderLabels=function(){ge("renderLabels()");var e=r.props,t=e.multiple,n=e.renderLabel,o=r.state,a=o.selectedLabel,l=o.value;if(t&&!(0,W.default)(l)){var u=(0,g.default)(l,r.getItemByValue);return ge("selectedItems",u),(0,g.default)((0,v.default)(u),function(e,t){var o={active:e.value===a,as:"a",key:e.value,onClick:r.handleLabelClick,onRemove:r.handleLabelRemove,value:e.value};return ce.default.create(n(e,t,o),o)})}},r.renderOptions=function(){var e=r.props,t=e.multiple,n=e.search,o=e.noResultsMessage,l=r.state,u=l.selectedIndex,s=l.value,i=r.getMenuOptions();if(null!==o&&n&&(0,W.default)(i))return ae.default.createElement("div",{className:"message"},o);var c=t?function(e){return(0,Z.default)(s,e)}:function(e){return e===s};return(0,g.default)(i,function(e,t){return ae.default.createElement(ye.default,(0,a.default)({key:e.value+"-"+t,active:c(e.value),onClick:r.handleItemClick,selected:u===t},e,{style:(0,a.default)({},e.style,{pointerEvents:"all"})}))})},r.renderMenu=function(){var e=r.props,t=e.children,n=e.header,o=r.state.open,l=o?"visible":"",u=r.getDropdownMenuAriaOptions();if(!(0,b.default)(t)){var s=oe.Children.only(t),i=(0,re.default)(l,s.props.className);return(0,oe.cloneElement)(s,(0,a.default)({className:i},u))}return ae.default.createElement(Pe.default,(0,a.default)({},u,{className:l}),(0,le.createShorthand)(he.default,function(e){return{content:e}},n),r.renderOptions())},o=t,(0,d.default)(r,o)}return(0,m.default)(n,t),(0,i.default)(n,[{key:"componentWillMount",value:function(){(0,f.default)(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"componentWillMount",this)&&(0,f.default)(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"componentWillMount",this).call(this),ge("componentWillMount()");var e=this.state,t=e.open,r=e.value;this.setValue(r),t&&this.open()}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,te.default)(e,this.props)||!(0,te.default)(t,this.state)}},{key:"componentWillReceiveProps",value:function(t){if((0,f.default)(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"componentWillReceiveProps",this).call(this,t),ge("componentWillReceiveProps()"),ge("to props:",(0,le.objectDiff)(this.props,t)),"production"!==e.env.NODE_ENV){var r=Array.isArray(t.value),o=(0,Q.default)(t,"value");o&&t.multiple&&!r?console.error("Dropdown `value` must be an array when `multiple` is set."+(" Received type: `"+Object.prototype.toString.call(t.value)+"`.")):o&&!t.multiple&&r&&console.error("Dropdown `value` must not be an array when `multiple` is not set. Either set `multiple={true}` or use a string or number value.")}(0,te.default)(t.value,this.props.value)||(ge("value changed, setting",t.value),this.setValue(t.value)),(0,te.default)(t.options,this.props.options)||this.setSelectedIndex(void 0,t.options)}},{key:"componentDidUpdate",value:function(e,t){if(ge("componentDidUpdate()"),ge("to state:",(0,le.objectDiff)(t,this.state)),le.isBrowser){if(!t.focus&&this.state.focus){if(ge("dropdown focused"),!this.isMouseDown){var n=this.props.openOnFocus;ge("mouse is not down, opening"),n&&this.open()}this.state.open?(document.addEventListener("keydown",this.moveSelectionOnKeyDown),document.addEventListener("keydown",this.selectItemOnEnter)):(document.addEventListener("keydown",this.openOnArrow),document.addEventListener("keydown",this.openOnSpace)),document.addEventListener("keydown",this.removeItemOnBackspace)}else if(t.focus&&!this.state.focus){ge("dropdown blurred");var r=this.props.closeOnBlur;!this.isMouseDown&&r&&(ge("mouse is not down and closeOnBlur=true, closing"),this.close()),document.removeEventListener("keydown",this.openOnArrow),document.removeEventListener("keydown",this.openOnSpace),document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter),document.removeEventListener("keydown",this.removeItemOnBackspace)}!t.open&&this.state.open?(ge("dropdown opened"),document.addEventListener("keydown",this.closeOnEscape),document.addEventListener("keydown",this.moveSelectionOnKeyDown),document.addEventListener("keydown",this.selectItemOnEnter),document.addEventListener("keydown",this.removeItemOnBackspace),document.addEventListener("click",this.closeOnDocumentClick),document.removeEventListener("keydown",this.openOnArrow),document.removeEventListener("keydown",this.openOnSpace),this.scrollSelectedItemIntoView()):t.open&&!this.state.open&&(ge("dropdown closed"),this.handleClose(),document.removeEventListener("keydown",this.closeOnEscape),document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter),document.removeEventListener("click",this.closeOnDocumentClick),this.state.focus||document.removeEventListener("keydown",this.removeItemOnBackspace))}}},{key:"componentWillUnmount",value:function(){ge("componentWillUnmount()"),le.isBrowser&&(document.removeEventListener("keydown",this.openOnArrow),document.removeEventListener("keydown",this.openOnSpace),document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter),document.removeEventListener("keydown",this.removeItemOnBackspace),document.removeEventListener("keydown",this.closeOnEscape),document.removeEventListener("click",this.closeOnDocumentClick))}},{key:"getDropdownMenuAriaOptions",value:function(){var e=this.props,t=e.search,n=e.multiple,r={};return t&&(r["aria-multiselectable"]=n,r.role="listbox"),r}},{key:"render",value:function(){ge("render()"),ge("props",this.props),ge("state",this.state);var e=this.state.open,t=this.props,r=t.basic,o=t.button,l=t.className,u=t.compact,s=t.fluid,i=t.floating,c=t.icon,d=t.inline,p=t.item,f=t.labeled,y=t.multiple,m=t.pointing,h=t.search,v=t.selection,P=t.simple,g=t.loading,T=t.error,O=t.disabled,_=t.scrolling,E=t.tabIndex,N=t.trigger,S=(0,re.default)("ui",(0,le.useKeyOnly)(e,"active visible"),(0,le.useKeyOnly)(O,"disabled"),(0,le.useKeyOnly)(T,"error"),(0,le.useKeyOnly)(g,"loading"),(0,le.useKeyOnly)(r,"basic"),(0,le.useKeyOnly)(o,"button"),(0,le.useKeyOnly)(u,"compact"),(0,le.useKeyOnly)(s,"fluid"),(0,le.useKeyOnly)(i,"floating"),(0,le.useKeyOnly)(d,"inline"),(0,le.useKeyOnly)(f,"labeled"),(0,le.useKeyOnly)(p,"item"),(0,le.useKeyOnly)(y,"multiple"),(0,le.useKeyOnly)(h,"search"),(0,le.useKeyOnly)(v,"selection"),(0,le.useKeyOnly)(P,"simple"),(0,le.useKeyOnly)(_,"scrolling"),(0,le.useKeyOrValueAndKey)(m,"pointing"),l,"dropdown"),M=(0,le.getUnhandledProps)(n,this.props),x=(0,le.getElementType)(n,this.props),w=this.getDropdownAriaOptions(x,this.props),C=void 0;return(0,b.default)(E)?h||(C=O?-1:0):C=E,ae.default.createElement(x,(0,a.default)({},M,w,{className:S,onBlur:this.handleBlur,onClick:this.handleClick,onMouseDown:this.handleMouseDown,onFocus:this.handleFocus,onChange:this.handleChange,tabIndex:C,ref:this.handleRef}),this.renderHiddenInput(),this.renderLabels(),this.renderSearchInput(),this.renderSearchSizer(),N||this.renderText(),se.default.create(c),this.renderMenu())}}]),n}(le.AutoControlledComponent);Te.defaultProps={additionLabel:"Add ",additionPosition:"top",icon:"dropdown",noResultsMessage:"No results found.",renderLabel:function(e){var t=e.text;return t},selectOnBlur:!0,openOnFocus:!0,closeOnBlur:!0},Te.autoControlledProps=["open","value","selectedLabel"],Te._meta={name:"Dropdown",type:le.META.TYPES.MODULE},Te.Divider=pe.default,Te.Header=he.default,Te.Item=ye.default,Te.Menu=Pe.default,t.default=Te,"production"!==e.env.NODE_ENV?Te.propTypes={as:le.customPropTypes.as,additionLabel:oe.PropTypes.oneOfType([oe.PropTypes.element,oe.PropTypes.string]),additionPosition:oe.PropTypes.oneOf(["top","bottom"]),allowAdditions:le.customPropTypes.every([le.customPropTypes.demand(["options","selection","search"]),oe.PropTypes.bool]),basic:oe.PropTypes.bool,button:oe.PropTypes.bool,children:le.customPropTypes.every([le.customPropTypes.disallow(["options","selection"]),le.customPropTypes.givenProps({children:oe.PropTypes.any.isRequired},ae.default.PropTypes.element.isRequired)]),className:oe.PropTypes.string,closeOnBlur:oe.PropTypes.bool,closeOnChange:oe.PropTypes.bool,compact:oe.PropTypes.bool,defaultOpen:oe.PropTypes.bool,defaultSelectedLabel:le.customPropTypes.every([le.customPropTypes.demand(["multiple"]),oe.PropTypes.oneOfType([oe.PropTypes.number,oe.PropTypes.string])]),defaultValue:oe.PropTypes.oneOfType([oe.PropTypes.number,oe.PropTypes.string,oe.PropTypes.arrayOf(oe.PropTypes.oneOfType([oe.PropTypes.string,oe.PropTypes.number]))]),disabled:oe.PropTypes.bool,error:oe.PropTypes.bool,floating:oe.PropTypes.bool,fluid:oe.PropTypes.bool,header:oe.PropTypes.node,icon:oe.PropTypes.oneOfType([oe.PropTypes.node,oe.PropTypes.object]),inline:oe.PropTypes.bool,item:oe.PropTypes.bool,labeled:oe.PropTypes.bool,loading:oe.PropTypes.bool,multiple:oe.PropTypes.bool,name:oe.PropTypes.string,noResultsMessage:oe.PropTypes.string,onAddItem:oe.PropTypes.func,onBlur:oe.PropTypes.func,onChange:oe.PropTypes.func,onClick:oe.PropTypes.func,onClose:oe.PropTypes.func,onFocus:oe.PropTypes.func,onLabelClick:oe.PropTypes.func,onMouseDown:oe.PropTypes.func,onOpen:oe.PropTypes.func,onSearchChange:oe.PropTypes.func,open:oe.PropTypes.bool,openOnFocus:oe.PropTypes.bool,options:le.customPropTypes.every([le.customPropTypes.disallow(["children"]),oe.PropTypes.arrayOf(oe.PropTypes.shape(ye.default.propTypes))]),placeholder:oe.PropTypes.string,pointing:oe.PropTypes.oneOfType([oe.PropTypes.bool,oe.PropTypes.oneOf(["left","right","top","top left","top right","bottom","bottom left","bottom right"])]),renderLabel:oe.PropTypes.func,scrolling:oe.PropTypes.bool,search:oe.PropTypes.oneOfType([oe.PropTypes.bool,oe.PropTypes.func]),selectOnBlur:oe.PropTypes.bool,selectedLabel:le.customPropTypes.every([le.customPropTypes.demand(["multiple"]),oe.PropTypes.oneOfType([oe.PropTypes.string,oe.PropTypes.number])]),selection:le.customPropTypes.every([le.customPropTypes.disallow(["children"]),le.customPropTypes.demand(["options"]),oe.PropTypes.bool]),simple:oe.PropTypes.bool,tabIndex:oe.PropTypes.oneOfType([oe.PropTypes.number,oe.PropTypes.string]),text:oe.PropTypes.string,trigger:le.customPropTypes.every([le.customPropTypes.disallow(["selection","text"]),oe.PropTypes.node]),value:oe.PropTypes.oneOfType([oe.PropTypes.string,oe.PropTypes.number,oe.PropTypes.arrayOf(oe.PropTypes.oneOfType([oe.PropTypes.string,oe.PropTypes.number]))])}:void 0,Te.handledProps=["additionLabel","additionPosition","allowAdditions","as","basic","button","children","className","closeOnBlur","closeOnChange","compact","defaultOpen","defaultSelectedLabel","defaultValue","disabled","error","floating","fluid","header","icon","inline","item","labeled","loading","multiple","name","noResultsMessage","onAddItem","onBlur","onChange","onClick","onClose","onFocus","onLabelClick","onMouseDown","onOpen","onSearchChange","open","openOnFocus","options","placeholder","pointing","renderLabel","scrolling","search","selectOnBlur","selectedLabel","selection","simple","tabIndex","text","trigger","value"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/modules/Embed/Embed.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! classnames */5),v=r(h),P=n(/*! react */1),g=r(P),T=n(/*! ../../lib */4),b=n(/*! ../../elements/Icon */15),O=r(b),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var l=arguments.length,s=Array(l),i=0;i<l;i++)s[i]=arguments[i];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={},r.handleClick=function(e){var t=r.props.onClick,n=r.state.active;t&&t(e,(0,a.default)({},r.props,{active:!0})),n||r.trySetState({active:!0})},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"getSrc",value:function(){var e=this.props,t=e.autoplay,n=void 0===t||t,r=e.brandedUI,o=void 0!==r&&r,a=e.color,l=void 0===a?"#444444":a,u=e.hd,s=void 0===u||u,i=e.id,c=e.source,d=e.url;return"youtube"===c?["//www.youtube.com/embed/"+i,"?autohide=true","&autoplay="+n,"&color="+encodeURIComponent(l),"&hq="+s,"&jsapi=false","&modestbranding="+o].join(""):"vimeo"===c?["//player.vimeo.com/video/"+i,"?api=false","&autoplay="+n,"&byline=false","&color="+encodeURIComponent(l),"&portrait=false","&title=false"].join(""):d}},{key:"render",value:function(){var e=this.props,n=e.aspectRatio,r=e.className,o=e.icon,l=e.placeholder,u=this.state.active,s=(0,v.default)("ui",n,(0,T.useKeyOnly)(u,"active"),"embed",r),i=(0,T.getUnhandledProps)(t,this.props),c=(0,T.getElementType)(t,this.props);return g.default.createElement(c,(0,a.default)({},i,{className:s,onClick:this.handleClick}),O.default.create(o),l&&g.default.createElement("img",{className:"placeholder",src:l}),this.renderEmbed())}},{key:"renderEmbed",value:function(){var e=this.props.children,t=this.state.active;return t?(0,m.default)(e)?g.default.createElement("div",{className:"embed"},g.default.createElement("iframe",{allowFullScreen:"",frameBorder:"0",height:"100%",scrolling:"no",src:this.getSrc(),width:"100%"})):g.default.createElement("div",{className:"embed"},e):null}}]),t}(T.AutoControlledComponent);_.autoControlledProps=["active"],_.defaultProps={icon:"video play"},_._meta={name:"Embed",type:T.META.TYPES.MODULE},t.default=_,"production"!==e.env.NODE_ENV?_.propTypes={as:T.customPropTypes.as,active:P.PropTypes.bool,aspectRatio:P.PropTypes.oneOf(["4:3","16:9","21:9"]),autoplay:T.customPropTypes.every([T.customPropTypes.demand(["source"]),P.PropTypes.bool]),brandedUI:T.customPropTypes.every([T.customPropTypes.demand(["source"]),P.PropTypes.bool]),children:P.PropTypes.node,className:P.PropTypes.string,color:T.customPropTypes.every([T.customPropTypes.demand(["source"]),P.PropTypes.string]),defaultActive:P.PropTypes.bool,hd:T.customPropTypes.every([T.customPropTypes.demand(["source"]),P.PropTypes.bool]),icon:T.customPropTypes.itemShorthand,id:T.customPropTypes.every([T.customPropTypes.demand(["source"]),P.PropTypes.string]),onClick:P.PropTypes.func,placeholder:P.PropTypes.string,source:T.customPropTypes.every([T.customPropTypes.disallow(["sourceUrl"]),P.PropTypes.oneOf(["youtube","vimeo"])]),url:T.customPropTypes.every([T.customPropTypes.disallow(["source"]),P.PropTypes.string])}:void 0,_.handledProps=["active","as","aspectRatio","autoplay","brandedUI","children","className","color","defaultActive","hd","icon","id","onClick","placeholder","source","url"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/modules/Embed/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Embed */400),a=r(o);t.default=a.default},/*!************************************!*\
!*** ./src/modules/Modal/Modal.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/pick */177),m=r(y),h=n(/*! lodash/omit */176),v=r(h),P=n(/*! classnames */5),g=r(P),T=n(/*! react */1),b=r(T),O=n(/*! ../../lib */4),_=n(/*! ../../elements/Icon */15),E=r(_),N=n(/*! ../../addons/Portal */66),S=r(N),M=n(/*! ./ModalHeader */236),x=r(M),w=n(/*! ./ModalContent */234),C=r(w),I=n(/*! ./ModalActions */233),A=r(I),j=n(/*! ./ModalDescription */235),k=r(j),D=(0,O.makeDebugger)("modal"),L=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.state={},r.getMountNode=function(){return O.isBrowser?r.props.mountNode||document.body:null},r.handleClose=function(e){D("close()");var t=r.props.onClose;t&&t(e,r.props),r.trySetState({open:!1})},r.handleOpen=function(e){D("open()");var t=r.props.onOpen;t&&t(e,r.props),r.trySetState({open:!0})},r.handlePortalMount=function(e){D("handlePortalMount()");var t=r.props.dimmer,n=r.getMountNode();t&&(D("adding dimmer"),n.classList.add("dimmable","dimmed"),"blurring"===t&&(D("adding blurred dimmer"),n.classList.add("blurring"))),r.setPosition();var o=r.props.onMount;o&&o(e,r.props)},r.handlePortalUnmount=function(e){D("handlePortalUnmount()");var t=r.getMountNode();t.classList.remove("blurring","dimmable","dimmed","scrollable"),cancelAnimationFrame(r.animationRequestId);var n=r.props.onUnmount;n&&n(e,r.props)},r.handleRef=function(e){return r.ref=e},r.setPosition=function(){if(r.ref){var e=r.getMountNode(),t=r.ref.getBoundingClientRect(),n=t.height,o=-Math.round(n/2),a=n>=window.innerHeight,l={};r.state.marginTop!==o&&(l.marginTop=o),r.state.scrolling!==a&&(l.scrolling=a,a?e.classList.add("scrolling"):e.classList.remove("scrolling")),Object.keys(l).length>0&&r.setState(l)}r.animationRequestId=requestAnimationFrame(r.setPosition)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"componentWillUnmount",value:function(){D("componentWillUnmount()"),this.handlePortalUnmount()}},{key:"render",value:function(){var e=this.state.open,n=this.props,r=n.basic,o=n.children,l=n.className,u=n.closeIcon,s=n.closeOnDimmerClick,i=n.closeOnDocumentClick,c=n.dimmer,d=n.size,p=n.style,f=this.getMountNode();if(!O.isBrowser)return null;var y=this.state,h=y.marginTop,P=y.scrolling,T=(0,g.default)("ui",d,(0,O.useKeyOnly)(r,"basic"),(0,O.useKeyOnly)(P,"scrolling"),"modal transition visible active",l),_=(0,O.getUnhandledProps)(t,this.props),N=S.default.handledProps,M=(0,v.default)(_,N),x=(0,m.default)(_,N),w=(0,O.getElementType)(t,this.props),C=u===!0?"close":u,I=b.default.createElement(w,(0,a.default)({},M,{className:T,style:(0,a.default)({marginTop:h},p),ref:this.handleRef}),E.default.create(C,{onClick:this.handleClose}),o),A=c?(0,g.default)("ui","inverted"===c&&"inverted","page modals dimmer transition visible active"):null;return b.default.createElement(S.default,(0,a.default)({closeOnRootNodeClick:s,closeOnDocumentClick:i},x,{className:A,mountNode:f,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,open:e}),I)}}]),t}(O.AutoControlledComponent);L.defaultProps={dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1},L.autoControlledProps=["open"],L._meta={name:"Modal",type:O.META.TYPES.MODULE},L.Header=x.default,L.Content=C.default,L.Description=k.default,L.Actions=A.default,"production"!==e.env.NODE_ENV?L.propTypes={as:O.customPropTypes.as,basic:T.PropTypes.bool,children:T.PropTypes.node,className:T.PropTypes.string,closeIcon:T.PropTypes.oneOfType([T.PropTypes.node,T.PropTypes.object,T.PropTypes.bool]),closeOnDimmerClick:T.PropTypes.bool,closeOnDocumentClick:T.PropTypes.bool,defaultOpen:T.PropTypes.bool,dimmer:T.PropTypes.oneOfType([T.PropTypes.bool,T.PropTypes.oneOf(["inverted","blurring"])]),mountNode:T.PropTypes.any,onClose:T.PropTypes.func,onMount:T.PropTypes.func,onOpen:T.PropTypes.func,onUnmount:T.PropTypes.func,open:T.PropTypes.bool,size:T.PropTypes.oneOf(["fullscreen","large","small"]),style:T.PropTypes.object}:void 0,L.handledProps=["as","basic","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","defaultOpen","dimmer","mountNode","onClose","onMount","onOpen","onUnmount","open","size","style"],t.default=L}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/modules/Popup/Popup.js ***!
\************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.POSITIONS=void 0;var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! lodash/pick */177),v=r(h),P=n(/*! lodash/omit */176),g=r(P),T=n(/*! lodash/assign */602),b=r(T),O=n(/*! lodash/mapValues */638),_=r(O),E=n(/*! lodash/isNumber */334),N=r(E),S=n(/*! lodash/includes */55),M=r(S),x=n(/*! lodash/without */13),w=r(x),C=n(/*! classnames */5),I=r(C),A=n(/*! react */1),j=r(A),k=n(/*! ../../lib */4),D=n(/*! ../../addons/Portal */66),L=r(D),K=n(/*! ./PopupContent */238),U=r(K),V=n(/*! ./PopupHeader */239),R=r(V),z=(0,k.makeDebugger)("popup"),F=t.POSITIONS=["top left","top right","bottom right","bottom left","right center","left center","top center","bottom center"],W=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.state={},r.hideOnScroll=function(e){r.setState({closed:!0}),window.removeEventListener("scroll",r.hideOnScroll),setTimeout(function(){return r.setState({closed:!1})},50)},r.handleClose=function(e){z("handleClose()");var t=r.props.onClose;t&&t(e,r.props)},r.handleOpen=function(e){z("handleOpen()"),r.coords=e.currentTarget.getBoundingClientRect();var t=r.props.onOpen;t&&t(e,r.props)},r.handlePortalMount=function(e){z("handlePortalMount()"),r.props.hideOnScroll&&window.addEventListener("scroll",r.hideOnScroll);var t=r.props.onMount;t&&t(e,r.props)},r.handlePortalUnmount=function(e){z("handlePortalUnmount()");var t=r.props.onUnmount;t&&t(e,r.props)},r.handlePopupRef=function(e){z("popupMounted()"),r.popupCoords=e?e.getBoundingClientRect():null,r.setPopupStyle()},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"computePopupStyle",value:function(e){var t={position:"absolute"};if(!k.isBrowser)return t;var n=this.props.offset,r=window,o=r.pageYOffset,a=r.pageXOffset,l=document.documentElement,u=l.clientWidth,s=l.clientHeight;if((0,M.default)(e,"right"))t.right=Math.round(u-(this.coords.right+a)),t.left="auto";else if((0,M.default)(e,"left"))t.left=Math.round(this.coords.left+a),t.right="auto";else{var i=(this.coords.width-this.popupCoords.width)/2;t.left=Math.round(this.coords.left+i+a),t.right="auto"}if((0,M.default)(e,"top"))t.bottom=Math.round(s-(this.coords.top+o)),t.top="auto";else if((0,M.default)(e,"bottom"))t.top=Math.round(this.coords.bottom+o),t.bottom="auto";else{var c=(this.coords.height+this.popupCoords.height)/2;t.top=Math.round(this.coords.bottom+o-c),t.bottom="auto";var d=this.popupCoords.width+8;(0,M.default)(e,"right")?t.right-=d:t.left-=d}return n&&((0,N.default)(t.right)?t.right-=n:t.left-=n),t}},{key:"isStyleInViewport",value:function(e){var t=window,n=t.pageYOffset,r=t.pageXOffset,o=document.documentElement,a=o.clientWidth,l=o.clientHeight,u={top:e.top,left:e.left,width:this.popupCoords.width,height:this.popupCoords.height};return(0,N.default)(e.right)&&(u.left=a-e.right-u.width),(0,N.default)(e.bottom)&&(u.top=l-e.bottom-u.height),!(u.top<n)&&(!(u.top+u.height>n+l)&&(!(u.left<r)&&!(u.left+u.width>r+a)))}},{key:"setPopupStyle",value:function(){if(this.coords&&this.popupCoords){for(var e=this.props.position,t=this.computePopupStyle(e),n=(0,w.default)(F,e),r=0;!this.isStyleInViewport(t)&&r<n.length;r++)t=this.computePopupStyle(n[r]),e=n[r];t=(0,_.default)(t,function(e){return(0,N.default)(e)?e+"px":e}),this.setState({style:t,position:e})}}},{key:"getPortalProps",value:function(){var e={},t=this.props,n=t.on,r=t.hoverable;return r&&(e.closeOnPortalMouseLeave=!0,e.mouseLeaveDelay=300),"click"===n?(e.openOnTriggerClick=!0,e.closeOnTriggerClick=!0,e.closeOnDocumentClick=!0):"focus"===n?(e.openOnTriggerFocus=!0,e.closeOnTriggerBlur=!0):"hover"===n&&(e.openOnTriggerMouseEnter=!0,e.closeOnTriggerMouseLeave=!0,e.mouseLeaveDelay=70,e.mouseEnterDelay=50),e}},{key:"render",value:function(){var e=this.props,n=e.basic,r=e.children,o=e.className,l=e.content,u=e.flowing,s=e.header,i=e.inverted,c=e.size,d=e.trigger,p=e.wide,f=this.state,y=f.position,h=f.closed,P=(0,b.default)({},this.state.style,this.props.style),T=(0,I.default)("ui",y,c,(0,k.useKeyOrValueAndKey)(p,"wide"),(0,k.useKeyOnly)(n,"basic"),(0,k.useKeyOnly)(u,"flowing"),(0,k.useKeyOnly)(i,"inverted"),"popup transition visible",o);if(h)return d;var O=(0,k.getUnhandledProps)(t,this.props),_=L.default.handledProps,E=(0,g.default)(O,_),N=(0,v.default)(O,_),S=(0,k.getElementType)(t,this.props),M=j.default.createElement(S,(0,a.default)({},E,{className:T,style:P,ref:this.handlePopupRef}),r,(0,m.default)(r)&&R.default.create(s),(0,m.default)(r)&&U.default.create(l)),x=(0,a.default)({},this.getPortalProps(),N);return z("portal props:",x),j.default.createElement(L.default,(0,a.default)({},x,{trigger:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),M)}}]),t}(A.Component);W.defaultProps={position:"top left",on:"hover"},W._meta={name:"Popup",type:k.META.TYPES.MODULE},W.Content=U.default,W.Header=R.default,t.default=W,"production"!==e.env.NODE_ENV?W.propTypes={basic:A.PropTypes.bool,children:A.PropTypes.node,className:A.PropTypes.string,content:k.customPropTypes.itemShorthand,flowing:A.PropTypes.bool,header:k.customPropTypes.itemShorthand,hideOnScroll:A.PropTypes.bool,hoverable:A.PropTypes.bool,inverted:A.PropTypes.bool,offset:A.PropTypes.number,on:A.PropTypes.oneOf(["hover","click","focus"]),onClose:A.PropTypes.func,onMount:A.PropTypes.func,onOpen:A.PropTypes.func,onUnmount:A.PropTypes.func,position:A.PropTypes.oneOf(F),size:A.PropTypes.oneOf((0,w.default)(k.SUI.SIZES,"medium","big","massive")),style:A.PropTypes.object,trigger:A.PropTypes.node,wide:A.PropTypes.oneOfType([A.PropTypes.bool,A.PropTypes.oneOf(["very"])])}:void 0,W.handledProps=["basic","children","className","content","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","position","size","style","trigger","wide"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/modules/Popup/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Popup */403),a=r(o);t.default=a.default},/*!******************************************!*\
!*** ./src/modules/Progress/Progress.js ***!
\******************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/isNil */6),m=r(y),h=n(/*! lodash/round */644),v=r(h),P=n(/*! lodash/clamp */603),g=r(P),T=n(/*! lodash/isUndefined */105),b=r(T),O=n(/*! lodash/without */13),_=r(O),E=n(/*! classnames */5),N=r(E),S=n(/*! react */1),M=r(S),x=n(/*! ../../lib */4),w=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.calculatePercent=function(){var e=r.props,t=e.percent,n=e.total,o=e.value;return(0,b.default)(t)?(0,b.default)(n)||(0,b.default)(o)?void 0:o/n*100:t},r.getPercent=function(){var e=r.props.precision,t=(0,g.default)(r.calculatePercent(),0,100);return(0,b.default)(e)?t:(0,v.default)(t,e)},r.isAutoSuccess=function(){var e=r.props,t=e.autoSuccess,n=e.percent,o=e.total,a=e.value;return t&&(n>=100||a>=o)},r.renderLabel=function(){var e=r.props,t=e.children,n=e.label;return(0,m.default)(t)?(0,x.createShorthand)("div",function(e){return{children:e}},n,{className:"label"}):M.default.createElement("div",{className:"label"},t)},r.renderProgress=function(e){var t=r.props,n=t.precision,o=t.progress,a=t.total,l=t.value;if(o||!(0,b.default)(n))return M.default.createElement("div",{className:"progress"},"ratio"!==o?e+"%":l+"/"+a)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this.props,n=e.active,r=e.attached,o=e.className,l=e.color,u=e.disabled,s=e.error,i=e.indicating,c=e.inverted,d=e.size,p=e.success,f=e.warning,y=(0,N.default)("ui",l,d,(0,x.useKeyOnly)(n||i,"active"),(0,x.useKeyOnly)(u,"disabled"),(0,x.useKeyOnly)(s,"error"),(0,x.useKeyOnly)(i,"indicating"),(0,x.useKeyOnly)(c,"inverted"),(0,x.useKeyOnly)(p||this.isAutoSuccess(),"success"),(0,x.useKeyOnly)(f,"warning"),(0,x.useValueAndKey)(r,"attached"),"progress",o),m=(0,x.getUnhandledProps)(t,this.props),h=(0,x.getElementType)(t,this.props),v=this.getPercent();return M.default.createElement(h,(0,a.default)({},m,{className:y}),M.default.createElement("div",{className:"bar",style:{width:v+"%"}},this.renderProgress(v)),this.renderLabel())}}]),t}(S.Component);w._meta={name:"Progress",type:x.META.TYPES.MODULE},"production"!==e.env.NODE_ENV?w.propTypes={as:x.customPropTypes.as,active:S.PropTypes.bool,attached:S.PropTypes.oneOf(["top","bottom"]),autoSuccess:S.PropTypes.bool,children:S.PropTypes.node,className:S.PropTypes.string,color:S.PropTypes.oneOf(x.SUI.COLORS),disabled:S.PropTypes.bool,error:S.PropTypes.bool,indicating:S.PropTypes.bool,inverted:S.PropTypes.bool,label:x.customPropTypes.itemShorthand,percent:x.customPropTypes.every([x.customPropTypes.disallow(["total","value"]),S.PropTypes.oneOfType([S.PropTypes.number,S.PropTypes.string])]),precision:S.PropTypes.number,progress:S.PropTypes.oneOfType([S.PropTypes.bool,S.PropTypes.oneOf(["percent","ratio"])]),size:S.PropTypes.oneOf((0,_.default)(x.SUI.SIZES,"mini","huge","massive")),success:S.PropTypes.bool,total:x.customPropTypes.every([x.customPropTypes.demand(["value"]),x.customPropTypes.disallow(["percent"]),S.PropTypes.oneOfType([S.PropTypes.number,S.PropTypes.string])]),value:x.customPropTypes.every([x.customPropTypes.demand(["total"]),x.customPropTypes.disallow(["percent"]),S.PropTypes.oneOfType([S.PropTypes.number,S.PropTypes.string])]),warning:S.PropTypes.bool}:void 0,w.handledProps=["active","as","attached","autoSuccess","children","className","color","disabled","error","indicating","inverted","label","percent","precision","progress","size","success","total","value","warning"],t.default=w}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!***************************************!*\
!*** ./src/modules/Progress/index.js ***!
\***************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Progress */405),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/modules/Rating/Rating.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! lodash/times */343),m=r(y),h=n(/*! lodash/invoke */172),v=r(h),P=n(/*! lodash/without */13),g=r(P),T=n(/*! classnames */5),b=r(T),O=n(/*! react */1),_=r(O),E=n(/*! ../../lib */4),N=n(/*! ./RatingIcon */240),S=r(N),M=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),x.call(r),o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this,n=this.props,r=n.className,o=n.disabled,l=n.icon,u=n.maxRating,s=n.size,i=this.state,c=i.rating,d=i.selectedIndex,p=i.isSelecting,f=(0,b.default)("ui",l,s,(0,E.useKeyOnly)(o,"disabled"),(0,E.useKeyOnly)(p&&!o&&d>=0,"selected"),"rating",r),y=(0,E.getUnhandledProps)(t,this.props),h=(0,E.getElementType)(t,this.props);return _.default.createElement(h,(0,a.default)({},y,{className:f,role:"radiogroup",onMouseLeave:this.handleMouseLeave}),(0,m.default)(u,function(t){return _.default.createElement(S.default,{active:c>=t+1,"aria-checked":c===t+1,"aria-posinset":t+1,"aria-setsize":u,index:t,key:t,onClick:e.handleIconClick,onMouseEnter:e.handleIconMouseEnter,selected:d>=t&&p})}))}}]),t}(E.AutoControlledComponent);M.autoControlledProps=["rating"],M.defaultProps={clearable:"auto",maxRating:1},M._meta={name:"Rating",type:E.META.TYPES.MODULE},M.Icon=S.default;var x=function(){var e=this;this.handleIconClick=function(t,n){var r=n.index,o=e.props,l=o.clearable,u=o.disabled,s=o.maxRating,i=o.onRate,c=e.state.rating;if(!u){var d=r+1;"auto"===l&&1===s?d=+!c:l===!0&&d===c&&(d=0),e.trySetState({rating:d},{isSelecting:!1}),i&&i(t,(0,a.default)({},e.props,{rating:d}))}},this.handleIconMouseEnter=function(t,n){var r=n.index;e.props.disabled||e.setState({selectedIndex:r,isSelecting:!0})},this.handleMouseLeave=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];v.default.apply(void 0,[e.props,"onMouseLeave"].concat(n)),e.props.disabled||e.setState({selectedIndex:-1,isSelecting:!1})}};t.default=M,"production"!==e.env.NODE_ENV?M.propTypes={as:E.customPropTypes.as,className:O.PropTypes.string,clearable:O.PropTypes.oneOfType([O.PropTypes.bool,O.PropTypes.oneOf(["auto"])]),defaultRating:O.PropTypes.oneOfType([O.PropTypes.number,O.PropTypes.string]),disabled:O.PropTypes.bool,icon:O.PropTypes.oneOf(["star","heart"]),maxRating:O.PropTypes.oneOfType([O.PropTypes.number,O.PropTypes.string]),onRate:O.PropTypes.func,rating:O.PropTypes.oneOfType([O.PropTypes.number,O.PropTypes.string]),size:O.PropTypes.oneOf((0,g.default)(E.SUI.SIZES,"medium","big"))}:void 0,M.handledProps=["as","className","clearable","defaultRating","disabled","icon","maxRating","onRate","rating","size"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/modules/Rating/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Rating */407),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/modules/Search/Search.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/slicedToArray */267),a=r(o),l=n(/*! babel-runtime/helpers/objectWithoutProperties */133),u=r(l),s=n(/*! babel-runtime/helpers/extends */2),i=r(s),c=n(/*! babel-runtime/helpers/classCallCheck */7),d=r(c),p=n(/*! babel-runtime/helpers/createClass */8),f=r(p),y=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),m=r(y),h=n(/*! babel-runtime/helpers/get */266),v=r(h),P=n(/*! babel-runtime/helpers/inherits */9),g=r(P),T=n(/*! lodash/isEmpty */173),b=r(T),O=n(/*! lodash/partialRight */641),_=r(O),E=n(/*! lodash/inRange */635),N=r(E),S=n(/*! lodash/map */16),M=r(S),x=n(/*! lodash/get */53),w=r(x),C=n(/*! lodash/reduce */339),I=r(C),A=n(/*! lodash/isEqual */174),j=r(A),k=n(/*! lodash/without */13),D=r(k),L=n(/*! classnames */5),K=r(L),U=n(/*! react */1),V=r(U),R=n(/*! ../../lib */4),z=n(/*! ../../elements/Input */111),F=r(z),W=n(/*! ./SearchCategory */241),B=r(W),Y=n(/*! ./SearchResult */242),H=r(Y),q=n(/*! ./SearchResults */243),G=r(q),Z=(0,R.makeDebugger)("search"),$=function(e){function t(){var e,n,r,o;(0,d.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.handleResultSelect=function(e,t){Z("handleResultSelect()"),Z(t);var n=r.props.onResultSelect;n&&n(e,t)},r.closeOnEscape=function(e){R.keyboardKey.getCode(e)===R.keyboardKey.Escape&&(e.preventDefault(),r.close())},r.moveSelectionOnKeyDown=function(e){switch(Z("moveSelectionOnKeyDown()"),Z(R.keyboardKey.getName(e)),R.keyboardKey.getCode(e)){case R.keyboardKey.ArrowDown:e.preventDefault(),r.moveSelectionBy(1);break;case R.keyboardKey.ArrowUp:e.preventDefault(),r.moveSelectionBy(-1)}},r.selectItemOnEnter=function(e){if(Z("selectItemOnEnter()"),Z(R.keyboardKey.getName(e)),R.keyboardKey.getCode(e)===R.keyboardKey.Enter){e.preventDefault();var t=r.getSelectedResult();t&&(r.setValue(t.title),r.handleResultSelect(e,t),r.close())}},r.closeOnDocumentClick=function(e){Z("closeOnDocumentClick()"),Z(e),r.close()},r.handleMouseDown=function(e){Z("handleMouseDown()");var t=r.props.onMouseDown;t&&t(e,r.props),r.isMouseDown=!0,R.isBrowser&&document.addEventListener("mouseup",r.handleDocumentMouseUp)},r.handleDocumentMouseUp=function(){Z("handleDocumentMouseUp()"),r.isMouseDown=!1,R.isBrowser&&document.removeEventListener("mouseup",r.handleDocumentMouseUp)},r.handleInputClick=function(e){Z("handleInputClick()",e),e.nativeEvent.stopImmediatePropagation(),r.tryOpen()},r.handleItemClick=function(e,t){var n=t.id;Z("handleItemClick()"),Z(n);var o=r.getSelectedResult(n);e.nativeEvent.stopImmediatePropagation(),r.setValue(o.title),r.handleResultSelect(e,o),r.close()},r.handleFocus=function(e){Z("handleFocus()");var t=r.props.onFocus;t&&t(e,r.props),r.setState({focus:!0})},r.handleBlur=function(e){Z("handleBlur()");var t=r.props.onBlur;t&&t(e,r.props),r.setState({focus:!1})},r.handleSearchChange=function(e){Z("handleSearchChange()"),Z(e.target.value),e.stopPropagation();var t=r.props,n=t.onSearchChange,o=t.minCharacters,a=r.state.open,l=e.target.value;n&&n(e,l),l.length<o?r.close():a||r.tryOpen(l),r.setValue(l)},r.getFlattenedResults=function(){var e=r.props,t=e.category,n=e.results;return t?(0,I.default)(n,function(e,t){return e.concat(t.results)},[]):n},r.getSelectedResult=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.state.selectedIndex,t=r.getFlattenedResults();return(0,w.default)(t,e)},r.setValue=function(e){Z("setValue()"),Z("value",e);var t=r.props.selectFirstResult;r.trySetState({value:e},{selectedIndex:t?0:-1})},r.moveSelectionBy=function(e){Z("moveSelectionBy()"),Z("offset: "+e);var t=r.state.selectedIndex,n=r.getFlattenedResults(),o=n.length-1,a=t+e;a>o?a=0:a<0&&(a=o),r.setState({selectedIndex:a}),r.scrollSelectedItemIntoView()},r.scrollSelectedItemIntoView=function(){if(Z("scrollSelectedItemIntoView()"),R.isBrowser){var e=document.querySelector(".ui.search.active.visible .results.visible"),t=e.querySelector(".result.active");Z("menu (results): "+e),Z("item (result): "+t);var n=t.offsetTop<e.scrollTop,r=t.offsetTop+t.clientHeight>e.scrollTop+e.clientHeight;n?e.scrollTop=t.offsetTop:r&&(e.scrollTop=t.offsetTop+t.clientHeight-e.clientHeight)}},r.tryOpen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.state.value;Z("open()");var t=r.props.minCharacters;e.length<t||r.open()},r.open=function(){Z("open()"),r.trySetState({open:!0})},r.close=function(){Z("close()"),r.trySetState({open:!1})},r.renderSearchInput=function(e){var t=r.props,n=t.icon,o=t.input,a=r.state.value;return F.default.create(o,(0,i.default)({},e,{icon:n,input:{className:"prompt",tabIndex:"0",autoComplete:"off"},onBlur:r.handleBlur,onChange:r.handleSearchChange,onClick:r.handleInputClick,onFocus:r.handleFocus,value:a}))},r.renderNoResults=function(){var e=r.props,t=e.noResultsDescription,n=e.noResultsMessage;return V.default.createElement("div",{className:"message empty"},V.default.createElement("div",{className:"header"},n),t&&V.default.createElement("div",{className:"description"},t))},r.renderResult=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.childKey,l=(0,u.default)(e,["childKey"]),s=r.props.resultRenderer,c=r.state.selectedIndex,d=t+o;return V.default.createElement(H.default,(0,i.default)({key:a||l.title,active:c===d,onClick:r.handleItemClick,renderer:s},l,{id:d}))},r.renderResults=function(){var e=r.props.results;return(0,M.default)(e,r.renderResult)},r.renderCategories=function(){var e=r.props,t=e.categoryRenderer,n=e.results,o=r.state.selectedIndex,a=0;return(0,M.default)(n,function(e,n,l){var s=e.childKey,c=(0,u.default)(e,["childKey"]),d=(0,i.default)({key:s||c.name,active:(0,N.default)(o,a,a+c.results.length),renderer:t},c),p=(0,_.default)(r.renderResult,a);return a+=c.results.length,V.default.createElement(B.default,d,c.results.map(p))})},r.renderMenuContent=function(){var e=r.props,t=e.category,n=e.showNoResults,o=e.results;return(0,b.default)(o)?n?r.renderNoResults():null:t?r.renderCategories():r.renderResults()},r.renderResultsMenu=function(){var e=r.state.open,t=e?"visible":"",n=r.renderMenuContent();if(n)return V.default.createElement(G.default,{className:t},n)},o=n,(0,m.default)(r,o)}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentWillMount",value:function(){(0,v.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillMount",this)&&(0,v.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillMount",this).call(this),Z("componentWillMount()");var e=this.state,n=e.open,r=e.value;this.setValue(r),n&&this.open()}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,j.default)(e,this.props)||!(0,j.default)(t,this.state)}},{key:"componentWillReceiveProps",value:function(e){(0,v.default)(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillReceiveProps",this).call(this,e),Z("componentWillReceiveProps()"),Z("changed props:",(0,R.objectDiff)(e,this.props)),(0,j.default)(e.value,this.props.value)||(Z("value changed, setting",e.value),this.setValue(e.value))}},{key:"componentDidUpdate",value:function(e,t){Z("componentDidUpdate()"),Z("to state:",(0,R.objectDiff)(t,this.state)),R.isBrowser&&(!t.focus&&this.state.focus?(Z("search focused"),this.isMouseDown||(Z("mouse is not down, opening"),this.tryOpen()),this.state.open&&(document.addEventListener("keydown",this.moveSelectionOnKeyDown),document.addEventListener("keydown",this.selectItemOnEnter))):t.focus&&!this.state.focus&&(Z("search blurred"),this.isMouseDown||(Z("mouse is not down, closing"),this.close()),document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter)),!t.open&&this.state.open?(Z("search opened"),this.open(),document.addEventListener("keydown",this.closeOnEscape),document.addEventListener("keydown",this.moveSelectionOnKeyDown),document.addEventListener("keydown",this.selectItemOnEnter),document.addEventListener("click",this.closeOnDocumentClick)):t.open&&!this.state.open&&(Z("search closed"),this.close(),document.removeEventListener("keydown",this.closeOnEscape),document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter),document.removeEventListener("click",this.closeOnDocumentClick)))}},{key:"componentWillUnmount",value:function(){Z("componentWillUnmount()"),R.isBrowser&&(document.removeEventListener("keydown",this.moveSelectionOnKeyDown),document.removeEventListener("keydown",this.selectItemOnEnter),document.removeEventListener("keydown",this.closeOnEscape),document.removeEventListener("click",this.closeOnDocumentClick))}},{key:"render",value:function(){Z("render()"),Z("props",this.props),Z("state",this.state);var e=this.state,n=e.searchClasses,r=e.focus,o=e.open,l=this.props,u=l.aligned,s=l.category,c=l.className,d=l.fluid,p=l.loading,f=l.size,y=(0,K.default)("ui",o&&"active visible",f,n,(0,R.useKeyOnly)(s,"category"),(0,R.useKeyOnly)(r,"focus"),(0,R.useKeyOnly)(d,"fluid"),(0,R.useKeyOnly)(p,"loading"),(0,R.useValueAndKey)(u,"aligned"),"search",c),m=(0,R.getUnhandledProps)(t,this.props),h=(0,R.getElementType)(t,this.props),v=(0,R.partitionHTMLInputProps)(m,R.htmlInputAttrs),P=(0,a.default)(v,2),g=P[0],T=P[1];return V.default.createElement(h,(0,i.default)({},T,{className:y,onBlur:this.handleBlur,onFocus:this.handleFocus,onMouseDown:this.handleMouseDown}),this.renderSearchInput(g),this.renderResultsMenu())}}]),t}(R.AutoControlledComponent);$.defaultProps={icon:"search",input:"text",minCharacters:1,noResultsMessage:"No results found.",showNoResults:!0},$.autoControlledProps=["open","value"],$._meta={name:"Search",type:R.META.TYPES.MODULE},$.Category=B.default,$.Result=H.default,$.Results=G.default,t.default=$,"production"!==e.env.NODE_ENV?$.propTypes={as:R.customPropTypes.as,defaultOpen:U.PropTypes.bool,defaultValue:U.PropTypes.string,icon:U.PropTypes.oneOfType([U.PropTypes.node,U.PropTypes.object]),minCharacters:U.PropTypes.number,noResultsDescription:U.PropTypes.string,noResultsMessage:U.PropTypes.string,open:U.PropTypes.bool,results:U.PropTypes.oneOfType([U.PropTypes.arrayOf(U.PropTypes.shape(H.default.propTypes)),U.PropTypes.object]),selectFirstResult:U.PropTypes.bool,showNoResults:U.PropTypes.bool,value:U.PropTypes.string,categoryRenderer:U.PropTypes.func,resultRenderer:U.PropTypes.func,onBlur:U.PropTypes.func,onFocus:U.PropTypes.func,onMouseDown:U.PropTypes.func,onResultSelect:U.PropTypes.func,onSearchChange:U.PropTypes.func,aligned:U.PropTypes.string,category:U.PropTypes.bool,className:U.PropTypes.string,fluid:U.PropTypes.bool,input:R.customPropTypes.itemShorthand,loading:U.PropTypes.bool,size:U.PropTypes.oneOf((0,D.default)(R.SUI.SIZES,"medium"))}:void 0,$.handledProps=["aligned","as","category","categoryRenderer","className","defaultOpen","defaultValue","fluid","icon","input","loading","minCharacters","noResultsDescription","noResultsMessage","onBlur","onFocus","onMouseDown","onResultSelect","onSearchChange","open","resultRenderer","results","selectFirstResult","showNoResults","size","value"]}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*************************************!*\
!*** ./src/modules/Search/index.js ***!
\*************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Search */409),a=r(o);t.default=a.default},/*!****************************************!*\
!*** ./src/modules/Sidebar/Sidebar.js ***!
\****************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! babel-runtime/helpers/extends */2),a=r(o),l=n(/*! babel-runtime/helpers/classCallCheck */7),u=r(l),s=n(/*! babel-runtime/helpers/createClass */8),i=r(s),c=n(/*! babel-runtime/helpers/possibleConstructorReturn */10),d=r(c),p=n(/*! babel-runtime/helpers/inherits */9),f=r(p),y=n(/*! classnames */5),m=r(y),h=n(/*! react */1),v=r(h),P=n(/*! ../../lib */4),g=n(/*! ./SidebarPushable */244),T=r(g),b=n(/*! ./SidebarPusher */245),O=r(b),_=function(e){function t(){var e,n,r,o;(0,u.default)(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=r=(0,d.default)(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.state={},r.startAnimating=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;clearTimeout(r.stopAnimatingTimer),r.setState({animating:!0}),r.stopAnimatingTimer=setTimeout(function(){return r.setState({animating:!1})},e)},o=n,(0,d.default)(r,o)}return(0,f.default)(t,e),(0,i.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.visible!==this.props.visible&&this.startAnimating()}},{key:"render",value:function(){var e=this.props,n=e.animation,r=e.className,o=e.children,l=e.direction,u=e.visible,s=e.width,i=this.state.animating,c=(0,m.default)("ui",n,l,s,(0,P.useKeyOnly)(i,"animating"),(0,P.useKeyOnly)(u,"visible"),"sidebar",r),d=(0,P.getUnhandledProps)(t,this.props),p=(0,P.getElementType)(t,this.props);return v.default.createElement(p,(0,a.default)({},d,{className:c}),o)}}]),t}(P.AutoControlledComponent);_.defaultProps={direction:"left"},_.autoControlledProps=["visible"],_._meta={name:"Sidebar",type:P.META.TYPES.MODULE},_.Pushable=T.default,_.Pusher=O.default,"production"!==e.env.NODE_ENV?_.propTypes={as:P.customPropTypes.as,animation:h.PropTypes.oneOf(["overlay","push","scale down","uncover","slide out","slide along"]),children:h.PropTypes.node,className:h.PropTypes.string,defaultVisible:h.PropTypes.bool,direction:h.PropTypes.oneOf(["top","right","bottom","left"]),visible:h.PropTypes.bool,width:h.PropTypes.oneOf(["very thin","thin","wide","very wide"])}:void 0,_.handledProps=["animation","as","children","className","defaultVisible","direction","visible","width"],t.default=_}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!**************************************!*\
!*** ./src/modules/Sidebar/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Sidebar */411),a=r(o);t.default=a.default},/*!**************************************************!*\
!*** ./src/views/Advertisement/Advertisement.js ***!
\**************************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.centered,n=e.children,r=e.className,a=e.test,u=e.unit,i=(0,s.default)("ui",u,(0,d.useKeyOnly)(t,"centered"),(0,d.useKeyOnly)(a,"test"),"ad",r),p=(0,d.getUnhandledProps)(o,e),f=(0,d.getElementType)(o,e);return c.default.createElement(f,(0,l.default)({},p,{className:i,"data-text":a}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4);o.handledProps=["as","centered","children","className","test","unit"],o._meta={name:"Advertisement",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,centered:i.PropTypes.bool,children:i.PropTypes.node,className:i.PropTypes.string,test:i.PropTypes.oneOfType([i.PropTypes.bool,i.PropTypes.number,i.PropTypes.string]),unit:i.PropTypes.oneOf(["medium rectangle","large rectangle","vertical rectangle","small rectangle","mobile banner","banner","vertical banner","top banner","half banner","button","square button","small button","skyscraper","wide skyscraper","leaderboard","large leaderboard","mobile leaderboard","billboard","panorama","netboard","half page","square","small square"]).isRequired}:void 0,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!******************************************!*\
!*** ./src/views/Advertisement/index.js ***!
\******************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Advertisement */413),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/views/Comment/Comment.js ***!
\**************************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.className,n=e.children,r=e.collapsed,a=(0,s.default)((0,d.useKeyOnly)(r,"collapsed"),"comment",t),u=(0,d.getUnhandledProps)(o,e),i=(0,d.getElementType)(o,e);return c.default.createElement(i,(0,l.default)({},u,{className:a}),n)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/extends */2),l=r(a),u=n(/*! classnames */5),s=r(u),i=n(/*! react */1),c=r(i),d=n(/*! ../../lib */4),p=n(/*! ./CommentAction */249),f=r(p),y=n(/*! ./CommentActions */250),m=r(y),h=n(/*! ./CommentAuthor */251),v=r(h),P=n(/*! ./CommentAvatar */252),g=r(P),T=n(/*! ./CommentContent */253),b=r(T),O=n(/*! ./CommentGroup */254),_=r(O),E=n(/*! ./CommentMetadata */255),N=r(E),S=n(/*! ./CommentText */256),M=r(S);o.handledProps=["as","children","className","collapsed"],o._meta={name:"Comment",type:d.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:d.customPropTypes.as,children:i.PropTypes.node,className:i.PropTypes.string,collapsed:i.PropTypes.bool}:void 0,o.Author=v.default,o.Action=f.default,o.Actions=m.default,o.Avatar=g.default,o.Content=b.default,o.Group=_.default,o.Metadata=N.default,o.Text=M.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!************************************!*\
!*** ./src/views/Comment/index.js ***!
\************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Comment */415),a=r(o);t.default=a.default},/*!********************************!*\
!*** ./src/views/Feed/Feed.js ***!
\********************************/
function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.children,n=e.className,r=e.events,a=e.size,u=(0,h.default)("ui",a,"feed",n),i=(0,g.getUnhandledProps)(o,e),c=(0,g.getElementType)(o,e);if(!(0,y.default)(t))return P.default.createElement(c,(0,s.default)({},i,{className:u}),t);var d=(0,p.default)(r,function(e){var t=e.childKey,n=e.date,r=e.meta,o=e.summary,a=(0,l.default)(e,["childKey","date","meta","summary"]),u=t||[n,r,o].join("-");return P.default.createElement(N.default,(0,s.default)({date:n,key:u,meta:r,summary:o},a))});return P.default.createElement(c,(0,s.default)({},i,{className:u}),d)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! babel-runtime/helpers/objectWithoutProperties */133),l=r(a),u=n(/*! babel-runtime/helpers/extends */2),s=r(u),i=n(/*! lodash/without */13),c=r(i),d=n(/*! lodash/map */16),p=r(d),f=n(/*! lodash/isNil */6),y=r(f),m=n(/*! classnames */5),h=r(m),v=n(/*! react */1),P=r(v),g=n(/*! ../../lib */4),T=n(/*! ./FeedContent */122),b=r(T),O=n(/*! ./FeedDate */73),_=r(O),E=n(/*! ./FeedEvent */257),N=r(E),S=n(/*! ./FeedExtra */123),M=r(S),x=n(/*! ./FeedLabel */124),w=r(x),C=n(/*! ./FeedLike */125),I=r(C),A=n(/*! ./FeedMeta */126),j=r(A),k=n(/*! ./FeedSummary */127),D=r(k),L=n(/*! ./FeedUser */128),K=r(L);o.handledProps=["as","children","className","events","size"],o._meta={name:"Feed",type:g.META.TYPES.VIEW},"production"!==e.env.NODE_ENV?o.propTypes={as:g.customPropTypes.as,children:v.PropTypes.node,className:v.PropTypes.string,events:g.customPropTypes.collectionShorthand,size:v.PropTypes.oneOf((0,c.default)(g.SUI.SIZES,"mini","tiny","medium","big","huge","massive"))}:void 0,o.Content=b.default,o.Date=_.default,o.Event=N.default,o.Extra=M.default,o.Label=w.default,o.Like=I.default,o.Meta=j.default,o.Summary=D.default,o.User=K.default,t.default=o}).call(t,n(/*! ./../../../~/process/browser.js */3))},/*!*********************************!*\
!*** ./src/views/Feed/index.js ***!
\*********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Feed */417),a=r(o);t.default=a.default},/*!*********************************!*\
!*** ./src/views/Item/index.js ***!
\*********************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Item */258),a=r(o);t.default=a.default},/*!**************************************!*\
!*** ./src/views/Statistic/index.js ***!
\**************************************/
function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(/*! ./Statistic */262),a=r(o);t.default=a.default},/*!***********************************************!*\
!*** ./~/babel-runtime/core-js/array/from.js ***!
\***********************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/array/from */432),__esModule:!0}},/*!*************************************************!*\
!*** ./~/babel-runtime/core-js/get-iterator.js ***!
\*************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/get-iterator */433),__esModule:!0}},/*!************************************************!*\
!*** ./~/babel-runtime/core-js/is-iterable.js ***!
\************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/is-iterable */434),__esModule:!0}},/*!**************************************************!*\
!*** ./~/babel-runtime/core-js/object/assign.js ***!
\**************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/assign */435),__esModule:!0}},/*!**************************************************!*\
!*** ./~/babel-runtime/core-js/object/create.js ***!
\**************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/create */436),__esModule:!0}},/*!***********************************************************!*\
!*** ./~/babel-runtime/core-js/object/define-property.js ***!
\***********************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/define-property */437),__esModule:!0}},/*!***********************************************************************!*\
!*** ./~/babel-runtime/core-js/object/get-own-property-descriptor.js ***!
\***********************************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/get-own-property-descriptor */438),__esModule:!0}},/*!************************************************************!*\
!*** ./~/babel-runtime/core-js/object/get-prototype-of.js ***!
\************************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/get-prototype-of */439),__esModule:!0}},/*!************************************************************!*\
!*** ./~/babel-runtime/core-js/object/set-prototype-of.js ***!
\************************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/set-prototype-of */440),__esModule:!0}},/*!*******************************************!*\
!*** ./~/babel-runtime/core-js/symbol.js ***!
\*******************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/symbol */441),__esModule:!0}},/*!****************************************************!*\
!*** ./~/babel-runtime/core-js/symbol/iterator.js ***!
\****************************************************/
function(e,t,n){e.exports={default:n(/*! core-js/library/fn/symbol/iterator */442),__esModule:!0}},/*!********************************************!*\
!*** ./~/core-js/library/fn/array/from.js ***!
\********************************************/
function(e,t,n){n(/*! ../../modules/es6.string.iterator */77),n(/*! ../../modules/es6.array.from */465),e.exports=n(/*! ../../modules/_core */17).Array.from},/*!**********************************************!*\
!*** ./~/core-js/library/fn/get-iterator.js ***!
\**********************************************/
function(e,t,n){n(/*! ../modules/web.dom.iterable */149),n(/*! ../modules/es6.string.iterator */77),e.exports=n(/*! ../modules/core.get-iterator */463)},/*!*********************************************!*\
!*** ./~/core-js/library/fn/is-iterable.js ***!
\*********************************************/
function(e,t,n){n(/*! ../modules/web.dom.iterable */149),n(/*! ../modules/es6.string.iterator */77),e.exports=n(/*! ../modules/core.is-iterable */464)},/*!***********************************************!*\
!*** ./~/core-js/library/fn/object/assign.js ***!
\***********************************************/
function(e,t,n){n(/*! ../../modules/es6.object.assign */467),e.exports=n(/*! ../../modules/_core */17).Object.assign},/*!***********************************************!*\
!*** ./~/core-js/library/fn/object/create.js ***!
\***********************************************/
function(e,t,n){n(/*! ../../modules/es6.object.create */468);var r=n(/*! ../../modules/_core */17).Object;e.exports=function(e,t){return r.create(e,t)}},/*!********************************************************!*\
!*** ./~/core-js/library/fn/object/define-property.js ***!
\********************************************************/
function(e,t,n){n(/*! ../../modules/es6.object.define-property */469);var r=n(/*! ../../modules/_core */17).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},/*!********************************************************************!*\
!*** ./~/core-js/library/fn/object/get-own-property-descriptor.js ***!
\********************************************************************/
function(e,t,n){n(/*! ../../modules/es6.object.get-own-property-descriptor */470);var r=n(/*! ../../modules/_core */17).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},/*!*********************************************************!*\
!*** ./~/core-js/library/fn/object/get-prototype-of.js ***!
\*********************************************************/
function(e,t,n){n(/*! ../../modules/es6.object.get-prototype-of */471),e.exports=n(/*! ../../modules/_core */17).Object.getPrototypeOf},/*!*********************************************************!*\
!*** ./~/core-js/library/fn/object/set-prototype-of.js ***!
\*********************************************************/
function(e,t,n){n(/*! ../../modules/es6.object.set-prototype-of */472),e.exports=n(/*! ../../modules/_core */17).Object.setPrototypeOf},/*!**********************************************!*\
!*** ./~/core-js/library/fn/symbol/index.js ***!
\**********************************************/
function(e,t,n){n(/*! ../../modules/es6.symbol */474),n(/*! ../../modules/es6.object.to-string */473),n(/*! ../../modules/es7.symbol.async-iterator */475),n(/*! ../../modules/es7.symbol.observable */476),e.exports=n(/*! ../../modules/_core */17).Symbol},/*!*************************************************!*\
!*** ./~/core-js/library/fn/symbol/iterator.js ***!
\*************************************************/
function(e,t,n){n(/*! ../../modules/es6.string.iterator */77),n(/*! ../../modules/web.dom.iterable */149),e.exports=n(/*! ../../modules/_wks-ext */148).f("iterator")},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_a-function.js ***!
\**************************************************/
function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},/*!**********************************************************!*\
!*** ./~/core-js/library/modules/_add-to-unscopables.js ***!
\**********************************************************/
function(e,t){e.exports=function(){}},/*!******************************************************!*\
!*** ./~/core-js/library/modules/_array-includes.js ***!
\******************************************************/
function(e,t,n){var r=n(/*! ./_to-iobject */33),o=n(/*! ./_to-length */278),a=n(/*! ./_to-index */462);e.exports=function(e){return function(t,n,l){var u,s=r(t),i=o(s.length),c=a(l,i);if(e&&n!=n){for(;i>c;)if(u=s[c++],u!=u)return!0}else for(;i>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}}},/*!*******************************************************!*\
!*** ./~/core-js/library/modules/_create-property.js ***!
\*******************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_object-dp */32),o=n(/*! ./_property-desc */59);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_enum-keys.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_object-keys */58),o=n(/*! ./_object-gops */141),a=n(/*! ./_object-pie */74);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var l,u=n(e),s=a.f,i=0;u.length>i;)s.call(e,l=u[i++])&&t.push(l);return t}},/*!********************************************!*\
!*** ./~/core-js/library/modules/_html.js ***!
\********************************************/
function(e,t,n){e.exports=n(/*! ./_global */31).document&&document.documentElement},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/_is-array-iter.js ***!
\*****************************************************/
function(e,t,n){var r=n(/*! ./_iterators */49),o=n(/*! ./_wks */21)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},/*!************************************************!*\
!*** ./~/core-js/library/modules/_is-array.js ***!
\************************************************/
function(e,t,n){var r=n(/*! ./_cof */134);e.exports=Array.isArray||function(e){return"Array"==r(e)}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_iter-call.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_an-object */40);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_iter-create.js ***!
\***************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_object-create */139),o=n(/*! ./_property-desc */59),a=n(/*! ./_set-to-string-tag */142),l={};n(/*! ./_hide */48)(l,n(/*! ./_wks */21)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(l,{next:o(1,n)}),a(e,t+" Iterator")}},/*!***************************************************!*\
!*** ./~/core-js/library/modules/_iter-detect.js ***!
\***************************************************/
function(e,t,n){var r=n(/*! ./_wks */21)("iterator"),o=!1;try{var a=[7][r]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var a=[7],l=a[r]();l.next=function(){return{done:n=!0}},a[r]=function(){return l},e(a)}catch(e){}return n}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_iter-step.js ***!
\*************************************************/
function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},/*!*********************************************!*\
!*** ./~/core-js/library/modules/_keyof.js ***!
\*********************************************/
function(e,t,n){var r=n(/*! ./_object-keys */58),o=n(/*! ./_to-iobject */33);e.exports=function(e,t){for(var n,a=o(e),l=r(a),u=l.length,s=0;u>s;)if(a[n=l[s++]]===t)return n}},/*!********************************************!*\
!*** ./~/core-js/library/modules/_meta.js ***!
\********************************************/
function(e,t,n){var r=n(/*! ./_uid */76)("meta"),o=n(/*! ./_is-object */57),a=n(/*! ./_has */42),l=n(/*! ./_object-dp */32).f,u=0,s=Object.isExtensible||function(){return!0},i=!n(/*! ./_fails */47)(function(){return s(Object.preventExtensions({}))}),c=function(e){l(e,r,{value:{i:"O"+ ++u,w:{}}})},d=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,r)){if(!s(e))return"F";if(!t)return"E";c(e)}return e[r].i},p=function(e,t){if(!a(e,r)){if(!s(e))return!0;if(!t)return!1;c(e)}return e[r].w},f=function(e){return i&&y.NEED&&s(e)&&!a(e,r)&&c(e),e},y=e.exports={KEY:r,NEED:!1,fastKey:d,getWeak:p,onFreeze:f}},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/_object-assign.js ***!
\*****************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_object-keys */58),o=n(/*! ./_object-gops */141),a=n(/*! ./_object-pie */74),l=n(/*! ./_to-object */75),u=n(/*! ./_iobject */271),s=Object.assign;e.exports=!s||n(/*! ./_fails */47)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r})?function(e,t){for(var n=l(e),s=arguments.length,i=1,c=o.f,d=a.f;s>i;)for(var p,f=u(arguments[i++]),y=c?r(f).concat(c(f)):r(f),m=y.length,h=0;m>h;)d.call(f,p=y[h++])&&(n[p]=f[p]);return n}:s},/*!**************************************************!*\
!*** ./~/core-js/library/modules/_object-dps.js ***!
\**************************************************/
function(e,t,n){var r=n(/*! ./_object-dp */32),o=n(/*! ./_an-object */40),a=n(/*! ./_object-keys */58);e.exports=n(/*! ./_descriptors */41)?Object.defineProperties:function(e,t){o(e);for(var n,l=a(t),u=l.length,s=0;u>s;)r.f(e,n=l[s++],t[n]);return e}},/*!*******************************************************!*\
!*** ./~/core-js/library/modules/_object-gopn-ext.js ***!
\*******************************************************/
function(e,t,n){var r=n(/*! ./_to-iobject */33),o=n(/*! ./_object-gopn */273).f,a={}.toString,l="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(e){try{return o(e)}catch(e){return l.slice()}};e.exports.f=function(e){return l&&"[object Window]"==a.call(e)?u(e):o(r(e))}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_set-proto.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_is-object */57),o=n(/*! ./_an-object */40),a=function(e,t){if(o(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(/*! ./_ctx */135)(Function.call,n(/*! ./_object-gopd */140).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},/*!*************************************************!*\
!*** ./~/core-js/library/modules/_string-at.js ***!
\*************************************************/
function(e,t,n){var r=n(/*! ./_to-integer */145),o=n(/*! ./_defined */136);e.exports=function(e){return function(t,n){var a,l,u=String(o(t)),s=r(n),i=u.length;return s<0||s>=i?e?"":void 0:(a=u.charCodeAt(s),a<55296||a>56319||s+1===i||(l=u.charCodeAt(s+1))<56320||l>57343?e?u.charAt(s):a:e?u.slice(s,s+2):(a-55296<<10)+(l-56320)+65536)}}},/*!************************************************!*\
!*** ./~/core-js/library/modules/_to-index.js ***!
\************************************************/
function(e,t,n){var r=n(/*! ./_to-integer */145),o=Math.max,a=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):a(e,t)}},/*!********************************************************!*\
!*** ./~/core-js/library/modules/core.get-iterator.js ***!
\********************************************************/
function(e,t,n){var r=n(/*! ./_an-object */40),o=n(/*! ./core.get-iterator-method */279);e.exports=n(/*! ./_core */17).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},/*!*******************************************************!*\
!*** ./~/core-js/library/modules/core.is-iterable.js ***!
\*******************************************************/
function(e,t,n){var r=n(/*! ./_classof */268),o=n(/*! ./_wks */21)("iterator"),a=n(/*! ./_iterators */49);e.exports=n(/*! ./_core */17).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||a.hasOwnProperty(r(t))}},/*!*****************************************************!*\
!*** ./~/core-js/library/modules/es6.array.from.js ***!
\*****************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_ctx */135),o=n(/*! ./_export */30),a=n(/*! ./_to-object */75),l=n(/*! ./_iter-call */451),u=n(/*! ./_is-array-iter */449),s=n(/*! ./_to-length */278),i=n(/*! ./_create-property */446),c=n(/*! ./core.get-iterator-method */279);o(o.S+o.F*!n(/*! ./_iter-detect */453)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,d,p=a(e),f="function"==typeof this?this:Array,y=arguments.length,m=y>1?arguments[1]:void 0,h=void 0!==m,v=0,P=c(p);if(h&&(m=r(m,y>2?arguments[2]:void 0,2)),void 0==P||f==Array&&u(P))for(t=s(p.length),n=new f(t);t>v;v++)i(n,v,h?m(p[v],v):p[v]);else for(d=P.call(p),n=new f;!(o=d.next()).done;v++)i(n,v,h?l(d,m,[o.value,v],!0):o.value);return n.length=v,n}})},/*!*********************************************************!*\
!*** ./~/core-js/library/modules/es6.array.iterator.js ***!
\*********************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_add-to-unscopables */444),o=n(/*! ./_iter-step */454),a=n(/*! ./_iterators */49),l=n(/*! ./_to-iobject */33);e.exports=n(/*! ./_iter-define */272)(Array,"Array",function(e,t){this._t=l(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,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},/*!********************************************************!*\
!*** ./~/core-js/library/modules/es6.object.assign.js ***!
\********************************************************/
function(e,t,n){var r=n(/*! ./_export */30);r(r.S+r.F,"Object",{assign:n(/*! ./_object-assign */457)})},/*!********************************************************!*\
!*** ./~/core-js/library/modules/es6.object.create.js ***!
\********************************************************/
function(e,t,n){var r=n(/*! ./_export */30);r(r.S,"Object",{create:n(/*! ./_object-create */139)})},/*!*****************************************************************!*\
!*** ./~/core-js/library/modules/es6.object.define-property.js ***!
\*****************************************************************/
function(e,t,n){var r=n(/*! ./_export */30);r(r.S+r.F*!n(/*! ./_descriptors */41),"Object",{defineProperty:n(/*! ./_object-dp */32).f})},/*!*****************************************************************************!*\
!*** ./~/core-js/library/modules/es6.object.get-own-property-descriptor.js ***!
\*****************************************************************************/
function(e,t,n){var r=n(/*! ./_to-iobject */33),o=n(/*! ./_object-gopd */140).f;n(/*! ./_object-sap */276)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},/*!******************************************************************!*\
!*** ./~/core-js/library/modules/es6.object.get-prototype-of.js ***!
\******************************************************************/
function(e,t,n){var r=n(/*! ./_to-object */75),o=n(/*! ./_object-gpo */274);n(/*! ./_object-sap */276)("getPrototypeOf",function(){return function(e){return o(r(e))}})},/*!******************************************************************!*\
!*** ./~/core-js/library/modules/es6.object.set-prototype-of.js ***!
\******************************************************************/
function(e,t,n){var r=n(/*! ./_export */30);r(r.S,"Object",{setPrototypeOf:n(/*! ./_set-proto */460).set})},/*!***********************************************************!*\
!*** ./~/core-js/library/modules/es6.object.to-string.js ***!
\***********************************************************/
function(e,t){},/*!*************************************************!*\
!*** ./~/core-js/library/modules/es6.symbol.js ***!
\*************************************************/
function(e,t,n){"use strict";var r=n(/*! ./_global */31),o=n(/*! ./_has */42),a=n(/*! ./_descriptors */41),l=n(/*! ./_export */30),u=n(/*! ./_redefine */277),s=n(/*! ./_meta */456).KEY,i=n(/*! ./_fails */47),c=n(/*! ./_shared */144),d=n(/*! ./_set-to-string-tag */142),p=n(/*! ./_uid */76),f=n(/*! ./_wks */21),y=n(/*! ./_wks-ext */148),m=n(/*! ./_wks-define */147),h=n(/*! ./_keyof */455),v=n(/*! ./_enum-keys */447),P=n(/*! ./_is-array */450),g=n(/*! ./_an-object */40),T=n(/*! ./_to-iobject */33),b=n(/*! ./_to-primitive */146),O=n(/*! ./_property-desc */59),_=n(/*! ./_object-create */139),E=n(/*! ./_object-gopn-ext */459),N=n(/*! ./_object-gopd */140),S=n(/*! ./_object-dp */32),M=n(/*! ./_object-keys */58),x=N.f,w=S.f,C=E.f,I=r.Symbol,A=r.JSON,j=A&&A.stringify,k="prototype",D=f("_hidden"),L=f("toPrimitive"),K={}.propertyIsEnumerable,U=c("symbol-registry"),V=c("symbols"),R=c("op-symbols"),z=Object[k],F="function"==typeof I,W=r.QObject,B=!W||!W[k]||!W[k].findChild,Y=a&&i(function(){return 7!=_(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=x(z,t);r&&delete z[t],w(e,t,n),r&&e!==z&&w(z,t,r)}:w,H=function(e){var t=V[e]=_(I[k]);return t._k=e,t},q=F&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},G=function(e,t,n){return e===z&&G(R,t,n),g(e),t=b(t,!0),g(n),o(V,t)?(n.enumerable?(o(e,D)&&e[D][t]&&(e[D][t]=!1),n=_(n,{enumerable:O(0,!1)})):(o(e,D)||w(e,D,O(1,{})),e[D][t]=!0),Y(e,t,n)):w(e,t,n)},Z=function(e,t){g(e);for(var n,r=v(t=T(t)),o=0,a=r.length;a>o;)G(e,n=r[o++],t[n]);return e},$=function(e,t){return void 0===t?_(e):Z(_(e),t)},X=function(e){var t=K.call(this,e=b(e,!0));return!(this===z&&o(V,e)&&!o(R,e))&&(!(t||!o(this,e)||!o(V,e)||o(this,D)&&this[D][e])||t)},J=function(e,t){if(e=T(e),t=b(t,!0),e!==z||!o(V,t)||o(R,t)){var n=x(e,t);return!n||!o(V,t)||o(e,D)&&e[D][t]||(n.enumerable=!0),n}},Q=function(e){for(var t,n=C(T(e)),r=[],a=0;n.length>a;)o(V,t=n[a++])||t==D||t==s||r.push(t);return r},ee=function(e){for(var t,n=e===z,r=C(n?R:T(e)),a=[],l=0;r.length>l;)!o(V,t=r[l++])||n&&!o(z,t)||a.push(V[t]);return a};F||(I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===z&&t.call(R,n),o(this,D)&&o(this[D],e)&&(this[D][e]=!1),Y(this,e,O(1,n))};return a&&B&&Y(z,e,{configurable:!0,set:t}),H(e)},u(I[k],"toString",function(){return this._k}),N.f=J,S.f=G,n(/*! ./_object-gopn */273).f=E.f=Q,n(/*! ./_object-pie */74).f=X,n(/*! ./_object-gops */141).f=ee,a&&!n(/*! ./_library */138)&&u(z,"propertyIsEnumerable",X,!0),y.f=function(e){return H(f(e))}),l(l.G+l.W+l.F*!F,{Symbol:I});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)f(te[ne++]);for(var te=M(f.store),ne=0;te.length>ne;)m(te[ne++]);l(l.S+l.F*!F,"Symbol",{for:function(e){return o(U,e+="")?U[e]:U[e]=I(e)},keyFor:function(e){if(q(e))return h(U,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){B=!0},useSimple:function(){B=!1}}),l(l.S+l.F*!F,"Object",{create:$,defineProperty:G,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:ee}),A&&l(l.S+l.F*(!F||i(function(){var e=I();return"[null]"!=j([e])||"{}"!=j({a:e})||"{}"!=j(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!q(e)){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);return t=r[1],"function"==typeof t&&(n=t),!n&&P(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!q(t))return t}),r[1]=t,j.apply(A,r)}}}),I[k][L]||n(/*! ./_hide */48)(I[k],L,I[k].valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},/*!****************************************************************!*\
!*** ./~/core-js/library/modules/es7.symbol.async-iterator.js ***!
\****************************************************************/
function(e,t,n){n(/*! ./_wks-define */147)("asyncIterator")},/*!************************************************************!*\
!*** ./~/core-js/library/modules/es7.symbol.observable.js ***!
\************************************************************/
function(e,t,n){n(/*! ./_wks-define */147)("observable")},/*!********************************!*\
!*** ./~/debug/src/browser.js ***!
\********************************/
function(e,t,n){(function(r){function o(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function a(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,a=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(a=o))}),e.splice(a,0,r)}}function l(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function s(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof r&&"env"in r&&(e=r.env.DEBUG),e}function i(){try{return window.localStorage}catch(e){}}t=e.exports=n(/*! ./debug */478),t.log=l,t.formatArgs=a,t.save=u,t.load=s,t.useColors=o,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:i(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(s())}).call(t,n(/*! ./../../process/browser.js */3))},/*!******************************!*\
!*** ./~/debug/src/debug.js ***!
\******************************/
function(e,t,n){function r(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}function o(e){function n(){if(n.enabled){var e=n,r=+new Date,o=r-(i||r);e.diff=o,e.prev=i,e.curr=r,i=r;for(var a=new Array(arguments.length),l=0;l<a.length;l++)a[l]=arguments[l];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var u=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;u++;var o=t.formatters[r];if("function"==typeof o){var l=a[u];n=o.call(e,l),a.splice(u,1),u--}return n}),t.formatArgs.call(e,a);var s=n.log||t.log||console.log.bind(console);s.apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=r(e),"function"==typeof t.init&&t.init(n),n}function a(e){t.save(e),t.names=[],t.skips=[];for(var n=(e||"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(e=n[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function l(){t.enable("")}function u(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1}function s(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o.debug=o.default=o,t.coerce=s,t.disable=l,t.enable=a,t.enabled=u,t.humanize=n(/*! ms */657),t.names=[],t.skips=[],t.formatters={};var i},/*!*******************************!*\
!*** ./~/lodash/_DataView.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=n(/*! ./_root */18),a=r(o,"DataView");e.exports=a},/*!***************************!*\
!*** ./~/lodash/_Hash.js ***!
\***************************/
function(e,t,n){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 o=n(/*! ./_hashClear */559),a=n(/*! ./_hashDelete */560),l=n(/*! ./_hashGet */561),u=n(/*! ./_hashHas */562),s=n(/*! ./_hashSet */563);r.prototype.clear=o,r.prototype.delete=a,r.prototype.get=l,r.prototype.has=u,r.prototype.set=s,e.exports=r},/*!******************************!*\
!*** ./~/lodash/_Promise.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_getNative */44),o=n(/*! ./_root */18),a=r(o,"Promise");e.exports=a},/*!**********************************!*\
!*** ./~/lodash/_addMapEntry.js ***!
\**********************************/
function(e,t){function n(e,t){return e.set(t[0],t[1]),e}e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_addSetEntry.js ***!
\**********************************/
function(e,t){function n(e,t){return e.add(t),e}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_arrayEvery.js ***!
\*********************************/
function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_asciiToArray.js ***!
\***********************************/
function(e,t){function n(e){return e.split("")}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_asciiWords.js ***!
\*********************************/
function(e,t){function n(e){return e.match(r)||[]}var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_baseAssignIn.js ***!
\***********************************/
function(e,t,n){function r(e,t){return e&&o(t,a(t),e)}var o=n(/*! ./_copyObject */52),a=n(/*! ./keysIn */336);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseEvery.js ***!
\********************************/
function(e,t,n){function r(e,t){var n=!0;return o(e,function(e,r,o){return n=!!t(e,r,o)}),n}var o=n(/*! ./_baseEach */51);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_baseExtremum.js ***!
\***********************************/
function(e,t,n){function r(e,t,n){for(var r=-1,a=e.length;++r<a;){var l=e[r],u=t(l);if(null!=u&&(void 0===s?u===u&&!o(u):n(u,s)))var s=u,i=l}return i}var o=n(/*! ./isSymbol */45);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseFilter.js ***!
\*********************************/
function(e,t,n){function r(e,t){var n=[];return o(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}var o=n(/*! ./_baseEach */51);e.exports=r},/*!******************************!*\
!*** ./~/lodash/_baseFor.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./_createBaseFor */540),o=r();e.exports=o},/*!******************************!*\
!*** ./~/lodash/_baseHas.js ***!
\******************************/
function(e,t){function n(e,t){return null!=e&&o.call(e,t)}var r=Object.prototype,o=r.hasOwnProperty;e.exports=n},/*!********************************!*\
!*** ./~/lodash/_baseHasIn.js ***!
\********************************/
function(e,t){function n(e,t){return null!=e&&t in Object(e)}e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_baseInRange.js ***!
\**********************************/
function(e,t){function n(e,t,n){return e>=o(t,n)&&e<r(t,n)}var r=Math.max,o=Math.min;e.exports=n},/*!***************************************!*\
!*** ./~/lodash/_baseIntersection.js ***!
\***************************************/
function(e,t,n){function r(e,t,n){for(var r=n?l:a,d=e[0].length,p=e.length,f=p,y=Array(p),m=1/0,h=[];f--;){var v=e[f];f&&t&&(v=u(v,s(t))),m=c(v.length,m),y[f]=!n&&(t||d>=120&&v.length>=120)?new o(f&&v):void 0}v=e[0];var P=-1,g=y[0];e:for(;++P<d&&h.length<m;){var T=v[P],b=t?t(T):T;if(T=n||0!==T?T:0,!(g?i(g,b):r(h,b,n))){for(f=p;--f;){var O=y[f];if(!(O?i(O,b):r(e[f],b,n)))continue e}g&&g.push(b),h.push(T)}}return h}var o=n(/*! ./_SetCache */79),a=n(/*! ./_arrayIncludes */81),l=n(/*! ./_arrayIncludesWith */155),u=n(/*! ./_arrayMap */26),s=n(/*! ./_baseUnary */89),i=n(/*! ./_cacheHas */90),c=Math.min;e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseInvoke.js ***!
\*********************************/
function(e,t,n){function r(e,t,n){t=a(t,e),e=u(e,t);var r=null==e?e:e[s(l(t))];return null==r?void 0:o(r,e,n)}var o=n(/*! ./_apply */80),a=n(/*! ./_castPath */43),l=n(/*! ./last */337),u=n(/*! ./_parent */316),s=n(/*! ./_toKey */36);e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_baseIsArguments.js ***!
\**************************************/
function(e,t,n){function r(e){return a(e)&&o(e)==l}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isObjectLike */24),l="[object Arguments]";e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_baseIsEqualDeep.js ***!
\**************************************/
function(e,t,n){function r(e,t,n,r,h,P){var g=i(e),T=i(t),b=g?y:s(e),O=T?y:s(t);b=b==f?m:b,O=O==f?m:O;var _=b==m,E=O==m,N=b==O;if(N&&c(e)){if(!c(t))return!1;g=!0,_=!1}if(N&&!_)return P||(P=new o),g||d(e)?a(e,t,n,r,h,P):l(e,t,b,n,r,h,P);if(!(n&p)){var S=_&&v.call(e,"__wrapped__"),M=E&&v.call(t,"__wrapped__");if(S||M){var x=S?e.value():e,w=M?t.value():t;return P||(P=new o),h(x,w,n,r,P)}}return!!N&&(P||(P=new o),u(e,t,n,r,h,P))}var o=n(/*! ./_Stack */154),a=n(/*! ./_equalArrays */301),l=n(/*! ./_equalByTag */552),u=n(/*! ./_equalObjects */553),s=n(/*! ./_getTag */168),i=n(/*! ./isArray */12),c=n(/*! ./isBuffer */65),d=n(/*! ./isTypedArray */104),p=1,f="[object Arguments]",y="[object Array]",m="[object Object]",h=Object.prototype,v=h.hasOwnProperty;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseIsMatch.js ***!
\**********************************/
function(e,t,n){function r(e,t,n,r){var s=n.length,i=s,c=!r;if(null==e)return!i;for(e=Object(e);s--;){var d=n[s];if(c&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++s<i;){d=n[s];var p=d[0],f=e[p],y=d[1];if(c&&d[2]){if(void 0===f&&!(p in e))return!1}else{var m=new o;if(r)var h=r(f,y,p,e,t,m);if(!(void 0===h?a(y,f,l|u,r,m):h))return!1}}return!0}var o=n(/*! ./_Stack */154),a=n(/*! ./_baseIsEqual */160),l=1,u=2;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseIsNaN.js ***!
\********************************/
function(e,t){function n(e){return e!==e}e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_baseIsNative.js ***!
\***********************************/
function(e,t,n){function r(e){if(!l(e)||a(e))return!1;var t=o(e)?y:i;return t.test(u(e))}var o=n(/*! ./isFunction */38),a=n(/*! ./_isMasked */570),l=n(/*! ./isObject */19),u=n(/*! ./_toSource */322),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,c=Function.prototype,d=Object.prototype,p=c.toString,f=d.hasOwnProperty,y=RegExp("^"+p.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},/*!***************************************!*\
!*** ./~/lodash/_baseIsTypedArray.js ***!
\***************************************/
function(e,t,n){function r(e){return l(e)&&a(e.length)&&!!I[o(e)]}var o=n(/*! ./_baseGetTag */34),a=n(/*! ./isLength */175),l=n(/*! ./isObjectLike */24),u="[object Arguments]",s="[object Array]",i="[object Boolean]",c="[object Date]",d="[object Error]",p="[object Function]",f="[object Map]",y="[object Number]",m="[object Object]",h="[object RegExp]",v="[object Set]",P="[object String]",g="[object WeakMap]",T="[object ArrayBuffer]",b="[object DataView]",O="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",N="[object Int16Array]",S="[object Int32Array]",M="[object Uint8Array]",x="[object Uint8ClampedArray]",w="[object Uint16Array]",C="[object Uint32Array]",I={};I[O]=I[_]=I[E]=I[N]=I[S]=I[M]=I[x]=I[w]=I[C]=!0,I[u]=I[s]=I[T]=I[i]=I[b]=I[c]=I[d]=I[p]=I[f]=I[y]=I[m]=I[h]=I[v]=I[P]=I[g]=!1,e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseKeysIn.js ***!
\*********************************/
function(e,t,n){function r(e){if(!o(e))return l(e);var t=a(e),n=[];for(var r in e)("constructor"!=r||!t&&s.call(e,r))&&n.push(r);return n}var o=n(/*! ./isObject */19),a=n(/*! ./_isPrototype */63),l=n(/*! ./_nativeKeysIn */584),u=Object.prototype,s=u.hasOwnProperty;e.exports=r},/*!*****************************!*\
!*** ./~/lodash/_baseLt.js ***!
\*****************************/
function(e,t){function n(e,t){return e<t}e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_baseMatches.js ***!
\**********************************/
function(e,t,n){function r(e){var t=a(e);return 1==t.length&&t[0][2]?l(t[0][0],t[0][1]):function(n){return n===e||o(n,e,t)}}var o=n(/*! ./_baseIsMatch */499),a=n(/*! ./_getMatchData */554),l=n(/*! ./_matchesStrictComparable */312);e.exports=r},/*!******************************************!*\
!*** ./~/lodash/_baseMatchesProperty.js ***!
\******************************************/
function(e,t,n){function r(e,t){return u(e)&&s(t)?i(c(e),t):function(n){var r=a(n,e);return void 0===r&&r===t?l(n,e):o(t,r,d|p)}}var o=n(/*! ./_baseIsEqual */160),a=n(/*! ./get */53),l=n(/*! ./hasIn */333),u=n(/*! ./_isKey */169),s=n(/*! ./_isStrictComparable */310),i=n(/*! ./_matchesStrictComparable */312),c=n(/*! ./_toKey */36),d=1,p=2;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_baseOrderBy.js ***!
\**********************************/
function(e,t,n){function r(e,t,n){var r=-1;t=o(t.length?t:[c],s(a));var d=l(e,function(e,n,a){var l=o(t,function(t){return t(e)});return{criteria:l,index:++r,value:e}});return u(d,function(e,t){return i(e,t,n)})}var o=n(/*! ./_arrayMap */26),a=n(/*! ./_baseIteratee */22),l=n(/*! ./_baseMap */291),u=n(/*! ./_baseSortBy */517),s=n(/*! ./_baseUnary */89),i=n(/*! ./_compareMultiple */533),c=n(/*! ./identity */37);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_basePick.js ***!
\*******************************/
function(e,t,n){function r(e,t){return o(e,t,function(t,n){return a(e,n)})}var o=n(/*! ./_basePickBy */509),a=n(/*! ./hasIn */333);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_basePickBy.js ***!
\*********************************/
function(e,t,n){function r(e,t,n){for(var r=-1,u=t.length,s={};++r<u;){var i=t[r],c=o(e,i);n(c,i)&&a(s,l(i,e),c)}return s}var o=n(/*! ./_baseGet */86),a=n(/*! ./_baseSet */514),l=n(/*! ./_castPath */43);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_baseProperty.js ***!
\***********************************/
function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},/*!***************************************!*\
!*** ./~/lodash/_basePropertyDeep.js ***!
\***************************************/
function(e,t,n){function r(e){return function(t){return o(t,e)}}var o=n(/*! ./_baseGet */86);e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_basePropertyOf.js ***!
\*************************************/
function(e,t){function n(e){return function(t){return null==e?void 0:e[t]}}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_baseReduce.js ***!
\*********************************/
function(e,t){function n(e,t,n,r,o){return o(e,function(e,o,a){n=r?(r=!1,e):t(n,e,o,a)}),n}e.exports=n},/*!******************************!*\
!*** ./~/lodash/_baseSet.js ***!
\******************************/
function(e,t,n){function r(e,t,n,r){if(!u(e))return e;t=a(t,e);for(var i=-1,c=t.length,d=c-1,p=e;null!=p&&++i<c;){var f=s(t[i]),y=n;if(i!=d){var m=p[f];y=r?r(m,f,p):void 0,void 0===y&&(y=u(m)?m:l(t[i+1])?[]:{})}o(p,f,y),p=p[f]}return e}var o=n(/*! ./_assignValue */83),a=n(/*! ./_castPath */43),l=n(/*! ./_isIndex */62),u=n(/*! ./isObject */19),s=n(/*! ./_toKey */36);e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_baseSetToString.js ***!
\**************************************/
function(e,t,n){var r=n(/*! ./constant */605),o=n(/*! ./_defineProperty */300),a=n(/*! ./identity */37),l=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=l},/*!*******************************!*\
!*** ./~/lodash/_baseSome.js ***!
\*******************************/
function(e,t,n){function r(e,t){var n;return o(e,function(e,r,o){return n=t(e,r,o),!n}),!!n}var o=n(/*! ./_baseEach */51);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseSortBy.js ***!
\*********************************/
function(e,t){function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}e.exports=n},/*!******************************!*\
!*** ./~/lodash/_baseSum.js ***!
\******************************/
function(e,t){function n(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);void 0!==a&&(n=void 0===n?a:n+a)}return n}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_baseUniq.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=-1,d=a,p=e.length,f=!0,y=[],m=y;if(n)f=!1,d=l;else if(p>=c){var h=t?null:s(e);if(h)return i(h);f=!1,d=u,m=new o}else m=t?[]:y;e:for(;++r<p;){var v=e[r],P=t?t(v):v;if(v=n||0!==v?v:0,f&&P===P){for(var g=m.length;g--;)if(m[g]===P)continue e;t&&m.push(P),y.push(v)}else d(m,P,n)||(m!==y&&m.push(P),y.push(v))}return y}var o=n(/*! ./_SetCache */79),a=n(/*! ./_arrayIncludes */81),l=n(/*! ./_arrayIncludesWith */155),u=n(/*! ./_cacheHas */90),s=n(/*! ./_createSet */549),i=n(/*! ./_setToArray */100),c=200;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_baseUnset.js ***!
\********************************/
function(e,t,n){function r(e,t){return t=o(t,e),e=l(e,t),null==e||delete e[u(a(t))]}var o=n(/*! ./_castPath */43),a=n(/*! ./last */337),l=n(/*! ./_parent */316),u=n(/*! ./_toKey */36);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_baseValues.js ***!
\*********************************/
function(e,t,n){function r(e,t){return o(t,function(t){return e[t]})}var o=n(/*! ./_arrayMap */26);e.exports=r},/*!******************************************!*\
!*** ./~/lodash/_castArrayLikeObject.js ***!
\******************************************/
function(e,t,n){function r(e){return o(e)?e:[]}var o=n(/*! ./isArrayLikeObject */102);e.exports=r},/*!************************************!*\
!*** ./~/lodash/_charsEndIndex.js ***!
\************************************/
function(e,t,n){function r(e,t){for(var n=e.length;n--&&o(t,e[n],0)>-1;);return n}var o=n(/*! ./_baseIndexOf */87);e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_charsStartIndex.js ***!
\**************************************/
function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&o(t,e[n],0)>-1;);return n}var o=n(/*! ./_baseIndexOf */87);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_cloneBuffer.js ***!
\**********************************/
function(e,t,n){(function(e){function r(e,t){if(t)return e.slice();var n=e.length,r=i?i(n):new e.constructor(n);return e.copy(r),r}var o=n(/*! ./_root */18),a="object"==typeof t&&t&&!t.nodeType&&t,l=a&&"object"==typeof e&&e&&!e.nodeType&&e,u=l&&l.exports===a,s=u?o.Buffer:void 0,i=s?s.allocUnsafe:void 0;e.exports=r}).call(t,n(/*! ./../webpack/buildin/module.js */179)(e))},/*!************************************!*\
!*** ./~/lodash/_cloneDataView.js ***!
\************************************/
function(e,t,n){function r(e,t){var n=t?o(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var o=n(/*! ./_cloneArrayBuffer */164);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_cloneMap.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=t?n(l(e),u):l(e);return a(r,o,new e.constructor)}var o=n(/*! ./_addMapEntry */482),a=n(/*! ./_arrayReduce */82),l=n(/*! ./_mapToArray */311),u=1;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_cloneRegExp.js ***!
\**********************************/
function(e,t){function n(e){var t=new e.constructor(e.source,r.exec(e));return t.lastIndex=e.lastIndex,t}var r=/\w*$/;e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_cloneSet.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=t?n(l(e),u):l(e);return a(r,o,new e.constructor)}var o=n(/*! ./_addSetEntry */483),a=n(/*! ./_arrayReduce */82),l=n(/*! ./_setToArray */100),u=1;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_cloneSymbol.js ***!
\**********************************/
function(e,t,n){function r(e){return l?Object(l.call(e)):{}}var o=n(/*! ./_Symbol */50),a=o?o.prototype:void 0,l=a?a.valueOf:void 0;e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_cloneTypedArray.js ***!
\**************************************/
function(e,t,n){function r(e,t){var n=t?o(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var o=n(/*! ./_cloneArrayBuffer */164);e.exports=r},/*!***************************************!*\
!*** ./~/lodash/_compareAscending.js ***!
\***************************************/
function(e,t,n){function r(e,t){if(e!==t){var n=void 0!==e,r=null===e,a=e===e,l=o(e),u=void 0!==t,s=null===t,i=t===t,c=o(t);if(!s&&!c&&!l&&e>t||l&&u&&i&&!s&&!c||r&&u&&i||!n&&i||!a)return 1;if(!r&&!l&&!c&&e<t||c&&n&&a&&!r&&!l||s&&n&&a||!u&&a||!i)return-1}return 0}var o=n(/*! ./isSymbol */45);e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_compareMultiple.js ***!
\**************************************/
function(e,t,n){function r(e,t,n){for(var r=-1,a=e.criteria,l=t.criteria,u=a.length,s=n.length;++r<u;){var i=o(a[r],l[r]);if(i){if(r>=s)return i;var c=n[r];return i*("desc"==c?-1:1)}}return e.index-t.index}var o=n(/*! ./_compareAscending */532);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_copySymbols.js ***!
\**********************************/
function(e,t,n){function r(e,t){return o(e,a(e),t)}var o=n(/*! ./_copyObject */52),a=n(/*! ./_getSymbols */167);e.exports=r},/*!************************************!*\
!*** ./~/lodash/_copySymbolsIn.js ***!
\************************************/
function(e,t,n){function r(e,t){return o(e,a(e),t)}var o=n(/*! ./_copyObject */52),a=n(/*! ./_getSymbolsIn */306);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_coreJsData.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./_root */18),o=r["__core-js_shared__"];e.exports=o},/*!***********************************!*\
!*** ./~/lodash/_countHolders.js ***!
\***********************************/
function(e,t){function n(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_createAssigner.js ***!
\*************************************/
function(e,t,n){function r(e){return o(function(t,n){var r=-1,o=n.length,l=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(l=e.length>3&&"function"==typeof l?(o--,l):void 0,u&&a(n[0],n[1],u)&&(l=o<3?void 0:l,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,l)}return t})}var o=n(/*! ./_baseRest */35),a=n(/*! ./_isIterateeCall */97);e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_createBaseEach.js ***!
\*************************************/
function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!o(n))return e(n,r);for(var a=n.length,l=t?a:-1,u=Object(n);(t?l--:++l<a)&&r(u[l],l,u)!==!1;);return n}}var o=n(/*! ./isArrayLike */23);e.exports=r},/*!************************************!*\
!*** ./~/lodash/_createBaseFor.js ***!
\************************************/
function(e,t){function n(e){return function(t,n,r){for(var o=-1,a=Object(t),l=r(t),u=l.length;u--;){var s=l[e?u:++o];if(n(a[s],s,a)===!1)break}return t}}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_createBind.js ***!
\*********************************/
function(e,t,n){function r(e,t,n){function r(){var t=this&&this!==a&&this instanceof r?s:e;return t.apply(u?n:this,arguments)}var u=t&l,s=o(e);return r}var o=n(/*! ./_createCtor */92),a=n(/*! ./_root */18),l=1;e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_createCaseFirst.js ***!
\**************************************/
function(e,t,n){function r(e){return function(t){t=u(t);var n=a(t)?l(t):void 0,r=n?n[0]:t.charAt(0),s=n?o(n,1).join(""):t.slice(1);return r[e]()+s}}var o=n(/*! ./_castSlice */295),a=n(/*! ./_hasUnicode */308),l=n(/*! ./_stringToArray */320),u=n(/*! ./toString */29);e.exports=r},/*!***************************************!*\
!*** ./~/lodash/_createCompounder.js ***!
\***************************************/
function(e,t,n){function r(e){return function(t){return o(l(a(t).replace(s,"")),e,"")}}var o=n(/*! ./_arrayReduce */82),a=n(/*! ./deburr */606),l=n(/*! ./words */655),u="['’]",s=RegExp(u,"g");e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_createCurry.js ***!
\**********************************/
function(e,t,n){function r(e,t,n){function r(){for(var a=arguments.length,p=Array(a),f=a,y=s(r);f--;)p[f]=arguments[f];var m=a<3&&p[0]!==y&&p[a-1]!==y?[]:i(p,y);if(a-=m.length,a<n)return u(e,t,l,r.placeholder,void 0,p,m,void 0,void 0,n-a);var h=this&&this!==c&&this instanceof r?d:e;return o(h,this,p)}var d=a(e);return r}var o=n(/*! ./_apply */80),a=n(/*! ./_createCtor */92),l=n(/*! ./_createHybrid */298),u=n(/*! ./_createRecurry */299),s=n(/*! ./_getHolder */166),i=n(/*! ./_replaceHolders */99),c=n(/*! ./_root */18);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_createFind.js ***!
\*********************************/
function(e,t,n){function r(e){return function(t,n,r){var u=Object(t);if(!a(t)){var s=o(n,3);t=l(t),n=function(e){return s(u[e],e,u)}}var i=e(t,n,r);return i>-1?u[s?t[i]:i]:void 0}}var o=n(/*! ./_baseIteratee */22),a=n(/*! ./isArrayLike */23),l=n(/*! ./keys */20);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_createFlow.js ***!
\*********************************/
function(e,t,n){function r(e){return a(function(t){var n=t.length,r=n,a=o.prototype.thru;for(e&&t.reverse();r--;){var m=t[r];if("function"!=typeof m)throw new TypeError(c);if(a&&!h&&"wrapper"==u(m))var h=new o([],!0)}for(r=h?r:n;++r<n;){m=t[r];var v=u(m),P="wrapper"==v?l(m):void 0;h=P&&i(P[0])&&P[1]==(f|d|p|y)&&!P[4].length&&1==P[9]?h[u(P[0])].apply(h,P[3]):1==m.length&&i(m)?h[v]():h.thru(m)}return function(){var e=arguments,r=e[0];if(h&&1==e.length&&s(r))return h.plant(r).value();for(var o=0,a=n?t[o].apply(this,e):r;++o<n;)a=t[o].call(this,a);return a}})}var o=n(/*! ./_LodashWrapper */151),a=n(/*! ./_flatRest */94),l=n(/*! ./_getData */165),u=n(/*! ./_getFuncName */305),s=n(/*! ./isArray */12),i=n(/*! ./_isLaziable */309),c="Expected a function",d=8,p=32,f=128,y=256;e.exports=r},/*!************************************!*\
!*** ./~/lodash/_createPartial.js ***!
\************************************/
function(e,t,n){function r(e,t,n,r){function s(){for(var t=-1,a=arguments.length,u=-1,d=r.length,p=Array(d+a),f=this&&this!==l&&this instanceof s?c:e;++u<d;)p[u]=r[u];for(;a--;)p[u++]=arguments[++t];return o(f,i?n:this,p)}var i=t&u,c=a(e);return s}var o=n(/*! ./_apply */80),a=n(/*! ./_createCtor */92),l=n(/*! ./_root */18),u=1;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_createRound.js ***!
\**********************************/
function(e,t,n){function r(e){var t=Math[e];return function(e,n){if(e=a(e),n=null==n?0:u(o(n),292)){var r=(l(e)+"e").split("e"),s=t(r[0]+"e"+(+r[1]+n));return r=(l(s)+"e").split("e"),+(r[0]+"e"+(+r[1]-n))}return t(e)}}var o=n(/*! ./toInteger */28),a=n(/*! ./toNumber */106),l=n(/*! ./toString */29),u=Math.min;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_createSet.js ***!
\********************************/
function(e,t,n){var r=n(/*! ./_Set */280),o=n(/*! ./noop */338),a=n(/*! ./_setToArray */100),l=1/0,u=r&&1/a(new r([,-0]))[1]==l?function(e){return new r(e)}:o;e.exports=u},/*!**************************************!*\
!*** ./~/lodash/_customOmitClone.js ***!
\**************************************/
function(e,t,n){function r(e){return o(e)?void 0:e}var o=n(/*! ./isPlainObject */103);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_deburrLetter.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./_basePropertyOf */512),o={"À":"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"},a=r(o);e.exports=a},/*!*********************************!*\
!*** ./~/lodash/_equalByTag.js ***!
\*********************************/
function(e,t,n){function r(e,t,n,r,o,_,N){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!_(new a(e),new a(t)));case p:case f:case h:return l(+e,+t);case y:return e.name==t.name&&e.message==t.message;case v:case g:return e==t+"";case m:var S=s;case P:var M=r&c;if(S||(S=i),e.size!=t.size&&!M)return!1;var x=N.get(e);if(x)return x==t;r|=d,N.set(e,t);var w=u(S(e),S(t),r,o,_,N);return N.delete(e),w;case T:if(E)return E.call(e)==E.call(t)}return!1}var o=n(/*! ./_Symbol */50),a=n(/*! ./_Uint8Array */281),l=n(/*! ./eq */64),u=n(/*! ./_equalArrays */301),s=n(/*! ./_mapToArray */311),i=n(/*! ./_setToArray */100),c=1,d=2,p="[object Boolean]",f="[object Date]",y="[object Error]",m="[object Map]",h="[object Number]",v="[object RegExp]",P="[object Set]",g="[object String]",T="[object Symbol]",b="[object ArrayBuffer]",O="[object DataView]",_=o?o.prototype:void 0,E=_?_.valueOf:void 0;e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_equalObjects.js ***!
\***********************************/
function(e,t,n){function r(e,t,n,r,l,s){var i=n&a,c=o(e),d=c.length,p=o(t),f=p.length;if(d!=f&&!i)return!1;for(var y=d;y--;){var m=c[y];if(!(i?m in t:u.call(t,m)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var v=!0;s.set(e,t),s.set(t,e);for(var P=i;++y<d;){m=c[y];var g=e[m],T=t[m];if(r)var b=i?r(T,g,m,t,e,s):r(g,T,m,e,t,s);if(!(void 0===b?g===T||l(g,T,n,r,s):b)){v=!1;break}P||(P="constructor"==m)}if(v&&!P){var O=e.constructor,_=t.constructor;O!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof O&&O instanceof O&&"function"==typeof _&&_ instanceof _)&&(v=!1)}return s.delete(e),s.delete(t),v}var o=n(/*! ./_getAllKeys */303),a=1,l=Object.prototype,u=l.hasOwnProperty;e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_getMatchData.js ***!
\***********************************/
function(e,t,n){function r(e){for(var t=a(e),n=t.length;n--;){var r=t[n],l=e[r];t[n]=[r,l,o(l)]}return t}var o=n(/*! ./_isStrictComparable */310),a=n(/*! ./keys */20);e.exports=r},/*!********************************!*\
!*** ./~/lodash/_getRawTag.js ***!
\********************************/
function(e,t,n){function r(e){var t=l.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[s]=n:delete e[s]),o}var o=n(/*! ./_Symbol */50),a=Object.prototype,l=a.hasOwnProperty,u=a.toString,s=o?o.toStringTag:void 0;e.exports=r},/*!*******************************!*\
!*** ./~/lodash/_getValue.js ***!
\*******************************/
function(e,t){function n(e,t){return null==e?void 0:e[t]}e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_getWrapDetails.js ***!
\*************************************/
function(e,t){function n(e){var t=e.match(r);return t?t[1].split(o):[]}var r=/\{\n\/\* \[wrapped with (.+)\] \*/,o=/,? & /;e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_hasUnicodeWord.js ***!
\*************************************/
function(e,t){function n(e){return r.test(e)}var r=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=n},/*!********************************!*\
!*** ./~/lodash/_hashClear.js ***!
\********************************/
function(e,t,n){function r(){this.__data__=o?o(null):{},this.size=0}var o=n(/*! ./_nativeCreate */98);e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_hashDelete.js ***!
\*********************************/
function(e,t){function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=n},/*!******************************!*\
!*** ./~/lodash/_hashGet.js ***!
\******************************/
function(e,t,n){function r(e){var t=this.__data__;if(o){var n=t[e];return n===a?void 0:n}return u.call(t,e)?t[e]:void 0}var o=n(/*! ./_nativeCreate */98),a="__lodash_hash_undefined__",l=Object.prototype,u=l.hasOwnProperty;e.exports=r},/*!******************************!*\
!*** ./~/lodash/_hashHas.js ***!
\******************************/
function(e,t,n){function r(e){var t=this.__data__;return o?void 0!==t[e]:l.call(t,e)}var o=n(/*! ./_nativeCreate */98),a=Object.prototype,l=a.hasOwnProperty;e.exports=r},/*!******************************!*\
!*** ./~/lodash/_hashSet.js ***!
\******************************/
function(e,t,n){function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=o&&void 0===t?a:t,this}var o=n(/*! ./_nativeCreate */98),a="__lodash_hash_undefined__";e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_initCloneArray.js ***!
\*************************************/
function(e,t){function n(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&o.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var r=Object.prototype,o=r.hasOwnProperty;e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_initCloneByTag.js ***!
\*************************************/
function(e,t,n){function r(e,t,n,r){var C=e.constructor;switch(t){case g:return o(e);case d:case p:return new C(+e);case T:return a(e,r);case b:case O:case _:case E:case N:case S:case M:case x:case w:return c(e,r);case f:return l(e,r,n);case y:case v:return new C(e);case m:return u(e);case h:return s(e,r,n);case P:return i(e)}}var o=n(/*! ./_cloneArrayBuffer */164),a=n(/*! ./_cloneDataView */526),l=n(/*! ./_cloneMap */527),u=n(/*! ./_cloneRegExp */528),s=n(/*! ./_cloneSet */529),i=n(/*! ./_cloneSymbol */530),c=n(/*! ./_cloneTypedArray */531),d="[object Boolean]",p="[object Date]",f="[object Map]",y="[object Number]",m="[object RegExp]",h="[object Set]",v="[object String]",P="[object Symbol]",g="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",O="[object Float64Array]",_="[object Int8Array]",E="[object Int16Array]",N="[object Int32Array]",S="[object Uint8Array]",M="[object Uint8ClampedArray]",x="[object Uint16Array]",w="[object Uint32Array]";e.exports=r},/*!**************************************!*\
!*** ./~/lodash/_initCloneObject.js ***!
\**************************************/
function(e,t,n){function r(e){return"function"!=typeof e.constructor||l(e)?{}:o(a(e))}var o=n(/*! ./_baseCreate */61),a=n(/*! ./_getPrototype */96),l=n(/*! ./_isPrototype */63);e.exports=r},/*!****************************************!*\
!*** ./~/lodash/_insertWrapDetails.js ***!
\****************************************/
function(e,t){function n(e,t){var n=t.length;if(!n)return e;var o=n-1;return t[o]=(n>1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace(r,"{\n/* [wrapped with "+t+"] */\n")}var r=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=n},/*!************************************!*\
!*** ./~/lodash/_isFlattenable.js ***!
\************************************/
function(e,t,n){function r(e){return l(e)||a(e)||!!(u&&e&&e[u])}var o=n(/*! ./_Symbol */50),a=n(/*! ./isArguments */101),l=n(/*! ./isArray */12),u=o?o.isConcatSpreadable:void 0;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_isKeyable.js ***!
\********************************/
function(e,t){function n(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_isMasked.js ***!
\*******************************/
function(e,t,n){function r(e){return!!a&&a in e}var o=n(/*! ./_coreJsData */536),a=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_listCacheClear.js ***!
\*************************************/
function(e,t){function n(){this.__data__=[],this.size=0}e.exports=n},/*!**************************************!*\
!*** ./~/lodash/_listCacheDelete.js ***!
\**************************************/
function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():l.call(t,n,1),--this.size,!0}var o=n(/*! ./_assocIndexOf */84),a=Array.prototype,l=a.splice;e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_listCacheGet.js ***!
\***********************************/
function(e,t,n){function r(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}var o=n(/*! ./_assocIndexOf */84);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_listCacheHas.js ***!
\***********************************/
function(e,t,n){function r(e){return o(this.__data__,e)>-1}var o=n(/*! ./_assocIndexOf */84);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_listCacheSet.js ***!
\***********************************/
function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=n(/*! ./_assocIndexOf */84);e.exports=r},/*!************************************!*\
!*** ./~/lodash/_mapCacheClear.js ***!
\************************************/
function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(l||a),string:new o}}var o=n(/*! ./_Hash */480),a=n(/*! ./_ListCache */78),l=n(/*! ./_Map */152);e.exports=r},/*!*************************************!*\
!*** ./~/lodash/_mapCacheDelete.js ***!
\*************************************/
function(e,t,n){function r(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}var o=n(/*! ./_getMapData */95);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_mapCacheGet.js ***!
\**********************************/
function(e,t,n){function r(e){return o(this,e).get(e)}var o=n(/*! ./_getMapData */95);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_mapCacheHas.js ***!
\**********************************/
function(e,t,n){function r(e){return o(this,e).has(e)}var o=n(/*! ./_getMapData */95);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_mapCacheSet.js ***!
\**********************************/
function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=n(/*! ./_getMapData */95);e.exports=r},/*!************************************!*\
!*** ./~/lodash/_memoizeCapped.js ***!
\************************************/
function(e,t,n){function r(e){var t=o(e,function(e){return n.size===a&&n.clear(),e}),n=t.cache;return t}var o=n(/*! ./memoize */639),a=500;e.exports=r},/*!********************************!*\
!*** ./~/lodash/_mergeData.js ***!
\********************************/
function(e,t,n){function r(e,t){var n=e[1],r=t[1],m=n|r,h=m<(s|i|p),v=r==p&&n==d||r==p&&n==f&&e[7].length<=t[8]||r==(p|f)&&t[7].length<=t[8]&&n==d;if(!h&&!v)return e;r&s&&(e[2]=t[2],m|=n&s?0:c);var P=t[3];if(P){var g=e[3];e[3]=g?o(g,P,t[4]):P,e[4]=g?l(e[3],u):t[4]}return P=t[5],P&&(g=e[5],e[5]=g?a(g,P,t[6]):P,e[6]=g?l(e[5],u):t[6]),P=t[7],P&&(e[7]=P),r&p&&(e[8]=null==e[8]?t[8]:y(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=m,e}var o=n(/*! ./_composeArgs */296),a=n(/*! ./_composeArgsRight */297),l=n(/*! ./_replaceHolders */99),u="__lodash_placeholder__",s=1,i=2,c=4,d=8,p=128,f=256,y=Math.min;e.exports=r},/*!*********************************!*\
!*** ./~/lodash/_nativeKeys.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./_overArg */314),o=r(Object.keys,Object);e.exports=o},/*!***********************************!*\
!*** ./~/lodash/_nativeKeysIn.js ***!
\***********************************/
function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_nodeUtil.js ***!
\*******************************/
function(e,t,n){(function(e){var r=n(/*! ./_freeGlobal */302),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===o,u=l&&r.process,s=function(){try{return u&&u.binding&&u.binding("util")}catch(e){}}();e.exports=s}).call(t,n(/*! ./../webpack/buildin/module.js */179)(e))},/*!*************************************!*\
!*** ./~/lodash/_objectToString.js ***!
\*************************************/
function(e,t){function n(e){return o.call(e)}var r=Object.prototype,o=r.toString;e.exports=n},/*!********************************!*\
!*** ./~/lodash/_realNames.js ***!
\********************************/
function(e,t){var n={};e.exports=n},/*!******************************!*\
!*** ./~/lodash/_reorder.js ***!
\******************************/
function(e,t,n){function r(e,t){for(var n=e.length,r=l(t.length,n),u=o(e);r--;){var s=t[r];e[r]=a(s,n)?u[s]:void 0}return e}var o=n(/*! ./_copyArray */91),a=n(/*! ./_isIndex */62),l=Math.min;e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_setCacheAdd.js ***!
\**********************************/
function(e,t){function n(e){return this.__data__.set(e,r),this}var r="__lodash_hash_undefined__";e.exports=n},/*!**********************************!*\
!*** ./~/lodash/_setCacheHas.js ***!
\**********************************/
function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},/*!*********************************!*\
!*** ./~/lodash/_stackClear.js ***!
\*********************************/
function(e,t,n){function r(){this.__data__=new o,this.size=0}var o=n(/*! ./_ListCache */78);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/_stackDelete.js ***!
\**********************************/
function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_stackGet.js ***!
\*******************************/
function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_stackHas.js ***!
\*******************************/
function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},/*!*******************************!*\
!*** ./~/lodash/_stackSet.js ***!
\*******************************/
function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!a||r.length<u-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new l(r)}return n.set(e,t),this.size=n.size,this}var o=n(/*! ./_ListCache */78),a=n(/*! ./_Map */152),l=n(/*! ./_MapCache */153),u=200;e.exports=r},/*!************************************!*\
!*** ./~/lodash/_strictIndexOf.js ***!
\************************************/
function(e,t){function n(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}e.exports=n},/*!*************************************!*\
!*** ./~/lodash/_unicodeToArray.js ***!
\*************************************/
function(e,t){function n(e){return e.match(O)||[]}var r="\\ud800-\\udfff",o="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",l="\\u20d0-\\u20ff",u=o+a+l,s="\\ufe0e\\ufe0f",i="["+r+"]",c="["+u+"]",d="\\ud83c[\\udffb-\\udfff]",p="(?:"+c+"|"+d+")",f="[^"+r+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d",v=p+"?",P="["+s+"]?",g="(?:"+h+"(?:"+[f,y,m].join("|")+")"+P+v+")*",T=P+v+g,b="(?:"+[f+c+"?",c,y,m,i].join("|")+")",O=RegExp(d+"(?="+d+")|"+b+T,"g");e.exports=n},/*!***********************************!*\
!*** ./~/lodash/_unicodeWords.js ***!
\***********************************/
function(e,t){function n(e){return e.match(F)||[]}var r="\\ud800-\\udfff",o="\\u0300-\\u036f",a="\\ufe20-\\ufe2f",l="\\u20d0-\\u20ff",u=o+a+l,s="\\u2700-\\u27bf",i="a-z\\xdf-\\xf6\\xf8-\\xff",c="\\xac\\xb1\\xd7\\xf7",d="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",p="\\u2000-\\u206f",f=" \\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",y="A-Z\\xc0-\\xd6\\xd8-\\xde",m="\\ufe0e\\ufe0f",h=c+d+p+f,v="['’]",P="["+h+"]",g="["+u+"]",T="\\d+",b="["+s+"]",O="["+i+"]",_="[^"+r+h+T+s+i+y+"]",E="\\ud83c[\\udffb-\\udfff]",N="(?:"+g+"|"+E+")",S="[^"+r+"]",M="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+y+"]",C="\\u200d",I="(?:"+O+"|"+_+")",A="(?:"+w+"|"+_+")",j="(?:"+v+"(?:d|ll|m|re|s|t|ve))?",k="(?:"+v+"(?:D|LL|M|RE|S|T|VE))?",D=N+"?",L="["+m+"]?",K="(?:"+C+"(?:"+[S,M,x].join("|")+")"+L+D+")*",U="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",V="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",R=L+D+K,z="(?:"+[b,M,x].join("|")+")"+R,F=RegExp([w+"?"+O+"+"+j+"(?="+[P,w,"$"].join("|")+")",A+"+"+k+"(?="+[P,w+I,"$"].join("|")+")",w+"?"+I+"+"+j,w+"+"+k,V,U,T,z].join("|"),"g");e.exports=n},/*!****************************************!*\
!*** ./~/lodash/_updateWrapDetails.js ***!
\****************************************/
function(e,t,n){function r(e,t){return o(m,function(n){var r="_."+n[0];t&n[1]&&!a(e,r)&&e.push(r)}),e.sort()}var o=n(/*! ./_arrayEach */60),a=n(/*! ./_arrayIncludes */81),l=1,u=2,s=8,i=16,c=32,d=64,p=128,f=256,y=512,m=[["ary",p],["bind",l],["bindKey",u],["curry",s],["curryRight",i],["flip",y],["partial",c],["partialRight",d],["rearg",f]];e.exports=r},/*!***********************************!*\
!*** ./~/lodash/_wrapperClone.js ***!
\***********************************/
function(e,t,n){function r(e){if(e instanceof o)return e.clone();var t=new a(e.__wrapped__,e.__chain__);return t.__actions__=l(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var o=n(/*! ./_LazyWrapper */150),a=n(/*! ./_LodashWrapper */151),l=n(/*! ./_copyArray */91);e.exports=r},/*!*************************!*\
!*** ./~/lodash/ary.js ***!
\*************************/
function(e,t,n){function r(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,o(e,a,void 0,void 0,void 0,void 0,t)}var o=n(/*! ./_createWrap */93),a=128;e.exports=r},/*!****************************!*\
!*** ./~/lodash/assign.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./_assignValue */83),o=n(/*! ./_copyObject */52),a=n(/*! ./_createAssigner */538),l=n(/*! ./isArrayLike */23),u=n(/*! ./_isPrototype */63),s=n(/*! ./keys */20),i=Object.prototype,c=i.hasOwnProperty,d=a(function(e,t){if(u(t)||l(t))return void o(t,s(t),e);for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=d},/*!***************************!*\
!*** ./~/lodash/clamp.js ***!
\***************************/
function(e,t,n){function r(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=a(n),n=n===n?n:0),void 0!==t&&(t=a(t),t=t===t?t:0),o(a(e),t,n)}var o=n(/*! ./_baseClamp */287),a=n(/*! ./toNumber */106);e.exports=r},/*!***************************!*\
!*** ./~/lodash/clone.js ***!
\***************************/
function(e,t,n){function r(e){return o(e,a)}var o=n(/*! ./_baseClone */158),a=4;e.exports=r},/*!******************************!*\
!*** ./~/lodash/constant.js ***!
\******************************/
function(e,t){function n(e){return function(){return e}}e.exports=n},/*!****************************!*\
!*** ./~/lodash/deburr.js ***!
\****************************/
function(e,t,n){function r(e){return e=a(e),e&&e.replace(l,o).replace(p,"")}var o=n(/*! ./_deburrLetter */551),a=n(/*! ./toString */29),l=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u="\\u0300-\\u036f",s="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",c=u+s+i,d="["+c+"]",p=RegExp(d,"g");e.exports=r},/*!*******************************!*\
!*** ./~/lodash/dropRight.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=null==e?0:e.length;return r?(t=n||void 0===t?1:a(t),t=r-t,o(e,0,t<0?0:t)):[]}var o=n(/*! ./_baseSlice */88),a=n(/*! ./toInteger */28);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/escapeRegExp.js ***!
\**********************************/
function(e,t,n){function r(e){return e=o(e),e&&l.test(e)?e.replace(a,"\\$&"):e}var o=n(/*! ./toString */29),a=/[\\^$.*+?()[\]{}|]/g,l=RegExp(a.source);e.exports=r},/*!***************************!*\
!*** ./~/lodash/every.js ***!
\***************************/
function(e,t,n){function r(e,t,n){var r=u(e)?o:a;return n&&s(e,t,n)&&(t=void 0),r(e,l(t,3))}var o=n(/*! ./_arrayEvery */484),a=n(/*! ./_baseEvery */488),l=n(/*! ./_baseIteratee */22),u=n(/*! ./isArray */12),s=n(/*! ./_isIterateeCall */97);e.exports=r},/*!*****************************!*\
!*** ./~/lodash/flatten.js ***!
\*****************************/
function(e,t,n){function r(e){var t=null==e?0:e.length;return t?o(e,1):[]}var o=n(/*! ./_baseFlatten */85);e.exports=r},/*!**************************!*\
!*** ./~/lodash/flow.js ***!
\**************************/
function(e,t,n){var r=n(/*! ./_createFlow */546),o=r();e.exports=o},/*!*************************************!*\
!*** ./~/lodash/fp/_baseConvert.js ***!
\*************************************/
function(e,t,n){function r(e,t){return 2==t?function(t,n){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}function o(e,t){return 2==t?function(t,n){return e(t,n)}:function(t){return e(t)}}function a(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function l(e){return function(t){return e({},t)}}function u(e,t){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var a=o[t],l=o.slice(0,t);return a&&p.apply(l,a),t!=r&&p.apply(l,o.slice(t+1)),e.apply(this,l)}}function s(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=t.apply(void 0,r);return e.apply(void 0,r),o}}}function i(e,t,n,p){function f(e,t){if(M.cap){var n=c.iterateeRearg[e];if(n)return b(t,n);var r=!N&&c.iterateeAry[e];if(r)return T(t,r)}return t}function y(e,t,n){return x||M.curry&&n>1?K(t,n):t}function m(e,t,n){if(M.fixed&&(w||!c.skipFixed[e])){var r=c.methodSpread[e],o=r&&r.start;return void 0===o?k(t,n):u(t,o)}return t}function h(e,t,n){return M.rearg&&n>1&&(C||!c.skipRearg[e])?F(t,c.methodRearg[e]||c.aryRearg[n]):t}function v(e,t){t=B(t);for(var n=-1,r=t.length,o=r-1,a=L(Object(e)),l=a;null!=l&&++n<r;){var u=t[n],s=l[u];null!=s&&(l[t[n]]=L(n==o?s:Object(s))),l=l[u]}return a}function P(e){return q.runInContext.convert(e)(void 0)}function g(e,t){var n=c.aliasToReal[e]||e,r=c.remap[n]||n,o=p;return function(e){var a=N?A:j,l=N?A[r]:t,u=D(D({},o),e);return i(a,n,l,u)}}function T(e,t){return O(e,function(e){return"function"==typeof e?o(e,t):e})}function b(e,t){return O(e,function(e){var n=t.length;return r(F(o(e,n),t),n)})}function O(e,t){return function(){var n=arguments.length;if(!n)return e();for(var r=Array(n);n--;)r[n]=arguments[n];var o=M.rearg?0:n-1;return r[o]=t(r[o]),e.apply(void 0,r)}}function _(e,t){var n,r=c.aliasToReal[e]||e,o=t,u=H[r];return u?o=u(t):M.immutable&&(c.mutate.array[r]?o=s(t,a):c.mutate.object[r]?o=s(t,l(t)):c.mutate.set[r]&&(o=s(t,v))),U(Y,function(e){return U(c.aryMethod[e],function(t){if(r==t){var a=c.methodSpread[r],l=a&&a.afterRearg;return n=l?m(r,h(r,o,e),e):h(r,m(r,o,e),e),n=f(r,n),n=y(r,n,e),!1}}),!n}),n||(n=o),n==t&&(n=x?K(n,1):function(){return t.apply(this,arguments)}),n.convert=g(r,t),c.placeholder[r]&&(E=!0,n.placeholder=t.placeholder=I),n}var E,N="function"==typeof t,S=t===Object(t);if(S&&(p=n,n=t,t=void 0),null==n)throw new TypeError;p||(p={});var M={cap:!("cap"in p)||p.cap,curry:!("curry"in p)||p.curry,fixed:!("fixed"in p)||p.fixed,immutable:!("immutable"in p)||p.immutable,rearg:!("rearg"in p)||p.rearg},x="curry"in p&&p.curry,w="fixed"in p&&p.fixed,C="rearg"in p&&p.rearg,I=N?n:d,A=N?n.runInContext():void 0,j=N?n:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},k=j.ary,D=j.assign,L=j.clone,K=j.curry,U=j.forEach,V=j.isArray,R=j.isFunction,z=j.keys,F=j.rearg,W=j.toInteger,B=j.toPath,Y=z(c.aryMethod),H={castArray:function(e){return function(){var t=arguments[0];return V(t)?e(a(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[0],n=arguments[1],r=e(t,n),a=r.length;return M.cap&&"number"==typeof n?(n=n>2?n-2:1,a&&a<=n?r:o(r,n)):r}},mixin:function(e){return function(t){var n=this;if(!R(n))return e(n,Object(t));var r=[];return U(z(t),function(e){R(t[e])&&r.push([e,n.prototype[e]])}),e(n,Object(t)),U(r,function(e){var t=e[1];R(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]}),n}},nthArg:function(e){return function(t){var n=t<0?1:W(t)+1;return K(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return K(e(t,n),r)}},runInContext:function(t){return function(n){return i(e,t(n),p)}}};if(!S)return _(t,n);var q=n,G=[];return U(Y,function(e){U(c.aryMethod[e],function(e){var t=q[c.remap[e]||e];t&&G.push([e,_(e,t)])})}),U(z(q),function(e){var t=q[e];if("function"==typeof t){for(var n=G.length;n--;)if(G[n][0]==e)return;t.convert=g(e,t),G.push([e,t])}}),U(G,function(e){q[e[0]]=e[1]}),q.convert=P,E&&(q.placeholder=I),U(z(q),function(e){U(c.realToAlias[e]||[],function(t){q[t]=q[e]})}),q}var c=n(/*! ./_mapping */613),d=n(/*! ./placeholder */11),p=Array.prototype.push;e.exports=i},/*!*********************************!*\
!*** ./~/lodash/fp/_mapping.js ***!
\*********************************/
function(e,t){t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var a=n[o];e.call(r,a)?r[a].push(o):r[a]=[o]}return r}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},/*!******************************!*\
!*** ./~/lodash/fp/_util.js ***!
\******************************/
function(e,t,n){e.exports={ary:n(/*! ../ary */601),assign:n(/*! ../_baseAssign */286),clone:n(/*! ../clone */604),curry:n(/*! ../curry */324),forEach:n(/*! ../_arrayEach */60),isArray:n(/*! ../isArray */12),isFunction:n(/*! ../isFunction */38),iteratee:n(/*! ../iteratee */637),keys:n(/*! ../_baseKeys */161),rearg:n(/*! ../rearg */643),toInteger:n(/*! ../toInteger */28),toPath:n(/*! ../toPath */650)}},/*!********************************!*\
!*** ./~/lodash/fp/compact.js ***!
\********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("compact",n(/*! ../compact */323),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!******************************!*\
!*** ./~/lodash/fp/curry.js ***!
\******************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("curry",n(/*! ../curry */324));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!***********************************!*\
!*** ./~/lodash/fp/difference.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("difference",n(/*! ../difference */325));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!***************************!*\
!*** ./~/lodash/fp/eq.js ***!
\***************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("eq",n(/*! ../eq */64));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!****************************!*\
!*** ./~/lodash/fp/get.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("get",n(/*! ../get */53));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!****************************!*\
!*** ./~/lodash/fp/has.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("has",n(/*! ../has */54));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*******************************!*\
!*** ./~/lodash/fp/invoke.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("invoke",n(/*! ../invoke */172));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!***********************************!*\
!*** ./~/lodash/fp/isFunction.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("isFunction",n(/*! ../isFunction */38),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*********************************!*\
!*** ./~/lodash/fp/isObject.js ***!
\*********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("isObject",n(/*! ../isObject */19),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!**************************************!*\
!*** ./~/lodash/fp/isPlainObject.js ***!
\**************************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("isPlainObject",n(/*! ../isPlainObject */103),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*****************************!*\
!*** ./~/lodash/fp/keys.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("keys",n(/*! ../keys */20),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!****************************!*\
!*** ./~/lodash/fp/map.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("map",n(/*! ../map */16));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!****************************!*\
!*** ./~/lodash/fp/min.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("min",n(/*! ../min */640),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*****************************!*\
!*** ./~/lodash/fp/pick.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("pick",n(/*! ../pick */177));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*******************************!*\
!*** ./~/lodash/fp/sortBy.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("sortBy",n(/*! ../sortBy */645));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!***********************************!*\
!*** ./~/lodash/fp/startsWith.js ***!
\***********************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("startsWith",n(/*! ../startsWith */341));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!****************************!*\
!*** ./~/lodash/fp/sum.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("sum",n(/*! ../sum */648),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*****************************!*\
!*** ./~/lodash/fp/take.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("take",n(/*! ../take */649));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*****************************!*\
!*** ./~/lodash/fp/trim.js ***!
\*****************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("trim",n(/*! ../trim */652));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*******************************!*\
!*** ./~/lodash/fp/values.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./convert */14),o=r("values",n(/*! ../values */178),n(/*! ./_falseOptions */27));o.placeholder=n(/*! ./placeholder */11),e.exports=o},/*!*****************************!*\
!*** ./~/lodash/inRange.js ***!
\*****************************/
function(e,t,n){function r(e,t,n){return t=a(t),void 0===n?(n=t,t=0):n=a(n),e=l(e),o(e,t,n)}var o=n(/*! ./_baseInRange */494),a=n(/*! ./toFinite */344),l=n(/*! ./toNumber */106);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/intersection.js ***!
\**********************************/
function(e,t,n){var r=n(/*! ./_arrayMap */26),o=n(/*! ./_baseIntersection */495),a=n(/*! ./_baseRest */35),l=n(/*! ./_castArrayLikeObject */522),u=a(function(e){var t=r(e,l);return t.length&&t[0]===e[0]?o(t):[]});e.exports=u},/*!******************************!*\
!*** ./~/lodash/iteratee.js ***!
\******************************/
function(e,t,n){function r(e){return a("function"==typeof e?e:o(e,l))}var o=n(/*! ./_baseClone */158),a=n(/*! ./_baseIteratee */22),l=1;e.exports=r},/*!*******************************!*\
!*** ./~/lodash/mapValues.js ***!
\*******************************/
function(e,t,n){function r(e,t){var n={};return t=l(t,3),a(e,function(e,r,a){o(n,r,t(e,r,a))}),n}var o=n(/*! ./_baseAssignValue */157),a=n(/*! ./_baseForOwn */159),l=n(/*! ./_baseIteratee */22);e.exports=r},/*!*****************************!*\
!*** ./~/lodash/memoize.js ***!
\*****************************/
function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var l=e.apply(this,r);return n.cache=a.set(o,l)||a,l};return n.cache=new(r.Cache||o),n}var o=n(/*! ./_MapCache */153),a="Expected a function";r.Cache=o,e.exports=r},/*!*************************!*\
!*** ./~/lodash/min.js ***!
\*************************/
function(e,t,n){function r(e){return e&&e.length?o(e,l,a):void 0}var o=n(/*! ./_baseExtremum */489),a=n(/*! ./_baseLt */504),l=n(/*! ./identity */37);e.exports=r},/*!**********************************!*\
!*** ./~/lodash/partialRight.js ***!
\**********************************/
function(e,t,n){var r=n(/*! ./_baseRest */35),o=n(/*! ./_createWrap */93),a=n(/*! ./_getHolder */166),l=n(/*! ./_replaceHolders */99),u=64,s=r(function(e,t){var n=l(t,a(s));return o(e,u,void 0,t,n)});s.placeholder={},e.exports=s},/*!******************************!*\
!*** ./~/lodash/property.js ***!
\******************************/
function(e,t,n){function r(e){return l(e)?o(u(e)):a(e)}var o=n(/*! ./_baseProperty */510),a=n(/*! ./_basePropertyDeep */511),l=n(/*! ./_isKey */169),u=n(/*! ./_toKey */36);e.exports=r},/*!***************************!*\
!*** ./~/lodash/rearg.js ***!
\***************************/
function(e,t,n){var r=n(/*! ./_createWrap */93),o=n(/*! ./_flatRest */94),a=256,l=o(function(e,t){return r(e,a,void 0,void 0,void 0,t)});e.exports=l},/*!***************************!*\
!*** ./~/lodash/round.js ***!
\***************************/
function(e,t,n){var r=n(/*! ./_createRound */548),o=r("round");e.exports=o},/*!****************************!*\
!*** ./~/lodash/sortBy.js ***!
\****************************/
function(e,t,n){var r=n(/*! ./_baseFlatten */85),o=n(/*! ./_baseOrderBy */507),a=n(/*! ./_baseRest */35),l=n(/*! ./_isIterateeCall */97),u=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&l(e,t[0],t[1])?t=[]:n>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=u},/*!*******************************!*\
!*** ./~/lodash/startCase.js ***!
\*******************************/
function(e,t,n){var r=n(/*! ./_createCompounder */543),o=n(/*! ./upperFirst */654),a=r(function(e,t,n){return e+(n?" ":"")+o(t)});e.exports=a},/*!*******************************!*\
!*** ./~/lodash/stubFalse.js ***!
\*******************************/
function(e,t){function n(){return!1}e.exports=n},/*!*************************!*\
!*** ./~/lodash/sum.js ***!
\*************************/
function(e,t,n){function r(e){return e&&e.length?o(e,a):0}var o=n(/*! ./_baseSum */518),a=n(/*! ./identity */37);e.exports=r},/*!**************************!*\
!*** ./~/lodash/take.js ***!
\**************************/
function(e,t,n){function r(e,t,n){return e&&e.length?(t=n||void 0===t?1:a(t),o(e,0,t<0?0:t)):[]}var o=n(/*! ./_baseSlice */88),a=n(/*! ./toInteger */28);e.exports=r},/*!****************************!*\
!*** ./~/lodash/toPath.js ***!
\****************************/
function(e,t,n){function r(e){return l(e)?o(e,i):u(e)?[e]:a(s(c(e)))}var o=n(/*! ./_arrayMap */26),a=n(/*! ./_copyArray */91),l=n(/*! ./isArray */12),u=n(/*! ./isSymbol */45),s=n(/*! ./_stringToPath */321),i=n(/*! ./_toKey */36),c=n(/*! ./toString */29);e.exports=r},/*!*******************************!*\
!*** ./~/lodash/transform.js ***!
\*******************************/
function(e,t,n){function r(e,t,n){var r=i(e),y=r||c(e)||f(e);if(t=u(t,4),null==n){var m=e&&e.constructor;n=y?r?new m:[]:p(e)&&d(m)?a(s(e)):{}}return(y?o:l)(e,function(e,r,o){return t(n,e,r,o)}),n}var o=n(/*! ./_arrayEach */60),a=n(/*! ./_baseCreate */61),l=n(/*! ./_baseForOwn */159),u=n(/*! ./_baseIteratee */22),s=n(/*! ./_getPrototype */96),i=n(/*! ./isArray */12),c=n(/*! ./isBuffer */65),d=n(/*! ./isFunction */38),p=n(/*! ./isObject */19),f=n(/*! ./isTypedArray */104);e.exports=r},/*!**************************!*\
!*** ./~/lodash/trim.js ***!
\**************************/
function(e,t,n){function r(e,t,n){if(e=i(e),e&&(n||void 0===t))return e.replace(c,"");if(!e||!(t=o(t)))return e;var r=s(e),d=s(t),p=u(r,d),f=l(r,d)+1;return a(r,p,f).join("")}var o=n(/*! ./_baseToString */163),a=n(/*! ./_castSlice */295),l=n(/*! ./_charsEndIndex */523),u=n(/*! ./_charsStartIndex */524),s=n(/*! ./_stringToArray */320),i=n(/*! ./toString */29),c=/^\s+|\s+$/g;e.exports=r},/*!***************************!*\
!*** ./~/lodash/union.js ***!
\***************************/
function(e,t,n){var r=n(/*! ./_baseFlatten */85),o=n(/*! ./_baseRest */35),a=n(/*! ./_baseUniq */519),l=n(/*! ./isArrayLikeObject */102),u=o(function(e){return a(r(e,1,l,!0))});e.exports=u},/*!********************************!*\
!*** ./~/lodash/upperFirst.js ***!
\********************************/
function(e,t,n){var r=n(/*! ./_createCaseFirst */542),o=r("toUpperCase");e.exports=o},/*!***************************!*\
!*** ./~/lodash/words.js ***!
\***************************/
function(e,t,n){function r(e,t,n){return e=l(e),t=n?void 0:t,void 0===t?a(e)?u(e):o(e):e.match(t)||[]}var o=n(/*! ./_asciiWords */486),a=n(/*! ./_hasUnicodeWord */558),l=n(/*! ./toString */29),u=n(/*! ./_unicodeWords */598);e.exports=r},/*!***********************************!*\
!*** ./~/lodash/wrapperLodash.js ***!
\***********************************/
function(e,t,n){function r(e){if(s(e)&&!u(e)&&!(e instanceof o)){if(e instanceof a)return e;if(d.call(e,"__wrapped__"))return i(e)}return new a(e)}var o=n(/*! ./_LazyWrapper */150),a=n(/*! ./_LodashWrapper */151),l=n(/*! ./_baseLodash */162),u=n(/*! ./isArray */12),s=n(/*! ./isObjectLike */24),i=n(/*! ./_wrapperClone */600),c=Object.prototype,d=c.hasOwnProperty;r.prototype=l.prototype,r.prototype.constructor=r,e.exports=r},/*!***********************!*\
!*** ./~/ms/index.js ***!
\***********************/
function(e,t){function n(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"days":case"day":case"d":return n*i;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(e){return e>=i?Math.round(e/i)+"d":e>=s?Math.round(e/s)+"h":e>=u?Math.round(e/u)+"m":e>=l?Math.round(e/l)+"s":e+"ms"}function o(e){return a(e,i,"day")||a(e,s,"hour")||a(e,u,"minute")||a(e,l,"second")||e+" ms"}function a(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var l=1e3,u=60*l,s=60*u,i=24*s,c=365.25*i;e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return n(e);if("number"===a&&isNaN(e)===!1)return t.long?o(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},/*!***************************!*\
!*** external "ReactDOM" ***!
\***************************/
function(e,n){e.exports=t}])}); |
ajax/libs/algoliasearch.zendesk-hc/2.0.0/algoliasearch.zendesk-hc.min.js | holtkamp/cdnjs | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.algoliasearchZendeskHC=e()}}(function(){var e;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(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 i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("./src/index.js"),o=r(i);t.exports=o["default"]},{"./src/index.js":819}],2:[function(e,t,n){function r(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function i(e){return e>=c?Math.round(e/c)+"d":e>=l?Math.round(e/l)+"h":e>=u?Math.round(e/u)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function o(e){return a(e,c,"day")||a(e,l,"hour")||a(e,u,"minute")||a(e,s,"second")||e+" ms"}function a(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,u=60*s,l=60*u,c=24*l,f=365.25*c;t.exports=function(e,t){return t=t||{},"string"==typeof e?r(e):t["long"]?o(e):i(e)}},{}],3:[function(e,t,n){"use strict";function r(e,t,n){return new i(e,t,n)}var i=e("./src/algoliasearch.helper"),o=e("./src/SearchParameters"),a=e("./src/SearchResults");r.version=e("./src/version.js"),r.AlgoliaSearchHelper=i,r.SearchParameters=o,r.SearchResults=a,r.url=e("./src/url"),t.exports=r},{"./src/SearchParameters":165,"./src/SearchResults":168,"./src/algoliasearch.helper":169,"./src/url":175,"./src/version.js":176}],4:[function(e,t,n){function r(e){for(var t=-1,n=e?e.length:0,r=-1,i=[];++t<n;){var o=e[t];o&&(i[++r]=o)}return i}t.exports=r},{}],5:[function(e,t,n){var r=e("../internal/createFindIndex"),i=r();t.exports=i},{"../internal/createFindIndex":90}],6:[function(e,t,n){function r(e,t,n){var r=e?e.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?a(r+n,0):n;else if(n){var s=o(e,t);return r>s&&(t===t?t===e[s]:e[s]!==e[s])?s:-1}return i(e,t,n||0)}var i=e("../internal/baseIndexOf"),o=e("../internal/binaryIndex"),a=Math.max;t.exports=r},{"../internal/baseIndexOf":52,"../internal/binaryIndex":72}],7:[function(e,t,n){var r=e("../internal/baseIndexOf"),i=e("../internal/cacheIndexOf"),o=e("../internal/createCache"),a=e("../internal/isArrayLike"),s=e("../function/restParam"),u=s(function(e){for(var t=e.length,n=t,s=Array(h),u=r,l=!0,c=[];n--;){var f=e[n]=a(f=e[n])?f:[];s[n]=l&&f.length>=120?o(n&&f):null}var p=e[0],d=-1,h=p?p.length:0,m=s[0];e:for(;++d<h;)if(f=p[d],(m?i(m,f):u(c,f,0))<0){for(var n=t;--n;){var v=s[n];if((v?i(v,f):u(e[n],f,0))<0)continue e}m&&m.push(f),c.push(f)}return c});t.exports=u},{"../function/restParam":23,"../internal/baseIndexOf":52,"../internal/cacheIndexOf":75,"../internal/createCache":86,"../internal/isArrayLike":108}],8:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],9:[function(e,t,n){function r(e){if(u(e)&&!s(e)&&!(e instanceof i)){if(e instanceof o)return e;if(f.call(e,"__chain__")&&f.call(e,"__wrapped__"))return l(e)}return new o(e)}var i=e("../internal/LazyWrapper"),o=e("../internal/LodashWrapper"),a=e("../internal/baseLodash"),s=e("../lang/isArray"),u=e("../internal/isObjectLike"),l=e("../internal/wrapperClone"),c=Object.prototype,f=c.hasOwnProperty;r.prototype=a.prototype,t.exports=r},{"../internal/LazyWrapper":24,"../internal/LodashWrapper":25,"../internal/baseLodash":56,"../internal/isObjectLike":114,"../internal/wrapperClone":131,"../lang/isArray":133}],10:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return t=o(t,n,3),r(e,t)}var i=e("../internal/arrayFilter"),o=e("../internal/baseCallback"),a=e("../internal/baseFilter"),s=e("../lang/isArray");t.exports=r},{"../internal/arrayFilter":29,"../internal/baseCallback":38,"../internal/baseFilter":44,"../lang/isArray":133}],11:[function(e,t,n){var r=e("../internal/baseEach"),i=e("../internal/createFind"),o=i(r);t.exports=o},{"../internal/baseEach":43,"../internal/createFind":89}],12:[function(e,t,n){var r=e("../internal/arrayEach"),i=e("../internal/baseEach"),o=e("../internal/createForEach"),a=o(r,i);t.exports=a},{"../internal/arrayEach":28,"../internal/baseEach":43,"../internal/createForEach":91}],13:[function(e,t,n){function r(e,t,n,r){var p=e?o(e):0;return u(p)||(e=c(e),p=e.length),n="number"!=typeof n||r&&s(t,n,r)?0:0>n?f(p+n,0):n||0,"string"==typeof e||!a(e)&&l(e)?p>=n&&e.indexOf(t,n)>-1:!!p&&i(e,t,n)>-1}var i=e("../internal/baseIndexOf"),o=e("../internal/getLength"),a=e("../lang/isArray"),s=e("../internal/isIterateeCall"),u=e("../internal/isLength"),l=e("../lang/isString"),c=e("../object/values"),f=Math.max;t.exports=r},{"../internal/baseIndexOf":52,"../internal/getLength":104,"../internal/isIterateeCall":110,"../internal/isLength":113,"../lang/isArray":133,"../lang/isString":141,"../object/values":158}],14:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return t=o(t,n,3),r(e,t)}var i=e("../internal/arrayMap"),o=e("../internal/baseCallback"),a=e("../internal/baseMap"),s=e("../lang/isArray");t.exports=r},{"../internal/arrayMap":30,"../internal/baseCallback":38,"../internal/baseMap":57,"../lang/isArray":133}],15:[function(e,t,n){function r(e,t){return i(e,o(t))}var i=e("./map"),o=e("../utility/property");t.exports=r},{"../utility/property":162,"./map":14}],16:[function(e,t,n){var r=e("../internal/arrayReduce"),i=e("../internal/baseEach"),o=e("../internal/createReduce"),a=o(r,i);t.exports=a},{"../internal/arrayReduce":32,"../internal/baseEach":43,"../internal/createReduce":97}],17:[function(e,t,n){function r(e,t,n,r){return null==e?[]:(r&&a(t,n,r)&&(n=void 0),o(t)||(t=null==t?[]:[t]),o(n)||(n=null==n?[]:[n]),i(e,t,n))}var i=e("../internal/baseSortByOrder"),o=e("../lang/isArray"),a=e("../internal/isIterateeCall");t.exports=r},{"../internal/baseSortByOrder":68,"../internal/isIterateeCall":110,"../lang/isArray":133}],18:[function(e,t,n){t.exports=e("../math/sum")},{"../math/sum":145}],19:[function(e,t,n){var r=e("../internal/getNative"),i=r(Date,"now"),o=i||function(){return(new Date).getTime()};t.exports=o},{"../internal/getNative":106}],20:[function(e,t,n){var r=e("../internal/createWrapper"),i=e("../internal/replaceHolders"),o=e("./restParam"),a=1,s=32,u=o(function(e,t,n){var o=a;if(n.length){var l=i(n,u.placeholder);o|=s}return r(e,o,t,n,l)});u.placeholder={},t.exports=u},{"../internal/createWrapper":98,"../internal/replaceHolders":123,"./restParam":23}],21:[function(e,t,n){var r=e("../internal/createPartial"),i=32,o=r(i);o.placeholder={},t.exports=o},{"../internal/createPartial":95}],22:[function(e,t,n){var r=e("../internal/createPartial"),i=64,o=r(i);o.placeholder={},t.exports=o},{"../internal/createPartial":95}],23:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(i);return t=o(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=o(n.length-t,0),a=Array(i);++r<i;)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 s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var i="Expected a function",o=Math.max;t.exports=r},{}],24:[function(e,t,n){function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}var i=e("./baseCreate"),o=e("./baseLodash"),a=Number.POSITIVE_INFINITY;r.prototype=i(o.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":41,"./baseLodash":56}],25:[function(e,t,n){function r(e,t,n){this.__wrapped__=e,this.__actions__=n||[],this.__chain__=!!t}var i=e("./baseCreate"),o=e("./baseLodash");r.prototype=i(o.prototype),r.prototype.constructor=r,t.exports=r},{"./baseCreate":41,"./baseLodash":56}],26:[function(e,t,n){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=e("./cachePush"),o=e("./getNative"),a=o(n,"Set"),s=o(Object,"create");r.prototype.push=i,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cachePush":76,"./getNative":106}],27:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],28:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],29:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[++i]=a)}return o}t.exports=r},{}],30:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],31:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=r},{}],32:[function(e,t,n){function r(e,t,n,r){var i=-1,o=e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}t.exports=r},{}],33:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],34:[function(e,t,n){function r(e,t){for(var n=e.length,r=0;n--;)r+=+t(e[n])||0;return r}t.exports=r},{}],35:[function(e,t,n){function r(e,t){return void 0===e?t:e}t.exports=r},{}],36:[function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],u=e[s],l=n(u,t[s],s,e,t);(l===l?l===u:u!==u)&&(void 0!==u||s in e)||(e[s]=l)}return e}var i=e("../object/keys");t.exports=r},{"../object/keys":150}],37:[function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=e("./baseCopy"),o=e("../object/keys");t.exports=r},{"../object/keys":150,"./baseCopy":40}],38:[function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:a(e,t,n):null==e?s:"object"==r?i(e):void 0===t?u(e):o(e,t)}var i=e("./baseMatches"),o=e("./baseMatchesProperty"),a=e("./bindCallback"),s=e("../utility/identity"),u=e("../utility/property");t.exports=r},{"../utility/identity":160,"../utility/property":162,"./baseMatches":58,"./baseMatchesProperty":59,"./bindCallback":74}],39:[function(e,t,n){function r(e,t){if(e!==t){var n=null===e,r=void 0===e,i=e===e,o=null===t,a=void 0===t,s=t===t;if(e>t&&!o||!i||n&&!a&&s||r&&s)return 1;if(t>e&&!n||!s||o&&!r&&i||a&&i)return-1}return 0}t.exports=r},{}],40:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}t.exports=r},{}],41:[function(e,t,n){var r=e("../lang/isObject"),i=function(){function e(){}return function(t){if(r(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}();t.exports=i},{"../lang/isObject":139}],42:[function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var u=-1,l=i,c=!0,f=c&&t.length>=s?a(t):null,p=t.length;f&&(l=o,c=!1,t=f);e:for(;++u<n;){var d=e[u];if(c&&d===d){for(var h=p;h--;)if(t[h]===d)continue e;r.push(d)}else l(t,d,0)<0&&r.push(d)}return r}var i=e("./baseIndexOf"),o=e("./cacheIndexOf"),a=e("./createCache"),s=200;t.exports=r},{"./baseIndexOf":52,"./cacheIndexOf":75,"./createCache":86}],43:[function(e,t,n){var r=e("./baseForOwn"),i=e("./createBaseEach"),o=i(r);t.exports=o},{"./baseForOwn":50,"./createBaseEach":83}],44:[function(e,t,n){function r(e,t){var n=[];return i(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var i=e("./baseEach");t.exports=r},{"./baseEach":43}],45:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,o){return t(e,n,o)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],46:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],47:[function(e,t,n){function r(e,t,n,l){l||(l=[]);for(var c=-1,f=e.length;++c<f;){var p=e[c];u(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,l):i(l,p):n||(l[l.length]=p)}return l}var i=e("./arrayPush"),o=e("../lang/isArguments"),a=e("../lang/isArray"),s=e("./isArrayLike"),u=e("./isObjectLike");t.exports=r},{"../lang/isArguments":132,"../lang/isArray":133,"./arrayPush":31,"./isArrayLike":108,"./isObjectLike":114}],48:[function(e,t,n){var r=e("./createBaseFor"),i=r();t.exports=i},{"./createBaseFor":84}],49:[function(e,t,n){function r(e,t){return i(e,t,o)}var i=e("./baseFor"),o=e("../object/keysIn");t.exports=r},{"../object/keysIn":151,"./baseFor":48}],50:[function(e,t,n){function r(e,t){return i(e,t,o)}var i=e("./baseFor"),o=e("../object/keys");t.exports=r},{"../object/keys":150,"./baseFor":48}],51:[function(e,t,n){function r(e,t,n){if(null!=e){void 0!==n&&n in i(e)&&(t=[n]);for(var r=0,o=t.length;null!=e&&o>r;)e=e[t[r++]];return r&&r==o?e:void 0}}var i=e("./toObject");t.exports=r},{"./toObject":127}],52:[function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=e("./indexOfNaN");t.exports=r},{"./indexOfNaN":107}],53:[function(e,t,n){function r(e,t,n,s,u,l){return e===t?!0:null==e||null==t||!o(e)&&!a(t)?e!==e&&t!==t:i(e,t,r,n,s,u,l)}var i=e("./baseIsEqualDeep"),o=e("../lang/isObject"),a=e("./isObjectLike");t.exports=r},{"../lang/isObject":139,"./baseIsEqualDeep":54,"./isObjectLike":114}],54:[function(e,t,n){function r(e,t,n,r,p,m,v){var y=s(e),g=s(t),b=c,_=c;y||(b=h.call(e),b==l?b=f:b!=f&&(y=u(e))),g||(_=h.call(t),_==l?_=f:_!=f&&(g=u(t)));var j=b==f,w=_==f,C=b==_;if(C&&!y&&!j)return o(e,t,b);if(!p){var x=j&&d.call(e,"__wrapped__"),E=w&&d.call(t,"__wrapped__");if(x||E)return n(x?e.value():e,E?t.value():t,r,p,m,v)}if(!C)return!1;m||(m=[]),v||(v=[]);for(var R=m.length;R--;)if(m[R]==e)return v[R]==t;m.push(e),v.push(t);var O=(y?i:a)(e,t,n,r,p,m,v);return m.pop(),v.pop(),O}var i=e("./equalArrays"),o=e("./equalByTag"),a=e("./equalObjects"),s=e("../lang/isArray"),u=e("../lang/isTypedArray"),l="[object Arguments]",c="[object Array]",f="[object Object]",p=Object.prototype,d=p.hasOwnProperty,h=p.toString;t.exports=r},{"../lang/isArray":133,"../lang/isTypedArray":142,"./equalArrays":99,"./equalByTag":100,"./equalObjects":101}],55:[function(e,t,n){function r(e,t,n){var r=t.length,a=r,s=!n;if(null==e)return!a;for(e=o(e);r--;){var u=t[r];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++r<a;){u=t[r];var l=u[0],c=e[l],f=u[1];if(s&&u[2]){if(void 0===c&&!(l in e))return!1}else{var p=n?n(c,f,l):void 0;if(!(void 0===p?i(f,c,n,!0):p))return!1}}return!0}var i=e("./baseIsEqual"),o=e("./toObject");t.exports=r},{"./baseIsEqual":53,"./toObject":127}],56:[function(e,t,n){function r(){}t.exports=r},{}],57:[function(e,t,n){function r(e,t){var n=-1,r=o(e)?Array(e.length):[];return i(e,function(e,i,o){r[++n]=t(e,i,o)}),r}var i=e("./baseEach"),o=e("./isArrayLike");t.exports=r},{"./baseEach":43,"./isArrayLike":108}],58:[function(e,t,n){function r(e){var t=o(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:e[n]===r&&(void 0!==r||n in a(e))}}return function(e){return i(e,t)}}var i=e("./baseIsMatch"),o=e("./getMatchData"),a=e("./toObject");t.exports=r},{"./baseIsMatch":55,"./getMatchData":105,"./toObject":127}],59:[function(e,t,n){function r(e,t){var n=s(e),r=u(e)&&l(t),d=e+"";return e=p(e),function(s){if(null==s)return!1;var u=d;if(s=f(s),(n||!r)&&!(u in s)){if(s=1==e.length?s:i(s,a(e,0,-1)),null==s)return!1;u=c(e),s=f(s)}return s[u]===t?void 0!==t||u in s:o(t,s[u],void 0,!0)}}var i=e("./baseGet"),o=e("./baseIsEqual"),a=e("./baseSlice"),s=e("../lang/isArray"),u=e("./isKey"),l=e("./isStrictComparable"),c=e("../array/last"),f=e("./toObject"),p=e("./toPath");t.exports=r},{"../array/last":8,"../lang/isArray":133,"./baseGet":51,"./baseIsEqual":53,"./baseSlice":66,"./isKey":111,"./isStrictComparable":116,"./toObject":127,"./toPath":128}],60:[function(e,t,n){function r(e,t,n,p,d){if(!u(e))return e;var h=s(t)&&(a(t)||c(t)),m=h?void 0:f(t);return i(m||t,function(i,a){if(m&&(a=i,i=t[a]),l(i))p||(p=[]),d||(d=[]),o(e,t,a,r,n,p,d);else{var s=e[a],u=n?n(s,i,a,e,t):void 0,c=void 0===u;c&&(u=i),void 0===u&&(!h||a in e)||!c&&(u===u?u===s:s!==s)||(e[a]=u)}}),e}var i=e("./arrayEach"),o=e("./baseMergeDeep"),a=e("../lang/isArray"),s=e("./isArrayLike"),u=e("../lang/isObject"),l=e("./isObjectLike"),c=e("../lang/isTypedArray"),f=e("../object/keys");t.exports=r},{"../lang/isArray":133,"../lang/isObject":139,"../lang/isTypedArray":142,"../object/keys":150,"./arrayEach":28,"./baseMergeDeep":61,"./isArrayLike":108,"./isObjectLike":114}],61:[function(e,t,n){function r(e,t,n,r,f,p,d){for(var h=p.length,m=t[n];h--;)if(p[h]==m)return void(e[n]=d[h]);var v=e[n],y=f?f(v,m,n,e,t):void 0,g=void 0===y;g&&(y=m,s(m)&&(a(m)||l(m))?y=a(v)?v:s(v)?i(v):[]:u(m)||o(m)?y=o(v)?c(v):u(v)?v:{}:g=!1),p.push(m),d.push(y),g?e[n]=r(y,m,f,p,d):(y===y?y!==v:v===v)&&(e[n]=y)}var i=e("./arrayCopy"),o=e("../lang/isArguments"),a=e("../lang/isArray"),s=e("./isArrayLike"),u=e("../lang/isPlainObject"),l=e("../lang/isTypedArray"),c=e("../lang/toPlainObject");t.exports=r},{"../lang/isArguments":132,"../lang/isArray":133,"../lang/isPlainObject":140,"../lang/isTypedArray":142,"../lang/toPlainObject":144,"./arrayCopy":27,"./isArrayLike":108}],62:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}t.exports=r},{}],63:[function(e,t,n){function r(e){var t=e+"";return e=o(e),function(n){return i(n,e,t)}}var i=e("./baseGet"),o=e("./toPath");t.exports=r},{"./baseGet":51,"./toPath":128}],64:[function(e,t,n){function r(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}t.exports=r},{}],65:[function(e,t,n){var r=e("../utility/identity"),i=e("./metaMap"),o=i?function(e,t){return i.set(e,t),e}:r;t.exports=o},{"../utility/identity":160,"./metaMap":118}],66:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}t.exports=r},{}],67:[function(e,t,n){function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=r},{}],68:[function(e,t,n){function r(e,t,n){var r=-1;t=i(t,function(e){return o(e)});var l=a(e,function(e){var n=i(t,function(t){return t(e)});return{criteria:n,index:++r,value:e}});return s(l,function(e,t){return u(e,t,n)})}var i=e("./arrayMap"),o=e("./baseCallback"),a=e("./baseMap"),s=e("./baseSortBy"),u=e("./compareMultiple");t.exports=r},{"./arrayMap":30,"./baseCallback":38,"./baseMap":57,"./baseSortBy":67,"./compareMultiple":79}],69:[function(e,t,n){function r(e,t){var n=0;return i(e,function(e,r,i){n+=+t(e,r,i)||0}),n}var i=e("./baseEach");t.exports=r},{"./baseEach":43}],70:[function(e,t,n){function r(e){return null==e?"":e+""}t.exports=r},{}],71:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e[t[n]];return i}t.exports=r},{}],72:[function(e,t,n){function r(e,t,n){var r=0,a=e?e.length:r;if("number"==typeof t&&t===t&&s>=a){for(;a>r;){var u=r+a>>>1,l=e[u];(n?t>=l:t>l)&&null!==l?r=u+1:a=u}return a}return i(e,t,o,n)}var i=e("./binaryIndexBy"),o=e("../utility/identity"),a=4294967295,s=a>>>1;t.exports=r},{"../utility/identity":160,"./binaryIndexBy":73}],73:[function(e,t,n){function r(e,t,n,r){t=n(t);for(var a=0,u=e?e.length:0,l=t!==t,c=null===t,f=void 0===t;u>a;){var p=i((a+u)/2),d=n(e[p]),h=void 0!==d,m=d===d;if(l)var v=m||r;else v=c?m&&h&&(r||null!=d):f?m&&(r||h):null==d?!1:r?t>=d:t>d;v?a=p+1:u=p}return o(u,s)}var i=Math.floor,o=Math.min,a=4294967295,s=a-1;t.exports=r},{}],74:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=e("../utility/identity");t.exports=r},{"../utility/identity":160}],75:[function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":139}],76:[function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":139}],77:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t.indexOf(e.charAt(n))>-1;);return n}t.exports=r},{}],78:[function(e,t,n){function r(e,t){for(var n=e.length;n--&&t.indexOf(e.charAt(n))>-1;);return n}t.exports=r},{}],79:[function(e,t,n){function r(e,t,n){for(var r=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++r<s;){var l=i(o[r],a[r]);if(l){if(r>=u)return l;var c=n[r];return l*("asc"===c||c===!0?1:-1)}}return e.index-t.index}var i=e("./baseCompareAscending");t.exports=r},{"./baseCompareAscending":39}],80:[function(e,t,n){function r(e,t,n){for(var r=n.length,o=-1,a=i(e.length-r,0),s=-1,u=t.length,l=Array(u+a);++s<u;)l[s]=t[s];for(;++o<r;)l[n[o]]=e[o];for(;a--;)l[s++]=e[o++];return l}var i=Math.max;t.exports=r},{}],81:[function(e,t,n){function r(e,t,n){for(var r=-1,o=n.length,a=-1,s=i(e.length-o,0),u=-1,l=t.length,c=Array(s+l);++a<s;)c[a]=e[a];for(var f=a;++u<l;)c[f+u]=t[u];for(;++r<o;)c[f+n[r]]=e[a++];return c}var i=Math.max;t.exports=r},{}],82:[function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,u=a>2?n[2]:void 0,l=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,l,5),a-=2):(s="function"==typeof l?l:void 0,a-=s?1:0),u&&o(n[0],n[1],u)&&(s=3>a?void 0:s,a=1);++r<a;){var c=n[r];c&&e(t,c,s)}return t})}var i=e("./bindCallback"),o=e("./isIterateeCall"),a=e("../function/restParam");t.exports=r},{"../function/restParam":23,"./bindCallback":74,"./isIterateeCall":110}],83:[function(e,t,n){function r(e,t){return function(n,r){var s=n?i(n):0;if(!o(s))return e(n,r);for(var u=t?s:-1,l=a(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}var i=e("./getLength"),o=e("./isLength"),a=e("./toObject");t.exports=r},{"./getLength":104,"./isLength":113,"./toObject":127}],84:[function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,u=e?s:-1;e?u--:++u<s;){var l=a[u];if(n(o[l],l,o)===!1)break}return t}}var i=e("./toObject");t.exports=r},{"./toObject":127}],85:[function(e,t,n){(function(n){function r(e,t){function r(){var i=this&&this!==n&&this instanceof r?o:e;return i.apply(t,arguments)}var o=i(e);return r}var i=e("./createCtorWrapper");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":87}],86:[function(e,t,n){(function(n){function r(e){return s&&a?new i(e):null}var i=e("./SetCache"),o=e("./getNative"),a=o(n,"Set"),s=o(Object,"create");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./SetCache":26,"./getNative":106}],87:[function(e,t,n){function r(e){return function(){var t=arguments;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]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=i(e.prototype),r=e.apply(n,t);return o(r)?r:n}}var i=e("./baseCreate"),o=e("../lang/isObject");t.exports=r},{"../lang/isObject":139,"./baseCreate":41}],88:[function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=e("../function/restParam");t.exports=r},{"../function/restParam":23}],89:[function(e,t,n){function r(e,t){return function(n,r,u){if(r=i(r,u,3),s(n)){var l=a(n,r,t);return l>-1?n[l]:void 0}return o(n,r,e)}}var i=e("./baseCallback"),o=e("./baseFind"),a=e("./baseFindIndex"),s=e("../lang/isArray");t.exports=r},{"../lang/isArray":133,"./baseCallback":38,"./baseFind":45,"./baseFindIndex":46}],90:[function(e,t,n){function r(e){return function(t,n,r){return t&&t.length?(n=i(n,r,3),o(t,n,e)):-1}}var i=e("./baseCallback"),o=e("./baseFindIndex");t.exports=r},{"./baseCallback":38,"./baseFindIndex":46}],91:[function(e,t,n){function r(e,t){return function(n,r,a){return"function"==typeof r&&void 0===a&&o(n)?e(n,r):t(n,i(r,a,3))}}var i=e("./bindCallback"),o=e("../lang/isArray");t.exports=r},{"../lang/isArray":133,"./bindCallback":74}],92:[function(e,t,n){function r(e){return function(t,n,r){return"function"==typeof n&&void 0===r||(n=i(n,r,3)),e(t,n)}}var i=e("./bindCallback");t.exports=r},{"./bindCallback":74}],93:[function(e,t,n){(function(n){function r(e,t,j,w,C,x,E,R,O,P){function S(){for(var h=arguments.length,m=h,v=Array(h);m--;)v[m]=arguments[m];if(w&&(v=o(v,w,C)),x&&(v=a(v,x,E)),M||I){var b=S.placeholder,F=c(v,b);if(h-=F.length,P>h){var L=R?i(R):void 0,U=_(P-h,0),H=M?F:void 0,B=M?void 0:F,q=M?v:void 0,V=M?void 0:v;t|=M?y:g,t&=~(M?g:y),N||(t&=~(p|d));var W=[e,t,j,q,H,V,B,L,O,U],K=r.apply(void 0,W);return u(e)&&f(K,W),K.placeholder=b,K}}var $=A?j:this,z=T?$[e]:e;return R&&(v=l(v,R)),k&&O<v.length&&(v.length=O),this&&this!==n&&this instanceof S&&(z=D||s(e)),z.apply($,v)}var k=t&b,A=t&p,T=t&d,M=t&m,N=t&h,I=t&v,D=T?void 0:s(e);return S}var i=e("./arrayCopy"),o=e("./composeArgs"),a=e("./composeArgsRight"),s=e("./createCtorWrapper"),u=e("./isLaziable"),l=e("./reorder"),c=e("./replaceHolders"),f=e("./setData"),p=1,d=2,h=4,m=8,v=16,y=32,g=64,b=128,_=Math.max;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./arrayCopy":27,"./composeArgs":80,"./composeArgsRight":81,"./createCtorWrapper":87,"./isLaziable":112,"./reorder":122,"./replaceHolders":123,"./setData":124}],94:[function(e,t,n){function r(e){return function(t,n,r){var a={};return n=i(n,r,3),o(t,function(t,r,i){var o=n(t,r,i);r=e?o:r,t=e?t:o,a[r]=t}),a}}var i=e("./baseCallback"),o=e("./baseForOwn");t.exports=r},{"./baseCallback":38,"./baseForOwn":50}],95:[function(e,t,n){function r(e){var t=a(function(n,r){var a=o(r,t.placeholder);return i(n,e,void 0,r,a)});return t}var i=e("./createWrapper"),o=e("./replaceHolders"),a=e("../function/restParam");t.exports=r},{"../function/restParam":23,"./createWrapper":98,"./replaceHolders":123}],96:[function(e,t,n){(function(n){function r(e,t,r,a){function s(){for(var t=-1,i=arguments.length,o=-1,c=a.length,f=Array(c+i);++o<c;)f[o]=a[o];for(;i--;)f[o++]=arguments[++t];var p=this&&this!==n&&this instanceof s?l:e;return p.apply(u?r:this,f)}var u=t&o,l=i(e);return s}var i=e("./createCtorWrapper"),o=1;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":87}],97:[function(e,t,n){function r(e,t){return function(n,r,s,u){var l=arguments.length<3;return"function"==typeof r&&void 0===u&&a(n)?e(n,r,s,l):o(n,i(r,u,4),s,l,t)}}var i=e("./baseCallback"),o=e("./baseReduce"),a=e("../lang/isArray");t.exports=r},{"../lang/isArray":133,"./baseCallback":38,"./baseReduce":64}],98:[function(e,t,n){function r(e,t,n,r,y,g,b,_){var j=t&p;if(!j&&"function"!=typeof e)throw new TypeError(m);var w=r?r.length:0;if(w||(t&=~(d|h),r=y=void 0),w-=y?y.length:0,t&h){var C=r,x=y;r=y=void 0}var E=j?void 0:u(e),R=[e,t,n,r,y,C,x,g,b,_];if(E&&(l(R,E),t=R[1],_=R[9]),R[9]=null==_?j?0:e.length:v(_-w,0)||0,t==f)var O=o(R[0],R[2]);else O=t!=d&&t!=(f|d)||R[4].length?a.apply(void 0,R):s.apply(void 0,R);var P=E?i:c;return P(O,R)}var i=e("./baseSetData"),o=e("./createBindWrapper"),a=e("./createHybridWrapper"),s=e("./createPartialWrapper"),u=e("./getData"),l=e("./mergeData"),c=e("./setData"),f=1,p=2,d=32,h=64,m="Expected a function",v=Math.max;t.exports=r},{"./baseSetData":65,"./createBindWrapper":85,"./createHybridWrapper":93,"./createPartialWrapper":96,"./getData":102,"./mergeData":117,"./setData":124}],99:[function(e,t,n){function r(e,t,n,r,o,a,s){var u=-1,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;for(;++u<l;){var f=e[u],p=t[u],d=r?r(o?p:f,o?f:p,u):void 0;if(void 0!==d){if(d)continue;return!1}if(o){if(!i(t,function(e){return f===e||n(f,e,r,o,a,s)}))return!1}else if(f!==p&&!n(f,p,r,o,a,s))return!1}return!0}var i=e("./arraySome");t.exports=r},{"./arraySome":33}],100:[function(e,t,n){function r(e,t,n){switch(n){case i:case o:return+e==+t;case a:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:e==+t;case u:case l:return e==t+""}return!1}var i="[object Boolean]",o="[object Date]",a="[object Error]",s="[object Number]",u="[object RegExp]",l="[object String]";t.exports=r},{}],101:[function(e,t,n){function r(e,t,n,r,o,s,u){var l=i(e),c=l.length,f=i(t),p=f.length;if(c!=p&&!o)return!1;for(var d=c;d--;){var h=l[d];if(!(o?h in t:a.call(t,h)))return!1}for(var m=o;++d<c;){h=l[d];var v=e[h],y=t[h],g=r?r(o?y:v,o?v:y,h):void 0;if(!(void 0===g?n(v,y,r,o,s,u):g))return!1;m||(m="constructor"==h)}if(!m){var b=e.constructor,_=t.constructor;if(b!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _))return!1}return!0}var i=e("../object/keys"),o=Object.prototype,a=o.hasOwnProperty;t.exports=r},{"../object/keys":150}],102:[function(e,t,n){var r=e("./metaMap"),i=e("../utility/noop"),o=r?function(e){return r.get(e)}:i;t.exports=o},{"../utility/noop":161,"./metaMap":118}],103:[function(e,t,n){function r(e){for(var t=e.name+"",n=i[t],r=n?n.length:0;r--;){var o=n[r],a=o.func;if(null==a||a==e)return o.name}return t}var i=e("./realNames");t.exports=r},{"./realNames":121}],104:[function(e,t,n){var r=e("./baseProperty"),i=r("length");t.exports=i},{"./baseProperty":62}],105:[function(e,t,n){function r(e){for(var t=o(e),n=t.length;n--;)t[n][2]=i(t[n][1]);return t}var i=e("./isStrictComparable"),o=e("../object/pairs");t.exports=r},{"../object/pairs":156,"./isStrictComparable":116}],106:[function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=e("../lang/isNative");t.exports=r},{"../lang/isNative":137}],107:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}t.exports=r},{}],108:[function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=e("./getLength"),o=e("./isLength");t.exports=r},{"./getLength":104,"./isLength":113}],109:[function(e,t,n){function r(e,t){return e="number"==typeof e||i.test(e)?+e:-1,t=null==t?o:t,e>-1&&e%1==0&&t>e}var i=/^\d+$/,o=9007199254740991;t.exports=r},{}],110:[function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=e("./isArrayLike"),o=e("./isIndex"),a=e("../lang/isObject");t.exports=r},{"../lang/isObject":139,"./isArrayLike":108,"./isIndex":109}],111:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!a.test(e);return r||null!=t&&e in o(t)}var i=e("../lang/isArray"),o=e("./toObject"),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r},{"../lang/isArray":133,"./toObject":127}],112:[function(e,t,n){function r(e){var t=a(e),n=s[t];if("function"!=typeof n||!(t in i.prototype))return!1;if(e===n)return!0;var r=o(n);return!!r&&e===r[0]}var i=e("./LazyWrapper"),o=e("./getData"),a=e("./getFuncName"),s=e("../chain/lodash");t.exports=r},{"../chain/lodash":9,"./LazyWrapper":24,"./getData":102,"./getFuncName":103}],113:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=r;
},{}],114:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],115:[function(e,t,n){function r(e){return 160>=e&&e>=9&&13>=e||32==e||160==e||5760==e||6158==e||e>=8192&&(8202>=e||8232==e||8233==e||8239==e||8287==e||12288==e||65279==e)}t.exports=r},{}],116:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":139}],117:[function(e,t,n){function r(e,t){var n=e[1],r=t[1],m=n|r,v=f>m,y=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&n==c;if(!v&&!y)return e;r&u&&(e[2]=t[2],m|=n&u?0:l);var g=t[3];if(g){var b=e[3];e[3]=b?o(b,g,t[4]):i(g),e[4]=b?s(e[3],d):i(t[4])}return g=t[5],g&&(b=e[5],e[5]=b?a(b,g,t[6]):i(g),e[6]=b?s(e[5],d):i(t[6])),g=t[7],g&&(e[7]=i(g)),r&f&&(e[8]=null==e[8]?t[8]:h(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=m,e}var i=e("./arrayCopy"),o=e("./composeArgs"),a=e("./composeArgsRight"),s=e("./replaceHolders"),u=1,l=4,c=8,f=128,p=256,d="__lodash_placeholder__",h=Math.min;t.exports=r},{"./arrayCopy":27,"./composeArgs":80,"./composeArgsRight":81,"./replaceHolders":123}],118:[function(e,t,n){(function(n){var r=e("./getNative"),i=r(n,"WeakMap"),o=i&&new i;t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getNative":106}],119:[function(e,t,n){function r(e,t){e=i(e);for(var n=-1,r=t.length,o={};++n<r;){var a=t[n];a in e&&(o[a]=e[a])}return o}var i=e("./toObject");t.exports=r},{"./toObject":127}],120:[function(e,t,n){function r(e,t){var n={};return i(e,function(e,r,i){t(e,r,i)&&(n[r]=e)}),n}var i=e("./baseForIn");t.exports=r},{"./baseForIn":49}],121:[function(e,t,n){var r={};t.exports=r},{}],122:[function(e,t,n){function r(e,t){for(var n=e.length,r=a(t.length,n),s=i(e);r--;){var u=t[r];e[r]=o(u,n)?s[u]:void 0}return e}var i=e("./arrayCopy"),o=e("./isIndex"),a=Math.min;t.exports=r},{"./arrayCopy":27,"./isIndex":109}],123:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,o=-1,a=[];++n<r;)e[n]===t&&(e[n]=i,a[++o]=n);return a}var i="__lodash_placeholder__";t.exports=r},{}],124:[function(e,t,n){var r=e("./baseSetData"),i=e("../date/now"),o=150,a=16,s=function(){var e=0,t=0;return function(n,s){var u=i(),l=a-(u-t);if(t=u,l>0){if(++e>=o)return n}else e=0;return r(n,s)}}();t.exports=s},{"../date/now":19,"./baseSetData":65}],125:[function(e,t,n){function r(e){for(var t=u(e),n=t.length,r=n&&e.length,l=!!r&&s(r)&&(o(e)||i(e)),f=-1,p=[];++f<n;){var d=t[f];(l&&a(d,r)||c.call(e,d))&&p.push(d)}return p}var i=e("../lang/isArguments"),o=e("../lang/isArray"),a=e("./isIndex"),s=e("./isLength"),u=e("../object/keysIn"),l=Object.prototype,c=l.hasOwnProperty;t.exports=r},{"../lang/isArguments":132,"../lang/isArray":133,"../object/keysIn":151,"./isIndex":109,"./isLength":113}],126:[function(e,t,n){function r(e){return null==e?[]:i(e)?o(e)?e:Object(e):a(e)}var i=e("./isArrayLike"),o=e("../lang/isObject"),a=e("../object/values");t.exports=r},{"../lang/isObject":139,"../object/values":158,"./isArrayLike":108}],127:[function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=e("../lang/isObject");t.exports=r},{"../lang/isObject":139}],128:[function(e,t,n){function r(e){if(o(e))return e;var t=[];return i(e).replace(a,function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)}),t}var i=e("./baseToString"),o=e("../lang/isArray"),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=r},{"../lang/isArray":133,"./baseToString":70}],129:[function(e,t,n){function r(e){for(var t=-1,n=e.length;++t<n&&i(e.charCodeAt(t)););return t}var i=e("./isSpace");t.exports=r},{"./isSpace":115}],130:[function(e,t,n){function r(e){for(var t=e.length;t--&&i(e.charCodeAt(t)););return t}var i=e("./isSpace");t.exports=r},{"./isSpace":115}],131:[function(e,t,n){function r(e){return e instanceof i?e.clone():new o(e.__wrapped__,e.__chain__,a(e.__actions__))}var i=e("./LazyWrapper"),o=e("./LodashWrapper"),a=e("./arrayCopy");t.exports=r},{"./LazyWrapper":24,"./LodashWrapper":25,"./arrayCopy":27}],132:[function(e,t,n){function r(e){return o(e)&&i(e)&&s.call(e,"callee")&&!u.call(e,"callee")}var i=e("../internal/isArrayLike"),o=e("../internal/isObjectLike"),a=Object.prototype,s=a.hasOwnProperty,u=a.propertyIsEnumerable;t.exports=r},{"../internal/isArrayLike":108,"../internal/isObjectLike":114}],133:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isLength"),o=e("../internal/isObjectLike"),a="[object Array]",s=Object.prototype,u=s.toString,l=r(Array,"isArray"),c=l||function(e){return o(e)&&i(e.length)&&u.call(e)==a};t.exports=c},{"../internal/getNative":106,"../internal/isLength":113,"../internal/isObjectLike":114}],134:[function(e,t,n){function r(e){return null==e?!0:a(e)&&(o(e)||l(e)||i(e)||u(e)&&s(e.splice))?!e.length:!c(e).length}var i=e("./isArguments"),o=e("./isArray"),a=e("../internal/isArrayLike"),s=e("./isFunction"),u=e("../internal/isObjectLike"),l=e("./isString"),c=e("../object/keys");t.exports=r},{"../internal/isArrayLike":108,"../internal/isObjectLike":114,"../object/keys":150,"./isArguments":132,"./isArray":133,"./isFunction":136,"./isString":141}],135:[function(e,t,n){function r(e,t,n,r){n="function"==typeof n?o(n,r,3):void 0;var a=n?n(e,t):void 0;return void 0===a?i(e,t,n):!!a}var i=e("../internal/baseIsEqual"),o=e("../internal/bindCallback");t.exports=r},{"../internal/baseIsEqual":53,"../internal/bindCallback":74}],136:[function(e,t,n){function r(e){return i(e)&&s.call(e)==o}var i=e("./isObject"),o="[object Function]",a=Object.prototype,s=a.toString;t.exports=r},{"./isObject":139}],137:[function(e,t,n){function r(e){return null==e?!1:i(e)?c.test(u.call(e)):o(e)&&a.test(e)}var i=e("./isFunction"),o=e("../internal/isObjectLike"),a=/^\[object .+?Constructor\]$/,s=Object.prototype,u=Function.prototype.toString,l=s.hasOwnProperty,c=RegExp("^"+u.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"../internal/isObjectLike":114,"./isFunction":136}],138:[function(e,t,n){function r(e){return"number"==typeof e||i(e)&&s.call(e)==o}var i=e("../internal/isObjectLike"),o="[object Number]",a=Object.prototype,s=a.toString;t.exports=r},{"../internal/isObjectLike":114}],139:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],140:[function(e,t,n){function r(e){var t;if(!a(e)||c.call(e)!=s||o(e)||!l.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||l.call(e,n)}var i=e("../internal/baseForIn"),o=e("./isArguments"),a=e("../internal/isObjectLike"),s="[object Object]",u=Object.prototype,l=u.hasOwnProperty,c=u.toString;t.exports=r},{"../internal/baseForIn":49,"../internal/isObjectLike":114,"./isArguments":132}],141:[function(e,t,n){function r(e){return"string"==typeof e||i(e)&&s.call(e)==o}var i=e("../internal/isObjectLike"),o="[object String]",a=Object.prototype,s=a.toString;t.exports=r},{"../internal/isObjectLike":114}],142:[function(e,t,n){function r(e){return o(e)&&i(e.length)&&!!S[A.call(e)]}var i=e("../internal/isLength"),o=e("../internal/isObjectLike"),a="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",v="[object Set]",y="[object String]",g="[object WeakMap]",b="[object ArrayBuffer]",_="[object Float32Array]",j="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",O="[object Uint16Array]",P="[object Uint32Array]",S={};S[_]=S[j]=S[w]=S[C]=S[x]=S[E]=S[R]=S[O]=S[P]=!0,S[a]=S[s]=S[b]=S[u]=S[l]=S[c]=S[f]=S[p]=S[d]=S[h]=S[m]=S[v]=S[y]=S[g]=!1;var k=Object.prototype,A=k.toString;t.exports=r},{"../internal/isLength":113,"../internal/isObjectLike":114}],143:[function(e,t,n){function r(e){return void 0===e}t.exports=r},{}],144:[function(e,t,n){function r(e){return i(e,o(e))}var i=e("../internal/baseCopy"),o=e("../object/keysIn");t.exports=r},{"../internal/baseCopy":40,"../object/keysIn":151}],145:[function(e,t,n){function r(e,t,n){return n&&u(e,t,n)&&(t=void 0),t=o(t,n,3),1==t.length?i(s(e)?e:l(e),t):a(e,t)}var i=e("../internal/arraySum"),o=e("../internal/baseCallback"),a=e("../internal/baseSum"),s=e("../lang/isArray"),u=e("../internal/isIterateeCall"),l=e("../internal/toIterable");t.exports=r},{"../internal/arraySum":34,"../internal/baseCallback":38,"../internal/baseSum":69,"../internal/isIterateeCall":110,"../internal/toIterable":126,"../lang/isArray":133}],146:[function(e,t,n){var r=e("../internal/assignWith"),i=e("../internal/baseAssign"),o=e("../internal/createAssigner"),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});t.exports=a},{"../internal/assignWith":36,"../internal/baseAssign":37,"../internal/createAssigner":82}],147:[function(e,t,n){var r=e("./assign"),i=e("../internal/assignDefaults"),o=e("../internal/createDefaults"),a=o(r,i);t.exports=a},{"../internal/assignDefaults":35,"../internal/createDefaults":88,"./assign":146}],148:[function(e,t,n){var r=e("../internal/baseForOwn"),i=e("../internal/createForOwn"),o=i(r);t.exports=o},{"../internal/baseForOwn":50,"../internal/createForOwn":92}],149:[function(e,t,n){function r(e,t,n){n&&i(e,t,n)&&(t=void 0);for(var r=-1,a=o(e),u=a.length,l={};++r<u;){var c=a[r],f=e[c];t?s.call(l,f)?l[f].push(c):l[f]=[c]:l[f]=c}return l}var i=e("../internal/isIterateeCall"),o=e("./keys"),a=Object.prototype,s=a.hasOwnProperty;t.exports=r},{"../internal/isIterateeCall":110,"./keys":150}],150:[function(e,t,n){var r=e("../internal/getNative"),i=e("../internal/isArrayLike"),o=e("../lang/isObject"),a=e("../internal/shimKeys"),s=r(Object,"keys"),u=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;t.exports=u},{"../internal/getNative":106,"../internal/isArrayLike":108,"../internal/shimKeys":125,"../lang/isObject":139}],151:[function(e,t,n){function r(e){if(null==e)return[];u(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||i(e))&&t||0;for(var n=e.constructor,r=-1,l="function"==typeof n&&n.prototype===e,f=Array(t),p=t>0;++r<t;)f[r]=r+"";for(var d in e)p&&a(d,t)||"constructor"==d&&(l||!c.call(e,d))||f.push(d);return f}var i=e("../lang/isArguments"),o=e("../lang/isArray"),a=e("../internal/isIndex"),s=e("../internal/isLength"),u=e("../lang/isObject"),l=Object.prototype,c=l.hasOwnProperty;t.exports=r},{"../internal/isIndex":109,"../internal/isLength":113,"../lang/isArguments":132,"../lang/isArray":133,"../lang/isObject":139}],152:[function(e,t,n){var r=e("../internal/createObjectMapper"),i=r(!0);t.exports=i},{"../internal/createObjectMapper":94}],153:[function(e,t,n){var r=e("../internal/createObjectMapper"),i=r();t.exports=i},{"../internal/createObjectMapper":94}],154:[function(e,t,n){var r=e("../internal/baseMerge"),i=e("../internal/createAssigner"),o=i(r);t.exports=o},{"../internal/baseMerge":60,"../internal/createAssigner":82}],155:[function(e,t,n){var r=e("../internal/arrayMap"),i=e("../internal/baseDifference"),o=e("../internal/baseFlatten"),a=e("../internal/bindCallback"),s=e("./keysIn"),u=e("../internal/pickByArray"),l=e("../internal/pickByCallback"),c=e("../function/restParam"),f=c(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=r(o(t),String);return u(e,i(s(e),t))}var n=a(t[0],t[1],3);return l(e,function(e,t,r){return!n(e,t,r)})});t.exports=f},{"../function/restParam":23,"../internal/arrayMap":30,"../internal/baseDifference":42,"../internal/baseFlatten":47,"../internal/bindCallback":74,"../internal/pickByArray":119,"../internal/pickByCallback":120,"./keysIn":151}],156:[function(e,t,n){function r(e){e=o(e);for(var t=-1,n=i(e),r=n.length,a=Array(r);++t<r;){var s=n[t];a[t]=[s,e[s]]}return a}var i=e("./keys"),o=e("../internal/toObject");t.exports=r},{"../internal/toObject":127,"./keys":150}],157:[function(e,t,n){var r=e("../internal/baseFlatten"),i=e("../internal/bindCallback"),o=e("../internal/pickByArray"),a=e("../internal/pickByCallback"),s=e("../function/restParam"),u=s(function(e,t){return null==e?{}:"function"==typeof t[0]?a(e,i(t[0],t[1],3)):o(e,r(t))});t.exports=u},{"../function/restParam":23,"../internal/baseFlatten":47,"../internal/bindCallback":74,"../internal/pickByArray":119,"../internal/pickByCallback":120}],158:[function(e,t,n){function r(e){return i(e,o(e))}var i=e("../internal/baseValues"),o=e("./keys");t.exports=r},{"../internal/baseValues":71,"./keys":150}],159:[function(e,t,n){function r(e,t,n){var r=e;return(e=i(e))?(n?s(r,t,n):null==t)?e.slice(u(e),l(e)+1):(t+="",e.slice(o(e,t),a(e,t)+1)):e}var i=e("../internal/baseToString"),o=e("../internal/charsLeftIndex"),a=e("../internal/charsRightIndex"),s=e("../internal/isIterateeCall"),u=e("../internal/trimmedLeftIndex"),l=e("../internal/trimmedRightIndex");t.exports=r},{"../internal/baseToString":70,"../internal/charsLeftIndex":77,"../internal/charsRightIndex":78,"../internal/isIterateeCall":110,"../internal/trimmedLeftIndex":129,"../internal/trimmedRightIndex":130}],160:[function(e,t,n){function r(e){return e}t.exports=r},{}],161:[function(e,t,n){function r(){}t.exports=r},{}],162:[function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=e("../internal/baseProperty"),o=e("../internal/basePropertyDeep"),a=e("../internal/isKey");t.exports=r},{"../internal/baseProperty":62,"../internal/basePropertyDeep":63,"../internal/isKey":111}],163:[function(e,t,n){"use strict";var r=e("lodash/lang/isUndefined"),i=e("lodash/lang/isString"),o=e("lodash/lang/isFunction"),a=e("lodash/lang/isEmpty"),s=e("lodash/object/defaults"),u=e("lodash/collection/reduce"),l=e("lodash/collection/filter"),c=e("lodash/object/omit"),f={addRefinement:function(e,t,n){if(f.isRefined(e,t,n))return e;var r=""+n,i=e[t]?e[t].concat(r):[r],o={};return o[t]=i,s({},o,e)},removeRefinement:function(e,t,n){if(r(n))return f.clearRefinement(e,t);var i=""+n;return f.clearRefinement(e,function(e,n){return t===n&&i===e})},toggleRefinement:function(e,t,n){if(r(n))throw new Error("toggleRefinement should be used with a value");return f.isRefined(e,t,n)?f.removeRefinement(e,t,n):f.addRefinement(e,t,n)},clearRefinement:function(e,t,n){return r(t)?{}:i(t)?c(e,t):o(t)?u(e,function(e,r,i){var o=l(r,function(e){return!t(e,i,n)});return a(o)||(e[i]=o),e},{}):void 0},isRefined:function(t,n,i){var o=e("lodash/array/indexOf"),a=!!t[n]&&t[n].length>0;if(r(i)||!a)return a;var s=""+i;return-1!==o(t[n],s)}};t.exports=f},{"lodash/array/indexOf":6,"lodash/collection/filter":10,"lodash/collection/reduce":16,"lodash/lang/isEmpty":134,"lodash/lang/isFunction":136,"lodash/lang/isString":141,"lodash/lang/isUndefined":143,"lodash/object/defaults":147,"lodash/object/omit":155}],164:[function(e,t,n){"use strict";function r(e,t){var n={},r=o(t,function(e){return-1!==e.indexOf("attribute:")}),l=a(r,function(e){return e.split(":")[1]});-1===u(l,"*")?i(l,function(t){e.isConjunctiveFacet(t)&&e.isFacetRefined(t)&&(n.facetsRefinements||(n.facetsRefinements={}),n.facetsRefinements[t]=e.facetsRefinements[t]),e.isDisjunctiveFacet(t)&&e.isDisjunctiveFacetRefined(t)&&(n.disjunctiveFacetsRefinements||(n.disjunctiveFacetsRefinements={}),n.disjunctiveFacetsRefinements[t]=e.disjunctiveFacetsRefinements[t]),e.isHierarchicalFacet(t)&&e.isHierarchicalFacetRefined(t)&&(n.hierarchicalFacetsRefinements||(n.hierarchicalFacetsRefinements={}),n.hierarchicalFacetsRefinements[t]=e.hierarchicalFacetsRefinements[t]);var r=e.getNumericRefinements(t);s(r)||(n.numericRefinements||(n.numericRefinements={}),n.numericRefinements[t]=e.numericRefinements[t])}):(s(e.numericRefinements)||(n.numericRefinements=e.numericRefinements),s(e.facetsRefinements)||(n.facetsRefinements=e.facetsRefinements),s(e.disjunctiveFacetsRefinements)||(n.disjunctiveFacetsRefinements=e.disjunctiveFacetsRefinements),s(e.hierarchicalFacetsRefinements)||(n.hierarchicalFacetsRefinements=e.hierarchicalFacetsRefinements));var c=o(t,function(e){return-1===e.indexOf("attribute:")});return i(c,function(t){n[t]=e[t]}),n}var i=e("lodash/collection/forEach"),o=e("lodash/collection/filter"),a=e("lodash/collection/map"),s=e("lodash/lang/isEmpty"),u=e("lodash/array/indexOf");t.exports=r},{"lodash/array/indexOf":6,"lodash/collection/filter":10,"lodash/collection/forEach":12,"lodash/collection/map":14,"lodash/lang/isEmpty":134}],165:[function(e,t,n){"use strict";function r(e,t){return _(e,function(e){return v(e,t)})}function i(e){var t=e?i._parseNumbers(e):{};this.index=t.index||"",this.query=t.query||"",this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{},this.numericFilters=t.numericFilters,this.tagFilters=t.tagFilters,this.optionalTagFilters=t.optionalTagFilters,this.optionalFacetFilters=t.optionalFacetFilters,this.hitsPerPage=t.hitsPerPage,this.maxValuesPerFacet=t.maxValuesPerFacet,this.page=t.page||0,this.queryType=t.queryType,this.typoTolerance=t.typoTolerance,this.minWordSizefor1Typo=t.minWordSizefor1Typo,this.minWordSizefor2Typos=t.minWordSizefor2Typos,this.minProximity=t.minProximity,this.allowTyposOnNumericTokens=t.allowTyposOnNumericTokens,this.ignorePlurals=t.ignorePlurals,this.restrictSearchableAttributes=t.restrictSearchableAttributes,this.advancedSyntax=t.advancedSyntax,this.analytics=t.analytics,this.analyticsTags=t.analyticsTags,this.synonyms=t.synonyms,this.replaceSynonymsInHighlight=t.replaceSynonymsInHighlight,this.optionalWords=t.optionalWords,this.removeWordsIfNoResults=t.removeWordsIfNoResults,this.attributesToRetrieve=t.attributesToRetrieve,this.attributesToHighlight=t.attributesToHighlight,this.highlightPreTag=t.highlightPreTag,this.highlightPostTag=t.highlightPostTag,this.attributesToSnippet=t.attributesToSnippet,this.getRankingInfo=t.getRankingInfo,this.distinct=t.distinct,this.aroundLatLng=t.aroundLatLng,this.aroundLatLngViaIP=t.aroundLatLngViaIP,this.aroundRadius=t.aroundRadius,this.minimumAroundRadius=t.minimumAroundRadius,this.aroundPrecision=t.aroundPrecision,this.insideBoundingBox=t.insideBoundingBox,this.insidePolygon=t.insidePolygon,this.snippetEllipsisText=t.snippetEllipsisText,this.disableExactOnAttributes=t.disableExactOnAttributes,this.enableExactOnSingleWordQuery=t.enableExactOnSingleWordQuery,this.offset=t.offset,this.length=t.length,s(t,function(e,t){if(-1===i.PARAMETERS.indexOf(t)){this[t]=e;var n="Unknown SearchParameter: `"+t+"` (this might raise an error in the Algolia API)";E(n)}},this)}var o=e("lodash/object/keys"),a=e("lodash/array/intersection"),s=e("lodash/object/forOwn"),u=e("lodash/collection/forEach"),l=e("lodash/collection/filter"),c=e("lodash/collection/map"),f=e("lodash/collection/reduce"),p=e("lodash/object/omit"),d=e("lodash/array/indexOf"),h=e("lodash/lang/isArray"),m=e("lodash/lang/isEmpty"),v=e("lodash/lang/isEqual"),y=e("lodash/lang/isUndefined"),g=e("lodash/lang/isString"),b=e("lodash/lang/isFunction"),_=e("lodash/collection/find"),j=e("lodash/collection/pluck"),w=e("lodash/object/defaults"),C=e("lodash/object/merge"),x=e("../functions/deepFreeze"),E=e("../functions/warnOnce"),R=e("../functions/valToNumber"),O=e("./filterState"),P=e("./RefinementList");i.PARAMETERS=o(new i),i._parseNumbers=function(e){var t={},n=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(u(n,function(n){var r=e[n];g(r)&&(t[n]=parseFloat(e[n]))}),e.numericRefinements){var r={};u(e.numericRefinements,function(e,t){r[t]={},u(e,function(e,n){var i=c(e,function(e){return h(e)?c(e,function(e){return g(e)?parseFloat(e):e}):g(e)?parseFloat(e):e});r[t][n]=i})}),t.numericRefinements=r}return C({},e,t)},i.make=function(e){var t=new i(e);return u(e.hierarchicalFacets,function(e){if(e.rootPath){var n=t.getHierarchicalRefinement(e.name);n.length>0&&0!==n[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),n=t.getHierarchicalRefinement(e.name),0===n.length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),x(t)},i.validate=function(e,t){var n=t||{},r=o(n),a=l(r,function(e){return-1===i.PARAMETERS.indexOf(e)});return 1===a.length?E("Unknown parameter "+a[0]+" (this might rise an error in the Algolia API)"):a.length>1&&E("Unknown parameters "+a.join(", ")+" (this might raise an error in the Algolia API)"),e.tagFilters&&n.tagRefinements&&n.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&n.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&n.numericRefinements&&!m(n.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):!m(e.numericRefinements)&&n.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},i.prototype={constructor:i,clearRefinements:function(e){var t=P.clearRefinement;return this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(e),facetsRefinements:t(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:t(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:t(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:t(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")})},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({page:0,tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e,page:0})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e,page:0})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e,page:0})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e,page:0})},addNumericRefinement:function(e,t,n){var r=R(n);if(this.isNumericRefined(e,t,r))return this;var i=C({},this.numericRefinements);return i[e]=C({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({page:0,numericRefinements:i})},getConjunctiveRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,n){if(void 0!==n){var r=R(n);return this.isNumericRefined(e,t,r)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(n,i){return i===e&&n.op===t&&v(n.val,r)})}):this}return void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(n,r){return r===e&&n.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({page:0,numericRefinements:this._clearNumericRefinements(function(t,n){return n===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){return y(e)?{}:g(e)?p(this.numericRefinements,e):b(e)?f(this.numericRefinements,function(t,n,r){var i={};return u(n,function(t,n){var o=[];u(t,function(t){var i=e({val:t,op:n},r,"numeric");i||o.push(t)}),m(o)||(i[n]=o)}),m(i)||(t[r]=i),t},{}):void 0},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({page:0,facetsRefinements:P.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({page:0,facetsExcludes:P.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return P.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({page:0,disjunctiveFacetsRefinements:P.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={page:0,tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({page:0,facetsRefinements:P.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({page:0,facetsExcludes:P.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return P.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({page:0,disjunctiveFacetsRefinements:P.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={page:0,tagRefinements:l(this.tagRefinements,function(t){return t!==e})};return this.setQueryParameters(t)},toggleRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({page:0,facetsRefinements:P.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({page:0,facetsExcludes:P.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({page:0,disjunctiveFacetsRefinements:P.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={},i=void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n));return i?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({page:0,hierarchicalFacetsRefinements:w({},r,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return d(this.disjunctiveFacets,e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return d(this.facets,e)>-1},isFacetRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return P.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return P.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this.getHierarchicalRefinement(e);return t?-1!==d(n,t):n.length>0},isNumericRefined:function(e,t,n){if(y(n)&&y(t))return!!this.numericRefinements[e];var i=this.numericRefinements[e]&&!y(this.numericRefinements[e][t]);if(y(n)||!i)return i;var o=R(n),a=!y(r(this.numericRefinements[e][t],o));return i&&a},isTagRefined:function(e){return-1!==d(this.tagRefinements,e)},getRefinedDisjunctiveFacets:function(){var e=a(o(this.numericRefinements),this.disjunctiveFacets);return o(this.disjunctiveFacetsRefinements).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){return a(j(this.hierarchicalFacets,"name"),o(this.hierarchicalFacetsRefinements))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return l(this.disjunctiveFacets,function(t){return-1===d(e,t)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={};return s(this,function(n,r){-1===d(e,r)&&void 0!==n&&(t[r]=n)}),t},getQueryParameter:function(e){if(!this.hasOwnProperty(e))throw new Error("Parameter '"+e+"' is not an attribute of SearchParameters (http://algolia.github.io/algoliasearch-helper-js/docs/SearchParameters.html)");return this[e]},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){var t=i.validate(this,e);if(t)throw t;var n=i._parseNumbers(e);return this.mutateMe(function(t){var r=o(e);return u(r,function(e){t[e]=n[e]}),t})},filter:function(e){return O(this,e)},mutateMe:function(e){var t=new this.constructor(this);return e(t,this),
x(t)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"==typeof e.showParentLevel?e.showParentLevel:!0},getHierarchicalFacetByName:function(e){return _(this.hierarchicalFacets,{name:e})}},t.exports=i},{"../functions/deepFreeze":170,"../functions/valToNumber":172,"../functions/warnOnce":173,"./RefinementList":163,"./filterState":164,"lodash/array/indexOf":6,"lodash/array/intersection":7,"lodash/collection/filter":10,"lodash/collection/find":11,"lodash/collection/forEach":12,"lodash/collection/map":14,"lodash/collection/pluck":15,"lodash/collection/reduce":16,"lodash/lang/isArray":133,"lodash/lang/isEmpty":134,"lodash/lang/isEqual":135,"lodash/lang/isFunction":136,"lodash/lang/isString":141,"lodash/lang/isUndefined":143,"lodash/object/defaults":147,"lodash/object/forOwn":148,"lodash/object/keys":150,"lodash/object/merge":154,"lodash/object/omit":155}],166:[function(e,t,n){"use strict";var r=e("lodash/object/invert"),i=e("lodash/object/keys"),o={advancedSyntax:"aS",allowTyposOnNumericTokens:"aTONT",analyticsTags:"aT",analytics:"a",aroundLatLngViaIP:"aLLVIP",aroundLatLng:"aLL",aroundPrecision:"aP",aroundRadius:"aR",attributesToHighlight:"aTH",attributesToRetrieve:"aTR",attributesToSnippet:"aTS",disjunctiveFacetsRefinements:"dFR",disjunctiveFacets:"dF",distinct:"d",facetsExcludes:"fE",facetsRefinements:"fR",facets:"f",getRankingInfo:"gRI",hierarchicalFacetsRefinements:"hFR",hierarchicalFacets:"hF",highlightPostTag:"hPoT",highlightPreTag:"hPrT",hitsPerPage:"hPP",ignorePlurals:"iP",index:"idx",insideBoundingBox:"iBB",insidePolygon:"iPg",length:"l",maxValuesPerFacet:"mVPF",minimumAroundRadius:"mAR",minProximity:"mP",minWordSizefor1Typo:"mWS1T",minWordSizefor2Typos:"mWS2T",numericFilters:"nF",numericRefinements:"nR",offset:"o",optionalWords:"oW",page:"p",queryType:"qT",query:"q",removeWordsIfNoResults:"rWINR",replaceSynonymsInHighlight:"rSIH",restrictSearchableAttributes:"rSA",synonyms:"s",tagFilters:"tF",tagRefinements:"tR",typoTolerance:"tT",optionalTagFilters:"oTF",optionalFacetFilters:"oFF",snippetEllipsisText:"sET",disableExactOnAttributes:"dEOA",enableExactOnSingleWordQuery:"eEOSWQ"},a=r(o);t.exports={ENCODED_PARAMETERS:i(a),decode:function(e){return a[e]},encode:function(e){return o[e]}}},{"lodash/object/invert":149,"lodash/object/keys":150}],167:[function(e,t,n){"use strict";function r(e){return function(t,n){var r=e.hierarchicalFacets[n],o=e.hierarchicalFacetsRefinements[r.name]&&e.hierarchicalFacetsRefinements[r.name][0]||"",a=e._getHierarchicalFacetSeparator(r),s=e._getHierarchicalRootPath(r),u=e._getHierarchicalShowParentLevel(r),c=h(e._getHierarchicalFacetSortBy(r)),f=i(c,a,s,u,o),p=t;return s&&(p=t.slice(s.split(a).length)),l(p,f,{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,data:null})}}function i(e,t,n,r,i){return function(s,l,f){var h=s;if(f>0){var m=0;for(h=s;f>m;)h=h&&p(h.data,{isRefined:!0}),m++}if(h){var v=o(h.path||n,i,t,n,r);h.data=c(u(d(l.data,v),a(t,i)),e[0],e[1])}return s}}function o(e,t,n,r,i){return function(o,a){return!r||0===a.indexOf(r)&&r!==a?!r&&-1===a.indexOf(n)||r&&a.split(n).length-r.split(n).length===1||-1===a.indexOf(n)&&-1===t.indexOf(n)||0===t.indexOf(a)||0===a.indexOf(e+n)&&(i||0===a.indexOf(t)):!1}}function a(e,t){return function(n,r){return{name:f(s(r.split(e))),path:r,count:n,isRefined:t===r||0===t.indexOf(r+e),data:null}}}t.exports=r;var s=e("lodash/array/last"),u=e("lodash/collection/map"),l=e("lodash/collection/reduce"),c=e("lodash/collection/sortByOrder"),f=e("lodash/string/trim"),p=e("lodash/collection/find"),d=e("lodash/object/pick"),h=e("../functions/formatSort")},{"../functions/formatSort":171,"lodash/array/last":8,"lodash/collection/find":11,"lodash/collection/map":14,"lodash/collection/reduce":16,"lodash/collection/sortByOrder":17,"lodash/object/pick":157,"lodash/string/trim":159}],168:[function(e,t,n){"use strict";function r(e){var t={};return f(e,function(e,n){t[e]=n}),t}function i(e,t,n){t&&t[n]&&(e.stats=t[n])}function o(e,t){return v(e,function(e){return y(e.attributes,t)})}function a(e,t){var n=t.results[0];this.query=n.query,this.parsedQuery=n.parsedQuery,this.hits=n.hits,this.index=n.index,this.hitsPerPage=n.hitsPerPage,this.nbHits=n.nbHits,this.nbPages=n.nbPages,this.page=n.page,this.processingTimeMS=m(t.results,"processingTimeMS"),this.aroundLatLng=n.aroundLatLng,this.automaticRadius=n.automaticRadius,this.serverUsed=n.serverUsed,this.timeoutCounts=n.timeoutCounts,this.timeoutHits=n.timeoutHits,this.disjunctiveFacets=[],this.hierarchicalFacets=g(e.hierarchicalFacets,function(){return[]}),this.facets=[];var a=e.getRefinedDisjunctiveFacets(),s=r(e.facets),u=r(e.disjunctiveFacets),l=1;f(n.facets,function(t,r){var a=o(e.hierarchicalFacets,r);if(a){var l=a.attributes.indexOf(r);this.hierarchicalFacets[h(e.hierarchicalFacets,{name:a.name})][l]={attribute:r,data:t,exhaustive:n.exhaustiveFacetsCount}}else{var c,f=-1!==d(e.disjunctiveFacets,r),p=-1!==d(e.facets,r);f&&(c=u[r],this.disjunctiveFacets[c]={name:r,data:t,exhaustive:n.exhaustiveFacetsCount},i(this.disjunctiveFacets[c],n.facets_stats,r)),p&&(c=s[r],this.facets[c]={name:r,data:t,exhaustive:n.exhaustiveFacetsCount},i(this.facets[c],n.facets_stats,r))}},this),this.hierarchicalFacets=p(this.hierarchicalFacets),f(a,function(r){var o=t.results[l],a=e.getHierarchicalFacetByName(r);f(o.facets,function(t,r){var s;if(a){s=h(e.hierarchicalFacets,{name:a.name});var l=h(this.hierarchicalFacets[s],{attribute:r});if(-1===l)return;this.hierarchicalFacets[s][l].data=j({},this.hierarchicalFacets[s][l].data,t)}else{s=u[r];var c=n.facets&&n.facets[r]||{};this.disjunctiveFacets[s]={name:r,data:_({},t,c),exhaustive:o.exhaustiveFacetsCount},i(this.disjunctiveFacets[s],o.facets_stats,r),e.disjunctiveFacetsRefinements[r]&&f(e.disjunctiveFacetsRefinements[r],function(t){!this.disjunctiveFacets[s].data[t]&&d(e.disjunctiveFacetsRefinements[r],t)>-1&&(this.disjunctiveFacets[s].data[t]=0)},this)}},this),l++},this),f(e.getRefinedHierarchicalFacets(),function(n){var r=e.getHierarchicalFacetByName(n),i=e._getHierarchicalFacetSeparator(r),o=e.getHierarchicalRefinement(n);if(!(0===o.length||o[0].split(i).length<2)){var a=t.results[l];f(a.facets,function(t,n){var a=h(e.hierarchicalFacets,{name:r.name}),s=h(this.hierarchicalFacets[a],{attribute:n});if(-1!==s){var u={};if(o.length>0){var l=o[0].split(i)[0];u[l]=this.hierarchicalFacets[a][s].data[l]}this.hierarchicalFacets[a][s].data=_(u,t,this.hierarchicalFacets[a][s].data)}},this),l++}},this),f(e.facetsExcludes,function(e,t){var r=s[t];this.facets[r]={name:t,data:n.facets[t],exhaustive:n.exhaustiveFacetsCount},f(e,function(e){this.facets[r]=this.facets[r]||{name:t},this.facets[r].data=this.facets[r].data||{},this.facets[r].data[e]=0},this)},this),this.hierarchicalFacets=g(this.hierarchicalFacets,O(e)),this.facets=p(this.facets),this.disjunctiveFacets=p(this.disjunctiveFacets),this._state=e}function s(e,t){var n={name:t};if(e._state.isConjunctiveFacet(t)){var r=v(e.facets,n);return r?g(r.data,function(n,r){return{name:r,count:n,isRefined:e._state.isFacetRefined(t,r)}}):[]}if(e._state.isDisjunctiveFacet(t)){var i=v(e.disjunctiveFacets,n);return i?g(i.data,function(n,r){return{name:r,count:n,isRefined:e._state.isDisjunctiveFacetRefined(t,r)}}):[]}return e._state.isHierarchicalFacet(t)?v(e.hierarchicalFacets,n):void 0}function u(e,t){if(!t.data||0===t.data.length)return t;var n=g(t.data,x(u,e)),r=e(n),i=j({},t,{data:r});return i}function l(e,t){return t.sort(e)}function c(e,t){var n=v(e,{name:t});return n&&n.stats}var f=e("lodash/collection/forEach"),p=e("lodash/array/compact"),d=e("lodash/array/indexOf"),h=e("lodash/array/findIndex"),m=e("lodash/collection/sum"),v=e("lodash/collection/find"),y=e("lodash/collection/includes"),g=e("lodash/collection/map"),b=e("lodash/collection/sortByOrder"),_=e("lodash/object/defaults"),j=e("lodash/object/merge"),w=e("lodash/lang/isArray"),C=e("lodash/lang/isFunction"),x=e("lodash/function/partial"),E=e("lodash/function/partialRight"),R=e("../functions/formatSort"),O=e("./generate-hierarchical-tree");a.prototype.getFacetByName=function(e){var t={name:e};return v(this.facets,t)||v(this.disjunctiveFacets,t)||v(this.hierarchicalFacets,t)},a.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],a.prototype.getFacetValues=function(e,t){var n=s(this,e);if(!n)throw new Error(e+" is not a retrieved facet.");var r=_({},t,{sortBy:a.DEFAULT_SORT});if(w(r.sortBy)){var i=R(r.sortBy);return w(n)?b(n,i[0],i[1]):u(E(b,i[0],i[1]),n)}if(C(r.sortBy))return w(n)?n.sort(r.sortBy):u(x(l,r.sortBy),n);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},a.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return c(this.facets,e);if(this._state.isDisjunctiveFacet(e))return c(this.disjunctiveFacets,e);throw new Error(e+" is not present in `facets` or `disjunctiveFacets`")},t.exports=a},{"../functions/formatSort":171,"./generate-hierarchical-tree":167,"lodash/array/compact":4,"lodash/array/findIndex":5,"lodash/array/indexOf":6,"lodash/collection/find":11,"lodash/collection/forEach":12,"lodash/collection/includes":13,"lodash/collection/map":14,"lodash/collection/sortByOrder":17,"lodash/collection/sum":18,"lodash/function/partial":21,"lodash/function/partialRight":22,"lodash/lang/isArray":133,"lodash/lang/isFunction":136,"lodash/object/defaults":147,"lodash/object/merge":154}],169:[function(e,t,n){"use strict";function r(e,t,n){this.client=e;var r=n||{};r.index=t,this.state=a.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1}function i(e){if(0>e)throw new Error("Page requested below 0.");return this.state=this.state.setPage(e),this._change(),this}function o(){return this.state.page}var a=e("./SearchParameters"),s=e("./SearchResults"),u=e("./requestBuilder"),l=e("util"),c=e("events"),f=e("lodash/collection/forEach"),p=e("lodash/collection/map"),d=e("lodash/function/bind"),h=e("lodash/lang/isEmpty"),m=e("lodash/string/trim"),v=e("./url");l.inherits(r,c.EventEmitter),r.prototype.search=function(){return this._search(),this},r.prototype.searchOnce=function(e,t){var n=this.state.setQueryParameters(e),r=u._getQueries(n.index,n);return t?this.client.search(r,function(e,r){t(e,new s(n,r),n)}):this.client.search(r).then(function(e){return{content:new s(n,e),state:n}})},r.prototype.setQuery=function(e){return this.state=this.state.setQuery(e),this._change(),this},r.prototype.clearRefinements=function(e){return this.state=this.state.clearRefinements(e),this._change(),this},r.prototype.clearTags=function(){return this.state=this.state.clearTags(),this._change(),this},r.prototype.addDisjunctiveFacetRefinement=function(e,t){return this.state=this.state.addDisjunctiveFacetRefinement(e,t),this._change(),this},r.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},r.prototype.addNumericRefinement=function(e,t,n){return this.state=this.state.addNumericRefinement(e,t,n),this._change(),this},r.prototype.addFacetRefinement=function(e,t){return this.state=this.state.addFacetRefinement(e,t),this._change(),this},r.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},r.prototype.addFacetExclusion=function(e,t){return this.state=this.state.addExcludeRefinement(e,t),this._change(),this},r.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},r.prototype.addTag=function(e){return this.state=this.state.addTagRefinement(e),this._change(),this},r.prototype.removeNumericRefinement=function(e,t,n){return this.state=this.state.removeNumericRefinement(e,t,n),this._change(),this},r.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this.state=this.state.removeDisjunctiveFacetRefinement(e,t),this._change(),this},r.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},r.prototype.removeFacetRefinement=function(e,t){return this.state=this.state.removeFacetRefinement(e,t),this._change(),this},r.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},r.prototype.removeFacetExclusion=function(e,t){return this.state=this.state.removeExcludeRefinement(e,t),this._change(),this},r.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},r.prototype.removeTag=function(e){return this.state=this.state.removeTagRefinement(e),this._change(),this},r.prototype.toggleFacetExclusion=function(e,t){return this.state=this.state.toggleExcludeFacetRefinement(e,t),this._change(),this},r.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},r.prototype.toggleRefinement=function(e,t){return this.state=this.state.toggleRefinement(e,t),this._change(),this},r.prototype.toggleRefine=function(){return this.toggleRefinement.apply(this,arguments)},r.prototype.toggleTag=function(e){return this.state=this.state.toggleTagRefinement(e),this._change(),this},r.prototype.nextPage=function(){return this.setPage(this.state.page+1)},r.prototype.previousPage=function(){return this.setPage(this.state.page-1)},r.prototype.setCurrentPage=i,r.prototype.setPage=i,r.prototype.setIndex=function(e){return this.state=this.state.setIndex(e),this._change(),this},r.prototype.setQueryParameter=function(e,t){var n=this.state.setQueryParameter(e,t);return this.state===n?this:(this.state=n,this._change(),this)},r.prototype.setState=function(e){return this.state=new a(e),this._change(),this},r.prototype.getState=function(e){return void 0===e?this.state:this.state.filter(e)},r.prototype.getStateAsQueryString=function(e){var t=e&&e.filters||["query","attribute:*"],n=this.getState(t);return v.getQueryStringFromState(n,e)},r.getConfigurationFromQueryString=v.getStateFromQueryString,r.getForeignConfigurationInQueryString=v.getUnrecognizedParametersInQueryString,r.prototype.setStateFromQueryString=function(e,t){var n=t&&t.triggerChange||!1,r=v.getStateFromQueryString(e,t),i=this.state.setQueryParameters(r);n?this.setState(i):this.overrideStateWithoutTriggeringChangeEvent(i)},r.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new a(e),this},r.prototype.isRefined=function(e,t){if(this.state.isConjunctiveFacet(e))return this.state.isFacetRefined(e,t);if(this.state.isDisjunctiveFacet(e))return this.state.isDisjunctiveFacetRefined(e,t);throw new Error(e+" is not properly defined in this helper configuration(use the facets or disjunctiveFacets keys to configure it)")},r.prototype.hasRefinements=function(e){return h(this.state.getNumericRefinements(e))?this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):this.state.isHierarchicalFacet(e)?this.state.isHierarchicalFacetRefined(e):!1:!0},r.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},r.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},r.prototype.hasTag=function(e){return this.state.isTagRefined(e)},r.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},r.prototype.getIndex=function(){return this.state.index},r.prototype.getCurrentPage=o,r.prototype.getPage=o,r.prototype.getTags=function(){return this.state.tagRefinements},r.prototype.getQueryParameter=function(e){return this.state.getQueryParameter(e)},r.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){var n=this.state.getConjunctiveRefinements(e);f(n,function(e){t.push({value:e,type:"conjunctive"})});var r=this.state.getExcludeRefinements(e);f(r,function(e){t.push({value:e,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);f(i,function(e){t.push({value:e,type:"disjunctive"})})}var o=this.state.getNumericRefinements(e);return f(o,function(e,n){t.push({value:e,operator:n,type:"numeric"})}),t},r.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},r.prototype.getHierarchicalFacetBreadcrumb=function(e){return p(this.state.getHierarchicalRefinement(e)[0].split(this.state._getHierarchicalFacetSeparator(this.state.getHierarchicalFacetByName(e))),function(e){return m(e)})},r.prototype._search=function(){var e=this.state,t=u._getQueries(e.index,e);this.emit("search",e,this.lastResults),this.client.search(t,d(this._handleResponse,this,e,this._queryId++))},r.prototype._handleResponse=function(e,t,n,r){if(!(t<this._lastQueryIdReceived)){if(this._lastQueryIdReceived=t,n)return void this.emit("error",n);var i=this.lastResults=new s(e,r);this.emit("result",i,e)}},r.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},r.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},r.prototype._change=function(){this.emit("change",this.state,this.lastResults)},t.exports=r},{"./SearchParameters":165,"./SearchResults":168,"./requestBuilder":174,"./url":175,events:278,"lodash/collection/forEach":12,"lodash/collection/map":14,"lodash/function/bind":20,"lodash/lang/isEmpty":134,"lodash/string/trim":159,util:814}],170:[function(e,t,n){"use strict";var r=e("lodash/collection/forEach"),i=e("lodash/utility/identity"),o=e("lodash/lang/isObject"),a=function(e){return o(e)?(r(e,a),Object.isFrozen(e)||Object.freeze(e),e):e};t.exports=Object.freeze?a:i},{"lodash/collection/forEach":12,"lodash/lang/isObject":139,"lodash/utility/identity":160}],171:[function(e,t,n){"use strict";var r=e("lodash/collection/reduce");t.exports=function(e){return r(e,function(e,t){var n=t.split(":");return e[0].push(n[0]),e[1].push(n[1]),e},[[],[]])}},{"lodash/collection/reduce":16}],172:[function(e,t,n){"use strict";function r(e){if(a(e))return e;if(s(e))return parseFloat(e);if(o(e))return i(e,r);throw new Error("The value should be a number, a parseable string or an array of those.")}var i=e("lodash/collection/map"),o=e("lodash/lang/isArray"),a=e("lodash/lang/isNumber"),s=e("lodash/lang/isString");t.exports=r},{"lodash/collection/map":14,"lodash/lang/isArray":133,"lodash/lang/isNumber":138,"lodash/lang/isString":141}],173:[function(e,t,n){"use strict";var r=e("lodash/function/bind");try{var i;i="undefined"!=typeof window?window.console&&r(window.console.warn,console):r(console.warn,console);var o=function(e){var t=[];return function(n){-1===t.indexOf(n)&&(e(n),t.push(n))}}(i);t.exports=o}catch(a){t.exports=function(){}}},{"lodash/function/bind":20}],174:[function(e,t,n){"use strict";var r=e("lodash/collection/forEach"),i=e("lodash/collection/map"),o=e("lodash/collection/reduce"),a=e("lodash/object/merge"),s=e("lodash/lang/isArray"),u={_getQueries:function(e,t){var n=[];return n.push({indexName:e,params:this._getHitsSearchParams(t)}),r(t.getRefinedDisjunctiveFacets(),function(r){n.push({indexName:e,params:this._getDisjunctiveFacetSearchParams(t,r)})},this),r(t.getRefinedHierarchicalFacets(),function(r){var i=t.getHierarchicalFacetByName(r),o=t.getHierarchicalRefinement(r);o.length>0&&o[0].split(t._getHierarchicalFacetSeparator(i)).length>1&&n.push({indexName:e,params:this._getDisjunctiveFacetSearchParams(t,r,!0)})},this),n},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(this._getHitsHierarchicalFacetsAttributes(e)),n=this._getFacetFilters(e),r=this._getNumericFilters(e),i=this._getTagFilters(e),o={facets:t,tagFilters:i};return n.length>0&&(o.facetFilters=n),r.length>0&&(o.numericFilters=r),a(e.getQueryParams(),o)},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=this._getFacetFilters(e,t,n),i=this._getNumericFilters(e,t),o=this._getTagFilters(e),s={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:o},u=e.getHierarchicalFacetByName(t);return u?s.facets=this._getDisjunctiveHierarchicalFacetAttribute(e,u,n):s.facets=t,i.length>0&&(s.numericFilters=i),r.length>0&&(s.facetFilters=r),a(e.getQueryParams(),s)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var n=[];return r(e.numericRefinements,function(e,o){r(e,function(e,a){t!==o&&r(e,function(e){if(s(e)){var t=i(e,function(e){return o+a+e});n.push(t)}else n.push(o+a+e)})})}),n},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,n){var i=[];return r(e.facetsRefinements,function(e,t){r(e,function(e){i.push(t+":"+e)})}),r(e.facetsExcludes,function(e,t){r(e,function(e){i.push(t+":-"+e)})}),r(e.disjunctiveFacetsRefinements,function(e,n){if(n!==t&&e&&0!==e.length){var o=[];r(e,function(e){o.push(n+":"+e)}),i.push(o)}}),r(e.hierarchicalFacetsRefinements,function(r,o){var a=r[0];if(void 0!==a){var s,u,l=e.getHierarchicalFacetByName(o),c=e._getHierarchicalFacetSeparator(l),f=e._getHierarchicalRootPath(l);if(t===o){if(-1===a.indexOf(c)||!f&&n===!0||f&&f.split(c).length===a.split(c).length)return;f?(u=f.split(c).length-1,a=f):(u=a.split(c).length-2,a=a.slice(0,a.lastIndexOf(c))),s=l.attributes[u]}else u=a.split(c).length-1,s=l.attributes[u];s&&i.push([s+":"+a])}}),i},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return o(e.hierarchicalFacets,function(t,n){var r=e.getHierarchicalRefinement(n.name)[0];if(!r)return t.push(n.attributes[0]),t;var i=r.split(e._getHierarchicalFacetSeparator(n)).length,o=n.attributes.slice(0,i+1);return t.concat(o)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(n===!0){var i=e._getHierarchicalRootPath(t),o=0;return i&&(o=i.split(r).length),[t.attributes[o]]}var a=e.getHierarchicalRefinement(t.name)[0]||"",s=a.split(r).length-1;return t.attributes.slice(0,s+1)}};t.exports=u},{"lodash/collection/forEach":12,"lodash/collection/map":14,"lodash/collection/reduce":16,"lodash/lang/isArray":133,"lodash/object/merge":154}],175:[function(e,t,n){"use strict";function r(e){return m(e)?d(e,r):v(e)?f(e,r):h(e)?g(e):e}function i(e,t,n,r){if(null!==e&&(n=n.replace(e,""),r=r.replace(e,"")),n=t[n]||n,r=t[r]||r,-1!==_.indexOf(n)||-1!==_.indexOf(r)){if("q"===n)return-1;if("q"===r)return 1;var i=-1!==b.indexOf(n),o=-1!==b.indexOf(r);if(i&&!o)return 1;if(o&&!i)return-1}return n.localeCompare(r)}var o=e("./SearchParameters/shortener"),a=e("./SearchParameters"),s=e("qs"),u=e("lodash/function/bind"),l=e("lodash/collection/forEach"),c=e("lodash/object/pick"),f=e("lodash/collection/map"),p=e("lodash/object/mapKeys"),d=e("lodash/object/mapValues"),h=e("lodash/lang/isString"),m=e("lodash/lang/isPlainObject"),v=e("lodash/lang/isArray"),y=e("lodash/object/invert"),g=e("qs/lib/utils").encode,b=["dFR","fR","nR","hFR","tR"],_=o.ENCODED_PARAMETERS;n.getStateFromQueryString=function(e,t){var n=t&&t.prefix||"",r=t&&t.mapping||{},i=y(r),u=s.parse(e),l=new RegExp("^"+n),f=p(u,function(e,t){var r=n&&l.test(t),a=r?t.replace(l,""):t,s=o.decode(i[a]||a);return s||a}),d=a._parseNumbers(f);return c(d,a.PARAMETERS)},n.getUnrecognizedParametersInQueryString=function(e,t){var n=t&&t.prefix,r=t&&t.mapping||{},i=y(r),a={},u=s.parse(e);if(n){var c=new RegExp("^"+n);l(u,function(e,t){c.test(t)||(a[t]=e)})}else l(u,function(e,t){o.decode(i[t]||t)||(a[t]=e)});return a},n.getQueryStringFromState=function(e,t){var n=t&&t.moreAttributes,a=t&&t.prefix||"",l=t&&t.mapping||{},c=y(l),f=r(e),d=p(f,function(e,t){var n=o.encode(t);return a+(l[n]||n)}),h=""===a?null:new RegExp("^"+a),m=u(i,null,h,c);if(n){var v=s.stringify(d,{encode:!1,sort:m}),g=s.stringify(n,{encode:!1});return v?v+"&"+g:g}return s.stringify(d,{encode:!1,sort:m})}},{"./SearchParameters":165,"./SearchParameters/shortener":166,"lodash/collection/forEach":12,"lodash/collection/map":14,"lodash/function/bind":20,"lodash/lang/isArray":133,"lodash/lang/isPlainObject":140,"lodash/lang/isString":141,"lodash/object/invert":149,"lodash/object/mapKeys":152,"lodash/object/mapValues":153,"lodash/object/pick":157,qs:674,"qs/lib/utils":677}],176:[function(e,t,n){"use strict";t.exports="2.9.1"},{}],177:[function(e,t,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],178:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"../internal/arrayEach":182,"../internal/baseEach":189,"../internal/createForEach":211,dup:12}],179:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{"../internal/arrayMap":183,"../internal/baseCallback":186,"../internal/baseMap":197,"../lang/isArray":234,dup:14}],180:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],181:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],182:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],183:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],184:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],185:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../object/keys":241,"./baseCopy":188,dup:37}],186:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"../utility/identity":245,"../utility/property":246,"./baseMatches":198,"./baseMatchesProperty":199,"./bindCallback":206,dup:38}],187:[function(e,t,n){function r(e,t,n,h,m,v,y){var b;if(n&&(b=m?n(e,h,m):n(e)),void 0!==b)return b;if(!p(e))return e;var _=f(e);if(_){if(b=u(e),!t)return i(e,b)}else{var w=L.call(e),C=w==g;if(w!=j&&w!=d&&(!C||m))return D[w]?l(e,w,t):m?e:{};if(b=c(C?{}:e),!t)return a(b,e)}v||(v=[]),y||(y=[]);for(var x=v.length;x--;)if(v[x]==e)return y[x];return v.push(e),y.push(b),(_?o:s)(e,function(i,o){b[o]=r(i,t,n,o,e,v,y)}),b}var i=e("./arrayCopy"),o=e("./arrayEach"),a=e("./baseAssign"),s=e("./baseForOwn"),u=e("./initCloneArray"),l=e("./initCloneByTag"),c=e("./initCloneObject"),f=e("../lang/isArray"),p=e("../lang/isObject"),d="[object Arguments]",h="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",g="[object Function]",b="[object Map]",_="[object Number]",j="[object Object]",w="[object RegExp]",C="[object Set]",x="[object String]",E="[object WeakMap]",R="[object ArrayBuffer]",O="[object Float32Array]",P="[object Float64Array]",S="[object Int8Array]",k="[object Int16Array]",A="[object Int32Array]",T="[object Uint8Array]",M="[object Uint8ClampedArray]",N="[object Uint16Array]",I="[object Uint32Array]",D={};D[d]=D[h]=D[R]=D[m]=D[v]=D[O]=D[P]=D[S]=D[k]=D[A]=D[_]=D[j]=D[w]=D[x]=D[T]=D[M]=D[N]=D[I]=!0,D[y]=D[g]=D[b]=D[C]=D[E]=!1;var F=Object.prototype,L=F.toString;t.exports=r},{"../lang/isArray":234,"../lang/isObject":237,"./arrayCopy":181,"./arrayEach":182,"./baseAssign":185,"./baseForOwn":192,"./initCloneArray":218,"./initCloneByTag":219,"./initCloneObject":220}],188:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{dup:40}],189:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"./baseForOwn":192,"./createBaseEach":209,dup:43}],190:[function(e,t,n){arguments[4][48][0].apply(n,arguments)},{"./createBaseFor":210,dup:48}],191:[function(e,t,n){arguments[4][49][0].apply(n,arguments)},{"../object/keysIn":242,"./baseFor":190,dup:49}],192:[function(e,t,n){arguments[4][50][0].apply(n,arguments)},{"../object/keys":241,"./baseFor":190,dup:50}],193:[function(e,t,n){arguments[4][51][0].apply(n,arguments)},{"./toObject":229,dup:51}],194:[function(e,t,n){arguments[4][53][0].apply(n,arguments)},{"../lang/isObject":237,"./baseIsEqualDeep":195,"./isObjectLike":226,dup:53}],195:[function(e,t,n){arguments[4][54][0].apply(n,arguments)},{"../lang/isArray":234,"../lang/isTypedArray":239,"./equalArrays":212,"./equalByTag":213,"./equalObjects":214,dup:54}],196:[function(e,t,n){arguments[4][55][0].apply(n,arguments)},{"./baseIsEqual":194,"./toObject":229,dup:55}],197:[function(e,t,n){arguments[4][57][0].apply(n,arguments)},{"./baseEach":189,"./isArrayLike":221,dup:57}],198:[function(e,t,n){arguments[4][58][0].apply(n,arguments)},{"./baseIsMatch":196,"./getMatchData":216,"./toObject":229,dup:58}],199:[function(e,t,n){arguments[4][59][0].apply(n,arguments)},{"../array/last":177,"../lang/isArray":234,"./baseGet":193,"./baseIsEqual":194,"./baseSlice":204,"./isKey":224,"./isStrictComparable":227,"./toObject":229,"./toPath":230,dup:59}],200:[function(e,t,n){arguments[4][60][0].apply(n,arguments)},{"../lang/isArray":234,"../lang/isObject":237,"../lang/isTypedArray":239,"../object/keys":241,"./arrayEach":182,"./baseMergeDeep":201,"./isArrayLike":221,"./isObjectLike":226,dup:60}],201:[function(e,t,n){arguments[4][61][0].apply(n,arguments)},{"../lang/isArguments":233,"../lang/isArray":234,"../lang/isPlainObject":238,"../lang/isTypedArray":239,"../lang/toPlainObject":240,"./arrayCopy":181,"./isArrayLike":221,dup:61}],202:[function(e,t,n){arguments[4][62][0].apply(n,arguments)},{dup:62}],203:[function(e,t,n){arguments[4][63][0].apply(n,arguments)},{"./baseGet":193,"./toPath":230,dup:63}],204:[function(e,t,n){arguments[4][66][0].apply(n,arguments)},{dup:66}],205:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{dup:70}],206:[function(e,t,n){arguments[4][74][0].apply(n,arguments)},{"../utility/identity":245,dup:74}],207:[function(e,t,n){(function(e){function n(e){var t=new r(e.byteLength),n=new i(t);return n.set(new i(e)),t}var r=e.ArrayBuffer,i=e.Uint8Array;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],208:[function(e,t,n){arguments[4][82][0].apply(n,arguments)},{"../function/restParam":180,"./bindCallback":206,"./isIterateeCall":223,dup:82}],209:[function(e,t,n){arguments[4][83][0].apply(n,arguments)},{"./getLength":215,"./isLength":225,"./toObject":229,dup:83}],210:[function(e,t,n){arguments[4][84][0].apply(n,arguments)},{"./toObject":229,dup:84}],211:[function(e,t,n){arguments[4][91][0].apply(n,arguments)},{"../lang/isArray":234,"./bindCallback":206,dup:91}],212:[function(e,t,n){arguments[4][99][0].apply(n,arguments)},{"./arraySome":184,dup:99}],213:[function(e,t,n){arguments[4][100][0].apply(n,arguments)},{dup:100}],214:[function(e,t,n){arguments[4][101][0].apply(n,arguments)},{"../object/keys":241,dup:101}],215:[function(e,t,n){arguments[4][104][0].apply(n,arguments)},{"./baseProperty":202,dup:104}],216:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"../object/pairs":244,"./isStrictComparable":227,dup:105}],217:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"../lang/isNative":236,dup:106}],218:[function(e,t,n){function r(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&o.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var i=Object.prototype,o=i.hasOwnProperty;t.exports=r},{}],219:[function(e,t,n){function r(e,t,n){var r=e.constructor;switch(t){case c:return i(e);case o:case a:return new r(+e);case f:case p:case d:case h:case m:case v:case y:case g:case b:var j=e.buffer;return new r(n?i(j):j,e.byteOffset,e.length);case s:case l:return new r(e);case u:var w=new r(e.source,_.exec(e));w.lastIndex=e.lastIndex}return w}var i=e("./bufferClone"),o="[object Boolean]",a="[object Date]",s="[object Number]",u="[object RegExp]",l="[object String]",c="[object ArrayBuffer]",f="[object Float32Array]",p="[object Float64Array]",d="[object Int8Array]",h="[object Int16Array]",m="[object Int32Array]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",g="[object Uint16Array]",b="[object Uint32Array]",_=/\w*$/;t.exports=r},{"./bufferClone":207}],220:[function(e,t,n){function r(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=r},{}],221:[function(e,t,n){arguments[4][108][0].apply(n,arguments)},{"./getLength":215,"./isLength":225,dup:108}],222:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{dup:109}],223:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{"../lang/isObject":237,"./isArrayLike":221,"./isIndex":222,dup:110}],224:[function(e,t,n){arguments[4][111][0].apply(n,arguments);
},{"../lang/isArray":234,"./toObject":229,dup:111}],225:[function(e,t,n){arguments[4][113][0].apply(n,arguments)},{dup:113}],226:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],227:[function(e,t,n){arguments[4][116][0].apply(n,arguments)},{"../lang/isObject":237,dup:116}],228:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"../lang/isArguments":233,"../lang/isArray":234,"../object/keysIn":242,"./isIndex":222,"./isLength":225,dup:125}],229:[function(e,t,n){arguments[4][127][0].apply(n,arguments)},{"../lang/isObject":237,dup:127}],230:[function(e,t,n){arguments[4][128][0].apply(n,arguments)},{"../lang/isArray":234,"./baseToString":205,dup:128}],231:[function(e,t,n){function r(e,t,n,r){return t&&"boolean"!=typeof t&&a(e,t,n)?t=!1:"function"==typeof t&&(r=n,n=t,t=!1),"function"==typeof n?i(e,t,o(n,r,3)):i(e,t)}var i=e("../internal/baseClone"),o=e("../internal/bindCallback"),a=e("../internal/isIterateeCall");t.exports=r},{"../internal/baseClone":187,"../internal/bindCallback":206,"../internal/isIterateeCall":223}],232:[function(e,t,n){function r(e,t,n){return"function"==typeof t?i(e,!0,o(t,n,3)):i(e,!0)}var i=e("../internal/baseClone"),o=e("../internal/bindCallback");t.exports=r},{"../internal/baseClone":187,"../internal/bindCallback":206}],233:[function(e,t,n){arguments[4][132][0].apply(n,arguments)},{"../internal/isArrayLike":221,"../internal/isObjectLike":226,dup:132}],234:[function(e,t,n){arguments[4][133][0].apply(n,arguments)},{"../internal/getNative":217,"../internal/isLength":225,"../internal/isObjectLike":226,dup:133}],235:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{"./isObject":237,dup:136}],236:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"../internal/isObjectLike":226,"./isFunction":235,dup:137}],237:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],238:[function(e,t,n){arguments[4][140][0].apply(n,arguments)},{"../internal/baseForIn":191,"../internal/isObjectLike":226,"./isArguments":233,dup:140}],239:[function(e,t,n){arguments[4][142][0].apply(n,arguments)},{"../internal/isLength":225,"../internal/isObjectLike":226,dup:142}],240:[function(e,t,n){arguments[4][144][0].apply(n,arguments)},{"../internal/baseCopy":188,"../object/keysIn":242,dup:144}],241:[function(e,t,n){arguments[4][150][0].apply(n,arguments)},{"../internal/getNative":217,"../internal/isArrayLike":221,"../internal/shimKeys":228,"../lang/isObject":237,dup:150}],242:[function(e,t,n){arguments[4][151][0].apply(n,arguments)},{"../internal/isIndex":222,"../internal/isLength":225,"../lang/isArguments":233,"../lang/isArray":234,"../lang/isObject":237,dup:151}],243:[function(e,t,n){arguments[4][154][0].apply(n,arguments)},{"../internal/baseMerge":200,"../internal/createAssigner":208,dup:154}],244:[function(e,t,n){arguments[4][156][0].apply(n,arguments)},{"../internal/toObject":229,"./keys":241,dup:156}],245:[function(e,t,n){arguments[4][160][0].apply(n,arguments)},{dup:160}],246:[function(e,t,n){arguments[4][162][0].apply(n,arguments)},{"../internal/baseProperty":202,"../internal/basePropertyDeep":203,"../internal/isKey":224,dup:162}],247:[function(e,t,n){"use strict";function r(t,n,r){var o=e("debug")("algoliasearch"),a=e("lodash/lang/clone"),s=e("lodash/lang/isArray"),u=e("lodash/collection/map"),l="Usage: algoliasearch(applicationID, apiKey, opts)";if(!t)throw new c.AlgoliaSearchError("Please provide an application ID. "+l);if(!n)throw new c.AlgoliaSearchError("Please provide an API key. "+l);this.applicationID=t,this.apiKey=n;var f=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]},this.hostIndex={read:0,write:0},r=r||{};var p=r.protocol||"https:",d=void 0===r.timeout?2e3:r.timeout;if(/:$/.test(p)||(p+=":"),"http:"!==r.protocol&&"https:"!==r.protocol)throw new c.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+r.protocol+"`)");r.hosts?s(r.hosts)?(this.hosts.read=a(r.hosts),this.hosts.write=a(r.hosts)):(this.hosts.read=a(r.hosts.read),this.hosts.write=a(r.hosts.write)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(f),this.hosts.write=[this.applicationID+".algolia.net"].concat(f)),this.hosts.read=u(this.hosts.read,i(p)),this.hosts.write=u(this.hosts.write,i(p)),this.requestTimeout=d,this.extraHeaders=[],this.cache=r._cache||{},this._ua=r._ua,this._useCache=void 0===r._useCache||r._cache?!0:r._useCache,this._useFallback=void 0===r.useFallback?!0:r.useFallback,this._setTimeout=r._setTimeout,o("init done, %j",this)}function i(e){return function(t){return e+"//"+t.toLowerCase()}}function o(){var e="Not implemented in this environment.\nIf you feel this is a mistake, write to [email protected]";throw new c.AlgoliaSearchError(e)}function a(e,t){var n=e.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+n}function s(e,t){t(e,0)}function u(e,t){function n(){return r||(console.log(t),r=!0),e.apply(this,arguments)}var r=!1;return n}function l(e){if(void 0===Array.prototype.toJSON)return JSON.stringify(e);var t=Array.prototype.toJSON;delete Array.prototype.toJSON;var n=JSON.stringify(e);return Array.prototype.toJSON=t,n}t.exports=r;var c=e("./errors"),f=e("./buildSearchMethod.js"),p=500;r.prototype={deleteIndex:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(e),hostType:"write",callback:t})},moveIndex:function(e,t,n){var r={operation:"move",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},copyIndex:function(e,t,n){var r={operation:"copy",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},getLogs:function(e,t,n){return 0===arguments.length||"function"==typeof e?(n=e,e=0,t=10):1!==arguments.length&&"function"!=typeof t||(n=t,t=10),this._jsonRequest({method:"GET",url:"/1/logs?offset="+e+"&length="+t,hostType:"read",callback:n})},listIndexes:function(e,t){var n="";return void 0===e||"function"==typeof e?t=e:n="?page="+e,this._jsonRequest({method:"GET",url:"/1/indexes"+n,hostType:"read",callback:t})},initIndex:function(e){return new this.Index(this,e)},listUserKeys:function(e){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){return this._jsonRequest({method:"GET",url:"/1/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+e,hostType:"write",callback:t})},addUserKey:function(t,n,r){var i=e("lodash/lang/isArray"),o="Usage: client.addUserKey(arrayOfAcls[, params, callback])";if(!i(t))throw new Error(o);1!==arguments.length&&"function"!=typeof n||(r=n,n=null);var a={acl:t};return n&&(a.validity=n.validity,a.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,a.maxHitsPerQuery=n.maxHitsPerQuery,a.indexes=n.indexes,a.description=n.description,n.queryParameters&&(a.queryParameters=this._getSearchParams(n.queryParameters,"")),a.referers=n.referers),this._jsonRequest({method:"POST",url:"/1/keys",body:a,hostType:"write",callback:r})},addUserKeyWithValidity:u(function(e,t,n){return this.addUserKey(e,t,n)},a("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(t,n,r,i){var o=e("lodash/lang/isArray"),a="Usage: client.updateUserKey(key, arrayOfAcls[, params, callback])";if(!o(n))throw new Error(a);2!==arguments.length&&"function"!=typeof r||(i=r,r=null);var s={acl:n};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.indexes=r.indexes,s.description=r.description,r.queryParameters&&(s.queryParameters=this._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this._jsonRequest({method:"PUT",url:"/1/keys/"+t,body:s,hostType:"write",callback:i})},setSecurityTags:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],n=0;n<e.length;++n)if("[object Array]"===Object.prototype.toString.call(e[n])){for(var r=[],i=0;i<e[n].length;++i)r.push(e[n][i]);t.push("("+r.join(",")+")")}else t.push(e[n]);e=t.join(",")}this.securityTags=e},setUserToken:function(e){this.userToken=e},startQueriesBatch:u(function(){this._batch=[]},a("client.startQueriesBatch()","client.search()")),addQueryInBatch:u(function(e,t,n){this._batch.push({indexName:e,query:t,params:n})},a("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:u(function(e){return this.search(this._batch,e)},a("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(e){e&&(this.requestTimeout=parseInt(e,10))},search:function(t,n){var r=e("lodash/lang/isArray"),i=e("lodash/collection/map"),o="Usage: client.search(arrayOfQueries[, callback])";if(!r(t))throw new Error(o);var a=this,s={requests:i(t,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:a._getSearchParams(e.params,t)}})},u=i(s.requests,function(e,t){return t+"="+encodeURIComponent("/1/indexes/"+encodeURIComponent(e.indexName)+"?"+e.params)}).join("&");return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:s,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:u}},callback:n})},batch:function(t,n){var r=e("lodash/lang/isArray"),i="Usage: client.batch(operations[, callback])";if(!r(t))throw new Error(i);return this._jsonRequest({method:"POST",url:"/1/indexes/*/batch",body:{requests:t},hostType:"write",callback:n})},destroy:o,enableRateLimitForward:o,disableRateLimitForward:o,useSecuredAPIKey:o,disableSecuredAPIKey:o,generateSecuredApiKey:o,Index:function(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}},setExtraHeader:function(e,t){this.extraHeaders.push({name:e.toLowerCase(),value:t})},addAlgoliaAgent:function(e){this._ua+=";"+e},_jsonRequest:function(t){function n(e,s){function p(e){var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200;o("received response: statusCode: %s, computed statusCode: %d, headers: %j",e.statusCode,t,e.headers);var n=200===t||201===t,r=!n&&4!==Math.floor(t/100)&&1!==Math.floor(t/100);if(u._useCache&&n&&a&&(a[y]=e.responseText),n)return e.body;if(r)return f+=1,v();var i=new c.AlgoliaSearchError(e.body&&e.body.message);return u._promise.reject(i)}function m(r){return o("error: %s, stack: %s",r.message,r.stack),r instanceof c.AlgoliaSearchError||(r=new c.Unknown(r&&r.message,r)),f+=1,r instanceof c.Unknown||r instanceof c.UnparsableJSON||f>=u.hosts[t.hostType].length&&(d||!h)?u._promise.reject(r):(u.hostIndex[t.hostType]=++u.hostIndex[t.hostType]%u.hosts[t.hostType].length,r instanceof c.RequestTimeout?v():(d||(f=1/0),n(e,s)))}function v(){return u.hostIndex[t.hostType]=++u.hostIndex[t.hostType]%u.hosts[t.hostType].length,s.timeout=u.requestTimeout*(f+1),n(e,s)}var y;if(u._useCache&&(y=t.url),u._useCache&&r&&(y+="_body_"+s.body),u._useCache&&a&&void 0!==a[y])return o("serving response from cache"),u._promise.resolve(JSON.parse(a[y]));if(f>=u.hosts[t.hostType].length)return!h||d?(o("could not get any response"),u._promise.reject(new c.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to [email protected] to report and resolve the issue. Application id was: "+u.applicationID))):(o("switching to fallback"),f=0,s.method=t.fallback.method,s.url=t.fallback.url,s.jsonBody=t.fallback.body,s.jsonBody&&(s.body=l(s.jsonBody)),i=u._computeRequestHeaders(),s.timeout=u.requestTimeout*(f+1),u.hostIndex[t.hostType]=0,d=!0,n(u._request.fallback,s));var g=u.hosts[t.hostType][u.hostIndex[t.hostType]]+s.url,b={body:s.body,jsonBody:s.jsonBody,method:s.method,headers:i,timeout:s.timeout,debug:o};return o("method: %s, url: %s, headers: %j, timeout: %d",b.method,g,b.headers,b.timeout),e===u._request.fallback&&o("using fallback"),e.call(u,g,b).then(p,m)}var r,i,o=e("debug")("algoliasearch:"+t.url),a=t.cache,u=this,f=0,d=!1,h=u._useFallback&&u._request.fallback&&t.fallback;this.apiKey.length>p&&void 0!==t.body&&void 0!==t.body.params?(t.body.apiKey=this.apiKey,i=this._computeRequestHeaders(!1)):i=this._computeRequestHeaders(),void 0!==t.body&&(r=l(t.body)),o("request start");var m=n(u._request,{url:t.url,method:t.method,body:r,jsonBody:t.body,timeout:u.requestTimeout*(f+1)});return t.callback?void m.then(function(e){s(function(){t.callback(null,e)},u._setTimeout||setTimeout)},function(e){s(function(){t.callback(e)},u._setTimeout||setTimeout)}):m},_getSearchParams:function(e,t){if(void 0===e||null===e)return t;for(var n in e)null!==n&&void 0!==e[n]&&e.hasOwnProperty(n)&&(t+=""===t?"":"&",t+=n+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[n])?l(e[n]):e[n]));return t},_computeRequestHeaders:function(t){var n=e("lodash/collection/forEach"),r={"x-algolia-agent":this._ua,"x-algolia-application-id":this.applicationID};return t!==!1&&(r["x-algolia-api-key"]=this.apiKey),this.userToken&&(r["x-algolia-usertoken"]=this.userToken),this.securityTags&&(r["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&n(this.extraHeaders,function(e){r[e.name]=e.value}),r}},r.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,t,n){var r=this;return 1!==arguments.length&&"function"!=typeof t||(n=t,t=void 0),this.as._jsonRequest({method:void 0!==t?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(r.indexName)+(void 0!==t?"/"+encodeURIComponent(t):""),body:e,hostType:"write",callback:n})},addObjects:function(t,n){var r=e("lodash/lang/isArray"),i="Usage: index.addObjects(arrayOfObjects[, callback])";if(!r(t))throw new Error(i);for(var o=this,a={requests:[]},s=0;s<t.length;++s){var u={action:"addObject",body:t[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:a,hostType:"write",callback:n})},getObject:function(e,t,n){var r=this;1!==arguments.length&&"function"!=typeof t||(n=t,t=void 0);var i="";if(void 0!==t){i="?attributes=";for(var o=0;o<t.length;++o)0!==o&&(i+=","),i+=t[o]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e)+i,hostType:"read",callback:n})},getObjects:function(t,n,r){var i=e("lodash/lang/isArray"),o=e("lodash/collection/map"),a="Usage: index.getObjects(arrayOfObjectIDs[, callback])";if(!i(t))throw new Error(a);var s=this;1!==arguments.length&&"function"!=typeof n||(r=n,n=void 0);var u={requests:o(t,function(e){var t={indexName:s.indexName,objectID:e};return n&&(t.attributesToRetrieve=n.join(",")),t})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:u,callback:r})},partialUpdateObject:function(e,t,n){1!==arguments.length&&"function"!=typeof t||(n=t,t=void 0);var r=this,i="/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e.objectID)+"/partial";return t===!1&&(i+="?createIfNotExists=false"),this.as._jsonRequest({method:"POST",url:i,body:e,hostType:"write",callback:n})},partialUpdateObjects:function(t,n){var r=e("lodash/lang/isArray"),i="Usage: index.partialUpdateObjects(arrayOfObjects[, callback])";if(!r(t))throw new Error(i);for(var o=this,a={requests:[]},s=0;s<t.length;++s){var u={action:"partialUpdateObject",objectID:t[s].objectID,body:t[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:a,hostType:"write",callback:n})},saveObject:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e.objectID),body:e,hostType:"write",callback:t})},saveObjects:function(t,n){var r=e("lodash/lang/isArray"),i="Usage: index.saveObjects(arrayOfObjects[, callback])";if(!r(t))throw new Error(i);for(var o=this,a={requests:[]},s=0;s<t.length;++s){var u={action:"updateObject",objectID:t[s].objectID,body:t[s]};a.requests.push(u)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:a,hostType:"write",callback:n})},deleteObject:function(e,t){if("function"==typeof e||"string"!=typeof e&&"number"!=typeof e){var n=new c.AlgoliaSearchError("Cannot delete an object without an objectID");return t=e,"function"==typeof t?t(n):this.as._promise.reject(n)}var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e),hostType:"write",callback:t})},deleteObjects:function(t,n){var r=e("lodash/lang/isArray"),i=e("lodash/collection/map"),o="Usage: index.deleteObjects(arrayOfObjectIDs[, callback])";if(!r(t))throw new Error(o);var a=this,s={requests:i(t,function(e){return{action:"deleteObject",objectID:e,body:{objectID:e}}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/batch",body:s,hostType:"write",callback:n})},deleteByQuery:function(t,n,r){function i(e){if(0===e.nbHits)return e;var t=f(e.hits,function(e){return e.objectID});return p.deleteObjects(t).then(o).then(a)}function o(e){return p.waitTask(e.taskID)}function a(){return p.deleteByQuery(t,n)}function u(){s(function(){r(null)},d._setTimeout||setTimeout)}function l(e){s(function(){r(e)},d._setTimeout||setTimeout)}var c=e("lodash/lang/clone"),f=e("lodash/collection/map"),p=this,d=p.as;1===arguments.length||"function"==typeof n?(r=n,n={}):n=c(n),n.attributesToRetrieve="objectID",n.hitsPerPage=1e3,n.distinct=!1,this.clearCache();var h=this.search(t,n).then(i);return r?void h.then(u,l):h},search:f("query"),similarSearch:f("similarQuery"),browse:function(t,n,r){var i,o,a=e("lodash/object/merge"),s=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(i=0,r=arguments[0],t=void 0):"number"==typeof arguments[0]?(i=arguments[0],"number"==typeof arguments[1]?o=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],o=void 0),t=void 0,n=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),n=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],n=void 0),n=a({},n||{},{page:i,hitsPerPage:o,query:t});var u=this.as._getSearchParams(n,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(s.indexName)+"/browse?"+u,hostType:"read",callback:r})},browseFrom:function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+encodeURIComponent(e),hostType:"read",callback:t})},browseAll:function(t,n){function r(e){if(!s._stopped){var t;t=void 0!==e?"cursor="+encodeURIComponent(e):c,u._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(l.indexName)+"/browse?"+t,hostType:"read",callback:i})}}function i(e,t){return s._stopped?void 0:e?void s._error(e):(s._result(t),void 0===t.cursor?void s._end():void r(t.cursor))}"object"==typeof t&&(n=t,t=void 0);var o=e("lodash/object/merge"),a=e("./IndexBrowser"),s=new a,u=this.as,l=this,c=u._getSearchParams(o({},n||{},{query:t}),"");return r(),s},ttAdapter:function(e){var t=this;return function(n,r,i){var o;o="function"==typeof i?i:r,t.search(n,e,function(e,t){return e?void o(e):void o(t.hits)})}},waitTask:function(e,t){function n(){return c._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(l.indexName)+"/task/"+e}).then(function(e){u++;var t=o*u*u;return t>a&&(t=a),"published"!==e.status?c._promise.delay(t).then(n):e})}function r(e){s(function(){t(null,e)},c._setTimeout||setTimeout)}function i(e){s(function(){t(e)},c._setTimeout||setTimeout)}var o=100,a=5e3,u=0,l=this,c=l.as,f=n();return t?void f.then(r,i):f},clearIndex:function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},getSettings:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings",hostType:"read",callback:e})},setSettings:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings",hostType:"write",body:e,callback:t})},listUserKeys:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){var n=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){var n=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"write",callback:t})},addUserKey:function(t,n,r){var i=e("lodash/lang/isArray"),o="Usage: index.addUserKey(arrayOfAcls[, params, callback])";if(!i(t))throw new Error(o);1!==arguments.length&&"function"!=typeof n||(r=n,n=null);var a={acl:t};return n&&(a.validity=n.validity,a.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,a.maxHitsPerQuery=n.maxHitsPerQuery,a.description=n.description,n.queryParameters&&(a.queryParameters=this.as._getSearchParams(n.queryParameters,"")),a.referers=n.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:a,hostType:"write",callback:r})},addUserKeyWithValidity:u(function(e,t,n){return this.addUserKey(e,t,n)},a("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(t,n,r,i){var o=e("lodash/lang/isArray"),a="Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])";if(!o(n))throw new Error(a);2!==arguments.length&&"function"!=typeof r||(i=r,r=null);var s={acl:n};return r&&(s.validity=r.validity,s.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour,s.maxHitsPerQuery=r.maxHitsPerQuery,s.description=r.description,r.queryParameters&&(s.queryParameters=this.as._getSearchParams(r.queryParameters,"")),s.referers=r.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+t,body:s,hostType:"write",callback:i})},_search:function(e,t,n){return this.as._jsonRequest({cache:this.cache,method:"POST",url:t||"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:n})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}},{"./IndexBrowser":248,"./buildSearchMethod.js":253,"./errors":254,debug:274,"lodash/collection/forEach":178,"lodash/collection/map":179,"lodash/lang/clone":231,"lodash/lang/isArray":234,"lodash/object/merge":243}],248:[function(e,t,n){"use strict";function r(){}t.exports=r;var i=e("inherits"),o=e("events").EventEmitter;i(r,o),r.prototype.stop=function(){this._stopped=!0,this._clean()},r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(e){this.emit("error",e),this._clean()},r.prototype._result=function(e){this.emit("result",e)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{events:278,inherits:326}],249:[function(e,t,n){(function(n){"use strict";function r(t,n,o){var a=e("lodash/lang/cloneDeep"),s=e("../get-document-protocol");return o=a(o||{}),void 0===o.protocol&&(o.protocol=s()),o._ua=o._ua||r.ua,new i(t,n,o)}function i(){s.apply(this,arguments)}t.exports=r;var o=e("inherits"),a=window.Promise||e("es6-promise").Promise,s=e("../../AlgoliaSearch"),u=e("../../errors"),l=e("../inline-headers"),c=e("../jsonp-request"),f=e("../../places.js");"development"===n.env.APP_ENV&&e("debug").enable("algoliasearch*"),r.version=e("../../version.js"),r.ua="Algolia for vanilla JavaScript "+r.version,r.initPlaces=f(r),window.__algolia={debug:e("debug"),algoliasearch:r};var p={hasXMLHttpRequest:"XMLHttpRequest"in window,hasXDomainRequest:"XDomainRequest"in window,cors:"withCredentials"in new XMLHttpRequest,timeout:"timeout"in new XMLHttpRequest};o(i,s),i.prototype._request=function(e,t){return new a(function(n,r){function i(){if(!c){p.timeout||clearTimeout(s);var e;try{e={body:JSON.parse(d.responseText),responseText:d.responseText,statusCode:d.status,headers:d.getAllResponseHeaders&&d.getAllResponseHeaders()||{}}}catch(t){e=new u.UnparsableJSON({more:d.responseText})}e instanceof u.UnparsableJSON?r(e):n(e)}}function o(e){c||(p.timeout||clearTimeout(s),r(new u.Network({more:e})))}function a(){p.timeout||(c=!0,d.abort()),r(new u.RequestTimeout)}if(!p.cors&&!p.hasXDomainRequest)return void r(new u.Network("CORS not supported"));e=l(e,t.headers);var s,c,f=t.body,d=p.cors?new XMLHttpRequest:new XDomainRequest;d instanceof XMLHttpRequest?d.open(t.method,e,!0):d.open(t.method,e),p.cors&&(f&&("POST"===t.method?d.setRequestHeader("content-type","application/x-www-form-urlencoded"):d.setRequestHeader("content-type","application/json")),d.setRequestHeader("accept","application/json")),d.onprogress=function(){},d.onload=i,d.onerror=o,p.timeout?(d.timeout=t.timeout,d.ontimeout=a):s=setTimeout(a,t.timeout),d.send(f)})},i.prototype._request.fallback=function(e,t){return e=l(e,t.headers),new a(function(n,r){c(e,t,function(e,t){return e?void r(e):void n(t)})})},i.prototype._promise={reject:function(e){return a.reject(e)},resolve:function(e){return a.resolve(e)},delay:function(e){return new a(function(t){setTimeout(t,e)})}}}).call(this,e("_process"))},{"../../AlgoliaSearch":247,"../../errors":254,"../../places.js":255,"../../version.js":256,"../get-document-protocol":250,"../inline-headers":251,"../jsonp-request":252,_process:673,debug:274,"es6-promise":277,inherits:326,"lodash/lang/cloneDeep":232}],250:[function(e,t,n){"use strict";function r(){var e=window.document.location.protocol;return"http:"!==e&&"https:"!==e&&(e="http:"),e}t.exports=r},{}],251:[function(e,t,n){"use strict";function r(e,t){return e+=/\?/.test(e)?"&":"?",e+i.encode(t)}t.exports=r;var i=e("querystring")},{querystring:680}],252:[function(e,t,n){"use strict";function r(e,t,n){function r(){t.debug("JSONP: success"),m||f||(m=!0,c||(t.debug("JSONP: Fail. Script loaded but did not call the callback"),s(),n(new i.JSONPScriptFail)))}function a(){"loaded"!==this.readyState&&"complete"!==this.readyState||r()}function s(){clearTimeout(v),d.onload=null,d.onreadystatechange=null,d.onerror=null,p.removeChild(d);try{delete window[h],delete window[h+"_loaded"]}catch(e){window[h]=null,window[h+"_loaded"]=null}}function u(){t.debug("JSONP: Script timeout"),f=!0,s(),n(new i.RequestTimeout)}function l(){t.debug("JSONP: Script error"),m||f||(s(),n(new i.JSONPScriptError))}if("GET"!==t.method)return void n(new Error("Method "+t.method+" "+e+" is not supported by JSONP."));t.debug("JSONP: start");var c=!1,f=!1;o+=1;var p=document.getElementsByTagName("head")[0],d=document.createElement("script"),h="algoliaJSONP_"+o,m=!1;window[h]=function(e){try{delete window[h]}catch(t){window[h]=void 0}f||(c=!0,s(),n(null,{body:e}))},e+="&callback="+h,t.jsonBody&&t.jsonBody.params&&(e+="&"+t.jsonBody.params);var v=setTimeout(u,t.timeout);d.onreadystatechange=a,d.onload=r,d.onerror=l,d.async=!0,d.defer=!0,d.src=e,p.appendChild(d)}t.exports=r;var i=e("../errors"),o=0},{"../errors":254}],253:[function(e,t,n){function r(e,t){return function(n,r,o){if("function"==typeof n&&"object"==typeof r||"object"==typeof o)throw new i.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof n?(o=n,n=""):1!==arguments.length&&"function"!=typeof r||(o=r,r=void 0),"object"==typeof n&&null!==n?(r=n,n=void 0):void 0!==n&&null!==n||(n="");var a="";return void 0!==n&&(a+=e+"="+encodeURIComponent(n)),void 0!==r&&(a=this.as._getSearchParams(r,a)),this._search(a,t,o)}}t.exports=r;var i=e("./errors.js")},{"./errors.js":254}],254:[function(e,t,n){"use strict";function r(t,n){var r=e("lodash/collection/forEach"),i=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):i.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name=this.constructor.name,this.message=t||"Unknown error",n&&r(n,function(e,t){i[t]=e})}function i(e,t){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(t),r.apply(this,n),this.name="AlgoliaSearch"+e+"Error"}return o(n,r),n}var o=e("inherits");o(r,Error),t.exports={AlgoliaSearchError:r,UnparsableJSON:i("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:i("RequestTimeout","Request timedout before getting a response"),Network:i("Network","Network issue, see err.more for details"),JSONPScriptFail:i("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:i("Unknown","Unknown error occured")}},{inherits:326,"lodash/collection/forEach":178}],255:[function(e,t,n){function r(t){return function(n,r,o){var a=e("lodash/lang/cloneDeep");o=o&&a(o)||{},o.hosts=o.hosts||["places-dsn.algolia.net","places-1.algolianet.com","places-2.algolianet.com","places-3.algolianet.com"];var s=t(n,r,o),u=s.initIndex("places");return u.search=i("query","/1/places/query"),u}}t.exports=r;var i=e("./buildSearchMethod.js")},{"./buildSearchMethod.js":253,"lodash/lang/cloneDeep":232}],256:[function(e,t,n){"use strict";t.exports="3.13.0"},{}],257:[function(e,t,n){"use strict";t.exports=e("./src/standalone/")},{"./src/standalone/":271}],258:[function(e,t,n){"use strict";var r=e("../common/utils.js"),i={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"}};r.isMsie()&&r.mixin(i.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),r.isMsie()&&r.isMsie()<=7&&r.mixin(i.input,{marginTop:"-1px"}),t.exports=i},{"../common/utils.js":267}],259:[function(e,t,n){"use strict";function r(e){e=e||{},e.templates=e.templates||{},e.source||c.error("missing source"),e.name&&!a(e.name)&&c.error("invalid dataset name: "+e.name),this.query=null,this.highlight=!!e.highlight,this.name="undefined"==typeof e.name||null===e.name?c.getUniqueId():e.name,this.source=e.source,this.displayFn=i(e.display||e.displayKey),this.templates=o(e.templates,this.displayFn),this.$el=e.$menu&&e.$menu.find(".aa-dataset-"+this.name).length>0?f.element(e.$menu.find(".aa-dataset-"+this.name)[0]):f.element(p.dataset.replace("%CLASS%",this.name)),this.$menu=e.$menu}function i(e){function t(t){return t[e]}return e=e||"value",c.isFunction(e)?e:t}function o(e,t){function n(e){return"<p>"+t(e)+"</p>"}return{empty:e.empty&&c.templatify(e.empty),header:e.header&&c.templatify(e.header),footer:e.footer&&c.templatify(e.footer),suggestion:e.suggestion||n}}function a(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var s="aaDataset",u="aaValue",l="aaDatum",c=e("../common/utils.js"),f=e("../common/dom.js"),p=e("./html.js"),d=e("./css.js"),h=e("./event_emitter.js");r.extractDatasetName=function(e){return f.element(e).data(s)},r.extractValue=function(e){return f.element(e).data(u)},r.extractDatum=function(e){var t=f.element(e).data(l);return"string"==typeof t&&(t=JSON.parse(t)),t},c.mixin(r.prototype,h,{_render:function(e,t){function n(){var t=[].slice.call(arguments,0);return t=[{
query:e,isEmpty:!0}].concat(t),h.templates.empty.apply(this,t)}function r(){function e(e){var t;return t=f.element(p.suggestion).append(h.templates.suggestion.apply(this,[e].concat(i))),t.data(s,h.name),t.data(u,h.displayFn(e)||void 0),t.data(l,JSON.stringify(e)),t.children().each(function(){f.element(this).css(d.suggestionChild)}),t}var n,r,i=[].slice.call(arguments,0);return n=f.element(p.suggestions).css(d.suggestions),r=c.map(t,e),n.append.apply(n,r),n}function i(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!a}].concat(t),h.templates.header.apply(this,t)}function o(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!a}].concat(t),h.templates.footer.apply(this,t)}if(this.$el){var a,h=this,m=[].slice.call(arguments,2);this.$el.empty(),a=t&&t.length,!a&&this.templates.empty?this.$el.html(n.apply(this,m)).prepend(h.templates.header?i.apply(this,m):null).append(h.templates.footer?o.apply(this,m):null):a&&this.$el.html(r.apply(this,m)).prepend(h.templates.header?i.apply(this,m):null).append(h.templates.footer?o.apply(this,m):null),this.$menu&&this.$menu.addClass("aa-"+(a?"with":"without")+"-"+this.name).removeClass("aa-"+(a?"without":"with")+"-"+this.name),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(e){function t(t){if(!n.canceled&&e===n.query){var r=[].slice.call(arguments,1);r=[e,t].concat(r),n._render.apply(n,r)}}var n=this;this.query=e,this.canceled=!1,this.source(e,t)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),t.exports=r},{"../common/dom.js":266,"../common/utils.js":267,"./css.js":258,"./event_emitter.js":262,"./html.js":263}],260:[function(e,t,n){"use strict";function r(e){var t,n,r,s=this;e=e||{},e.menu||o.error("menu is required"),o.isArray(e.datasets)||o.isObject(e.datasets)||o.error("1 or more datasets required"),e.datasets||o.error("datasets is required"),this.isOpen=!1,this.isEmpty=!0,t=o.bind(this._onSuggestionClick,this),n=o.bind(this._onSuggestionMouseEnter,this),r=o.bind(this._onSuggestionMouseLeave,this),this.$menu=a.element(e.menu).on("click.aa",".aa-suggestion",t).on("mouseenter.aa",".aa-suggestion",n).on("mouseleave.aa",".aa-suggestion",r),e.templates&&e.templates.header&&this.$menu.prepend(o.templatify(e.templates.header)()),this.datasets=o.map(e.datasets,function(e){return i(s.$menu,e)}),o.each(this.datasets,function(e){var t=e.getRoot();t&&0===t.parent().length&&s.$menu.append(t),e.onSync("rendered",s._onRendered,s)}),e.templates&&e.templates.footer&&this.$menu.append(o.templatify(e.templates.footer)())}function i(e,t){return new r.Dataset(o.mixin({$menu:e},t))}var o=e("../common/utils.js"),a=e("../common/dom.js"),s=e("./event_emitter.js"),u=e("./dataset.js"),l=e("./css.js");o.mixin(r.prototype,s,{_onSuggestionClick:function(e){this.trigger("suggestionClicked",a.element(e.currentTarget))},_onSuggestionMouseEnter:function(e){this._removeCursor(),this._setCursor(a.element(e.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function e(e){return e.isEmpty()}this.isEmpty=o.every(this.datasets,e),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".aa-suggestion")},_getCursor:function(){return this.$menu.find(".aa-cursor").first()},_setCursor:function(e,t){e.first().addClass("aa-cursor"),t||this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("aa-cursor")},_moveCursor:function(e){var t,n,r,i;if(this.isOpen){if(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),r=t.index(n)+e,r=(r+1)%(t.length+1)-1,-1===r)return void this.trigger("cursorRemoved");-1>r&&(r=t.length-1),this._setCursor(i=t.eq(r)),this._ensureVisible(i)}},_ensureVisible:function(e){var t,n,r,i;t=e.position().top,n=t+e.height()+parseInt(e.css("margin-top"),10)+parseInt(e.css("margin-bottom"),10),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),0>t?this.$menu.scrollTop(r+t):n>i&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:u.extractDatum(e),value:u.extractValue(e),datasetName:u.extractDatasetName(e)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(e){function t(t){t.update(e)}o.each(this.datasets,t)},empty:function(){function e(e){e.clear()}o.each(this.datasets,e),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function e(e){e.destroy()}this.$menu.off(".aa"),this.$menu=null,o.each(this.datasets,e)}}),r.Dataset=u,t.exports=r},{"../common/dom.js":266,"../common/utils.js":267,"./css.js":258,"./dataset.js":259,"./event_emitter.js":262}],261:[function(e,t,n){"use strict";function r(e){e&&e.el||o.error("EventBus initialized without el"),this.$el=a.element(e.el)}var i="autocomplete:",o=e("../common/utils.js"),a=e("../common/dom.js");o.mixin(r.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(i+e,t)}}),t.exports=r},{"../common/dom.js":266,"../common/utils.js":267}],262:[function(e,t,n){"use strict";function r(e,t,n,r){var i;if(!n)return this;for(t=t.split(f),n=r?c(n,r):n,this._callbacks=this._callbacks||{};i=t.shift();)this._callbacks[i]=this._callbacks[i]||{sync:[],async:[]},this._callbacks[i][e].push(n);return this}function i(e,t,n){return r.call(this,"async",e,t,n)}function o(e,t,n){return r.call(this,"sync",e,t,n)}function a(e){var t;if(!this._callbacks)return this;for(e=e.split(f);t=e.shift();)delete this._callbacks[t];return this}function s(e){var t,n,r,i,o;if(!this._callbacks)return this;for(e=e.split(f),r=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)i=u(n.sync,this,[t].concat(r)),o=u(n.async,this,[t].concat(r)),i()&&p(o);return this}function u(e,t,n){function r(){for(var r,i=0,o=e.length;!r&&o>i;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function l(){var e;return e=window.setImmediate?function(e){setImmediate(function(){e()})}:function(e){setTimeout(function(){e()},0)}}function c(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var f=/\s+/,p=l();t.exports={onSync:o,onAsync:i,off:a,trigger:s}},{}],263:[function(e,t,n){"use strict";t.exports={wrapper:'<span class="algolia-autocomplete"></span>',dropdown:'<span class="aa-dropdown-menu"></span>',dataset:'<div class="aa-dataset-%CLASS%"></div>',suggestions:'<span class="aa-suggestions"></span>',suggestion:'<div class="aa-suggestion"></div>'}},{}],264:[function(e,t,n){"use strict";function r(e){var t,n,r,o,a=this;e=e||{},e.input||u.error("input is missing"),t=u.bind(this._onBlur,this),n=u.bind(this._onFocus,this),r=u.bind(this._onKeydown,this),o=u.bind(this._onInput,this),this.$hint=l.element(e.hint),this.$input=l.element(e.input).on("blur.aa",t).on("focus.aa",n).on("keydown.aa",r),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=u.noop),u.isMsie()?this.$input.on("keydown.aa keypress.aa cut.aa paste.aa",function(e){s[e.which||e.keyCode]||u.defer(u.bind(a._onInput,a,e))}):this.$input.on("input.aa",o),this.query=this.$input.val(),this.$overflowHelper=i(this.$input)}function i(e){return l.element('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:e.css("font-family"),fontSize:e.css("font-size"),fontStyle:e.css("font-style"),fontVariant:e.css("font-variant"),fontWeight:e.css("font-weight"),wordSpacing:e.css("word-spacing"),letterSpacing:e.css("letter-spacing"),textIndent:e.css("text-indent"),textRendering:e.css("text-rendering"),textTransform:e.css("text-transform")}).insertAfter(e)}function o(e,t){return r.normalizeQuery(e)===r.normalizeQuery(t)}function a(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var s;s={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};var u=e("../common/utils.js"),l=e("../common/dom.js"),c=e("./event_emitter.js");r.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},u.mixin(r.prototype,c,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=s[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!a(t);break;case"up":case"down":n=!a(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!a(t);break;default:n=!0}return n},_checkInputValue:function(){var e,t,n;e=this.getInputValue(),t=o(e,this.query),n=t&&this.query?this.query.length!==e.length:!1,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){"undefined"==typeof e&&(e=this.query),this.$input.val(e),t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n,r;e=this.getInputValue(),t=this.getHint(),n=e!==t&&0===t.indexOf(e),r=""!==e&&n&&!this.hasOverflow(),r||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,t,n;return e=this.$input.val().length,t=this.$input[0].selectionStart,u.isNumber(t)?t===e:document.selection?(n=document.selection.createRange(),n.moveStart("character",-e),e===n.text.length):!0},destroy:function(){this.$hint.off(".aa"),this.$input.off(".aa"),this.$hint=this.$input=this.$overflowHelper=null}}),t.exports=r},{"../common/dom.js":266,"../common/utils.js":267,"./event_emitter.js":262}],265:[function(e,t,n){"use strict";function r(e){var t,n,o;e=e||{},e.input||u.error("missing input"),this.isActivated=!1,this.debug=!!e.debug,this.autoselect=!!e.autoselect,this.openOnFocus=!!e.openOnFocus,this.minLength=u.isNumber(e.minLength)?e.minLength:1,this.$node=i(e),t=this.$node.find(".aa-dropdown-menu"),n=this.$node.find(".aa-input"),o=this.$node.find(".aa-hint"),e.dropdownMenuContainer&&l.element(e.dropdownMenuContainer).css("position","relative").append(t.css("top","0")),n.on("blur.aa",function(e){var r=document.activeElement;u.isMsie()&&(t.is(r)||t.has(r).length>0)&&(e.preventDefault(),e.stopImmediatePropagation(),u.defer(function(){n.focus()}))}),t.on("mousedown.aa",function(e){e.preventDefault()}),this.eventBus=e.eventBus||new c({el:n}),this.dropdown=new r.Dropdown({menu:t,datasets:e.datasets,templates:e.templates}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new r.Input({input:n,hint:o}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function i(e){var t,n,r,i;t=l.element(e.input),n=l.element(d.wrapper).css(h.wrapper),"block"===t.css("display")&&"table"===t.parent().css("display")&&n.css("display","table-cell"),r=l.element(d.dropdown).css(h.dropdown),e.templates&&e.templates.dropdownMenu&&r.html(u.templatify(e.templates.dropdownMenu)()),i=t.clone().css(h.hint).css(o(t)),i.val("").addClass("aa-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),i.removeData&&i.removeData(),t.data(s,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass("aa-input").attr({autocomplete:"off",spellcheck:!1}).css(e.hint?h.input:h.inputWithNoHint);try{t.attr("dir")||t.attr("dir","auto")}catch(a){}return t.wrap(n).parent().prepend(e.hint?i:null).append(r)}function o(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function a(e){var t=e.find(".aa-input");u.each(t.data(s),function(e,n){void 0===e?t.removeAttr(n):t.attr(n,e)}),t.detach().removeClass("aa-input").insertAfter(e),t.removeData&&t.removeData(s),e.remove()}var s="aaAttrs",u=e("../common/utils.js"),l=e("../common/dom.js"),c=e("./event_bus.js"),f=e("./input.js"),p=e("./dropdown.js"),d=e("./html.js"),h=e("./css.js");u.mixin(r.prototype,{_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n)},_onCursorMoved:function(){var e=this.dropdown.getDatumForCursor();this.input.setInputValue(e.value,!0),this.eventBus.trigger("cursorchanged",e.raw,e.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint(),this.eventBus.trigger("updated")},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){if(this.isActivated=!0,this.openOnFocus){var e=this.input.getQuery();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty(),this.dropdown.open()}},_onBlurred:function(){this.debug||(this.isActivated=!1,this.dropdown.empty(),this.dropdown.close())},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(e,t){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e=this.input.getLanguageDirection();this.dir!==e&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,t,n,r,i,o;e=this.dropdown.getDatumForTopSuggestion(),e&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(t=this.input.getInputValue(),n=f.normalizeQuery(t),r=u.escapeRegExChars(n),i=new RegExp("^(?:"+r+")(.+$)","i"),o=i.exec(e.value),o?this.input.setHint(t+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&(i=this.dropdown.getDatumForTopSuggestion(),i&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e){"undefined"!=typeof e.value&&this.input.setQuery(e.value),this.input.setInputValue(e.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",e.raw,e.datasetName),this.dropdown.close(),u.defer(u.bind(this.dropdown.empty,this.dropdown))},open:function(){if(!this.isActivated){var e=this.input.getInputValue();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty()}this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=u.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),a(this.$node),this.$node=null}}),r.Dropdown=p,r.Input=f,r.sources=e("../sources/index.js"),t.exports=r},{"../common/dom.js":266,"../common/utils.js":267,"../sources/index.js":269,"./css.js":258,"./dropdown.js":260,"./event_bus.js":261,"./html.js":263,"./input.js":264}],266:[function(e,t,n){"use strict";t.exports={element:null}},{}],267:[function(e,t,n){"use strict";var r=e("./dom.js");t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(e){return"number"==typeof e},toStr:function(e){return void 0===e||null===e?"":e+""},cloneDeep:function(e){var t=this.mixin({},e),n=this;return this.each(t,function(e,r){e&&(n.isArray(e)?t[r]=[].concat(e):n.isObject(e)&&(t[r]=n.cloneDeep(e)))}),t},error:function(e){throw new Error(e)},every:function(e,t){var n=!0;return e?(this.each(e,function(r,i){return n=t.call(null,r,i,e),n?void 0:!1}),!!n):n},getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(e){if(this.isFunction(e))return e;var t=r.element(e);return"SCRIPT"===t.prop("tagName")?function(){return t.text()}:function(){return String(e)}},defer:function(e){setTimeout(e,0)},noop:function(){}}},{"./dom.js":266}],268:[function(e,t,n){"use strict";var r=e("../common/utils.js");t.exports=function(e,t){function n(n,i){e.search(n,t,function(e,t){return e?void r.error(e.message):void i(t.hits,t)})}return n}},{"../common/utils.js":267}],269:[function(e,t,n){"use strict";t.exports={hits:e("./hits.js"),popularIn:e("./popularIn.js")}},{"./hits.js":268,"./popularIn.js":270}],270:[function(e,t,n){"use strict";var r=e("../common/utils.js");t.exports=function(e,t,n,i){function o(o,u){e.search(o,t,function(e,t){if(e)return void r.error(e.message);if(t.hits.length>0){var o=t.hits[0],l=r.mixin({hitsPerPage:0},n);return delete l.source,delete l.index,void s.search(a(o),l,function(e,n){if(e)return void r.error(e.message);var a=[];if(i.includeAll){var s=i.allTitle||"All departments";a.push(r.mixin({facet:{value:s,count:n.nbHits}},r.cloneDeep(o)))}r.each(n.facets,function(e,t){r.each(e,function(e,n){a.push(r.mixin({facet:{facet:t,value:n,count:e}},r.cloneDeep(o)))})});for(var l=1;l<t.hits.length;++l)a.push(t.hits[l]);u(a,t)})}u([])})}if(!n.source)return r.error("Missing 'source' key");var a=r.isFunction(n.source)?n.source:function(e){return e[n.source]};if(!n.index)return r.error("Missing 'index' key");var s=n.index;return i=i||{},o}},{"../common/utils.js":267}],271:[function(e,t,n){"use strict";function r(e,t,n,r){n=s.isArray(n)?n:[].slice.call(arguments,2);var i=o(e),a=new l({el:i}),c=r||new u({input:i,eventBus:a,dropdownMenuContainer:t.dropdownMenuContainer,hint:void 0===t.hint?!0:!!t.hint,minLength:t.minLength,autoselect:t.autoselect,openOnFocus:t.openOnFocus,templates:t.templates,debug:t.debug,datasets:n});return c.input.$input.autocomplete={typeahead:c,open:function(){c.open()},close:function(){c.close()},getVal:function(){return c.getVal()},setVal:function(e){return c.setVal(e)},destroy:function(){c.destroy()}},c.input.$input}var i=window.$;e("../../zepto.js");var o=window.$;window.$=i;var a=e("../common/dom.js");a.element=o;var s=e("../common/utils.js");s.isArray=o.isArray,s.isFunction=o.isFunction,s.isObject=o.isPlainObject,s.bind=o.proxy,s.each=function(e,t){function n(e,n){return t(n,e)}o.each(e,n)},s.map=o.map,s.mixin=o.extend;var u=e("../autocomplete/typeahead.js"),l=e("../autocomplete/event_bus.js");r.sources=u.sources,t.exports=r},{"../../zepto.js":272,"../autocomplete/event_bus.js":261,"../autocomplete/typeahead.js":265,"../common/dom.js":266,"../common/utils.js":267}],272:[function(e,t,n){var r=function(){function e(e){return null==e?String(e):Q[G.call(e)]||"object"}function t(t){return"function"==e(t)}function n(e){return null!=e&&e==e.window}function r(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function i(t){return"object"==e(t)}function o(e){return i(e)&&!n(e)&&Object.getPrototypeOf(e)==Object.prototype}function a(e){return"number"==typeof e.length}function s(e){return k.call(e,function(e){return null!=e})}function u(e){return e.length>0?x.fn.concat.apply([],e):e}function l(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function c(e){return e in N?N[e]:N[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function f(e,t){return"number"!=typeof t||I[l(e)]?t:t+"px"}function p(e){var t,n;return M[e]||(t=T.createElement(e),T.body.appendChild(t),n=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==n&&(n="block"),M[e]=n),M[e]}function d(e){return"children"in e?A.call(e.children):x.map(e.childNodes,function(e){return 1==e.nodeType?e:void 0})}function h(e,t){var n,r=e?e.length:0;for(n=0;r>n;n++)this[n]=e[n];this.length=r,this.selector=t||""}function m(e,t,n){for(C in t)n&&(o(t[C])||Z(t[C]))?(o(t[C])&&!o(e[C])&&(e[C]={}),Z(t[C])&&!Z(e[C])&&(e[C]=[]),m(e[C],t[C],n)):t[C]!==w&&(e[C]=t[C])}function v(e,t){return null==t?x(e):x(e).filter(t)}function y(e,n,r,i){return t(n)?n.call(e,r,i):n}function g(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function b(e,t){var n=e.className||"",r=n&&n.baseVal!==w;return t===w?r?n.baseVal:n:void(r?n.baseVal=t:e.className=t)}function _(e){try{return e?"true"==e||("false"==e?!1:"null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?x.parseJSON(e):e):e}catch(t){return e}}function j(e,t){t(e);for(var n=0,r=e.childNodes.length;r>n;n++)j(e.childNodes[n],t)}var w,C,x,E,R,O,P=[],S=P.concat,k=P.filter,A=P.slice,T=window.document,M={},N={},I={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},D=/^\s*<(\w+|!)[^>]*>/,F=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,L=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,U=/^(?:body|html)$/i,H=/([A-Z])/g,B=["val","css","html","text","data","width","height","offset"],q=["after","prepend","before","append"],V=T.createElement("table"),W=T.createElement("tr"),K={tr:T.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:W,th:W,"*":T.createElement("div")},$=/complete|loaded|interactive/,z=/^[\w-]*$/,Q={},G=Q.toString,Y={},J=T.createElement("div"),X={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Z=Array.isArray||function(e){return e instanceof Array};return Y.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var n=e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,o=!i;return o&&(i=J).appendChild(e),r=~Y.qsa(i,t).indexOf(e),o&&J.removeChild(e),r},R=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},O=function(e){return k.call(e,function(t,n){return e.indexOf(t)==n})},Y.fragment=function(e,t,n){var r,i,a;return F.test(e)&&(r=x(T.createElement(RegExp.$1))),r||(e.replace&&(e=e.replace(L,"<$1></$2>")),t===w&&(t=D.test(e)&&RegExp.$1),t in K||(t="*"),a=K[t],a.innerHTML=""+e,r=x.each(A.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=x(r),x.each(n,function(e,t){B.indexOf(e)>-1?i[e](t):i.attr(e,t)})),r},Y.Z=function(e,t){return new h(e,t)},Y.isZ=function(e){return e instanceof Y.Z},Y.init=function(e,n){var r;if(!e)return Y.Z();if("string"==typeof e)if(e=e.trim(),"<"==e[0]&&D.test(e))r=Y.fragment(e,RegExp.$1,n),e=null;else{if(n!==w)return x(n).find(e);r=Y.qsa(T,e)}else{if(t(e))return x(T).ready(e);if(Y.isZ(e))return e;if(Z(e))r=s(e);else if(i(e))r=[e],e=null;else if(D.test(e))r=Y.fragment(e.trim(),RegExp.$1,n),e=null;else{if(n!==w)return x(n).find(e);r=Y.qsa(T,e)}}return Y.Z(r,e)},x=function(e,t){return Y.init(e,t)},x.extend=function(e){var t,n=A.call(arguments,1);return"boolean"==typeof e&&(t=e,e=n.shift()),n.forEach(function(n){m(e,n,t)}),e},Y.qsa=function(e,t){var n,r="#"==t[0],i=!r&&"."==t[0],o=r||i?t.slice(1):t,a=z.test(o);return e.getElementById&&a&&r?(n=e.getElementById(o))?[n]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:A.call(a&&!r&&e.getElementsByClassName?i?e.getElementsByClassName(o):e.getElementsByTagName(t):e.querySelectorAll(t))},x.contains=T.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},x.type=e,x.isFunction=t,x.isWindow=n,x.isArray=Z,x.isPlainObject=o,x.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},x.inArray=function(e,t,n){return P.indexOf.call(t,e,n)},x.camelCase=R,x.trim=function(e){return null==e?"":String.prototype.trim.call(e)},x.uuid=0,x.support={},x.expr={},x.noop=function(){},x.map=function(e,t){var n,r,i,o=[];if(a(e))for(r=0;r<e.length;r++)n=t(e[r],r),null!=n&&o.push(n);else for(i in e)n=t(e[i],i),null!=n&&o.push(n);return u(o)},x.each=function(e,t){var n,r;if(a(e)){for(n=0;n<e.length;n++)if(t.call(e[n],n,e[n])===!1)return e}else for(r in e)if(t.call(e[r],r,e[r])===!1)return e;return e},x.grep=function(e,t){return k.call(e,t)},window.JSON&&(x.parseJSON=JSON.parse),x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),x.fn={constructor:Y.Z,length:0,forEach:P.forEach,reduce:P.reduce,push:P.push,sort:P.sort,splice:P.splice,indexOf:P.indexOf,concat:function(){var e,t,n=[];for(e=0;e<arguments.length;e++)t=arguments[e],n[e]=Y.isZ(t)?t.toArray():t;return S.apply(Y.isZ(this)?this.toArray():this,n)},map:function(e){return x(x.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return x(A.apply(this,arguments))},ready:function(e){return $.test(T.readyState)&&T.body?e(x):T.addEventListener("DOMContentLoaded",function(){e(x)},!1),this},get:function(e){return e===w?A.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(e){return P.every.call(this,function(t,n){return e.call(t,n,t)!==!1}),this},filter:function(e){return t(e)?this.not(this.not(e)):x(k.call(this,function(t){return Y.matches(t,e)}))},add:function(e,t){return x(O(this.concat(x(e,t))))},is:function(e){return this.length>0&&Y.matches(this[0],e)},not:function(e){var n=[];if(t(e)&&e.call!==w)this.each(function(t){e.call(this,t)||n.push(this)});else{var r="string"==typeof e?this.filter(e):a(e)&&t(e.item)?A.call(e):x(e);this.forEach(function(e){r.indexOf(e)<0&&n.push(e)})}return x(n)},has:function(e){return this.filter(function(){return i(e)?x.contains(this,e):x(this).find(e).size()})},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!i(e)?e:x(e)},last:function(){var e=this[this.length-1];return e&&!i(e)?e:x(e)},find:function(e){var t,n=this;return t=e?"object"==typeof e?x(e).filter(function(){var e=this;return P.some.call(n,function(t){return x.contains(t,e)})}):1==this.length?x(Y.qsa(this[0],e)):this.map(function(){return Y.qsa(this,e)}):x()},closest:function(e,t){var n=this[0],i=!1;for("object"==typeof e&&(i=x(e));n&&!(i?i.indexOf(n)>=0:Y.matches(n,e));)n=n!==t&&!r(n)&&n.parentNode;return x(n)},parents:function(e){for(var t=[],n=this;n.length>0;)n=x.map(n,function(e){return(e=e.parentNode)&&!r(e)&&t.indexOf(e)<0?(t.push(e),e):void 0});return v(t,e)},parent:function(e){return v(O(this.pluck("parentNode")),e)},children:function(e){return v(this.map(function(){return d(this)}),e)},contents:function(){return this.map(function(){return this.contentDocument||A.call(this.childNodes)})},siblings:function(e){return v(this.map(function(e,t){return k.call(d(t.parentNode),function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return x.map(this,function(t){return t[e]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=p(this.nodeName))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var n=t(e);if(this[0]&&!n)var r=x(e).get(0),i=r.parentNode||this.length>1;return this.each(function(t){x(this).wrapAll(n?e.call(this,t):i?r.cloneNode(!0):r)})},wrapAll:function(e){if(this[0]){x(this[0]).before(e=x(e));for(var t;(t=e.children()).length;)e=t.first();x(e).append(this)}return this},wrapInner:function(e){var n=t(e);return this.each(function(t){var r=x(this),i=r.contents(),o=n?e.call(this,t):e;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){x(this).replaceWith(x(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var t=x(this);(e===w?"none"==t.css("display"):e)?t.show():t.hide()})},prev:function(e){return x(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return x(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each(function(t){var n=this.innerHTML;x(this).empty().append(y(this,e,t,n))}):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each(function(t){var n=y(this,e,t,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(e,t){var n;return"string"!=typeof e||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(e))for(C in e)g(this,C,e[C]);else g(this,e,y(this,t,n,this.getAttribute(e)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(e))&&e in this[0]?this[0][e]:n:w},removeAttr:function(e){return this.each(function(){1===this.nodeType&&e.split(" ").forEach(function(e){g(this,e)},this)})},prop:function(e,t){return e=X[e]||e,1 in arguments?this.each(function(n){this[e]=y(this,t,n,this[e])}):this[0]&&this[0][e]},data:function(e,t){
var n="data-"+e.replace(H,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,t):this.attr(n);return null!==r?_(r):w},val:function(e){return 0 in arguments?this.each(function(t){this.value=y(this,e,t,this.value)}):this[0]&&(this[0].multiple?x(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each(function(t){var n=x(this),r=y(this,e,t,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(!x.contains(T.documentElement,this[0]))return{top:0,left:0};var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(t,n){if(arguments.length<2){var r,i=this[0];if(!i)return;if(r=getComputedStyle(i,""),"string"==typeof t)return i.style[R(t)]||r.getPropertyValue(t);if(Z(t)){var o={};return x.each(t,function(e,t){o[t]=i.style[R(t)]||r.getPropertyValue(t)}),o}}var a="";if("string"==e(t))n||0===n?a=l(t)+":"+f(t,n):this.each(function(){this.style.removeProperty(l(t))});else for(C in t)t[C]||0===t[C]?a+=l(C)+":"+f(C,t[C])+";":this.each(function(){this.style.removeProperty(l(C))});return this.each(function(){this.style.cssText+=";"+a})},index:function(e){return e?this.indexOf(x(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return e?P.some.call(this,function(e){return this.test(b(e))},c(e)):!1},addClass:function(e){return e?this.each(function(t){if("className"in this){E=[];var n=b(this),r=y(this,e,t,n);r.split(/\s+/g).forEach(function(e){x(this).hasClass(e)||E.push(e)},this),E.length&&b(this,n+(n?" ":"")+E.join(" "))}}):this},removeClass:function(e){return this.each(function(t){if("className"in this){if(e===w)return b(this,"");E=b(this),y(this,e,t,E).split(/\s+/g).forEach(function(e){E=E.replace(c(e)," ")}),b(this,E.trim())}})},toggleClass:function(e,t){return e?this.each(function(n){var r=x(this),i=y(this,e,n,b(this));i.split(/\s+/g).forEach(function(e){(t===w?!r.hasClass(e):t)?r.addClass(e):r.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return e===w?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return e===w?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],t=this.offsetParent(),n=this.offset(),r=U.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(x(e).css("margin-top"))||0,n.left-=parseFloat(x(e).css("margin-left"))||0,r.top+=parseFloat(x(t[0]).css("border-top-width"))||0,r.left+=parseFloat(x(t[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||T.body;e&&!U.test(e.nodeName)&&"static"==x(e).css("position");)e=e.offsetParent;return e})}},x.fn.detach=x.fn.remove,["width","height"].forEach(function(e){var t=e.replace(/./,function(e){return e[0].toUpperCase()});x.fn[e]=function(i){var o,a=this[0];return i===w?n(a)?a["inner"+t]:r(a)?a.documentElement["scroll"+t]:(o=this.offset())&&o[e]:this.each(function(t){a=x(this),a.css(e,y(this,i,t,a[e]()))})}}),q.forEach(function(t,n){var r=n%2;x.fn[t]=function(){var t,i,o=x.map(arguments,function(n){return t=e(n),"object"==t||"array"==t||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(e,t){i=r?t:t.parentNode,t=0==n?t.nextSibling:1==n?t.firstChild:2==n?t:null;var s=x.contains(T.documentElement,i);o.forEach(function(e){if(a)e=e.cloneNode(!0);else if(!i)return x(e).remove();i.insertBefore(e,t),s&&j(e,function(e){null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src||window.eval.call(window,e.innerHTML)})})})},x.fn[r?t+"To":"insert"+(n?"Before":"After")]=function(e){return x(e)[t](this),this}}),Y.Z.prototype=h.prototype=x.fn,Y.uniq=O,Y.deserializeValue=_,x.zepto=Y,x}();window.Zepto=r,void 0===window.$&&(window.$=r),function(e){var t,n=[];e.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(n.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",t&&clearTimeout(t),t=setTimeout(function(){n=[]},6e4)),this.parentNode.removeChild(this))})}}(r),function(e){function t(t,r){var u=t[s],l=u&&i[u];if(void 0===r)return l||n(t);if(l){if(r in l)return l[r];var c=a(r);if(c in l)return l[c]}return o.call(e(t),r)}function n(t,n,o){var u=t[s]||(t[s]=++e.uuid),l=i[u]||(i[u]=r(t));return void 0!==n&&(l[a(n)]=o),l}function r(t){var n={};return e.each(t.attributes||u,function(t,r){0==r.name.indexOf("data-")&&(n[a(r.name.replace("data-",""))]=e.zepto.deserializeValue(r.value))}),n}var i={},o=e.fn.data,a=e.camelCase,s=e.expando="Zepto"+ +new Date,u=[];e.fn.data=function(r,i){return void 0===i?e.isPlainObject(r)?this.each(function(t,i){e.each(r,function(e,t){n(i,e,t)})}):0 in this?t(this[0],r):void 0:this.each(function(){n(this,r,i)})},e.fn.removeData=function(t){return"string"==typeof t&&(t=t.split(/\s+/)),this.each(function(){var n=this[s],r=n&&i[n];r&&e.each(t||r,function(e){delete r[t?a(this):e]})})},["remove","empty"].forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=this.find("*");return"remove"===t&&(e=e.add(this)),e.removeData(),n.call(this)}})}(r),function(e){function t(e){return e._zid||(e._zid=p++)}function n(e,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[t(e)]||[]).filter(function(e){return e&&(!n.e||e.e==n.e)&&(!n.ns||s.test(e.ns))&&(!o||t(e.fn)===t(o))&&(!a||e.sel==a)})}function r(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function i(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function o(e,t){return e.del&&!g&&e.e in b||!!t}function a(e){return _[e]||g&&b[e]||e}function s(n,i,s,u,c,p,d){var h=t(n),m=v[h]||(v[h]=[]);i.split(/\s/).forEach(function(t){if("ready"==t)return e(document).ready(s);var i=r(t);i.fn=s,i.sel=c,i.e in _&&(s=function(t){var n=t.relatedTarget;return!n||n!==this&&!e.contains(this,n)?i.fn.apply(this,arguments):void 0}),i.del=p;var h=p||s;i.proxy=function(e){if(e=l(e),!e.isImmediatePropagationStopped()){e.data=u;var t=h.apply(n,e._args==f?[e]:[e].concat(e._args));return t===!1&&(e.preventDefault(),e.stopPropagation()),t}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,d))})}function u(e,r,i,s,u){var l=t(e);(r||"").split(/\s/).forEach(function(t){n(e,t,i,s).forEach(function(t){delete v[l][t.i],"removeEventListener"in e&&e.removeEventListener(a(t.e),t.proxy,o(t,u))})})}function l(t,n){return!n&&t.isDefaultPrevented||(n||(n=t),e.each(x,function(e,r){var i=n[e];t[e]=function(){return this[r]=j,i&&i.apply(n,arguments)},t[r]=w}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(t.isDefaultPrevented=j)),t}function c(e){var t,n={originalEvent:e};for(t in e)C.test(t)||e[t]===f||(n[t]=e[t]);return l(n,e)}var f,p=1,d=Array.prototype.slice,h=e.isFunction,m=function(e){return"string"==typeof e},v={},y={},g="onfocusin"in window,b={focus:"focusin",blur:"focusout"},_={mouseenter:"mouseover",mouseleave:"mouseout"};y.click=y.mousedown=y.mouseup=y.mousemove="MouseEvents",e.event={add:s,remove:u},e.proxy=function(n,r){var i=2 in arguments&&d.call(arguments,2);if(h(n)){var o=function(){return n.apply(r,i?i.concat(d.call(arguments)):arguments)};return o._zid=t(n),o}if(m(r))return i?(i.unshift(n[r],n),e.proxy.apply(null,i)):e.proxy(n[r],n);throw new TypeError("expected function")},e.fn.bind=function(e,t,n){return this.on(e,t,n)},e.fn.unbind=function(e,t){return this.off(e,t)},e.fn.one=function(e,t,n,r){return this.on(e,t,n,r,1)};var j=function(){return!0},w=function(){return!1},C=/^([A-Z]|returnValue$|layer[XY]$)/,x={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(e,t,n){return this.on(t,e,n)},e.fn.undelegate=function(e,t,n){return this.off(t,e,n)},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,r,i,o){var a,l,p=this;return t&&!m(t)?(e.each(t,function(e,t){p.on(e,n,r,t,o)}),p):(m(n)||h(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=w),p.each(function(f,p){o&&(a=function(e){return u(p,e.type,i),i.apply(this,arguments)}),n&&(l=function(t){var r,o=e(t.target).closest(n,p).get(0);return o&&o!==p?(r=e.extend(c(t),{currentTarget:o,liveFired:p}),(a||i).apply(o,[r].concat(d.call(arguments,1)))):void 0}),s(p,t,i,r,n,l||a)}))},e.fn.off=function(t,n,r){var i=this;return t&&!m(t)?(e.each(t,function(e,t){i.off(e,n,t)}),i):(m(n)||h(r)||r===!1||(r=n,n=f),r===!1&&(r=w),i.each(function(){u(this,t,r,n)}))},e.fn.trigger=function(t,n){return t=m(t)||e.isPlainObject(t)?e.Event(t):l(t),t._args=n,this.each(function(){t.type in b&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,n)})},e.fn.triggerHandler=function(t,r){var i,o;return this.each(function(a,s){i=c(m(t)?e.Event(t):t),i._args=r,i.target=s,e.each(n(s,t.type||t),function(e,t){return o=t.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}}),e.Event=function(e,t){m(e)||(t=e,e=t.type);var n=document.createEvent(y[e]||"Events"),r=!0;if(t)for(var i in t)"bubbles"==i?r=!!t[i]:n[i]=t[i];return n.initEvent(e,r,!0),l(n)}}(r),function(){try{getComputedStyle(void 0)}catch(e){var t=getComputedStyle;window.getComputedStyle=function(e){try{return t(e)}catch(n){return null}}}}()},{}],273:[function(t,n,r){!function(){"use strict";function t(){for(var e=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i))e.push(t.apply(null,i));else if("object"===o)for(var a in i)r.call(i,a)&&i[a]&&e.push(a)}}return e.join(" ")}var r={}.hasOwnProperty;"undefined"!=typeof n&&n.exports?n.exports=t:"function"==typeof e&&"object"==typeof e.amd&&e.amd?e("classnames",[],function(){return t}):window.classNames=t}()},{}],274:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function s(){var e;try{e=n.storage.debug}catch(t){}return e}function u(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=o,n.formatArgs=i,n.save=a,n.load=s,n.useColors=r,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(s())},{"./debug":275}],275:[function(e,t,n){function r(){return n.colors[c++%n.colors.length]}function i(e){function t(){}function i(){var e=i,t=+new Date,o=t-(l||t);e.diff=o,e.prev=l,e.curr=t,l=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;s++;var i=n.formatters[r];if("function"==typeof i){var o=a[s];t=i.call(e,o),a.splice(s,1),s--}return t}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(e,a));var u=i.log||n.log||console.log.bind(console);u.apply(e,a)}t.enabled=!1,i.enabled=!0;var o=n.enabled(e)?i:t;return o.namespace=e,o}function o(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,i=0;r>i;i++)t[i]&&(e=t[i].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function a(){n.enable("")}function s(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=i,n.coerce=u,n.disable=a,n.enable=o,n.enabled=s,n.humanize=e("algolia-ms"),n.names=[],n.skips=[],n.formatters={};var l,c=0},{"algolia-ms":2}],276:[function(e,t,n){(function(e){!function(e){"use strict";function t(e,t){function r(e){return this&&this.constructor===r?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new r(e)}return t||b(e,"size",{get:v}),e.constructor=r,r.prototype=e,r}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function r(e){return this.has(e)&&(this._keys.splice(g,1),this._values.splice(g,1),this._itp.forEach(function(e){g<e[0]&&e[0]--})),g>-1}function i(e){return this.has(e)?this._values[g]:void 0}function o(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(g=e.length;g--&&!_(e[g],t););else g=e.indexOf(t);return g>-1}function a(e){return o.call(this,this._values,e)}function s(e){return o.call(this,this._keys,e)}function u(e,t){return this.has(e)?this._values[g]=t:this._values[this._keys.push(e)-1]=t,this}function l(e){return this.has(e)||this._values.push(e),this}function c(){(this._keys||0).length=this._values.length=0}function f(){return m(this._itp,this._keys)}function p(){return m(this._itp,this._values)}function d(){return m(this._itp,this._keys,this._values)}function h(){return m(this._itp,this._values,this._values)}function m(e,t,n){var r=[0],i=!1;return e.push(r),{next:function(){var o,a=r[0];return!i&&a<t.length?(o=n?[t[a],n[a]]:t[a],r[0]++):(i=!0,e.splice(e.indexOf(r),1)),{done:i,value:o}}}}function v(){return this._values.length}function y(e,t){for(var n=this.entries();;){var r=n.next();if(r.done)break;e.call(t,r.value[1],r.value[0],this)}}var g,b=Object.defineProperty,_=function(e,t){return isNaN(e)?isNaN(t):e===t};"undefined"==typeof WeakMap&&(e.WeakMap=t({"delete":r,clear:c,get:i,has:s,set:u},!0)),"undefined"!=typeof Map&&"function"==typeof(new Map).values&&(new Map).values().next||(e.Map=t({"delete":r,has:s,get:i,set:u,keys:f,values:p,entries:d,forEach:y,clear:c})),"undefined"!=typeof Set&&"function"==typeof(new Set).values&&(new Set).values().next||(e.Set=t({has:a,add:l,"delete":r,clear:c,keys:p,values:p,entries:h,forEach:y})),"undefined"==typeof WeakSet&&(e.WeakSet=t({"delete":r,add:l,clear:c,has:a},!0))}("undefined"!=typeof n&&"undefined"!=typeof e?e:window)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],277:[function(t,n,r){(function(r,i){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function a(e){return"function"==typeof e}function s(e){$=e}function u(e){Y=e}function l(){return function(){r.nextTick(h)}}function c(){return function(){K(h)}}function f(){var e=0,t=new Z(h),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function p(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(h,1)}}function h(){for(var e=0;G>e;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}G=0}function m(){try{var e=t,n=e("vertx");return K=n.runOnLoop||n.runOnContext,c()}catch(r){return d()}}function v(e,t){var n=this,r=n._state;if(r===ae&&!e||r===se&&!t)return this;var i=new this.constructor(g),o=n._result;if(r){var a=arguments[r-1];Y(function(){N(r,i,a,o)})}else k(n,i,e,t);return i}function y(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(g);return R(n,e),n}function g(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function j(e){try{return e.then}catch(t){return ue.error=t,ue}}function w(e,t,n,r){try{e.call(t,n,r)}catch(i){return i}}function C(e,t,n){Y(function(e){var r=!1,i=w(n,t,function(n){r||(r=!0,t!==n?R(e,n):P(e,n))},function(t){r||(r=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&i&&(r=!0,S(e,i))},e)}function x(e,t){t._state===ae?P(e,t._result):t._state===se?S(e,t._result):k(t,void 0,function(t){R(e,t)},function(t){S(e,t)})}function E(e,t,n){t.constructor===e.constructor&&n===re&&constructor.resolve===ie?x(e,t):n===ue?S(e,ue.error):void 0===n?P(e,t):a(n)?C(e,t,n):P(e,t)}function R(e,t){e===t?S(e,b()):o(t)?E(e,t,j(t)):P(e,t)}function O(e){e._onerror&&e._onerror(e._result),A(e)}function P(e,t){e._state===oe&&(e._result=t,e._state=ae,0!==e._subscribers.length&&Y(A,e))}function S(e,t){e._state===oe&&(e._state=se,e._result=t,Y(O,e))}function k(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+ae]=n,i[o+se]=r,0===o&&e._state&&Y(A,e)}function A(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,i,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?N(n,r,i,o):i(o);e._subscribers.length=0}}function T(){this.error=null}function M(e,t){try{return e(t)}catch(n){return le.error=n,le}}function N(e,t,n,r){var i,o,s,u,l=a(n);if(l){if(i=M(n,r),i===le?(u=!0,o=i.error,i=null):s=!0,t===i)return void S(t,_())}else i=r,s=!0;t._state!==oe||(l&&s?R(t,i):u?S(t,o):e===ae?P(t,i):e===se&&S(t,i))}function I(e,t){try{t(function(t){R(e,t)},function(t){S(e,t)})}catch(n){S(e,n)}}function D(e){return new me(this,e).promise}function F(e){function t(e){R(i,e)}function n(e){S(i,e)}var r=this,i=new r(g);if(!Q(e))return S(i,new TypeError("You must pass an array to race.")),i;for(var o=e.length,a=0;i._state===oe&&o>a;a++)k(r.resolve(e[a]),void 0,t,n);return i}function L(e){var t=this,n=new t(g);return S(n,e),n}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function H(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function B(e){this._id=de++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==e&&("function"!=typeof e&&U(),this instanceof B?I(this,e):H())}function q(e,t){this._instanceConstructor=e,this.promise=new e(g),Array.isArray(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&P(this.promise,this._result))):S(this.promise,this._validationError())}function V(){var e;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(e.Promise=he)}var W;W=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var K,$,z,Q=W,G=0,Y=function(e,t){ne[G]=e,ne[G+1]=t,G+=2,2===G&&($?$(h):z())},J="undefined"!=typeof window?window:void 0,X=J||{},Z=X.MutationObserver||X.WebKitMutationObserver,ee="undefined"!=typeof r&&"[object process]"==={}.toString.call(r),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3);z=ee?l():Z?f():te?p():void 0===J&&"function"==typeof t?m():d();var re=v,ie=y,oe=void 0,ae=1,se=2,ue=new T,le=new T,ce=D,fe=F,pe=L,de=0,he=B;B.all=ce,B.race=fe,B.resolve=ie,B.reject=pe,B._setScheduler=s,B._setAsap=u,B._asap=Y,B.prototype={constructor:B,then:re,"catch":function(e){return this.then(null,e)}};var me=q;q.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},q.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===oe&&e>n;n++)this._eachEntry(t[n],n)},q.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===ie){var i=j(e);if(i===re&&e._state!==oe)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===he){var o=new n(g);E(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n(function(t){t(e)}),t)}else this._willSettleAt(r(e),t)},q.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===oe&&(this._remaining--,e===se?S(r,n):this._result[t]=n),0===this._remaining&&P(r,this._result)},q.prototype._willSettleAt=function(e,t){var n=this;k(e,void 0,function(e){n._settledAt(ae,t,e)},function(e){n._settledAt(se,t,e)})};var ve=V,ye={Promise:he,polyfill:ve};"function"==typeof e&&e.amd?e(function(){return ye}):"undefined"!=typeof n&&n.exports?n.exports=ye:"undefined"!=typeof this&&(this.ES6Promise=ye),ve()}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:673}],278:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(a(n))for(o=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;r>u;u++)l[u].apply(this,o);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],279:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("./src/types/undefined.js"),o=r(i),a=e("./src/types/null.js"),s=r(a),u=e("./src/types/boolean.js"),l=r(u),c=e("./src/types/number.js"),f=r(c),p=e("./src/types/string.js"),d=r(p),h=e("./src/types/function.js"),m=r(h),v=e("./src/types/Array.js"),y=r(v),g=e("./src/types/Object.js"),b=r(g),_=e("./src/OptionsManager.js"),j=r(_);t.exports=function(){return(new j["default"]).registerTypes([o["default"],s["default"],l["default"],f["default"],d["default"],m["default"],y["default"],b["default"]])}},{"./src/OptionsManager.js":282,"./src/types/Array.js":288,"./src/types/Object.js":289,"./src/types/boolean.js":290,"./src/types/function.js":291,"./src/types/null.js":292,"./src/types/number.js":293,"./src/types/string.js":294,"./src/types/undefined.js":295}],280:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=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}}(),o=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1];r(this,e),this.path=n+"["+t+"]"}return i(e,[{key:"nest",value:function(t){return new e(t,this.path)}},{key:"throw",value:function(e){throw new Error(this.path+" "+e)}}]),e}();n["default"]=o},{}],281:[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")}Object.defineProperty(n,"__esModule",{value:!0});var o=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}}(),a=e("lodash/forEach"),s=r(a),u=e("lodash/isNull"),l=r(u),c=e("lodash/isUndefined"),f=r(c),p=e("./Structure.js"),d=r(p),h=function(){function e(t,n){i(this,e),this.name=t,this.options=[],this.errors=[],this.shared=n}return o(e,[{key:"arg",value:function(e,t){if((0,f["default"])(t)&&(t=e,e=null),!(t instanceof d["default"])){var n=(0,l["default"])(e)?"arguments["+this.options.length+"]":e;t=new d["default"](t,this.shared,n)}return this.options.push({name:e,structure:t}),this}},{key:"_legend",value:function(){var e=["<...> Type","* Required"];return this.errors.length>0&&e.push("X Error"),e}},{key:"usage",value:function(){var e=this,t=[];(0,s["default"])(this.options,function(n){var r=n.structure,i=n.name;t.push(r.usage(i,e.errors))});var n=[];if(n.push("Usage:\n "+this.name+"(\n"+t.join(",\n")+"\n )"),this.errors.length>0){var r=this.errors.map(function(e){var t=e.actualPath,n=e.message;return" - `"+t+"` "+n}).join("\n");n.push("Errors:\n"+r)}return n.push("Legend:\n "+this._legend().join("\n ")),"\n"+n.join("\n----------------\n")}},{key:"check",value:function(){var e=this;if(this.errors=[],(0,s["default"])(this.options,function(t){var n=t.structure,r=t.value;n.check(r,e.errors)}),this.errors.length>0)throw new Error(this.usage())}},{key:"values",value:function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=[];return(0,s["default"])(this.options,function(n,r){n.value=e[r],t.push(n.structure.buildValue(n.value))}),this.check(),t}}]),e}();n["default"]=h},{"./Structure.js":284,"lodash/forEach":645,"lodash/isNull":658,"lodash/isUndefined":666}],282:[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){return e.toString()}Object.defineProperty(n,"__esModule",{value:!0});var a=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},s=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}}(),u=e("lodash/isUndefined"),l=r(u),c=e("./ExceptionThrower.js"),f=r(c),p=e("./FunctionChecker.js"),d=r(p),h=e("./Structure.js"),m=r(h),v=e("./TypeCheckerStore.js"),y=r(v),g=e("./TypePrinterStore.js"),b=r(g),_=e("./ValidatorStore.js"),j=r(_),w=function(){function e(){i(this,e),this.thrower=new f["default"]("OptionsManager"),this.typeCheckers=new y["default"](this.thrower),this.typePrinters=new b["default"](this.thrower),this.validators=new j["default"](this.thrower),this._shared={thrower:this.thrower,typeCheckers:this.typeCheckers,typePrinters:this.typePrinters}}return s(e,[{key:"registerType",value:function(e){var t=e.name,n=e.checker,r=e.printer,i=void 0===r?o:r;return this.typeCheckers.add(t,n),this.typePrinters.add(t,i),this}},{key:"registerTypes",value:function(e){return e.forEach(this.registerType,this),this}},{key:"registerValidator",value:function(e){var t=e.name,n=e.validator;return this.validators.add(t,n),this}},{key:"registerValidators",value:function(e){return e.forEach(this.registerValidator,this),this}},{key:"validator",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return this.validators.get(e).apply(void 0,n)}},{key:"structure",value:function(e,t){return(0,l["default"])(t)&&(t=e,e=""),new m["default"](t,this._shared,e)}},{key:"check",value:function(e){var t=a({},this._shared,{thrower:this.thrower.nest(".check")});return new d["default"](e,t)}}]),e}();n["default"]=w},{"./ExceptionThrower.js":280,"./FunctionChecker.js":281,"./Structure.js":284,"./TypeCheckerStore.js":285,"./TypePrinterStore.js":286,"./ValidatorStore.js":287,"lodash/isUndefined":666}],283:[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")}Object.defineProperty(n,"__esModule",{value:!0});var o=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}}(),a=e("lodash/isFunction"),s=r(a),u=e("lodash/isNull"),l=r(u),c=e("lodash/isString"),f=r(c),p=e("lodash/isUndefined"),d=r(p),h=e("./ExceptionThrower.js"),m=r(h),v=function(){
function e(){var t=arguments.length<=0||void 0===arguments[0]?null:arguments[0],n=arguments.length<=1||void 0===arguments[1]?"Store":arguments[1];i(this,e),this.thrower=(0,l["default"])(t)?new m["default"](n):t.nest(n),this.store={}}return o(e,[{key:"get",value:function(e){var t=this.thrower.nest(".get");(0,f["default"])(e)||t["throw"]("Name `"+e+"` should be a string");var n=this.store[e];return(0,d["default"])(n)&&t["throw"]("Name `"+e+"` has no associated function"),n}},{key:"set",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"set":arguments[2],r=this.thrower.nest("."+n);(0,f["default"])(e)||r["throw"]("Name `"+e+"` should be a string"),(0,s["default"])(t)||r["throw"]("Function `"+t+"` should be a function"),this.store[e]=t}},{key:"add",value:function(e,t){this.set(e,t,"add")}}]),e}();n["default"]=v},{"./ExceptionThrower.js":280,"lodash/isFunction":655,"lodash/isNull":658,"lodash/isString":663,"lodash/isUndefined":666}],284:[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")}Object.defineProperty(n,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a=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}}(),s=e("lodash/clone"),u=r(s),l=e("lodash/find"),c=r(l),f=e("lodash/forEach"),p=r(f),d=e("lodash/isArray"),h=r(d),m=e("lodash/isFunction"),v=r(m),y=e("lodash/isNumber"),g=r(y),b=e("lodash/isNull"),_=r(b),j=e("lodash/isPlainObject"),w=r(j),C=e("lodash/isString"),x=r(C),E=e("lodash/isUndefined"),R=r(E),O=function(){function e(t,n,r){var o=this,a=arguments.length<=3||void 0===arguments[3]?null:arguments[3],s=arguments.length<=4||void 0===arguments[4]?!1:arguments[4];i(this,e);var u=n.thrower,l=n.typeCheckers,c=n.typePrinters;this.path=r,this.fullPath=""+((0,_["default"])(a)?"":a)+r,(0,R["default"])(t)&&u["throw"]("`"+this.fullPath+"`'s `structure` must be defined"),(0,x["default"])(t.type)||u["throw"]("`"+this.fullPath+"` must have a `type`"),this.types=t.type.split("|"),this.typeCheck=l.check.bind(l,this.types),this.typesStr=this.types.join("|"),this.required=t.required===!0,this.hasValue=t.hasOwnProperty("value")||t.hasOwnProperty("computeValue"),this.value=(t.computeValue||function(){return t.value})(),this.computeValue=t.computeValue,this.hasValue&&(this.valueStr=c.get(this.types[0])(this.value)),this.hasValue&&this.required&&u["throw"]("`"+this.fullPath+"` can't be `required` and have a `value`"),this.validators=t.validators||[],this.isElement=s,this.isElement&&(this.hasValue&&u["throw"]("`"+this.fullPath+"` is an `element`, it can't have a `value`"),this.required&&u["throw"]("`"+this.fullPath+"` is an `element`, it can't be `required`")),this.hasElement=!(0,R["default"])(t.element),this.hasChildren=!(0,R["default"])(t.children),this.hasElement&&this.hasChildren&&u["throw"]("`"+this.fullPath+"`'s structure can't have both `element` and `children`"),this.children=null,this.hasChildren&&(this.children=(0,h["default"])(t.children)?[]:{},(0,p["default"])(t.children,function(r,i){var a=(0,h["default"])(t.children)?"["+i+"]":"."+i;o.children[i]=new e(r,n,a,o.fullPath)})),this.element=null,this.hasElement&&(this.element=new e(t.element,n,"[]",this.fullPath,!0))}return a(e,[{key:"buildValue",value:function(e){var t=this;if((0,R["default"])(e)&&this.hasValue)if((0,v["default"])(this.computeValue))e=this.computeValue();else{var n=(0,u["default"])(this.value);e=(0,w["default"])(n)&&!(0,w["default"])(this.value)?this.value:n}return(0,_["default"])(this.children)||(0,p["default"])(this.children,function(t,n){var r=t.buildValue(e[n]);(0,R["default"])(r)||(e[n]=r)}),(0,_["default"])(this.element)||(0,p["default"])(e,function(n,r){e[r]=t.element.buildValue(n)}),e}},{key:"_addError",value:function(e,t,n,r){(0,_["default"])(n)&&(n=""),e.push({actualPath:""+n+(this.isElement?"["+r+"]":this.path),message:t,structurePath:this.isElement?n:this.fullPath})}},{key:"check",value:function(e,t){var n=this,r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],i=arguments.length<=3||void 0===arguments[3]?null:arguments[3],a="undefined"==typeof e?"undefined":o(e);if(this.isElement){var s=-1===this.types.indexOf("undefined")&&-1===this.types.indexOf("any");if((0,R["default"])(e)&&s)return void this._addError(t,"should be defined",r,i)}if(this.required&&(0,R["default"])(e))return void this._addError(t,"is required",r,i);if(!(0,R["default"])(e)||this.isElement||this.required){if(!this.typeCheck(e)){var u="should be <"+this.typesStr+">, received "+a;return void this._addError(t,u,r,i)}for(var l=0;l<this.validators.length;++l){var c=this.validators[l](e);if(c!==!0)return void this._addError(t,c,r,i)}this.hasChildren&&(0,p["default"])(this.children,function(r,i){r.check(e[i],t,n.fullPath)}),this.hasElement&&(0,p["default"])(e,function(e,r){n.element.check(e,t,n.fullPath,r)})}}},{key:"usage",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t=this,n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],r=arguments.length<=2||void 0===arguments[2]?4:arguments[2],i=new Array(r+1).join(" "),o=this.required?"*":" ",a=(0,c["default"])(n,{structurePath:this.fullPath})?"X":" ",s=o+a+i.substring(0,i.length-2),u=!(0,R["default"])(e)&&!(0,_["default"])(e)&&!(0,g["default"])(e);u||(e="");var l=""+s+e+"<"+this.typesStr+">";return(0,_["default"])(this.children)&&(0,_["default"])(this.element)||!u||(l+=": "),(0,_["default"])(this.children)||!function(){var e=(0,h["default"])(t.children);l+=e?"[":"{",l+="\n";var o=[];(0,p["default"])(t.children,function(e,t){o.push(e.usage(t,n,r+2))}),l+=o.join(",\n"),l+="\n"+i,l+=e?"]":"}"}(),(0,_["default"])(this.element)||(l+="["+this.element.usage(null,n,r).substr(r)+"]"),this.hasValue&&(l+=" = "+this.valueStr),l}}]),e}();n["default"]=O},{"lodash/clone":641,"lodash/find":644,"lodash/forEach":645,"lodash/isArray":650,"lodash/isFunction":655,"lodash/isNull":658,"lodash/isNumber":659,"lodash/isPlainObject":662,"lodash/isString":663,"lodash/isUndefined":666}],285:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=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}}(),u=e("lodash/isArray"),l=r(u),c=e("./Store.js"),f=r(c),p=function(e){function t(e){return i(this,t),o(this,Object.getPrototypeOf(t).call(this,e,"TypeCheckerStore"))}return a(t,e),s(t,[{key:"check",value:function(e,t){var n=this,r=this.thrower.nest(".check");(0,l["default"])(e)||r["throw"]("Types `"+e+"` should be an array"),0===e.length&&r["throw"]("Types `[]` must have at least one element");var i=!1;return e.forEach(function(e){n.get(e)(t)&&(i=!0)}),i}}]),t}(f["default"]);n["default"]=p},{"./Store.js":283,"lodash/isArray":650}],286:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=e("./Store.js"),u=r(s),l=function(e){function t(e){return i(this,t),o(this,Object.getPrototypeOf(t).call(this,e,"TypePrinterStore"))}return a(t,e),t}(u["default"]);n["default"]=l},{"./Store.js":283}],287:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=e("./Store.js"),u=r(s),l=function(e){function t(e){return i(this,t),o(this,Object.getPrototypeOf(t).call(this,e,"ValidatorStore"))}return a(t,e),t}(u["default"]);n["default"]=l},{"./Store.js":283}],288:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isArray"),o=r(i);t.exports={name:"Array",checker:o["default"],printer:JSON.stringify}},{"lodash/isArray":650}],289:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isPlainObject"),o=r(i);t.exports={name:"Object",checker:o["default"],printer:JSON.stringify}},{"lodash/isPlainObject":662}],290:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isBoolean"),o=r(i);t.exports={name:"boolean",checker:o["default"],printer:JSON.stringify}},{"lodash/isBoolean":653}],291:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isFunction"),o=r(i);t.exports={name:"function",checker:o["default"],printer:function(e){var t=e.name||"anonymous",n=e.length?e.length+" argument"+(e.length>1?"s":""):"";return t+"("+n+")"}}},{"lodash/isFunction":655}],292:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isNull"),o=r(i);t.exports={name:"null",checker:o["default"],printer:function(){return"null"}}},{"lodash/isNull":658}],293:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isNumber"),o=r(i);t.exports={name:"number",checker:o["default"],printer:JSON.stringify}},{"lodash/isNumber":659}],294:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isString"),o=r(i);t.exports={name:"string",checker:o["default"],printer:JSON.stringify}},{"lodash/isString":663}],295:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("lodash/isUndefined"),o=r(i);t.exports={name:"undefined",checker:o["default"],printer:function(){return"undefined"}}},{"lodash/isUndefined":666}],296:[function(e,t,n){"use strict";var r=e("./emptyFunction"),i={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(){}};t.exports=i},{"./emptyFunction":303}],297:[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};t.exports=i},{}],298:[function(e,t,n){"use strict";function r(e){return e.replace(i,function(e,t){return t.toUpperCase()})}var i=/-(.)/g;t.exports=r},{}],299:[function(e,t,n){"use strict";function r(e){return i(e.replace(o,"ms-"))}var i=e("./camelize"),o=/^-ms-/;t.exports=r},{"./camelize":298}],300:[function(e,t,n){"use strict";function r(e,t){var n=!0;e:for(;n;){var r=e,o=t;if(n=!1,r&&o){if(r===o)return!0;if(i(r))return!1;if(i(o)){e=r,t=o.parentNode,n=!0;continue e}return r.contains?r.contains(o):r.compareDocumentPosition?!!(16&r.compareDocumentPosition(o)):!1}return!1}}var i=e("./isTextNode");t.exports=r},{"./isTextNode":313}],301:[function(e,t,n){"use strict";function r(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function i(e){return r(e)?Array.isArray(e)?e.slice():o(e):[e]}var o=e("./toArray");t.exports=i},{"./toArray":321}],302:[function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,t){var n=l;l?void 0:u(!1);var i=r(e),o=i&&s(i);if(o){n.innerHTML=o[1]+e+o[2];for(var c=o[0];c--;)n=n.lastChild}else n.innerHTML=e;var f=n.getElementsByTagName("script");f.length&&(t?void 0:u(!1),a(f).forEach(t));for(var p=a(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return p}var o=e("./ExecutionEnvironment"),a=e("./createArrayFromMixed"),s=e("./getMarkupWrap"),u=e("./invariant"),l=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=i},{"./ExecutionEnvironment":297,"./createArrayFromMixed":301,"./getMarkupWrap":307,"./invariant":311}],303:[function(e,t,n){"use strict";function r(e){return function(){return e}}function i(){}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},t.exports=i},{}],304:[function(e,t,n){"use strict";var r={};t.exports=r},{}],305:[function(e,t,n){"use strict";function r(e){try{e.focus()}catch(t){}}t.exports=r},{}],306:[function(e,t,n){"use strict";function r(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=r},{}],307:[function(e,t,n){"use strict";function r(e){return a?void 0:o(!1),p.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||("*"===e?a.innerHTML="<link />":a.innerHTML="<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?p[e]:null}var i=e("./ExecutionEnvironment"),o=e("./invariant"),a=i.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],f=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},d=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];d.forEach(function(e){p[e]=f,s[e]=!0}),t.exports=r},{"./ExecutionEnvironment":297,"./invariant":311}],308:[function(e,t,n){"use strict";function r(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=r},{}],309:[function(e,t,n){"use strict";function r(e){return e.replace(i,"-$1").toLowerCase()}var i=/([A-Z])/g;t.exports=r},{}],310:[function(e,t,n){"use strict";function r(e){return i(e).replace(o,"-ms-")}var i=e("./hyphenate"),o=/^ms-/;t.exports=r},{"./hyphenate":309}],311:[function(e,t,n){"use strict";function r(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=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,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}t.exports=r},{}],312:[function(e,t,n){"use strict";function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=r},{}],313:[function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=e("./isNode");t.exports=r},{"./isNode":312}],314:[function(e,t,n){"use strict";var r=e("./invariant"),i=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};t.exports=i},{"./invariant":311}],315:[function(e,t,n){"use strict";var r=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=r},{}],316:[function(e,t,n){"use strict";function r(e,t,n){if(!e)return null;var r={};for(var o in e)i.call(e,o)&&(r[o]=t.call(n,e[o],o,e));return r}var i=Object.prototype.hasOwnProperty;t.exports=r},{}],317:[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]}}t.exports=r},{}],318:[function(e,t,n){"use strict";var r,i=e("./ExecutionEnvironment");i.canUseDOM&&(r=window.performance||window.msPerformance||window.webkitPerformance),t.exports=r||{}},{"./ExecutionEnvironment":297}],319:[function(e,t,n){"use strict";var r,i=e("./performance");r=i.now?function(){return i.now()}:function(){return Date.now()},t.exports=r},{"./performance":318}],320:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=i.bind(t),a=0;a<n.length;a++)if(!o(n[a])||e[n[a]]!==t[n[a]])return!1;return!0}var i=Object.prototype.hasOwnProperty;t.exports=r},{}],321:[function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?i(!1):void 0,"number"!=typeof t?i(!1):void 0,0===t||t-1 in e?void 0:i(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),o=0;t>o;o++)r[o]=e[o];return r}var i=e("./invariant");t.exports=r},{"./invariant":311}],322:[function(e,t,n){"use strict";var r=e("./emptyFunction"),i=r;t.exports=i},{"./emptyFunction":303}],323:[function(e,t,n){!function(e){function t(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function n(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function r(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;i>r;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}function i(t,n,r,s){var u=[],l=null,c=null,f=null;for(c=r[r.length-1];t.length>0;){if(f=t.shift(),c&&"<"==c.tag&&!(f.tag in j))throw new Error("Illegal content in < super tag.");if(e.tags[f.tag]<=e.tags.$||o(f,s))r.push(f),f.nodes=i(t,f.tag,r,s);else{if("/"==f.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+f.n);if(l=r.pop(),f.n!=l.n&&!a(f.n,l.n,s))throw new Error("Nesting error: "+l.n+" vs. "+f.n);return l.end=f.i,u}"\n"==f.tag&&(f.last=0==t.length||"\n"==t[0].tag)}u.push(f)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return u}function o(e,t){for(var n=0,r=t.length;r>n;n++)if(t[n].o==e.n)return e.tag="#",!0}function a(e,t,n){for(var r=0,i=n.length;i>r;r++)if(n[r].c==e&&n[r].o==t)return!0}function s(e){var t=[];for(var n in e)t.push('"'+l(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}function u(e){var t=[];for(var n in e.partials)t.push('"'+l(n)+'":{name:"'+l(e.partials[n].name)+'", '+u(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+s(e.subs)}function l(e){return e.replace(g,"\\\\").replace(m,'\\"').replace(v,"\\n").replace(y,"\\r").replace(b,"\\u2028").replace(_,"\\u2029")}function c(e){return~e.indexOf(".")?"d":"f"}function f(e,t){var n="<"+(t.prefix||""),r=n+e.n+w++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+l(r)+'",c,p,"'+(e.indent||"")+'"));',r}function p(e,t){t.code+="t.b(t.t(t."+c(e.n)+'("'+l(e.n)+'",c,p,0)));'}function d(e){return"t.b("+e+");"}var h=/\S/,m=/\"/g,v=/\n/g,y=/\r/g,g=/\\/g,b=/\u2028/,_=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(i,o){function a(){g.length>0&&(b.push({tag:"_t",text:new String(g)}),g="")}function s(){for(var t=!0,n=w;n<b.length;n++)if(t=e.tags[b[n].tag]<e.tags._v||"_t"==b[n].tag&&null===b[n].text.match(h),!t)return!1;return t}function u(e,t){if(a(),e&&s())for(var n,r=w;r<b.length;r++)b[r].text&&((n=b[r+1])&&">"==n.tag&&(n.indent=b[r].text.toString()),b.splice(r,1));else t||b.push({tag:"\n"});_=!1,w=b.length}function l(e,t){var r="="+x,i=e.indexOf(r,t),o=n(e.substring(e.indexOf("=",t)+1,i)).split(" ");return C=o[0],x=o[o.length-1],i+r.length-1}var c=i.length,f=0,p=1,d=2,m=f,v=null,y=null,g="",b=[],_=!1,j=0,w=0,C="{{",x="}}";for(o&&(o=o.split(" "),C=o[0],x=o[1]),j=0;c>j;j++)m==f?r(C,i,j)?(--j,a(),m=p):"\n"==i.charAt(j)?u(_):g+=i.charAt(j):m==p?(j+=C.length-1,y=e.tags[i.charAt(j+1)],v=y?i.charAt(j+1):"_v","="==v?(j=l(i,j),m=f):(y&&j++,m=d),_=j):r(x,i,j)?(b.push({tag:v,n:n(g),otag:C,ctag:x,i:"/"==v?_-C.length:j+x.length}),g="",j+=x.length-1,m=f,"{"==v&&("}}"==x?j++:t(b[b.length-1]))):g+=i.charAt(j);return u(_,!0),b};var j={_t:!0,"\n":!0,$:!0,"/":!0};e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+u(t)+"}"};var w=0;e.generate=function(t,n,r){w=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+c(t.n)+'("'+l(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+c(t.n)+'("'+l(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":f,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[f(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+l(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=d('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+c(e.n)+'("'+l(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=d('"'+l(e.text)+'"')},"{":p,"&":p},e.walk=function(t,n){for(var r,i=0,o=t.length;o>i;i++)r=e.codegen[t[i].tag],r&&r(t[i],n);return n},e.parse=function(e,t,n){return n=n||{},i(e,"",[],n.sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var o=i.partials;for(var a in o)delete o[a].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}("undefined"!=typeof n?n:Hogan)},{}],324:[function(e,t,n){var r=e("./compiler");r.Template=e("./template").Template,r.template=r.Template,t.exports=r},{"./compiler":323,"./template":325}],325:[function(e,t,n){var r={};!function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}function n(e,t,n,r,i,o){function a(){}function s(){}a.prototype=e,s.prototype=e.subs;var u,l=new a;l.subs=new s,l.subsText={},l.buf="",r=r||{},l.stackSubs=r,l.subsText=o;for(u in t)r[u]||(r[u]=t[u]);for(u in r)l.subs[u]=r[u];i=i||{},l.stackPartials=i;for(u in n)i[u]||(i[u]=n[u]);for(u in i)l.partials[u]=i[u];return l}function r(e){return String(null===e||void 0===e?"":e)}function i(e){return e=r(e),c.test(e)?e.replace(o,"&").replace(a,"<").replace(s,">").replace(u,"'").replace(l,"""):e}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:i,t:r,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var r=this.partials[e],i=t[r.name];if(r.instance&&r.base==i)return r.instance;if("string"==typeof i){if(!this.c)throw new Error("No compiler available.");i=this.c.compile(i,this.options)}if(!i)return null;if(this.partials[e].base=i,r.subs){t.stackText||(t.stackText={});for(key in r.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);i=n(i,r.subs,r.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=i,i},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(!f(r))return void n(e,t,this);for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop()},s:function(e,t,n,r,i,o,a){var s;return f(e)&&0===e.length?!1:("function"==typeof e&&(e=this.ms(e,t,n,r,i,o,a)),s=!!e,!r&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,n,r,i){var o,a=e.split("."),s=this.f(a[0],n,r,i),u=this.options.modelGet,l=null;if("."===e&&f(n[n.length-2]))s=n[n.length-1];else for(var c=1;c<a.length;c++)o=t(a[c],s,u),void 0!==o?(l=s,s=o):s="";return i&&!s?!1:(i||"function"!=typeof s||(n.push(l),s=this.mv(s,n,r),n.pop()),s)},f:function(e,n,r,i){for(var o=!1,a=null,s=!1,u=this.options.modelGet,l=n.length-1;l>=0;l--)if(a=n[l],o=t(e,a,u),void 0!==o){s=!0;break}return s?(i||"function"!=typeof o||(o=this.mv(o,n,r)),o):i?!1:""},ls:function(e,t,n,i,o){var a=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(r(e.call(t,i)),t,n)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,o,a){var s,u=t[t.length-1],l=e.call(u);return"function"==typeof l?r?!0:(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(l,u,n,s.substring(i,o),a)):l},mv:function(e,t,n){var i=t[t.length-1],o=e.call(i);return"function"==typeof o?this.ct(r(o.call(i)),i,n):o},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var o=/&/g,a=/</g,s=/>/g,u=/\'/g,l=/\"/g,c=/[&<>\"\']/,f=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}("undefined"!=typeof n?n:r)},{}],326:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],327:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("./src/lib/main.js"),o=r(i);t.exports=o["default"]},{"./src/lib/main.js":347}],328:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=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(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),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}}(),c=e("react"),f=r(c),p=e("../Template.js"),d=r(p),h=e("../../lib/utils.js"),m=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"componentWillMount",value:function(){this.handleClick=this.handleClick.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url||this.props.hasRefinements!==e.hasRefinements}},{key:"handleClick",value:function(e){(0,h.isSpecialClick)(e)||(e.preventDefault(),this.props.clearAll())}},{key:"render",value:function(){var e={hasRefinements:this.props.hasRefinements};return u("a",{className:this.props.cssClasses.link,href:this.props.url,onClick:this.handleClick},void 0,f["default"].createElement(d["default"],s({data:e,templateKey:"link"},this.props.templateProps)))}}]),t}(f["default"].Component);n["default"]=m},{"../../lib/utils.js":351,"../Template.js":342,react:811}],329:[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 s(e){var t={};return void 0!==e.template&&(t.templates={item:e.template}),void 0!==e.transformData&&(t.transformData=e.transformData),t}function u(e,t,n){var r=(0,j["default"])(t);return r.cssClasses=n,void 0!==e.label&&(r.label=e.label),void 0!==r.operator&&(r.displayOperator=r.operator,">="===r.operator&&(r.displayOperator="≥"),"<="===r.operator&&(r.displayOperator="≤")),r}function l(e){return function(t){(0,y.isSpecialClick)(t)||(t.preventDefault(),e())}}Object.defineProperty(n,"__esModule",{value:!0});var c=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},f=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});
if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),p=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}}(),d=e("react"),h=r(d),m=e("../Template.js"),v=r(m),y=e("../../lib/utils.js"),g=e("lodash/collection/map"),b=r(g),_=e("lodash/lang/cloneDeep"),j=r(_),w=e("lodash/lang/isEqual"),C=r(w),x=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),p(t,[{key:"shouldComponentUpdate",value:function(e){return!(0,C["default"])(this.props.refinements,e.refinements)}},{key:"_clearAllElement",value:function(e,t){return t===e?f("a",{className:this.props.cssClasses.clearAll,href:this.props.clearAllURL,onClick:l(this.props.clearAllClick)},void 0,h["default"].createElement(v["default"],c({templateKey:"clearAll"},this.props.templateProps))):void 0}},{key:"_refinementElement",value:function(e,t){var n=this.props.attributes[e.attributeName]||{},r=u(n,e,this.props.cssClasses),i=s(n),o=e.attributeName+(e.operator?e.operator:":")+(e.exclude?e.exclude:"")+e.name;return f("div",{className:this.props.cssClasses.item},o,f("a",{className:this.props.cssClasses.link,href:this.props.clearRefinementURLs[t],onClick:l(this.props.clearRefinementClicks[t])},void 0,h["default"].createElement(v["default"],c({data:r,templateKey:"item"},this.props.templateProps,i))))}},{key:"render",value:function(){return f("div",{},void 0,this._clearAllElement("before",this.props.clearAllPosition),f("div",{className:this.props.cssClasses.list},void 0,(0,b["default"])(this.props.refinements,this._refinementElement,this)),this._clearAllElement("after",this.props.clearAllPosition))}}]),t}(h["default"].Component);n["default"]=x},{"../../lib/utils.js":351,"../Template.js":342,"lodash/collection/map":408,"lodash/lang/cloneDeep":514,"lodash/lang/isEqual":519,react:811}],330:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),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},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}}(),c=e("react"),f=r(c),p=e("lodash/collection/map"),d=r(p),h=e("./Template.js"),m=r(h),v=e("lodash/lang/isEqual"),y=r(v),g=e("classnames"),b=r(g),_=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){return 0===this.props.results.hits.length||this.props.results.hits.length!==e.results.hits.length||!(0,y["default"])(this.props.results.hits,e.results.hits)}},{key:"renderWithResults",value:function(){var e=this,t=(0,d["default"])(this.props.results.hits,function(t){return f["default"].createElement(m["default"],u({data:t,key:t.objectID,rootProps:{className:e.props.cssClasses.item},templateKey:"item"},e.props.templateProps))});return s("div",{className:this.props.cssClasses.root},void 0,t)}},{key:"renderAllResults",value:function(){return f["default"].createElement(m["default"],u({data:this.props.results,rootProps:{className:this.props.cssClasses.allItems},templateKey:"allItems"},this.props.templateProps))}},{key:"renderNoResults",value:function(){return f["default"].createElement(m["default"],u({data:this.props.results,rootProps:{className:(0,b["default"])(this.props.cssClasses.root,this.props.cssClasses.empty)},templateKey:"empty"},this.props.templateProps))}},{key:"render",value:function(){if(this.props.results.hits.length>0){var e=this.props.templateProps&&this.props.templateProps.templates&&this.props.templateProps.templates.allItems;return e?this.renderAllResults():this.renderWithResults()}return this.renderNoResults()}}]),t}(f["default"].Component);_.defaultProps={results:{hits:[]}},n["default"]=_},{"./Template.js":342,classnames:273,"lodash/collection/map":408,"lodash/lang/isEqual":519,react:811}],331:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),u=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}}(),l=e("react"),c=r(l),f=e("lodash/collection/forEach"),p=r(f),d=e("lodash/object/defaultsDeep"),h=r(d),m=e("../../lib/utils.js"),v=e("./Paginator.js"),y=r(v),g=e("./PaginationLink.js"),b=r(g),_=e("classnames"),j=r(_),w=function(e){function t(e){i(this,t);var n=o(this,Object.getPrototypeOf(t).call(this,(0,h["default"])(e,t.defaultProps)));return n.handleClick=n.handleClick.bind(n),n}return a(t,e),u(t,[{key:"pageLink",value:function(e){var t=e.label,n=e.ariaLabel,r=e.pageNumber,i=e.additionalClassName,o=void 0===i?null:i,a=e.isDisabled,u=void 0===a?!1:a,l=e.isActive,c=void 0===l?!1:l,f=e.createURL,p={item:(0,j["default"])(this.props.cssClasses.item,o),link:(0,j["default"])(this.props.cssClasses.link)};u?p.item=(0,j["default"])(p.item,this.props.cssClasses.disabled):c&&(p.item=(0,j["default"])(p.item,this.props.cssClasses.active));var d=f&&!u?f(r):"#";return s(b["default"],{ariaLabel:n,cssClasses:p,handleClick:this.handleClick,label:t,pageNumber:r,url:d},t+r)}},{key:"previousPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Previous",additionalClassName:this.props.cssClasses.previous,isDisabled:e.isFirstPage(),label:this.props.labels.previous,pageNumber:e.currentPage-1,createURL:t})}},{key:"nextPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Next",additionalClassName:this.props.cssClasses.next,isDisabled:e.isLastPage(),label:this.props.labels.next,pageNumber:e.currentPage+1,createURL:t})}},{key:"firstPageLink",value:function(e,t){return this.pageLink({ariaLabel:"First",additionalClassName:this.props.cssClasses.first,isDisabled:e.isFirstPage(),label:this.props.labels.first,pageNumber:0,createURL:t})}},{key:"lastPageLink",value:function(e,t){return this.pageLink({ariaLabel:"Last",additionalClassName:this.props.cssClasses.last,isDisabled:e.isLastPage(),label:this.props.labels.last,pageNumber:e.total-1,createURL:t})}},{key:"pages",value:function n(e,t){var r=this,n=[];return(0,p["default"])(e.pages(),function(i){var o=i===e.currentPage;n.push(r.pageLink({ariaLabel:i+1,additionalClassName:r.props.cssClasses.page,isActive:o,label:i+1,pageNumber:i,createURL:t}))}),n}},{key:"handleClick",value:function(e,t){(0,m.isSpecialClick)(t)||(t.preventDefault(),this.props.setCurrentPage(e))}},{key:"render",value:function(){var e=new y["default"]({currentPage:this.props.currentPage,total:this.props.nbPages,padding:this.props.padding}),t=this.props.createURL;return s("ul",{className:this.props.cssClasses.root},void 0,this.props.showFirstLast?this.firstPageLink(e,t):null,this.previousPageLink(e,t),this.pages(e,t),this.nextPageLink(e,t),this.props.showFirstLast?this.lastPageLink(e,t):null)}}]),t}(c["default"].Component);w.defaultProps={nbHits:0,currentPage:0,nbPages:0},n["default"]=w},{"../../lib/utils.js":351,"./PaginationLink.js":332,"./Paginator.js":333,classnames:273,"lodash/collection/forEach":406,"lodash/object/defaultsDeep":530,react:811}],332:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),u=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}}(),l=e("react"),c=r(l),f=e("lodash/lang/isEqual"),p=r(f),d=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillMount",value:function(){this.handleClick=this.handleClick.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return!(0,p["default"])(this.props,e)}},{key:"handleClick",value:function(e){this.props.handleClick(this.props.pageNumber,e)}},{key:"render",value:function(){var e=this.props,t=e.cssClasses,n=e.label,r=e.ariaLabel,i=e.url;return s("li",{className:t.item},void 0,s("a",{ariaLabel:r,className:t.link,dangerouslySetInnerHTML:{__html:n},href:i,onClick:this.handleClick}))}}]),t}(c["default"].Component);n["default"]=d},{"lodash/lang/isEqual":519,react:811}],333:[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")}Object.defineProperty(n,"__esModule",{value:!0});var o=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}}(),a=e("lodash/utility/range"),s=r(a),u=function(){function e(t){i(this,e),this.currentPage=t.currentPage,this.total=t.total,this.padding=t.padding}return o(e,[{key:"pages",value:function(){var e=this.total,t=this.currentPage,n=this.padding,r=this.nbPagesDisplayed(n,e);if(r===e)return(0,s["default"])(0,e);var i=this.calculatePaddingLeft(t,n,e,r),o=r-i,a=t-i,u=t+o;return(0,s["default"])(a,u)}},{key:"nbPagesDisplayed",value:function(e,t){return Math.min(2*e+1,t)}},{key:"calculatePaddingLeft",value:function(e,t,n,r){return t>=e?e:e>=n-t?r-(n-e):t}},{key:"isLastPage",value:function(){return this.currentPage===this.total-1}},{key:"isFirstPage",value:function(){return 0===this.currentPage}}]),e}();n["default"]=u},{"lodash/utility/range":542}],334:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),u=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}}(),l=e("react"),c=r(l),f=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return s("div",{className:this.props.cssClasses.root},void 0,"Search by",s("a",{className:this.props.cssClasses.link,href:this.props.link,target:"_blank"},void 0,"Algolia"))}}]),t}(c["default"].Component);n["default"]=f},{react:811}],335:[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 s(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(n,"__esModule",{value:!0});var u=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),l=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(){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=e("react"),p=r(f),d=e("../Template.js"),h=r(d),m=e("./PriceRangesForm.js"),v=r(m),y=e("classnames"),g=r(y),b=e("lodash/lang/isEqual"),_=r(b),j=function(e){function t(){return o(this,t),a(this,Object.getPrototypeOf(t).apply(this,arguments))}return s(t,e),c(t,[{key:"componentWillMount",value:function(){this.refine=this.refine.bind(this),this.form=this.getForm()}},{key:"shouldComponentUpdate",value:function(e){return!(0,_["default"])(this.props.facetValues,e.facetValues)}},{key:"getForm",value:function(){var e=l({currency:this.props.currency},this.props.labels);return u(v["default"],{cssClasses:this.props.cssClasses,labels:e,refine:this.refine})}},{key:"getItemFromFacetValue",value:function(e){var t=(0,g["default"])(this.props.cssClasses.item,i({},this.props.cssClasses.active,e.isRefined)),n=e.from+"_"+e.to,r=this.refine.bind(this,e.from,e.to),o=l({currency:this.props.currency},e);return u("div",{className:t},n,u("a",{className:this.props.cssClasses.link,href:e.url,onClick:r},void 0,p["default"].createElement(h["default"],l({data:o,templateKey:"item"},this.props.templateProps))))}},{key:"refine",value:function(e,t,n){n.preventDefault(),this.props.refine(e,t)}},{key:"render",value:function(){var e=this;return u("div",{},void 0,u("div",{className:this.props.cssClasses.list},void 0,this.props.facetValues.map(function(t){return e.getItemFromFacetValue(t)})),this.form)}}]),t}(p["default"].Component);j.defaultProps={cssClasses:{}},n["default"]=j},{"../Template.js":342,"./PriceRangesForm.js":336,classnames:273,"lodash/lang/isEqual":519,react:811}],336:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),u=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}}(),l=e("react"),c=r(l),f=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillMount",value:function(){this.handleSubmit=this.handleSubmit.bind(this)}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getInput",value:function(e){return s("label",{className:this.props.cssClasses.label},void 0,s("span",{className:this.props.cssClasses.currency},void 0,this.props.labels.currency," "),c["default"].createElement("input",{className:this.props.cssClasses.input,ref:e,type:"number"}))}},{key:"handleSubmit",value:function(e){var t=+this.refs.from.value||void 0,n=+this.refs.to.value||void 0;this.props.refine(t,n,e)}},{key:"render",value:function(){var e=this.getInput("from"),t=this.getInput("to"),n=this.handleSubmit;return c["default"].createElement("form",{className:this.props.cssClasses.form,onSubmit:n,ref:"form"},e,s("span",{className:this.props.cssClasses.separator},void 0," ",this.props.labels.separator," "),t,s("button",{className:this.props.cssClasses.button,type:"submit"},void 0,this.props.labels.button))}}]),t}(c["default"].Component);f.defaultProps={cssClasses:{},labels:{}},n["default"]=f},{react:811}],337:[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 s(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(n,"__esModule",{value:!0});var u=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),l=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(){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=e("react"),p=r(f),d=e("classnames"),h=r(d),m=e("../../lib/utils.js"),v=e("../Template.js"),y=r(v),g=e("./RefinementListItem.js"),b=r(g),_=e("lodash/lang/isEqual"),j=r(_),w=function(e){function t(e){o(this,t);var n=a(this,Object.getPrototypeOf(t).call(this,e));return n.state={isShowMoreOpen:!1},n.handleItemClick=n.handleItemClick.bind(n),n.handleClickShowMore=n.handleClickShowMore.bind(n),n}return s(t,e),c(t,[{key:"shouldComponentUpdate",value:function(e,t){return t!==this.state||!(0,j["default"])(this.props.facetValues,e.facetValues)}},{key:"refine",value:function(e,t){this.props.toggleRefinement(e,t)}},{key:"_generateFacetItem",value:function(e){var n=void 0,r=e.data&&e.data.length>0;r&&(n=p["default"].createElement(t,l({},this.props,{depth:this.props.depth+1,facetValues:e.data})));var o=l({},e,{cssClasses:this.props.cssClasses}),a=(0,h["default"])(this.props.cssClasses.item,i({},this.props.cssClasses.active,e.isRefined)),s=e[this.props.attributeNameKey];return void 0!==e.isRefined&&(s+="/"+e.isRefined),void 0!==e.count&&(s+="/"+e.count),u(b["default"],{facetValueToRefine:e[this.props.attributeNameKey],handleClick:this.handleItemClick,isRefined:e.isRefined,itemClassName:a,subItems:n,templateData:o,templateKey:"item",templateProps:this.props.templateProps},s)}},{key:"handleItemClick",value:function(e){var t=e.facetValueToRefine,n=e.originalEvent,r=e.isRefined;if(!(0,m.isSpecialClick)(n)){if("INPUT"===n.target.tagName)return void this.refine(t,r);for(var i=n.target;i!==n.currentTarget;){if("LABEL"===i.tagName&&(i.querySelector('input[type="checkbox"]')||i.querySelector('input[type="radio"]')))return;"A"===i.tagName&&i.href&&n.preventDefault(),i=i.parentNode}n.stopPropagation(),this.refine(t,r)}}},{key:"handleClickShowMore",value:function(){var e=!this.state.isShowMoreOpen;this.setState({isShowMoreOpen:e})}},{key:"render",value:function(){var e=[this.props.cssClasses.list];this.props.cssClasses.depth&&e.push(""+this.props.cssClasses.depth+this.props.depth);var t=this.state.isShowMoreOpen?this.props.limitMax:this.props.limitMin,n=this.props.showMore?p["default"].createElement(y["default"],l({rootProps:{onClick:this.handleClickShowMore},templateKey:"show-more-"+(this.state.isShowMoreOpen?"active":"inactive")},this.props.templateProps)):void 0;return u("div",{className:(0,h["default"])(e)},void 0,this.props.facetValues.map(this._generateFacetItem,this).slice(0,t),n)}}]),t}(p["default"].Component);w.defaultProps={cssClasses:{},depth:0,attributeNameKey:"name"},n["default"]=w},{"../../lib/utils.js":351,"../Template.js":342,"./RefinementListItem.js":338,classnames:273,"lodash/lang/isEqual":519,react:811}],338:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=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(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),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}}(),c=e("react"),f=r(c),p=e("../Template.js"),d=r(p),h=e("lodash/lang/isEqual"),m=r(h),v=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),l(t,[{key:"componentWillMount",value:function(){this.handleClick=this.handleClick.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return!(0,m["default"])(this.props,e)}},{key:"handleClick",value:function(e){this.props.handleClick({facetValueToRefine:this.props.facetValueToRefine,isRefined:this.props.isRefined,originalEvent:e})}},{key:"render",value:function(){return u("div",{className:this.props.itemClassName,onClick:this.handleClick},void 0,f["default"].createElement(d["default"],s({data:this.props.templateData,templateKey:this.props.templateKey},this.props.templateProps)),this.props.subItems)}}]),t}(f["default"].Component);n["default"]=v},{"../Template.js":342,"lodash/lang/isEqual":519,react:811}],339:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),u=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}}(),l=e("react"),c=r(l),f=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillMount",value:function(){this.handleChange=this.handleChange.bind(this)}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"handleChange",value:function(e){this.props.setValue(e.target.value)}},{key:"render",value:function(){var e=this,t=this.props,n=t.currentValue,r=t.options;return s("select",{className:this.props.cssClasses.root,defaultValue:n,onChange:this.handleChange},void 0,r.map(function(t){return s("option",{className:e.props.cssClasses.item,value:t.value},t.value,t.label)}))}}]),t}(c["default"].Component);n["default"]=f},{react:811}],340:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=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(){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}}(),l=e("react"),c=r(l),f=e("react-nouislider"),p=r(f),d=e("lodash/lang/isEqual"),h=r(d),m="ais-range-slider--",v=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillMount",value:function(){this.handleChange=this.handleChange.bind(this)}},{key:"shouldComponentUpdate",value:function(e){return!(0,h["default"])(this.props.range,e.range)||!(0,h["default"])(this.props.start,e.start)}},{key:"handleChange",value:function(e,t,n){this.props.onChange(n)}},{key:"render",value:function(){if(this.props.range.min===this.props.range.max)return null;var e=void 0;return e=this.props.pips===!1?void 0:this.props.pips===!0||"undefined"==typeof this.props.pips?{mode:"positions",density:3,values:[0,50,100],stepped:!0,format:{to:function(e){return Number(e).toLocaleString()}}}:this.props.pips,c["default"].createElement(p["default"],s({},this.props,{animate:!1,behaviour:"snap",connect:!0,cssPrefix:m,onChange:this.handleChange,pips:e}))}}]),t}(c["default"].Component);n["default"]=v},{"lodash/lang/isEqual":519,react:811,"react-nouislider":682}],341:[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)}Object.defineProperty(n,"__esModule",{value:!0});var s=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(){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}}(),l=e("react"),c=r(l),f=e("../Template.js"),p=r(f),d=function(e){function t(){return i(this,t),o(this,Object.getPrototypeOf(t).apply(this,arguments))}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.nbHits!==e.hits||this.props.processingTimeMS!==e.processingTimeMS}},{key:"render",value:function(){var e={hasManyResults:this.props.nbHits>1,hasNoResults:0===this.props.nbHits,hasOneResult:1===this.props.nbHits,hitsPerPage:this.props.hitsPerPage,nbHits:this.props.nbHits,nbPages:this.props.nbPages,page:this.props.page,processingTimeMS:this.props.processingTimeMS,query:this.props.query,cssClasses:this.props.cssClasses};return c["default"].createElement(p["default"],s({data:e,templateKey:"body"},this.props.templateProps))}}]),t}(c["default"].Component);n["default"]=d},{"../Template.js":342,react:811}],342:[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 s(e,t,n){if(!e)return n;var r=(0,g["default"])(n),i=void 0,o="undefined"==typeof e?"undefined":c(e);if("function"===o)i=e(r);else{if("object"!==o)throw new Error("transformData must be a function or an object, was "+o+" (key : "+t+")");i=e[t]?e[t](r):n}var a="undefined"==typeof i?"undefined":c(i),s="undefined"==typeof n?"undefined":c(n);if(a!==s)throw new Error("`transformData` must return a `"+s+"`, got `"+a+"`.");return i}function u(e){var t=e.templates,n=e.templateKey,r=e.compileOptions,i=e.helpers,o=e.data,a=t[n],s="undefined"==typeof a?"undefined":c(a),u="string"===s,p="function"===s;if(u||p){if(p)return a(o);var d=l(i,r,o),h=f({},o,{helpers:d});return w["default"].compile(a,r).render(h)}throw new Error("Template must be 'string' or 'function', was '"+s+"' (key: "+n+")")}function l(e,t,n){return(0,_["default"])(e,function(e){return(0,v["default"])(function(r){var i=this,o=function(e){return w["default"].compile(e,t).render(i)};return e.call(n,r,o)})})}Object.defineProperty(n,"__esModule",{value:!0});var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},f=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},p=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}}(),d=e("react"),h=r(d),m=e("lodash/function/curry"),v=r(m),y=e("lodash/lang/cloneDeep"),g=r(y),b=e("lodash/object/mapValues"),_=r(b),j=e("hogan.js"),w=r(j),C=e("lodash/lang/isEqual"),x=r(C),E=function(e){function t(e){return i(this,t),o(this,Object.getPrototypeOf(t).call(this,e))}return a(t,e),p(t,[{key:"shouldComponentUpdate",value:function(e){return!(0,x["default"])(this.props.data,e.data)||this.props.templateKey!==e.templateKey}},{key:"render",value:function(){var e=this.props.useCustomCompileOptions[this.props.templateKey],t=e?this.props.templatesConfig.compileOptions:{},n=u({templates:this.props.templates,templateKey:this.props.templateKey,compileOptions:t,helpers:this.props.templatesConfig.helpers,data:s(this.props.transformData,this.props.templateKey,this.props.data)});return null===n?null:h["default"].isValidElement(n)?h["default"].createElement("div",this.props.rootProps,n):h["default"].createElement("div",f({},this.props.rootProps,{dangerouslySetInnerHTML:{__html:n}}))}}]),t}(h["default"].Component);E.defaultProps={data:{},useCustomCompileOptions:{},templates:{},templatesConfig:{}},n["default"]=E},{"hogan.js":396,"lodash/function/curry":412,"lodash/lang/cloneDeep":514,"lodash/lang/isEqual":519,"lodash/object/mapValues":535,react:811}],343:[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 s(e){var t=function(t){function n(){return i(this,n),o(this,Object.getPrototypeOf(n).apply(this,arguments))}return a(n,t),u(n,[{key:"componentDidMount",value:function(){this._hideOrShowContainer(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.props.shouldAutoHideContainer!==e.shouldAutoHideContainer&&this._hideOrShowContainer(e)}},{key:"shouldComponentUpdate",value:function(e){return e.shouldAutoHideContainer===!1}},{key:"_hideOrShowContainer",value:function(e){var t=p["default"].findDOMNode(this).parentNode;t.style.display=e.shouldAutoHideContainer===!0?"none":""}},{key:"render",value:function(){return c["default"].createElement(e,this.props)}}]),n}(c["default"].Component);return t.displayName=e.name+"-AutoHide",t}Object.defineProperty(n,"__esModule",{value:!0});var u=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}}(),l=e("react"),c=r(l),f=e("react-dom"),p=r(f);n["default"]=s},{react:811,"react-dom":681}],344:[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 s(e){var t=function(t){function n(e){i(this,n);var t=o(this,Object.getPrototypeOf(n).call(this,e));return t.handleHeaderClick=t.handleHeaderClick.bind(t),t.state={collapsed:e.collapsible&&e.collapsible.collapsed},t._headerElement=t._getElement({type:"header",handleClick:e.collapsible?t.handleHeaderClick:null}),t._cssClasses={root:(0,h["default"])("ais-root",t.props.cssClasses.root),body:(0,h["default"])("ais-body",t.props.cssClasses.body)},t._footerElement=t._getElement({type:"footer"}),t}return a(n,t),c(n,[{key:"shouldComponentUpdate",value:function(e,t){return t.collapsed===!1||t!==this.state}},{key:"_getElement",value:function(e){var t=e.type,n=e.handleClick,r=void 0===n?null:n,i=this.props.templateProps.templates;if(!i||!i[t])return null;var o=(0,h["default"])(this.props.cssClasses[t],"ais-"+t);return p["default"].createElement(v["default"],l({},this.props.templateProps,{rootProps:{className:o,onClick:r},templateKey:t,transformData:null}))}},{key:"handleHeaderClick",value:function(){this.setState({collapsed:!this.state.collapsed})}},{key:"render",value:function(){var t=[this._cssClasses.root];this.props.collapsible&&t.push("ais-root__collapsible"),this.state.collapsed&&t.push("ais-root__collapsed");var n=l({},this._cssClasses,{root:(0,h["default"])(t)});return u("div",{className:n.root},void 0,this._headerElement,u("div",{className:n.body},void 0,p["default"].createElement(e,this.props)),this._footerElement)}}]),n}(p["default"].Component);return t.defaultProps={cssClasses:{},collapsible:!1},t.displayName=e.name+"-HeaderFooter",t}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),l=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(){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=e("react"),p=r(f),d=e("classnames"),h=r(d),m=e("../components/Template.js"),v=r(m);n["default"]=s},{"../components/Template.js":342,classnames:273,react:811}],345:[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 s(){return"#"}function u(e,t){if(!t.getConfiguration)return e;var n=t.getConfiguration(e);return(0,g["default"])({},e,n,function(e,t){return Array.isArray(e)?(0,_["default"])(e,t):void 0})}Object.defineProperty(n,"__esModule",{value:!0});var l=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(){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=e("algoliasearch"),p=r(f),d=e("algoliasearch-helper"),h=r(d),m=e("lodash/collection/forEach"),v=r(m),y=e("lodash/object/merge"),g=r(y),b=e("lodash/array/union"),_=r(b),j=e("lodash/lang/clone"),w=r(j),C=e("events"),x=e("./url-sync.js"),E=r(x),R=e("./version.js"),O=r(R),P=e("./createHelpers.js"),S=r(P),k=function(e){function t(e){var n=e.appId,r=void 0===n?null:n,a=e.apiKey,s=void 0===a?null:a,u=e.indexName,c=void 0===u?null:u,f=e.numberLocale,d=e.searchParameters,h=void 0===d?{}:d,m=e.urlSync,v=void 0===m?null:m,y=e.searchFunction;i(this,t);var g=o(this,Object.getPrototypeOf(t).call(this));if(null===r||null===s||null===c){var b="\nUsage: instantsearch({\n appId: 'my_application_id',\n apiKey: 'my_search_api_key',\n indexName: 'my_index_name'\n});";throw new Error(b)}var _=(0,p["default"])(r,s);return _.addAlgoliaAgent("instantsearch.js "+O["default"]),g.client=_,g.helper=null,g.indexName=c,g.searchParameters=l({},h,{index:c}),g.widgets=[],g.templatesConfig={helpers:(0,S["default"])({numberLocale:f}),compileOptions:{}},y&&(g._searchFunction=y),g.urlSync=v===!0?{}:v,g}return a(t,e),c(t,[{key:"addWidget",value:function(e){if(void 0===e.render&&void 0===e.init)throw new Error("Widget definition missing render or init method");this.widgets.push(e)}},{key:"start",value:function(){if(!this.widgets)throw new Error("No widgets were added to instantsearch.js");if(this.urlSync){var e=(0,E["default"])(this.urlSync);this._createURL=e.createURL.bind(e),this._onHistoryChange=e.onHistoryChange.bind(e),this.widgets.push(e)}else this._createURL=s,this._onHistoryChange=function(){};this.searchParameters=this.widgets.reduce(u,this.searchParameters);var t=(0,h["default"])(this.client,this.searchParameters.index||this.indexName,this.searchParameters);this._searchFunction&&(this._originalHelperSearch=t.search.bind(t),t.search=this._wrappedSearch.bind(this)),this.helper=t,this._init(t.state,t),t.on("result",this._render.bind(this,t)),t.search()}},{key:"_wrappedSearch",value:function(){var e=(0,w["default"])(this.helper);e.search=this._originalHelperSearch,this._searchFunction(e)}},{key:"createURL",value:function(e){if(!this._createURL)throw new Error("You need to call start() before calling createURL()");return this._createURL(this.helper.state.setQueryParameters(e))}},{key:"_render",value:function(e,t,n){(0,v["default"])(this.widgets,function(r){r.render&&r.render({templatesConfig:this.templatesConfig,results:t,state:n,helper:e,createURL:this._createURL})},this),this.emit("render")}},{key:"_init",value:function(e,t){var n=this._onHistoryChange,r=this.templatesConfig;(0,v["default"])(this.widgets,function(i){i.init&&i.init({state:e,helper:t,templatesConfig:r,createURL:this._createURL,onHistoryChange:n})},this)}}]),t}(C.EventEmitter);n["default"]=k},{"./createHelpers.js":346,"./url-sync.js":350,"./version.js":352,algoliasearch:387,"algoliasearch-helper":3,events:278,"lodash/array/union":400,"lodash/collection/forEach":406,"lodash/lang/clone":513,"lodash/object/merge":536}],346:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(e){var t=e.numberLocale;return{formatNumber:function(e,n){return Number(n(e)).toLocaleString(t)}}}},{}],347:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0}),e("../shams/Object.freeze.js"),e("../shims/Object.getPrototypeOf.js");var i=e("to-factory"),o=r(i),a=e("./InstantSearch.js"),s=r(a),u=e("algoliasearch-helper"),l=r(u),c=e("../widgets/clear-all/clear-all.js"),f=r(c),p=e("../widgets/current-refined-values/current-refined-values.js"),d=r(p),h=e("../widgets/hierarchical-menu/hierarchical-menu.js"),m=r(h),v=e("../widgets/hits/hits.js"),y=r(v),g=e("../widgets/hits-per-page-selector/hits-per-page-selector.js"),b=r(g),_=e("../widgets/menu/menu.js"),j=r(_),w=e("../widgets/refinement-list/refinement-list.js"),C=r(w),x=e("../widgets/numeric-refinement-list/numeric-refinement-list.js"),E=r(x),R=e("../widgets/numeric-selector/numeric-selector.js"),O=r(R),P=e("../widgets/pagination/pagination.js"),S=r(P),k=e("../widgets/price-ranges/price-ranges.js"),A=r(k),T=e("../widgets/search-box/search-box.js"),M=r(T),N=e("../widgets/range-slider/range-slider.js"),I=r(N),D=e("../widgets/sort-by-selector/sort-by-selector.js"),F=r(D),L=e("../widgets/star-rating/star-rating.js"),U=r(L),H=e("../widgets/stats/stats.js"),B=r(H),q=e("../widgets/toggle/toggle.js"),V=r(q),W=e("./version.js"),K=r(W),$=(0,o["default"])(s["default"]);$.widgets={clearAll:f["default"],currentRefinedValues:d["default"],hierarchicalMenu:m["default"],hits:y["default"],hitsPerPageSelector:b["default"],menu:j["default"],refinementList:C["default"],numericRefinementList:E["default"],numericSelector:O["default"],pagination:S["default"],priceRanges:A["default"],searchBox:M["default"],rangeSlider:I["default"],sortBySelector:F["default"],starRating:U["default"],stats:B["default"],toggle:V["default"]},$.version=K["default"],$.createQueryString=l["default"].url.getQueryStringFromState,n["default"]=$},{"../shams/Object.freeze.js":353,"../shims/Object.getPrototypeOf.js":354,"../widgets/clear-all/clear-all.js":355,"../widgets/current-refined-values/current-refined-values.js":357,"../widgets/hierarchical-menu/hierarchical-menu.js":360,"../widgets/hits-per-page-selector/hits-per-page-selector.js":361,"../widgets/hits/hits.js":363,"../widgets/menu/menu.js":365,"../widgets/numeric-refinement-list/numeric-refinement-list.js":367,"../widgets/numeric-selector/numeric-selector.js":368,"../widgets/pagination/pagination.js":369,"../widgets/price-ranges/price-ranges.js":372,"../widgets/range-slider/range-slider.js":373,"../widgets/refinement-list/refinement-list.js":375,"../widgets/search-box/search-box.js":376,"../widgets/sort-by-selector/sort-by-selector.js":377,"../widgets/star-rating/star-rating.js":380,"../widgets/stats/stats.js":382,"../widgets/toggle/toggle.js":384,"./InstantSearch.js":345,"./version.js":352,"algoliasearch-helper":3,"to-factory":812}],348:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={active:'<a class="ais-show-more ais-show-more__active">Show less</a>',inactive:'<a class="ais-show-more ais-show-more__inactive">Show more</a>'}},{}],349:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(!e)return null;if(e===!0)return u;var t=o({},e);return e.templates||(t.templates=u.templates),e.limit||(t.limit=u.limit),t}Object.defineProperty(n,"__esModule",{value:!0});var 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};n["default"]=i;var a=e("./defaultShowMoreTemplates.js"),s=r(a),u={templates:s["default"],limit:100}},{"./defaultShowMoreTemplates.js":348}],350:[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){var t=e;return function(){var e=Date.now(),n=e-t;return t=e,n}}function a(e){return s()+window.location.pathname+e}function s(){return window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function u(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.useHash||!1,n=t?w:C;return new x(n,e)}Object.defineProperty(n,"__esModule",{value:!0});var 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}}(),c=e("algoliasearch-helper"),f=r(c),p=e("../lib/version.js"),d=r(p),h=e("algoliasearch-helper/src/url"),m=r(h),v=e("lodash/lang/isEqual"),y=r(v),g=e("lodash/object/merge"),b=r(g),_=f["default"].AlgoliaSearchHelper,j=d["default"].split(".")[0],w={character:"#",onpopstate:function(e){window.addEventListener("hashchange",e)},pushState:function(e){window.location.assign(a(this.createURL(e)))},replaceState:function(e){window.location.replace(a(this.createURL(e)))},createURL:function(e){return window.location.search+this.character+e},readUrl:function(){return window.location.hash.slice(1)}},C={character:"?",onpopstate:function(e){window.addEventListener("popstate",e)},pushState:function(e){window.history.pushState(null,"",a(this.createURL(e)))},replaceState:function(e){window.history.replaceState(null,"",a(this.createURL(e)))},createURL:function(e){return this.character+e+document.location.hash},readUrl:function(){return window.location.search.slice(1)}},x=function(){function e(t,n){i(this,e),this.urlUtils=t,this.originalConfig=null,this.timer=o(Date.now()),this.mapping=n.mapping||{},this.threshold=n.threshold||700,this.trackedParameters=n.trackedParameters||["query","attribute:*","index","page","hitsPerPage"]}return l(e,[{key:"getConfiguration",value:function(e){this.originalConfig=e;var t=this.urlUtils.readUrl(),n=_.getConfigurationFromQueryString(t,{mapping:this.mapping});return n}},{key:"init",value:function(e){var t=this,n=e.helper;n.on("change",function(e){t.renderURLFromState(e)}),this.onHistoryChange(this.onPopState.bind(this,n))}},{key:"onPopState",value:function(e,t){var n=e.getState(this.trackedParameters),r=(0,b["default"])({},this.originalConfig,n);(0,y["default"])(r,t)||e.overrideStateWithoutTriggeringChangeEvent(t).search()}},{key:"renderURLFromState",value:function(e){var t=this.urlUtils.readUrl(),n=_.getForeignConfigurationInQueryString(t,{mapping:this.mapping});n.is_v=j;var r=m["default"].getQueryStringFromState(e.filter(this.trackedParameters),{moreAttributes:n,mapping:this.mapping});this.timer()<this.threshold?this.urlUtils.replaceState(r):this.urlUtils.pushState(r)}},{key:"createURL",value:function(e){var t=this.urlUtils.readUrl(),n=e.filter(this.trackedParameters),r=f["default"].url.getUnrecognizedParametersInQueryString(t,{mapping:this.mapping});return r.is_v=j,this.urlUtils.createURL(f["default"].url.getQueryStringFromState(n,{mapping:this.mapping}))}},{key:"onHistoryChange",value:function(e){var t=this;this.urlUtils.onpopstate(function(){var n=t.urlUtils.readUrl(),r=_.getConfigurationFromQueryString(n,{mapping:t.mapping}),i=(0,b["default"])({},t.originalConfig,r);e(i)})}}]),e}();n["default"]=u},{"../lib/version.js":352,"algoliasearch-helper":3,"algoliasearch-helper/src/url":175,"lodash/lang/isEqual":519,"lodash/object/merge":536}],351:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":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){var t="string"==typeof e,n=void 0;if(n=t?document.querySelector(e):e,!a(n)){var r="Container must be `string` or `HTMLElement`.";throw t&&(r+=" Unable to find "+e),new Error(r)}return n}function a(e){return e instanceof HTMLElement||!!e&&e.nodeType>0}function s(e){var t=1===e.button;return t||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function u(e){return function(t,n){return t||n?t&&!n?e+"--"+t:t&&n?e+"--"+t+"__"+n:!t&&n?e+"__"+n:void 0:e}}function l(e){var t=e.transformData,n=e.defaultTemplates,r=e.templates,i=e.templatesConfig,o=c(n,r);return v({transformData:t,templatesConfig:i},o)}function c(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=(0,k["default"])([].concat(i((0,P["default"])(e)),i((0,P["default"])(t))));return(0,g["default"])(n,function(n,r){var i=e[r],o=t[r],a=void 0!==o&&o!==i;return n.templates[r]=a?o:i,n.useCustomCompileOptions[r]=a,n},{templates:{},useCustomCompileOptions:{}})}function f(e,t,n,r,i){var o={type:t,attributeName:n,name:r},a=(0,w["default"])(i,{name:n}),s=void 0;if("hierarchical"===t){var u=e.getHierarchicalFacetByName(n),l=r.split(u.separator);o.name=l[l.length-1];for(var c=0;void 0!==a&&c<l.length;++c)a=(0,w["default"])(a.data,{name:l[c]});s=(0,x["default"])(a,"count")}else s=(0,x["default"])(a,'data["'+o.name+'"]');var f=(0,x["default"])(a,"exhaustive");return void 0!==s&&(o.count=s),void 0!==f&&(o.exhaustive=f),o}function p(e,t){var n=[];return(0,_["default"])(t.facetsRefinements,function(r,i){(0,_["default"])(r,function(r){n.push(f(t,"facet",i,r,e.facets))})}),(0,_["default"])(t.facetsExcludes,function(e,t){(0,_["default"])(e,function(e){n.push({type:"exclude",attributeName:t,name:e,exclude:!0})})}),(0,_["default"])(t.disjunctiveFacetsRefinements,function(r,i){(0,_["default"])(r,function(r){n.push(f(t,"disjunctive",i,r,e.disjunctiveFacets))})}),(0,_["default"])(t.hierarchicalFacetsRefinements,function(r,i){(0,_["default"])(r,function(r){n.push(f(t,"hierarchical",i,r,e.hierarchicalFacets))})}),(0,_["default"])(t.numericRefinements,function(e,t){(0,_["default"])(e,function(e,r){(0,_["default"])(e,function(e){n.push({type:"numeric",attributeName:t,name:e+"",numericValue:e,operator:r})})})}),(0,_["default"])(t.tagRefinements,function(e){n.push({type:"tag",attributeName:"_tags",name:e})}),n}function d(e,t){return(0,R["default"])(t)?(e=e.clearTags(),e=e.clearRefinements()):((0,_["default"])(t,function(t){e="_tags"===t?e.clearTags():e.clearRefinements(t)}),e)}function h(e,t){e.setState(d(e.state,t)).search()}function m(e,t){return t?(0,T["default"])(t,function(t,n){return e+n}):void 0}Object.defineProperty(n,"__esModule",{value:!0}),n.prefixKeys=n.clearRefinementsAndSearch=n.clearRefinementsFromState=n.getRefinements=n.isDomElement=n.isSpecialClick=n.prepareTemplateProps=n.bemHelper=n.getContainerNode=void 0;var 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=e("lodash/collection/reduce"),g=r(y),b=e("lodash/collection/forEach"),_=r(b),j=e("lodash/collection/find"),w=r(j),C=e("lodash/object/get"),x=r(C),E=e("lodash/lang/isEmpty"),R=r(E),O=e("lodash/object/keys"),P=r(O),S=e("lodash/array/uniq"),k=r(S),A=e("lodash/object/mapKeys"),T=r(A);n.getContainerNode=o,n.bemHelper=u,n.prepareTemplateProps=l,n.isSpecialClick=s,n.isDomElement=a,n.getRefinements=p,n.clearRefinementsFromState=d,n.clearRefinementsAndSearch=h,n.prefixKeys=m},{"lodash/array/uniq":401,"lodash/collection/find":405,"lodash/collection/forEach":406,"lodash/collection/reduce":409,"lodash/lang/isEmpty":518,"lodash/object/get":531,"lodash/object/keys":532,"lodash/object/mapKeys":534}],352:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]="1.4.0"},{}],353:[function(e,t,n){"use strict";Object.freeze||(Object.freeze=function(e){if(Object(e)!==e)throw new TypeError("Object.freeze can only be called on Objects.");return e})},{}],354:[function(e,t,n){"use strict";var r={};if(!Object.setPrototypeOf&&!r.__proto__){var i=Object.getPrototypeOf;Object.getPrototypeOf=function(e){return e.__proto__?e.__proto__:i.call(Object,e)}}},{}],355:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.templates,r=void 0===n?y["default"]:n,i=e.cssClasses,a=void 0===i?{}:i,s=e.collapsible,c=void 0===s?!1:s,p=e.autoHideContainer,h=void 0===p?!0:p;if(!t)throw new Error(j);var v=(0,l.getContainerNode)(t),g=(0,m["default"])(b["default"]);h===!0&&(g=(0,d["default"])(g));var w={root:(0,f["default"])(_(null),a.root),header:(0,f["default"])(_("header"),a.header),body:(0,f["default"])(_("body"),a.body),footer:(0,f["default"])(_("footer"),a.footer),link:(0,f["default"])(_("link"),a.link)};return{init:function(e){var t=e.helper,n=e.templatesConfig;this._clearRefinementsAndSearch=l.clearRefinementsAndSearch.bind(null,t),this._templateProps=(0,l.prepareTemplateProps)({defaultTemplates:y["default"],templatesConfig:n,templates:r})},render:function(e){var t=e.results,n=e.state,r=e.createURL,i=0!==(0,l.getRefinements)(t,n).length,a=r((0,l.clearRefinementsFromState)(n));u["default"].render(o(g,{clearAll:this._clearRefinementsAndSearch,collapsible:c,cssClasses:w,hasRefinements:i,shouldAutoHideContainer:!i,templateProps:this._templateProps,url:a}),v)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("classnames"),f=r(c),p=e("../../decorators/autoHideContainer.js"),d=r(p),h=e("../../decorators/headerFooter.js"),m=r(h),v=e("./defaultTemplates.js"),y=r(v),g=e("../../components/ClearAll/ClearAll.js"),b=r(g),_=(0,l.bemHelper)("ais-clear-all"),j="Usage:\nclearAll({\n container,\n [ cssClasses.{root,header,body,footer,link}={} ],\n [ templates.{header,link,footer}={header: '', link: 'Clear all', footer: ''} ],\n [ autoHideContainer=true ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/ClearAll/ClearAll.js":328,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":356,classnames:273,react:811,"react-dom":681}],356:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",link:"Clear all",footer:""}},{}],357:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.container,n=e.attributes,r=void 0===n?[]:n,i=e.onlyListedAttributes,o=void 0===i?!1:i,a=e.clearAll,f=void 0===a?"before":a,p=e.templates,m=void 0===p?q["default"]:p,y=e.collapsible,b=void 0===y?!1:y,j=e.transformData,C=e.autoHideContainer,E=void 0===C?!0:C,O=e.cssClasses,S=void 0===O?{}:O,k=(0,x["default"])(r)&&(0,N["default"])(r,function(e,t){return e&&(0,R["default"])(t)&&(0,w["default"])(t.name)&&((0,g["default"])(t.label)||(0,w["default"])(t.label))&&((0,g["default"])(t.template)||(0,w["default"])(t.template)||(0,P["default"])(t.template))&&((0,g["default"])(t.transformData)||(0,P["default"])(t.transformData))},!0),A=["header","item","clearAll","footer"],M=(0,R["default"])(m)&&(0,N["default"])(m,function(e,t,n){return e&&-1!==A.indexOf(n)&&((0,w["default"])(t)||(0,P["default"])(t))},!0),I=["root","header","body","clearAll","list","item","link","count","footer"],D=(0,R["default"])(S)&&(0,N["default"])(S,function(e,t,n){return e&&-1!==I.indexOf(n)&&(0,w["default"])(t)||(0,x["default"])(t)},!0),F=!(((0,w["default"])(t)||(0,h.isDomElement)(t))&&(0,x["default"])(r)&&k&&(0,_["default"])(o)&&-1!==[!1,"before","after"].indexOf(f)&&(0,R["default"])(m)&&M&&((0,g["default"])(j)||(0,P["default"])(j))&&(0,_["default"])(E)&&D);if(F)throw new Error($);var U=(0,h.getContainerNode)(t),B=(0,L["default"])(W["default"]);E===!0&&(B=(0,H["default"])(B));var V=(0,T["default"])(r,function(e){return e.name}),z=o?V:[],Q=(0,N["default"])(r,function(e,t){return e[t.name]=t,e},{});return{init:function(e){var t=e.helper;this._clearRefinementsAndSearch=h.clearRefinementsAndSearch.bind(null,t,z)},render:function(e){var t=e.results,n=e.helper,r=e.state,i=e.templatesConfig,a=e.createURL,p={root:(0,v["default"])(K(null),S.root),header:(0,v["default"])(K("header"),S.header),body:(0,v["default"])(K("body"),S.body),clearAll:(0,v["default"])(K("clear-all"),S.clearAll),list:(0,v["default"])(K("list"),S.list),item:(0,v["default"])(K("item"),S.item),link:(0,v["default"])(K("link"),S.link),count:(0,v["default"])(K("count"),S.count),footer:(0,v["default"])(K("footer"),S.footer)},y=(0,h.prepareTemplateProps)({defaultTemplates:q["default"],templatesConfig:i,templates:m}),g=a((0,h.clearRefinementsFromState)(r,z)),_=s(t,r,V,o),j=_.map(function(e){return a(u(r,e))}),w=_.map(function(e){return l.bind(null,n,e)}),C=0===_.length;d["default"].render(c(B,{attributes:Q,clearAllClick:this._clearRefinementsAndSearch,clearAllPosition:f,clearAllURL:g,clearRefinementClicks:w,
clearRefinementURLs:j,collapsible:b,cssClasses:p,refinements:_,shouldAutoHideContainer:C,templateProps:y}),U)}}}function o(e,t,n){var r=e.indexOf(n);return-1!==r?r:e.length+t.indexOf(n)}function a(e,t,n,r){var i=o(e,t,n.attributeName),a=o(e,t,r.attributeName);return i===a?n.name===r.name?0:n.name<r.name?-1:1:a>i?-1:1}function s(e,t,n,r){var i=(0,h.getRefinements)(e,t),o=(0,N["default"])(i,function(e,t){return-1===n.indexOf(t.attributeName)&&e.indexOf(-1===t.attributeName)&&e.push(t.attributeName),e},[]);return i=i.sort(a.bind(null,n,o)),r&&!(0,k["default"])(n)&&(i=(0,D["default"])(i,function(e){return-1!==n.indexOf(e.attributeName)})),i}function u(e,t){switch(t.type){case"facet":return e.removeFacetRefinement(t.attributeName,t.name);case"disjunctive":return e.removeDisjunctiveFacetRefinement(t.attributeName,t.name);case"hierarchical":return e.clearRefinements(t.attributeName);case"exclude":return e.removeExcludeRefinement(t.attributeName,t.name);case"numeric":return e.removeNumericRefinement(t.attributeName,t.operator,t.numericValue);case"tag":return e.removeTagRefinement(t.name);default:throw new Error("clearRefinement: type "+t.type+"isn't handled")}}function l(e,t){e.setState(u(e.state,t)).search()}Object.defineProperty(n,"__esModule",{value:!0});var c=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),f=e("react"),p=(r(f),e("react-dom")),d=r(p),h=e("../../lib/utils.js"),m=e("classnames"),v=r(m),y=e("lodash/lang/isUndefined"),g=r(y),b=e("lodash/lang/isBoolean"),_=r(b),j=e("lodash/lang/isString"),w=r(j),C=e("lodash/lang/isArray"),x=r(C),E=e("lodash/lang/isPlainObject"),R=r(E),O=e("lodash/lang/isFunction"),P=r(O),S=e("lodash/lang/isEmpty"),k=r(S),A=e("lodash/collection/map"),T=r(A),M=e("lodash/collection/reduce"),N=r(M),I=e("lodash/collection/filter"),D=r(I),F=e("../../decorators/headerFooter.js"),L=r(F),U=e("../../decorators/autoHideContainer"),H=r(U),B=e("./defaultTemplates"),q=r(B),V=e("../../components/CurrentRefinedValues/CurrentRefinedValues.js"),W=r(V),K=(0,h.bemHelper)("ais-current-refined-values"),$="Usage:\ncurrentRefinedValues({\n container,\n [ attributes: [{name[, label, template, transformData]}] ],\n [ onlyListedAttributes = false ],\n [ clearAll = 'before' ] // One of ['before', 'after', false]\n [ templates.{header = '', item, clearAll, footer = ''} ],\n [ transformData ],\n [ autoHideContainer = true ],\n [ cssClasses.{root, header, body, clearAll, list, item, link, count, footer} = {} ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/CurrentRefinedValues/CurrentRefinedValues.js":329,"../../decorators/autoHideContainer":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates":358,classnames:273,"lodash/collection/filter":404,"lodash/collection/map":408,"lodash/collection/reduce":409,"lodash/lang/isArray":516,"lodash/lang/isBoolean":517,"lodash/lang/isEmpty":518,"lodash/lang/isFunction":520,"lodash/lang/isPlainObject":523,"lodash/lang/isString":524,"lodash/lang/isUndefined":526,react:811,"react-dom":681}],358:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:'{{#label}}{{label}}{{^operator}}:{{/operator}} {{/label}}{{#operator}}{{{displayOperator}}} {{/operator}}{{#exclude}}-{{/exclude}}{{name}} <span class="{{cssClasses.count}}">{{count}}</span>',clearAll:"Clear all",footer:""}},{}],359:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:'<a class="{{cssClasses.link}}" href="{{url}}">{{name}} <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>',footer:""}},{}],360:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.attributes,r=e.separator,i=void 0===r?" > ":r,a=e.rootPath,s=void 0===a?null:a,c=e.showParentLevel,p=void 0===c?!0:c,h=e.limit,v=void 0===h?10:h,g=e.sortBy,w=void 0===g?["name:asc"]:g,C=e.cssClasses,x=void 0===C?{}:C,E=e.autoHideContainer,R=void 0===E?!0:E,O=e.templates,P=void 0===O?y["default"]:O,S=e.collapsible,k=void 0===S?!1:S,A=e.transformData;if(!t||!n||!n.length)throw new Error(j);var T=(0,l.getContainerNode)(t),M=(0,m["default"])(b["default"]);R===!0&&(M=(0,d["default"])(M));var N=n[0],I={root:(0,f["default"])(_(null),x.root),header:(0,f["default"])(_("header"),x.header),body:(0,f["default"])(_("body"),x.body),footer:(0,f["default"])(_("footer"),x.footer),list:(0,f["default"])(_("list"),x.list),depth:_("list","lvl"),item:(0,f["default"])(_("item"),x.item),active:(0,f["default"])(_("item","active"),x.active),link:(0,f["default"])(_("link"),x.link),count:(0,f["default"])(_("count"),x.count)};return{getConfiguration:function(e){return{hierarchicalFacets:[{name:N,attributes:n,separator:i,rootPath:s,showParentLevel:p}],maxValuesPerFacet:void 0!==e.maxValuesPerFacet?Math.max(e.maxValuesPerFacet,v):v}},init:function(e){var t=e.helper,n=e.templatesConfig,r=e.createURL;this._toggleRefinement=function(e){return t.toggleRefinement(N,e).search()},this._createURL=function(e,t){return r(e.toggleRefinement(N,t))},this._templateProps=(0,l.prepareTemplateProps)({transformData:A,defaultTemplates:y["default"],templatesConfig:n,templates:P})},_prepareFacetValues:function(e,t){var n=this;return e.slice(0,v).map(function(e){return Array.isArray(e.data)&&(e.data=n._prepareFacetValues(e.data,t)),e.url=n._createURL(t,e),e})},render:function(e){var t=e.results,n=e.state,r=t.getFacetValues(N,{sortBy:w}).data||[];r=this._prepareFacetValues(r,n),u["default"].render(o(M,{attributeNameKey:"path",collapsible:k,cssClasses:I,facetValues:r,shouldAutoHideContainer:0===r.length,templateProps:this._templateProps,toggleRefinement:this._toggleRefinement}),T)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("classnames"),f=r(c),p=e("../../decorators/autoHideContainer.js"),d=r(p),h=e("../../decorators/headerFooter.js"),m=r(h),v=e("./defaultTemplates.js"),y=r(v),g=e("../../components/RefinementList/RefinementList.js"),b=r(g),_=(0,l.bemHelper)("ais-hierarchical-menu"),j="Usage:\nhierarchicalMenu({\n container,\n attributes,\n [ separator=' > ' ],\n [ rootPath ],\n [ showParentLevel=true ],\n [ limit=10 ],\n [ sortBy=['name:asc'] ],\n [ cssClasses.{root , header, body, footer, list, depth, item, active, link}={} ],\n [ templates.{header, item, footer} ],\n [ transformData ],\n [ autoHideContainer=true ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":359,classnames:273,react:811,"react-dom":681}],361:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.options,r=e.cssClasses,i=void 0===r?{}:r,a=e.autoHideContainer,s=void 0===a?!1:a;if(!t||!n)throw new Error(b);var c=(0,l.getContainerNode)(t),p=y["default"];s===!0&&(p=(0,m["default"])(p));var h={root:(0,d["default"])(g(null),i.root),item:(0,d["default"])(g("item"),i.item)};return{init:function(e){var t=e.helper,r=e.state,i=(0,f["default"])(n,function(e){return+r.hitsPerPage===+e.value});i||(void 0===r.hitsPerPage?window.console&&window.console.log("[Warning][hitsPerPageSelector] hitsPerPage not defined. You should probably used a `hits` widget or set the value `hitsPerPage` using the searchParameters attribute of the instantsearch constructor."):window.console&&window.console.log("[Warning][hitsPerPageSelector] No option in `options` with `value: hitsPerPage` (hitsPerPage: "+r.hitsPerPage+")"),n=[{value:void 0,label:""}].concat(n)),this.setHitsPerPage=function(e){return t.setQueryParameter("hitsPerPage",+e).search()}},render:function(e){var t=e.state,r=e.results,i=t.hitsPerPage,a=0===r.nbHits;u["default"].render(o(p,{cssClasses:h,currentValue:i,options:n,setValue:this.setHitsPerPage,shouldAutoHideContainer:a}),c)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("lodash/collection/any"),f=r(c),p=e("classnames"),d=r(p),h=e("../../decorators/autoHideContainer.js"),m=r(h),v=e("../../components/Selector.js"),y=r(v),g=(0,l.bemHelper)("ais-hits-per-page-selector"),b="Usage:\nhitsPerPageSelector({\n container,\n options,\n [ cssClasses.{root,item}={} ],\n [ autoHideContainer=false ]\n})";n["default"]=i},{"../../components/Selector.js":339,"../../decorators/autoHideContainer.js":343,"../../lib/utils.js":351,classnames:273,"lodash/collection/any":403,react:811,"react-dom":681}],362:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={empty:"No results",item:function(e){return JSON.stringify(e,null,2)}}},{}],363:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.templates,a=void 0===i?m["default"]:i,s=e.transformData,c=e.hitsPerPage,p=void 0===c?20:c;if(!t)throw new Error("Must provide a container."+y);if(a.item&&a.allItems)throw new Error("Must contain only allItems OR item template."+y);var h=(0,l.getContainerNode)(t),g={root:(0,f["default"])(v(null),r.root),item:(0,f["default"])(v("item"),r.item),empty:(0,f["default"])(v(null,"empty"),r.empty)};return{getConfiguration:function(){return{hitsPerPage:p}},init:function(e){var t=e.templatesConfig;this._templateProps=(0,l.prepareTemplateProps)({transformData:s,defaultTemplates:m["default"],templatesConfig:t,templates:a})},render:function(e){var t=e.results;u["default"].render(o(d["default"],{cssClasses:g,hits:t.hits,results:t,templateProps:this._templateProps}),h)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("classnames"),f=r(c),p=e("../../components/Hits.js"),d=r(p),h=e("./defaultTemplates.js"),m=r(h),v=(0,l.bemHelper)("ais-hits"),y="\nUsage:\nhits({\n container,\n [ cssClasses.{root,empty,item}={} ],\n [ templates.{empty,item} | templates.{empty, allItems} ],\n [ transformData.{empty=identity,item=identity} | transformData.{empty, allItems} ],\n [ hitsPerPage=20 ]\n})";n["default"]=i},{"../../components/Hits.js":330,"../../lib/utils.js":351,"./defaultTemplates.js":362,classnames:273,react:811,"react-dom":681}],364:[function(e,t,n){arguments[4][359][0].apply(n,arguments)},{dup:359}],365:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.attributeName,r=e.sortBy,i=void 0===r?["count:desc","name:asc"]:r,s=e.limit,u=void 0===s?10:s,f=e.cssClasses,d=void 0===f?{}:f,m=e.templates,y=void 0===m?_["default"]:m,b=e.collapsible,j=void 0===b?!1:b,E=e.transformData,R=e.autoHideContainer,O=void 0===R?!0:R,P=e.showMore,S=void 0===P?!1:P,k=(0,g["default"])(S);if(k&&k.limit<u)throw new Error("showMore.limit configuration should be > than the limit in the main configuration");var A=k&&k.limit||u;if(!t||!n)throw new Error(x);var T=(0,c.getContainerNode)(t),M=(0,v["default"])(w["default"]);O===!0&&(M=(0,h["default"])(M));var N=n,I=k&&(0,c.prefixKeys)("show-more-",k.templates),D=I?a({},y,I):y,F={root:(0,p["default"])(C(null),d.root),header:(0,p["default"])(C("header"),d.header),body:(0,p["default"])(C("body"),d.body),footer:(0,p["default"])(C("footer"),d.footer),list:(0,p["default"])(C("list"),d.list),item:(0,p["default"])(C("item"),d.item),active:(0,p["default"])(C("item","active"),d.active),link:(0,p["default"])(C("link"),d.link),count:(0,p["default"])(C("count"),d.count)};return{getConfiguration:function(e){var t={hierarchicalFacets:[{name:N,attributes:[n]}]},r=e.maxValuesPerFacet||0;return t.maxValuesPerFacet=Math.max(r,A),t},init:function(e){var t=e.templatesConfig,n=e.helper,r=e.createURL;this._templateProps=(0,c.prepareTemplateProps)({transformData:E,defaultTemplates:_["default"],templatesConfig:t,templates:D}),this._createURL=function(e,t){return r(e.toggleRefinement(N,t))},this._toggleRefinement=function(e){return n.toggleRefinement(N,e).search()}},_prepareFacetValues:function(e,t){var n=this;return e.map(function(e){return e.url=n._createURL(t,e),e})},render:function(e){var t=e.results,n=e.state,r=t.getFacetValues(N,{sortBy:i}).data||[];r=this._prepareFacetValues(r,n),l["default"].render(o(M,{collapsible:j,cssClasses:F,facetValues:r,limitMax:A,limitMin:u,shouldAutoHideContainer:0===r.length,showMore:null!==k,templateProps:this._templateProps,toggleRefinement:this._toggleRefinement}),T)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=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},s=e("react"),u=(r(s),e("react-dom")),l=r(u),c=e("../../lib/utils.js"),f=e("classnames"),p=r(f),d=e("../../decorators/autoHideContainer.js"),h=r(d),m=e("../../decorators/headerFooter.js"),v=r(m),y=e("../../lib/show-more/getShowMoreConfig.js"),g=r(y),b=e("./defaultTemplates.js"),_=r(b),j=e("../../components/RefinementList/RefinementList.js"),w=r(j),C=(0,c.bemHelper)("ais-menu"),x="Usage:\nmenu({\n container,\n attributeName,\n [ sortBy=['count:desc', 'name:asc'] ],\n [ limit=10 ],\n [ cssClasses.{root,list,item} ],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer ],\n [ showMore.{templates: {active, inactive}, limit} ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/show-more/getShowMoreConfig.js":349,"../../lib/utils.js":351,"./defaultTemplates.js":364,classnames:273,react:811,"react-dom":681}],366:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:'<label class="{{cssClasses.label}}">\n <input type="radio" class="{{cssClasses.checkbox}}" name="{{attributeName}}" {{#isRefined}}checked{{/isRefined}} />{{name}}\n</label>',footer:""}},{}],367:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.container,n=e.attributeName,r=e.options,i=e.cssClasses,s=void 0===i?{}:i,l=e.templates,c=void 0===l?x["default"]:l,d=e.collapsible,m=void 0===d?!1:d,v=e.transformData,y=e.autoHideContainer,g=void 0===y?!0:y;if(!t||!n||!r)throw new Error(P);var b=(0,p.getContainerNode)(t),j=(0,w["default"])(R["default"]);g===!0&&(j=(0,_["default"])(j));var C={root:(0,h["default"])(O(null),s.root),header:(0,h["default"])(O("header"),s.header),body:(0,h["default"])(O("body"),s.body),footer:(0,h["default"])(O("footer"),s.footer),list:(0,h["default"])(O("list"),s.list),item:(0,h["default"])(O("item"),s.item),label:(0,h["default"])(O("label"),s.label),radio:(0,h["default"])(O("radio"),s.radio),active:(0,h["default"])(O("item","active"),s.active)};return{init:function(e){var t=e.templatesConfig,i=e.helper;this._templateProps=(0,p.prepareTemplateProps)({transformData:v,defaultTemplates:x["default"],templatesConfig:t,templates:c}),this._toggleRefinement=function(e){return i.setState(a(i.state,n,r,e)).search()}},render:function(e){var t=e.results,i=e.state,s=e.createURL,l=r.map(function(e){return e.isRefined=o(i,n,e),e.attributeName=n,e.url=s(a(i,n,r,e.name)),e});f["default"].render(u(j,{collapsible:m,cssClasses:C,facetValues:l,shouldAutoHideContainer:0===t.nbHits,templateProps:this._templateProps,toggleRefinement:this._toggleRefinement}),b)}}}function o(e,t,n){var r=e.getNumericRefinements(t);return void 0!==n.start&&void 0!==n.end&&n.start===n.end?s(r,"=",n.start):void 0!==n.start?s(r,">=",n.start):void 0!==n.end?s(r,"<=",n.end):void 0===n.start&&void 0===n.end?0===Object.keys(r).length:void 0}function a(e,t,n,r){var i=(0,v["default"])(n,{name:r}),a=e.getNumericRefinements(t);if(void 0===i.start&&void 0===i.end)return e.clearRefinements(t);if(o(e,t,i)||(e=e.clearRefinements(t)),void 0!==i.start&&void 0!==i.end){if(i.start>i.end)throw new Error("option.start should be > to option.end");if(i.start===i.end)return e=s(a,"=",i.start)?e.removeNumericRefinement(t,"=",i.start):e.addNumericRefinement(t,"=",i.start)}return void 0!==i.start&&(e=s(a,">=",i.start)?e.removeNumericRefinement(t,">=",i.start):e.addNumericRefinement(t,">=",i.start)),void 0!==i.end&&(e=s(a,"<=",i.end)?e.removeNumericRefinement(t,"<=",i.end):e.addNumericRefinement(t,"<=",i.end)),e}function s(e,t,n){var r=void 0!==e[t],i=(0,g["default"])(e[t],n);return r&&i}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),l=e("react"),c=(r(l),e("react-dom")),f=r(c),p=e("../../lib/utils.js"),d=e("classnames"),h=r(d),m=e("lodash/collection/find"),v=r(m),y=e("lodash/collection/includes"),g=r(y),b=e("../../decorators/autoHideContainer.js"),_=r(b),j=e("../../decorators/headerFooter.js"),w=r(j),C=e("./defaultTemplates.js"),x=r(C),E=e("../../components/RefinementList/RefinementList.js"),R=r(E),O=(0,p.bemHelper)("ais-refinement-list"),P="Usage:\nnumericRefinementList({\n container,\n attributeName,\n options,\n [ cssClasses.{root,header,body,footer,list,item,active,label,checkbox,count} ],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":366,classnames:273,"lodash/collection/find":405,"lodash/collection/includes":407,react:811,"react-dom":681}],368:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.container,n=e.operator,r=void 0===n?"=":n,i=e.attributeName,a=e.options,s=e.cssClasses,c=void 0===s?{}:s,p=e.autoHideContainer,h=void 0===p?!1:p,v=(0,l.getContainerNode)(t),b="Usage: numericSelector({container, attributeName, options[, cssClasses.{root,item}, autoHideContainer]})",_=y["default"];if(h===!0&&(_=(0,m["default"])(_)),!t||!a||0===a.length||!i)throw new Error(b);var j={root:(0,f["default"])(g(null),c.root),item:(0,f["default"])(g("item"),c.item)};return{init:function(e){var t=e.helper,n=this._getRefinedValue(t)||a[0].value;void 0!==n&&t.addNumericRefinement(i,r,n),this._refine=function(e){t.clearRefinements(i),void 0!==e&&t.addNumericRefinement(i,r,e),t.search()}},render:function(e){var t=e.helper,n=e.results;u["default"].render(o(_,{cssClasses:j,currentValue:this._getRefinedValue(t),options:a,setValue:this._refine,shouldAutoHideContainer:0===n.nbHits}),v)},_getRefinedValue:function(e){var t=e.getRefinements(i),n=(0,d["default"])(t,{operator:r});return n&&void 0!==n.value&&void 0!==n.value[0]?n.value[0]:void 0}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("classnames"),f=r(c),p=e("lodash/collection/find"),d=r(p),h=e("../../decorators/autoHideContainer.js"),m=r(h),v=e("../../components/Selector.js"),y=r(v),g=(0,l.bemHelper)("ais-numeric-selector");n["default"]=i},{"../../components/Selector.js":339,"../../decorators/autoHideContainer.js":343,"../../lib/utils.js":351,classnames:273,"lodash/collection/find":405,react:811,"react-dom":681}],369:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.labels,a=void 0===i?{}:i,s=e.maxPages,l=e.padding,f=void 0===l?3:l,h=e.showFirstLast,v=void 0===h?!0:h,j=e.autoHideContainer,w=void 0===j?!0:j,C=e.scrollTo,x=void 0===C?"body":C;if(!t)throw new Error(_);x===!0&&(x="body");var E=(0,d.getContainerNode)(t),R=x!==!1?(0,d.getContainerNode)(x):!1,O=y["default"];w===!0&&(O=(0,m["default"])(O));var P={root:(0,p["default"])(b(null),r.root),item:(0,p["default"])(b("item"),r.item),link:(0,p["default"])(b("link"),r.link),page:(0,p["default"])(b("item","page"),r.page),previous:(0,p["default"])(b("item","previous"),r.previous),next:(0,p["default"])(b("item","next"),r.next),first:(0,p["default"])(b("item","first"),r.first),last:(0,p["default"])(b("item","last"),r.last),active:(0,p["default"])(b("item","active"),r.active),disabled:(0,p["default"])(b("item","disabled"),r.disabled)};return a=(0,c["default"])(a,g),{init:function(e){var t=e.helper;this.setCurrentPage=function(e){t.setCurrentPage(e),R!==!1&&R.scrollIntoView(),t.search()}},getMaxPage:function(e){return void 0!==s?Math.min(s,e.nbPages):e.nbPages},render:function(e){var t=e.results,n=e.state,r=e.createURL;u["default"].render(o(O,{createURL:function(e){return r(n.setPage(e))},cssClasses:P,currentPage:t.page,labels:a,nbHits:t.nbHits,nbPages:this.getMaxPage(t),padding:f,setCurrentPage:this.setCurrentPage,shouldAutoHideContainer:0===t.nbHits,showFirstLast:v}),E)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("lodash/object/defaults"),c=r(l),f=e("classnames"),p=r(f),d=e("../../lib/utils.js"),h=e("../../decorators/autoHideContainer.js"),m=r(h),v=e("../../components/Pagination/Pagination.js"),y=r(v),g={previous:"‹",next:"›",first:"«",last:"»"},b=(0,d.bemHelper)("ais-pagination"),_="Usage:\npagination({\n container,\n [ cssClasses.{root,item,page,previous,next,first,last,active,disabled}={} ],\n [ labels.{previous,next,first,last} ],\n [ maxPages ],\n [ padding=3 ],\n [ showFirstLast=true ],\n [ autoHideContainer=true ],\n [ scrollTo='body' ]\n})";n["default"]=i},{"../../components/Pagination/Pagination.js":331,"../../decorators/autoHideContainer.js":343,"../../lib/utils.js":351,classnames:273,"lodash/object/defaults":529,react:811,"react-dom":681}],370:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:"\n {{#from}}\n {{^to}}\n ≥\n {{/to}}\n {{currency}}{{from}}\n {{/from}}\n {{#to}}\n {{#from}}\n -\n {{/from}}\n {{^from}}\n ≤\n {{/from}}\n {{to}}\n {{/to}}\n ",footer:""}},{}],371:[function(e,t,n){"use strict";function r(e,t){var n=Math.round(e/t)*t;return 1>n&&(n=1),n}function i(e){var t=void 0;t=e.avg<100?1:e.avg<1e3?10:100;for(var n=r(Math.round(e.avg),t),i=Math.ceil(e.min),o=r(Math.floor(e.max),t);o>e.max;)o-=t;var a=void 0,s=void 0,u=[];if(i!==o){for(a=i,u.push({to:a});n>a;)s=u[u.length-1].to,a=r(s+(n-i)/3,t),s>=a&&(a=s+1),u.push({from:s,to:a});for(;o>a;)s=u[u.length-1].to,a=r(s+(o-n)/3,t),s>=a&&(a=s+1),u.push({from:s,to:a});1===u.length&&a!==n&&(u.push({from:a,to:n}),a=n),1===u.length?(u[0].from=e.min,u[0].to=e.max):delete u[u.length-1].to}return u}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=i},{}],372:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.attributeName,r=e.cssClasses,i=void 0===r?{}:r,s=e.templates,u=void 0===s?h["default"]:s,f=e.collapsible,d=void 0===f?!1:f,m=e.labels,y=void 0===m?{}:m,b=e.currency,j=void 0===b?"$":b,E=e.autoHideContainer,R=void 0===E?!0:E;if(!t||!n)throw new Error(x);var O=(0,c.getContainerNode)(t),P=(0,g["default"])(w["default"]);R===!0&&(P=(0,v["default"])(P));var S=a({button:"Go",separator:"to"},y),k={root:(0,_["default"])(C(null),i.root),header:(0,_["default"])(C("header"),i.header),body:(0,_["default"])(C("body"),i.body),list:(0,_["default"])(C("list"),i.list),link:(0,_["default"])(C("link"),i.link),item:(0,_["default"])(C("item"),i.item),active:(0,_["default"])(C("item","active"),i.active),form:(0,_["default"])(C("form"),i.form),label:(0,_["default"])(C("label"),i.label),input:(0,_["default"])(C("input"),i.input),currency:(0,_["default"])(C("currency"),i.currency),button:(0,_["default"])(C("button"),i.button),separator:(0,_["default"])(C("separator"),i.separator),footer:(0,_["default"])(C("footer"),i.footer)};return void 0!==y.currency&&y.currency!==j&&(j=y.currency),{getConfiguration:function(){return{facets:[n]}},_generateRanges:function(e){var t=e.getFacetStats(n);return(0,p["default"])(t)},_extractRefinedRange:function(e){var t=e.getRefinements(n),r=void 0,i=void 0;return 0===t.length?[]:(t.forEach(function(e){-1!==e.operator.indexOf(">")?r=Math.floor(e.value[0]):-1!==e.operator.indexOf("<")&&(i=Math.ceil(e.value[0]))}),[{from:r,to:i,isRefined:!0}])},_refine:function(e,t,r){var i=this._extractRefinedRange(e);e.clearRefinements(n),0!==i.length&&i[0].from===t&&i[0].to===r||("undefined"!=typeof t&&e.addNumericRefinement(n,">=",Math.floor(t)),"undefined"!=typeof r&&e.addNumericRefinement(n,"<=",Math.ceil(r))),e.search()},init:function(e){var t=e.helper,n=e.templatesConfig;this._refine=this._refine.bind(this,t),this._templateProps=(0,c.prepareTemplateProps)({defaultTemplates:h["default"],templatesConfig:n,templates:u})},render:function(e){var t=e.results,r=e.helper,i=e.state,a=e.createURL,s=void 0;t.hits.length>0?(s=this._extractRefinedRange(r),0===s.length&&(s=this._generateRanges(t))):s=[],s.map(function(e){var t=i.clearRefinements(n);return e.isRefined||(void 0!==e.from&&(t=t.addNumericRefinement(n,">=",Math.floor(e.from))),void 0!==e.to&&(t=t.addNumericRefinement(n,"<=",Math.ceil(e.to)))),e.url=a(t),e}),l["default"].render(o(P,{collapsible:d,cssClasses:k,currency:j,facetValues:s,labels:S,refine:this._refine,shouldAutoHideContainer:0===s.length,templateProps:this._templateProps}),O)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=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},s=e("react"),u=(r(s),e("react-dom")),l=r(u),c=e("../../lib/utils.js"),f=e("./generate-ranges.js"),p=r(f),d=e("./defaultTemplates.js"),h=r(d),m=e("../../decorators/autoHideContainer.js"),v=r(m),y=e("../../decorators/headerFooter.js"),g=r(y),b=e("classnames"),_=r(b),j=e("../../components/PriceRanges/PriceRanges.js"),w=r(j),C=(0,c.bemHelper)("ais-price-ranges"),x="Usage:\npriceRanges({\n container,\n attributeName,\n [ currency=$ ],\n [ cssClasses.{root,header,body,list,item,active,link,form,label,input,currency,separator,button,footer} ],\n [ templates.{header,item,footer} ],\n [ labels.{currency,separator,button} ],\n [ autoHideContainer=true ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/PriceRanges/PriceRanges.js":335,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":370,"./generate-ranges.js":371,classnames:273,react:811,"react-dom":681}],373:[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(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.attributeName,r=e.tooltips,o=void 0===r?!0:r,s=e.templates,u=void 0===s?w:s,f=e.collapsible,d=void 0===f?!1:f,m=e.cssClasses,y=void 0===m?{}:m,b=e.step,x=void 0===b?1:b,E=e.pips,R=void 0===E?!0:E,O=e.autoHideContainer,P=void 0===O?!0:O,S=e.min,k=e.max;if(!t||!n)throw new Error(C);var A=(0,c.getContainerNode)(t),T=(0,v["default"])(_["default"]);P===!0&&(T=(0,h["default"])(T));var M={root:(0,g["default"])(j(null),y.root),header:(0,g["default"])(j("header"),y.header),body:(0,g["default"])(j("body"),y.body),footer:(0,g["default"])(j("footer"),y.footer)};return{getConfiguration:function(e){var t={disjunctiveFacets:[n]};return void 0===S&&void 0===k||e&&(!e.numericRefinements||void 0!==e.numericRefinements[n])||(t.numericRefinements=i({},n,{}),void 0!==S&&(t.numericRefinements[n][">="]=[S]),void 0!==k&&(t.numericRefinements[n]["<="]=[k])),t},_getCurrentRefinement:function(e){var t=e.state.getNumericRefinement(n,">="),r=e.state.getNumericRefinement(n,"<=");
return t=t&&t.length?t[0]:-(1/0),r=r&&r.length?r[0]:1/0,{min:t,max:r}},_refine:function(e,t,r){e.clearRefinements(n),r[0]>t.min&&e.addNumericRefinement(n,">=",Math.round(r[0])),r[1]<t.max&&e.addNumericRefinement(n,"<=",Math.round(r[1])),e.search()},init:function(e){var t=e.templatesConfig;this._templateProps=(0,c.prepareTemplateProps)({defaultTemplates:w,templatesConfig:t,templates:u})},render:function(e){var t=e.results,r=e.helper,i=(0,p["default"])(t.disjunctiveFacets,{name:n}),s=void 0;void 0!==S||void 0!==k?(s={},void 0!==S&&(s.min=S),void 0!==k&&(s.max=k)):s=void 0!==i&&void 0!==i.stats?i.stats:{min:null,max:null};var u=this._getCurrentRefinement(r);void 0!==o.format&&(o=[{to:o.format},{to:o.format}]),l["default"].render(a(T,{collapsible:d,cssClasses:M,onChange:this._refine.bind(this,r,s),pips:R,range:{min:Math.floor(s.min),max:Math.ceil(s.max)},shouldAutoHideContainer:s.min===s.max,start:[u.min,u.max],step:x,templateProps:this._templateProps,tooltips:o}),A)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),s=e("react"),u=(r(s),e("react-dom")),l=r(u),c=e("../../lib/utils.js"),f=e("lodash/collection/find"),p=r(f),d=e("../../decorators/autoHideContainer.js"),h=r(d),m=e("../../decorators/headerFooter.js"),v=r(m),y=e("classnames"),g=r(y),b=e("../../components/Slider/Slider.js"),_=r(b),j=(0,c.bemHelper)("ais-range-slider"),w={header:"",footer:""},C="Usage:\nrangeSlider({\n container,\n attributeName,\n [ tooltips=true ],\n [ templates.{header, footer} ],\n [ cssClasses.{root, header, body, footer} ],\n [ step=1 ],\n [ pips=true ],\n [ autoHideContainer=true ],\n [ collapsible=false ],\n [ min ],\n [ max ]\n});\n";n["default"]=o},{"../../components/Slider/Slider.js":340,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,classnames:273,"lodash/collection/find":405,react:811,"react-dom":681}],374:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:'<label class="{{cssClasses.label}}">\n <input type="checkbox" class="{{cssClasses.checkbox}}" value="{{name}}" {{#isRefined}}checked{{/isRefined}} />{{name}}\n <span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>\n</label>',footer:""}},{}],375:[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){var t=e.container,n=e.attributeName,r=e.operator,o=void 0===r?"or":r,u=e.sortBy,l=void 0===u?["count:desc","name:asc"]:u,p=e.limit,h=void 0===p?10:p,v=e.cssClasses,g=void 0===v?{}:v,_=e.templates,w=void 0===_?j["default"]:_,R=e.collapsible,O=void 0===R?!1:R,P=e.transformData,S=e.autoHideContainer,k=void 0===S?!0:S,A=e.showMore,T=void 0===A?!1:A,M=(0,b["default"])(T);if(M&&M.limit<h)throw new Error("showMore.limit configuration should be > than the limit in the main configuration");var N=M&&M.limit||h,I=C["default"];if(!t||!n)throw new Error(E);I=(0,y["default"])(I),k===!0&&(I=(0,m["default"])(I));var D=(0,f.getContainerNode)(t);if(o&&(o=o.toLowerCase(),"and"!==o&&"or"!==o))throw new Error(E);var F=M&&(0,f.prefixKeys)("show-more-",M.templates),L=F?s({},w,F):w,U={root:(0,d["default"])(x(null),g.root),header:(0,d["default"])(x("header"),g.header),body:(0,d["default"])(x("body"),g.body),footer:(0,d["default"])(x("footer"),g.footer),list:(0,d["default"])(x("list"),g.list),item:(0,d["default"])(x("item"),g.item),active:(0,d["default"])(x("item","active"),g.active),label:(0,d["default"])(x("label"),g.label),checkbox:(0,d["default"])(x("checkbox"),g.checkbox),count:(0,d["default"])(x("count"),g.count)};return{getConfiguration:function(e){var t=i({},"and"===o?"facets":"disjunctiveFacets",[n]),r=e.maxValuesPerFacet||0;return t.maxValuesPerFacet=Math.max(r,N),t},init:function(e){var t=e.templatesConfig,r=e.helper,i=e.createURL;this._templateProps=(0,f.prepareTemplateProps)({transformData:P,defaultTemplates:j["default"],templatesConfig:t,templates:L}),this._createURL=function(e,t){return i(e.toggleRefinement(n,t))},this.toggleRefinement=function(e){return r.toggleRefinement(n,e).search()}},render:function(e){var t=this,r=e.results,i=e.state,o=r.getFacetValues(n,{sortBy:l}).map(function(e){return e.url=t._createURL(i,e),e});c["default"].render(a(I,{collapsible:O,cssClasses:U,facetValues:o,limitMax:N,limitMin:h,shouldAutoHideContainer:0===o.length,showMore:null!==M,templateProps:this._templateProps,toggleRefinement:this.toggleRefinement}),D)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),s=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=e("react"),l=(r(u),e("react-dom")),c=r(l),f=e("../../lib/utils.js"),p=e("classnames"),d=r(p),h=e("../../decorators/autoHideContainer.js"),m=r(h),v=e("../../decorators/headerFooter.js"),y=r(v),g=e("../../lib/show-more/getShowMoreConfig.js"),b=r(g),_=e("./defaultTemplates.js"),j=r(_),w=e("../../components/RefinementList/RefinementList.js"),C=r(w),x=(0,f.bemHelper)("ais-refinement-list"),E="Usage:\nrefinementList({\n container,\n attributeName,\n [ operator='or' ],\n [ sortBy=['count:desc', 'name:asc'] ],\n [ limit=10 ],\n [ cssClasses.{root, header, body, footer, list, item, active, label, checkbox, count}],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer=true ],\n [ collapsible=false ],\n [ showMore.{templates: {active, inactive}, limit} ],\n [ collapsible=false ]\n})";n["default"]=o},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/show-more/getShowMoreConfig.js":349,"../../lib/utils.js":351,"./defaultTemplates.js":374,classnames:273,react:811,"react-dom":681}],376:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.container,n=e.placeholder,r=void 0===n?"":n,i=e.cssClasses,a=void 0===i?{}:i,c=e.poweredBy,f=void 0===c?!1:c,h=e.wrapInput,v=void 0===h?!0:h,g=e.autofocus,x=void 0===g?"auto":g,E=e.searchOnEnterKeyPressOnly,R=void 0===E?!1:E,O=e.queryHook,P=window.addEventListener?"input":"propertychange";if(!t)throw new Error(C);return t=(0,d.getContainerNode)(t),"boolean"!=typeof x&&(x="auto"),{getInput:function(){return"INPUT"===t.tagName?t:document.createElement("input")},wrapInput:function(e){var t=document.createElement("div"),n=(0,y["default"])(_(null),a.root).split(" ");return t.classList.add.apply(t.classList,n),t.appendChild(e),t},addDefaultAttributesToInput:function(e,t){var n={autocapitalize:"off",autocomplete:"off",autocorrect:"off",placeholder:r,role:"textbox",spellcheck:"false",type:"text",value:t};(0,m["default"])(n,function(t,n){e.hasAttribute(n)||e.setAttribute(n,t)});var i=(0,y["default"])(_("input"),a.input).split(" ");e.classList.add.apply(e.classList,i)},addPoweredBy:function(e){var t=document.createElement("div");e.parentNode.insertBefore(t,e.nextSibling);var n={root:(0,y["default"])(_("powered-by"),a.poweredBy),link:_("powered-by-link")},r="https://www.algolia.com/?utm_source=instantsearch.js&utm_medium=website&"+("utm_content="+location.hostname+"&")+"utm_campaign=poweredby";p["default"].render(l(b["default"],{cssClasses:n,link:r}),t)},init:function(e){function n(e){return O?void O(e,r):void r(e)}function r(e){a.setQuery(e),a.search()}var i=e.state,a=e.helper,l=e.onHistoryChange,c="INPUT"===t.tagName,p=this._input=this.getInput();if(this.addDefaultAttributesToInput(p,i.query),R?o(p,"keyup",s(j,u(n))):(o(p,P,u(n)),("propertychange"===P||window.attachEvent)&&o(p,"keyup",s(w,u(n)))),c){var d=document.createElement("div");p.parentNode.insertBefore(d,p);var h=p.parentNode,m=v?this.wrapInput(p):p;h.replaceChild(m,d)}else{var y=v?this.wrapInput(p):p;t.appendChild(y)}f&&this.addPoweredBy(p),l(function(e){p.value=e.query||""}),(x===!0||"auto"===x&&""===a.state.query)&&p.focus()},render:function(e){var t=e.helper;t.state.query!==this._input.value&&(this._input.value=t.state.query)}}}function o(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n)}function a(e){return(e.currentTarget?e.currentTarget:e.srcElement).value}function s(e,t){return function(n){return n.keyCode===e&&t(n)}}function u(e){return function(t){return e(a(t))}}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),c=e("react"),f=(r(c),e("react-dom")),p=r(f),d=e("../../lib/utils.js"),h=e("lodash/collection/forEach"),m=r(h),v=e("classnames"),y=r(v),g=e("../../components/PoweredBy/PoweredBy.js"),b=r(g),_=(0,d.bemHelper)("ais-search-box"),j=13,w=8,C="Usage:\nsearchBox({\n container,\n [ placeholder ],\n [ cssClasses.{input,poweredBy} ],\n [ poweredBy ],\n [ wrapInput ],\n [ autofocus ],\n [ searchOnEnterKeyPressOnly ],\n [ queryHook ]\n})";n["default"]=i},{"../../components/PoweredBy/PoweredBy.js":334,"../../lib/utils.js":351,classnames:273,"lodash/collection/forEach":406,react:811,"react-dom":681}],377:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.indices,r=e.cssClasses,i=void 0===r?{}:r,a=e.autoHideContainer,s=void 0===a?!1:a;if(!t||!n)throw new Error(j);var l=(0,d.getContainerNode)(t),f=b["default"];s===!0&&(f=(0,y["default"])(f));var h=(0,p["default"])(n,function(e){return{label:e.label,value:e.name}}),v={root:(0,m["default"])(_(null),i.root),item:(0,m["default"])(_("item"),i.item)};return{init:function(e){var t=e.helper,r=t.getIndex(),i=-1!==(0,c["default"])(n,{name:r});if(!i)throw new Error("[sortBySelector]: Index "+r+" not present in `indices`");this.setIndex=function(e){return t.setIndex(e).search()}},render:function(e){var t=e.helper,n=e.results;u["default"].render(o(f,{cssClasses:v,currentValue:t.getIndex(),options:h,setValue:this.setIndex,shouldAutoHideContainer:0===n.nbHits}),l)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("lodash/array/findIndex"),c=r(l),f=e("lodash/collection/map"),p=r(f),d=e("../../lib/utils.js"),h=e("classnames"),m=r(h),v=e("../../decorators/autoHideContainer.js"),y=r(v),g=e("../../components/Selector.js"),b=r(g),_=(0,d.bemHelper)("ais-sort-by-selector"),j="Usage:\nsortBySelector({\n container,\n indices,\n [cssClasses.{root,item}={}],\n [autoHideContainer=false]\n})";n["default"]=i},{"../../components/Selector.js":339,"../../decorators/autoHideContainer.js":343,"../../lib/utils.js":351,classnames:273,"lodash/array/findIndex":398,"lodash/collection/map":408,react:811,"react-dom":681}],378:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={andUp:"& Up"}},{}],379:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",item:'<a class="{{cssClasses.link}}{{^count}} {{cssClasses.disabledLink}}{{/count}}" {{#count}}href="{{href}}"{{/count}}>\n {{#stars}}<span class="{{#.}}{{cssClasses.star}}{{/.}}{{^.}}{{cssClasses.emptyStar}}{{/.}}"></span>{{/stars}}\n {{labels.andUp}}\n {{#count}}<span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>{{/count}}\n</a>',footer:""}},{}],380:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.container,n=e.attributeName,r=e.max,i=void 0===r?5:r,a=e.cssClasses,s=void 0===a?{}:a,c=e.labels,p=void 0===c?b["default"]:c,h=e.templates,v=void 0===h?y["default"]:h,g=e.collapsible,_=void 0===g?!1:g,x=e.transformData,E=e.autoHideContainer,R=void 0===E?!0:E,O=(0,l.getContainerNode)(t),P=(0,m["default"])(j["default"]);if(R===!0&&(P=(0,d["default"])(P)),!t||!n)throw new Error(C);var S={root:(0,f["default"])(w(null),s.root),header:(0,f["default"])(w("header"),s.header),body:(0,f["default"])(w("body"),s.body),footer:(0,f["default"])(w("footer"),s.footer),list:(0,f["default"])(w("list"),s.list),item:(0,f["default"])(w("item"),s.item),link:(0,f["default"])(w("link"),s.link),disabledLink:(0,f["default"])(w("link","disabled"),s.disabledLink),count:(0,f["default"])(w("count"),s.count),star:(0,f["default"])(w("star"),s.star),emptyStar:(0,f["default"])(w("star","empty"),s.emptyStar),active:(0,f["default"])(w("item","active"),s.active)};return{getConfiguration:function(){return{disjunctiveFacets:[n]}},init:function(e){var t=e.templatesConfig,n=e.helper;this._templateProps=(0,l.prepareTemplateProps)({transformData:x,defaultTemplates:y["default"],templatesConfig:t,templates:v}),this._toggleRefinement=this._toggleRefinement.bind(this,n)},render:function(e){for(var t=e.helper,r=e.results,a=e.state,s=e.createURL,l=[],c={},f=i-1;f>=0;--f)c[f]=0;r.getFacetValues(n).forEach(function(e){var t=Math.round(e.name);if(t&&!(t>i-1))for(var n=t;n>=1;--n)c[n]+=e.count});for(var d=this._getRefinedStar(t),h=i-1;h>=1;--h){var m=c[h];if(!d||h===d||0!==m){for(var v=[],y=1;i>=y;++y)v.push(h>=y);l.push({stars:v,name:""+h,count:m,isRefined:d===h,url:s(a.toggleRefinement(n,v)),labels:p})}}u["default"].render(o(P,{collapsible:_,cssClasses:S,facetValues:l,shouldAutoHideContainer:0===r.nbHits,templateProps:this._templateProps,toggleRefinement:this._toggleRefinement}),O)},_toggleRefinement:function(e,t){var r=this._getRefinedStar(e)===+t;if(e.clearRefinements(n),!r)for(var o=+t;i>=o;++o)e.addDisjunctiveFacetRefinement(n,o);e.search()},_getRefinedStar:function(e){var t=void 0,r=e.getRefinements(n);return r.forEach(function(e){(!t||+e.value<t)&&(t=+e.value)}),t}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("classnames"),f=r(c),p=e("../../decorators/autoHideContainer.js"),d=r(p),h=e("../../decorators/headerFooter.js"),m=r(h),v=e("./defaultTemplates.js"),y=r(v),g=e("./defaultLabels.js"),b=r(g),_=e("../../components/RefinementList/RefinementList.js"),j=r(_),w=(0,l.bemHelper)("ais-star-rating"),C="Usage:\nstarRating({\n container,\n attributeName,\n [ max=5 ],\n [ cssClasses.{root,header,body,footer,list,item,active,link,disabledLink,star,emptyStar,count} ],\n [ templates.{header,item,footer} ],\n [ labels.{andUp} ],\n [ transformData ],\n [ autoHideContainer=true ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultLabels.js":378,"./defaultTemplates.js":379,classnames:273,react:811,"react-dom":681}],381:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={header:"",body:'{{#hasNoResults}}No results{{/hasNoResults}}\n {{#hasOneResult}}1 result{{/hasOneResult}}\n {{#hasManyResults}}{{#helpers.formatNumber}}{{nbHits}}{{/helpers.formatNumber}} results{{/hasManyResults}}\n <span class="{{cssClasses.time}}">found in {{processingTimeMS}}ms</span>',footer:""}},{}],382:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.cssClasses,r=void 0===n?{}:n,i=e.autoHideContainer,a=void 0===i?!0:i,s=e.templates,c=void 0===s?b["default"]:s,p=e.collapsible,h=void 0===p?!1:p,v=e.transformData;if(!t)throw new Error(j);var g=(0,l.getContainerNode)(t),w=(0,d["default"])(m["default"]);if(a===!0&&(w=(0,f["default"])(w)),!g)throw new Error(j);var C={body:(0,y["default"])(_("body"),r.body),footer:(0,y["default"])(_("footer"),r.footer),header:(0,y["default"])(_("header"),r.header),root:(0,y["default"])(_(null),r.root),time:(0,y["default"])(_("time"),r.time)};return{init:function(e){var t=e.templatesConfig;this._templateProps=(0,l.prepareTemplateProps)({transformData:v,defaultTemplates:b["default"],templatesConfig:t,templates:c})},render:function(e){var t=e.results;u["default"].render(o(w,{collapsible:h,cssClasses:C,hitsPerPage:t.hitsPerPage,nbHits:t.nbHits,nbPages:t.nbPages,page:t.page,processingTimeMS:t.processingTimeMS,query:t.query,shouldAutoHideContainer:0===t.nbHits,templateProps:this._templateProps}),g)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("react"),s=(r(a),e("react-dom")),u=r(s),l=e("../../lib/utils.js"),c=e("../../decorators/autoHideContainer.js"),f=r(c),p=e("../../decorators/headerFooter.js"),d=r(p),h=e("../../components/Stats/Stats.js"),m=r(h),v=e("classnames"),y=r(v),g=e("./defaultTemplates.js"),b=r(g),_=(0,l.bemHelper)("ais-stats"),j="Usage:\nstats({\n container,\n [ template ],\n [ transformData ],\n [ autoHideContainer]\n})";n["default"]=i},{"../../components/Stats/Stats.js":341,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":381,classnames:273,react:811,"react-dom":681}],383:[function(e,t,n){arguments[4][374][0].apply(n,arguments)},{dup:374}],384:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.container,n=e.attributeName,r=e.label,i=e.values,a=void 0===i?{on:!0,off:void 0}:i,u=e.templates,l=void 0===u?b["default"]:u,p=e.collapsible,h=void 0===p?!1:p,v=e.cssClasses,g=void 0===v?{}:v,_=e.transformData,x=e.autoHideContainer,E=void 0===x?!0:x,R=(0,f.getContainerNode)(t),O=(0,y["default"])(j["default"]);if(E===!0&&(O=(0,m["default"])(O)),!t||!n||!r)throw new Error(C);var P=void 0!==a.off,S={root:(0,d["default"])(w(null),g.root),header:(0,d["default"])(w("header"),g.header),body:(0,d["default"])(w("body"),g.body),footer:(0,d["default"])(w("footer"),g.footer),list:(0,d["default"])(w("list"),g.list),item:(0,d["default"])(w("item"),g.item),active:(0,d["default"])(w("item","active"),g.active),label:(0,d["default"])(w("label"),g.label),checkbox:(0,d["default"])(w("checkbox"),g.checkbox),count:(0,d["default"])(w("count"),g.count)};return{getConfiguration:function(){return{facets:[n]}},init:function(e){var t=e.state,r=e.helper,i=e.templatesConfig;if(this._templateProps=(0,f.prepareTemplateProps)({transformData:_,defaultTemplates:b["default"],templatesConfig:i,templates:l}),this.toggleRefinement=this.toggleRefinement.bind(this,r),void 0!==a.off){var o=t.isFacetRefined(n,a.on);o||r.addFacetRefinement(n,a.off)}},toggleRefinement:function(e,t,r){var i=a.on,o=a.off;r?(e.removeFacetRefinement(n,i),P&&e.addFacetRefinement(n,o)):(P&&e.removeFacetRefinement(n,o),e.addFacetRefinement(n,i)),e.search()},render:function(e){var t=e.helper,i=e.results,u=e.state,l=e.createURL,f=t.state.isFacetRefined(n,a.on),p=(0,s["default"])(i.getFacetValues(n),{name:f.toString()}),d={name:r,isRefined:f,count:p&&p.count||null,url:l(u.toggleRefinement(n,f))};c["default"].render(o(O,{collapsible:h,cssClasses:S,facetValues:[d],shouldAutoHideContainer:0===i.nbHits,templateProps:this._templateProps,toggleRefinement:this.toggleRefinement}),R)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){var e="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103;return function(t,n,r,i){var o=t&&t.defaultProps,a=arguments.length-3;if(n||0===a||(n={}),n&&o)for(var s in o)void 0===n[s]&&(n[s]=o[s]);else n||(n=o||{});if(1===a)n.children=i;else if(a>1){for(var u=Array(a),l=0;a>l;l++)u[l]=arguments[l+3];n.children=u}return{$$typeof:e,type:t,key:void 0===r?null:""+r,ref:null,props:n,_owner:null}}}(),a=e("lodash/collection/find"),s=r(a),u=e("react"),l=(r(u),e("react-dom")),c=r(l),f=e("../../lib/utils.js"),p=e("classnames"),d=r(p),h=e("../../decorators/autoHideContainer.js"),m=r(h),v=e("../../decorators/headerFooter.js"),y=r(v),g=e("./defaultTemplates.js"),b=r(g),_=e("../../components/RefinementList/RefinementList.js"),j=r(_),w=(0,f.bemHelper)("ais-toggle"),C="Usage:\ntoggle({\n container,\n attributeName,\n label,\n [ userValues={on: true, off: undefined} ],\n [ cssClasses.{root,header,body,footer,list,item,active,label,checkbox,count} ],\n [ templates.{header,item,footer} ],\n [ transformData ],\n [ autoHideContainer=true ],\n [ collapsible=false ]\n})";n["default"]=i},{"../../components/RefinementList/RefinementList.js":337,"../../decorators/autoHideContainer.js":343,"../../decorators/headerFooter.js":344,"../../lib/utils.js":351,"./defaultTemplates.js":383,classnames:273,"lodash/collection/find":405,react:811,"react-dom":681}],385:[function(e,t,n){arguments[4][247][0].apply(n,arguments)},{"./IndexBrowser":386,"./buildSearchMethod.js":391,"./errors":392,debug:274,dup:247,"lodash/collection/forEach":406,"lodash/collection/map":408,"lodash/lang/clone":513,"lodash/lang/isArray":516,"lodash/object/merge":536}],386:[function(e,t,n){arguments[4][248][0].apply(n,arguments)},{dup:248,events:278,inherits:326}],387:[function(e,t,n){(function(n){"use strict";function r(t,n,o){var a=e("lodash/lang/cloneDeep"),s=e("../get-document-protocol");return o=a(o||{}),void 0===o.protocol&&(o.protocol=s()),o._ua=o._ua||r.ua,new i(t,n,o)}function i(){s.apply(this,arguments)}t.exports=r;var o=e("inherits"),a=window.Promise||e("es6-promise").Promise,s=e("../../AlgoliaSearch"),u=e("../../errors"),l=e("../inline-headers"),c=e("../jsonp-request"),f=e("../../places.js");"development"===n.env.APP_ENV&&e("debug").enable("algoliasearch*"),r.version=e("../../version.js"),r.ua="Algolia for vanilla JavaScript "+r.version,r.initPlaces=f(r),window.__algolia={debug:e("debug"),algoliasearch:r};var p={hasXMLHttpRequest:"XMLHttpRequest"in window,hasXDomainRequest:"XDomainRequest"in window,cors:"withCredentials"in new XMLHttpRequest,timeout:"timeout"in new XMLHttpRequest};o(i,s),i.prototype._request=function(e,t){return new a(function(n,r){function i(){if(!c){p.timeout||clearTimeout(s);var e;try{e={body:JSON.parse(d.responseText),responseText:d.responseText,statusCode:d.status,headers:d.getAllResponseHeaders&&d.getAllResponseHeaders()||{}}}catch(t){e=new u.UnparsableJSON({more:d.responseText})}e instanceof u.UnparsableJSON?r(e):n(e)}}function o(e){c||(p.timeout||clearTimeout(s),r(new u.Network({more:e})))}function a(){p.timeout||(c=!0,d.abort()),r(new u.RequestTimeout)}if(!p.cors&&!p.hasXDomainRequest)return void r(new u.Network("CORS not supported"));e=l(e,t.headers);var s,c,f=t.body,d=p.cors?new XMLHttpRequest:new XDomainRequest;d instanceof XMLHttpRequest?d.open(t.method,e,!0):d.open(t.method,e),p.cors&&(f&&("POST"===t.method?d.setRequestHeader("content-type","application/x-www-form-urlencoded"):d.setRequestHeader("content-type","application/json")),d.setRequestHeader("accept","application/json")),d.onprogress=function(){},d.onload=i,d.onerror=o,p.timeout?(d.timeout=t.timeout,d.ontimeout=a):s=setTimeout(a,t.timeout),d.send(f)})},i.prototype._request.fallback=function(e,t){return e=l(e,t.headers),new a(function(n,r){c(e,t,function(e,t){return e?void r(e):void n(t)})})},i.prototype._promise={reject:function(e){return a.reject(e)},resolve:function(e){return a.resolve(e)},delay:function(e){return new a(function(t){setTimeout(t,e)})}}}).call(this,e("_process"))},{"../../AlgoliaSearch":385,"../../errors":392,"../../places.js":393,"../../version.js":394,"../get-document-protocol":388,"../inline-headers":389,"../jsonp-request":390,_process:673,debug:274,"es6-promise":277,inherits:326,"lodash/lang/cloneDeep":514}],388:[function(e,t,n){arguments[4][250][0].apply(n,arguments)},{dup:250}],389:[function(e,t,n){arguments[4][251][0].apply(n,arguments)},{dup:251,querystring:680}],390:[function(e,t,n){arguments[4][252][0].apply(n,arguments)},{"../errors":392,dup:252}],391:[function(e,t,n){arguments[4][253][0].apply(n,arguments)},{"./errors.js":392,dup:253}],392:[function(e,t,n){arguments[4][254][0].apply(n,arguments)},{dup:254,inherits:326,"lodash/collection/forEach":406}],393:[function(e,t,n){arguments[4][255][0].apply(n,arguments)},{"./buildSearchMethod.js":391,dup:255,"lodash/lang/cloneDeep":514}],394:[function(e,t,n){arguments[4][256][0].apply(n,arguments)},{dup:256}],395:[function(e,t,n){arguments[4][323][0].apply(n,arguments)},{dup:323}],396:[function(e,t,n){arguments[4][324][0].apply(n,arguments)},{"./compiler":395,"./template":397,dup:324}],397:[function(e,t,n){arguments[4][325][0].apply(n,arguments)},{dup:325}],398:[function(e,t,n){arguments[4][5][0].apply(n,arguments)},{"../internal/createFindIndex":474,dup:5}],399:[function(e,t,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],400:[function(e,t,n){var r=e("../internal/baseFlatten"),i=e("../internal/baseUniq"),o=e("../function/restParam"),a=o(function(e){return i(r(e,!1,!0))});t.exports=a},{"../function/restParam":413,"../internal/baseFlatten":435,"../internal/baseUniq":457}],401:[function(e,t,n){function r(e,t,n,r){var u=e?e.length:0;return u?(null!=t&&"boolean"!=typeof t&&(r=n,n=a(e,t,r)?void 0:t,t=!1),n=null==n?n:i(n,r,3),t?s(e,n):o(e,n)):[]}var i=e("../internal/baseCallback"),o=e("../internal/baseUniq"),a=e("../internal/isIterateeCall"),s=e("../internal/sortedUniq");t.exports=r},{"../internal/baseCallback":427,"../internal/baseUniq":457,"../internal/isIterateeCall":495,"../internal/sortedUniq":509}],402:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{"../internal/LazyWrapper":414,"../internal/LodashWrapper":415,"../internal/baseLodash":444,"../internal/isObjectLike":499,"../internal/wrapperClone":512,"../lang/isArray":516,dup:9}],403:[function(e,t,n){t.exports=e("./some")},{"./some":410}],404:[function(e,t,n){arguments[4][10][0].apply(n,arguments)},{"../internal/arrayFilter":419,"../internal/baseCallback":427,"../internal/baseFilter":432,"../lang/isArray":516,dup:10}],405:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{"../internal/baseEach":431,"../internal/createFind":473,dup:11}],406:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"../internal/arrayEach":418,"../internal/baseEach":431,"../internal/createForEach":475,dup:12}],407:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{"../internal/baseIndexOf":440,"../internal/getLength":486,"../internal/isIterateeCall":495,"../internal/isLength":498,"../lang/isArray":516,"../lang/isString":524,"../object/values":538,dup:13}],408:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{"../internal/arrayMap":420,"../internal/baseCallback":427,"../internal/baseMap":445,"../lang/isArray":516,dup:14}],409:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"../internal/arrayReduce":422,"../internal/baseEach":431,"../internal/createReduce":479,dup:16}],410:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return n&&u(e,t,n)&&(t=void 0),"function"==typeof t&&void 0===n||(t=o(t,n,3)),r(e,t)}var i=e("../internal/arraySome"),o=e("../internal/baseCallback"),a=e("../internal/baseSome"),s=e("../lang/isArray"),u=e("../internal/isIterateeCall");t.exports=r},{"../internal/arraySome":423,"../internal/baseCallback":427,"../internal/baseSome":455,"../internal/isIterateeCall":495,"../lang/isArray":516}],411:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../internal/getNative":488,dup:19}],412:[function(e,t,n){var r=e("../internal/createCurry"),i=8,o=r(i);o.placeholder={},t.exports=o},{"../internal/createCurry":471}],413:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],414:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"./baseCreate":430,"./baseLodash":444,dup:24}],415:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{"./baseCreate":430,"./baseLodash":444,dup:25}],416:[function(e,t,n){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=e("./cachePush"),o=e("./getNative"),a=o(n,"Set"),s=o(Object,"create");r.prototype.push=i,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cachePush":462,"./getNative":488}],417:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{dup:27}],418:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],419:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{dup:29}],420:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],421:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],422:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],423:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{dup:33}],424:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],425:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../object/keys":532,dup:36}],426:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../object/keys":532,"./baseCopy":429,dup:37}],427:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"../utility/identity":539,"../utility/property":541,"./baseMatches":446,"./baseMatchesProperty":447,"./bindCallback":459,dup:38}],428:[function(e,t,n){arguments[4][187][0].apply(n,arguments)},{"../lang/isArray":516,"../lang/isObject":522,"./arrayCopy":417,"./arrayEach":418,"./baseAssign":426,"./baseForOwn":438,"./initCloneArray":490,"./initCloneByTag":491,"./initCloneObject":492,dup:187}],429:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{dup:40}],430:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../lang/isObject":522,dup:41}],431:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"./baseForOwn":438,"./createBaseEach":466,dup:43}],432:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"./baseEach":431,
dup:44}],433:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],434:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],435:[function(e,t,n){arguments[4][47][0].apply(n,arguments)},{"../lang/isArguments":515,"../lang/isArray":516,"./arrayPush":421,"./isArrayLike":493,"./isObjectLike":499,dup:47}],436:[function(e,t,n){arguments[4][48][0].apply(n,arguments)},{"./createBaseFor":467,dup:48}],437:[function(e,t,n){arguments[4][49][0].apply(n,arguments)},{"../object/keysIn":533,"./baseFor":436,dup:49}],438:[function(e,t,n){arguments[4][50][0].apply(n,arguments)},{"../object/keys":532,"./baseFor":436,dup:50}],439:[function(e,t,n){arguments[4][51][0].apply(n,arguments)},{"./toObject":510,dup:51}],440:[function(e,t,n){arguments[4][52][0].apply(n,arguments)},{"./indexOfNaN":489,dup:52}],441:[function(e,t,n){arguments[4][53][0].apply(n,arguments)},{"../lang/isObject":522,"./baseIsEqualDeep":442,"./isObjectLike":499,dup:53}],442:[function(e,t,n){arguments[4][54][0].apply(n,arguments)},{"../lang/isArray":516,"../lang/isTypedArray":525,"./equalArrays":481,"./equalByTag":482,"./equalObjects":483,dup:54}],443:[function(e,t,n){arguments[4][55][0].apply(n,arguments)},{"./baseIsEqual":441,"./toObject":510,dup:55}],444:[function(e,t,n){arguments[4][56][0].apply(n,arguments)},{dup:56}],445:[function(e,t,n){arguments[4][57][0].apply(n,arguments)},{"./baseEach":431,"./isArrayLike":493,dup:57}],446:[function(e,t,n){arguments[4][58][0].apply(n,arguments)},{"./baseIsMatch":443,"./getMatchData":487,"./toObject":510,dup:58}],447:[function(e,t,n){arguments[4][59][0].apply(n,arguments)},{"../array/last":399,"../lang/isArray":516,"./baseGet":439,"./baseIsEqual":441,"./baseSlice":454,"./isKey":496,"./isStrictComparable":500,"./toObject":510,"./toPath":511,dup:59}],448:[function(e,t,n){arguments[4][60][0].apply(n,arguments)},{"../lang/isArray":516,"../lang/isObject":522,"../lang/isTypedArray":525,"../object/keys":532,"./arrayEach":418,"./baseMergeDeep":449,"./isArrayLike":493,"./isObjectLike":499,dup:60}],449:[function(e,t,n){arguments[4][61][0].apply(n,arguments)},{"../lang/isArguments":515,"../lang/isArray":516,"../lang/isPlainObject":523,"../lang/isTypedArray":525,"../lang/toPlainObject":527,"./arrayCopy":417,"./isArrayLike":493,dup:61}],450:[function(e,t,n){arguments[4][62][0].apply(n,arguments)},{dup:62}],451:[function(e,t,n){arguments[4][63][0].apply(n,arguments)},{"./baseGet":439,"./toPath":511,dup:63}],452:[function(e,t,n){arguments[4][64][0].apply(n,arguments)},{dup:64}],453:[function(e,t,n){arguments[4][65][0].apply(n,arguments)},{"../utility/identity":539,"./metaMap":503,dup:65}],454:[function(e,t,n){arguments[4][66][0].apply(n,arguments)},{dup:66}],455:[function(e,t,n){function r(e,t){var n;return i(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}var i=e("./baseEach");t.exports=r},{"./baseEach":431}],456:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{dup:70}],457:[function(e,t,n){function r(e,t){var n=-1,r=i,u=e.length,l=!0,c=l&&u>=s,f=c?a():null,p=[];f?(r=o,l=!1):(c=!1,f=t?[]:p);e:for(;++n<u;){var d=e[n],h=t?t(d,n,e):d;if(l&&d===d){for(var m=f.length;m--;)if(f[m]===h)continue e;t&&f.push(h),p.push(d)}else r(f,h,0)<0&&((t||c)&&f.push(h),p.push(d))}return p}var i=e("./baseIndexOf"),o=e("./cacheIndexOf"),a=e("./createCache"),s=200;t.exports=r},{"./baseIndexOf":440,"./cacheIndexOf":461,"./createCache":469}],458:[function(e,t,n){arguments[4][71][0].apply(n,arguments)},{dup:71}],459:[function(e,t,n){arguments[4][74][0].apply(n,arguments)},{"../utility/identity":539,dup:74}],460:[function(e,t,n){(function(e){function n(e){var t=new r(e.byteLength),n=new i(t);return n.set(new i(e)),t}var r=e.ArrayBuffer,i=e.Uint8Array;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],461:[function(e,t,n){arguments[4][75][0].apply(n,arguments)},{"../lang/isObject":522,dup:75}],462:[function(e,t,n){arguments[4][76][0].apply(n,arguments)},{"../lang/isObject":522,dup:76}],463:[function(e,t,n){arguments[4][80][0].apply(n,arguments)},{dup:80}],464:[function(e,t,n){arguments[4][81][0].apply(n,arguments)},{dup:81}],465:[function(e,t,n){arguments[4][82][0].apply(n,arguments)},{"../function/restParam":413,"./bindCallback":459,"./isIterateeCall":495,dup:82}],466:[function(e,t,n){arguments[4][83][0].apply(n,arguments)},{"./getLength":486,"./isLength":498,"./toObject":510,dup:83}],467:[function(e,t,n){arguments[4][84][0].apply(n,arguments)},{"./toObject":510,dup:84}],468:[function(e,t,n){(function(n){function r(e,t){function r(){var i=this&&this!==n&&this instanceof r?o:e;return i.apply(t,arguments)}var o=i(e);return r}var i=e("./createCtorWrapper");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":470}],469:[function(e,t,n){(function(n){function r(e){return s&&a?new i(e):null}var i=e("./SetCache"),o=e("./getNative"),a=o(n,"Set"),s=o(Object,"create");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./SetCache":416,"./getNative":488}],470:[function(e,t,n){arguments[4][87][0].apply(n,arguments)},{"../lang/isObject":522,"./baseCreate":430,dup:87}],471:[function(e,t,n){function r(e){function t(n,r,a){a&&o(n,r,a)&&(r=void 0);var s=i(n,e,void 0,void 0,void 0,void 0,void 0,r);return s.placeholder=t.placeholder,s}return t}var i=e("./createWrapper"),o=e("./isIterateeCall");t.exports=r},{"./createWrapper":480,"./isIterateeCall":495}],472:[function(e,t,n){arguments[4][88][0].apply(n,arguments)},{"../function/restParam":413,dup:88}],473:[function(e,t,n){arguments[4][89][0].apply(n,arguments)},{"../lang/isArray":516,"./baseCallback":427,"./baseFind":433,"./baseFindIndex":434,dup:89}],474:[function(e,t,n){arguments[4][90][0].apply(n,arguments)},{"./baseCallback":427,"./baseFindIndex":434,dup:90}],475:[function(e,t,n){arguments[4][91][0].apply(n,arguments)},{"../lang/isArray":516,"./bindCallback":459,dup:91}],476:[function(e,t,n){(function(n){function r(e,t,j,w,C,x,E,R,O,P){function S(){for(var h=arguments.length,m=h,v=Array(h);m--;)v[m]=arguments[m];if(w&&(v=o(v,w,C)),x&&(v=a(v,x,E)),M||I){var b=S.placeholder,F=c(v,b);if(h-=F.length,P>h){var L=R?i(R):void 0,U=_(P-h,0),H=M?F:void 0,B=M?void 0:F,q=M?v:void 0,V=M?void 0:v;t|=M?y:g,t&=~(M?g:y),N||(t&=~(p|d));var W=[e,t,j,q,H,V,B,L,O,U],K=r.apply(void 0,W);return u(e)&&f(K,W),K.placeholder=b,K}}var $=A?j:this,z=T?$[e]:e;return R&&(v=l(v,R)),k&&O<v.length&&(v.length=O),this&&this!==n&&this instanceof S&&(z=D||s(e)),z.apply($,v)}var k=t&b,A=t&p,T=t&d,M=t&m,N=t&h,I=t&v,D=T?void 0:s(e);return S}var i=e("./arrayCopy"),o=e("./composeArgs"),a=e("./composeArgsRight"),s=e("./createCtorWrapper"),u=e("./isLaziable"),l=e("./reorder"),c=e("./replaceHolders"),f=e("./setData"),p=1,d=2,h=4,m=8,v=16,y=32,g=64,b=128,_=Math.max;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./arrayCopy":417,"./composeArgs":463,"./composeArgsRight":464,"./createCtorWrapper":470,"./isLaziable":497,"./reorder":505,"./replaceHolders":506,"./setData":507}],477:[function(e,t,n){arguments[4][94][0].apply(n,arguments)},{"./baseCallback":427,"./baseForOwn":438,dup:94}],478:[function(e,t,n){(function(n){function r(e,t,r,a){function s(){for(var t=-1,i=arguments.length,o=-1,c=a.length,f=Array(c+i);++o<c;)f[o]=a[o];for(;i--;)f[o++]=arguments[++t];var p=this&&this!==n&&this instanceof s?l:e;return p.apply(u?r:this,f)}var u=t&o,l=i(e);return s}var i=e("./createCtorWrapper"),o=1;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./createCtorWrapper":470}],479:[function(e,t,n){arguments[4][97][0].apply(n,arguments)},{"../lang/isArray":516,"./baseCallback":427,"./baseReduce":452,dup:97}],480:[function(e,t,n){arguments[4][98][0].apply(n,arguments)},{"./baseSetData":453,"./createBindWrapper":468,"./createHybridWrapper":476,"./createPartialWrapper":478,"./getData":484,"./mergeData":501,"./setData":507,dup:98}],481:[function(e,t,n){arguments[4][99][0].apply(n,arguments)},{"./arraySome":423,dup:99}],482:[function(e,t,n){arguments[4][100][0].apply(n,arguments)},{dup:100}],483:[function(e,t,n){arguments[4][101][0].apply(n,arguments)},{"../object/keys":532,dup:101}],484:[function(e,t,n){arguments[4][102][0].apply(n,arguments)},{"../utility/noop":540,"./metaMap":503,dup:102}],485:[function(e,t,n){arguments[4][103][0].apply(n,arguments)},{"./realNames":504,dup:103}],486:[function(e,t,n){arguments[4][104][0].apply(n,arguments)},{"./baseProperty":450,dup:104}],487:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"../object/pairs":537,"./isStrictComparable":500,dup:105}],488:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"../lang/isNative":521,dup:106}],489:[function(e,t,n){arguments[4][107][0].apply(n,arguments)},{dup:107}],490:[function(e,t,n){arguments[4][218][0].apply(n,arguments)},{dup:218}],491:[function(e,t,n){arguments[4][219][0].apply(n,arguments)},{"./bufferClone":460,dup:219}],492:[function(e,t,n){arguments[4][220][0].apply(n,arguments)},{dup:220}],493:[function(e,t,n){arguments[4][108][0].apply(n,arguments)},{"./getLength":486,"./isLength":498,dup:108}],494:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{dup:109}],495:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{"../lang/isObject":522,"./isArrayLike":493,"./isIndex":494,dup:110}],496:[function(e,t,n){arguments[4][111][0].apply(n,arguments)},{"../lang/isArray":516,"./toObject":510,dup:111}],497:[function(e,t,n){arguments[4][112][0].apply(n,arguments)},{"../chain/lodash":402,"./LazyWrapper":414,"./getData":484,"./getFuncName":485,dup:112}],498:[function(e,t,n){arguments[4][113][0].apply(n,arguments)},{dup:113}],499:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],500:[function(e,t,n){arguments[4][116][0].apply(n,arguments)},{"../lang/isObject":522,dup:116}],501:[function(e,t,n){arguments[4][117][0].apply(n,arguments)},{"./arrayCopy":417,"./composeArgs":463,"./composeArgsRight":464,"./replaceHolders":506,dup:117}],502:[function(e,t,n){function r(e,t){return void 0===e?t:i(e,t,r)}var i=e("../object/merge");t.exports=r},{"../object/merge":536}],503:[function(e,t,n){(function(n){var r=e("./getNative"),i=r(n,"WeakMap"),o=i&&new i;t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getNative":488}],504:[function(e,t,n){arguments[4][121][0].apply(n,arguments)},{dup:121}],505:[function(e,t,n){arguments[4][122][0].apply(n,arguments)},{"./arrayCopy":417,"./isIndex":494,dup:122}],506:[function(e,t,n){arguments[4][123][0].apply(n,arguments)},{dup:123}],507:[function(e,t,n){arguments[4][124][0].apply(n,arguments)},{"../date/now":411,"./baseSetData":453,dup:124}],508:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"../lang/isArguments":515,"../lang/isArray":516,"../object/keysIn":533,"./isIndex":494,"./isLength":498,dup:125}],509:[function(e,t,n){function r(e,t){for(var n,r=-1,i=e.length,o=-1,a=[];++r<i;){var s=e[r],u=t?t(s,r,e):s;r&&n===u||(n=u,a[++o]=s)}return a}t.exports=r},{}],510:[function(e,t,n){arguments[4][127][0].apply(n,arguments)},{"../lang/isObject":522,dup:127}],511:[function(e,t,n){arguments[4][128][0].apply(n,arguments)},{"../lang/isArray":516,"./baseToString":456,dup:128}],512:[function(e,t,n){arguments[4][131][0].apply(n,arguments)},{"./LazyWrapper":414,"./LodashWrapper":415,"./arrayCopy":417,dup:131}],513:[function(e,t,n){arguments[4][231][0].apply(n,arguments)},{"../internal/baseClone":428,"../internal/bindCallback":459,"../internal/isIterateeCall":495,dup:231}],514:[function(e,t,n){arguments[4][232][0].apply(n,arguments)},{"../internal/baseClone":428,"../internal/bindCallback":459,dup:232}],515:[function(e,t,n){arguments[4][132][0].apply(n,arguments)},{"../internal/isArrayLike":493,"../internal/isObjectLike":499,dup:132}],516:[function(e,t,n){arguments[4][133][0].apply(n,arguments)},{"../internal/getNative":488,"../internal/isLength":498,"../internal/isObjectLike":499,dup:133}],517:[function(e,t,n){function r(e){return e===!0||e===!1||i(e)&&s.call(e)==o}var i=e("../internal/isObjectLike"),o="[object Boolean]",a=Object.prototype,s=a.toString;t.exports=r},{"../internal/isObjectLike":499}],518:[function(e,t,n){arguments[4][134][0].apply(n,arguments)},{"../internal/isArrayLike":493,"../internal/isObjectLike":499,"../object/keys":532,"./isArguments":515,"./isArray":516,"./isFunction":520,"./isString":524,dup:134}],519:[function(e,t,n){arguments[4][135][0].apply(n,arguments)},{"../internal/baseIsEqual":441,"../internal/bindCallback":459,dup:135}],520:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{"./isObject":522,dup:136}],521:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"../internal/isObjectLike":499,"./isFunction":520,dup:137}],522:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],523:[function(e,t,n){arguments[4][140][0].apply(n,arguments)},{"../internal/baseForIn":437,"../internal/isObjectLike":499,"./isArguments":515,dup:140}],524:[function(e,t,n){arguments[4][141][0].apply(n,arguments)},{"../internal/isObjectLike":499,dup:141}],525:[function(e,t,n){arguments[4][142][0].apply(n,arguments)},{"../internal/isLength":498,"../internal/isObjectLike":499,dup:142}],526:[function(e,t,n){arguments[4][143][0].apply(n,arguments)},{dup:143}],527:[function(e,t,n){arguments[4][144][0].apply(n,arguments)},{"../internal/baseCopy":429,"../object/keysIn":533,dup:144}],528:[function(e,t,n){arguments[4][146][0].apply(n,arguments)},{"../internal/assignWith":425,"../internal/baseAssign":426,"../internal/createAssigner":465,dup:146}],529:[function(e,t,n){arguments[4][147][0].apply(n,arguments)},{"../internal/assignDefaults":424,"../internal/createDefaults":472,"./assign":528,dup:147}],530:[function(e,t,n){var r=e("../internal/createDefaults"),i=e("./merge"),o=e("../internal/mergeDefaults"),a=r(i,o);t.exports=a},{"../internal/createDefaults":472,"../internal/mergeDefaults":502,"./merge":536}],531:[function(e,t,n){function r(e,t,n){var r=null==e?void 0:i(e,o(t),t+"");return void 0===r?n:r}var i=e("../internal/baseGet"),o=e("../internal/toPath");t.exports=r},{"../internal/baseGet":439,"../internal/toPath":511}],532:[function(e,t,n){arguments[4][150][0].apply(n,arguments)},{"../internal/getNative":488,"../internal/isArrayLike":493,"../internal/shimKeys":508,"../lang/isObject":522,dup:150}],533:[function(e,t,n){arguments[4][151][0].apply(n,arguments)},{"../internal/isIndex":494,"../internal/isLength":498,"../lang/isArguments":515,"../lang/isArray":516,"../lang/isObject":522,dup:151}],534:[function(e,t,n){arguments[4][152][0].apply(n,arguments)},{"../internal/createObjectMapper":477,dup:152}],535:[function(e,t,n){arguments[4][153][0].apply(n,arguments)},{"../internal/createObjectMapper":477,dup:153}],536:[function(e,t,n){arguments[4][154][0].apply(n,arguments)},{"../internal/baseMerge":448,"../internal/createAssigner":465,dup:154}],537:[function(e,t,n){arguments[4][156][0].apply(n,arguments)},{"../internal/toObject":510,"./keys":532,dup:156}],538:[function(e,t,n){arguments[4][158][0].apply(n,arguments)},{"../internal/baseValues":458,"./keys":532,dup:158}],539:[function(e,t,n){arguments[4][160][0].apply(n,arguments)},{dup:160}],540:[function(e,t,n){arguments[4][161][0].apply(n,arguments)},{dup:161}],541:[function(e,t,n){arguments[4][162][0].apply(n,arguments)},{"../internal/baseProperty":450,"../internal/basePropertyDeep":451,"../internal/isKey":496,dup:162}],542:[function(e,t,n){function r(e,t,n){n&&i(e,t,n)&&(t=n=void 0),e=+e||0,n=null==n?1:+n||0,null==t?(t=e,e=0):t=+t||0;for(var r=-1,s=a(o((t-e)/(n||1)),0),u=Array(s);++r<s;)u[r]=e,e+=n;return u}var i=e("../internal/isIterateeCall"),o=Math.ceil,a=Math.max;t.exports=r},{"../internal/isIterateeCall":495}],543:[function(e,t,n){function r(){}var i=e("./_nativeCreate"),o=Object.prototype;r.prototype=i?i(null):o,t.exports=r},{"./_nativeCreate":631}],544:[function(e,t,n){var r=e("./_getNative"),i=e("./_root"),o=r(i,"Map");t.exports=o},{"./_getNative":607,"./_root":633}],545:[function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=e("./_mapClear"),o=e("./_mapDelete"),a=e("./_mapGet"),s=e("./_mapHas"),u=e("./_mapSet");r.prototype.clear=i,r.prototype["delete"]=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,t.exports=r},{"./_mapClear":625,"./_mapDelete":626,"./_mapGet":627,"./_mapHas":628,"./_mapSet":629}],546:[function(e,t,n){var r=e("./_getNative"),i=e("./_root"),o=r(i,"Set");t.exports=o},{"./_getNative":607,"./_root":633}],547:[function(e,t,n){function r(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=e("./_stackClear"),o=e("./_stackDelete"),a=e("./_stackGet"),s=e("./_stackHas"),u=e("./_stackSet");r.prototype.clear=i,r.prototype["delete"]=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,t.exports=r},{"./_stackClear":635,"./_stackDelete":636,"./_stackGet":637,"./_stackHas":638,"./_stackSet":639}],548:[function(e,t,n){var r=e("./_root"),i=r.Symbol;t.exports=i},{"./_root":633}],549:[function(e,t,n){var r=e("./_root"),i=r.Uint8Array;t.exports=i},{"./_root":633}],550:[function(e,t,n){var r=e("./_getNative"),i=e("./_root"),o=r(i,"WeakMap");t.exports=o},{"./_getNative":607,"./_root":633}],551:[function(e,t,n){function r(e,t){return e.set(t[0],t[1]),e}t.exports=r},{}],552:[function(e,t,n){function r(e,t){return e.add(t),e}t.exports=r},{}],553:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],554:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],555:[function(e,t,n){function r(e,t,n,r){var i=-1,o=e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}t.exports=r},{}],556:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],557:[function(e,t,n){function r(e,t,n){var r=e[t];a.call(e,t)&&i(r,n)&&(void 0!==n||t in e)||(e[t]=n)}var i=e("./eq"),o=Object.prototype,a=o.hasOwnProperty;t.exports=r},{"./eq":643}],558:[function(e,t,n){function r(e,t){var n=i(e,t);if(0>n)return!1;var r=e.length-1;return n==r?e.pop():a.call(e,n,1),!0}var i=e("./_assocIndexOf"),o=Array.prototype,a=o.splice;t.exports=r},{"./_assocIndexOf":561}],559:[function(e,t,n){function r(e,t){var n=i(e,t);return 0>n?void 0:e[n][1]}var i=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":561}],560:[function(e,t,n){function r(e,t){return i(e,t)>-1}var i=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":561}],561:[function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}var i=e("./eq");t.exports=r},{"./eq":643}],562:[function(e,t,n){function r(e,t,n){var r=i(e,t);0>r?e.push([t,n]):e[r][1]=n}var i=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":561}],563:[function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=e("./_copyObject"),o=e("./keys");t.exports=r},{"./_copyObject":597,"./keys":667}],564:[function(e,t,n){function r(e){return"function"==typeof e?e:i}var i=e("./identity");t.exports=r},{"./identity":648}],565:[function(e,t,n){function r(e){return i(e)?e:o(e)}var i=e("./isArray"),o=e("./_stringToPath");t.exports=r},{"./_stringToPath":640,"./isArray":650}],566:[function(e,t,n){function r(e,t,n,j,w,C,x){var O;if(j&&(O=C?j(e,w,C,x):j(e)),void 0!==O)return O;if(!b(e))return e;var P=v(e);if(P){if(O=d(e),!t)return c(e,O)}else{var k=p(e),A=k==E||k==R;if(y(e))return l(e,t);if(k==S||k==_||A&&!C){if(g(e))return C?e:{};if(O=m(A?{}:e),!t)return O=s(O,e),n?f(e,O):O}else{if(!K[k])return C?e:{};O=h(e,k,t)}}x||(x=new i);var T=x.get(e);return T?T:(x.set(e,O),(P?o:u)(e,function(i,o){a(O,o,r(i,t,n,j,o,e,x))}),n&&!P?f(e,O):O)}var i=e("./_Stack"),o=e("./_arrayEach"),a=e("./_assignValue"),s=e("./_baseAssign"),u=e("./_baseForOwn"),l=e("./_cloneBuffer"),c=e("./_copyArray"),f=e("./_copySymbols"),p=e("./_getTag"),d=e("./_initCloneArray"),h=e("./_initCloneByTag"),m=e("./_initCloneObject"),v=e("./isArray"),y=e("./isBuffer"),g=e("./_isHostObject"),b=e("./isObject"),_="[object Arguments]",j="[object Array]",w="[object Boolean]",C="[object Date]",x="[object Error]",E="[object Function]",R="[object GeneratorFunction]",O="[object Map]",P="[object Number]",S="[object Object]",k="[object RegExp]",A="[object Set]",T="[object String]",M="[object Symbol]",N="[object WeakMap]",I="[object ArrayBuffer]",D="[object Float32Array]",F="[object Float64Array]",L="[object Int8Array]",U="[object Int16Array]",H="[object Int32Array]",B="[object Uint8Array]",q="[object Uint8ClampedArray]",V="[object Uint16Array]",W="[object Uint32Array]",K={};K[_]=K[j]=K[I]=K[w]=K[C]=K[D]=K[F]=K[L]=K[U]=K[H]=K[O]=K[P]=K[S]=K[k]=K[A]=K[T]=K[M]=K[B]=K[q]=K[V]=K[W]=!0,K[x]=K[E]=K[N]=!1,t.exports=r},{"./_Stack":547,"./_arrayEach":553,"./_assignValue":557,"./_baseAssign":563,"./_baseForOwn":572,"./_cloneBuffer":590,"./_copyArray":596,"./_copySymbols":599,"./_getTag":609,"./_initCloneArray":616,"./_initCloneByTag":617,"./_initCloneObject":618,"./_isHostObject":619,"./isArray":650,"./isBuffer":654,"./isObject":660}],567:[function(e,t,n){function r(e){return i(e)?o(e):{}}var i=e("./isObject"),o=Object.create;t.exports=r},{"./isObject":660}],568:[function(e,t,n){var r=e("./_baseForOwn"),i=e("./_createBaseEach"),o=i(r);t.exports=o},{"./_baseForOwn":572,"./_createBaseEach":600}],569:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,o){return t(e,n,o)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],570:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],571:[function(e,t,n){var r=e("./_createBaseFor"),i=r();t.exports=i},{"./_createBaseFor":601}],572:[function(e,t,n){function r(e,t){return e&&i(e,t,o)}var i=e("./_baseFor"),o=e("./keys");t.exports=r},{"./_baseFor":571,"./keys":667}],573:[function(e,t,n){function r(e,t){t=o(t,e)?[t+""]:i(t);for(var n=0,r=t.length;null!=e&&r>n;)e=e[t[n++]];return n&&n==r?e:void 0}var i=e("./_baseCastPath"),o=e("./_isKey");t.exports=r},{"./_baseCastPath":565,"./_isKey":621}],574:[function(e,t,n){function r(e,t){return o.call(e,t)||"object"==typeof e&&t in e&&null===a(e)}var i=Object.prototype,o=i.hasOwnProperty,a=Object.getPrototypeOf;t.exports=r},{}],575:[function(e,t,n){function r(e,t){return t in Object(e)}t.exports=r},{}],576:[function(e,t,n){function r(e,t,n,s,u){return e===t?!0:null==e||null==t||!o(e)&&!a(t)?e!==e&&t!==t:i(e,t,r,n,s,u)}var i=e("./_baseIsEqualDeep"),o=e("./isObject"),a=e("./isObjectLike");t.exports=r},{"./_baseIsEqualDeep":577,"./isObject":660,"./isObjectLike":661}],577:[function(e,t,n){function r(e,t,n,r,v,g){var b=l(e),_=l(t),j=h,w=h;b||(j=u(e),j=j==d?m:j),_||(w=u(t),w=w==d?m:w);var C=j==m&&!c(e),x=w==m&&!c(t),E=j==w;if(E&&!C)return g||(g=new i),b||f(e)?o(e,t,n,r,v,g):a(e,t,j,n,r,v,g);if(!(v&p)){var R=C&&y.call(e,"__wrapped__"),O=x&&y.call(t,"__wrapped__");if(R||O)return g||(g=new i),n(R?e.value():e,O?t.value():t,r,v,g)}return E?(g||(g=new i),s(e,t,n,r,v,g)):!1}var i=e("./_Stack"),o=e("./_equalArrays"),a=e("./_equalByTag"),s=e("./_equalObjects"),u=e("./_getTag"),l=e("./isArray"),c=e("./_isHostObject"),f=e("./isTypedArray"),p=2,d="[object Arguments]",h="[object Array]",m="[object Object]",v=Object.prototype,y=v.hasOwnProperty;t.exports=r},{"./_Stack":547,"./_equalArrays":602,"./_equalByTag":603,"./_equalObjects":604,"./_getTag":609,"./_isHostObject":619,"./isArray":650,"./isTypedArray":665}],578:[function(e,t,n){function r(e,t,n,r){var u=n.length,l=u,c=!r;if(null==e)return!l;for(e=Object(e);u--;){var f=n[u];if(c&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++u<l;){f=n[u];var p=f[0],d=e[p],h=f[1];if(c&&f[2]){if(void 0===d&&!(p in e))return!1}else{var m=new i,v=r?r(d,h,p,e,t,m):void 0;if(!(void 0===v?o(h,d,r,a|s,m):v))return!1}}return!0}var i=e("./_Stack"),o=e("./_baseIsEqual"),a=1,s=2;t.exports=r},{"./_Stack":547,"./_baseIsEqual":576}],579:[function(e,t,n){function r(e){var t=typeof e;return"function"==t?e:null==e?a:"object"==t?s(e)?o(e[0],e[1]):i(e):u(e)}var i=e("./_baseMatches"),o=e("./_baseMatchesProperty"),a=e("./identity"),s=e("./isArray"),u=e("./property");t.exports=r},{"./_baseMatches":581,"./_baseMatchesProperty":582,"./identity":648,"./isArray":650,"./property":669}],580:[function(e,t,n){function r(e){return i(Object(e))}var i=Object.keys;t.exports=r},{}],581:[function(e,t,n){function r(e){var t=o(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:e[n]===r&&(void 0!==r||n in Object(e))}}return function(n){return n===e||i(n,e,t)}}var i=e("./_baseIsMatch"),o=e("./_getMatchData");t.exports=r},{"./_baseIsMatch":578,"./_getMatchData":606}],582:[function(e,t,n){function r(e,t){return function(n){var r=o(n,e);return void 0===r&&r===t?a(n,e):i(t,r,void 0,s|u)}}var i=e("./_baseIsEqual"),o=e("./get"),a=e("./hasIn"),s=1,u=2;t.exports=r},{"./_baseIsEqual":576,"./get":646,"./hasIn":647}],583:[function(e,t,n){arguments[4][62][0].apply(n,arguments)},{dup:62}],584:[function(e,t,n){function r(e){return function(t){return i(t,e)}}var i=e("./_baseGet");t.exports=r},{"./_baseGet":573}],585:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;0>t&&(t=-t>i?0:i+t),n=n>i?i:n,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}t.exports=r},{}],586:[function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=r},{}],587:[function(e,t,n){function r(e,t){return i(t,function(t){return[t,e[t]]})}var i=e("./_arrayMap");t.exports=r},{"./_arrayMap":554}],588:[function(e,t,n){function r(e){return e&&e.Object===Object?e:null}t.exports=r},{}],589:[function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=e("./_Uint8Array");t.exports=r},{"./_Uint8Array":549}],590:[function(e,t,n){function r(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}t.exports=r},{}],591:[function(e,t,n){function r(e){return o(a(e),i,new e.constructor)}var i=e("./_addMapEntry"),o=e("./_arrayReduce"),a=e("./_mapToArray");t.exports=r},{"./_addMapEntry":551,"./_arrayReduce":555,"./_mapToArray":630}],592:[function(e,t,n){function r(e){var t=new e.constructor(e.source,i.exec(e));return t.lastIndex=e.lastIndex,t}var i=/\w*$/;t.exports=r},{}],593:[function(e,t,n){function r(e){return o(a(e),i,new e.constructor)}var i=e("./_addSetEntry"),o=e("./_arrayReduce"),a=e("./_setToArray");t.exports=r},{"./_addSetEntry":552,"./_arrayReduce":555,"./_setToArray":634}],594:[function(e,t,n){function r(e){return a?Object(a.call(e)):{}}var i=e("./_Symbol"),o=i?i.prototype:void 0,a=o?o.valueOf:void 0;t.exports=r},{"./_Symbol":548}],595:[function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i=e("./_cloneArrayBuffer");t.exports=r},{"./_cloneArrayBuffer":589}],596:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],597:[function(e,t,n){function r(e,t,n){return i(e,t,n)}var i=e("./_copyObjectWith");t.exports=r},{"./_copyObjectWith":598}],598:[function(e,t,n){function r(e,t,n,r){n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):e[s];i(n,s,u)}return n}var i=e("./_assignValue");t.exports=r},{"./_assignValue":557}],599:[function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=e("./_copyObject"),o=e("./_getSymbols");t.exports=r},{"./_copyObject":597,"./_getSymbols":608}],600:[function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!i(n))return e(n,r);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&r(s[a],a,s)!==!1;);return n}}var i=e("./isArrayLike");t.exports=r},{"./isArrayLike":651}],601:[function(e,t,n){function r(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(n(o[u],u,o)===!1)break}return t}}t.exports=r},{}],602:[function(e,t,n){function r(e,t,n,r,s,u){var l=-1,c=s&a,f=s&o,p=e.length,d=t.length;if(p!=d&&!(c&&d>p))return!1;var h=u.get(e);if(h)return h==t;var m=!0;for(u.set(e,t);++l<p;){var v=e[l],y=t[l];if(r)var g=c?r(y,v,l,t,e,u):r(v,y,l,e,t,u);if(void 0!==g){if(g)continue;m=!1;break}if(f){if(!i(t,function(e){return v===e||n(v,e,r,s,u)})){m=!1;break}}else if(v!==y&&!n(v,y,r,s,u)){m=!1;break}}return u["delete"](e),m}var i=e("./_arraySome"),o=1,a=2;t.exports=r},{"./_arraySome":556}],603:[function(e,t,n){function r(e,t,n,r,i,j,C){switch(n){case _:return!(e.byteLength!=t.byteLength||!r(new o(e),new o(t)));case f:case p:return+e==+t;case d:return e.name==t.name&&e.message==t.message;case m:return e!=+e?t!=+t:e==+t;case v:case g:return e==t+"";case h:var x=s;case y:var E=j&c;if(x||(x=u),e.size!=t.size&&!E)return!1;var R=C.get(e);return R?R==t:a(x(e),x(t),r,i,j|l,C.set(e,t));case b:if(w)return w.call(e)==w.call(t)}return!1}var i=e("./_Symbol"),o=e("./_Uint8Array"),a=e("./_equalArrays"),s=e("./_mapToArray"),u=e("./_setToArray"),l=1,c=2,f="[object Boolean]",p="[object Date]",d="[object Error]",h="[object Map]",m="[object Number]",v="[object RegExp]",y="[object Set]",g="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",j=i?i.prototype:void 0,w=j?j.valueOf:void 0;t.exports=r},{"./_Symbol":548,"./_Uint8Array":549,"./_equalArrays":602,"./_mapToArray":630,"./_setToArray":634}],604:[function(e,t,n){function r(e,t,n,r,s,u){var l=s&a,c=o(e),f=c.length,p=o(t),d=p.length;if(f!=d&&!l)return!1;for(var h=f;h--;){var m=c[h];if(!(l?m in t:i(t,m)))return!1}var v=u.get(e);if(v)return v==t;var y=!0;u.set(e,t);for(var g=l;++h<f;){m=c[h];var b=e[m],_=t[m];if(r)var j=l?r(_,b,m,t,e,u):r(b,_,m,e,t,u);if(!(void 0===j?b===_||n(b,_,r,s,u):j)){y=!1;break}g||(g="constructor"==m)}if(y&&!g){var w=e.constructor,C=t.constructor;w!=C&&"constructor"in e&&"constructor"in t&&!("function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C)&&(y=!1)}return u["delete"](e),y}var i=e("./_baseHas"),o=e("./keys"),a=2;t.exports=r},{"./_baseHas":574,"./keys":667}],605:[function(e,t,n){var r=e("./_baseProperty"),i=r("length");t.exports=i},{"./_baseProperty":583}],606:[function(e,t,n){function r(e){for(var t=o(e),n=t.length;n--;)t[n][2]=i(t[n][1]);return t}var i=e("./_isStrictComparable"),o=e("./toPairs");t.exports=r},{"./_isStrictComparable":624,"./toPairs":670}],607:[function(e,t,n){function r(e,t){var n=e[t];return i(n)?n:void 0}var i=e("./isNative");t.exports=r},{"./isNative":657}],608:[function(e,t,n){var r=Object.getOwnPropertySymbols,i=r||function(){return[]};t.exports=i},{}],609:[function(e,t,n){function r(e){return d.call(e)}var i=e("./_Map"),o=e("./_Set"),a=e("./_WeakMap"),s="[object Map]",u="[object Object]",l="[object Set]",c="[object WeakMap]",f=Object.prototype,p=Function.prototype.toString,d=f.toString,h=i?p.call(i):"",m=o?p.call(o):"",v=a?p.call(a):"";(i&&r(new i)!=s||o&&r(new o)!=l||a&&r(new a)!=c)&&(r=function(e){var t=d.call(e),n=t==u?e.constructor:null,r="function"==typeof n?p.call(n):"";if(r)switch(r){case h:return s;case m:return l;case v:return c}return t}),t.exports=r},{"./_Map":544,"./_Set":546,"./_WeakMap":550}],610:[function(e,t,n){function r(e,t,n){if(null==e)return!1;var r=n(e,t);r||u(t)||(t=i(t),e=p(e,t),null!=e&&(t=f(t),r=n(e,t)));var d=e?e.length:void 0;return r||!!d&&l(d)&&s(t,d)&&(a(e)||c(e)||o(e))}var i=e("./_baseCastPath"),o=e("./isArguments"),a=e("./isArray"),s=e("./_isIndex"),u=e("./_isKey"),l=e("./isLength"),c=e("./isString"),f=e("./last"),p=e("./_parent");t.exports=r},{"./_baseCastPath":565,"./_isIndex":620,"./_isKey":621,"./_parent":632,"./isArguments":649,"./isArray":650,"./isLength":656,"./isString":663,"./last":668}],611:[function(e,t,n){function r(e,t){return i(e,t)&&delete e[t]}var i=e("./_hashHas");t.exports=r},{"./_hashHas":613}],612:[function(e,t,n){function r(e,t){if(i){var n=e[t];return n===o?void 0:n}return s.call(e,t)?e[t]:void 0}var i=e("./_nativeCreate"),o="__lodash_hash_undefined__",a=Object.prototype,s=a.hasOwnProperty;
t.exports=r},{"./_nativeCreate":631}],613:[function(e,t,n){function r(e,t){return i?void 0!==e[t]:a.call(e,t)}var i=e("./_nativeCreate"),o=Object.prototype,a=o.hasOwnProperty;t.exports=r},{"./_nativeCreate":631}],614:[function(e,t,n){function r(e,t,n){e[t]=i&&void 0===n?o:n}var i=e("./_nativeCreate"),o="__lodash_hash_undefined__";t.exports=r},{"./_nativeCreate":631}],615:[function(e,t,n){function r(e){var t=e?e.length:void 0;return s(t)&&(a(e)||u(e)||o(e))?i(t,String):null}var i=e("./_baseTimes"),o=e("./isArguments"),a=e("./isArray"),s=e("./isLength"),u=e("./isString");t.exports=r},{"./_baseTimes":586,"./isArguments":649,"./isArray":650,"./isLength":656,"./isString":663}],616:[function(e,t,n){function r(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&o.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var i=Object.prototype,o=i.hasOwnProperty;t.exports=r},{}],617:[function(e,t,n){function r(e,t,n){var r=e.constructor;switch(t){case g:return i(e);case c:case f:return new r(+e);case b:case _:case j:case w:case C:case x:case E:case R:case O:return l(e,n);case p:return o(e);case d:case v:return new r(e);case h:return a(e);case m:return s(e);case y:return u(e)}}var i=e("./_cloneArrayBuffer"),o=e("./_cloneMap"),a=e("./_cloneRegExp"),s=e("./_cloneSet"),u=e("./_cloneSymbol"),l=e("./_cloneTypedArray"),c="[object Boolean]",f="[object Date]",p="[object Map]",d="[object Number]",h="[object RegExp]",m="[object Set]",v="[object String]",y="[object Symbol]",g="[object ArrayBuffer]",b="[object Float32Array]",_="[object Float64Array]",j="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",x="[object Uint8Array]",E="[object Uint8ClampedArray]",R="[object Uint16Array]",O="[object Uint32Array]";t.exports=r},{"./_cloneArrayBuffer":589,"./_cloneMap":591,"./_cloneRegExp":592,"./_cloneSet":593,"./_cloneSymbol":594,"./_cloneTypedArray":595}],618:[function(e,t,n){function r(e){return"function"!=typeof e.constructor||o(e)?{}:i(a(e))}var i=e("./_baseCreate"),o=e("./_isPrototype"),a=Object.getPrototypeOf;t.exports=r},{"./_baseCreate":567,"./_isPrototype":623}],619:[function(e,t,n){function r(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}t.exports=r},{}],620:[function(e,t,n){function r(e,t){return e="number"==typeof e||o.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=r},{}],621:[function(e,t,n){function r(e,t){return"number"==typeof e?!0:!i(e)&&(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}var i=e("./isArray"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=r},{"./isArray":650}],622:[function(e,t,n){function r(e){var t=typeof e;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!=e||null==e}t.exports=r},{}],623:[function(e,t,n){function r(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||i;return e===n}var i=Object.prototype;t.exports=r},{}],624:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e("./isObject");t.exports=r},{"./isObject":660}],625:[function(e,t,n){function r(){this.__data__={hash:new i,map:o?new o:[],string:new i}}var i=e("./_Hash"),o=e("./_Map");t.exports=r},{"./_Hash":543,"./_Map":544}],626:[function(e,t,n){function r(e){var t=this.__data__;return s(e)?a("string"==typeof e?t.string:t.hash,e):i?t.map["delete"](e):o(t.map,e)}var i=e("./_Map"),o=e("./_assocDelete"),a=e("./_hashDelete"),s=e("./_isKeyable");t.exports=r},{"./_Map":544,"./_assocDelete":558,"./_hashDelete":611,"./_isKeyable":622}],627:[function(e,t,n){function r(e){var t=this.__data__;return s(e)?a("string"==typeof e?t.string:t.hash,e):i?t.map.get(e):o(t.map,e)}var i=e("./_Map"),o=e("./_assocGet"),a=e("./_hashGet"),s=e("./_isKeyable");t.exports=r},{"./_Map":544,"./_assocGet":559,"./_hashGet":612,"./_isKeyable":622}],628:[function(e,t,n){function r(e){var t=this.__data__;return s(e)?a("string"==typeof e?t.string:t.hash,e):i?t.map.has(e):o(t.map,e)}var i=e("./_Map"),o=e("./_assocHas"),a=e("./_hashHas"),s=e("./_isKeyable");t.exports=r},{"./_Map":544,"./_assocHas":560,"./_hashHas":613,"./_isKeyable":622}],629:[function(e,t,n){function r(e,t){var n=this.__data__;return s(e)?a("string"==typeof e?n.string:n.hash,e,t):i?n.map.set(e,t):o(n.map,e,t),this}var i=e("./_Map"),o=e("./_assocSet"),a=e("./_hashSet"),s=e("./_isKeyable");t.exports=r},{"./_Map":544,"./_assocSet":562,"./_hashSet":614,"./_isKeyable":622}],630:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=r},{}],631:[function(e,t,n){var r=e("./_getNative"),i=r(Object,"create");t.exports=i},{"./_getNative":607}],632:[function(e,t,n){function r(e,t){return 1==t.length?e:o(e,i(t,0,-1))}var i=e("./_baseSlice"),o=e("./get");t.exports=r},{"./_baseSlice":585,"./get":646}],633:[function(e,t,n){(function(r){var i=e("./_checkGlobal"),o={"function":!0,object:!0},a=o[typeof n]&&n&&!n.nodeType?n:void 0,s=o[typeof t]&&t&&!t.nodeType?t:void 0,u=i(a&&s&&"object"==typeof r&&r),l=i(o[typeof self]&&self),c=i(o[typeof window]&&window),f=i(o[typeof this]&&this),p=u||c!==(f&&f.window)&&c||l||f||Function("return this")();t.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_checkGlobal":588}],634:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=r},{}],635:[function(e,t,n){function r(){this.__data__={array:[],map:null}}t.exports=r},{}],636:[function(e,t,n){function r(e){var t=this.__data__,n=t.array;return n?i(n,e):t.map["delete"](e)}var i=e("./_assocDelete");t.exports=r},{"./_assocDelete":558}],637:[function(e,t,n){function r(e){var t=this.__data__,n=t.array;return n?i(n,e):t.map.get(e)}var i=e("./_assocGet");t.exports=r},{"./_assocGet":559}],638:[function(e,t,n){function r(e){var t=this.__data__,n=t.array;return n?i(n,e):t.map.has(e)}var i=e("./_assocHas");t.exports=r},{"./_assocHas":560}],639:[function(e,t,n){function r(e,t){var n=this.__data__,r=n.array;r&&(r.length<a-1?o(r,e,t):(n.array=null,n.map=new i(r)));var s=n.map;return s&&s.set(e,t),this}var i=e("./_MapCache"),o=e("./_assocSet"),a=200;t.exports=r},{"./_MapCache":545,"./_assocSet":562}],640:[function(e,t,n){function r(e){var t=[];return i(e).replace(o,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t}var i=e("./toString"),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,a=/\\(\\)?/g;t.exports=r},{"./toString":671}],641:[function(e,t,n){function r(e){return i(e,!1,!0)}var i=e("./_baseClone");t.exports=r},{"./_baseClone":566}],642:[function(e,t,n){function r(e){return function(){return e}}t.exports=r},{}],643:[function(e,t,n){function r(e,t){return e===t||e!==e&&t!==t}t.exports=r},{}],644:[function(e,t,n){function r(e,t){if(t=s(t,3),u(e)){var n=a(e,t);return n>-1?e[n]:void 0}return o(e,t,i)}var i=e("./_baseEach"),o=e("./_baseFind"),a=e("./_baseFindIndex"),s=e("./_baseIteratee"),u=e("./isArray");t.exports=r},{"./_baseEach":568,"./_baseFind":569,"./_baseFindIndex":570,"./_baseIteratee":579,"./isArray":650}],645:[function(e,t,n){function r(e,t){return"function"==typeof t&&s(e)?i(e,t):a(e,o(t))}var i=e("./_arrayEach"),o=e("./_baseCastFunction"),a=e("./_baseEach"),s=e("./isArray");t.exports=r},{"./_arrayEach":553,"./_baseCastFunction":564,"./_baseEach":568,"./isArray":650}],646:[function(e,t,n){function r(e,t,n){var r=null==e?void 0:i(e,t);return void 0===r?n:r}var i=e("./_baseGet");t.exports=r},{"./_baseGet":573}],647:[function(e,t,n){function r(e,t){return o(e,t,i)}var i=e("./_baseHasIn"),o=e("./_hasPath");t.exports=r},{"./_baseHasIn":575,"./_hasPath":610}],648:[function(e,t,n){function r(e){return e}t.exports=r},{}],649:[function(e,t,n){function r(e){return i(e)&&s.call(e,"callee")&&(!l.call(e,"callee")||u.call(e)==o)}var i=e("./isArrayLikeObject"),o="[object Arguments]",a=Object.prototype,s=a.hasOwnProperty,u=a.toString,l=a.propertyIsEnumerable;t.exports=r},{"./isArrayLikeObject":652}],650:[function(e,t,n){var r=Array.isArray;t.exports=r},{}],651:[function(e,t,n){function r(e){return null!=e&&a(i(e))&&!o(e)}var i=e("./_getLength"),o=e("./isFunction"),a=e("./isLength");t.exports=r},{"./_getLength":605,"./isFunction":655,"./isLength":656}],652:[function(e,t,n){function r(e){return o(e)&&i(e)}var i=e("./isArrayLike"),o=e("./isObjectLike");t.exports=r},{"./isArrayLike":651,"./isObjectLike":661}],653:[function(e,t,n){function r(e){return e===!0||e===!1||i(e)&&s.call(e)==o}var i=e("./isObjectLike"),o="[object Boolean]",a=Object.prototype,s=a.toString;t.exports=r},{"./isObjectLike":661}],654:[function(e,t,n){var r=e("./constant"),i=e("./_root"),o={"function":!0,object:!0},a=o[typeof n]&&n&&!n.nodeType?n:void 0,s=o[typeof t]&&t&&!t.nodeType?t:void 0,u=s&&s.exports===a?a:void 0,l=u?i.Buffer:void 0,c=l?function(e){return e instanceof l}:r(!1);t.exports=c},{"./_root":633,"./constant":642}],655:[function(e,t,n){function r(e){var t=i(e)?u.call(e):"";return t==o||t==a}var i=e("./isObject"),o="[object Function]",a="[object GeneratorFunction]",s=Object.prototype,u=s.toString;t.exports=r},{"./isObject":660}],656:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=9007199254740991;t.exports=r},{}],657:[function(e,t,n){function r(e){return null==e?!1:i(e)?p.test(c.call(e)):a(e)&&(o(e)?p:u).test(e)}var i=e("./isFunction"),o=e("./_isHostObject"),a=e("./isObjectLike"),s=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,l=Object.prototype,c=Function.prototype.toString,f=l.hasOwnProperty,p=RegExp("^"+c.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"./_isHostObject":619,"./isFunction":655,"./isObjectLike":661}],658:[function(e,t,n){function r(e){return null===e}t.exports=r},{}],659:[function(e,t,n){function r(e){return"number"==typeof e||i(e)&&s.call(e)==o}var i=e("./isObjectLike"),o="[object Number]",a=Object.prototype,s=a.toString;t.exports=r},{"./isObjectLike":661}],660:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],661:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],662:[function(e,t,n){function r(e){if(!o(e)||c.call(e)!=a||i(e))return!1;var t=f(e);if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}var i=e("./_isHostObject"),o=e("./isObjectLike"),a="[object Object]",s=Object.prototype,u=Function.prototype.toString,l=u.call(Object),c=s.toString,f=Object.getPrototypeOf;t.exports=r},{"./_isHostObject":619,"./isObjectLike":661}],663:[function(e,t,n){function r(e){return"string"==typeof e||!i(e)&&o(e)&&u.call(e)==a}var i=e("./isArray"),o=e("./isObjectLike"),a="[object String]",s=Object.prototype,u=s.toString;t.exports=r},{"./isArray":650,"./isObjectLike":661}],664:[function(e,t,n){function r(e){return"symbol"==typeof e||i(e)&&s.call(e)==o}var i=e("./isObjectLike"),o="[object Symbol]",a=Object.prototype,s=a.toString;t.exports=r},{"./isObjectLike":661}],665:[function(e,t,n){function r(e){return o(e)&&i(e.length)&&!!S[A.call(e)]}var i=e("./isLength"),o=e("./isObjectLike"),a="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",v="[object Set]",y="[object String]",g="[object WeakMap]",b="[object ArrayBuffer]",_="[object Float32Array]",j="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",O="[object Uint16Array]",P="[object Uint32Array]",S={};S[_]=S[j]=S[w]=S[C]=S[x]=S[E]=S[R]=S[O]=S[P]=!0,S[a]=S[s]=S[b]=S[u]=S[l]=S[c]=S[f]=S[p]=S[d]=S[h]=S[m]=S[v]=S[y]=S[g]=!1;var k=Object.prototype,A=k.toString;t.exports=r},{"./isLength":656,"./isObjectLike":661}],666:[function(e,t,n){arguments[4][143][0].apply(n,arguments)},{dup:143}],667:[function(e,t,n){function r(e){var t=l(e);if(!t&&!s(e))return o(e);var n=a(e),r=!!n,c=n||[],f=c.length;for(var p in e)!i(e,p)||r&&("length"==p||u(p,f))||t&&"constructor"==p||c.push(p);return c}var i=e("./_baseHas"),o=e("./_baseKeys"),a=e("./_indexKeys"),s=e("./isArrayLike"),u=e("./_isIndex"),l=e("./_isPrototype");t.exports=r},{"./_baseHas":574,"./_baseKeys":580,"./_indexKeys":615,"./_isIndex":620,"./_isPrototype":623,"./isArrayLike":651}],668:[function(e,t,n){arguments[4][8][0].apply(n,arguments)},{dup:8}],669:[function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=e("./_baseProperty"),o=e("./_basePropertyDeep"),a=e("./_isKey");t.exports=r},{"./_baseProperty":583,"./_basePropertyDeep":584,"./_isKey":621}],670:[function(e,t,n){function r(e){return i(e,o(e))}var i=e("./_baseToPairs"),o=e("./keys");t.exports=r},{"./_baseToPairs":587,"./keys":667}],671:[function(e,t,n){function r(e){if("string"==typeof e)return e;if(null==e)return"";if(o(e))return u?u.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}var i=e("./_Symbol"),o=e("./isSymbol"),a=1/0,s=i?i.prototype:void 0,u=s?s.toString:void 0;t.exports=r},{"./_Symbol":548,"./isSymbol":664}],672:[function(t,n,r){!function(t){"function"==typeof e&&e.amd?e([],t):"object"==typeof r?n.exports=t():window.noUiSlider=t()}(function(){"use strict";function e(e){return e.filter(function(e){return this[e]?!1:this[e]=!0},{})}function t(e,t){return Math.round(e/t)*t}function n(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,i=p();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),{top:t.top+i.y-r.clientTop,left:t.left+i.x-r.clientLeft}}function r(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function i(e){var t=Math.pow(10,7);return Number((Math.round(e*t)/t).toFixed(7))}function o(e,t,n){l(e,t),setTimeout(function(){c(e,t)},n)}function a(e){return Math.max(Math.min(e,100),0)}function s(e){return Array.isArray(e)?e:[e]}function u(e){var t=e.split(".");return t.length>1?t[1].length:0}function l(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function c(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function p(){var e=void 0!==window.pageXOffset,t="CSS1Compat"===(document.compatMode||""),n=e?window.pageXOffset:t?document.documentElement.scrollLeft:document.body.scrollLeft,r=e?window.pageYOffset:t?document.documentElement.scrollTop:document.body.scrollTop;return{x:n,y:r}}function d(e){e.stopPropagation()}function h(e){return function(t){return e+t}}function m(){W||(W=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"})}function v(e,t){return 100/(t-e)}function y(e,t){return 100*t/(e[1]-e[0])}function g(e,t){return y(e,e[0]<0?t+Math.abs(e[0]):t-e[0])}function b(e,t){return t*(e[1]-e[0])/100+e[0]}function _(e,t){for(var n=1;e>=t[n];)n+=1;return n}function j(e,t,n){if(n>=e.slice(-1)[0])return 100;var r,i,o,a,s=_(n,e);return r=e[s-1],i=e[s],o=t[s-1],a=t[s],o+g([r,i],n)/v(o,a)}function w(e,t,n){if(n>=100)return e.slice(-1)[0];var r,i,o,a,s=_(n,t);return r=e[s-1],i=e[s],o=t[s-1],a=t[s],b([r,i],(n-o)*v(o,a))}function C(e,n,r,i){if(100===i)return i;var o,a,s=_(i,e);return r?(o=e[s-1],a=e[s],i-o>(a-o)/2?a:o):n[s-1]?e[s-1]+t(i-e[s-1],n[s-1]):i}function x(e,t,n){var i;if("number"==typeof t&&(t=[t]),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("noUiSlider: 'range' contains invalid value.");if(i="min"===e?0:"max"===e?100:parseFloat(e),!r(i)||!r(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(i),n.xVal.push(t[0]),i?n.xSteps.push(isNaN(t[1])?!1:t[1]):isNaN(t[1])||(n.xSteps[0]=t[1])}function E(e,t,n){return t?void(n.xSteps[e]=y([n.xVal[e],n.xVal[e+1]],t)/v(n.xPct[e],n.xPct[e+1])):!0}function R(e,t,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t,this.direction=n;var i,o=[];for(i in e)e.hasOwnProperty(i)&&o.push([e[i],i]);for(o.length&&"object"==typeof o[0][0]?o.sort(function(e,t){return e[0][0]-t[0][0]}):o.sort(function(e,t){return e[0]-t[0]}),i=0;i<o.length;i++)x(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)E(i,this.xNumSteps[i],this)}function O(e,t){if(!r(t))throw new Error("noUiSlider: 'step' is not numeric.");e.singleStep=t}function P(e,t){if("object"!=typeof t||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===t.min||void 0===t.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(t.min===t.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");e.spectrum=new R(t,e.snap,e.dir,e.singleStep)}function S(e,t){if(t=s(t),!Array.isArray(t)||!t.length||t.length>2)throw new Error("noUiSlider: 'start' option is incorrect.");e.handles=t.length,e.start=t}function k(e,t){if(e.snap=t,"boolean"!=typeof t)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function A(e,t){if(e.animate=t,"boolean"!=typeof t)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function T(e,t){if("lower"===t&&1===e.handles)e.connect=1;else if("upper"===t&&1===e.handles)e.connect=2;else if(t===!0&&2===e.handles)e.connect=3;else{if(t!==!1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");e.connect=0}}function M(e,t){switch(t){case"horizontal":e.ort=0;break;case"vertical":e.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function N(e,t){if(!r(t))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==t&&(e.margin=e.spectrum.getMargin(t),!e.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function I(e,t){if(!r(t))throw new Error("noUiSlider: 'limit' option must be numeric.");if(e.limit=e.spectrum.getMargin(t),!e.limit)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders.")}function D(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1,e.connect=[0,2,1,3][e.connect];break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function F(e,t){if("string"!=typeof t)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=t.indexOf("tap")>=0,r=t.indexOf("drag")>=0,i=t.indexOf("fixed")>=0,o=t.indexOf("snap")>=0,a=t.indexOf("hover")>=0;if(r&&!e.connect)throw new Error("noUiSlider: 'drag' behaviour must be used with 'connect': true.");e.events={tap:n||o,drag:r,fixed:i,snap:o,hover:a}}function L(e,t){var n;if(t!==!1)if(t===!0)for(e.tooltips=[],n=0;n<e.handles;n++)e.tooltips.push(!0);else{if(e.tooltips=s(t),e.tooltips.length!==e.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.tooltips.forEach(function(e){if("boolean"!=typeof e&&("object"!=typeof e||"function"!=typeof e.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function U(e,t){if(e.format=t,"function"==typeof t.to&&"function"==typeof t.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function H(e,t){if(void 0!==t&&"string"!=typeof t)throw new Error("noUiSlider: 'cssPrefix' must be a string.");e.cssPrefix=t}function B(e){var t,n={margin:0,limit:0,animate:!0,format:$};t={step:{r:!1,t:O},start:{r:!0,t:S},connect:{r:!0,t:T},direction:{r:!0,t:D},snap:{r:!1,t:k},animate:{r:!1,t:A},range:{r:!0,t:P},orientation:{r:!1,t:M},margin:{r:!1,t:N},limit:{r:!1,t:I},behaviour:{r:!0,t:F},format:{r:!1,t:U},tooltips:{r:!1,t:L},cssPrefix:{r:!1,t:H}};var r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"};return Object.keys(t).forEach(function(i){if(void 0===e[i]&&void 0===r[i]){if(t[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}t[i].t(n,void 0===e[i]?r[i]:e[i])}),n.pips=e.pips,n.style=n.ort?"top":"left",n}function q(t,r){function i(e,t,n){var r=e+t[0],i=e+t[1];return n?(0>r&&(i+=Math.abs(r)),i>100&&(r-=i-100),[a(r),a(i)]):[r,i]}function v(e,t){e.preventDefault();var n,r,i=0===e.type.indexOf("touch"),o=0===e.type.indexOf("mouse"),a=0===e.type.indexOf("pointer"),s=e;return 0===e.type.indexOf("MSPointer")&&(a=!0),i&&(n=e.changedTouches[0].pageX,r=e.changedTouches[0].pageY),t=t||p(),(o||a)&&(n=e.clientX+t.x,r=e.clientY+t.y),s.pageOffset=t,s.points=[n,r],s.cursor=o||a,s}function y(e,t){var n=document.createElement("div"),r=document.createElement("div"),i=["-lower","-upper"];return e&&i.reverse(),l(r,ie[3]),l(r,ie[3]+i[t]),l(n,ie[2]),n.appendChild(r),n}function g(e,t,n){switch(e){case 1:l(t,ie[7]),l(n[0],ie[6]);break;case 3:l(n[1],ie[6]);case 2:l(n[0],ie[7]);case 0:l(t,ie[6])}}function b(e,t,n){var r,i=[];for(r=0;e>r;r+=1)i.push(n.appendChild(y(t,r)));return i}function _(e,t,n){l(n,ie[0]),l(n,ie[8+e]),l(n,ie[4+t]);var r=document.createElement("div");return l(r,ie[1]),n.appendChild(r),r}function j(e,t){if(!r.tooltips[t])return!1;var n=document.createElement("div");return n.className=ie[18],e.firstChild.appendChild(n)}function w(){r.dir&&r.tooltips.reverse();var e=J.map(j);r.dir&&(e.reverse(),r.tooltips.reverse()),z("update",function(t,n,i){e[n]&&(e[n].innerHTML=r.tooltips[n]===!0?t[n]:r.tooltips[n].to(i[n]))})}function C(e,t,n){if("range"===e||"steps"===e)return te.xVal;if("count"===e){var r,i=100/(t-1),o=0;for(t=[];(r=o++*i)<=100;)t.push(r);e="positions"}return"positions"===e?t.map(function(e){return te.fromStepping(n?te.getStep(e):e)}):"values"===e?n?t.map(function(e){return te.fromStepping(te.getStep(te.toStepping(e)))}):t:void 0}function x(t,n,r){function i(e,t){return(e+t).toFixed(7)/1}var o=te.direction,a={},s=te.xVal[0],u=te.xVal[te.xVal.length-1],l=!1,c=!1,f=0;return te.direction=0,r=e(r.slice().sort(function(e,t){return e-t})),r[0]!==s&&(r.unshift(s),l=!0),r[r.length-1]!==u&&(r.push(u),c=!0),r.forEach(function(e,o){var s,u,p,d,h,m,v,y,g,b,_=e,j=r[o+1];if("steps"===n&&(s=te.xNumSteps[o]),s||(s=j-_),_!==!1&&void 0!==j)for(u=_;j>=u;u=i(u,s)){for(d=te.toStepping(u),h=d-f,y=h/t,g=Math.round(y),b=h/g,p=1;g>=p;p+=1)m=f+p*b,a[m.toFixed(5)]=["x",0];v=r.indexOf(u)>-1?1:"steps"===n?2:0,!o&&l&&(v=0),u===j&&c||(a[d.toFixed(5)]=[u,v]),f=d}}),te.direction=o,a}function E(e,t,n){function i(e){return["-normal","-large","-sub"][e]}function o(e,t,n){return'class="'+t+" "+t+"-"+s+" "+t+i(n[1])+'" style="'+r.style+": "+e+'%"'}function a(e,r){te.direction&&(e=100-e),r[1]=r[1]&&t?t(r[0],r[1]):r[1],c+="<div "+o(e,ie[21],r)+"></div>",r[1]&&(c+="<div "+o(e,ie[22],r)+">"+n.to(r[0])+"</div>")}var s=["horizontal","vertical"][r.ort],u=document.createElement("div"),c="";return l(u,ie[20]),l(u,ie[20]+"-"+s),Object.keys(e).forEach(function(t){a(t,e[t])}),u.innerHTML=c,u}function R(e){var t=e.mode,n=e.density||1,r=e.filter||!1,i=e.values||!1,o=e.stepped||!1,a=C(t,i,o),s=x(n,t,a),u=e.format||{to:Math.round};return Z.appendChild(E(s,r,u))}function O(){var e=Y.getBoundingClientRect(),t="offset"+["Width","Height"][r.ort];return 0===r.ort?e.width||Y[t]:e.height||Y[t]}function P(e,t,n){void 0!==t&&1!==r.handles&&(t=Math.abs(t-r.dir)),Object.keys(re).forEach(function(r){var i=r.split(".")[0];e===i&&re[r].forEach(function(e){e.call(X,s(q()),t,s(S(Array.prototype.slice.call(ne))),n||!1,ee)})})}function S(e){return 1===e.length?e[0]:r.dir?e.reverse():e}function k(e,t,n,i){var o=function(t){return Z.hasAttribute("disabled")?!1:f(Z,ie[14])?!1:(t=v(t,i.pageOffset),e===W.start&&void 0!==t.buttons&&t.buttons>1?!1:i.hover&&t.buttons?!1:(t.calcPoint=t.points[r.ort],void n(t,i)))},a=[];return e.split(" ").forEach(function(e){t.addEventListener(e,o,!1),a.push([e,o])}),a}function A(e,t){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===e.buttons&&0!==t.buttonsProperty)return T(e,t);var n,r,o=t.handles||J,a=!1,s=100*(e.calcPoint-t.start)/t.baseSize,u=o[0]===J[0]?0:1;if(n=i(s,t.positions,o.length>1),a=L(o[0],n[u],1===o.length),o.length>1){if(a=L(o[1],n[u?0:1],!1)||a)for(r=0;r<t.handles.length;r++)P("slide",r)}else a&&P("slide",u)}function T(e,t){var n=Y.querySelector("."+ie[15]),r=t.handles[0]===J[0]?0:1;null!==n&&c(n,ie[15]),e.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener));var i=document.documentElement;i.noUiListeners.forEach(function(e){i.removeEventListener(e[0],e[1])}),c(Z,ie[12]),P("set",r),P("change",r),void 0!==t.handleNumber&&P("end",t.handleNumber)}function M(e,t){"mouseout"===e.type&&"HTML"===e.target.nodeName&&null===e.relatedTarget&&T(e,t)}function N(e,t){var n=document.documentElement;if(1===t.handles.length&&(l(t.handles[0].children[0],ie[15]),t.handles[0].hasAttribute("disabled")))return!1;e.preventDefault(),e.stopPropagation();var r=k(W.move,n,A,{start:e.calcPoint,baseSize:O(),pageOffset:e.pageOffset,handles:t.handles,handleNumber:t.handleNumber,buttonsProperty:e.buttons,positions:[ee[0],ee[J.length-1]]}),i=k(W.end,n,T,{handles:t.handles,handleNumber:t.handleNumber}),o=k("mouseout",n,M,{handles:t.handles,handleNumber:t.handleNumber});if(n.noUiListeners=r.concat(i,o),e.cursor){document.body.style.cursor=getComputedStyle(e.target).cursor,J.length>1&&l(Z,ie[12]);var a=function(){return!1};document.body.noUiListener=a,document.body.addEventListener("selectstart",a,!1)}void 0!==t.handleNumber&&P("start",t.handleNumber)}function I(e){var t,i,a=e.calcPoint,s=0;return e.stopPropagation(),J.forEach(function(e){s+=n(e)[r.style]}),t=s/2>a||1===J.length?0:1,J[t].hasAttribute("disabled")&&(t=t?0:1),a-=n(Y)[r.style],i=100*a/O(),r.events.snap||o(Z,ie[14],300),J[t].hasAttribute("disabled")?!1:(L(J[t],i),P("slide",t,!0),P("set",t,!0),P("change",t,!0),void(r.events.snap&&N(e,{handles:[J[t]]})))}function D(e){var t=e.calcPoint-n(Y)[r.style],i=te.getStep(100*t/O()),o=te.fromStepping(i);Object.keys(re).forEach(function(e){"hover"===e.split(".")[0]&&re[e].forEach(function(e){e.call(X,o)})})}function F(e){var t,n;if(!e.fixed)for(t=0;t<J.length;t+=1)k(W.start,J[t].children[0],N,{handles:[J[t]],handleNumber:t});if(e.tap&&k(W.start,Y,I,{handles:J}),e.hover)for(k(W.move,Y,D,{hover:!0}),t=0;t<J.length;t+=1)["mousemove MSPointerMove pointermove"].forEach(function(e){J[t].children[0].addEventListener(e,d,!1)});e.drag&&(n=[Y.querySelector("."+ie[7])],l(n[0],ie[10]),e.fixed&&n.push(J[n[0]===J[0]?1:0].children[0]),n.forEach(function(e){k(W.start,e,N,{handles:J})}))}function L(e,t,n){var i=e!==J[0]?1:0,o=ee[0]+r.margin,s=ee[1]-r.margin,u=ee[0]+r.limit,f=ee[1]-r.limit;return J.length>1&&(t=i?Math.max(t,o):Math.min(t,s)),n!==!1&&r.limit&&J.length>1&&(t=i?Math.min(t,u):Math.max(t,f)),t=te.getStep(t),t=a(parseFloat(t.toFixed(7))),t===ee[i]?!1:(window.requestAnimationFrame?window.requestAnimationFrame(function(){e.style[r.style]=t+"%"}):e.style[r.style]=t+"%",e.previousSibling||(c(e,ie[17]),t>50&&l(e,ie[17])),ee[i]=t,ne[i]=te.fromStepping(t),P("update",i),!0)}function U(e,t){var n,i,o;for(r.limit&&(e+=1),n=0;e>n;n+=1)i=n%2,o=t[i],null!==o&&o!==!1&&("number"==typeof o&&(o=String(o)),o=r.format.from(o),(o===!1||isNaN(o)||L(J[i],te.toStepping(o),n===3-r.dir)===!1)&&P("update",i))}function H(e){var t,n,i=s(e);for(r.dir&&r.handles>1&&i.reverse(),r.animate&&-1!==ee[0]&&o(Z,ie[14],300),t=J.length>1?3:1,1===i.length&&(t=1),U(t,i),n=0;n<J.length;n++)null!==i[n]&&P("set",n)}function q(){var e,t=[];for(e=0;e<r.handles;e+=1)t[e]=r.format.to(ne[e]);return S(t)}function V(){for(ie.forEach(function(e){e&&c(Z,e)});Z.firstChild;)Z.removeChild(Z.firstChild);delete Z.noUiSlider}function $(){var e=ee.map(function(e,t){var n=te.getApplicableStep(e),r=u(String(n[2])),i=ne[t],o=100===e?null:n[2],a=Number((i-n[2]).toFixed(r)),s=0===e?null:a>=n[1]?n[2]:n[0]||!1;return[s,o]});return S(e)}function z(e,t){re[e]=re[e]||[],re[e].push(t),"update"===e.split(".")[0]&&J.forEach(function(e,t){P("update",t)})}function Q(e){var t=e.split(".")[0],n=e.substring(t.length);Object.keys(re).forEach(function(e){var r=e.split(".")[0],i=e.substring(r.length);t&&t!==r||n&&n!==i||delete re[e]})}function G(e){var t,n=q(),i=B({start:[0,0],margin:e.margin,limit:e.limit,step:e.step,range:e.range,animate:e.animate,snap:void 0===e.snap?r.snap:e.snap});for(["margin","limit","step","range","animate"].forEach(function(t){void 0!==e[t]&&(r[t]=e[t])}),i.spectrum.direction=te.direction,te=i.spectrum,ee=[-1,-1],H(n),t=0;t<J.length;t++)P("update",t)}m();var Y,J,X,Z=t,ee=[-1,-1],te=r.spectrum,ne=[],re={},ie=["target","base","origin","handle","horizontal","vertical","background","connect","ltr","rtl","draggable","","state-drag","","state-tap","active","","stacking","tooltip","","pips","marker","value"].map(h(r.cssPrefix||K));if(Z.noUiSlider)throw new Error("Slider was already initialized.");return Y=_(r.dir,r.ort,Z),J=b(r.handles,r.dir,Y),g(r.connect,Z,J),r.pips&&R(r.pips),r.tooltips&&w(),X={destroy:V,steps:$,on:z,off:Q,get:q,set:H,updateOptions:G,options:r,target:Z,pips:R},F(r.events),X}function V(e,t){if(!e.nodeName)throw new Error("noUiSlider.create requires a single element.");var n=B(t,e),r=q(e,n);return r.set(n.start),e.noUiSlider=r,r}var W,K="noUi-";R.prototype.getMargin=function(e){return 2===this.xPct.length?y(this.xVal,e):!1},R.prototype.toStepping=function(e){return e=j(this.xVal,this.xPct,e),this.direction&&(e=100-e),e},R.prototype.fromStepping=function(e){return this.direction&&(e=100-e),i(w(this.xVal,this.xPct,e))},R.prototype.getStep=function(e){return this.direction&&(e=100-e),e=C(this.xPct,this.xSteps,this.snap,e),this.direction&&(e=100-e),e},R.prototype.getApplicableStep=function(e){var t=_(e,this.xPct),n=100===e?2:1;return[this.xNumSteps[t-2],this.xVal[t-n],this.xNumSteps[t-n]]},R.prototype.convert=function(e){return this.getStep(this.toStepping(e))};var $={to:function(e){return void 0!==e&&e.toFixed(2)},from:Number};return{create:V}})},{}],673:[function(e,t,n){function r(){c=!1,s.length?l=s.concat(l):f=-1,l.length&&i()}function i(){if(!c){var e=setTimeout(r);c=!0;for(var t=l.length;t;){for(s=l,l=[];++f<t;)s&&s[f].run();f=-1,t=l.length}s=null,c=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function a(){}var s,u=t.exports={},l=[],c=!1,f=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new o(e,t)),1!==l.length||c||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=a,u.addListener=a,u.once=a,u.off=a,u.removeListener=a,u.removeAllListeners=a,u.emit=a,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],674:[function(e,t,n){var r=e("./stringify"),i=e("./parse");t.exports={stringify:r,parse:i}},{"./parse":675,"./stringify":676}],675:[function(e,t,n){var r=e("./utils"),i={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};i.parseValues=function(e,t){for(var n={},i=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),o=0,a=i.length;a>o;++o){var s=i[o],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="",t.strictNullHandling&&(n[r.decode(s)]=null);else{var l=r.decode(s.slice(0,u)),c=r.decode(s.slice(u+1));Object.prototype.hasOwnProperty.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}}return n},i.parseObject=function(e,t,n){if(!e.length)return t;var r,o=e.shift();if("[]"===o)r=[],r=r.concat(i.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var a="["===o[0]&&"]"===o[o.length-1]?o.slice(1,o.length-1):o,s=parseInt(a,10),u=""+s;!isNaN(s)&&o!==a&&u===a&&s>=0&&n.parseArrays&&s<=n.arrayLimit?(r=[],r[s]=i.parseObject(e,t,n)):r[a]=i.parseObject(e,t,n)}return r},i.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,o=/(\[[^\[\]]*\])/g,a=r.exec(e),s=[];if(a[1]){
if(!n.plainObjects&&Object.prototype.hasOwnProperty(a[1])&&!n.allowPrototypes)return;s.push(a[1])}for(var u=0;null!==(a=o.exec(e))&&u<n.depth;)++u,(n.plainObjects||!Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&s.push(a[1]);return a&&s.push("["+e.slice(a.index)+"]"),i.parseObject(s,t,n)}},t.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:i.delimiter,t.depth="number"==typeof t.depth?t.depth:i.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:i.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots="boolean"==typeof t.allowDots?t.allowDots:i.allowDots,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:i.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:i.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:i.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?i.parseValues(e,t):e,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),s=0,u=a.length;u>s;++s){var l=a[s],c=i.parseKeys(l,n[l],t);o=r.merge(o,c,t)}return r.compact(o)}},{"./utils":677}],676:[function(e,t,n){var r=e("./utils"),i={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1,skipNulls:!1,encode:!0};i.stringify=function(e,t,n,o,a,s,u,l){if("function"==typeof u)e=u(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(o)return s?r.encode(t):t;e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return s?[r.encode(t)+"="+r.encode(e)]:[t+"="+e];var c=[];if("undefined"==typeof e)return c;var f;if(Array.isArray(u))f=u;else{var p=Object.keys(e);f=l?p.sort(l):p}for(var d=0,h=f.length;h>d;++d){var m=f[d];a&&null===e[m]||(c=Array.isArray(e)?c.concat(i.stringify(e[m],n(t,m),n,o,a,s,u)):c.concat(i.stringify(e[m],t+"["+m+"]",n,o,a,s,u)))}return c},t.exports=function(e,t){t=t||{};var n,r,o="undefined"==typeof t.delimiter?i.delimiter:t.delimiter,a="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,s="boolean"==typeof t.skipNulls?t.skipNulls:i.skipNulls,u="boolean"==typeof t.encode?t.encode:i.encode,l="function"==typeof t.sort?t.sort:null;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var c=[];if("object"!=typeof e||null===e)return"";var f;f=t.arrayFormat in i.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var p=i.arrayPrefixGenerators[f];n||(n=Object.keys(e)),l&&n.sort(l);for(var d=0,h=n.length;h>d;++d){var m=n[d];s&&null===e[m]||(c=c.concat(i.stringify(e[m],m,p,a,s,u,r,l)))}return c.join(o)}},{"./utils":677}],677:[function(e,t,n){var r={};r.hexTable=new Array(256);for(var i=0;256>i;++i)r.hexTable[i]="%"+((16>i?"0":"")+i.toString(16)).toUpperCase();n.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,i=e.length;i>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},n.merge=function(e,t,r){if(!t)return e;if("object"!=typeof t)return Array.isArray(e)?e.push(t):"object"==typeof e?e[t]=!0:e=[e,t],e;if("object"!=typeof e)return e=[e].concat(t);Array.isArray(e)&&!Array.isArray(t)&&(e=n.arrayToObject(e,r));for(var i=Object.keys(t),o=0,a=i.length;a>o;++o){var s=i[o],u=t[s];Object.prototype.hasOwnProperty.call(e,s)?e[s]=n.merge(e[s],u,r):e[s]=u}return e},n.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},n.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",n=0,i=e.length;i>n;++n){var o=e.charCodeAt(n);45===o||46===o||95===o||126===o||o>=48&&57>=o||o>=65&&90>=o||o>=97&&122>=o?t+=e[n]:128>o?t+=r.hexTable[o]:2048>o?t+=r.hexTable[192|o>>6]+r.hexTable[128|63&o]:55296>o||o>=57344?t+=r.hexTable[224|o>>12]+r.hexTable[128|o>>6&63]+r.hexTable[128|63&o]:(++n,o=65536+((1023&o)<<10|1023&e.charCodeAt(n)),t+=r.hexTable[240|o>>18]+r.hexTable[128|o>>12&63]+r.hexTable[128|o>>6&63]+r.hexTable[128|63&o])}return t},n.compact=function(e,t){if("object"!=typeof e||null===e)return e;t=t||[];var r=t.indexOf(e);if(-1!==r)return t[r];if(t.push(e),Array.isArray(e)){for(var i=[],o=0,a=e.length;a>o;++o)"undefined"!=typeof e[o]&&i.push(e[o]);return i}var s=Object.keys(e);for(o=0,a=s.length;a>o;++o){var u=s[o];e[u]=n.compact(e[u],t)}return e},n.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},n.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},{}],678:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;l>c;++c){var f,p,d,h,m=e[c].replace(s,"%20"),v=m.indexOf(n);v>=0?(f=m.substr(0,v),p=m.substr(v+1)):(f=m,p=""),d=decodeURIComponent(f),h=decodeURIComponent(p),r(a,d)?i(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],679:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(a(e),function(a){var s=encodeURIComponent(i(a))+n;return o(e[a])?r(e[a],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],680:[function(e,t,n){"use strict";n.decode=n.parse=e("./decode"),n.encode=n.stringify=e("./encode")},{"./decode":678,"./encode":679}],681:[function(e,t,n){"use strict";t.exports=e("react/lib/ReactDOM")},{"react/lib/ReactDOM":717}],682:[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("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=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},s=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}}(),u=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},l=e("react"),c=r(l),f=e("nouislider-algolia-fork"),p=r(f),d=function(e){function t(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"componentDidMount",value:function(){this.props.disabled?this.sliderContainer.setAttribute("disabled",!0):this.sliderContainer.removeAttribute("disabled"),this.createSlider()}},{key:"componentDidUpdate",value:function(){this.props.disabled?this.sliderContainer.setAttribute("disabled",!0):this.sliderContainer.removeAttribute("disabled"),this.slider.destroy(),this.createSlider()}},{key:"componentWillUnmount",value:function(){this.slider.destroy()}},{key:"createSlider",value:function(){var e=this.slider=p["default"].create(this.sliderContainer,a({},this.props));this.props.onUpdate&&e.on("update",this.props.onUpdate),this.props.onChange&&e.on("change",this.props.onChange),this.props.onSlide&&e.on("slide",this.props.onSlide)}},{key:"render",value:function(){var e=this;return c["default"].createElement("div",{ref:function(t){e.sliderContainer=t}})}}]),t}(c["default"].Component);d.propTypes={animate:c["default"].PropTypes.bool,behaviour:c["default"].PropTypes.string,connect:c["default"].PropTypes.oneOfType([c["default"].PropTypes.oneOf(["lower","upper"]),c["default"].PropTypes.bool]),cssPrefix:c["default"].PropTypes.string,direction:c["default"].PropTypes.oneOf(["ltr","rtl"]),disabled:c["default"].PropTypes.bool,limit:c["default"].PropTypes.number,margin:c["default"].PropTypes.number,onChange:c["default"].PropTypes.func,onSlide:c["default"].PropTypes.func,onUpdate:c["default"].PropTypes.func,orientation:c["default"].PropTypes.oneOf(["horizontal","vertical"]),pips:c["default"].PropTypes.object,range:c["default"].PropTypes.object.isRequired,start:c["default"].PropTypes.arrayOf(c["default"].PropTypes.number).isRequired,step:c["default"].PropTypes.number,tooltips:c["default"].PropTypes.oneOfType([c["default"].PropTypes.bool,c["default"].PropTypes.arrayOf(c["default"].PropTypes.shape({to:c["default"].PropTypes.func}))])},t.exports=d},{"nouislider-algolia-fork":672,react:811}],683:[function(e,t,n){"use strict";var r=e("./ReactMount"),i=e("./findDOMNode"),o=e("fbjs/lib/focusNode"),a={componentDidMount:function(){this.props.autoFocus&&o(i(this))}},s={Mixin:a,focusDOMComponent:function(){o(r.getNode(this._rootNodeID))}};t.exports=s},{"./ReactMount":747,"./findDOMNode":790,"fbjs/lib/focusNode":305}],684:[function(e,t,n){"use strict";function r(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function i(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function o(e){switch(e){case P.topCompositionStart:return S.compositionStart;case P.topCompositionEnd:return S.compositionEnd;case P.topCompositionUpdate:return S.compositionUpdate}}function a(e,t){return e===P.topKeyDown&&t.keyCode===j}function s(e,t){switch(e){case P.topKeyUp:return-1!==_.indexOf(t.keyCode);case P.topKeyDown:return t.keyCode!==j;case P.topKeyPress:case P.topMouseDown:case P.topBlur:return!0;default:return!1}}function u(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function l(e,t,n,r,i){var l,c;if(w?l=o(e):A?s(e,r)&&(l=S.compositionEnd):a(e,r)&&(l=S.compositionStart),!l)return null;E&&(A||l!==S.compositionStart?l===S.compositionEnd&&A&&(c=A.getData()):A=v.getPooled(t));var f=y.getPooled(l,n,r,i);if(c)f.data=c;else{var p=u(r);null!==p&&(f.data=p)}return h.accumulateTwoPhaseDispatches(f),f}function c(e,t){switch(e){case P.topCompositionEnd:return u(t);case P.topKeyPress:var n=t.which;return n!==R?null:(k=!0,O);case P.topTextInput:var r=t.data;return r===O&&k?null:r;default:return null}}function f(e,t){if(A){if(e===P.topCompositionEnd||s(e,t)){var n=A.getData();return v.release(A),A=null,n}return null}switch(e){case P.topPaste:return null;case P.topKeyPress:return t.which&&!i(t)?String.fromCharCode(t.which):null;case P.topCompositionEnd:return E?null:t.data;default:return null}}function p(e,t,n,r,i){var o;if(o=x?c(e,r):f(e,r),!o)return null;var a=g.getPooled(S.beforeInput,n,r,i);return a.data=o,h.accumulateTwoPhaseDispatches(a),a}var d=e("./EventConstants"),h=e("./EventPropagators"),m=e("fbjs/lib/ExecutionEnvironment"),v=e("./FallbackCompositionState"),y=e("./SyntheticCompositionEvent"),g=e("./SyntheticInputEvent"),b=e("fbjs/lib/keyOf"),_=[9,13,27,32],j=229,w=m.canUseDOM&&"CompositionEvent"in window,C=null;m.canUseDOM&&"documentMode"in document&&(C=document.documentMode);var x=m.canUseDOM&&"TextEvent"in window&&!C&&!r(),E=m.canUseDOM&&(!w||C&&C>8&&11>=C),R=32,O=String.fromCharCode(R),P=d.topLevelTypes,S={beforeInput:{phasedRegistrationNames:{bubbled:b({onBeforeInput:null}),captured:b({onBeforeInputCapture:null})},dependencies:[P.topCompositionEnd,P.topKeyPress,P.topTextInput,P.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:b({onCompositionEnd:null}),captured:b({onCompositionEndCapture:null})},dependencies:[P.topBlur,P.topCompositionEnd,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:b({onCompositionStart:null}),captured:b({onCompositionStartCapture:null})},dependencies:[P.topBlur,P.topCompositionStart,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:b({onCompositionUpdate:null}),captured:b({onCompositionUpdateCapture:null})},dependencies:[P.topBlur,P.topCompositionUpdate,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]}},k=!1,A=null,T={eventTypes:S,extractEvents:function(e,t,n,r,i){return[l(e,t,n,r,i),p(e,t,n,r,i)]}};t.exports=T},{"./EventConstants":696,"./EventPropagators":700,"./FallbackCompositionState":701,"./SyntheticCompositionEvent":772,"./SyntheticInputEvent":776,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/keyOf":315}],685:[function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var i={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},o=["Webkit","ms","Moz","O"];Object.keys(i).forEach(function(e){o.forEach(function(t){i[r(t,e)]=i[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:i,shorthandPropertyExpansions:a};t.exports=s},{}],686:[function(e,t,n){"use strict";var r=e("./CSSProperty"),i=e("fbjs/lib/ExecutionEnvironment"),o=e("./ReactPerf"),a=(e("fbjs/lib/camelizeStyleName"),e("./dangerousStyleValue")),s=e("fbjs/lib/hyphenateStyleName"),u=e("fbjs/lib/memoizeStringOnly"),l=(e("fbjs/lib/warning"),u(function(e){return s(e)})),c=!1,f="cssFloat";if(i.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(d){c=!0}void 0===document.documentElement.style.cssFloat&&(f="styleFloat")}var h={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=l(n)+":",t+=a(n,r)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var i in t)if(t.hasOwnProperty(i)){var o=a(i,t[i]);if("float"===i&&(i=f),o)n[i]=o;else{var s=c&&r.shorthandPropertyExpansions[i];if(s)for(var u in s)n[u]="";else n[i]=""}}}};o.measureMethods(h,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),t.exports=h},{"./CSSProperty":685,"./ReactPerf":753,"./dangerousStyleValue":787,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/camelizeStyleName":299,"fbjs/lib/hyphenateStyleName":310,"fbjs/lib/memoizeStringOnly":317,"fbjs/lib/warning":322}],687:[function(e,t,n){"use strict";function r(){this._callbacks=null,this._contexts=null}var i=e("./PooledClass"),o=e("./Object.assign"),a=e("fbjs/lib/invariant");o(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?a(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n<e.length;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),i.addPoolingTo(r),t.exports=r},{"./Object.assign":704,"./PooledClass":705,"fbjs/lib/invariant":311}],688:[function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function i(e){var t=C.getPooled(S.change,A,e,x(e));_.accumulateTwoPhaseDispatches(t),w.batchedUpdates(o,t)}function o(e){b.enqueueEvents(e),b.processEventQueue(!1)}function a(e,t){k=e,A=t,k.attachEvent("onchange",i)}function s(){k&&(k.detachEvent("onchange",i),k=null,A=null)}function u(e,t,n){return e===P.topChange?n:void 0}function l(e,t,n){e===P.topFocus?(s(),a(t,n)):e===P.topBlur&&s()}function c(e,t){k=e,A=t,T=e.value,M=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(k,"value",D),k.attachEvent("onpropertychange",p)}function f(){k&&(delete k.value,k.detachEvent("onpropertychange",p),k=null,A=null,T=null,M=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==T&&(T=t,i(e))}}function d(e,t,n){return e===P.topInput?n:void 0}function h(e,t,n){e===P.topFocus?(f(),c(t,n)):e===P.topBlur&&f()}function m(e,t,n){return e!==P.topSelectionChange&&e!==P.topKeyUp&&e!==P.topKeyDown||!k||k.value===T?void 0:(T=k.value,A)}function v(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){return e===P.topClick?n:void 0}var g=e("./EventConstants"),b=e("./EventPluginHub"),_=e("./EventPropagators"),j=e("fbjs/lib/ExecutionEnvironment"),w=e("./ReactUpdates"),C=e("./SyntheticEvent"),x=e("./getEventTarget"),E=e("./isEventSupported"),R=e("./isTextInputElement"),O=e("fbjs/lib/keyOf"),P=g.topLevelTypes,S={change:{phasedRegistrationNames:{bubbled:O({onChange:null}),captured:O({onChangeCapture:null})},dependencies:[P.topBlur,P.topChange,P.topClick,P.topFocus,P.topInput,P.topKeyDown,P.topKeyUp,P.topSelectionChange]}},k=null,A=null,T=null,M=null,N=!1;j.canUseDOM&&(N=E("change")&&(!("documentMode"in document)||document.documentMode>8));var I=!1;j.canUseDOM&&(I=E("input")&&(!("documentMode"in document)||document.documentMode>9));var D={get:function(){return M.get.call(this)},set:function(e){T=""+e,M.set.call(this,e)}},F={eventTypes:S,extractEvents:function(e,t,n,i,o){var a,s;if(r(t)?N?a=u:s=l:R(t)?I?a=d:(a=m,s=h):v(t)&&(a=y),a){var c=a(e,t,n);if(c){var f=C.getPooled(S.change,c,i,o);return f.type="change",_.accumulateTwoPhaseDispatches(f),f}}s&&s(e,t,n)}};t.exports=F},{"./EventConstants":696,"./EventPluginHub":697,"./EventPropagators":700,"./ReactUpdates":765,"./SyntheticEvent":774,"./getEventTarget":796,"./isEventSupported":801,"./isTextInputElement":802,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/keyOf":315}],689:[function(e,t,n){"use strict";var r=0,i={createReactRootIndex:function(){return r++}};t.exports=i},{}],690:[function(e,t,n){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var i=e("./Danger"),o=e("./ReactMultiChildUpdateTypes"),a=e("./ReactPerf"),s=e("./setInnerHTML"),u=e("./setTextContent"),l=e("fbjs/lib/invariant"),c={dangerouslyReplaceNodeWithMarkup:i.dangerouslyReplaceNodeWithMarkup,updateTextContent:u,processUpdates:function(e,t){for(var n,a=null,c=null,f=0;f<e.length;f++)if(n=e[f],n.type===o.MOVE_EXISTING||n.type===o.REMOVE_NODE){var p=n.fromIndex,d=n.parentNode.childNodes[p],h=n.parentID;d?void 0:l(!1),a=a||{},a[h]=a[h]||[],a[h][p]=d,c=c||[],c.push(d)}var m;if(m=t.length&&"string"==typeof t[0]?i.dangerouslyRenderMarkup(t):t,c)for(var v=0;v<c.length;v++)c[v].parentNode.removeChild(c[v]);for(var y=0;y<e.length;y++)switch(n=e[y],n.type){case o.INSERT_MARKUP:r(n.parentNode,m[n.markupIndex],n.toIndex);break;case o.MOVE_EXISTING:r(n.parentNode,a[n.parentID][n.fromIndex],n.toIndex);break;case o.SET_MARKUP:s(n.parentNode,n.content);break;case o.TEXT_CONTENT:u(n.parentNode,n.content);break;case o.REMOVE_NODE:}}};a.measureMethods(c,"DOMChildrenOperations",{updateTextContent:"updateTextContent"}),t.exports=c},{"./Danger":693,"./ReactMultiChildUpdateTypes":749,"./ReactPerf":753,"./setInnerHTML":806,"./setTextContent":807,"fbjs/lib/invariant":311}],691:[function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var i=e("fbjs/lib/invariant"),o={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var f in n){s.properties.hasOwnProperty(f)?i(!1):void 0;var p=f.toLowerCase(),d=n[f],h={attributeName:p,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseAttribute:r(d,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(d,t.MUST_USE_PROPERTY),hasSideEffects:r(d,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(d,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(d,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(d,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(d,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty?i(!1):void 0,!h.mustUseProperty&&h.hasSideEffects?i(!1):void 0,h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1?void 0:i(!1),u.hasOwnProperty(f)){var m=u[f];h.attributeName=m}a.hasOwnProperty(f)&&(h.attributeNamespace=a[f]),l.hasOwnProperty(f)&&(h.propertyName=l[f]),c.hasOwnProperty(f)&&(h.mutationMethod=c[f]),s.properties[f]=h}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){var n=s._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=a[e];return r||(a[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:o};t.exports=s},{"fbjs/lib/invariant":311}],692:[function(e,t,n){"use strict";function r(e){return c.hasOwnProperty(e)?!0:l.hasOwnProperty(e)?!1:u.test(e)?(c[e]=!0,!0):(l[e]=!0,!1)}function i(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&1>t||e.hasOverloadedBooleanValue&&t===!1}var o=e("./DOMProperty"),a=e("./ReactPerf"),s=e("./quoteAttributeValueForBrowser"),u=(e("fbjs/lib/warning"),/^[a-zA-Z_][\w\.\-]*$/),l={},c={},f={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(i(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+s(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else if(i(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var l=r.propertyName;r.hasSideEffects&&""+e[l]==""+n||(e[l]=n)}}else o.isCustomAttribute(t)&&f.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var i=n.propertyName,a=o.getDefaultValueForProperty(e.nodeName,i);n.hasSideEffects&&""+e[i]===a||(e[i]=a)}}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};a.measureMethods(f,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),t.exports=f},{"./DOMProperty":691,"./ReactPerf":753,"./quoteAttributeValueForBrowser":804,"fbjs/lib/warning":322}],693:[function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var i=e("fbjs/lib/ExecutionEnvironment"),o=e("fbjs/lib/createNodesFromMarkup"),a=e("fbjs/lib/emptyFunction"),s=e("fbjs/lib/getMarkupWrap"),u=e("fbjs/lib/invariant"),l=/^(<[^ \/>]+)/,c="data-danger-index",f={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:u(!1);for(var t,n={},f=0;f<e.length;f++)e[f]?void 0:u(!1),t=r(e[f]),t=s(t)?t:"*",n[t]=n[t]||[],n[t][f]=e[f];var p=[],d=0;for(t in n)if(n.hasOwnProperty(t)){var h,m=n[t];for(h in m)if(m.hasOwnProperty(h)){var v=m[h];m[h]=v.replace(l,"$1 "+c+'="'+h+'" ')}for(var y=o(m.join(""),a),g=0;g<y.length;++g){var b=y[g];b.hasAttribute&&b.hasAttribute(c)&&(h=+b.getAttribute(c),b.removeAttribute(c),p.hasOwnProperty(h)?u(!1):void 0,p[h]=b,d+=1)}}return d!==p.length?u(!1):void 0,p.length!==e.length?u(!1):void 0,p},dangerouslyReplaceNodeWithMarkup:function(e,t){i.canUseDOM?void 0:u(!1),t?void 0:u(!1),"html"===e.tagName.toLowerCase()?u(!1):void 0;var n;n="string"==typeof t?o(t,a)[0]:t,e.parentNode.replaceChild(n,e)}};t.exports=f},{"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/createNodesFromMarkup":302,"fbjs/lib/emptyFunction":303,"fbjs/lib/getMarkupWrap":307,"fbjs/lib/invariant":311}],694:[function(e,t,n){"use strict";var r=e("fbjs/lib/keyOf"),i=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null})];t.exports=i},{"fbjs/lib/keyOf":315}],695:[function(e,t,n){"use strict";var r=e("./EventConstants"),i=e("./EventPropagators"),o=e("./SyntheticMouseEvent"),a=e("./ReactMount"),s=e("fbjs/lib/keyOf"),u=r.topLevelTypes,l=a.getFirstReactDOM,c={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[u.topMouseOut,u.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[u.topMouseOut,u.topMouseOver]}},f=[null,null],p={eventTypes:c,extractEvents:function(e,t,n,r,s){if(e===u.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==u.topMouseOut&&e!==u.topMouseOver)return null;var p;if(t.window===t)p=t;else{var d=t.ownerDocument;p=d?d.defaultView||d.parentWindow:window}var h,m,v="",y="";if(e===u.topMouseOut?(h=t,v=n,m=l(r.relatedTarget||r.toElement),m?y=a.getID(m):m=p,m=m||p):(h=p,m=t,y=n),h===m)return null;var g=o.getPooled(c.mouseLeave,v,r,s);g.type="mouseleave",g.target=h,g.relatedTarget=m;var b=o.getPooled(c.mouseEnter,y,r,s);return b.type="mouseenter",b.target=m,b.relatedTarget=h,i.accumulateEnterLeaveDispatches(g,b,v,y),f[0]=g,f[1]=b,f}};t.exports=p},{"./EventConstants":696,"./EventPropagators":700,"./ReactMount":747,"./SyntheticMouseEvent":778,"fbjs/lib/keyOf":315}],696:[function(e,t,n){"use strict";var r=e("fbjs/lib/keyMirror"),i=r({bubbled:null,captured:null}),o=r({topAbort:null,topBlur:null,topCanPlay:null,topCanPlayThrough:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topDurationChange:null,topEmptied:null,topEncrypted:null,topEnded:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topLoadedData:null,topLoadedMetadata:null,topLoadStart:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topPause:null,topPlay:null,topPlaying:null,topProgress:null,topRateChange:null,topReset:null,topScroll:null,topSeeked:null,topSeeking:null,topSelectionChange:null,topStalled:null,topSubmit:null,topSuspend:null,topTextInput:null,topTimeUpdate:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topVolumeChange:null,topWaiting:null,topWheel:null}),a={topLevelTypes:o,PropagationPhases:i};t.exports=a},{"fbjs/lib/keyMirror":314}],697:[function(e,t,n){"use strict";var r=e("./EventPluginRegistry"),i=e("./EventPluginUtils"),o=e("./ReactErrorUtils"),a=e("./accumulateInto"),s=e("./forEachAccumulated"),u=e("fbjs/lib/invariant"),l=(e("fbjs/lib/warning"),{}),c=null,f=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},p=function(e){return f(e,!0)},d=function(e){return f(e,!1)},h=null,m={injection:{injectMount:i.injection.injectMount,injectInstanceHandle:function(e){h=e},getInstanceHandle:function(){return h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?u(!1):void 0;var i=l[t]||(l[t]={});i[e]=n;var o=r.registrationNameModules[t];o&&o.didPutListener&&o.didPutListener(e,t,n)},getListener:function(e,t){var n=l[t];return n&&n[e]},deleteListener:function(e,t){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var i=l[t];i&&delete i[e]},deleteAllListeners:function(e){for(var t in l)if(l[t][e]){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t),delete l[t][e]}},extractEvents:function(e,t,n,i,o){for(var s,u=r.plugins,l=0;l<u.length;l++){var c=u[l];if(c){var f=c.extractEvents(e,t,n,i,o);f&&(s=a(s,f))}}return s},enqueueEvents:function(e){e&&(c=a(c,e))},processEventQueue:function(e){var t=c;c=null,e?s(t,p):s(t,d),c?u(!1):void 0,o.rethrowCaughtError()},__purge:function(){l={}},__getListenerBank:function(){return l}};t.exports=m},{"./EventPluginRegistry":698,"./EventPluginUtils":699,"./ReactErrorUtils":738,"./accumulateInto":784,"./forEachAccumulated":792,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],698:[function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(n>-1?void 0:a(!1),!l.plugins[n]){t.extractEvents?void 0:a(!1),l.plugins[n]=t;var r=t.eventTypes;for(var o in r)i(r[o],t,o)?void 0:a(!1)}}}function i(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){l.registrationNameModules[e]?a(!1):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e("fbjs/lib/invariant"),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];u.hasOwnProperty(n)&&u[n]===i||(u[n]?a(!1):void 0,u[n]=i,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){
s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};t.exports=l},{"fbjs/lib/invariant":311}],699:[function(e,t,n){"use strict";function r(e){return e===v.topMouseUp||e===v.topTouchEnd||e===v.topTouchCancel}function i(e){return e===v.topMouseMove||e===v.topTouchMove}function o(e){return e===v.topMouseDown||e===v.topTouchStart}function a(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=m.Mount.getNode(r),t?d.invokeGuardedCallbackWithCatch(i,n,e,r):d.invokeGuardedCallback(i,n,e,r),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var i=0;i<n.length&&!e.isPropagationStopped();i++)a(e,t,n[i],r[i]);else n&&a(e,t,n,r);e._dispatchListeners=null,e._dispatchIDs=null}function u(e){var t=e._dispatchListeners,n=e._dispatchIDs;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function l(e){var t=u(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function c(e){var t=e._dispatchListeners,n=e._dispatchIDs;Array.isArray(t)?h(!1):void 0;var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function f(e){return!!e._dispatchListeners}var p=e("./EventConstants"),d=e("./ReactErrorUtils"),h=e("fbjs/lib/invariant"),m=(e("fbjs/lib/warning"),{Mount:null,injectMount:function(e){m.Mount=e}}),v=p.topLevelTypes,y={isEndish:r,isMoveish:i,isStartish:o,executeDirectDispatch:c,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:l,hasDispatches:f,getNode:function(e){return m.Mount.getNode(e)},getID:function(e){return m.Mount.getID(e)},injection:m};t.exports=y},{"./EventConstants":696,"./ReactErrorUtils":738,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],700:[function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function i(e,t,n){var i=t?y.bubbled:y.captured,o=r(e,n,i);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchIDs=m(n._dispatchIDs,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,i,e)}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&h.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,i,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,i=g(e,r);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchIDs=m(n._dispatchIDs,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function l(e){v(e,o)}function c(e){v(e,a)}function f(e,t,n,r){h.injection.getInstanceHandle().traverseEnterLeave(n,r,s,e,t)}function p(e){v(e,u)}var d=e("./EventConstants"),h=e("./EventPluginHub"),m=(e("fbjs/lib/warning"),e("./accumulateInto")),v=e("./forEachAccumulated"),y=d.PropagationPhases,g=h.getListener,b={accumulateTwoPhaseDispatches:l,accumulateTwoPhaseDispatchesSkipTarget:c,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:f};t.exports=b},{"./EventConstants":696,"./EventPluginHub":697,"./accumulateInto":784,"./forEachAccumulated":792,"fbjs/lib/warning":322}],701:[function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var i=e("./PooledClass"),o=e("./Object.assign"),a=e("./getTextContentAccessor");o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,i=this.getText(),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++);var s=t>1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),i.addPoolingTo(r),t.exports=r},{"./Object.assign":704,"./PooledClass":705,"./getTextContentAccessor":799}],702:[function(e,t,n){"use strict";var r,i=e("./DOMProperty"),o=e("fbjs/lib/ExecutionEnvironment"),a=i.injection.MUST_USE_ATTRIBUTE,s=i.injection.MUST_USE_PROPERTY,u=i.injection.HAS_BOOLEAN_VALUE,l=i.injection.HAS_SIDE_EFFECTS,c=i.injection.HAS_NUMERIC_VALUE,f=i.injection.HAS_POSITIVE_NUMERIC_VALUE,p=i.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var d=document.implementation;r=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,capture:a|u,cellPadding:null,cellSpacing:null,charSet:a,challenge:a,checked:s|u,classID:a,className:r?a:s,cols:a|f,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,"default":u,defer:u,dir:null,disabled:a|u,download:p,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:a,integrity:null,is:a,keyParams:a,keyType:a,kind:null,label:null,lang:null,list:a,loop:s|u,low:null,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,minLength:a,multiple:s|u,muted:s|u,name:null,nonce:a,noValidate:u,open:u,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,reversed:u,role:a,rows:a|f,rowSpan:null,sandbox:null,scope:null,scoped:u,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|f,sizes:a,span:f,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:a,start:c,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|l,width:a,wmode:a,wrap:null,about:a,datatype:a,inlist:a,prefix:a,property:a,resource:a,"typeof":a,vocab:a,autoCapitalize:a,autoCorrect:a,autoSave:null,color:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,results:null,security:a,unselectable:a},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=h},{"./DOMProperty":691,"fbjs/lib/ExecutionEnvironment":297}],703:[function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?l(!1):void 0}function i(e){r(e),null!=e.value||null!=e.onChange?l(!1):void 0}function o(e){r(e),null!=e.checked||null!=e.onChange?l(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e("./ReactPropTypes"),u=e("./ReactPropTypeLocations"),l=e("fbjs/lib/invariant"),c=(e("fbjs/lib/warning"),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),f={value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},p={},d={checkPropTypes:function(e,t,n){for(var r in f){if(f.hasOwnProperty(r))var i=f[r](t,r,e,u.prop);if(i instanceof Error&&!(i.message in p)){p[i.message]=!0;a(n)}}},getValue:function(e){return e.valueLink?(i(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(o(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(i(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(o(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=d},{"./ReactPropTypeLocations":755,"./ReactPropTypes":756,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],704:[function(e,t,n){"use strict";function r(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),r=Object.prototype.hasOwnProperty,i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o){var a=Object(o);for(var s in a)r.call(a,s)&&(n[s]=a[s])}}return n}t.exports=r},{}],705:[function(e,t,n){"use strict";var r=e("fbjs/lib/invariant"),i=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e,t,n,r,i){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r,i),a}return new o(e,t,n,r,i)},l=function(e){var t=this;e instanceof t?void 0:r(!1),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},c=10,f=i,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||f,n.poolSize||(n.poolSize=c),n.release=l,n},d={addPoolingTo:p,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:a,fourArgumentPooler:s,fiveArgumentPooler:u};t.exports=d},{"fbjs/lib/invariant":311}],706:[function(e,t,n){"use strict";var r=e("./ReactDOM"),i=e("./ReactDOMServer"),o=e("./ReactIsomorphic"),a=e("./Object.assign"),s=e("./deprecated"),u={};a(u,o),a(u,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",i,i.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",i,i.renderToStaticMarkup)}),u.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,u.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i,t.exports=u},{"./Object.assign":704,"./ReactDOM":717,"./ReactDOMServer":727,"./ReactIsomorphic":745,"./deprecated":788}],707:[function(e,t,n){"use strict";var r=(e("./ReactInstanceMap"),e("./findDOMNode")),i=(e("fbjs/lib/warning"),"_getDOMNodeDidWarn"),o={getDOMNode:function(){return this.constructor[i]=!0,r(this)}};t.exports=o},{"./ReactInstanceMap":744,"./findDOMNode":790,"fbjs/lib/warning":322}],708:[function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,v)||(e[v]=h++,p[e[v]]={}),p[e[v]]}var i=e("./EventConstants"),o=e("./EventPluginHub"),a=e("./EventPluginRegistry"),s=e("./ReactEventEmitterMixin"),u=e("./ReactPerf"),l=e("./ViewportMetrics"),c=e("./Object.assign"),f=e("./isEventSupported"),p={},d=!1,h=0,m={topAbort:"abort",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",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",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",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},v="_reactListenersID"+String(Math.random()).slice(2),y=c({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(y.handleTopLevel),y.ReactEventListener=e}},setEnabled:function(e){y.ReactEventListener&&y.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!y.ReactEventListener||!y.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,o=r(n),s=a.registrationNameDependencies[e],u=i.topLevelTypes,l=0;l<s.length;l++){var c=s[l];o.hasOwnProperty(c)&&o[c]||(c===u.topWheel?f("wheel")?y.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",n):f("mousewheel")?y.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",n):y.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",n):c===u.topScroll?f("scroll",!0)?y.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",n):y.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",y.ReactEventListener.WINDOW_HANDLE):c===u.topFocus||c===u.topBlur?(f("focus",!0)?(y.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",n),y.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",n)):f("focusin")&&(y.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",n),y.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",n)),o[u.topBlur]=!0,o[u.topFocus]=!0):m.hasOwnProperty(c)&&y.ReactEventListener.trapBubbledEvent(c,m[c],n),o[c]=!0)}},trapBubbledEvent:function(e,t,n){return y.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return y.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=l.refreshScrollValues;y.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});u.measureMethods(y,"ReactBrowserEventEmitter",{putListener:"putListener",deleteListener:"deleteListener"}),t.exports=y},{"./EventConstants":696,"./EventPluginHub":697,"./EventPluginRegistry":698,"./Object.assign":704,"./ReactEventEmitterMixin":739,"./ReactPerf":753,"./ViewportMetrics":783,"./isEventSupported":801}],709:[function(e,t,n){"use strict";function r(e,t,n){var r=void 0===e[n];null!=t&&r&&(e[n]=o(t,null))}var i=e("./ReactReconciler"),o=e("./instantiateReactComponent"),a=e("./shouldUpdateReactComponent"),s=e("./traverseAllChildren"),u=(e("fbjs/lib/warning"),{instantiateChildren:function(e,t,n){if(null==e)return null;var i={};return s(e,r,i),i},updateChildren:function(e,t,n,r){if(!t&&!e)return null;var s;for(s in t)if(t.hasOwnProperty(s)){var u=e&&e[s],l=u&&u._currentElement,c=t[s];if(null!=u&&a(l,c))i.receiveComponent(u,c,n,r),t[s]=u;else{u&&i.unmountComponent(u,s);var f=o(c,null);t[s]=f}}for(s in e)!e.hasOwnProperty(s)||t&&t.hasOwnProperty(s)||i.unmountComponent(e[s]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];i.unmountComponent(n)}}});t.exports=u},{"./ReactReconciler":758,"./instantiateReactComponent":800,"./shouldUpdateReactComponent":808,"./traverseAllChildren":809,"fbjs/lib/warning":322}],710:[function(e,t,n){"use strict";function r(e){return(""+e).replace(_,"//")}function i(e,t){this.func=e,this.context=t,this.count=0}function o(e,t,n){var r=e.func,i=e.context;r.call(i,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=i.getPooled(t,n);y(e,o,r),i.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var i=e.result,o=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?l(u,i,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(u!==t?r(u.key||"")+"/":"")+n)),i.push(u))}function l(e,t,n,i,o){var a="";null!=n&&(a=r(n)+"/");var l=s.getPooled(t,a,i,o);y(e,u,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function f(e,t,n){return null}function p(e,t){return y(e,f,null)}function d(e){var t=[];return l(e,t,null,v.thatReturnsArgument),t}var h=e("./PooledClass"),m=e("./ReactElement"),v=e("fbjs/lib/emptyFunction"),y=e("./traverseAllChildren"),g=h.twoArgumentPooler,b=h.fourArgumentPooler,_=/\/(?!\/)/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(i,g),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var j={forEach:a,map:c,mapIntoWithKeyPrefixInternal:l,count:p,toArray:d};t.exports=j},{"./PooledClass":705,"./ReactElement":734,"./traverseAllChildren":809,"fbjs/lib/emptyFunction":303}],711:[function(e,t,n){"use strict";function r(e,t){var n=w.hasOwnProperty(t)?w[t]:null;x.hasOwnProperty(t)&&(n!==_.OVERRIDE_BASE?v(!1):void 0),e.hasOwnProperty(t)&&(n!==_.DEFINE_MANY&&n!==_.DEFINE_MANY_MERGED?v(!1):void 0)}function i(e,t){if(t){"function"==typeof t?v(!1):void 0,p.isValidElement(t)?v(!1):void 0;var n=e.prototype;t.hasOwnProperty(b)&&C.mixins(e,t.mixins);for(var i in t)if(t.hasOwnProperty(i)&&i!==b){var o=t[i];if(r(n,i),C.hasOwnProperty(i))C[i](e,o);else{var a=w.hasOwnProperty(i),l=n.hasOwnProperty(i),c="function"==typeof o,f=c&&!a&&!l&&t.autobind!==!1;if(f)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[i]=o,n[i]=o;else if(l){var d=w[i];!a||d!==_.DEFINE_MANY_MERGED&&d!==_.DEFINE_MANY?v(!1):void 0,d===_.DEFINE_MANY_MERGED?n[i]=s(n[i],o):d===_.DEFINE_MANY&&(n[i]=u(n[i],o))}else n[i]=o}}}}function o(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var i=n in C;i?v(!1):void 0;var o=n in e;o?v(!1):void 0,e[n]=r}}}function a(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:v(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?v(!1):void 0,e[n]=t[n]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return a(i,n),a(i,r),i}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,t){var n=t.bind(e);return n}function c(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,n)}}var f=e("./ReactComponent"),p=e("./ReactElement"),d=(e("./ReactPropTypeLocations"),e("./ReactPropTypeLocationNames"),e("./ReactNoopUpdateQueue")),h=e("./Object.assign"),m=e("fbjs/lib/emptyObject"),v=e("fbjs/lib/invariant"),y=e("fbjs/lib/keyMirror"),g=e("fbjs/lib/keyOf"),b=(e("fbjs/lib/warning"),g({mixins:null})),_=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),j=[],w={mixins:_.DEFINE_MANY,statics:_.DEFINE_MANY,propTypes:_.DEFINE_MANY,contextTypes:_.DEFINE_MANY,childContextTypes:_.DEFINE_MANY,getDefaultProps:_.DEFINE_MANY_MERGED,getInitialState:_.DEFINE_MANY_MERGED,getChildContext:_.DEFINE_MANY_MERGED,render:_.DEFINE_ONCE,componentWillMount:_.DEFINE_MANY,componentDidMount:_.DEFINE_MANY,componentWillReceiveProps:_.DEFINE_MANY,shouldComponentUpdate:_.DEFINE_ONCE,componentWillUpdate:_.DEFINE_MANY,componentDidUpdate:_.DEFINE_MANY,componentWillUnmount:_.DEFINE_MANY,updateComponent:_.OVERRIDE_BASE},C={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)i(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=h({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=h({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=s(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=h({},e.propTypes,t)},statics:function(e,t){o(e,t)},autobind:function(){}},x={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e),t&&this.updater.enqueueCallback(this,t)},isMounted:function(){return this.updater.isMounted(this)},setProps:function(e,t){this.updater.enqueueSetProps(this,e),t&&this.updater.enqueueCallback(this,t)},replaceProps:function(e,t){this.updater.enqueueReplaceProps(this,e),t&&this.updater.enqueueCallback(this,t)}},E=function(){};h(E.prototype,f.prototype,x);var R={createClass:function(e){var t=function(e,t,n){this.__reactAutoBindMap&&c(this),this.props=e,this.context=t,this.refs=m,this.updater=n||d,this.state=null;var r=this.getInitialState?this.getInitialState():null;"object"!=typeof r||Array.isArray(r)?v(!1):void 0,this.state=r};t.prototype=new E,t.prototype.constructor=t,j.forEach(i.bind(null,t)),i(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),t.prototype.render?void 0:v(!1);for(var n in w)t.prototype[n]||(t.prototype[n]=null);return t},injection:{injectMixin:function(e){j.push(e)}}};t.exports=R},{"./Object.assign":704,"./ReactComponent":712,"./ReactElement":734,"./ReactNoopUpdateQueue":751,"./ReactPropTypeLocationNames":754,"./ReactPropTypeLocations":755,"fbjs/lib/emptyObject":304,"fbjs/lib/invariant":311,"fbjs/lib/keyMirror":314,"fbjs/lib/keyOf":315,"fbjs/lib/warning":322}],712:[function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=o,this.updater=n||i}var i=e("./ReactNoopUpdateQueue"),o=(e("./canDefineProperty"),e("fbjs/lib/emptyObject")),a=e("fbjs/lib/invariant");e("fbjs/lib/warning");r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e?a(!1):void 0,this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t)},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e)};t.exports=r},{"./ReactNoopUpdateQueue":751,"./canDefineProperty":786,"fbjs/lib/emptyObject":304,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],713:[function(e,t,n){"use strict";var r=e("./ReactDOMIDOperations"),i=e("./ReactMount"),o={processChildrenUpdates:r.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:r.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){i.purgeID(e)}};t.exports=o},{"./ReactDOMIDOperations":722,"./ReactMount":747}],714:[function(e,t,n){"use strict";var r=e("fbjs/lib/invariant"),i=!1,o={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){i?r(!1):void 0,o.unmountIDFromEnvironment=e.unmountIDFromEnvironment,o.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,o.processChildrenUpdates=e.processChildrenUpdates,i=!0}}};t.exports=o},{"fbjs/lib/invariant":311}],715:[function(e,t,n){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}function i(e){}var o=e("./ReactComponentEnvironment"),a=e("./ReactCurrentOwner"),s=e("./ReactElement"),u=e("./ReactInstanceMap"),l=e("./ReactPerf"),c=e("./ReactPropTypeLocations"),f=(e("./ReactPropTypeLocationNames"),e("./ReactReconciler")),p=e("./ReactUpdateQueue"),d=e("./Object.assign"),h=e("fbjs/lib/emptyObject"),m=e("fbjs/lib/invariant"),v=e("./shouldUpdateReactComponent");e("fbjs/lib/warning");i.prototype.render=function(){var e=u.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var y=1,g={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=y++,this._rootNodeID=e;var r,o,a=this._processProps(this._currentElement.props),l=this._processContext(n),c=this._currentElement.type,d="prototype"in c;d&&(r=new c(a,l,p)),d&&null!==r&&r!==!1&&!s.isValidElement(r)||(o=r,r=new i(c)),r.props=a,r.context=l,r.refs=h,r.updater=p,this._instance=r,u.set(r,this);var v=r.state;void 0===v&&(r.state=v=null),"object"!=typeof v||Array.isArray(v)?m(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,r.componentWillMount&&(r.componentWillMount(),this._pendingStateQueue&&(r.state=this._processPendingState(r.props,r.context))),void 0===o&&(o=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(o);var g=f.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return r.componentDidMount&&t.getReactMountReady().enqueue(r.componentDidMount,r),g},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),f.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,u.remove(e)},_maskContext:function(e){var t=null,n=this._currentElement.type,r=n.contextTypes;if(!r)return h;t={};for(var i in r)t[i]=e[i];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?m(!1):void 0;for(var i in r)i in t.childContextTypes?void 0:m(!1);return d({},e,r)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var i=this.getName();for(var o in e)if(e.hasOwnProperty(o)){var a;try{"function"!=typeof e[o]?m(!1):void 0,a=e[o](t,o,i,n)}catch(s){a=s}if(a instanceof Error){r(this);n===c.prop}}},receiveComponent:function(e,t,n){var r=this._currentElement,i=this._context;this._pendingElement=null,this.updateComponent(t,r,e,i,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&f.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,i){var o,a=this._instance,s=this._context===i?a.context:this._processContext(i);t===n?o=n.props:(o=this._processProps(n.props),a.componentWillReceiveProps&&a.componentWillReceiveProps(o,s));var u=this._processPendingState(o,s),l=this._pendingForceUpdate||!a.shouldComponentUpdate||a.shouldComponentUpdate(o,u,s);l?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,o,u,s,e,i)):(this._currentElement=n,this._context=i,a.props=o,a.state=u,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var o=d({},i?r[0]:n.state),a=i?1:0;a<r.length;a++){var s=r[a];d(o,"function"==typeof s?s.call(n,o,e,t):s)}return o},_performComponentUpdate:function(e,t,n,r,i,o){var a,s,u,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,s=l.state,u=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=o,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(i,o),c&&i.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,s,u),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,i=this._renderValidatedComponent();if(v(r,i))f.receiveComponent(n,i,e,this._processChildContext(t));else{var o=this._rootNodeID,a=n._rootNodeID;f.unmountComponent(n),this._renderedComponent=this._instantiateReactComponent(i);var s=f.mountComponent(this._renderedComponent,o,e,this._processChildContext(t));this._replaceNodeWithMarkupByID(a,s)}},_replaceNodeWithMarkupByID:function(e,t){o.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return t},_renderValidatedComponent:function(){var e;a.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{a.current=null}return null===e||e===!1||s.isValidElement(e)?void 0:m(!1),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n?m(!1):void 0;var r=t.getPublicInstance(),i=n.refs===h?n.refs={}:n.refs;i[e]=r},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return e instanceof i?null:e},_instantiateReactComponent:null};l.measureMethods(g,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var b={Mixin:g};t.exports=b},{"./Object.assign":704,"./ReactComponentEnvironment":714,"./ReactCurrentOwner":716,"./ReactElement":734,"./ReactInstanceMap":744,"./ReactPerf":753,"./ReactPropTypeLocationNames":754,"./ReactPropTypeLocations":755,"./ReactReconciler":758,"./ReactUpdateQueue":764,"./shouldUpdateReactComponent":808,"fbjs/lib/emptyObject":304,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],716:[function(e,t,n){"use strict";var r={current:null};t.exports=r},{}],717:[function(e,t,n){"use strict";var r=e("./ReactCurrentOwner"),i=e("./ReactDOMTextComponent"),o=e("./ReactDefaultInjection"),a=e("./ReactInstanceHandles"),s=e("./ReactMount"),u=e("./ReactPerf"),l=e("./ReactReconciler"),c=e("./ReactUpdates"),f=e("./ReactVersion"),p=e("./findDOMNode"),d=e("./renderSubtreeIntoContainer");e("fbjs/lib/warning");o.inject();var h=u.measure("React","render",s.render),m={findDOMNode:p,render:h,unmountComponentAtNode:s.unmountComponentAtNode,version:f,unstable_batchedUpdates:c.batchedUpdates,unstable_renderSubtreeIntoContainer:d};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:r,InstanceHandles:a,Mount:s,Reconciler:l,TextComponent:i});t.exports=m},{"./ReactCurrentOwner":716,"./ReactDOMTextComponent":728,"./ReactDefaultInjection":731,"./ReactInstanceHandles":743,"./ReactMount":747,"./ReactPerf":753,"./ReactReconciler":758,"./ReactUpdates":765,"./ReactVersion":766,"./findDOMNode":790,"./renderSubtreeIntoContainer":805,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/warning":322}],718:[function(e,t,n){"use strict";var r={onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0},i={getNativeProps:function(e,t,n){if(!t.disabled)return t;var i={};for(var o in t)t.hasOwnProperty(o)&&!r[o]&&(i[o]=t[o]);return i}};t.exports=i},{}],719:[function(e,t,n){"use strict";function r(){return this}function i(){var e=this._reactInternalComponent;return!!e}function o(){}function a(e,t){var n=this._reactInternalComponent;n&&(T.enqueueSetPropsInternal(n,e),t&&T.enqueueCallbackInternal(n,t))}function s(e,t){var n=this._reactInternalComponent;n&&(T.enqueueReplacePropsInternal(n,e),t&&T.enqueueCallbackInternal(n,t))}function u(e,t){t&&(null!=t.dangerouslySetInnerHTML&&(null!=t.children?D(!1):void 0,"object"==typeof t.dangerouslySetInnerHTML&&$ in t.dangerouslySetInnerHTML?void 0:D(!1)),null!=t.style&&"object"!=typeof t.style?D(!1):void 0)}function l(e,t,n,r){var i=S.findReactContainerForID(e);
if(i){var o=i.nodeType===z?i.ownerDocument:i;B(t,o)}r.getReactMountReady().enqueue(c,{id:e,registrationName:t,listener:n})}function c(){var e=this;w.putListener(e.id,e.registrationName,e.listener)}function f(){var e=this;e._rootNodeID?void 0:D(!1);var t=S.getNode(e._rootNodeID);switch(t?void 0:D(!1),e._tag){case"iframe":e._wrapperState.listeners=[w.trapBubbledEvent(j.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in Q)Q.hasOwnProperty(n)&&e._wrapperState.listeners.push(w.trapBubbledEvent(j.topLevelTypes[n],Q[n],t));break;case"img":e._wrapperState.listeners=[w.trapBubbledEvent(j.topLevelTypes.topError,"error",t),w.trapBubbledEvent(j.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[w.trapBubbledEvent(j.topLevelTypes.topReset,"reset",t),w.trapBubbledEvent(j.topLevelTypes.topSubmit,"submit",t)]}}function p(){E.mountReadyWrapper(this)}function d(){O.postUpdateWrapper(this)}function h(e){Z.call(X,e)||(J.test(e)?void 0:D(!1),X[e]=!0)}function m(e,t){return e.indexOf("-")>=0||null!=t.is}function v(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var y=e("./AutoFocusUtils"),g=e("./CSSPropertyOperations"),b=e("./DOMProperty"),_=e("./DOMPropertyOperations"),j=e("./EventConstants"),w=e("./ReactBrowserEventEmitter"),C=e("./ReactComponentBrowserEnvironment"),x=e("./ReactDOMButton"),E=e("./ReactDOMInput"),R=e("./ReactDOMOption"),O=e("./ReactDOMSelect"),P=e("./ReactDOMTextarea"),S=e("./ReactMount"),k=e("./ReactMultiChild"),A=e("./ReactPerf"),T=e("./ReactUpdateQueue"),M=e("./Object.assign"),N=e("./canDefineProperty"),I=e("./escapeTextContentForBrowser"),D=e("fbjs/lib/invariant"),F=(e("./isEventSupported"),e("fbjs/lib/keyOf")),L=e("./setInnerHTML"),U=e("./setTextContent"),H=(e("fbjs/lib/shallowEqual"),e("./validateDOMNesting"),e("fbjs/lib/warning"),w.deleteListener),B=w.listenTo,q=w.registrationNameModules,V={string:!0,number:!0},W=F({children:null}),K=F({style:null}),$=F({__html:null}),z=1,Q={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"},G={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={listing:!0,pre:!0,textarea:!0},J=(M({menuitem:!0},G),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),X={},Z={}.hasOwnProperty;v.displayName="ReactDOMComponent",v.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(f,this);break;case"button":r=x.getNativeProps(this,r,n);break;case"input":E.mountWrapper(this,r,n),r=E.getNativeProps(this,r,n);break;case"option":R.mountWrapper(this,r,n),r=R.getNativeProps(this,r,n);break;case"select":O.mountWrapper(this,r,n),r=O.getNativeProps(this,r,n),n=O.processChildContext(this,r,n);break;case"textarea":P.mountWrapper(this,r,n),r=P.getNativeProps(this,r,n)}u(this,r);var i;if(t.useCreateElement){var o=n[S.ownerDocumentContextKey],a=o.createElement(this._currentElement.type);_.setAttributeForID(a,this._rootNodeID),S.getID(a),this._updateDOMProperties({},r,t,a),this._createInitialChildren(t,r,n,a),i=a}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),l=this._createContentMarkup(t,r,n);i=!l&&G[this._tag]?s+"/>":s+">"+l+"</"+this._currentElement.type+">"}switch(this._tag){case"input":t.getReactMountReady().enqueue(p,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(y.focusDOMComponent,this)}return i},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(q.hasOwnProperty(r))i&&l(this._rootNodeID,r,i,e);else{r===K&&(i&&(i=this._previousStyleCopy=M({},t.style)),i=g.createMarkupForStyles(i));var o=null;null!=this._tag&&m(this._tag,t)?r!==W&&(o=_.createMarkupForCustomAttribute(r,i)):o=_.createMarkupForProperty(r,i),o&&(n+=" "+o)}}if(e.renderToStaticMarkup)return n;var a=_.createMarkupForID(this._rootNodeID);return n+" "+a},_createContentMarkup:function(e,t,n){var r="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=V[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)r=I(o);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return Y[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&L(r,i.__html);else{var o=V[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)U(r,o);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)r.appendChild(s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var i=t.props,o=this._currentElement.props;switch(this._tag){case"button":i=x.getNativeProps(this,i),o=x.getNativeProps(this,o);break;case"input":E.updateWrapper(this),i=E.getNativeProps(this,i),o=E.getNativeProps(this,o);break;case"option":i=R.getNativeProps(this,i),o=R.getNativeProps(this,o);break;case"select":i=O.getNativeProps(this,i),o=O.getNativeProps(this,o);break;case"textarea":P.updateWrapper(this),i=P.getNativeProps(this,i),o=P.getNativeProps(this,o)}u(this,o),this._updateDOMProperties(i,o,e,null),this._updateDOMChildren(i,o,e,r),!N&&this._nodeWithLegacyProperties&&(this._nodeWithLegacyProperties.props=o),"select"===this._tag&&e.getReactMountReady().enqueue(d,this)},_updateDOMProperties:function(e,t,n,r){var i,o,a;for(i in e)if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i))if(i===K){var s=this._previousStyleCopy;for(o in s)s.hasOwnProperty(o)&&(a=a||{},a[o]="");this._previousStyleCopy=null}else q.hasOwnProperty(i)?e[i]&&H(this._rootNodeID,i):(b.properties[i]||b.isCustomAttribute(i))&&(r||(r=S.getNode(this._rootNodeID)),_.deleteValueForProperty(r,i));for(i in t){var u=t[i],c=i===K?this._previousStyleCopy:e[i];if(t.hasOwnProperty(i)&&u!==c)if(i===K)if(u?u=this._previousStyleCopy=M({},u):this._previousStyleCopy=null,c){for(o in c)!c.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(a=a||{},a[o]="");for(o in u)u.hasOwnProperty(o)&&c[o]!==u[o]&&(a=a||{},a[o]=u[o])}else a=u;else q.hasOwnProperty(i)?u?l(this._rootNodeID,i,u,n):c&&H(this._rootNodeID,i):m(this._tag,t)?(r||(r=S.getNode(this._rootNodeID)),i===W&&(u=null),_.setValueForAttribute(r,i,u)):(b.properties[i]||b.isCustomAttribute(i))&&(r||(r=S.getNode(this._rootNodeID)),null!=u?_.setValueForProperty(r,i,u):_.deleteValueForProperty(r,i))}a&&(r||(r=S.getNode(this._rootNodeID)),g.setValueForStyles(r,a))},_updateDOMChildren:function(e,t,n,r){var i=V[typeof e.children]?e.children:null,o=V[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=i?null:e.children,l=null!=o?null:t.children,c=null!=i||null!=a,f=null!=o||null!=s;null!=u&&null==l?this.updateChildren(null,n,r):c&&!f&&this.updateTextContent(""),null!=o?i!==o&&this.updateTextContent(""+o):null!=s?a!==s&&this.updateMarkup(""+s):null!=l&&this.updateChildren(l,n,r)},unmountComponent:function(){switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":var e=this._wrapperState.listeners;if(e)for(var t=0;t<e.length;t++)e[t].remove();break;case"input":E.unmountWrapper(this);break;case"html":case"head":case"body":D(!1)}if(this.unmountChildren(),w.deleteAllListeners(this._rootNodeID),C.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var n=this._nodeWithLegacyProperties;n._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=S.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=r,e.isMounted=i,e.setState=o,e.replaceState=o,e.forceUpdate=o,e.setProps=a,e.replaceProps=s,e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},A.measureMethods(v,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),M(v.prototype,v.Mixin,k.Mixin),t.exports=v},{"./AutoFocusUtils":683,"./CSSPropertyOperations":686,"./DOMProperty":691,"./DOMPropertyOperations":692,"./EventConstants":696,"./Object.assign":704,"./ReactBrowserEventEmitter":708,"./ReactComponentBrowserEnvironment":713,"./ReactDOMButton":718,"./ReactDOMInput":723,"./ReactDOMOption":724,"./ReactDOMSelect":725,"./ReactDOMTextarea":729,"./ReactMount":747,"./ReactMultiChild":748,"./ReactPerf":753,"./ReactUpdateQueue":764,"./canDefineProperty":786,"./escapeTextContentForBrowser":789,"./isEventSupported":801,"./setInnerHTML":806,"./setTextContent":807,"./validateDOMNesting":810,"fbjs/lib/invariant":311,"fbjs/lib/keyOf":315,"fbjs/lib/shallowEqual":320,"fbjs/lib/warning":322}],720:[function(e,t,n){"use strict";function r(e){return i.createFactory(e)}var i=e("./ReactElement"),o=(e("./ReactElementValidator"),e("fbjs/lib/mapObject")),a=o({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);t.exports=a},{"./ReactElement":734,"./ReactElementValidator":735,"fbjs/lib/mapObject":316}],721:[function(e,t,n){"use strict";var r={useCreateElement:!1};t.exports=r},{}],722:[function(e,t,n){"use strict";var r=e("./DOMChildrenOperations"),i=e("./DOMPropertyOperations"),o=e("./ReactMount"),a=e("./ReactPerf"),s=e("fbjs/lib/invariant"),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:function(e,t,n){var r=o.getNode(e);u.hasOwnProperty(t)?s(!1):void 0,null!=n?i.setValueForProperty(r,t,n):i.deleteValueForProperty(r,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=o.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=o.getNode(e[n].parentID);r.processUpdates(e,t)}};a.measureMethods(l,"ReactDOMIDOperations",{dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=l},{"./DOMChildrenOperations":690,"./DOMPropertyOperations":692,"./ReactMount":747,"./ReactPerf":753,"fbjs/lib/invariant":311}],723:[function(e,t,n){"use strict";function r(){this._rootNodeID&&p.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);u.asap(r,this);var i=t.name;if("radio"===t.type&&null!=i){for(var o=s.getNode(this._rootNodeID),l=o;l.parentNode;)l=l.parentNode;for(var p=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),d=0;d<p.length;d++){var h=p[d];if(h!==o&&h.form===o.form){var m=s.getID(h);m?void 0:c(!1);var v=f[m];v?void 0:c(!1),u.asap(r,v)}}}return n}var o=e("./ReactDOMIDOperations"),a=e("./LinkedValueUtils"),s=e("./ReactMount"),u=e("./ReactUpdates"),l=e("./Object.assign"),c=e("fbjs/lib/invariant"),f={},p={getNativeProps:function(e,t,n){var r=a.getValue(t),i=a.getChecked(t),o=l({},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=r?r:e._wrapperState.initialValue,checked:null!=i?i:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange});return o},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:t.defaultChecked||!1,initialValue:null!=n?n:null,onChange:i.bind(e)}},mountReadyWrapper:function(e){f[e._rootNodeID]=e},unmountWrapper:function(e){delete f[e._rootNodeID]},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&o.updatePropertyByID(e._rootNodeID,"checked",n||!1);var r=a.getValue(t);null!=r&&o.updatePropertyByID(e._rootNodeID,"value",""+r)}};t.exports=p},{"./LinkedValueUtils":703,"./Object.assign":704,"./ReactDOMIDOperations":722,"./ReactMount":747,"./ReactUpdates":765,"fbjs/lib/invariant":311}],724:[function(e,t,n){"use strict";var r=e("./ReactChildren"),i=e("./ReactDOMSelect"),o=e("./Object.assign"),a=(e("fbjs/lib/warning"),i.valueContextKey),s={mountWrapper:function(e,t,n){var r=n[a],i=null;if(null!=r)if(i=!1,Array.isArray(r)){for(var o=0;o<r.length;o++)if(""+r[o]==""+t.value){i=!0;break}}else i=""+r==""+t.value;e._wrapperState={selected:i}},getNativeProps:function(e,t,n){var i=o({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(i.selected=e._wrapperState.selected);var a="";return r.forEach(t.children,function(e){null!=e&&("string"!=typeof e&&"number"!=typeof e||(a+=e))}),a&&(i.children=a),i}};t.exports=s},{"./Object.assign":704,"./ReactChildren":710,"./ReactDOMSelect":725,"fbjs/lib/warning":322}],725:[function(e,t,n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=a.getValue(e);null!=t&&i(this,Boolean(e.multiple),t)}}function i(e,t,n){var r,i,o=s.getNode(e._rootNodeID).options;if(t){for(r={},i=0;i<n.length;i++)r[""+n[i]]=!0;for(i=0;i<o.length;i++){var a=r.hasOwnProperty(o[i].value);o[i].selected!==a&&(o[i].selected=a)}}else{for(r=""+n,i=0;i<o.length;i++)if(o[i].value===r)return void(o[i].selected=!0);o.length&&(o[0].selected=!0)}}function o(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);return this._wrapperState.pendingUpdate=!0,u.asap(r,this),n}var a=e("./LinkedValueUtils"),s=e("./ReactMount"),u=e("./ReactUpdates"),l=e("./Object.assign"),c=(e("fbjs/lib/warning"),"__ReactDOMSelect_value$"+Math.random().toString(36).slice(2)),f={valueContextKey:c,getNativeProps:function(e,t,n){return l({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=a.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,onChange:o.bind(e),wasMultiple:Boolean(t.multiple)}},processChildContext:function(e,t,n){var r=l({},n);return r[c]=e._wrapperState.initialValue,r},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=a.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,i(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?i(e,Boolean(t.multiple),t.defaultValue):i(e,Boolean(t.multiple),t.multiple?[]:""))}};t.exports=f},{"./LinkedValueUtils":703,"./Object.assign":704,"./ReactMount":747,"./ReactUpdates":765,"fbjs/lib/warning":322}],726:[function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function i(e){var t=document.selection,n=t.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(e),i.setEndPoint("EndToStart",n);var o=i.text.length,a=o+r;return{start:o,end:a}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(u){return null}var l=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=l?0:s.toString().length,f=s.cloneRange();f.selectNodeContents(e),f.setEnd(s.startContainer,s.startOffset);var p=r(f.startContainer,f.startOffset,f.endContainer,f.endOffset),d=p?0:f.toString().length,h=d+c,m=document.createRange();m.setStart(n,i),m.setEnd(o,a);var v=m.collapsed;return{start:v?h:d,end:v?d:h}}function a(e,t){var n,r,i=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o="undefined"==typeof t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var f=document.createRange();f.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(f),n.extend(u.node,u.offset)):(f.setEnd(u.node,u.offset),n.addRange(f))}}}var u=e("fbjs/lib/ExecutionEnvironment"),l=e("./getNodeForCharacterOffset"),c=e("./getTextContentAccessor"),f=u.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:f?i:o,setOffsets:f?a:s};t.exports=p},{"./getNodeForCharacterOffset":798,"./getTextContentAccessor":799,"fbjs/lib/ExecutionEnvironment":297}],727:[function(e,t,n){"use strict";var r=e("./ReactDefaultInjection"),i=e("./ReactServerRendering"),o=e("./ReactVersion");r.inject();var a={renderToString:i.renderToString,renderToStaticMarkup:i.renderToStaticMarkup,version:o};t.exports=a},{"./ReactDefaultInjection":731,"./ReactServerRendering":762,"./ReactVersion":766}],728:[function(e,t,n){"use strict";var r=e("./DOMChildrenOperations"),i=e("./DOMPropertyOperations"),o=e("./ReactComponentBrowserEnvironment"),a=e("./ReactMount"),s=e("./Object.assign"),u=e("./escapeTextContentForBrowser"),l=e("./setTextContent"),c=(e("./validateDOMNesting"),function(e){});s(c.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){if(this._rootNodeID=e,t.useCreateElement){var r=n[a.ownerDocumentContextKey],o=r.createElement("span");return i.setAttributeForID(o,e),a.getID(o),l(o,this._stringText),o}var s=u(this._stringText);return t.renderToStaticMarkup?s:"<span "+i.createMarkupForID(e)+">"+s+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var i=a.getNode(this._rootNodeID);r.updateTextContent(i,n)}}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=c},{"./DOMChildrenOperations":690,"./DOMPropertyOperations":692,"./Object.assign":704,"./ReactComponentBrowserEnvironment":713,"./ReactMount":747,"./escapeTextContentForBrowser":789,"./setTextContent":807,"./validateDOMNesting":810}],729:[function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return s.asap(r,this),n}var o=e("./LinkedValueUtils"),a=e("./ReactDOMIDOperations"),s=e("./ReactUpdates"),u=e("./Object.assign"),l=e("fbjs/lib/invariant"),c=(e("fbjs/lib/warning"),{getNativeProps:function(e,t,n){null!=t.dangerouslySetInnerHTML?l(!1):void 0;var r=u({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?l(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:l(!1),r=r[0]),n=""+r),null==n&&(n="");var a=o.getValue(t);e._wrapperState={initialValue:""+(null!=a?a:n),onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=o.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}});t.exports=c},{"./LinkedValueUtils":703,"./Object.assign":704,"./ReactDOMIDOperations":722,"./ReactUpdates":765,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],730:[function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var i=e("./ReactUpdates"),o=e("./Transaction"),a=e("./Object.assign"),s=e("fbjs/lib/emptyFunction"),u={initialize:s,close:function(){p.isBatchingUpdates=!1}},l={initialize:s,close:i.flushBatchedUpdates.bind(i)},c=[l,u];a(r.prototype,o.Mixin,{getTransactionWrappers:function(){return c}});var f=new r,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,i,o){var a=p.isBatchingUpdates;p.isBatchingUpdates=!0,a?e(t,n,r,i,o):f.perform(e,null,t,n,r,i,o)}};t.exports=p},{"./Object.assign":704,"./ReactUpdates":765,"./Transaction":782,"fbjs/lib/emptyFunction":303}],731:[function(e,t,n){"use strict";function r(){if(!E){E=!0,y.EventEmitter.injectReactEventListener(v),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginHub.injectInstanceHandle(g),y.EventPluginHub.injectMount(b),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:C,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,SelectEventPlugin:j,BeforeInputEventPlugin:i}),y.NativeComponent.injectGenericComponentClass(h),y.NativeComponent.injectTextComponentClass(m),y.Class.injectMixin(f),y.DOMProperty.injectDOMPropertyConfig(c),y.DOMProperty.injectDOMPropertyConfig(x),y.EmptyComponent.injectEmptyComponent("noscript"),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(d),y.RootIndex.injectCreateReactRootIndex(l.canUseDOM?a.createReactRootIndex:w.createReactRootIndex),y.Component.injectEnvironment(p)}}var i=e("./BeforeInputEventPlugin"),o=e("./ChangeEventPlugin"),a=e("./ClientReactRootIndex"),s=e("./DefaultEventPluginOrder"),u=e("./EnterLeaveEventPlugin"),l=e("fbjs/lib/ExecutionEnvironment"),c=e("./HTMLDOMPropertyConfig"),f=e("./ReactBrowserComponentMixin"),p=e("./ReactComponentBrowserEnvironment"),d=e("./ReactDefaultBatchingStrategy"),h=e("./ReactDOMComponent"),m=e("./ReactDOMTextComponent"),v=e("./ReactEventListener"),y=e("./ReactInjection"),g=e("./ReactInstanceHandles"),b=e("./ReactMount"),_=e("./ReactReconcileTransaction"),j=e("./SelectEventPlugin"),w=e("./ServerReactRootIndex"),C=e("./SimpleEventPlugin"),x=e("./SVGDOMPropertyConfig"),E=!1;t.exports={inject:r}},{"./BeforeInputEventPlugin":684,"./ChangeEventPlugin":688,"./ClientReactRootIndex":689,"./DefaultEventPluginOrder":694,"./EnterLeaveEventPlugin":695,"./HTMLDOMPropertyConfig":702,"./ReactBrowserComponentMixin":707,"./ReactComponentBrowserEnvironment":713,"./ReactDOMComponent":719,"./ReactDOMTextComponent":728,"./ReactDefaultBatchingStrategy":730,"./ReactDefaultPerf":732,"./ReactEventListener":740,"./ReactInjection":741,"./ReactInstanceHandles":743,"./ReactMount":747,"./ReactReconcileTransaction":757,"./SVGDOMPropertyConfig":767,"./SelectEventPlugin":768,"./ServerReactRootIndex":769,"./SimpleEventPlugin":770,"fbjs/lib/ExecutionEnvironment":297}],732:[function(e,t,n){"use strict";function r(e){return Math.floor(100*e)/100}function i(e,t,n){e[t]=(e[t]||0)+n}var o=e("./DOMProperty"),a=e("./ReactDefaultPerfAnalysis"),s=e("./ReactMount"),u=e("./ReactPerf"),l=e("fbjs/lib/performanceNow"),c={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){c._injected||u.injection.injectMeasure(c.measure),c._allMeasurements.length=0,u.enableMeasure=!0},stop:function(){u.enableMeasure=!1},getLastMeasurements:function(){return c._allMeasurements},printExclusive:function(e){e=e||c._allMeasurements;var t=a.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":r(e.inclusive),"Exclusive mount time (ms)":r(e.exclusive),"Exclusive render time (ms)":r(e.render),"Mount time per instance (ms)":r(e.exclusive/e.count),"Render time per instance (ms)":r(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||c._allMeasurements;var t=a.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":r(e.time),Instances:e.count}})),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=a.getInclusiveSummary(e,!0);return t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})},printWasted:function(e){e=e||c._allMeasurements,console.table(c.getMeasurementsSummaryMap(e)),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||c._allMeasurements;var t=a.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[o.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,r){var i=c._allMeasurements[c._allMeasurements.length-1].writes;i[e]=i[e]||[],i[e].push({type:t,time:n,args:r})},measure:function(e,t,n){return function(){for(var r=arguments.length,o=Array(r),a=0;r>a;a++)o[a]=arguments[a];var u,f,p;if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return c._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0,created:{}}),p=l(),f=n.apply(this,o),c._allMeasurements[c._allMeasurements.length-1].totalTime=l()-p,f;if("_mountImageIntoNode"===t||"ReactBrowserEventEmitter"===e||"ReactDOMIDOperations"===e||"CSSPropertyOperations"===e||"DOMChildrenOperations"===e||"DOMPropertyOperations"===e){if(p=l(),f=n.apply(this,o),u=l()-p,"_mountImageIntoNode"===t){var d=s.getID(o[1]);c._recordWrite(d,t,u,o[0])}else if("dangerouslyProcessChildrenUpdates"===t)o[0].forEach(function(e){var t={};null!==e.fromIndex&&(t.fromIndex=e.fromIndex),null!==e.toIndex&&(t.toIndex=e.toIndex),null!==e.textContent&&(t.textContent=e.textContent),null!==e.markupIndex&&(t.markup=o[1][e.markupIndex]),c._recordWrite(e.parentID,e.type,u,t)});else{var h=o[0];"object"==typeof h&&(h=s.getID(o[0])),c._recordWrite(h,t,u,Array.prototype.slice.call(o,1))}return f}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return n.apply(this,o);if(this._currentElement.type===s.TopLevelWrapper)return n.apply(this,o);var m="mountComponent"===t?o[0]:this._rootNodeID,v="_renderValidatedComponent"===t,y="mountComponent"===t,g=c._mountStack,b=c._allMeasurements[c._allMeasurements.length-1];if(v?i(b.counts,m,1):y&&(b.created[m]=!0,g.push(0)),p=l(),f=n.apply(this,o),u=l()-p,v)i(b.render,m,u);else if(y){var _=g.pop();g[g.length-1]+=u,i(b.exclusive,m,u-_),i(b.inclusive,m,u)}else i(b.inclusive,m,u);return b.displayNames[m]={current:this.getName(),owner:this._currentElement._owner?this._currentElement._owner.getName():"<root>"},f}}};t.exports=c},{"./DOMProperty":691,"./ReactDefaultPerfAnalysis":733,"./ReactMount":747,"./ReactPerf":753,"fbjs/lib/performanceNow":319}],733:[function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];t+=r.totalTime}return t}function i(e){var t=[];return e.forEach(function(e){Object.keys(e.writes).forEach(function(n){e.writes[n].forEach(function(e){t.push({id:n,type:c[e.type]||e.type,args:e.args})})})}),t}function o(e){for(var t,n={},r=0;r<e.length;r++){var i=e[r],o=u({},i.exclusive,i.inclusive);for(var a in o)t=i.displayNames[a].current,n[t]=n[t]||{componentName:t,inclusive:0,exclusive:0,render:0,count:0},i.render[a]&&(n[t].render+=i.render[a]),i.exclusive[a]&&(n[t].exclusive+=i.exclusive[a]),i.inclusive[a]&&(n[t].inclusive+=i.inclusive[a]),i.counts[a]&&(n[t].count+=i.counts[a])}var s=[];for(t in n)n[t].exclusive>=l&&s.push(n[t]);return s.sort(function(e,t){return t.exclusive-e.exclusive}),s}function a(e,t){for(var n,r={},i=0;i<e.length;i++){var o,a=e[i],c=u({},a.exclusive,a.inclusive);t&&(o=s(a));for(var f in c)if(!t||o[f]){var p=a.displayNames[f];n=p.owner+" > "+p.current,r[n]=r[n]||{componentName:n,time:0,count:0},a.inclusive[f]&&(r[n].time+=a.inclusive[f]),a.counts[f]&&(r[n].count+=a.counts[f])}}var d=[];for(n in r)r[n].time>=l&&d.push(r[n]);return d.sort(function(e,t){return t.time-e.time}),d}function s(e){var t={},n=Object.keys(e.writes),r=u({},e.exclusive,e.inclusive);for(var i in r){for(var o=!1,a=0;a<n.length;a++)if(0===n[a].indexOf(i)){o=!0;break}e.created[i]&&(o=!0),!o&&e.counts[i]>0&&(t[i]=!0)}return t}var u=e("./Object.assign"),l=1.2,c={_mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",SET_MARKUP:"set innerHTML",TEXT_CONTENT:"set textContent",setValueForProperty:"update attribute",setValueForAttribute:"update attribute",deleteValueForProperty:"remove attribute",setValueForStyles:"update styles",replaceNodeWithMarkup:"replace",updateTextContent:"set textContent"},f={getExclusiveSummary:o,getInclusiveSummary:a,getDOMSummary:i,getTotalTime:r};t.exports=f},{"./Object.assign":704}],734:[function(e,t,n){"use strict";var r=e("./ReactCurrentOwner"),i=e("./Object.assign"),o=(e("./canDefineProperty"),"function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103),a={key:!0,ref:!0,__self:!0,__source:!0},s=function(e,t,n,r,i,a,s){var u={$$typeof:o,type:e,key:t,ref:n,props:s,_owner:a};return u};s.createElement=function(e,t,n){var i,o={},u=null,l=null,c=null,f=null;if(null!=t){l=void 0===t.ref?null:t.ref,u=void 0===t.key?null:""+t.key,c=void 0===t.__self?null:t.__self,f=void 0===t.__source?null:t.__source;for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(o[i]=t[i])}var p=arguments.length-2;if(1===p)o.children=n;else if(p>1){for(var d=Array(p),h=0;p>h;h++)d[h]=arguments[h+2];o.children=d}if(e&&e.defaultProps){var m=e.defaultProps;for(i in m)"undefined"==typeof o[i]&&(o[i]=m[i])}return s(e,u,l,c,f,r.current,o)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneAndReplaceProps=function(e,t){var n=s(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return n},s.cloneElement=function(e,t,n){var o,u=i({},e.props),l=e.key,c=e.ref,f=e._self,p=e._source,d=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,d=r.current),void 0!==t.key&&(l=""+t.key);for(o in t)t.hasOwnProperty(o)&&!a.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var m=Array(h),v=0;h>v;v++)m[v]=arguments[v+2];u.children=m}return s(e.type,l,c,f,p,d,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.exports=s},{"./Object.assign":704,"./ReactCurrentOwner":716,"./canDefineProperty":786}],735:[function(e,t,n){"use strict";function r(){if(f.current){var e=f.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function i(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;o("uniqueKey",e,t)}}function o(e,t,n){var i=r();
if(!i){var o="string"==typeof n?n:n.displayName||n.name;o&&(i=" Check the top-level render call using <"+o+">.")}var a=h[e]||(h[e]={});if(a[i])return null;a[i]=!0;var s={parentOrOwner:i,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==f.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];l.isValidElement(r)&&i(r,t)}else if(l.isValidElement(e))e._store&&(e._store.validated=!0);else if(e){var o=p(e);if(o&&o!==e.entries)for(var a,s=o.call(e);!(a=s.next()).done;)l.isValidElement(a.value)&&i(a.value,t)}}function s(e,t,n,i){for(var o in t)if(t.hasOwnProperty(o)){var a;try{"function"!=typeof t[o]?d(!1):void 0,a=t[o](n,o,e,i)}catch(s){a=s}if(a instanceof Error&&!(a.message in m)){m[a.message]=!0;r()}}}function u(e){var t=e.type;if("function"==typeof t){var n=t.displayName||t.name;t.propTypes&&s(n,t.propTypes,e.props,c.prop),"function"==typeof t.getDefaultProps}}var l=e("./ReactElement"),c=e("./ReactPropTypeLocations"),f=(e("./ReactPropTypeLocationNames"),e("./ReactCurrentOwner")),p=(e("./canDefineProperty"),e("./getIteratorFn")),d=e("fbjs/lib/invariant"),h=(e("fbjs/lib/warning"),{}),m={},v={createElement:function(e,t,n){var r="string"==typeof e||"function"==typeof e,i=l.createElement.apply(this,arguments);if(null==i)return i;if(r)for(var o=2;o<arguments.length;o++)a(arguments[o],e);return u(i),i},createFactory:function(e){var t=v.createElement.bind(null,e);return t.type=e,t},cloneElement:function(e,t,n){for(var r=l.cloneElement.apply(this,arguments),i=2;i<arguments.length;i++)a(arguments[i],r.type);return u(r),r}};t.exports=v},{"./ReactCurrentOwner":716,"./ReactElement":734,"./ReactPropTypeLocationNames":754,"./ReactPropTypeLocations":755,"./canDefineProperty":786,"./getIteratorFn":797,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],736:[function(e,t,n){"use strict";var r,i=e("./ReactElement"),o=e("./ReactEmptyComponentRegistry"),a=e("./ReactReconciler"),s=e("./Object.assign"),u={injectEmptyComponent:function(e){r=i.createElement(e)}},l=function(e){this._currentElement=null,this._rootNodeID=null,this._renderedComponent=e(r)};s(l.prototype,{construct:function(e){},mountComponent:function(e,t,n){return o.registerNullComponentID(e),this._rootNodeID=e,a.mountComponent(this._renderedComponent,e,t,n)},receiveComponent:function(){},unmountComponent:function(e,t,n){a.unmountComponent(this._renderedComponent),o.deregisterNullComponentID(this._rootNodeID),this._rootNodeID=null,this._renderedComponent=null}}),l.injection=u,t.exports=l},{"./Object.assign":704,"./ReactElement":734,"./ReactEmptyComponentRegistry":737,"./ReactReconciler":758}],737:[function(e,t,n){"use strict";function r(e){return!!a[e]}function i(e){a[e]=!0}function o(e){delete a[e]}var a={},s={isNullComponentID:r,registerNullComponentID:i,deregisterNullComponentID:o};t.exports=s},{}],738:[function(e,t,n){"use strict";function r(e,t,n,r){try{return t(n,r)}catch(o){return void(null===i&&(i=o))}}var i=null,o={invokeGuardedCallback:r,invokeGuardedCallbackWithCatch:r,rethrowCaughtError:function(){if(i){var e=i;throw i=null,e}}};t.exports=o},{}],739:[function(e,t,n){"use strict";function r(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=e("./EventPluginHub"),o={handleTopLevel:function(e,t,n,o,a){var s=i.extractEvents(e,t,n,o,a);r(s)}};t.exports=o},{"./EventPluginHub":697}],740:[function(e,t,n){"use strict";function r(e){var t=p.getID(e),n=f.getReactRootIDFromNodeID(t),r=p.findReactContainerForID(n),i=p.getFirstReactDOM(r);return i}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){a(e)}function a(e){for(var t=p.getFirstReactDOM(m(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=r(n);for(var i=0;i<e.ancestors.length;i++){t=e.ancestors[i];var o=p.getID(t)||"";y._handleTopLevel(e.topLevelType,t,o,e.nativeEvent,m(e.nativeEvent))}}function s(e){var t=v(window);e(t)}var u=e("fbjs/lib/EventListener"),l=e("fbjs/lib/ExecutionEnvironment"),c=e("./PooledClass"),f=e("./ReactInstanceHandles"),p=e("./ReactMount"),d=e("./ReactUpdates"),h=e("./Object.assign"),m=e("./getEventTarget"),v=e("fbjs/lib/getUnboundedScrollPosition");h(i.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(i,c.twoArgumentPooler);var y={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:l.canUseDOM?window:null,setHandleTopLevel:function(e){y._handleTopLevel=e},setEnabled:function(e){y._enabled=!!e},isEnabled:function(){return y._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?u.listen(r,t,y.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var r=n;return r?u.capture(r,t,y.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=s.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(y._enabled){var n=i.getPooled(e,t);try{d.batchedUpdates(o,n)}finally{i.release(n)}}}};t.exports=y},{"./Object.assign":704,"./PooledClass":705,"./ReactInstanceHandles":743,"./ReactMount":747,"./ReactUpdates":765,"./getEventTarget":796,"fbjs/lib/EventListener":296,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/getUnboundedScrollPosition":308}],741:[function(e,t,n){"use strict";var r=e("./DOMProperty"),i=e("./EventPluginHub"),o=e("./ReactComponentEnvironment"),a=e("./ReactClass"),s=e("./ReactEmptyComponent"),u=e("./ReactBrowserEventEmitter"),l=e("./ReactNativeComponent"),c=e("./ReactPerf"),f=e("./ReactRootIndex"),p=e("./ReactUpdates"),d={Component:o.injection,Class:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:i.injection,EventEmitter:u.injection,NativeComponent:l.injection,Perf:c.injection,RootIndex:f.injection,Updates:p.injection};t.exports=d},{"./DOMProperty":691,"./EventPluginHub":697,"./ReactBrowserEventEmitter":708,"./ReactClass":711,"./ReactComponentEnvironment":714,"./ReactEmptyComponent":736,"./ReactNativeComponent":750,"./ReactPerf":753,"./ReactRootIndex":760,"./ReactUpdates":765}],742:[function(e,t,n){"use strict";function r(e){return o(document.documentElement,e)}var i=e("./ReactDOMSelection"),o=e("fbjs/lib/containsNode"),a=e("fbjs/lib/focusNode"),s=e("fbjs/lib/getActiveElement"),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,i=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,i),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=i.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.select()}else i.setOffsets(e,t)}};t.exports=u},{"./ReactDOMSelection":726,"fbjs/lib/containsNode":300,"fbjs/lib/focusNode":305,"fbjs/lib/getActiveElement":306}],743:[function(e,t,n){"use strict";function r(e){return d+e.toString(36)}function i(e,t){return e.charAt(t)===d||t===e.length}function o(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function a(e,t){return 0===t.indexOf(e)&&i(t,e.length)}function s(e){return e?e.substr(0,e.lastIndexOf(d)):""}function u(e,t){if(o(e)&&o(t)?void 0:p(!1),a(e,t)?void 0:p(!1),e===t)return e;var n,r=e.length+h;for(n=r;n<t.length&&!i(t,n);n++);return t.substr(0,n)}function l(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var r=0,a=0;n>=a;a++)if(i(e,a)&&i(t,a))r=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,r);return o(s)?void 0:p(!1),s}function c(e,t,n,r,i,o){e=e||"",t=t||"",e===t?p(!1):void 0;var l=a(t,e);l||a(e,t)?void 0:p(!1);for(var c=0,f=l?s:u,d=e;;d=f(d,t)){var h;if(i&&d===e||o&&d===t||(h=n(d,l,r)),h===!1||d===t)break;c++<m?void 0:p(!1)}}var f=e("./ReactRootIndex"),p=e("fbjs/lib/invariant"),d=".",h=d.length,m=1e4,v={createReactRootID:function(){return r(f.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===d&&e.length>1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,i){var o=l(e,t);o!==e&&c(e,o,n,r,!1,!0),o!==t&&c(o,t,n,i,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(c("",e,t,n,!0,!0),c(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},getFirstCommonAncestorID:l,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:d};t.exports=v},{"./ReactRootIndex":760,"fbjs/lib/invariant":311}],744:[function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=r},{}],745:[function(e,t,n){"use strict";var r=e("./ReactChildren"),i=e("./ReactComponent"),o=e("./ReactClass"),a=e("./ReactDOMFactories"),s=e("./ReactElement"),u=(e("./ReactElementValidator"),e("./ReactPropTypes")),l=e("./ReactVersion"),c=e("./Object.assign"),f=e("./onlyChild"),p=s.createElement,d=s.createFactory,h=s.cloneElement,m={Children:{map:r.map,forEach:r.forEach,count:r.count,toArray:r.toArray,only:f},Component:i,createElement:p,cloneElement:h,isValidElement:s.isValidElement,PropTypes:u,createClass:o.createClass,createFactory:d,createMixin:function(e){return e},DOM:a,version:l,__spread:c};t.exports=m},{"./Object.assign":704,"./ReactChildren":710,"./ReactClass":711,"./ReactComponent":712,"./ReactDOMFactories":720,"./ReactElement":734,"./ReactElementValidator":735,"./ReactPropTypes":756,"./ReactVersion":766,"./onlyChild":803}],746:[function(e,t,n){"use strict";var r=e("./adler32"),i=/\/?>/,o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(i," "+o.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var i=r(e);return i===n}};t.exports=o},{"./adler32":785}],747:[function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function i(e){return e?e.nodeType===q?e.documentElement:e.firstChild:null}function o(e){var t=i(e);return t&&Y.getID(t)}function a(e){var t=s(e);if(t)if(H.hasOwnProperty(t)){var n=H[t];n!==e&&(f(n,t)?D(!1):void 0,H[t]=e)}else H[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(U)||""}function u(e,t){var n=s(e);n!==t&&delete H[n],e.setAttribute(U,t),H[t]=e}function l(e){return H.hasOwnProperty(e)&&f(H[e],e)||(H[e]=Y.findReactNodeByID(e)),H[e]}function c(e){var t=R.get(e)._rootNodeID;return x.isNullComponentID(t)?null:(H.hasOwnProperty(t)&&f(H[t],t)||(H[t]=Y.findReactNodeByID(t)),H[t])}function f(e,t){if(e){s(e)!==t?D(!1):void 0;var n=Y.findReactContainerForID(t);if(n&&N(n,e))return!0}return!1}function p(e){delete H[e]}function d(e){var t=H[e];return t&&f(t,e)?void(Q=t):!1}function h(e){Q=null,E.traverseAncestors(e,d);var t=Q;return Q=null,t}function m(e,t,n,r,i,o){w.useCreateElement&&(o=T({},o),n.nodeType===q?o[W]=n:o[W]=n.ownerDocument);var a=S.mountComponent(e,t,r,o);e._renderedComponent._topLevelWrapper=e,Y._mountImageIntoNode(a,n,i,r)}function v(e,t,n,r,i){var o=A.ReactReconcileTransaction.getPooled(r);o.perform(m,null,e,t,n,o,r,i),A.ReactReconcileTransaction.release(o)}function y(e,t){for(S.unmountComponent(e),t.nodeType===q&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function g(e){var t=o(e);return t?t!==E.getReactRootIDFromNodeID(t):!1}function b(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=s(e);if(t){var n,r=E.getReactRootIDFromNodeID(t),i=e;do if(n=s(i),i=i.parentNode,null==i)return null;while(n!==r);if(i===$[r])return e}}return null}var _=e("./DOMProperty"),j=e("./ReactBrowserEventEmitter"),w=(e("./ReactCurrentOwner"),e("./ReactDOMFeatureFlags")),C=e("./ReactElement"),x=e("./ReactEmptyComponentRegistry"),E=e("./ReactInstanceHandles"),R=e("./ReactInstanceMap"),O=e("./ReactMarkupChecksum"),P=e("./ReactPerf"),S=e("./ReactReconciler"),k=e("./ReactUpdateQueue"),A=e("./ReactUpdates"),T=e("./Object.assign"),M=e("fbjs/lib/emptyObject"),N=e("fbjs/lib/containsNode"),I=e("./instantiateReactComponent"),D=e("fbjs/lib/invariant"),F=e("./setInnerHTML"),L=e("./shouldUpdateReactComponent"),U=(e("./validateDOMNesting"),e("fbjs/lib/warning"),_.ID_ATTRIBUTE_NAME),H={},B=1,q=9,V=11,W="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),K={},$={},z=[],Q=null,G=function(){};G.prototype.isReactComponent={},G.prototype.render=function(){return this.props};var Y={TopLevelWrapper:G,_instancesByReactRootID:K,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return Y.scrollMonitor(n,function(){k.enqueueElementInternal(e,t),r&&k.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){!t||t.nodeType!==B&&t.nodeType!==q&&t.nodeType!==V?D(!1):void 0,j.ensureScrollValueMonitoring();var n=Y.registerContainer(t);return K[n]=e,n},_renderNewRootComponent:function(e,t,n,r){var i=I(e,null),o=Y._registerComponent(i,t);return A.batchedUpdates(v,i,o,t,n,r),i},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?D(!1):void 0,Y._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){C.isValidElement(t)?void 0:D(!1);var a=new C(G,null,null,null,null,null,t),u=K[o(n)];if(u){var l=u._currentElement,c=l.props;if(L(c,t)){var f=u._renderedComponent.getPublicInstance(),p=r&&function(){r.call(f)};return Y._updateRootComponent(u,a,n,p),f}Y.unmountComponentAtNode(n)}var d=i(n),h=d&&!!s(d),m=g(n),v=h&&!u&&!m,y=Y._renderNewRootComponent(a,n,v,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):M)._renderedComponent.getPublicInstance();return r&&r.call(y),y},render:function(e,t,n){return Y._renderSubtreeIntoContainer(null,e,t,n)},registerContainer:function(e){var t=o(e);return t&&(t=E.getReactRootIDFromNodeID(t)),t||(t=E.createReactRootID()),$[t]=e,t},unmountComponentAtNode:function(e){!e||e.nodeType!==B&&e.nodeType!==q&&e.nodeType!==V?D(!1):void 0;var t=o(e),n=K[t];if(!n){var r=(g(e),s(e));r&&r===E.getReactRootIDFromNodeID(r);return!1}return A.batchedUpdates(y,n,e),delete K[t],delete $[t],!0},findReactContainerForID:function(e){var t=E.getReactRootIDFromNodeID(e),n=$[t];return n},findReactNodeByID:function(e){var t=Y.findReactContainerForID(e);return Y.findComponentRoot(t,e)},getFirstReactDOM:function(e){return b(e)},findComponentRoot:function(e,t){var n=z,r=0,i=h(t)||e;for(n[0]=i.firstChild,n.length=1;r<n.length;){for(var o,a=n[r++];a;){var s=Y.getID(a);s?t===s?o=a:E.isAncestorIDOf(s,t)&&(n.length=r=0,n.push(a.firstChild)):n.push(a.firstChild),a=a.nextSibling}if(o)return n.length=0,o}n.length=0,D(!1)},_mountImageIntoNode:function(e,t,n,o){if(!t||t.nodeType!==B&&t.nodeType!==q&&t.nodeType!==V?D(!1):void 0,n){var a=i(t);if(O.canReuseMarkup(e,a))return;var s=a.getAttribute(O.CHECKSUM_ATTR_NAME);a.removeAttribute(O.CHECKSUM_ATTR_NAME);var u=a.outerHTML;a.setAttribute(O.CHECKSUM_ATTR_NAME,s);var l=e,c=r(l,u);" (client) "+l.substring(c-20,c+20)+"\n (server) "+u.substring(c-20,c+20);t.nodeType===q?D(!1):void 0}if(t.nodeType===q?D(!1):void 0,o.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else F(t,e)},ownerDocumentContextKey:W,getReactRootID:o,getID:a,setID:u,getNode:l,getNodeFromInstance:c,isValid:f,purgeID:p};P.measureMethods(Y,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=Y},{"./DOMProperty":691,"./Object.assign":704,"./ReactBrowserEventEmitter":708,"./ReactCurrentOwner":716,"./ReactDOMFeatureFlags":721,"./ReactElement":734,"./ReactEmptyComponentRegistry":737,"./ReactInstanceHandles":743,"./ReactInstanceMap":744,"./ReactMarkupChecksum":746,"./ReactPerf":753,"./ReactReconciler":758,"./ReactUpdateQueue":764,"./ReactUpdates":765,"./instantiateReactComponent":800,"./setInnerHTML":806,"./shouldUpdateReactComponent":808,"./validateDOMNesting":810,"fbjs/lib/containsNode":300,"fbjs/lib/emptyObject":304,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],748:[function(e,t,n){"use strict";function r(e,t,n){v.push({parentID:e,parentNode:null,type:f.INSERT_MARKUP,markupIndex:y.push(t)-1,content:null,fromIndex:null,toIndex:n})}function i(e,t,n){v.push({parentID:e,parentNode:null,type:f.MOVE_EXISTING,markupIndex:null,content:null,fromIndex:t,toIndex:n})}function o(e,t){v.push({parentID:e,parentNode:null,type:f.REMOVE_NODE,markupIndex:null,content:null,fromIndex:t,toIndex:null})}function a(e,t){v.push({parentID:e,parentNode:null,type:f.SET_MARKUP,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function s(e,t){v.push({parentID:e,parentNode:null,type:f.TEXT_CONTENT,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function u(){v.length&&(c.processChildrenUpdates(v,y),l())}function l(){v.length=0,y.length=0}var c=e("./ReactComponentEnvironment"),f=e("./ReactMultiChildUpdateTypes"),p=(e("./ReactCurrentOwner"),e("./ReactReconciler")),d=e("./ReactChildReconciler"),h=e("./flattenChildren"),m=0,v=[],y=[],g={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return d.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r){var i;return i=h(t),d.updateChildren(e,i,n,r)},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var i=[],o=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=this._rootNodeID+a,l=p.mountComponent(s,u,t,n);s._mountIndex=o++,i.push(l)}return i},updateTextContent:function(e){m++;var t=!0;try{var n=this._renderedChildren;d.unmountChildren(n);for(var r in n)n.hasOwnProperty(r)&&this._unmountChild(n[r]);this.setTextContent(e),t=!1}finally{m--,m||(t?l():u())}},updateMarkup:function(e){m++;var t=!0;try{var n=this._renderedChildren;d.unmountChildren(n);for(var r in n)n.hasOwnProperty(r)&&this._unmountChildByName(n[r],r);this.setMarkup(e),t=!1}finally{m--,m||(t?l():u())}},updateChildren:function(e,t,n){m++;var r=!0;try{this._updateChildren(e,t,n),r=!1}finally{m--,m||(r?l():u())}},_updateChildren:function(e,t,n){var r=this._renderedChildren,i=this._reconcilerUpdateChildren(r,e,t,n);if(this._renderedChildren=i,i||r){var o,a=0,s=0;for(o in i)if(i.hasOwnProperty(o)){var u=r&&r[o],l=i[o];u===l?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChild(u)),this._mountChildByNameAtIndex(l,o,s,t,n)),s++}for(o in r)!r.hasOwnProperty(o)||i&&i.hasOwnProperty(o)||this._unmountChild(r[o])}},unmountChildren:function(){var e=this._renderedChildren;d.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&i(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){r(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){o(this._rootNodeID,e._mountIndex)},setTextContent:function(e){s(this._rootNodeID,e)},setMarkup:function(e){a(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,r,i){var o=this._rootNodeID+t,a=p.mountComponent(e,o,r,i);e._mountIndex=n,this.createChild(e,a)},_unmountChild:function(e){this.removeChild(e),e._mountIndex=null}}};t.exports=g},{"./ReactChildReconciler":709,"./ReactComponentEnvironment":714,"./ReactCurrentOwner":716,"./ReactMultiChildUpdateTypes":749,"./ReactReconciler":758,"./flattenChildren":791}],749:[function(e,t,n){"use strict";var r=e("fbjs/lib/keyMirror"),i=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});t.exports=i},{"fbjs/lib/keyMirror":314}],750:[function(e,t,n){"use strict";function r(e){if("function"==typeof e.type)return e.type;var t=e.type,n=f[t];return null==n&&(f[t]=n=l(t)),n}function i(e){return c?void 0:u(!1),new c(e.type,e.props)}function o(e){return new p(e)}function a(e){return e instanceof p}var s=e("./Object.assign"),u=e("fbjs/lib/invariant"),l=null,c=null,f={},p=null,d={injectGenericComponentClass:function(e){c=e},injectTextComponentClass:function(e){p=e},injectComponentClasses:function(e){s(f,e)}},h={getComponentClassForElement:r,createInternalComponent:i,createInstanceForText:o,isTextComponent:a,injection:d};t.exports=h},{"./Object.assign":704,"fbjs/lib/invariant":311}],751:[function(e,t,n){"use strict";function r(e,t){}var i=(e("fbjs/lib/warning"),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e,t){r(e,"replaceState")},enqueueSetState:function(e,t){r(e,"setState")},enqueueSetProps:function(e,t){r(e,"setProps")},enqueueReplaceProps:function(e,t){r(e,"replaceProps")}});t.exports=i},{"fbjs/lib/warning":322}],752:[function(e,t,n){"use strict";var r=e("fbjs/lib/invariant"),i={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){i.isValidOwner(n)?void 0:r(!1),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){i.isValidOwner(n)?void 0:r(!1),n.getPublicInstance().refs[t]===e.getPublicInstance()&&n.detachRef(t)}};t.exports=i},{"fbjs/lib/invariant":311}],753:[function(e,t,n){"use strict";function r(e,t,n){return n}var i={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){i.storedMeasure=e}}};t.exports=i},{}],754:[function(e,t,n){"use strict";var r={};t.exports=r},{}],755:[function(e,t,n){"use strict";var r=e("fbjs/lib/keyMirror"),i=r({prop:null,context:null,childContext:null});t.exports=i},{"fbjs/lib/keyMirror":314}],756:[function(e,t,n){"use strict";function r(e){function t(t,n,r,i,o,a){if(i=i||w,a=a||r,null==n[r]){var s=b[o];return t?new Error("Required "+s+" `"+a+"` was not specified in "+("`"+i+"`.")):null}return e(n,r,i,o,a)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e){function t(t,n,r,i,o){var a=t[n],s=m(a);if(s!==e){var u=b[i],l=v(a);return new Error("Invalid "+u+" `"+o+"` of type "+("`"+l+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return r(t)}function o(){return r(_.thatReturns(null))}function a(e){function t(t,n,r,i,o){var a=t[n];if(!Array.isArray(a)){var s=b[i],u=m(a);return new Error("Invalid "+s+" `"+o+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<a.length;l++){var c=e(a,l,r,i,o+"["+l+"]");if(c instanceof Error)return c}return null}return r(t)}function s(){function e(e,t,n,r,i){if(!g.isValidElement(e[t])){var o=b[r];return new Error("Invalid "+o+" `"+i+"` supplied to "+("`"+n+"`, expected a single ReactElement."))}return null}return r(e)}function u(e){function t(t,n,r,i,o){if(!(t[n]instanceof e)){var a=b[i],s=e.name||w,u=y(t[n]);return new Error("Invalid "+a+" `"+o+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+s+"`."))}return null}return r(t)}function l(e){function t(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(a===e[s])return null;var u=b[i],l=JSON.stringify(e);return new Error("Invalid "+u+" `"+o+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+l+"."))}return r(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOf, expected an instance of array.")})}function c(e){function t(t,n,r,i,o){var a=t[n],s=m(a);if("object"!==s){var u=b[i];return new Error("Invalid "+u+" `"+o+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an object."))}for(var l in a)if(a.hasOwnProperty(l)){var c=e(a,l,r,i,o+"."+l);if(c instanceof Error)return c}return null}return r(t)}function f(e){function t(t,n,r,i,o){for(var a=0;a<e.length;a++){var s=e[a];if(null==s(t,n,r,i,o))return null}var u=b[i];return new Error("Invalid "+u+" `"+o+"` supplied to "+("`"+r+"`."))}return r(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOfType, expected an instance of array.")})}function p(){function e(e,t,n,r,i){if(!h(e[t])){var o=b[r];return new Error("Invalid "+o+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return null}return r(e)}function d(e){function t(t,n,r,i,o){var a=t[n],s=m(a);if("object"!==s){var u=b[i];return new Error("Invalid "+u+" `"+o+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."))}for(var l in e){var c=e[l];if(c){var f=c(a,l,r,i,o+"."+l);if(f)return f}}return null}return r(t)}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||g.isValidElement(e))return!0;var t=j(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!h(n.value))return!1}else for(;!(n=r.next()).done;){var i=n.value;if(i&&!h(i[1]))return!1}return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function v(e){var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){return e.constructor&&e.constructor.name?e.constructor.name:"<<anonymous>>"}var g=e("./ReactElement"),b=e("./ReactPropTypeLocationNames"),_=e("fbjs/lib/emptyFunction"),j=e("./getIteratorFn"),w="<<anonymous>>",C={array:i("array"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),any:o(),arrayOf:a,element:s(),instanceOf:u,node:p(),objectOf:c,oneOf:l,oneOfType:f,shape:d};t.exports=C},{"./ReactElement":734,"./ReactPropTypeLocationNames":754,"./getIteratorFn":797,"fbjs/lib/emptyFunction":303}],757:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=i.getPooled(null),this.useCreateElement=!e&&s.useCreateElement}var i=e("./CallbackQueue"),o=e("./PooledClass"),a=e("./ReactBrowserEventEmitter"),s=e("./ReactDOMFeatureFlags"),u=e("./ReactInputSelection"),l=e("./Transaction"),c=e("./Object.assign"),f={initialize:u.getSelectionInformation,close:u.restoreSelection},p={initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[f,p,d],m={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null}};c(r.prototype,l.Mixin,m),o.addPoolingTo(r),t.exports=r},{"./CallbackQueue":687,"./Object.assign":704,"./PooledClass":705,"./ReactBrowserEventEmitter":708,"./ReactDOMFeatureFlags":721,"./ReactInputSelection":742,"./Transaction":782}],758:[function(e,t,n){"use strict";function r(){i.attachRefs(this,this._currentElement)}var i=e("./ReactRef"),o={mountComponent:function(e,t,n,i){var o=e.mountComponent(t,n,i);return e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e),o},unmountComponent:function(e){i.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,o){var a=e._currentElement;if(t!==a||o!==e._context){var s=i.shouldUpdateRefs(a,t);s&&i.detachRefs(e,a),e.receiveComponent(t,n,o),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};t.exports=o},{"./ReactRef":759}],759:[function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):o.addComponentAsRefTo(t,e,n)}function i(e,t,n){"function"==typeof e?e(null):o.removeComponentAsRefFrom(t,e,n)}var o=e("./ReactOwner"),a={};a.attachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null===e||e===!1,r=null===t||t===!1;return n||r||t._owner!==e._owner||t.ref!==e.ref},a.detachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&i(n,e,t._owner)}},t.exports=a},{"./ReactOwner":752}],760:[function(e,t,n){"use strict";var r={injectCreateReactRootIndex:function(e){i.createReactRootIndex=e}},i={createReactRootIndex:null,injection:r};t.exports=i},{}],761:[function(e,t,n){"use strict";var r={isBatchingUpdates:!1,batchedUpdates:function(e){}};t.exports=r},{}],762:[function(e,t,n){"use strict";function r(e){a.isValidElement(e)?void 0:h(!1);var t;try{f.injection.injectBatchingStrategy(l);var n=s.createReactRootID();return t=c.getPooled(!1),t.perform(function(){var r=d(e,null),i=r.mountComponent(n,t,p);return u.addChecksumToMarkup(i)},null)}finally{c.release(t),f.injection.injectBatchingStrategy(o)}}function i(e){a.isValidElement(e)?void 0:h(!1);var t;try{f.injection.injectBatchingStrategy(l);var n=s.createReactRootID();return t=c.getPooled(!0),t.perform(function(){var r=d(e,null);return r.mountComponent(n,t,p)},null)}finally{c.release(t),f.injection.injectBatchingStrategy(o)}}var o=e("./ReactDefaultBatchingStrategy"),a=e("./ReactElement"),s=e("./ReactInstanceHandles"),u=e("./ReactMarkupChecksum"),l=e("./ReactServerBatchingStrategy"),c=e("./ReactServerRenderingTransaction"),f=e("./ReactUpdates"),p=e("fbjs/lib/emptyObject"),d=e("./instantiateReactComponent"),h=e("fbjs/lib/invariant");t.exports={renderToString:r,renderToStaticMarkup:i}},{"./ReactDefaultBatchingStrategy":730,"./ReactElement":734,"./ReactInstanceHandles":743,"./ReactMarkupChecksum":746,"./ReactServerBatchingStrategy":761,"./ReactServerRenderingTransaction":763,"./ReactUpdates":765,"./instantiateReactComponent":800,"fbjs/lib/emptyObject":304,"fbjs/lib/invariant":311}],763:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=o.getPooled(null),this.useCreateElement=!1}var i=e("./PooledClass"),o=e("./CallbackQueue"),a=e("./Transaction"),s=e("./Object.assign"),u=e("fbjs/lib/emptyFunction"),l={initialize:function(){this.reactMountReady.reset()},close:u},c=[l],f={getTransactionWrappers:function(){return c},getReactMountReady:function(){return this.reactMountReady},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};s(r.prototype,a.Mixin,f),i.addPoolingTo(r),t.exports=r},{"./CallbackQueue":687,"./Object.assign":704,"./PooledClass":705,"./Transaction":782,"fbjs/lib/emptyFunction":303}],764:[function(e,t,n){"use strict";function r(e){s.enqueueUpdate(e)}function i(e,t){var n=a.get(e);return n?n:null}var o=(e("./ReactCurrentOwner"),e("./ReactElement")),a=e("./ReactInstanceMap"),s=e("./ReactUpdates"),u=e("./Object.assign"),l=e("fbjs/lib/invariant"),c=(e("fbjs/lib/warning"),{isMounted:function(e){var t=a.get(e);return t?!!t._renderedComponent:!1},enqueueCallback:function(e,t){"function"!=typeof t?l(!1):void 0;var n=i(e);return n?(n._pendingCallbacks?n._pendingCallbacks.push(t):n._pendingCallbacks=[t],void r(n)):null},enqueueCallbackInternal:function(e,t){"function"!=typeof t?l(!1):void 0,e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=i(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=i(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=i(e,"setState");if(n){var o=n._pendingStateQueue||(n._pendingStateQueue=[]);o.push(t),r(n)}},enqueueSetProps:function(e,t){var n=i(e,"setProps");n&&c.enqueueSetPropsInternal(n,t)},enqueueSetPropsInternal:function(e,t){
var n=e._topLevelWrapper;n?void 0:l(!1);var i=n._pendingElement||n._currentElement,a=i.props,s=u({},a.props,t);n._pendingElement=o.cloneAndReplaceProps(i,o.cloneAndReplaceProps(a,s)),r(n)},enqueueReplaceProps:function(e,t){var n=i(e,"replaceProps");n&&c.enqueueReplacePropsInternal(n,t)},enqueueReplacePropsInternal:function(e,t){var n=e._topLevelWrapper;n?void 0:l(!1);var i=n._pendingElement||n._currentElement,a=i.props;n._pendingElement=o.cloneAndReplaceProps(i,o.cloneAndReplaceProps(a,t)),r(n)},enqueueElementInternal:function(e,t){e._pendingElement=t,r(e)}});t.exports=c},{"./Object.assign":704,"./ReactCurrentOwner":716,"./ReactElement":734,"./ReactInstanceMap":744,"./ReactUpdates":765,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],765:[function(e,t,n){"use strict";function r(){R.ReactReconcileTransaction&&_?void 0:v(!1)}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=R.ReactReconcileTransaction.getPooled(!1)}function o(e,t,n,i,o,a){r(),_.batchedUpdates(e,t,n,i,o,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==y.length?v(!1):void 0,y.sort(a);for(var n=0;t>n;n++){var r=y[n],i=r._pendingCallbacks;if(r._pendingCallbacks=null,d.performUpdateIfNecessary(r,e.reconcileTransaction),i)for(var o=0;o<i.length;o++)e.callbackQueue.enqueue(i[o],r.getPublicInstance())}}function u(e){return r(),_.isBatchingUpdates?void y.push(e):void _.batchedUpdates(u,e)}function l(e,t){_.isBatchingUpdates?void 0:v(!1),g.enqueue(e,t),b=!0}var c=e("./CallbackQueue"),f=e("./PooledClass"),p=e("./ReactPerf"),d=e("./ReactReconciler"),h=e("./Transaction"),m=e("./Object.assign"),v=e("fbjs/lib/invariant"),y=[],g=c.getPooled(),b=!1,_=null,j={initialize:function(){this.dirtyComponentsLength=y.length},close:function(){this.dirtyComponentsLength!==y.length?(y.splice(0,this.dirtyComponentsLength),x()):y.length=0}},w={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},C=[j,w];m(i.prototype,h.Mixin,{getTransactionWrappers:function(){return C},destructor:function(){this.dirtyComponentsLength=null,c.release(this.callbackQueue),this.callbackQueue=null,R.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return h.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),f.addPoolingTo(i);var x=function(){for(;y.length||b;){if(y.length){var e=i.getPooled();e.perform(s,null,e),i.release(e)}if(b){b=!1;var t=g;g=c.getPooled(),t.notifyAll(),c.release(t)}}};x=p.measure("ReactUpdates","flushBatchedUpdates",x);var E={injectReconcileTransaction:function(e){e?void 0:v(!1),R.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:v(!1),"function"!=typeof e.batchedUpdates?v(!1):void 0,"boolean"!=typeof e.isBatchingUpdates?v(!1):void 0,_=e}},R={ReactReconcileTransaction:null,batchedUpdates:o,enqueueUpdate:u,flushBatchedUpdates:x,injection:E,asap:l};t.exports=R},{"./CallbackQueue":687,"./Object.assign":704,"./PooledClass":705,"./ReactPerf":753,"./ReactReconciler":758,"./Transaction":782,"fbjs/lib/invariant":311}],766:[function(e,t,n){"use strict";t.exports="0.14.7"},{}],767:[function(e,t,n){"use strict";var r=e("./DOMProperty"),i=r.injection.MUST_USE_ATTRIBUTE,o={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},a={Properties:{clipPath:i,cx:i,cy:i,d:i,dx:i,dy:i,fill:i,fillOpacity:i,fontFamily:i,fontSize:i,fx:i,fy:i,gradientTransform:i,gradientUnits:i,markerEnd:i,markerMid:i,markerStart:i,offset:i,opacity:i,patternContentUnits:i,patternUnits:i,points:i,preserveAspectRatio:i,r:i,rx:i,ry:i,spreadMethod:i,stopColor:i,stopOpacity:i,stroke:i,strokeDasharray:i,strokeLinecap:i,strokeOpacity:i,strokeWidth:i,textAnchor:i,transform:i,version:i,viewBox:i,x1:i,x2:i,x:i,xlinkActuate:i,xlinkArcrole:i,xlinkHref:i,xlinkRole:i,xlinkShow:i,xlinkTitle:i,xlinkType:i,xmlBase:i,xmlLang:i,xmlSpace:i,y1:i,y2:i,y:i},DOMAttributeNamespaces:{xlinkActuate:o.xlink,xlinkArcrole:o.xlink,xlinkHref:o.xlink,xlinkRole:o.xlink,xlinkShow:o.xlink,xlinkTitle:o.xlink,xlinkType:o.xlink,xmlBase:o.xml,xmlLang:o.xml,xmlSpace:o.xml},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space"}};t.exports=a},{"./DOMProperty":691}],768:[function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function i(e,t){if(_||null==y||y!==c())return null;var n=r(y);if(!b||!d(b,n)){b=n;var i=l.getPooled(v.select,g,e,t);return i.type="select",i.target=y,a.accumulateTwoPhaseDispatches(i),i}return null}var o=e("./EventConstants"),a=e("./EventPropagators"),s=e("fbjs/lib/ExecutionEnvironment"),u=e("./ReactInputSelection"),l=e("./SyntheticEvent"),c=e("fbjs/lib/getActiveElement"),f=e("./isTextInputElement"),p=e("fbjs/lib/keyOf"),d=e("fbjs/lib/shallowEqual"),h=o.topLevelTypes,m=s.canUseDOM&&"documentMode"in document&&document.documentMode<=11,v={select:{phasedRegistrationNames:{bubbled:p({onSelect:null}),captured:p({onSelectCapture:null})},dependencies:[h.topBlur,h.topContextMenu,h.topFocus,h.topKeyDown,h.topMouseDown,h.topMouseUp,h.topSelectionChange]}},y=null,g=null,b=null,_=!1,j=!1,w=p({onSelect:null}),C={eventTypes:v,extractEvents:function(e,t,n,r,o){if(!j)return null;switch(e){case h.topFocus:(f(t)||"true"===t.contentEditable)&&(y=t,g=n,b=null);break;case h.topBlur:y=null,g=null,b=null;break;case h.topMouseDown:_=!0;break;case h.topContextMenu:case h.topMouseUp:return _=!1,i(r,o);case h.topSelectionChange:if(m)break;case h.topKeyDown:case h.topKeyUp:return i(r,o)}return null},didPutListener:function(e,t,n){t===w&&(j=!0)}};t.exports=C},{"./EventConstants":696,"./EventPropagators":700,"./ReactInputSelection":742,"./SyntheticEvent":774,"./isTextInputElement":802,"fbjs/lib/ExecutionEnvironment":297,"fbjs/lib/getActiveElement":306,"fbjs/lib/keyOf":315,"fbjs/lib/shallowEqual":320}],769:[function(e,t,n){"use strict";var r=Math.pow(2,53),i={createReactRootIndex:function(){return Math.ceil(Math.random()*r)}};t.exports=i},{}],770:[function(e,t,n){"use strict";var r=e("./EventConstants"),i=e("fbjs/lib/EventListener"),o=e("./EventPropagators"),a=e("./ReactMount"),s=e("./SyntheticClipboardEvent"),u=e("./SyntheticEvent"),l=e("./SyntheticFocusEvent"),c=e("./SyntheticKeyboardEvent"),f=e("./SyntheticMouseEvent"),p=e("./SyntheticDragEvent"),d=e("./SyntheticTouchEvent"),h=e("./SyntheticUIEvent"),m=e("./SyntheticWheelEvent"),v=e("fbjs/lib/emptyFunction"),y=e("./getEventCharCode"),g=e("fbjs/lib/invariant"),b=e("fbjs/lib/keyOf"),_=r.topLevelTypes,j={abort:{phasedRegistrationNames:{bubbled:b({onAbort:!0}),captured:b({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:b({onBlur:!0}),captured:b({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:b({onCanPlay:!0}),captured:b({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:b({onCanPlayThrough:!0}),captured:b({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:b({onClick:!0}),captured:b({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:b({onContextMenu:!0}),captured:b({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:b({onCopy:!0}),captured:b({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:b({onCut:!0}),captured:b({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:b({onDoubleClick:!0}),captured:b({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:b({onDrag:!0}),captured:b({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:b({onDragEnd:!0}),captured:b({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:b({onDragEnter:!0}),captured:b({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:b({onDragExit:!0}),captured:b({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:b({onDragLeave:!0}),captured:b({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:b({onDragOver:!0}),captured:b({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:b({onDragStart:!0}),captured:b({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:b({onDrop:!0}),captured:b({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:b({onDurationChange:!0}),captured:b({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:b({onEmptied:!0}),captured:b({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:b({onEncrypted:!0}),captured:b({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:b({onEnded:!0}),captured:b({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:b({onError:!0}),captured:b({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:b({onFocus:!0}),captured:b({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:b({onInput:!0}),captured:b({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:b({onKeyDown:!0}),captured:b({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:b({onKeyPress:!0}),captured:b({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:b({onKeyUp:!0}),captured:b({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:b({onLoad:!0}),captured:b({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:b({onLoadedData:!0}),captured:b({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:b({onLoadedMetadata:!0}),captured:b({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:b({onLoadStart:!0}),captured:b({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:b({onMouseDown:!0}),captured:b({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:b({onMouseMove:!0}),captured:b({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:b({onMouseOut:!0}),captured:b({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:b({onMouseOver:!0}),captured:b({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:b({onMouseUp:!0}),captured:b({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:b({onPaste:!0}),captured:b({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:b({onPause:!0}),captured:b({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:b({onPlay:!0}),captured:b({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:b({onPlaying:!0}),captured:b({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:b({onProgress:!0}),captured:b({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:b({onRateChange:!0}),captured:b({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:b({onReset:!0}),captured:b({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:b({onScroll:!0}),captured:b({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:b({onSeeked:!0}),captured:b({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:b({onSeeking:!0}),captured:b({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:b({onStalled:!0}),captured:b({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:b({onSubmit:!0}),captured:b({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:b({onSuspend:!0}),captured:b({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:b({onTimeUpdate:!0}),captured:b({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:b({onTouchCancel:!0}),captured:b({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:b({onTouchEnd:!0}),captured:b({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:b({onTouchMove:!0}),captured:b({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:b({onTouchStart:!0}),captured:b({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:b({onVolumeChange:!0}),captured:b({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:b({onWaiting:!0}),captured:b({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:b({onWheel:!0}),captured:b({onWheelCapture:!0})}}},w={topAbort:j.abort,topBlur:j.blur,topCanPlay:j.canPlay,topCanPlayThrough:j.canPlayThrough,topClick:j.click,topContextMenu:j.contextMenu,topCopy:j.copy,topCut:j.cut,topDoubleClick:j.doubleClick,topDrag:j.drag,topDragEnd:j.dragEnd,topDragEnter:j.dragEnter,topDragExit:j.dragExit,topDragLeave:j.dragLeave,topDragOver:j.dragOver,topDragStart:j.dragStart,topDrop:j.drop,topDurationChange:j.durationChange,topEmptied:j.emptied,topEncrypted:j.encrypted,topEnded:j.ended,topError:j.error,topFocus:j.focus,topInput:j.input,topKeyDown:j.keyDown,topKeyPress:j.keyPress,topKeyUp:j.keyUp,topLoad:j.load,topLoadedData:j.loadedData,topLoadedMetadata:j.loadedMetadata,topLoadStart:j.loadStart,topMouseDown:j.mouseDown,topMouseMove:j.mouseMove,topMouseOut:j.mouseOut,topMouseOver:j.mouseOver,topMouseUp:j.mouseUp,topPaste:j.paste,topPause:j.pause,topPlay:j.play,topPlaying:j.playing,topProgress:j.progress,topRateChange:j.rateChange,topReset:j.reset,topScroll:j.scroll,topSeeked:j.seeked,topSeeking:j.seeking,topStalled:j.stalled,topSubmit:j.submit,topSuspend:j.suspend,topTimeUpdate:j.timeUpdate,topTouchCancel:j.touchCancel,topTouchEnd:j.touchEnd,topTouchMove:j.touchMove,topTouchStart:j.touchStart,topVolumeChange:j.volumeChange,topWaiting:j.waiting,topWheel:j.wheel};for(var C in w)w[C].dependencies=[C];var x=b({onClick:null}),E={},R={eventTypes:j,extractEvents:function(e,t,n,r,i){var a=w[e];if(!a)return null;var v;switch(e){case _.topAbort:case _.topCanPlay:case _.topCanPlayThrough:case _.topDurationChange:case _.topEmptied:case _.topEncrypted:case _.topEnded:case _.topError:case _.topInput:case _.topLoad:case _.topLoadedData:case _.topLoadedMetadata:case _.topLoadStart:case _.topPause:case _.topPlay:case _.topPlaying:case _.topProgress:case _.topRateChange:case _.topReset:case _.topSeeked:case _.topSeeking:case _.topStalled:case _.topSubmit:case _.topSuspend:case _.topTimeUpdate:case _.topVolumeChange:case _.topWaiting:v=u;break;case _.topKeyPress:if(0===y(r))return null;case _.topKeyDown:case _.topKeyUp:v=c;break;case _.topBlur:case _.topFocus:v=l;break;case _.topClick:if(2===r.button)return null;case _.topContextMenu:case _.topDoubleClick:case _.topMouseDown:case _.topMouseMove:case _.topMouseOut:case _.topMouseOver:case _.topMouseUp:v=f;break;case _.topDrag:case _.topDragEnd:case _.topDragEnter:case _.topDragExit:case _.topDragLeave:case _.topDragOver:case _.topDragStart:case _.topDrop:v=p;break;case _.topTouchCancel:case _.topTouchEnd:case _.topTouchMove:case _.topTouchStart:v=d;break;case _.topScroll:v=h;break;case _.topWheel:v=m;break;case _.topCopy:case _.topCut:case _.topPaste:v=s}v?void 0:g(!1);var b=v.getPooled(a,n,r,i);return o.accumulateTwoPhaseDispatches(b),b},didPutListener:function(e,t,n){if(t===x){var r=a.getNode(e);E[e]||(E[e]=i.listen(r,"click",v))}},willDeleteListener:function(e,t){t===x&&(E[e].remove(),delete E[e])}};t.exports=R},{"./EventConstants":696,"./EventPropagators":700,"./ReactMount":747,"./SyntheticClipboardEvent":771,"./SyntheticDragEvent":773,"./SyntheticEvent":774,"./SyntheticFocusEvent":775,"./SyntheticKeyboardEvent":777,"./SyntheticMouseEvent":778,"./SyntheticTouchEvent":779,"./SyntheticUIEvent":780,"./SyntheticWheelEvent":781,"./getEventCharCode":793,"fbjs/lib/EventListener":296,"fbjs/lib/emptyFunction":303,"fbjs/lib/invariant":311,"fbjs/lib/keyOf":315}],771:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticEvent"),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};i.augmentClass(r,o),t.exports=r},{"./SyntheticEvent":774}],772:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticEvent"),o={data:null};i.augmentClass(r,o),t.exports=r},{"./SyntheticEvent":774}],773:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticMouseEvent"),o={dataTransfer:null};i.augmentClass(r,o),t.exports=r},{"./SyntheticMouseEvent":778}],774:[function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;u?this.isDefaultPrevented=a.thatReturnsTrue:this.isDefaultPrevented=a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var i=e("./PooledClass"),o=e("./Object.assign"),a=e("fbjs/lib/emptyFunction"),s=(e("fbjs/lib/warning"),{type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);o(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,i.addPoolingTo(e,i.fourArgumentPooler)},i.addPoolingTo(r,i.fourArgumentPooler),t.exports=r},{"./Object.assign":704,"./PooledClass":705,"fbjs/lib/emptyFunction":303,"fbjs/lib/warning":322}],775:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticUIEvent"),o={relatedTarget:null};i.augmentClass(r,o),t.exports=r},{"./SyntheticUIEvent":780}],776:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticEvent"),o={data:null};i.augmentClass(r,o),t.exports=r},{"./SyntheticEvent":774}],777:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticUIEvent"),o=e("./getEventCharCode"),a=e("./getEventKey"),s=e("./getEventModifierState"),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};i.augmentClass(r,u),t.exports=r},{"./SyntheticUIEvent":780,"./getEventCharCode":793,"./getEventKey":794,"./getEventModifierState":795}],778:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticUIEvent"),o=e("./ViewportMetrics"),a=e("./getEventModifierState"),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};i.augmentClass(r,s),t.exports=r},{"./SyntheticUIEvent":780,"./ViewportMetrics":783,"./getEventModifierState":795}],779:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticUIEvent"),o=e("./getEventModifierState"),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};i.augmentClass(r,a),t.exports=r},{"./SyntheticUIEvent":780,"./getEventModifierState":795}],780:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticEvent"),o=e("./getEventTarget"),a={view:function(e){if(e.view)return e.view;var t=o(e);if(null!=t&&t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};i.augmentClass(r,a),t.exports=r},{"./SyntheticEvent":774,"./getEventTarget":796}],781:[function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=e("./SyntheticMouseEvent"),o={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};i.augmentClass(r,o),t.exports=r},{"./SyntheticMouseEvent":778}],782:[function(e,t,n){"use strict";var r=e("fbjs/lib/invariant"),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,i,o,a,s,u){this.isInTransaction()?r(!1):void 0;var l,c;try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,i,o,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(f){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o.OBSERVED_ERROR,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(i){}}}},closeAll:function(e){this.isInTransaction()?void 0:r(!1);for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],s=this.wrapperInitData[n];try{i=!0,s!==o.OBSERVED_ERROR&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(u){}}}this.wrapperInitData.length=0}},o={Mixin:i,OBSERVED_ERROR:{}};t.exports=o},{"fbjs/lib/invariant":311}],783:[function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};t.exports=r},{}],784:[function(e,t,n){"use strict";function r(e,t){if(null==t?i(!1):void 0,null==e)return t;var n=Array.isArray(e),r=Array.isArray(t);return n&&r?(e.push.apply(e,t),e):n?(e.push(t),e):r?[e].concat(t):[e,t]}var i=e("fbjs/lib/invariant");t.exports=r},{"fbjs/lib/invariant":311}],785:[function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,o=e.length,a=-4&o;a>r;){for(;r<Math.min(r+4096,a);r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=i,n%=i}for(;o>r;r++)n+=t+=e.charCodeAt(r);return t%=i,n%=i,t|n<<16}var i=65521;t.exports=r},{}],786:[function(e,t,n){"use strict";var r=!1;t.exports=r},{}],787:[function(e,t,n){"use strict";function r(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var i=e("./CSSProperty"),o=i.isUnitlessNumber;t.exports=r},{"./CSSProperty":685}],788:[function(e,t,n){"use strict";function r(e,t,n,r,i){return i}e("./Object.assign"),e("fbjs/lib/warning");t.exports=r},{"./Object.assign":704,"fbjs/lib/warning":322}],789:[function(e,t,n){"use strict";function r(e){return o[e]}function i(e){return(""+e).replace(a,r)}var o={"&":"&",">":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;t.exports=i},{}],790:[function(e,t,n){"use strict";function r(e){return null==e?null:1===e.nodeType?e:i.has(e)?o.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render?a(!1):void 0,void a(!1))}var i=(e("./ReactCurrentOwner"),e("./ReactInstanceMap")),o=e("./ReactMount"),a=e("fbjs/lib/invariant");e("fbjs/lib/warning");t.exports=r},{"./ReactCurrentOwner":716,"./ReactInstanceMap":744,"./ReactMount":747,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],791:[function(e,t,n){"use strict";function r(e,t,n){var r=e,i=void 0===r[n];i&&null!=t&&(r[n]=t)}function i(e){if(null==e)return e;var t={};return o(e,r,t),t}var o=e("./traverseAllChildren");e("fbjs/lib/warning");t.exports=i},{"./traverseAllChildren":809,"fbjs/lib/warning":322}],792:[function(e,t,n){"use strict";var r=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=r},{}],793:[function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=r},{}],794:[function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var i=e("./getEventCharCode"),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={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"};t.exports=r},{"./getEventCharCode":793}],795:[function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function i(e){return r}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=i},{}],796:[function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=r},{}],797:[function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);return"function"==typeof t?t:void 0}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";t.exports=r},{}],798:[function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var n=r(e),o=0,a=0;n;){if(3===n.nodeType){if(a=o+n.textContent.length,t>=o&&a>=t)return{node:n,offset:t-o};o=a}n=r(i(n))}}t.exports=o},{}],799:[function(e,t,n){"use strict";function r(){return!o&&i.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var i=e("fbjs/lib/ExecutionEnvironment"),o=null;t.exports=r},{"fbjs/lib/ExecutionEnvironment":297}],800:[function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function i(e){var t;if(null===e||e===!1)t=new a(i);else if("object"==typeof e){var n=e;!n||"function"!=typeof n.type&&"string"!=typeof n.type?l(!1):void 0,t="string"==typeof n.type?s.createInternalComponent(n):r(n.type)?new n.type(n):new c}else"string"==typeof e||"number"==typeof e?t=s.createInstanceForText(e):l(!1);return t.construct(e),t._mountIndex=0,t._mountImage=null,t}var o=e("./ReactCompositeComponent"),a=e("./ReactEmptyComponent"),s=e("./ReactNativeComponent"),u=e("./Object.assign"),l=e("fbjs/lib/invariant"),c=(e("fbjs/lib/warning"),function(){});u(c.prototype,o.Mixin,{_instantiateReactComponent:i}),t.exports=i},{"./Object.assign":704,"./ReactCompositeComponent":715,"./ReactEmptyComponent":736,"./ReactNativeComponent":750,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],801:[function(e,t,n){"use strict";function r(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&i&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var i,o=e("fbjs/lib/ExecutionEnvironment");o.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=r},{"fbjs/lib/ExecutionEnvironment":297}],802:[function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&i[e.type]||"textarea"===t)}var i={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};t.exports=r},{}],803:[function(e,t,n){"use strict";function r(e){return i.isValidElement(e)?void 0:o(!1),e}var i=e("./ReactElement"),o=e("fbjs/lib/invariant");t.exports=r},{"./ReactElement":734,"fbjs/lib/invariant":311}],804:[function(e,t,n){"use strict";function r(e){return'"'+i(e)+'"'}var i=e("./escapeTextContentForBrowser");t.exports=r},{"./escapeTextContentForBrowser":789}],805:[function(e,t,n){"use strict";var r=e("./ReactMount");t.exports=r.renderSubtreeIntoContainer},{"./ReactMount":747}],806:[function(e,t,n){"use strict";var r=e("fbjs/lib/ExecutionEnvironment"),i=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=a},{"fbjs/lib/ExecutionEnvironment":297}],807:[function(e,t,n){"use strict";var r=e("fbjs/lib/ExecutionEnvironment"),i=e("./escapeTextContentForBrowser"),o=e("./setInnerHTML"),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){o(e,i(t))})),t.exports=a},{"./escapeTextContentForBrowser":789,"./setInnerHTML":806,"fbjs/lib/ExecutionEnvironment":297}],808:[function(e,t,n){"use strict";function r(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var i=typeof e,o=typeof t;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&e.type===t.type&&e.key===t.key}t.exports=r},{}],809:[function(e,t,n){"use strict";function r(e){return m[e]}function i(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function o(e){return(""+e).replace(v,r)}function a(e){return"$"+o(e)}function s(e,t,n,r){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||l.isValidElement(e))return n(r,e,""===t?d+i(e,0):t),1;var u,c,m=0,v=""===t?d:t+h;if(Array.isArray(e))for(var y=0;y<e.length;y++)u=e[y],c=v+i(u,y),m+=s(u,c,n,r);else{var g=f(e);if(g){var b,_=g.call(e);
if(g!==e.entries)for(var j=0;!(b=_.next()).done;)u=b.value,c=v+i(u,j++),m+=s(u,c,n,r);else for(;!(b=_.next()).done;){var w=b.value;w&&(u=w[1],c=v+a(w[0])+h+i(u,0),m+=s(u,c,n,r))}}else if("object"===o){String(e);p(!1)}}return m}function u(e,t,n){return null==e?0:s(e,"",t,n)}var l=(e("./ReactCurrentOwner"),e("./ReactElement")),c=e("./ReactInstanceHandles"),f=e("./getIteratorFn"),p=e("fbjs/lib/invariant"),d=(e("fbjs/lib/warning"),c.SEPARATOR),h=":",m={"=":"=0",".":"=1",":":"=2"},v=/[=.:]/g;t.exports=u},{"./ReactCurrentOwner":716,"./ReactElement":734,"./ReactInstanceHandles":743,"./getIteratorFn":797,"fbjs/lib/invariant":311,"fbjs/lib/warning":322}],810:[function(e,t,n){"use strict";var r=(e("./Object.assign"),e("fbjs/lib/emptyFunction")),i=(e("fbjs/lib/warning"),r);t.exports=i},{"./Object.assign":704,"fbjs/lib/emptyFunction":303,"fbjs/lib/warning":322}],811:[function(e,t,n){"use strict";t.exports=e("./lib/React")},{"./lib/React":706}],812:[function(e,t,n){"use strict";function r(e){var t=function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return new(i.apply(e,[null].concat(n)))};return t.__proto__=e,t.prototype=e.prototype,t}var i=Function.prototype.bind;t.exports=r},{}],813:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],814:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(t)?r.showHidden=t:t&&n._extend(r,t),j(r.showHidden)&&(r.showHidden=!1),j(r.depth)&&(r.depth=2),j(r.colors)&&(r.colors=!1),j(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&R(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return b(i)||(i=u(e,i,r)),i}var o=l(e,t);if(o)return o;var a=Object.keys(t),m=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),E(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(t);if(0===a.length){if(R(t)){var v=t.name?": "+t.name:"";return e.stylize("[Function"+v+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return c(t)}var y="",g=!1,_=["{","}"];if(h(t)&&(g=!0,_=["[","]"]),R(t)){var j=t.name?": "+t.name:"";y=" [Function"+j+"]"}if(w(t)&&(y=" "+RegExp.prototype.toString.call(t)),x(t)&&(y=" "+Date.prototype.toUTCString.call(t)),E(t)&&(y=" "+c(t)),0===a.length&&(!g||0==t.length))return _[0]+y+_[1];if(0>r)return w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var C;return C=g?f(e,t,r,m,a):a.map(function(n){return p(e,t,r,m,n,g)}),e.seen.pop(),d(C,y,_)}function l(e,t){if(j(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],a=0,s=t.length;s>a;++a)A(t,String(a))?o.push(p(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,n,r,i,!0))}),o}function p(e,t,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=v(n)?u(e,l.value,null):u(e,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),j(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return null==e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function _(e){return"symbol"==typeof e}function j(e){return void 0===e}function w(e){return C(e)&&"[object RegExp]"===P(e)}function C(e){return"object"==typeof e&&null!==e}function x(e){return C(e)&&"[object Date]"===P(e)}function E(e){return C(e)&&("[object Error]"===P(e)||e instanceof Error)}function R(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function P(e){return Object.prototype.toString.call(e)}function S(e){return 10>e?"0"+e.toString(10):e.toString(10)}function k(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(e).replace(T,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),s=r[n];o>n;s=r[++n])a+=v(s)||!C(s)?" "+s:" "+i(s);return a},n.deprecate=function(e,i){function o(){if(!a){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),a=!0}return e.apply(this,arguments)}if(j(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var a=!1;return o};var M,N={};n.debuglog=function(e){if(j(M)&&(M=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!N[e])if(new RegExp("\\b"+e+"\\b","i").test(M)){var r=t.pid;N[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else N[e]=function(){};return N[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=m,n.isNull=v,n.isNullOrUndefined=y,n.isNumber=g,n.isString=b,n.isSymbol=_,n.isUndefined=j,n.isRegExp=w,n.isObject=C,n.isDate=x,n.isError=E,n.isFunction=R,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",k(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!C(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":813,_process:673,inherits:326}],815:[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){return e>=1&&20>=e||"should be between 1 and 20"}function a(){return null!==window.location.pathname.match(/\/search$/)}Object.defineProperty(n,"__esModule",{value:!0});var s=e("fargs"),u=r(s),l=e("./autocomplete.js"),c=r(l),f=e("./translations.js"),p=r(f),d=e("./instantsearch.js"),h=r(d),m={required:!0,type:"Object",children:{applicationId:{type:"string",required:!0},apiKey:{type:"string",required:!0},autocomplete:{type:"Object",value:{},children:{enabled:{type:"boolean",value:!0},inputSelector:{type:"string",value:"#query"},hitsPerPage:{type:"number",value:5,validators:[o]}}},baseUrl:{type:"string",value:"/hc/"},color:{type:"string",value:"#158EC2"},indexPrefix:{type:"string",value:"zendesk_"},instantsearch:{type:"Object",value:{},children:{enabled:{type:"boolean",value:!0},paginationSelector:{type:"string",value:".pagination"},selector:{type:"string",value:".search-results"},tagsLimit:{type:"number",value:15}}},instantsearchPage:{type:"function",value:a},poweredBy:{type:"boolean",value:!0},subdomain:{type:"string",required:!0},translations:{type:"Object",value:{}}}},v=function y(){var e=this;i(this,y);var t=(0,u["default"])().check("algoliasearchZendeskHC").arg("options",m).values(arguments)[0];this.search=(t.instantsearchPage()?h["default"]:c["default"])(t),document.addEventListener("DOMContentLoaded",function(){(0,p["default"])(t),e.search.render(t)})};n["default"]=v},{"./autocomplete.js":818,"./instantsearch.js":820,"./translations.js":823,fargs:279}],816:[function(e,t,n){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var r="undefined"!=typeof window?window.I18n:"undefined"!=typeof e?e.I18n:null,i=n(r);t.exports=i["default"]||{locale:"en-us",translations:{},datetime_translations:{}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],817:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(e){var t=document.getElementsByTagName("head")[0],n=document.createElement("style");return n.setAttribute("type","text/css"),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}},{}],818:[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")}Object.defineProperty(n,"__esModule",{value:!0});var 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(){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}}(),s=e("autocomplete.js"),u=r(s),l=e("algoliasearch"),c=r(l);e("es6-collections");var f=e("./templates.js"),p=r(f),d=e("./addCSS.js"),h=r(d),m=e("./removeCSS.js"),v=r(m),y=400,g=600,b=function(){function t(e){var n=e.applicationId,r=e.apiKey,o=e.autocomplete,a=o.enabled,s=o.inputSelector,u=e.indexPrefix,l=e.subdomain;i(this,t),a&&(this._temporaryHiding(s),this.client=(0,c["default"])(n,r),this.index=this.client.initIndex(""+u+l+"_articles"))}return a(t,[{key:"render",value:function(t){var n=t.autocomplete,r=n.enabled,i=n.hitsPerPage,o=n.inputSelector,a=t.baseUrl,s=t.color,l=t.poweredBy,c=t.translations;if(!r)return null;this.$inputs=document.querySelectorAll(o),this.locale=e("./I18n.js").locale,(0,h["default"])(p["default"].autocomplete.css.render({color:s})),this.autocompletes=[];for(var f=0;f<this.$inputs.length;++f){var d=this.$inputs[f],m=document.createElement("div");m["class"]="algolia-autocomplete";var v=document.createElement("div");v["class"]="aa-dropdown-menu",m.appendChild(v),d.parentNode.insertBefore(m,d);var y=d.offsetWidth;m.parentNode.insertBefore(d,m.nextSibling),m.parentNode.removeChild(m);var g=this._sizeModifier(y),b=this._nbSnippetWords(y),_={hitsPerPage:i,facetFilters:'["locale.locale:'+this.locale+'"]',highlightPreTag:'<span class="aa-article-hit--highlight">',highlightPostTag:"</span>",attributesToSnippet:["body_safe:"+b],snippetEllipsisText:"..."};d.setAttribute("placeholder",c.placeholder_autocomplete);var j=(0,u["default"])(d,{hint:!1,debug:!1,templates:this._templates({poweredBy:l,translations:c})},[{source:this._source(_),name:"articles",templates:{suggestion:this._renderSuggestion(g)}}]);j.on("autocomplete:selected",this._onSelected(a)),this.autocompletes.push(j)}this._temporaryHidingCancel()}},{key:"_sizeModifier",value:function(e){return y>e?"xs":g>e?"sm":null}},{key:"_nbSnippetWords",value:function(e){return y>e?0:g>e?5+Math.floor(e/30):Math.floor(e/15)}},{key:"_source",value:function(e){var t=this;return function(n,r){t.index.search(o({},e,{query:n})).then(function(e){r(t._reorderedHits(e.hits))})}}},{key:"_reorderedHits",value:function(e){var t=new Map;e.forEach(function(e){var n=e.category.title,r=e.section.title;t.has(n)||(e.isCategoryHeader=!0,t.set(n,new Map)),t.get(n).has(r)||(e.isSectionHeader=!0,t.get(n).set(r,[])),t.get(n).get(r).push(e)});var n=[];return t.forEach(function(e){e.forEach(function(e){e.forEach(function(e){n.push(e)})})}),n}},{key:"_templates",value:function(e){var t=e.poweredBy,n=e.translations,r={};return t===!0&&(r.header=p["default"].autocomplete.poweredBy.render({translations:n})),r}},{key:"_renderSuggestion",value:function(e){return function(t){return t.sizeModifier=e,p["default"].autocomplete.article.render(t)}}},{key:"_onSelected",value:function(e){var t=this;return function(n,r,i){location.href=""+e+t.locale+"/"+i+"/"+r.id}}},{key:"_temporaryHiding",value:function(e){this._temporaryHidingCSS=(0,h["default"])("\n "+e+" {\n visibility: hidden !important;\n height: 1px !important;\n }\n ")}},{key:"_temporaryHidingCancel",value:function(){(0,v["default"])(this._temporaryHidingCSS),delete this._temporaryHidingCSS}}]),t}();n["default"]=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(b,[null].concat(t)))}},{"./I18n.js":816,"./addCSS.js":817,"./removeCSS.js":821,"./templates.js":822,algoliasearch:249,"autocomplete.js":257,"es6-collections":276}],819:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("to-factory"),o=r(i),a=e("./AlgoliasearchZendeskHC.js"),s=r(a);n["default"]=(0,o["default"])(s["default"])},{"./AlgoliasearchZendeskHC.js":815,"to-factory":812}],820:[function(e,t,n){(function(t){"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")}Object.defineProperty(n,"__esModule",{value:!0});var 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(){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}}(),s=e("instantsearch.js"),u=r(s),l=e("./templates.js"),c=r(l),f=e("./addCSS.js"),p=r(f),d=e("./removeCSS.js"),h=r(d),m=function(){function n(e){var t=e.applicationId,r=e.apiKey,o=e.autocomplete.inputSelector,a=e.indexPrefix,s=e.instantsearch,l=s.enabled,c=s.paginationSelector,f=s.selector,p=e.subdomain;i(this,n),l&&(this._temporaryHiding({autocompleteSelector:o,instantsearchSelector:f,paginationSelector:c}),this.instantsearch=(0,u["default"])({appId:t,apiKey:r,indexName:""+a+p+"_articles",urlSync:{mapping:{q:"query"}},searchParameters:{attributesToSnippet:["body_safe:60"],snippetEllipsisText:"..."}}))}return a(n,[{key:"render",value:function(e){var n=this,r=e.autocomplete.inputSelector,i=e.baseUrl,a=e.colors,s=e.instantsearch,l=s.enabled,f=s.selector,p=s.paginationSelector,d=s.tagsLimit,h=e.poweredBy,m=e.translations;if(l){var v="undefined"!=typeof window?window.I18n:"undefined"!=typeof t?t.I18n:null;if(this.$autocompleteInputs=document.querySelectorAll(r),this._hideAutocomplete(),this.$oldPagination=document.querySelector(p),null!==this.$oldPagination&&(this.$oldPagination.style.display="none"),this.$container=document.querySelector(f),null===this.$container)throw new Error('[Algolia] Cannot find a container with the "'+f+'" selector.');this.$container.innerHTML=c["default"].instantsearch.layout,this.instantsearch.addWidget({getConfiguration:function(){return{facets:["locale.locale"]}},init:function(e){var t=e.helper;t.toggleRefine("locale.locale",v.locale)}}),this.instantsearch.addWidget(u["default"].widgets.searchBox({container:"#algolia-query",placeholder:m.placeholder_instantsearch,autofocus:!0,poweredBy:h})),this.instantsearch.addWidget(u["default"].widgets.stats({container:"#algolia-stats",templates:{body:c["default"].instantsearch.stats},transformData:function(e){return o({},e,{translations:m})}})),this.instantsearch.addWidget(u["default"].widgets.pagination({container:"#algolia-pagination",cssClasses:{root:"pagination"}})),this.instantsearch.addWidget(u["default"].widgets.hierarchicalMenu({container:"#algolia-categories",attributes:["category.title","section.full_path"],separator:" > ",templates:{header:m.categories}})),this.instantsearch.addWidget(u["default"].widgets.refinementList({container:"#algolia-labels",attributeName:"label_names",operator:"and",templates:{header:m.tags},limit:d})),this.instantsearch.addWidget(u["default"].widgets.hits({container:"#algolia-hits",templates:{empty:c["default"].instantsearch.noResults,item:c["default"].instantsearch.hit},transformData:function(e){return o({},e,{baseUrl:i,colors:a})}})),this.instantsearch.on("render",function(){n._displayTimes()}),this.instantsearch.start(),this._temporaryHidingCancel()}}},{key:"_displayTimes",value:function(){var n=e("./I18n.js"),r="undefined"!=typeof window?window.moment:"undefined"!=typeof t?t.moment:null,i=r().zone();r().lang(n.locale,n.datetime_translations);for(var o=document.querySelectorAll("time"),a=0;a<o.length;++a){var s=o[a],u=s.getAttribute("datetime"),l=r(u).utc().zone(i),c=l.format("YYYY-MM-DD HH:mm");s.setAttribute("title",c),"relative"===s.getAttribute("data-datetime")?s.textContent=l.fromNow():"calendar"===s.getAttribute("data-datetime")&&(s.textContent=l.calendar())}}},{key:"_hideAutocomplete",value:function(){for(var e=0,t=this.$autocompleteInputs.length;t>e;++e){for(var n=this.$autocompleteInputs[e],r=n,i=r.parentNode;null!==r&&"form"!==r.nodeName.toLowerCase();)r=i,i=r.parentNode;for(null===r&&(r=n,i=r.parentNode);null!==r&&1===i.children.length;)r=i,i=r.parentNode;r.style.display="none"}}},{key:"_temporaryHiding",value:function(e){var t=e.autocompleteSelector,n=e.instantsearchSelector,r=e.paginationSelector;this._temporaryHidingCSS=(0,p["default"])("\n "+t+", "+n+", "+r+" {\n display: none !important;\n visibility: hidden !important;\n }\n ")}},{key:"_temporaryHidingCancel",value:function(){(0,h["default"])(this._temporaryHidingCSS),delete this._temporaryHidingCSS}}]),n}();n["default"]=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(m,[null].concat(t)))}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./I18n.js":816,"./addCSS.js":817,"./removeCSS.js":821,"./templates.js":822,"instantsearch.js":327}],821:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(e){var t=document.getElementsByTagName("head")[0];t.removeChild(e)}},{}],822:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("hogan.js"),o=r(i);n["default"]={autocomplete:{article:o["default"].compile('<div\n class="\n aa-article-hit\n {{# isCategoryHeader }}aa-article-hit__category-first{{/ isCategoryHeader }}\n {{# isSectionHeader }}aa-article-hit__section-first{{/ isSectionHeader }}\n {{# sizeModifier }}aa-article-hit__{{ sizeModifier }}{{/ sizeModifier}}\n "\n >\n <div class="aa-article-hit--category">\n <span class="aa-article-hit--category--content">\n {{ category.title }}\n </span>\n </div>\n <div class="aa-article-hit--line">\n <div class="aa-article-hit--section">\n {{ section.title }}\n </div>\n <div class="aa-article-hit--content">\n <div class="aa-article-hit--headline">\n <span class="aa-article-hit--title">\n {{{ _highlightResult.title.value }}}\n </span>\n </div>\n {{# _snippetResult.body_safe.value }}\n <div class="aa-article-hit--body">{{{ _snippetResult.body_safe.value }}}</div>\n {{/ _snippetResult.body_safe.value }}\n </div>\n </div>'),poweredBy:o["default"].compile('<div class="aa-powered-by">\n {{ translations.search_by }}\n <a\n href="https://www.algolia.com/?utm_source=zendesk_hc&utm_medium=link&utm_campaign=autocomplete"\n class="aa-powered-by-link"\n >\n Algolia\n </a>\n </div>'),css:o["default"].compile("\n .aa-article-hit--highlight {\n color: {{ color }};\n }\n\n .aa-article-hit--highlight::before {\n background-color: {{ color }};\n }\n\n .aa-article-hit--category {\n color: {{ color }};\n }\n ")},instantsearch:{layout:'\n<div>\n <input type="text" id="algolia-query"/>\n <div id="algolia-stats"></div>\n <div id="algolia-facets">\n <div id="algolia-categories"></div>\n <div id="algolia-labels"></div>\n </div>\n <div id="algolia-hits"></div>\n <div class="clearfix"></div>\n <div id="algolia-pagination"></div>\n</div>\n ',hit:'\n<div class="search-result">\n <a class="search-result-link" href="{{ baseUrl }}{{ locale.locale }}/articles/{{ id }}">\n {{{ _highlightResult.title.value }}}\n </a>\n {{# vote_sum }}<span class="search-result-votes">{{ vote_sum }}</span>{{/ vote_sum }}\n <div class="search-result-meta">\n <time data-datetime="relative" datetime="{{ created_at_iso }}"></time>\n </div>\n <div class="search-result-body">\n {{{ _snippetResult.body_safe.value }}}\n </div>\n</div>\n ',noResults:'\n<div id="no-results-message">\n <p>We didn\'t find any results for the search <em>"{{ query }}"</em>.</p>\n</div>\n ',stats:'\n{{# hasNoResults }}{{ translations.no_result }}{{/ hasNoResults }}\n{{# hasOneResult }}1 {{ translations.result }}{{/ hasOneResult }}\n{{# hasManyResults }}\n {{# helpers.formatNumber }}{{ nbHits }}{{/ helpers.formatNumber }}\n {{ translations.results }}\n{{/ hasManyResults }}\n<span class="{{ cssClasses.time }}">{{ translations.found_in }} {{ processingTimeMS }}ms</span>\n '}}},{"hogan.js":324}],823:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n,r,i){return(0,s["default"])(t[n])?void 0:(0,f["default"])(t[n])&&(0,s["default"])(t[n][e.locale])?void(t[n]=t[n][e.locale]):!(0,l["default"])(i)&&(0,s["default"])(e.translations[i])?void(t[n]=e.translations[i]):void(t[n]=r)}function o(t){var n=t.translations,r=e("./I18n.js");i(r,n,"article","Article","txt.help_center.views.admin.manage_knowledge_base.table.article"),i(r,n,"articles","Articles","txt.help_center.javascripts.arrange_content.articles"),i(r,n,"categories","Categories","txt.help_center.javascripts.arrange_content.categories"),i(r,n,"sections","Sections","txt.help_center.javascripts.arrange_content.sections"),i(r,n,"tags","Tags"),i(r,n,"search_by","Search by"),i(r,n,"no_result","No result"),i(r,n,"result","Result"),i(r,n,"results","Results"),i(r,n,"found_in","Found in"),i(r,n,"search_by","Search by"),i(r,n,"placeholder_autocomplete","Search in sections and articles"),i(r,n,"placeholder_instantsearch","Search in articles")}Object.defineProperty(n,"__esModule",{value:!0}),n.loadTranslations=o;var a=e("lodash/isString"),s=r(a),u=e("lodash/isUndefined"),l=r(u),c=e("lodash/isPlainObject"),f=r(c);n["default"]=o},{"./I18n.js":816,"lodash/isPlainObject":662,"lodash/isString":663,"lodash/isUndefined":666}]},{},[1])(1)});
//# sourceMappingURL=algoliasearch.zendesk-hc.min.js.map
|
plugins/react/frontend/components/controls/base/StringControl/index.js | carteb/carte-blanche | import React from 'react';
import randomValue from './randomValue';
import Row from '../../../form/Grid/Row';
import LeftColumn from '../../../form/Grid/LeftColumn';
import RightColumn from '../../../form/Grid/RightColumn';
import CarteBlancheInput from '../../../form/CarteBlancheInput';
import Label from '../../../form/Label';
const StringControl = (props) => {
const { label, value, onUpdate, secondaryLabel, nestedLevel, required } = props;
return (
<Row>
<LeftColumn nestedLevel={nestedLevel}>
<Label
type={secondaryLabel}
propKey={label}
/>
</LeftColumn>
<RightColumn>
<div style={{ padding: '0 0.5rem' }}>
<CarteBlancheInput
value={value}
fallbackValue=""
onChange={onUpdate}
hasRandomButton
hasSettings={!required}
onRandomButtonClick={() => onUpdate({ value: StringControl.randomValue(props) })}
/>
</div>
</RightColumn>
</Row>
);
};
StringControl.randomValue = randomValue;
export default StringControl;
|
pollard/components/SelectedSong.js | spncrlkt/pollard | import React, { Component } from 'react';
import classNames from 'classnames';
import mergeStyles from '../lib/mergeStyles';
import SongInput from './SongInput';
import TitleArtistLine from './TitleArtistLine';
import MarkPlayedBtn from './MarkPlayedBtn';
import ActionBar from './ActionBar';
export default class SelectedSong extends Component {
handleClick() {
this.props.deselectSong();
}
render() {
const inputs = this.props.song.get('inputs').map((input, index) => {
return <SongInput
label={ input.get('name') }
val={ input.get('value') }
updateSong={ this.props.updateSong }
key={ index }
songIdx={ this.props.idx }/>;
});
const songStyle= mergeStyles({
backgroundColor: '#D0D0D0'
});
const gridClasses = classNames(
"col-xs-12",
"col-sm-6"
);
const releaseImgBaseClasses = classNames(
"col-xs-12"
);
const releaseImgXSClasses = classNames(
releaseImgBaseClasses,
"visible-xs-block"
);
const releaseImgSMClasses = classNames(
"col-sm-4",
"col-sm-offset-1",
"hidden-xs"
);
const imgSMStyle = {
border: '1px solid black',
padding: 12,
height: 220,
width: 220,
marginLeft: 138,
}
return (
<li id="SelectedSong" className="list-group-item clearfix song" style={ songStyle }> <TitleArtistLine
song={ this.props.song }
idx={ this.props.idx }
deselectSong={ this.props.deselectSong }
type='selected'
/>
<div className="visible-xs-block col-xs-12" style={{ marginTop: 5 }} />
<MarkPlayedBtn
idx={ this.props.idx }
playingSongIdx={ this.props.playingSongIdx }
isSelected={ true }
isSongPlayed={ this.props.song.get('played') }
markSongPlayed={ this.props.markSongPlayed } />
<div className="clearfix"></div>
<div className={ gridClasses }>
{ inputs }
</div>
<div className="visible-xs-block col-xs-12" style={{ marginTop: 5 }} />
{ this.props.song.get('img300px') ?
<img
className={ releaseImgXSClasses }
src={ this.props.song.get('img300px') } />
: ""
}
<div className={ releaseImgSMClasses } style={{ marginTop: 10 }} />
{ this.props.song.get('img300px') ?
<img
className={ releaseImgSMClasses }
style={ imgSMStyle }
src={ this.props.song.get('img300px') } />
: ""
}
<div className="clearfix"></div>
<ActionBar
songIdx={ this.props.idx }
deleteSong={ this.props.deleteSong } />
</li>
);
}
}
|
ajax/libs/thorax/2.0.0rc6/thorax.js | dhowe/cdnjs | /*!
* jQuery JavaScript Library v1.9.0
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-1-14
*/
(function( window, undefined ) {
"use strict";
var
// A central reference to the root jQuery(document)
rootjQuery,
// The deferred used on DOM ready
readyList,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.9.0",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// 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 = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/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();
},
// The ready event handler and self cleanup method
DOMContentLoaded = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
} else if ( document.readyState === "complete" ) {
// we're here because readyState === "complete" in oldIE
// which is good enough for us to call the dom ready!
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
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
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 rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_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 a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// 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 );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_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] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// 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 ( length === i ) {
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({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// 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.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// 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 ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// 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 &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// 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
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 ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
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;
},
noop: function() {},
// 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;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
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 {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_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 l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// 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
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_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 tmp, args, proxy;
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 = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_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;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
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;
},
now: function() {
return ( new Date() ).getTime();
}
});
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", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// 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 );
}
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// 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 ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// 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( core_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 // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// 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;
},
// Control if a given callback is in the list
has: function( fn ) {
return jQuery.inArray( fn, list ) > -1;
},
// Remove all callbacks from the list
empty: function() {
list = [];
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 ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
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 action = tuple[ 0 ],
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[ action + "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 = core_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 ? core_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();
}
});
jQuery.support = (function() {
var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
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)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// 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: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// 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";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.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()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// 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>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.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%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== "undefined" ) {
// 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.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
// Prevent IE 6 from affecting layout for positioned elements #11048
// Prevent IE from shrinking the body in IE 7 mode #12869
body.style.zoom = 1;
}
body.removeChild( container );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// 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)) && getByName && data === undefined ) {
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 ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].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 ( getByName ) {
// 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 /* For internal use only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, i, l,
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 ) );
}
for ( i = 0, l = name.length; i < l; 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 : 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)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
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, false );
},
removeData: function( elem, name ) {
return internalRemoveData( elem, name, false );
},
// For internal use only.
_data: function( elem, name, data ) {
return internalData( elem, name, data, true );
},
_removeData: function( elem, name ) {
return internalRemoveData( elem, name, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(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 jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
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;
}
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--;
}
hooks.cur = fn;
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 );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
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 );
};
});
},
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 nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.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 ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
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 ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === "undefined" || 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;
},
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,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.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 ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
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
( jQuery.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 values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var ret, hooks, notxml,
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 === "undefined" ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== "undefined" ) {
ret = elem.getAttribute( 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( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
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 ( !jQuery.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;
}
}
}
},
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( 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 ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return 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/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
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;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
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 = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
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)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
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 ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// 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 );
}
};
});
}
if ( !jQuery.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 + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( 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;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* 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 handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
// Don't attach events to noData or text/comment nodes (but allow plain objects)
elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem );
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 !== "undefined" && (!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
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// 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, origCount, tmp,
events, t, handleObj,
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( core_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 i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = event.type || event,
namespaces = 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 );
event.isTrigger = true;
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 && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && 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, j, ret, matched, handleObj,
handlerQueue = [],
args = core_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 i, matches, sel, handleObj,
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") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( 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,
originalEvent = event,
fixHook = jQuery.event.fixHooks[ event.type ] || {},
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 eventDoc, doc, body,
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
},
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;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && 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 === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
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 ] === "undefined" ) {
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.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? 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() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, 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 ( !jQuery.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 ( !jQuery.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 ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// 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 );
});
},
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 );
},
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 );
}
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
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 );
};
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
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;
},
// 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#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// 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 + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + 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" ),
// 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" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /\{\s*\[native code\]\s*\}/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( docElem.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
for ( ; (elem = this[i]); i++ ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* 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 cache,
keys = [];
return (cache = function( 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);
});
}
/**
* 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 {
// release memory in IE
div = null;
}
}
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 ( !documentIsXML && !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 #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, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = 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 ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
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 doc = node ? node.ownerDocument || node : preferredDoc;
// 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
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
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 {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
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.tagNameNoComments ?
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 === "*" ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(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 explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// 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 ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + 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 = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
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 = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
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;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
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;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
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']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !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 ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = a && b && a.nextSibling;
for ( ; cur; cur = cur.nextSibling ) {
if ( cur === b ) {
return -1;
}
}
return a ? 1 : -1;
}
// Returns a function to use in pseudos for input types
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
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
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]);
}
}
});
});
}
/**
* 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
for ( ; (node = elem[i]); 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 (see #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,
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[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[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// 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( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return 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( 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.substr( result.length - check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.substr( 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 identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.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 only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
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;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// 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;
})
}
};
// 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 );
}
function tokenize( 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 && combinator.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 data, cache, outerCache,
dirkey = 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 ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
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 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( tokens.slice( 0, i - 1 ) ).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 ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Nested matchers should use non-integer dirruns
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++matcherCachedRuns;
}
}
// 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
// `i` starts as a string, so matchedCount would equal "00" if there are no elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
for ( j = 0; (matcher = setMatchers[j]); 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, group /* 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 ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is 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" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; 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 ) && 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, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
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;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < self.length; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < this.length; i++ ) {
jQuery.find( selector, this[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( jQuery.unique( ret ) );
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
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;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// 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".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// 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 ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
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 ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
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;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
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,
manipulation_rcheckableType = /^(?:checkbox|radio)$/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: jQuery.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;
jQuery.fn.extend({
text: function( value ) {
return jQuery.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 );
},
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();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
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 jQuery.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 ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.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( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
jQuery( this ).remove();
if ( next ) {
next.parentNode.insertBefore( elem, next );
} else {
parent.appendChild( elem );
}
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var fragment, first, scripts, hasScripts, node, doc,
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" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
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(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
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 ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + 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, data, e;
// 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 ( !jQuery.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 ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_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.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()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== "undefined" ? 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 ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, srcElements, node, i, clone,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.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 ( (!jQuery.support.noCloneEvent || !jQuery.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 contains, elem, tag, tmp, wrap, tbody, j,
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 ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.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 ( !jQuery.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 data, id, elem, type,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
deleteExpando = jQuery.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 !== "undefined" ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var curCSS, getStyles, iframe,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// 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]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
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 isHidden( 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 );
}
function showHide( elements, show ) {
var elem,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = jQuery._data( elem, "olddisplay" );
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && elem.style.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", css_defaultDisplay(elem.nodeName) );
}
} else if ( !values[ index ] && !isHidden( elem ) ) {
jQuery._data( elem, "olddisplay", 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;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.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 ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
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;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": 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": jQuery.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 NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( 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 ( !jQuery.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 ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #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 val, num, 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 ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
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;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
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;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// 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;
}
}
return ret === "" ? "auto" : ret;
};
}
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 = jQuery.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 && ( jQuery.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";
}
// Try to determine the default display value of an element
function css_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'/>")
.css( "cssText", "display:block !important" )
).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;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
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 elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
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,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.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;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: 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" ] );
}
}
};
}
// 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
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: 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;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// 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;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
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 || !manipulation_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();
}
});
//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, "+" );
};
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 );
}
}
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
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+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* 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( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[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 key, deep,
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;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, type, response,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = 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;
};
// 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.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
});
};
});
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"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.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 transport,
// URL without anti-cache param
cacheURL,
// Response headers
responseHeadersString,
responseHeaders,
// timeout handle
timeoutTimer,
// Cross-domain detection vars
parts,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// 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( core_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 += ( ajax_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_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_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;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// 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 not modified
if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.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;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// 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
function ajaxConvert( s, response ) {
var conv, conv2, current, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
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.splice( i--, 0, current );
}
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 };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// 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 + "_" + ( ajax_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 += ( ajax_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";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( 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 ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.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 ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status,
statusText,
responseHeaders,
responses,
xml;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
xml = xhr.responseXML;
responseHeaders = xhr.getAllResponseHeaders();
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#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 && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.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 {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 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 );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
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;
}
}
createTweens( animation, props );
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 );
}
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;
}
}
}
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 );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// 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
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.done(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// 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 ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
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 a non 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, "auto" );
// 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;
}
}
}
};
// Remove in 2.0 - this supports IE8's 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.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 );
};
});
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 );
doAnimation.finish = function() {
anim.stop( true );
};
// 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.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// 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;
});
}
});
// 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;
}
// 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.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.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
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 ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
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
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.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 !== "undefined" ) {
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 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// 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({
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 it's 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 || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// 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 jQuery.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 );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// 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 jQuery.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 );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use 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.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window );
/*
Copyright (C) 2011 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// lib/handlebars/browser-prefix.js
var Handlebars = {};
(function(Handlebars, undefined) {
;
// lib/handlebars/base.js
Handlebars.VERSION = "1.0.0-rc.4";
Handlebars.COMPILER_REVISION = 3;
Handlebars.REVISION_CHANGES = {
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
2: '== 1.0.0-rc.3',
3: '>= 1.0.0-rc.4'
};
Handlebars.helpers = {};
Handlebars.partials = {};
var toString = Object.prototype.toString,
functionType = '[object Function]',
objectType = '[object Object]';
Handlebars.registerHelper = function(name, fn, inverse) {
if (toString.call(name) === objectType) {
if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
Handlebars.Utils.extend(this.helpers, name);
} else {
if (inverse) { fn.not = inverse; }
this.helpers[name] = fn;
}
};
Handlebars.registerPartial = function(name, str) {
if (toString.call(name) === objectType) {
Handlebars.Utils.extend(this.partials, name);
} else {
this.partials[name] = str;
}
};
Handlebars.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
throw new Error("Could not find property '" + arg + "'");
}
});
Handlebars.registerHelper('blockHelperMissing', function(context, options) {
var inverse = options.inverse || function() {}, fn = options.fn;
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
if(context === true) {
return fn(this);
} else if(context === false || context == null) {
return inverse(this);
} else if(type === "[object Array]") {
if(context.length > 0) {
return Handlebars.helpers.each(context, options);
} else {
return inverse(this);
}
} else {
return fn(context);
}
});
Handlebars.K = function() {};
Handlebars.createFrame = Object.create || function(object) {
Handlebars.K.prototype = object;
var obj = new Handlebars.K();
Handlebars.K.prototype = null;
return obj;
};
Handlebars.logger = {
DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
// can be overridden in the host environment
log: function(level, obj) {
if (Handlebars.logger.level <= level) {
var method = Handlebars.logger.methodMap[level];
if (typeof console !== 'undefined' && console[method]) {
console[method].call(console, obj);
}
}
}
};
Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
Handlebars.registerHelper('each', function(context, options) {
var fn = options.fn, inverse = options.inverse;
var i = 0, ret = "", data;
if (options.data) {
data = Handlebars.createFrame(options.data);
}
if(context && typeof context === 'object') {
if(context instanceof Array){
for(var j = context.length; i<j; i++) {
if (data) { data.index = i; }
ret = ret + fn(context[i], { data: data });
}
} else {
for(var key in context) {
if(context.hasOwnProperty(key)) {
if(data) { data.key = key; }
ret = ret + fn(context[key], {data: data});
i++;
}
}
}
}
if(i === 0){
ret = inverse(this);
}
return ret;
});
Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
if(!context || Handlebars.Utils.isEmpty(context)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
Handlebars.registerHelper('unless', function(context, options) {
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
});
Handlebars.registerHelper('with', function(context, options) {
if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
});
Handlebars.registerHelper('log', function(context, options) {
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
Handlebars.log(level, context);
});
;
// lib/handlebars/compiler/parser.js
/* Jison generated parser */
var handlebars = (function(){
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"root":3,"program":4,"EOF":5,"simpleInverse":6,"statements":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"partialName":25,"params":26,"hash":27,"DATA":28,"param":29,"STRING":30,"INTEGER":31,"BOOLEAN":32,"hashSegments":33,"hashSegment":34,"ID":35,"EQUALS":36,"PARTIAL_NAME":37,"pathSegments":38,"SEP":39,"$accept":0,"$end":1},
terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"DATA",30:"STRING",31:"INTEGER",32:"BOOLEAN",35:"ID",36:"EQUALS",37:"PARTIAL_NAME",39:"SEP"},
productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[26,2],[26,1],[29,1],[29,1],[29,1],[29,1],[29,1],[27,1],[33,2],[33,1],[34,3],[34,3],[34,3],[34,3],[34,3],[25,1],[21,1],[38,3],[38,1]],
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return $$[$0-1];
break;
case 2: this.$ = new yy.ProgramNode([], $$[$0]);
break;
case 3: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
break;
case 4: this.$ = new yy.ProgramNode($$[$0-1], []);
break;
case 5: this.$ = new yy.ProgramNode($$[$0]);
break;
case 6: this.$ = new yy.ProgramNode([], []);
break;
case 7: this.$ = new yy.ProgramNode([]);
break;
case 8: this.$ = [$$[$0]];
break;
case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break;
case 10: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
break;
case 11: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
break;
case 12: this.$ = $$[$0];
break;
case 13: this.$ = $$[$0];
break;
case 14: this.$ = new yy.ContentNode($$[$0]);
break;
case 15: this.$ = new yy.CommentNode($$[$0]);
break;
case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break;
case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break;
case 18: this.$ = $$[$0-1];
break;
case 19: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break;
case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
break;
case 21: this.$ = new yy.PartialNode($$[$0-1]);
break;
case 22: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
break;
case 23:
break;
case 24: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
break;
case 25: this.$ = [[$$[$0-1]].concat($$[$0]), null];
break;
case 26: this.$ = [[$$[$0-1]], $$[$0]];
break;
case 27: this.$ = [[$$[$0]], null];
break;
case 28: this.$ = [[new yy.DataNode($$[$0])], null];
break;
case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break;
case 30: this.$ = [$$[$0]];
break;
case 31: this.$ = $$[$0];
break;
case 32: this.$ = new yy.StringNode($$[$0]);
break;
case 33: this.$ = new yy.IntegerNode($$[$0]);
break;
case 34: this.$ = new yy.BooleanNode($$[$0]);
break;
case 35: this.$ = new yy.DataNode($$[$0]);
break;
case 36: this.$ = new yy.HashNode($$[$0]);
break;
case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break;
case 38: this.$ = [$$[$0]];
break;
case 39: this.$ = [$$[$0-2], $$[$0]];
break;
case 40: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
break;
case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
break;
case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
break;
case 43: this.$ = [$$[$0-2], new yy.DataNode($$[$0])];
break;
case 44: this.$ = new yy.PartialNameNode($$[$0]);
break;
case 45: this.$ = new yy.IdNode($$[$0]);
break;
case 46: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
break;
case 47: this.$ = [$$[$0]];
break;
}
},
table: [{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],24:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],24:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],24:[1,16]},{17:23,18:[1,22],21:24,28:[1,25],35:[1,27],38:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{4:28,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{17:30,21:24,28:[1,25],35:[1,27],38:26},{17:31,21:24,28:[1,25],35:[1,27],38:26},{17:32,21:24,28:[1,25],35:[1,27],38:26},{25:33,37:[1,34]},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],24:[1,16]},{17:23,21:24,28:[1,25],35:[1,27],38:26},{5:[2,4],7:35,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],24:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],24:[2,23]},{18:[1,36]},{18:[2,27],21:41,26:37,27:38,28:[1,45],29:39,30:[1,42],31:[1,43],32:[1,44],33:40,34:46,35:[1,47],38:26},{18:[2,28]},{18:[2,45],28:[2,45],30:[2,45],31:[2,45],32:[2,45],35:[2,45],39:[1,48]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],39:[2,47]},{10:49,20:[1,50]},{10:51,20:[1,50]},{18:[1,52]},{18:[1,53]},{18:[1,54]},{18:[1,55],21:56,35:[1,27],38:26},{18:[2,44],35:[2,44]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],24:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{18:[2,25],21:41,27:57,28:[1,45],29:58,30:[1,42],31:[1,43],32:[1,44],33:40,34:46,35:[1,47],38:26},{18:[2,26]},{18:[2,30],28:[2,30],30:[2,30],31:[2,30],32:[2,30],35:[2,30]},{18:[2,36],34:59,35:[1,60]},{18:[2,31],28:[2,31],30:[2,31],31:[2,31],32:[2,31],35:[2,31]},{18:[2,32],28:[2,32],30:[2,32],31:[2,32],32:[2,32],35:[2,32]},{18:[2,33],28:[2,33],30:[2,33],31:[2,33],32:[2,33],35:[2,33]},{18:[2,34],28:[2,34],30:[2,34],31:[2,34],32:[2,34],35:[2,34]},{18:[2,35],28:[2,35],30:[2,35],31:[2,35],32:[2,35],35:[2,35]},{18:[2,38],35:[2,38]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],36:[1,61],39:[2,47]},{35:[1,62]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{21:63,35:[1,27],38:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],24:[2,21]},{18:[1,64]},{18:[2,24]},{18:[2,29],28:[2,29],30:[2,29],31:[2,29],32:[2,29],35:[2,29]},{18:[2,37],35:[2,37]},{36:[1,61]},{21:65,28:[1,69],30:[1,66],31:[1,67],32:[1,68],35:[1,27],38:26},{18:[2,46],28:[2,46],30:[2,46],31:[2,46],32:[2,46],35:[2,46],39:[2,46]},{18:[1,70]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],24:[2,22]},{18:[2,39],35:[2,39]},{18:[2,40],35:[2,40]},{18:[2,41],35:[2,41]},{18:[2,42],35:[2,42]},{18:[2,43],35:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]}],
defaultActions: {17:[2,1],25:[2,28],38:[2,26],57:[2,24]},
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
this.yy.parser = this;
if (typeof this.lexer.yylloc == "undefined")
this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
var ranges = this.lexer.options && this.lexer.options.ranges;
if (typeof this.yy.parseError === "function")
this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1;
if (typeof token !== "number") {
token = self.symbols_[token] || token;
}
return token;
}
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
if (!recovering) {
expected = [];
for (p in table[state])
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0)
recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}
};
/* Jison generated lexer */
var lexer = (function(){
var lexer = ({EOF:1,
parseError:function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
} else {
throw new Error(str);
}
},
setInput:function (input) {
this._input = input;
this._more = this._less = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
if (this.options.ranges) this.yylloc.range = [0,0];
this.offset = 0;
return this;
},
input:function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
} else {
this.yylloc.last_column++;
}
if (this.options.ranges) this.yylloc.range[1]++;
this._input = this._input.slice(1);
return ch;
},
unput:function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length-1);
this.matched = this.matched.substr(0, this.matched.length-1);
if (lines.length-1) this.yylineno -= lines.length-1;
var r = this.yylloc.range;
this.yylloc = {first_line: this.yylloc.first_line,
last_line: this.yylineno+1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
return this;
},
more:function () {
this._more = true;
return this;
},
less:function (n) {
this.unput(this.match.slice(n));
},
pastInput:function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
upcomingInput:function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20-next.length);
}
return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
},
showPosition:function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c+"^";
},
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
var token,
match,
tempMatch,
index,
col,
lines;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i=0;i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (!this.options.flex) break;
}
}
if (match) {
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) this.yylineno += lines.length;
this.yylloc = {first_line: this.yylloc.last_line,
last_line: this.yylineno+1,
first_column: this.yylloc.last_column,
last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
if (this.done && this._input) this.done = false;
if (token) return token;
else return;
}
if (this._input === "") {
return this.EOF;
} else {
return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
{text: "", token: null, line: this.yylineno});
}
},
lex:function lex() {
var r = this.next();
if (typeof r !== 'undefined') {
return r;
} else {
return this.lex();
}
},
begin:function begin(condition) {
this.conditionStack.push(condition);
},
popState:function popState() {
return this.conditionStack.pop();
},
_currentRules:function _currentRules() {
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
},
topState:function () {
return this.conditionStack[this.conditionStack.length-2];
},
pushState:function begin(condition) {
this.begin(condition);
}});
lexer.options = {};
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
var YYSTATE=YY_START
switch($avoiding_name_collisions) {
case 0: yy_.yytext = "\\"; return 14;
break;
case 1:
if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
if(yy_.yytext) return 14;
break;
case 2: return 14;
break;
case 3:
if(yy_.yytext.slice(-1) !== "\\") this.popState();
if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
return 14;
break;
case 4: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
break;
case 5: this.begin("par"); return 24;
break;
case 6: return 16;
break;
case 7: return 20;
break;
case 8: return 19;
break;
case 9: return 19;
break;
case 10: return 23;
break;
case 11: return 23;
break;
case 12: this.popState(); this.begin('com');
break;
case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
break;
case 14: return 22;
break;
case 15: return 36;
break;
case 16: return 35;
break;
case 17: return 35;
break;
case 18: return 39;
break;
case 19: /*ignore whitespace*/
break;
case 20: this.popState(); return 18;
break;
case 21: this.popState(); return 18;
break;
case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30;
break;
case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30;
break;
case 24: yy_.yytext = yy_.yytext.substr(1); return 28;
break;
case 25: return 32;
break;
case 26: return 32;
break;
case 27: return 31;
break;
case 28: return 35;
break;
case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35;
break;
case 30: return 'INVALID';
break;
case 31: /*ignore whitespace*/
break;
case 32: this.popState(); return 37;
break;
case 33: return 5;
break;
}
};
lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:\-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/]+)/,/^(?:$)/];
lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"par":{"rules":[31,32],"inclusive":false},"INITIAL":{"rules":[0,1,2,33],"inclusive":true}};
return lexer;})()
parser.lexer = lexer;
function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
return new Parser;
})();;
// lib/handlebars/compiler/base.js
Handlebars.Parser = handlebars;
Handlebars.parse = function(input) {
// Just return if an already-compile AST was passed in.
if(input.constructor === Handlebars.AST.ProgramNode) { return input; }
Handlebars.Parser.yy = Handlebars.AST;
return Handlebars.Parser.parse(input);
};
;
// lib/handlebars/compiler/ast.js
Handlebars.AST = {};
Handlebars.AST.ProgramNode = function(statements, inverse) {
this.type = "program";
this.statements = statements;
if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
};
Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
this.type = "mustache";
this.escaped = !unescaped;
this.hash = hash;
var id = this.id = rawParams[0];
var params = this.params = rawParams.slice(1);
// a mustache is an eligible helper if:
// * its id is simple (a single part, not `this` or `..`)
var eligibleHelper = this.eligibleHelper = id.isSimple;
// a mustache is definitely a helper if:
// * it is an eligible helper, and
// * it has at least one parameter or hash segment
this.isHelper = eligibleHelper && (params.length || hash);
// if a mustache is an eligible helper but not a definite
// helper, it is ambiguous, and will be resolved in a later
// pass or at runtime.
};
Handlebars.AST.PartialNode = function(partialName, context) {
this.type = "partial";
this.partialName = partialName;
this.context = context;
};
Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
var verifyMatch = function(open, close) {
if(open.original !== close.original) {
throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
}
};
verifyMatch(mustache.id, close);
this.type = "block";
this.mustache = mustache;
this.program = program;
this.inverse = inverse;
if (this.inverse && !this.program) {
this.isInverse = true;
}
};
Handlebars.AST.ContentNode = function(string) {
this.type = "content";
this.string = string;
};
Handlebars.AST.HashNode = function(pairs) {
this.type = "hash";
this.pairs = pairs;
};
Handlebars.AST.IdNode = function(parts) {
this.type = "ID";
this.original = parts.join(".");
var dig = [], depth = 0;
for(var i=0,l=parts.length; i<l; i++) {
var part = parts[i];
if (part === ".." || part === "." || part === "this") {
if (dig.length > 0) { throw new Handlebars.Exception("Invalid path: " + this.original); }
else if (part === "..") { depth++; }
else { this.isScoped = true; }
}
else { dig.push(part); }
}
this.parts = dig;
this.string = dig.join('.');
this.depth = depth;
// an ID is simple if it only has one part, and that part is not
// `..` or `this`.
this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
this.stringModeValue = this.string;
};
Handlebars.AST.PartialNameNode = function(name) {
this.type = "PARTIAL_NAME";
this.name = name;
};
Handlebars.AST.DataNode = function(id) {
this.type = "DATA";
this.id = id;
};
Handlebars.AST.StringNode = function(string) {
this.type = "STRING";
this.string = string;
this.stringModeValue = string;
};
Handlebars.AST.IntegerNode = function(integer) {
this.type = "INTEGER";
this.integer = integer;
this.stringModeValue = Number(integer);
};
Handlebars.AST.BooleanNode = function(bool) {
this.type = "BOOLEAN";
this.bool = bool;
this.stringModeValue = bool === "true";
};
Handlebars.AST.CommentNode = function(comment) {
this.type = "comment";
this.comment = comment;
};
;
// lib/handlebars/utils.js
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
Handlebars.Exception = function(message) {
var tmp = Error.prototype.constructor.apply(this, arguments);
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
for (var idx = 0; idx < errorProps.length; idx++) {
this[errorProps[idx]] = tmp[errorProps[idx]];
}
};
Handlebars.Exception.prototype = new Error();
// Build out our basic SafeString type
Handlebars.SafeString = function(string) {
this.string = string;
};
Handlebars.SafeString.prototype.toString = function() {
return this.string.toString();
};
var escape = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
};
var badChars = /[&<>"'`]/g;
var possible = /[&<>"'`]/;
var escapeChar = function(chr) {
return escape[chr] || "&";
};
Handlebars.Utils = {
extend: function(obj, value) {
for(var key in value) {
if(value.hasOwnProperty(key)) {
obj[key] = value[key];
}
}
},
escapeExpression: function(string) {
// don't escape SafeStrings, since they're already safe
if (string instanceof Handlebars.SafeString) {
return string.toString();
} else if (string == null || string === false) {
return "";
}
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
string = string.toString();
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);
},
isEmpty: function(value) {
if (!value && value !== 0) {
return true;
} else if(toString.call(value) === "[object Array]" && value.length === 0) {
return true;
} else {
return false;
}
}
};
;
// lib/handlebars/compiler/compiler.js
/*jshint eqnull:true*/
var Compiler = Handlebars.Compiler = function() {};
var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
// the foundHelper register will disambiguate helper lookup from finding a
// function in a context. This is necessary for mustache compatibility, which
// requires that context functions in blocks are evaluated by blockHelperMissing,
// and then proceed as if the resulting value was provided to blockHelperMissing.
Compiler.prototype = {
compiler: Compiler,
disassemble: function() {
var opcodes = this.opcodes, opcode, out = [], params, param;
for (var i=0, l=opcodes.length; i<l; i++) {
opcode = opcodes[i];
if (opcode.opcode === 'DECLARE') {
out.push("DECLARE " + opcode.name + "=" + opcode.value);
} else {
params = [];
for (var j=0; j<opcode.args.length; j++) {
param = opcode.args[j];
if (typeof param === "string") {
param = "\"" + param.replace("\n", "\\n") + "\"";
}
params.push(param);
}
out.push(opcode.opcode + " " + params.join(" "));
}
}
return out.join("\n");
},
equals: function(other) {
var len = this.opcodes.length;
if (other.opcodes.length !== len) {
return false;
}
for (var i = 0; i < len; i++) {
var opcode = this.opcodes[i],
otherOpcode = other.opcodes[i];
if (opcode.opcode !== otherOpcode.opcode || opcode.args.length !== otherOpcode.args.length) {
return false;
}
for (var j = 0; j < opcode.args.length; j++) {
if (opcode.args[j] !== otherOpcode.args[j]) {
return false;
}
}
}
len = this.children.length;
if (other.children.length !== len) {
return false;
}
for (i = 0; i < len; i++) {
if (!this.children[i].equals(other.children[i])) {
return false;
}
}
return true;
},
guid: 0,
compile: function(program, options) {
this.children = [];
this.depths = {list: []};
this.options = options;
// These changes will propagate to the other compiler components
var knownHelpers = this.options.knownHelpers;
this.options.knownHelpers = {
'helperMissing': true,
'blockHelperMissing': true,
'each': true,
'if': true,
'unless': true,
'with': true,
'log': true
};
if (knownHelpers) {
for (var name in knownHelpers) {
this.options.knownHelpers[name] = knownHelpers[name];
}
}
return this.program(program);
},
accept: function(node) {
return this[node.type](node);
},
program: function(program) {
var statements = program.statements, statement;
this.opcodes = [];
for(var i=0, l=statements.length; i<l; i++) {
statement = statements[i];
this[statement.type](statement);
}
this.isSimple = l === 1;
this.depths.list = this.depths.list.sort(function(a, b) {
return a - b;
});
return this;
},
compileProgram: function(program) {
var result = new this.compiler().compile(program, this.options);
var guid = this.guid++, depth;
this.usePartial = this.usePartial || result.usePartial;
this.children[guid] = result;
for(var i=0, l=result.depths.list.length; i<l; i++) {
depth = result.depths.list[i];
if(depth < 2) { continue; }
else { this.addDepth(depth - 1); }
}
return guid;
},
block: function(block) {
var mustache = block.mustache,
program = block.program,
inverse = block.inverse;
if (program) {
program = this.compileProgram(program);
}
if (inverse) {
inverse = this.compileProgram(inverse);
}
var type = this.classifyMustache(mustache);
if (type === "helper") {
this.helperMustache(mustache, program, inverse);
} else if (type === "simple") {
this.simpleMustache(mustache);
// now that the simple mustache is resolved, we need to
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('blockValue');
} else {
this.ambiguousMustache(mustache, program, inverse);
// now that the simple mustache is resolved, we need to
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('ambiguousBlockValue');
}
this.opcode('append');
},
hash: function(hash) {
var pairs = hash.pairs, pair, val;
this.opcode('pushHash');
for(var i=0, l=pairs.length; i<l; i++) {
pair = pairs[i];
val = pair[1];
if (this.options.stringParams) {
if(val.depth) {
this.addDepth(val.depth);
}
this.opcode('getContext', val.depth || 0);
this.opcode('pushStringParam', val.stringModeValue, val.type);
} else {
this.accept(val);
}
this.opcode('assignToHash', pair[0]);
}
this.opcode('popHash');
},
partial: function(partial) {
var partialName = partial.partialName;
this.usePartial = true;
if(partial.context) {
this.ID(partial.context);
} else {
this.opcode('push', 'depth0');
}
this.opcode('invokePartial', partialName.name);
this.opcode('append');
},
content: function(content) {
this.opcode('appendContent', content.string);
},
mustache: function(mustache) {
var options = this.options;
var type = this.classifyMustache(mustache);
if (type === "simple") {
this.simpleMustache(mustache);
} else if (type === "helper") {
this.helperMustache(mustache);
} else {
this.ambiguousMustache(mustache);
}
if(mustache.escaped && !options.noEscape) {
this.opcode('appendEscaped');
} else {
this.opcode('append');
}
},
ambiguousMustache: function(mustache, program, inverse) {
var id = mustache.id,
name = id.parts[0],
isBlock = program != null || inverse != null;
this.opcode('getContext', id.depth);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('invokeAmbiguous', name, isBlock);
},
simpleMustache: function(mustache) {
var id = mustache.id;
if (id.type === 'DATA') {
this.DATA(id);
} else if (id.parts.length) {
this.ID(id);
} else {
// Simplified ID for `this`
this.addDepth(id.depth);
this.opcode('getContext', id.depth);
this.opcode('pushContext');
}
this.opcode('resolvePossibleLambda');
},
helperMustache: function(mustache, program, inverse) {
var params = this.setupFullMustacheParams(mustache, program, inverse),
name = mustache.id.parts[0];
if (this.options.knownHelpers[name]) {
this.opcode('invokeKnownHelper', params.length, name);
} else if (this.options.knownHelpersOnly) {
throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
} else {
this.opcode('invokeHelper', params.length, name);
}
},
ID: function(id) {
this.addDepth(id.depth);
this.opcode('getContext', id.depth);
var name = id.parts[0];
if (!name) {
this.opcode('pushContext');
} else {
this.opcode('lookupOnContext', id.parts[0]);
}
for(var i=1, l=id.parts.length; i<l; i++) {
this.opcode('lookup', id.parts[i]);
}
},
DATA: function(data) {
this.options.data = true;
this.opcode('lookupData', data.id);
},
STRING: function(string) {
this.opcode('pushString', string.string);
},
INTEGER: function(integer) {
this.opcode('pushLiteral', integer.integer);
},
BOOLEAN: function(bool) {
this.opcode('pushLiteral', bool.bool);
},
comment: function() {},
// HELPERS
opcode: function(name) {
this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
},
declare: function(name, value) {
this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
},
addDepth: function(depth) {
if(isNaN(depth)) { throw new Error("EWOT"); }
if(depth === 0) { return; }
if(!this.depths[depth]) {
this.depths[depth] = true;
this.depths.list.push(depth);
}
},
classifyMustache: function(mustache) {
var isHelper = mustache.isHelper;
var isEligible = mustache.eligibleHelper;
var options = this.options;
// if ambiguous, we can possibly resolve the ambiguity now
if (isEligible && !isHelper) {
var name = mustache.id.parts[0];
if (options.knownHelpers[name]) {
isHelper = true;
} else if (options.knownHelpersOnly) {
isEligible = false;
}
}
if (isHelper) { return "helper"; }
else if (isEligible) { return "ambiguous"; }
else { return "simple"; }
},
pushParams: function(params) {
var i = params.length, param;
while(i--) {
param = params[i];
if(this.options.stringParams) {
if(param.depth) {
this.addDepth(param.depth);
}
this.opcode('getContext', param.depth || 0);
this.opcode('pushStringParam', param.stringModeValue, param.type);
} else {
this[param.type](param);
}
}
},
setupMustacheParams: function(mustache) {
var params = mustache.params;
this.pushParams(params);
if(mustache.hash) {
this.hash(mustache.hash);
} else {
this.opcode('emptyHash');
}
return params;
},
// this will replace setupMustacheParams when we're done
setupFullMustacheParams: function(mustache, program, inverse) {
var params = mustache.params;
this.pushParams(params);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
if(mustache.hash) {
this.hash(mustache.hash);
} else {
this.opcode('emptyHash');
}
return params;
}
};
var Literal = function(value) {
this.value = value;
};
JavaScriptCompiler.prototype = {
// PUBLIC API: You can override these methods in a subclass to provide
// alternative compiled forms for name lookup and buffering semantics
nameLookup: function(parent, name /* , type*/) {
if (/^[0-9]+$/.test(name)) {
return parent + "[" + name + "]";
} else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
return parent + "." + name;
}
else {
return parent + "['" + name + "']";
}
},
appendToBuffer: function(string) {
if (this.environment.isSimple) {
return "return " + string + ";";
} else {
return {
appendToBuffer: true,
content: string,
toString: function() { return "buffer += " + string + ";"; }
};
}
},
initializeBuffer: function() {
return this.quotedString("");
},
namespace: "Handlebars",
// END PUBLIC API
compile: function(environment, options, context, asObject) {
this.environment = environment;
this.options = options || {};
Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
this.name = this.environment.name;
this.isChild = !!context;
this.context = context || {
programs: [],
environments: [],
aliases: { }
};
this.preamble();
this.stackSlot = 0;
this.stackVars = [];
this.registers = { list: [] };
this.compileStack = [];
this.inlineStack = [];
this.compileChildren(environment, options);
var opcodes = environment.opcodes, opcode;
this.i = 0;
for(l=opcodes.length; this.i<l; this.i++) {
opcode = opcodes[this.i];
if(opcode.opcode === 'DECLARE') {
this[opcode.name] = opcode.value;
} else {
this[opcode.opcode].apply(this, opcode.args);
}
}
return this.createFunctionContext(asObject);
},
nextOpcode: function() {
var opcodes = this.environment.opcodes;
return opcodes[this.i + 1];
},
eat: function() {
this.i = this.i + 1;
},
preamble: function() {
var out = [];
if (!this.isChild) {
var namespace = this.namespace;
var copies = "helpers = helpers || " + namespace + ".helpers;";
if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
if (this.options.data) { copies = copies + " data = data || {};"; }
out.push(copies);
} else {
out.push('');
}
if (!this.environment.isSimple) {
out.push(", buffer = " + this.initializeBuffer());
} else {
out.push("");
}
// track the last context pushed into place to allow skipping the
// getContext opcode when it would be a noop
this.lastContext = 0;
this.source = out;
},
createFunctionContext: function(asObject) {
var locals = this.stackVars.concat(this.registers.list);
if(locals.length > 0) {
this.source[1] = this.source[1] + ", " + locals.join(", ");
}
// Generate minimizer alias mappings
if (!this.isChild) {
for (var alias in this.context.aliases) {
this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
}
}
if (this.source[1]) {
this.source[1] = "var " + this.source[1].substring(2) + ";";
}
// Merge children
if (!this.isChild) {
this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
}
if (!this.environment.isSimple) {
this.source.push("return buffer;");
}
var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
params.push("depth" + this.environment.depths.list[i]);
}
// Perform a second pass over the output to merge content when possible
var source = this.mergeSource();
if (!this.isChild) {
var revision = Handlebars.COMPILER_REVISION,
versions = Handlebars.REVISION_CHANGES[revision];
source = "this.compilerInfo = ["+revision+",'"+versions+"'];\n"+source;
}
if (asObject) {
params.push(source);
return Function.apply(this, params);
} else {
var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + source + '}';
Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
return functionSource;
}
},
mergeSource: function() {
// WARN: We are not handling the case where buffer is still populated as the source should
// not have buffer append operations as their final action.
var source = '',
buffer;
for (var i = 0, len = this.source.length; i < len; i++) {
var line = this.source[i];
if (line.appendToBuffer) {
if (buffer) {
buffer = buffer + '\n + ' + line.content;
} else {
buffer = line.content;
}
} else {
if (buffer) {
source += 'buffer += ' + buffer + ';\n ';
buffer = undefined;
}
source += line + '\n ';
}
}
return source;
},
// [blockValue]
//
// On stack, before: hash, inverse, program, value
// On stack, after: return value of blockHelperMissing
//
// The purpose of this opcode is to take a block of the form
// `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
// replace it on the stack with the result of properly
// invoking blockHelperMissing.
blockValue: function() {
this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
var params = ["depth0"];
this.setupParams(0, params);
this.replaceStack(function(current) {
params.splice(1, 0, current);
return "blockHelperMissing.call(" + params.join(", ") + ")";
});
},
// [ambiguousBlockValue]
//
// On stack, before: hash, inverse, program, value
// Compiler value, before: lastHelper=value of last found helper, if any
// On stack, after, if no lastHelper: same as [blockValue]
// On stack, after, if lastHelper: value
ambiguousBlockValue: function() {
this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
var params = ["depth0"];
this.setupParams(0, params);
var current = this.topStack();
params.splice(1, 0, current);
// Use the options value generated from the invocation
params[params.length-1] = 'options';
this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
},
// [appendContent]
//
// On stack, before: ...
// On stack, after: ...
//
// Appends the string value of `content` to the current buffer
appendContent: function(content) {
this.source.push(this.appendToBuffer(this.quotedString(content)));
},
// [append]
//
// On stack, before: value, ...
// On stack, after: ...
//
// Coerces `value` to a String and appends it to the current buffer.
//
// If `value` is truthy, or 0, it is coerced into a string and appended
// Otherwise, the empty string is appended
append: function() {
// Force anything that is inlined onto the stack so we don't have duplication
// when we examine local
this.flushInline();
var local = this.popStack();
this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
if (this.environment.isSimple) {
this.source.push("else { " + this.appendToBuffer("''") + " }");
}
},
// [appendEscaped]
//
// On stack, before: value, ...
// On stack, after: ...
//
// Escape `value` and append it to the buffer
appendEscaped: function() {
this.context.aliases.escapeExpression = 'this.escapeExpression';
this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));
},
// [getContext]
//
// On stack, before: ...
// On stack, after: ...
// Compiler value, after: lastContext=depth
//
// Set the value of the `lastContext` compiler value to the depth
getContext: function(depth) {
if(this.lastContext !== depth) {
this.lastContext = depth;
}
},
// [lookupOnContext]
//
// On stack, before: ...
// On stack, after: currentContext[name], ...
//
// Looks up the value of `name` on the current context and pushes
// it onto the stack.
lookupOnContext: function(name) {
this.push(this.nameLookup('depth' + this.lastContext, name, 'context'));
},
// [pushContext]
//
// On stack, before: ...
// On stack, after: currentContext, ...
//
// Pushes the value of the current context onto the stack.
pushContext: function() {
this.pushStackLiteral('depth' + this.lastContext);
},
// [resolvePossibleLambda]
//
// On stack, before: value, ...
// On stack, after: resolved value, ...
//
// If the `value` is a lambda, replace it on the stack by
// the return value of the lambda
resolvePossibleLambda: function() {
this.context.aliases.functionType = '"function"';
this.replaceStack(function(current) {
return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;
});
},
// [lookup]
//
// On stack, before: value, ...
// On stack, after: value[name], ...
//
// Replace the value on the stack with the result of looking
// up `name` on `value`
lookup: function(name) {
this.replaceStack(function(current) {
return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
});
},
// [lookupData]
//
// On stack, before: ...
// On stack, after: data[id], ...
//
// Push the result of looking up `id` on the current data
lookupData: function(id) {
this.push(this.nameLookup('data', id, 'data'));
},
// [pushStringParam]
//
// On stack, before: ...
// On stack, after: string, currentContext, ...
//
// This opcode is designed for use in string mode, which
// provides the string value of a parameter along with its
// depth rather than resolving it immediately.
pushStringParam: function(string, type) {
this.pushStackLiteral('depth' + this.lastContext);
this.pushString(type);
if (typeof string === 'string') {
this.pushString(string);
} else {
this.pushStackLiteral(string);
}
},
emptyHash: function() {
this.pushStackLiteral('{}');
if (this.options.stringParams) {
this.register('hashTypes', '{}');
this.register('hashContexts', '{}');
}
},
pushHash: function() {
this.hash = {values: [], types: [], contexts: []};
},
popHash: function() {
var hash = this.hash;
this.hash = undefined;
if (this.options.stringParams) {
this.register('hashContexts', '{' + hash.contexts.join(',') + '}');
this.register('hashTypes', '{' + hash.types.join(',') + '}');
}
this.push('{\n ' + hash.values.join(',\n ') + '\n }');
},
// [pushString]
//
// On stack, before: ...
// On stack, after: quotedString(string), ...
//
// Push a quoted version of `string` onto the stack
pushString: function(string) {
this.pushStackLiteral(this.quotedString(string));
},
// [push]
//
// On stack, before: ...
// On stack, after: expr, ...
//
// Push an expression onto the stack
push: function(expr) {
this.inlineStack.push(expr);
return expr;
},
// [pushLiteral]
//
// On stack, before: ...
// On stack, after: value, ...
//
// Pushes a value onto the stack. This operation prevents
// the compiler from creating a temporary variable to hold
// it.
pushLiteral: function(value) {
this.pushStackLiteral(value);
},
// [pushProgram]
//
// On stack, before: ...
// On stack, after: program(guid), ...
//
// Push a program expression onto the stack. This takes
// a compile-time guid and converts it into a runtime-accessible
// expression.
pushProgram: function(guid) {
if (guid != null) {
this.pushStackLiteral(this.programExpression(guid));
} else {
this.pushStackLiteral(null);
}
},
// [invokeHelper]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of helper invocation
//
// Pops off the helper's parameters, invokes the helper,
// and pushes the helper's return value onto the stack.
//
// If the helper is not found, `helperMissing` is called.
invokeHelper: function(paramSize, name) {
this.context.aliases.helperMissing = 'helpers.helperMissing';
var helper = this.lastHelper = this.setupHelper(paramSize, name, true);
this.push(helper.name);
this.replaceStack(function(name) {
return name + ' ? ' + name + '.call(' +
helper.callParams + ") " + ": helperMissing.call(" +
helper.helperMissingParams + ")";
});
},
// [invokeKnownHelper]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of helper invocation
//
// This operation is used when the helper is known to exist,
// so a `helperMissing` fallback is not required.
invokeKnownHelper: function(paramSize, name) {
var helper = this.setupHelper(paramSize, name);
this.push(helper.name + ".call(" + helper.callParams + ")");
},
// [invokeAmbiguous]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of disambiguation
//
// This operation is used when an expression like `{{foo}}`
// is provided, but we don't know at compile-time whether it
// is a helper or a path.
//
// This operation emits more code than the other options,
// and can be avoided by passing the `knownHelpers` and
// `knownHelpersOnly` flags at compile-time.
invokeAmbiguous: function(name, helperCall) {
this.context.aliases.functionType = '"function"';
this.pushStackLiteral('{}'); // Hash value
var helper = this.setupHelper(0, name, helperCall);
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
var nextStack = this.nextStack();
this.source.push('if (' + nextStack + ' = ' + helperName + ') { ' + nextStack + ' = ' + nextStack + '.call(' + helper.callParams + '); }');
this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '.apply(depth0) : ' + nextStack + '; }');
},
// [invokePartial]
//
// On stack, before: context, ...
// On stack after: result of partial invocation
//
// This operation pops off a context, invokes a partial with that context,
// and pushes the result of the invocation back.
invokePartial: function(name) {
var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
if (this.options.data) {
params.push("data");
}
this.context.aliases.self = "this";
this.push("self.invokePartial(" + params.join(", ") + ")");
},
// [assignToHash]
//
// On stack, before: value, hash, ...
// On stack, after: hash, ...
//
// Pops a value and hash off the stack, assigns `hash[key] = value`
// and pushes the hash back onto the stack.
assignToHash: function(key) {
var value = this.popStack(),
context,
type;
if (this.options.stringParams) {
type = this.popStack();
context = this.popStack();
}
var hash = this.hash;
if (context) {
hash.contexts.push("'" + key + "': " + context);
}
if (type) {
hash.types.push("'" + key + "': " + type);
}
hash.values.push("'" + key + "': (" + value + ")");
},
// HELPERS
compiler: JavaScriptCompiler,
compileChildren: function(environment, options) {
var children = environment.children, child, compiler;
for(var i=0, l=children.length; i<l; i++) {
child = children[i];
compiler = new this.compiler();
var index = this.matchExistingProgram(child);
if (index == null) {
this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
index = this.context.programs.length;
child.index = index;
child.name = 'program' + index;
this.context.programs[index] = compiler.compile(child, options, this.context);
this.context.environments[index] = child;
} else {
child.index = index;
child.name = 'program' + index;
}
}
},
matchExistingProgram: function(child) {
for (var i = 0, len = this.context.environments.length; i < len; i++) {
var environment = this.context.environments[i];
if (environment && environment.equals(child)) {
return i;
}
}
},
programExpression: function(guid) {
this.context.aliases.self = "this";
if(guid == null) {
return "self.noop";
}
var child = this.environment.children[guid],
depths = child.depths.list, depth;
var programParams = [child.index, child.name, "data"];
for(var i=0, l = depths.length; i<l; i++) {
depth = depths[i];
if(depth === 1) { programParams.push("depth0"); }
else { programParams.push("depth" + (depth - 1)); }
}
return (depths.length === 0 ? "self.program(" : "self.programWithDepth(") + programParams.join(", ") + ")";
},
register: function(name, val) {
this.useRegister(name);
this.source.push(name + " = " + val + ";");
},
useRegister: function(name) {
if(!this.registers[name]) {
this.registers[name] = true;
this.registers.list.push(name);
}
},
pushStackLiteral: function(item) {
return this.push(new Literal(item));
},
pushStack: function(item) {
this.flushInline();
var stack = this.incrStack();
if (item) {
this.source.push(stack + " = " + item + ";");
}
this.compileStack.push(stack);
return stack;
},
replaceStack: function(callback) {
var prefix = '',
inline = this.isInline(),
stack;
// If we are currently inline then we want to merge the inline statement into the
// replacement statement via ','
if (inline) {
var top = this.popStack(true);
if (top instanceof Literal) {
// Literals do not need to be inlined
stack = top.value;
} else {
// Get or create the current stack name for use by the inline
var name = this.stackSlot ? this.topStackName() : this.incrStack();
prefix = '(' + this.push(name) + ' = ' + top + '),';
stack = this.topStack();
}
} else {
stack = this.topStack();
}
var item = callback.call(this, stack);
if (inline) {
if (this.inlineStack.length || this.compileStack.length) {
this.popStack();
}
this.push('(' + prefix + item + ')');
} else {
// Prevent modification of the context depth variable. Through replaceStack
if (!/^stack/.test(stack)) {
stack = this.nextStack();
}
this.source.push(stack + " = (" + prefix + item + ");");
}
return stack;
},
nextStack: function() {
return this.pushStack();
},
incrStack: function() {
this.stackSlot++;
if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
return this.topStackName();
},
topStackName: function() {
return "stack" + this.stackSlot;
},
flushInline: function() {
var inlineStack = this.inlineStack;
if (inlineStack.length) {
this.inlineStack = [];
for (var i = 0, len = inlineStack.length; i < len; i++) {
var entry = inlineStack[i];
if (entry instanceof Literal) {
this.compileStack.push(entry);
} else {
this.pushStack(entry);
}
}
}
},
isInline: function() {
return this.inlineStack.length;
},
popStack: function(wrapped) {
var inline = this.isInline(),
item = (inline ? this.inlineStack : this.compileStack).pop();
if (!wrapped && (item instanceof Literal)) {
return item.value;
} else {
if (!inline) {
this.stackSlot--;
}
return item;
}
},
topStack: function(wrapped) {
var stack = (this.isInline() ? this.inlineStack : this.compileStack),
item = stack[stack.length - 1];
if (!wrapped && (item instanceof Literal)) {
return item.value;
} else {
return item;
}
},
quotedString: function(str) {
return '"' + str
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
.replace(/\u2029/g, '\\u2029') + '"';
},
setupHelper: function(paramSize, name, missingParams) {
var params = [];
this.setupParams(paramSize, params, missingParams);
var foundHelper = this.nameLookup('helpers', name, 'helper');
return {
params: params,
name: foundHelper,
callParams: ["depth0"].concat(params).join(", "),
helperMissingParams: missingParams && ["depth0", this.quotedString(name)].concat(params).join(", ")
};
},
// the params and contexts arguments are passed in arrays
// to fill in
setupParams: function(paramSize, params, useRegister) {
var options = [], contexts = [], types = [], param, inverse, program;
options.push("hash:" + this.popStack());
inverse = this.popStack();
program = this.popStack();
// Avoid setting fn and inverse if neither are set. This allows
// helpers to do a check for `if (options.fn)`
if (program || inverse) {
if (!program) {
this.context.aliases.self = "this";
program = "self.noop";
}
if (!inverse) {
this.context.aliases.self = "this";
inverse = "self.noop";
}
options.push("inverse:" + inverse);
options.push("fn:" + program);
}
for(var i=0; i<paramSize; i++) {
param = this.popStack();
params.push(param);
if(this.options.stringParams) {
types.push(this.popStack());
contexts.push(this.popStack());
}
}
if (this.options.stringParams) {
options.push("contexts:[" + contexts.join(",") + "]");
options.push("types:[" + types.join(",") + "]");
options.push("hashContexts:hashContexts");
options.push("hashTypes:hashTypes");
}
if(this.options.data) {
options.push("data:data");
}
options = "{" + options.join(",") + "}";
if (useRegister) {
this.register('options', options);
params.push('options');
} else {
params.push(options);
}
return params.join(", ");
}
};
var reservedWords = (
"break else new var" +
" case finally return void" +
" catch for switch while" +
" continue function this with" +
" default if throw" +
" delete in try" +
" do instanceof typeof" +
" abstract enum int short" +
" boolean export interface static" +
" byte extends long super" +
" char final native synchronized" +
" class float package throws" +
" const goto private transient" +
" debugger implements protected volatile" +
" double import public let yield"
).split(" ");
var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
for(var i=0, l=reservedWords.length; i<l; i++) {
compilerWords[reservedWords[i]] = true;
}
JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
return true;
}
return false;
};
Handlebars.precompile = function(input, options) {
if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
}
options = options || {};
if (!('data' in options)) {
options.data = true;
}
var ast = Handlebars.parse(input);
var environment = new Compiler().compile(ast, options);
return new JavaScriptCompiler().compile(environment, options);
};
Handlebars.compile = function(input, options) {
if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
}
options = options || {};
if (!('data' in options)) {
options.data = true;
}
var compiled;
function compile() {
var ast = Handlebars.parse(input);
var environment = new Compiler().compile(ast, options);
var templateSpec = new JavaScriptCompiler().compile(environment, options, undefined, true);
return Handlebars.template(templateSpec);
}
// Template is only compiled on first use and cached after that point.
return function(context, options) {
if (!compiled) {
compiled = compile();
}
return compiled.call(this, context, options);
};
};
;
// lib/handlebars/runtime.js
Handlebars.VM = {
template: function(templateSpec) {
// Just add water
var container = {
escapeExpression: Handlebars.Utils.escapeExpression,
invokePartial: Handlebars.VM.invokePartial,
programs: [],
program: function(i, fn, data) {
var programWrapper = this.programs[i];
if(data) {
programWrapper = Handlebars.VM.program(i, fn, data);
} else if (!programWrapper) {
programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
}
return programWrapper;
},
programWithDepth: Handlebars.VM.programWithDepth,
noop: Handlebars.VM.noop,
compilerInfo: null
};
return function(context, options) {
options = options || {};
var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
var compilerInfo = container.compilerInfo || [],
compilerRevision = compilerInfo[0] || 1,
currentRevision = Handlebars.COMPILER_REVISION;
if (compilerRevision !== currentRevision) {
if (compilerRevision < currentRevision) {
var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
} else {
// Use the embedded version info since the runtime doesn't know about this revision yet
throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
"Please update your runtime to a newer version ("+compilerInfo[1]+").";
}
}
return result;
};
},
programWithDepth: function(i, fn, data /*, $depth */) {
var args = Array.prototype.slice.call(arguments, 3);
var program = function(context, options) {
options = options || {};
return fn.apply(this, [context, options.data || data].concat(args));
};
program.program = i;
program.depth = args.length;
return program;
},
program: function(i, fn, data) {
var program = function(context, options) {
options = options || {};
return fn(context, options.data || data);
};
program.program = i;
program.depth = 0;
return program;
},
noop: function() { return ""; },
invokePartial: function(partial, name, context, helpers, partials, data) {
var options = { helpers: helpers, partials: partials, data: data };
if(partial === undefined) {
throw new Handlebars.Exception("The partial " + name + " could not be found");
} else if(partial instanceof Function) {
return partial(context, options);
} else if (!Handlebars.compile) {
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
} else {
partials[name] = Handlebars.compile(partial, {data: data !== undefined});
return partials[name](context, options);
}
}
};
Handlebars.template = Handlebars.VM.template;
;
// lib/handlebars/browser-suffix.js
})(Handlebars);
;
// Underscore.js 1.4.4
// ===================
// > http://underscorejs.org
// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
// > Underscore may be freely distributed under the MIT license.
// Baseline setup
// --------------
(function() {
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {};
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var push = ArrayProto.push,
slice = ArrayProto.slice,
concat = ArrayProto.concat,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeForEach = ArrayProto.forEach,
nativeMap = ArrayProto.map,
nativeReduce = ArrayProto.reduce,
nativeReduceRight = ArrayProto.reduceRight,
nativeFilter = ArrayProto.filter,
nativeEvery = ArrayProto.every,
nativeSome = ArrayProto.some,
nativeIndexOf = ArrayProto.indexOf,
nativeLastIndexOf = ArrayProto.lastIndexOf,
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root._ = _;
}
// Current version.
_.VERSION = '1.4.4';
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var each = _.each = _.forEach = function(obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, l = obj.length; i < l; i++) {
if (iterator.call(context, obj[i], i, obj) === breaker) return;
}
} else {
for (var key in obj) {
if (_.has(obj, key)) {
if (iterator.call(context, obj[key], key, obj) === breaker) return;
}
}
}
};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
_.map = _.collect = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) {
results[results.length] = iterator.call(context, value, index, list);
});
return results;
};
var reduceError = 'Reduce of empty array with no initial value';
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduce && obj.reduce === nativeReduce) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial) {
memo = value;
initial = true;
} else {
memo = iterator.call(context, memo, value, index, list);
}
});
if (!initial) throw new TypeError(reduceError);
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var length = obj.length;
if (length !== +length) {
var keys = _.keys(obj);
length = keys.length;
}
each(obj, function(value, index, list) {
index = keys ? keys[--length] : --length;
if (!initial) {
memo = obj[index];
initial = true;
} else {
memo = iterator.call(context, memo, obj[index], index, list);
}
});
if (!initial) throw new TypeError(reduceError);
return memo;
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, iterator, context) {
var result;
any(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
_.filter = _.select = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
return _.filter(obj, function(value, index, list) {
return !iterator.call(context, value, index, list);
}, context);
};
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
each(obj, function(value, index, list) {
if (result || (result = iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if the array or object contains a given value (using `===`).
// Aliased as `include`.
_.contains = _.include = function(obj, target) {
if (obj == null) return false;
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
return any(obj, function(value) {
return value === target;
});
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
var isFunc = _.isFunction(method);
return _.map(obj, function(value) {
return (isFunc ? method : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, function(value){ return value[key]; });
};
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
_.where = function(obj, attrs, first) {
if (_.isEmpty(attrs)) return first ? null : [];
return _[first ? 'find' : 'filter'](obj, function(value) {
for (var key in attrs) {
if (attrs[key] !== value[key]) return false;
}
return true;
});
};
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
_.findWhere = function(obj, attrs) {
return _.where(obj, attrs, true);
};
// Return the maximum element or (element-based computation).
// Can't optimize arrays of integers longer than 65,535 elements.
// See: https://bugs.webkit.org/show_bug.cgi?id=80797
_.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
return Math.max.apply(Math, obj);
}
if (!iterator && _.isEmpty(obj)) return -Infinity;
var result = {computed : -Infinity, value: -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iterator, context) {
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
return Math.min.apply(Math, obj);
}
if (!iterator && _.isEmpty(obj)) return Infinity;
var result = {computed : Infinity, value: Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed < result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Shuffle an array.
_.shuffle = function(obj) {
var rand;
var index = 0;
var shuffled = [];
each(obj, function(value) {
rand = _.random(index++);
shuffled[index - 1] = shuffled[rand];
shuffled[rand] = value;
});
return shuffled;
};
// An internal function to generate lookup iterators.
var lookupIterator = function(value) {
return _.isFunction(value) ? value : function(obj){ return obj[value]; };
};
// Sort the object's values by a criterion produced by an iterator.
_.sortBy = function(obj, value, context) {
var iterator = lookupIterator(value);
return _.pluck(_.map(obj, function(value, index, list) {
return {
value : value,
index : index,
criteria : iterator.call(context, value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria;
var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
if (a < b || b === void 0) return -1;
}
return left.index < right.index ? -1 : 1;
}), 'value');
};
// An internal function used for aggregate "group by" operations.
var group = function(obj, value, context, behavior) {
var result = {};
var iterator = lookupIterator(value || _.identity);
each(obj, function(value, index) {
var key = iterator.call(context, value, index, obj);
behavior(result, key, value);
});
return result;
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = function(obj, value, context) {
return group(obj, value, context, function(result, key, value) {
(_.has(result, key) ? result[key] : (result[key] = [])).push(value);
});
};
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
_.countBy = function(obj, value, context) {
return group(obj, value, context, function(result, key) {
if (!_.has(result, key)) result[key] = 0;
result[key]++;
});
};
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator, context) {
iterator = iterator == null ? _.identity : lookupIterator(iterator);
var value = iterator.call(context, obj);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >>> 1;
iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
}
return low;
};
// Safely convert anything iterable into a real, live array.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
if (obj.length === +obj.length) return _.map(obj, _.identity);
return _.values(obj);
};
// Return the number of elements in an object.
_.size = function(obj) {
if (obj == null) return 0;
return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0;
return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
};
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if (array == null) return void 0;
if ((n != null) && !guard) {
return slice.call(array, Math.max(array.length - n, 0));
} else {
return array[array.length - 1];
}
};
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = _.drop = function(array, n, guard) {
return slice.call(array, (n == null) || guard ? 1 : n);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
};
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, output) {
each(input, function(value) {
if (_.isArray(value)) {
shallow ? push.apply(output, value) : flatten(value, shallow, output);
} else {
output.push(value);
}
});
return output;
};
// Return a completely flattened version of an array.
_.flatten = function(array, shallow) {
return flatten(array, shallow, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iterator, context) {
if (_.isFunction(isSorted)) {
context = iterator;
iterator = isSorted;
isSorted = false;
}
var initial = iterator ? _.map(array, iterator, context) : array;
var results = [];
var seen = [];
each(initial, function(value, index) {
if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
seen.push(value);
results.push(array[index]);
}
});
return results;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(concat.apply(ArrayProto, arguments));
};
// Produce an array that contains every item shared between all the
// passed-in arrays.
_.intersection = function(array) {
var rest = slice.call(arguments, 1);
return _.filter(_.uniq(array), function(item) {
return _.every(rest, function(other) {
return _.indexOf(other, item) >= 0;
});
});
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
return _.filter(array, function(value){ return !_.contains(rest, value); });
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var args = slice.call(arguments);
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(args, "" + i);
}
return results;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
_.object = function(list, values) {
if (list == null) return {};
var result = {};
for (var i = 0, l = list.length; i < l; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
};
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i = 0, l = array.length;
if (isSorted) {
if (typeof isSorted == 'number') {
i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
} else {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
}
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
for (; i < l; i++) if (array[i] === item) return i;
return -1;
};
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item, from) {
if (array == null) return -1;
var hasIndex = from != null;
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
}
var i = (hasIndex ? from : array.length);
while (i--) if (array[i] === item) return i;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = arguments[2] || 1;
var len = Math.max(Math.ceil((stop - start) / step), 0);
var idx = 0;
var range = new Array(len);
while(idx < len) {
range[idx++] = start;
start += step;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
_.bind = function(func, context) {
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
var args = slice.call(arguments, 2);
return function() {
return func.apply(context, args.concat(slice.call(arguments)));
};
};
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context.
_.partial = function(func) {
var args = slice.call(arguments, 1);
return function() {
return func.apply(this, args.concat(slice.call(arguments)));
};
};
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
_.bindAll = function(obj) {
var funcs = slice.call(arguments, 1);
if (funcs.length === 0) funcs = _.functions(obj);
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
};
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(null, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
_.throttle = function(func, wait) {
var context, args, timeout, result;
var previous = 0;
var later = function() {
previous = new Date;
timeout = null;
result = func.apply(context, args);
};
return function() {
var now = new Date;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
} else if (!timeout) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, result;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) result = func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) result = func.apply(context, args);
return result;
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = function(func) {
var ran = false, memo;
return function() {
if (ran) return memo;
ran = true;
memo = func.apply(this, arguments);
func = null;
return memo;
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return function() {
var args = [func];
push.apply(args, arguments);
return wrapper.apply(this, args);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length - 1; i >= 0; i--) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
if (times <= 0) return func();
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
var values = [];
for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
return values;
};
// Convert an object into a list of `[key, value]` pairs.
_.pairs = function(obj) {
var pairs = [];
for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
return pairs;
};
// Invert the keys and values of an object. The values must be serializable.
_.invert = function(obj) {
var result = {};
for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
return result;
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
if (source) {
for (var prop in source) {
obj[prop] = source[prop];
}
}
});
return obj;
};
// Return a copy of the object only containing the whitelisted properties.
_.pick = function(obj) {
var copy = {};
var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
each(keys, function(key) {
if (key in obj) copy[key] = obj[key];
});
return copy;
};
// Return a copy of the object without the blacklisted properties.
_.omit = function(obj) {
var copy = {};
var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
for (var key in obj) {
if (!_.contains(keys, key)) copy[key] = obj[key];
}
return copy;
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
if (source) {
for (var prop in source) {
if (obj[prop] == null) obj[prop] = source[prop];
}
}
});
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className != toString.call(b)) return false;
switch (className) {
// Strings, numbers, dates, and booleans are compared by value.
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return a == String(b);
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a == +b;
// RegExps are compared by their source patterns and flags.
case '[object RegExp]':
return a.source == b.source &&
a.global == b.global &&
a.multiline == b.multiline &&
a.ignoreCase == b.ignoreCase;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] == a) return bStack[length] == b;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
var size = 0, result = true;
// Recursively compare objects and arrays.
if (className == '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size == b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
if (!(result = eq(a[size], b[size], aStack, bStack))) break;
}
}
} else {
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
_.isFunction(bCtor) && (bCtor instanceof bCtor))) {
return false;
}
// Deep compare objects.
for (var key in a) {
if (_.has(a, key)) {
// Count the expected number of properties.
size++;
// Deep compare each member.
if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
}
}
// Ensure that both objects contain the same number of properties.
if (result) {
for (key in b) {
if (_.has(b, key) && !(size--)) break;
}
result = !size;
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return result;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, [], []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (obj == null) return true;
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType === 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) == '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
return obj === Object(obj);
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) == '[object ' + name + ']';
};
});
// Define a fallback version of the method in browsers (ahem, IE), where
// there isn't any inspectable "Arguments" type.
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return !!(obj && _.has(obj, 'callee'));
};
}
// Optimize `isFunction` if appropriate.
if (typeof (/./) !== 'function') {
_.isFunction = function(obj) {
return typeof obj === 'function';
};
}
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj != +obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
_.has = function(obj, key) {
return hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iterators.
_.identity = function(value) {
return value;
};
// Run a function **n** times.
_.times = function(n, iterator, context) {
var accum = Array(n);
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
return accum;
};
// Return a random integer between min and max (inclusive).
_.random = function(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
};
// List of HTML entities for escaping.
var entityMap = {
escape: {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'/': '/'
}
};
entityMap.unescape = _.invert(entityMap.escape);
// Regexes containing the keys and values listed immediately above.
var entityRegexes = {
escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
};
// Functions for escaping and unescaping strings to/from HTML interpolation.
_.each(['escape', 'unescape'], function(method) {
_[method] = function(string) {
if (string == null) return '';
return ('' + string).replace(entityRegexes[method], function(match) {
return entityMap[method][match];
});
};
});
// If the value of the named property is a function then invoke it;
// otherwise, return it.
_.result = function(object, property) {
if (object == null) return null;
var value = object[property];
return _.isFunction(value) ? value.call(object) : value;
};
// Add your own custom functions to the Underscore object.
_.mixin = function(obj) {
each(_.functions(obj), function(name){
var func = _[name] = obj[name];
_.prototype[name] = function() {
var args = [this._wrapped];
push.apply(args, arguments);
return result.call(this, func.apply(_, args));
};
});
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\t': 't',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(text, data, settings) {
var render;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = new RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset)
.replace(escaper, function(match) { return '\\' + escapes[match]; });
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
}
if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
}
if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
index = offset + match.length;
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + "return __p;\n";
try {
render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
if (data) return render(data, _);
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled function source as a convenience for precompilation.
template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
return template;
};
// Add a "chain" function, which will delegate to the wrapper.
_.chain = function(obj) {
return _(obj).chain();
};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var result = function(obj) {
return this._chain ? _(obj).chain() : obj;
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
var obj = this._wrapped;
method.apply(obj, arguments);
if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
return result.call(this, obj);
};
});
// Add all accessor Array functions to the wrapper.
each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
return result.call(this, method.apply(this._wrapped, arguments));
};
});
_.extend(_.prototype, {
// Start chaining a wrapped Underscore object.
chain: function() {
this._chain = true;
return this;
},
// Extracts the result from a wrapped and chained object.
value: function() {
return this._wrapped;
}
});
}).call(this);
// Backbone.js 0.9.9
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){
// Initial Setup
// -------------
// Save a reference to the global object (`window` in the browser, `exports`
// on the server).
var root = this;
// Save the previous value of the `Backbone` variable, so that it can be
// restored later on, if `noConflict` is used.
var previousBackbone = root.Backbone;
// Create a local reference to array methods.
var array = [];
var push = array.push;
var slice = array.slice;
var splice = array.splice;
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both CommonJS and the browser.
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '0.9.9';
// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
// For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
Backbone.$ = root.jQuery || root.Zepto || root.ender;
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
// to its previous owner. Returns a reference to this Backbone object.
Backbone.noConflict = function() {
root.Backbone = previousBackbone;
return this;
};
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
// will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
// set a `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
// Turn on `emulateJSON` to support legacy servers that can't deal with direct
// `application/json` requests ... will encode the body as
// `application/x-www-form-urlencoded` instead and will send the model in a
// form param named `model`.
Backbone.emulateJSON = false;
// Backbone.Events
// ---------------
// Regular expression used to split event strings.
var eventSplitter = /\s+/;
// Implement fancy features of the Events API such as multiple event
// names `"change blur"` and jQuery-style event maps `{change: action}`
// in terms of the existing API.
var eventsApi = function(obj, action, name, rest) {
if (!name) return true;
if (typeof name === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
} else if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
} else {
return true;
}
};
// Optimized internal dispatch function for triggering events. Tries to
// keep the usual cases speedy (most Backbone events have 3 arguments).
var triggerEvents = function(obj, events, args) {
var ev, i = -1, l = events.length;
switch (args.length) {
case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx);
return;
case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0]);
return;
case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1]);
return;
case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1], args[2]);
return;
default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
}
};
// A module that can be mixed in to *any object* in order to provide it with
// custom events. You may bind with `on` or remove with `off` callback
// functions to an event; `trigger`-ing an event fires all callbacks in
// succession.
//
// var object = {};
// _.extend(object, Backbone.Events);
// object.on('expand', function(){ alert('expanded'); });
// object.trigger('expand');
//
var Events = Backbone.Events = {
// Bind one or more space separated events, or an events map,
// to a `callback` function. Passing `"all"` will bind the callback to
// all events fired.
on: function(name, callback, context) {
if (!(eventsApi(this, 'on', name, [callback, context]) && callback)) return this;
this._events || (this._events = {});
var list = this._events[name] || (this._events[name] = []);
list.push({callback: callback, context: context, ctx: context || this});
return this;
},
// Bind events to only be triggered a single time. After the first time
// the callback is invoked, it will be removed.
once: function(name, callback, context) {
if (!(eventsApi(this, 'once', name, [callback, context]) && callback)) return this;
var self = this;
var once = _.once(function() {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
this.on(name, once, context);
return this;
},
// Remove one or many callbacks. If `context` is null, removes all
// callbacks with that function. If `callback` is null, removes all
// callbacks for the event. If `events` is null, removes all bound
// callbacks for all events.
off: function(name, callback, context) {
var list, ev, events, names, i, l, j, k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) {
this._events = {};
return this;
}
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
if (list = this._events[name]) {
events = [];
if (callback || context) {
for (j = 0, k = list.length; j < k; j++) {
ev = list[j];
if ((callback && callback !== (ev.callback._callback || ev.callback)) ||
(context && context !== ev.context)) {
events.push(ev);
}
}
}
this._events[name] = events;
}
}
return this;
},
// Trigger one or many events, firing all bound callbacks. Callbacks are
// passed the same arguments as `trigger` is, apart from the event name
// (unless you're listening on `"all"`, which will cause your callback to
// receive the true name of the event as the first argument).
trigger: function(name) {
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(this, events, args);
if (allEvents) triggerEvents(this, allEvents, arguments);
return this;
},
// An inversion-of-control version of `on`. Tell *this* object to listen to
// an event in another object ... keeping track of what it's listening to.
listenTo: function(object, events, callback) {
var listeners = this._listeners || (this._listeners = {});
var id = object._listenerId || (object._listenerId = _.uniqueId('l'));
listeners[id] = object;
object.on(events, callback || this, this);
return this;
},
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function(object, events, callback) {
var listeners = this._listeners;
if (!listeners) return;
if (object) {
object.off(events, callback, this);
if (!events && !callback) delete listeners[object._listenerId];
} else {
for (var id in listeners) {
listeners[id].off(null, null, this);
}
this._listeners = {};
}
return this;
}
};
// Aliases for backwards compatibility.
Events.bind = Events.on;
Events.unbind = Events.off;
// Allow the `Backbone` object to serve as a global event bus, for folks who
// want global "pubsub" in a convenient place.
_.extend(Backbone, Events);
// Backbone.Model
// --------------
// Create a new model, with defined attributes. A client id (`cid`)
// is automatically generated and assigned for you.
var Model = Backbone.Model = function(attributes, options) {
var defaults;
var attrs = attributes || {};
this.cid = _.uniqueId('c');
this.changed = {};
this.attributes = {};
this._changes = [];
if (options && options.collection) this.collection = options.collection;
if (options && options.parse) attrs = this.parse(attrs);
if (defaults = _.result(this, 'defaults')) _.defaults(attrs, defaults);
this.set(attrs, {silent: true});
this._currentAttributes = _.clone(this.attributes);
this._previousAttributes = _.clone(this.attributes);
this.initialize.apply(this, arguments);
};
// Attach all inheritable methods to the Model prototype.
_.extend(Model.prototype, Events, {
// A hash of attributes whose current and previous value differ.
changed: null,
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
// CouchDB users may want to set this to `"_id"`.
idAttribute: 'id',
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Return a copy of the model's `attributes` object.
toJSON: function(options) {
return _.clone(this.attributes);
},
// Proxy `Backbone.sync` by default.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Get the value of an attribute.
get: function(attr) {
return this.attributes[attr];
},
// Get the HTML-escaped value of an attribute.
escape: function(attr) {
return _.escape(this.get(attr));
},
// Returns `true` if the attribute contains a value that is not null
// or undefined.
has: function(attr) {
return this.get(attr) != null;
},
// Set a hash of model attributes on the object, firing `"change"` unless
// you choose to silence it.
set: function(key, val, options) {
var attr, attrs;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (_.isObject(key)) {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
// Extract attributes and options.
var silent = options && options.silent;
var unset = options && options.unset;
// Run validation.
if (!this._validate(attrs, options)) return false;
// Check for changes of `id`.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
var now = this.attributes;
// For each `set` attribute...
for (attr in attrs) {
val = attrs[attr];
// Update or delete the current value, and track the change.
unset ? delete now[attr] : now[attr] = val;
this._changes.push(attr, val);
}
// Signal that the model's state has potentially changed, and we need
// to recompute the actual changes.
this._hasComputed = false;
// Fire the `"change"` events.
if (!silent) this.change(options);
return this;
},
// Remove an attribute from the model, firing `"change"` unless you choose
// to silence it. `unset` is a noop if the attribute doesn't exist.
unset: function(attr, options) {
return this.set(attr, void 0, _.extend({}, options, {unset: true}));
},
// Clear all attributes on the model, firing `"change"` unless you choose
// to silence it.
clear: function(options) {
var attrs = {};
for (var key in this.attributes) attrs[key] = void 0;
return this.set(attrs, _.extend({}, options, {unset: true}));
},
// Fetch the model from the server. If the server's representation of the
// model differs from its current attributes, they will be overriden,
// triggering a `"change"` event.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success;
options.success = function(resp, status, xhr) {
if (!model.set(model.parse(resp), options)) return false;
if (success) success(model, resp, options);
};
return this.sync('read', this, options);
},
// Set a hash of model attributes, and sync the model to the server.
// If the server returns an attributes hash that differs, the model's
// state will be `set` again.
save: function(key, val, options) {
var attrs, current, done;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || _.isObject(key)) {
attrs = key;
options = val;
} else if (key != null) {
(attrs = {})[key] = val;
}
options = options ? _.clone(options) : {};
// If we're "wait"-ing to set changed attributes, validate early.
if (options.wait) {
if (attrs && !this._validate(attrs, options)) return false;
current = _.clone(this.attributes);
}
// Regular saves `set` attributes before persisting to the server.
var silentOptions = _.extend({}, options, {silent: true});
if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
return false;
}
// Do not persist invalid models.
if (!attrs && !this._validate(null, options)) return false;
// After a successful server-side save, the client is (optionally)
// updated with the server-side state.
var model = this;
var success = options.success;
options.success = function(resp, status, xhr) {
done = true;
var serverAttrs = model.parse(resp);
if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
if (!model.set(serverAttrs, options)) return false;
if (success) success(model, resp, options);
};
// Finish configuring and sending the Ajax request.
var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
if (method == 'patch') options.attrs = attrs;
var xhr = this.sync(method, this, options);
// When using `wait`, reset attributes to original values unless
// `success` has been called already.
if (!done && options.wait) {
this.clear(silentOptions);
this.set(current, silentOptions);
}
return xhr;
},
// Destroy this model on the server if it was already persisted.
// Optimistically removes the model from its collection, if it has one.
// If `wait: true` is passed, waits for the server to respond before removal.
destroy: function(options) {
options = options ? _.clone(options) : {};
var model = this;
var success = options.success;
var destroy = function() {
model.trigger('destroy', model, model.collection, options);
};
options.success = function(resp) {
if (options.wait || model.isNew()) destroy();
if (success) success(model, resp, options);
};
if (this.isNew()) {
options.success();
return false;
}
var xhr = this.sync('delete', this, options);
if (!options.wait) destroy();
return xhr;
},
// Default URL for the model's representation on the server -- if you're
// using Backbone's restful methods, override this to change the endpoint
// that will be called.
url: function() {
var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
},
// **parse** converts a response into the hash of attributes to be `set` on
// the model. The default implementation is just to pass the response along.
parse: function(resp) {
return resp;
},
// Create a new model with identical attributes to this one.
clone: function() {
return new this.constructor(this.attributes);
},
// A model is new if it has never been saved to the server, and lacks an id.
isNew: function() {
return this.id == null;
},
// Call this method to manually fire a `"change"` event for this model and
// a `"change:attribute"` event for each changed attribute.
// Calling this will cause all objects observing the model to update.
change: function(options) {
var changing = this._changing;
this._changing = true;
// Generate the changes to be triggered on the model.
var triggers = this._computeChanges(true);
this._pending = !!triggers.length;
for (var i = triggers.length - 2; i >= 0; i -= 2) {
this.trigger('change:' + triggers[i], this, triggers[i + 1], options);
}
if (changing) return this;
// Trigger a `change` while there have been changes.
while (this._pending) {
this._pending = false;
this.trigger('change', this, options);
this._previousAttributes = _.clone(this.attributes);
}
this._changing = false;
return this;
},
// Determine if the model has changed since the last `"change"` event.
// If you specify an attribute name, determine if that attribute has changed.
hasChanged: function(attr) {
if (!this._hasComputed) this._computeChanges();
if (attr == null) return !_.isEmpty(this.changed);
return _.has(this.changed, attr);
},
// Return an object containing all the attributes that have changed, or
// false if there are no changed attributes. Useful for determining what
// parts of a view need to be updated and/or what attributes need to be
// persisted to the server. Unset attributes will be set to undefined.
// You can also pass an attributes object to diff against the model,
// determining if there *would be* a change.
changedAttributes: function(diff) {
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
var val, changed = false, old = this._previousAttributes;
for (var attr in diff) {
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
(changed || (changed = {}))[attr] = val;
}
return changed;
},
// Looking at the built up list of `set` attribute changes, compute how
// many of the attributes have actually changed. If `loud`, return a
// boiled-down list of only the real changes.
_computeChanges: function(loud) {
this.changed = {};
var already = {};
var triggers = [];
// WARN: monkey patch for 0.9.9, will go away when upgrading
// to future version of backbone
var current = this._currentAttributes || {};
var changes = this._changes;
// Loop through the current queue of potential model changes.
for (var i = changes.length - 2; i >= 0; i -= 2) {
var key = changes[i], val = changes[i + 1];
if (already[key]) continue;
already[key] = true;
// Check if the attribute has been modified since the last change,
// and update `this.changed` accordingly. If we're inside of a `change`
// call, also add a trigger to the list.
if (current[key] !== val) {
this.changed[key] = val;
if (!loud) continue;
triggers.push(key, val);
current[key] = val;
}
}
if (loud) this._changes = [];
// Signals `this.changed` is current to prevent duplicate calls from `this.hasChanged`.
this._hasComputed = true;
return triggers;
},
// Get the previous value of an attribute, recorded at the time the last
// `"change"` event was fired.
previous: function(attr) {
if (attr == null || !this._previousAttributes) return null;
return this._previousAttributes[attr];
},
// Get all of the attributes of the model at the time of the previous
// `"change"` event.
previousAttributes: function() {
return _.clone(this._previousAttributes);
},
// Run validation against the next complete set of model attributes,
// returning `true` if all is well. If a specific `error` callback has
// been passed, call that instead of firing the general `"error"` event.
_validate: function(attrs, options) {
if (!this.validate) return true;
attrs = _.extend({}, this.attributes, attrs);
var error = this.validate(attrs, options);
if (!error) return true;
if (options && options.error) options.error(this, error, options);
this.trigger('error', this, error, options);
return false;
}
});
// Backbone.Collection
// -------------------
// Provides a standard collection class for our sets of models, ordered
// or unordered. If a `comparator` is specified, the Collection will maintain
// its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
this.initialize.apply(this, arguments);
if (models) this.reset(models, _.extend({silent: true}, options));
};
// Define the Collection's inheritable methods.
_.extend(Collection.prototype, Events, {
// The default model for a collection is just a **Backbone.Model**.
// This should be overridden in most cases.
model: Model,
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// The JSON representation of a Collection is an array of the
// models' attributes.
toJSON: function(options) {
return this.map(function(model){ return model.toJSON(options); });
},
// Proxy `Backbone.sync` by default.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Add a model, or list of models to the set. Pass **silent** to avoid
// firing the `add` event for every new model.
add: function(models, options) {
var i, args, length, model, existing, needsSort;
var at = options && options.at;
var sort = ((options && options.sort) == null ? true : options.sort);
models = _.isArray(models) ? models.slice() : [models];
// Turn bare objects into model references, and prevent invalid models
// from being added.
for (i = models.length - 1; i >= 0; i--) {
if(!(model = this._prepareModel(models[i], options))) {
this.trigger("error", this, models[i], options);
models.splice(i, 1);
continue;
}
models[i] = model;
existing = model.id != null && this._byId[model.id];
// If a duplicate is found, prevent it from being added and
// optionally merge it into the existing model.
if (existing || this._byCid[model.cid]) {
if (options && options.merge && existing) {
existing.set(model.attributes, options);
needsSort = sort;
}
models.splice(i, 1);
continue;
}
// Listen to added models' events, and index models for lookup by
// `id` and by `cid`.
model.on('all', this._onModelEvent, this);
this._byCid[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
// See if sorting is needed, update `length` and splice in new models.
if (models.length) needsSort = sort;
this.length += models.length;
args = [at != null ? at : this.models.length, 0];
push.apply(args, models);
splice.apply(this.models, args);
// Sort the collection if appropriate.
if (needsSort && this.comparator && at == null) this.sort({silent: true});
if (options && options.silent) return this;
// Trigger `add` events.
while (model = models.shift()) {
model.trigger('add', model, this, options);
}
return this;
},
// Remove a model, or a list of models from the set. Pass silent to avoid
// firing the `remove` event for every model removed.
remove: function(models, options) {
var i, l, index, model;
options || (options = {});
models = _.isArray(models) ? models.slice() : [models];
for (i = 0, l = models.length; i < l; i++) {
model = this.get(models[i]);
if (!model) continue;
delete this._byId[model.id];
delete this._byCid[model.cid];
index = this.indexOf(model);
this.models.splice(index, 1);
this.length--;
if (!options.silent) {
options.index = index;
model.trigger('remove', model, this, options);
}
this._removeReference(model);
}
return this;
},
// Add a model to the end of the collection.
push: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: this.length}, options));
return model;
},
// Remove a model from the end of the collection.
pop: function(options) {
var model = this.at(this.length - 1);
this.remove(model, options);
return model;
},
// Add a model to the beginning of the collection.
unshift: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: 0}, options));
return model;
},
// Remove a model from the beginning of the collection.
shift: function(options) {
var model = this.at(0);
this.remove(model, options);
return model;
},
// Slice out a sub-array of models from the collection.
slice: function(begin, end) {
return this.models.slice(begin, end);
},
// Get a model from the set by id.
get: function(obj) {
if (obj == null) return void 0;
return this._byId[obj.id != null ? obj.id : obj] || this._byCid[obj.cid || obj];
},
// Get the model at the given index.
at: function(index) {
return this.models[index];
},
// Return models with matching attributes. Useful for simple cases of `filter`.
where: function(attrs) {
if (_.isEmpty(attrs)) return [];
return this.filter(function(model) {
for (var key in attrs) {
if (attrs[key] !== model.get(key)) return false;
}
return true;
});
},
// Force the collection to re-sort itself. You don't need to call this under
// normal circumstances, as the set will maintain sort order as each item
// is added.
sort: function(options) {
if (!this.comparator) {
throw new Error('Cannot sort a set without a comparator');
}
if (_.isString(this.comparator) || this.comparator.length === 1) {
this.models = this.sortBy(this.comparator, this);
} else {
this.models.sort(_.bind(this.comparator, this));
}
if (!options || !options.silent) this.trigger('sort', this, options);
return this;
},
// Pluck an attribute from each model in the collection.
pluck: function(attr) {
return _.invoke(this.models, 'get', attr);
},
// Smartly update a collection with a change set of models, adding,
// removing, and merging as necessary.
update: function(models, options) {
var model, i, l, existing;
var add = [], remove = [], modelMap = {};
var idAttr = this.model.prototype.idAttribute;
options = _.extend({add: true, merge: true, remove: true}, options);
if (options.parse) models = this.parse(models);
// Allow a single model (or no argument) to be passed.
if (!_.isArray(models)) models = models ? [models] : [];
// Proxy to `add` for this case, no need to iterate...
if (options.add && !options.remove) return this.add(models, options);
// Determine which models to add and merge, and which to remove.
for (i = 0, l = models.length; i < l; i++) {
model = models[i];
existing = this.get(model.id || model.cid || model[idAttr]);
if (options.remove && existing) modelMap[existing.cid] = true;
if ((options.add && !existing) || (options.merge && existing)) {
add.push(model);
}
}
if (options.remove) {
for (i = 0, l = this.models.length; i < l; i++) {
model = this.models[i];
if (!modelMap[model.cid]) remove.push(model);
}
}
// Remove models (if applicable) before we add and merge the rest.
if (remove.length) this.remove(remove, options);
if (add.length) this.add(add, options);
return this;
},
// When you have more items than you want to add or remove individually,
// you can reset the entire set with a new list of models, without firing
// any `add` or `remove` events. Fires `reset` when finished.
reset: function(models, options) {
options || (options = {});
if (options.parse) models = this.parse(models);
for (var i = 0, l = this.models.length; i < l; i++) {
this._removeReference(this.models[i]);
}
options.previousModels = this.models;
this._reset();
if (models) this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
return this;
},
// Fetch the default set of models for this collection, resetting the
// collection when they arrive. If `add: true` is passed, appends the
// models to the collection instead of resetting.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var collection = this;
var success = options.success;
options.success = function(resp, status, xhr) {
var method = options.update ? 'update' : 'reset';
collection[method](resp, options);
if (success) success(collection, resp, options);
};
return this.sync('read', this, options);
},
// Create a new instance of a model in this collection. Add the model to the
// collection immediately, unless `wait: true` is passed, in which case we
// wait for the server to agree.
create: function(model, options) {
var collection = this;
options = options ? _.clone(options) : {};
model = this._prepareModel(model, options);
if (!model) return false;
if (!options.wait) collection.add(model, options);
var success = options.success;
options.success = function(model, resp, options) {
if (options.wait) collection.add(model, options);
if (success) success(model, resp, options);
};
model.save(null, options);
return model;
},
// **parse** converts a response into a list of models to be added to the
// collection. The default implementation is just to pass it through.
parse: function(resp) {
return resp;
},
// Create a new collection with an identical list of models as this one.
clone: function() {
return new this.constructor(this.models);
},
// Proxy to _'s chain. Can't be proxied the same way the rest of the
// underscore methods are proxied because it relies on the underscore
// constructor.
chain: function() {
return _(this.models).chain();
},
// Reset all internal state. Called when the collection is reset.
_reset: function() {
this.length = 0;
this.models = [];
this._byId = {};
this._byCid = {};
},
// Prepare a model or hash of attributes to be added to this collection.
_prepareModel: function(attrs, options) {
if (attrs instanceof Model) {
if (!attrs.collection) attrs.collection = this;
return attrs;
}
options || (options = {});
options.collection = this;
var model = new this.model(attrs, options);
if (!model._validate(attrs, options)) return false;
return model;
},
// Internal method to remove a model's ties to a collection.
_removeReference: function(model) {
if (this === model.collection) delete model.collection;
model.off('all', this._onModelEvent, this);
},
// Internal method called every time a model in the set fires an event.
// Sets need to update their indexes when models change ids. All other
// events simply proxy through. "add" and "remove" events that originate
// in other collections are ignored.
_onModelEvent: function(event, model, collection, options) {
if ((event === 'add' || event === 'remove') && collection !== this) return;
if (event === 'destroy') this.remove(model, options);
if (model && event === 'change:' + model.idAttribute) {
delete this._byId[model.previous(model.idAttribute)];
if (model.id != null) this._byId[model.id] = model;
}
this.trigger.apply(this, arguments);
}
});
// Underscore methods that we want to implement on the Collection.
var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'sortedIndex', 'toArray', 'size', 'first', 'head', 'take',
'initial', 'rest', 'tail', 'last', 'without', 'indexOf', 'shuffle',
'lastIndexOf', 'isEmpty'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
Collection.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.models);
return _[method].apply(_, args);
};
});
// Underscore methods that take a property name as an argument.
var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
// Use attributes instead of properties.
_.each(attributeMethods, function(method) {
Collection.prototype[method] = function(value, context) {
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);
};
return _[method](this.models, iterator, context);
};
});
// Backbone.Router
// ---------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = Backbone.Router = function(options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this.initialize.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var optionalParam = /\((.*?)\)/g;
var namedParam = /:\w+/g;
var splatParam = /\*\w+/g;
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **Backbone.Router** properties and methods.
_.extend(Router.prototype, Events, {
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route: function(route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (!callback) callback = this[name];
Backbone.history.route(route, _.bind(function(fragment) {
var args = this._extractParameters(route, fragment);
callback && callback.apply(this, args);
this.trigger.apply(this, ['route:' + name].concat(args));
Backbone.history.trigger('route', this, name, args);
}, this));
return this;
},
// Simple proxy to `Backbone.history` to save a fragment into the history.
navigate: function(fragment, options) {
Backbone.history.navigate(fragment, options);
return this;
},
// Bind all defined routes to `Backbone.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function() {
if (!this.routes) return;
var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
.replace(namedParam, '([^\/]+)')
.replace(splatParam, '(.*?)');
return new RegExp('^' + route + '$');
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted parameters.
_extractParameters: function(route, fragment) {
return route.exec(fragment).slice(1);
}
});
// Backbone.History
// ----------------
// Handles cross-browser history management, based on URL fragments. If the
// browser does not support `onhashchange`, falls back to polling.
var History = Backbone.History = function() {
this.handlers = [];
_.bindAll(this, 'checkUrl');
// Ensure that `History` can be used outside of the browser.
if (typeof window !== 'undefined') {
this.location = window.location;
this.history = window.history;
}
};
// Cached regex for stripping a leading hash/slash and trailing space.
var routeStripper = /^[#\/]|\s+$/g;
// Cached regex for stripping leading and trailing slashes.
var rootStripper = /^\/+|\/+$/g;
// Cached regex for detecting MSIE.
var isExplorer = /msie [\w.]+/;
// Cached regex for removing a trailing slash.
var trailingSlash = /\/$/;
// Has the history handling already been started?
History.started = false;
// Set up all inheritable **Backbone.History** properties and methods.
_.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded.
getHash: function(window) {
var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : '';
},
// Get the cross-browser normalized URL fragment, either from the URL,
// the hash, or the override.
getFragment: function(fragment, forcePushState) {
if (fragment == null) {
if (this._hasPushState || !this._wantsHashChange || forcePushState) {
fragment = this.location.pathname;
var root = this.root.replace(trailingSlash, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
} else {
fragment = this.getHash();
}
}
return fragment.replace(routeStripper, '');
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({}, {root: '/'}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
var fragment = this.getFragment();
var docMode = document.documentMode;
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
// Normalize root to always include a leading and trailing slash.
this.root = ('/' + this.root + '/').replace(rootStripper, '/');
if (oldIE && this._wantsHashChange) {
this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
this.navigate(fragment);
}
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
Backbone.$(window).bind('popstate', this.checkUrl);
} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
Backbone.$(window).bind('hashchange', this.checkUrl);
} else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
}
// Determine if we need to change the base url, for a pushState link
// opened by a non-pushState browser.
this.fragment = fragment;
var loc = this.location;
var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
// If we've started off with a route from a `pushState`-enabled browser,
// but we're currently in a browser that doesn't support it...
if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
this.location.replace(this.root + this.location.search + '#' + this.fragment);
// Return immediately as browser will do redirect to new url
return true;
// Or if we've started out with a hash-based route, but we're currently
// in a browser where it could be `pushState`-based instead...
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = this.getHash().replace(routeStripper, '');
this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
}
if (!this.options.silent) return this.loadUrl();
},
// Disable Backbone.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function() {
Backbone.$(window).unbind('popstate', this.checkUrl).unbind('hashchange', this.checkUrl);
clearInterval(this._checkUrlInterval);
History.started = false;
},
// Add a route to be tested when the fragment changes. Routes added later
// may override previous routes.
route: function(route, callback) {
this.handlers.unshift({route: route, callback: callback});
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl: function(e) {
var current = this.getFragment();
if (current === this.fragment && this.iframe) {
current = this.getFragment(this.getHash(this.iframe));
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
this.loadUrl() || this.loadUrl(this.getHash());
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl: function(fragmentOverride) {
var fragment = this.fragment = this.getFragment(fragmentOverride);
var matched = _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
return matched;
},
// Save a fragment into the hash history, or replace the URL state if the
// 'replace' option is passed. You are responsible for properly URL-encoding
// the fragment in advance.
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!History.started) return false;
if (!options || options === true) options = {trigger: options};
fragment = this.getFragment(fragment || '');
if (this.fragment === fragment) return;
this.fragment = fragment;
var url = this.root + fragment;
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash
// fragment to store history.
} else if (this._wantsHashChange) {
this._updateHash(this.location, fragment, options.replace);
if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
// Opening and closing the iframe tricks IE7 and earlier to push a
// history entry on hash-tag change. When replace is true, we don't
// want this.
if(!options.replace) this.iframe.document.open().close();
this._updateHash(this.iframe.location, fragment, options.replace);
}
// If you've told us that you explicitly don't want fallback hashchange-
// based history, then `navigate` becomes a page refresh.
} else {
return this.location.assign(url);
}
if (options.trigger) this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
// a new one to the browser history.
_updateHash: function(location, fragment, replace) {
if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, '');
location.replace(href + '#' + fragment);
} else {
// Some browsers require that `hash` contains a leading #.
location.hash = '#' + fragment;
}
}
});
// Create the default Backbone.history.
Backbone.history = new History;
// Backbone.View
// -------------
// Creating a Backbone.View creates its initial element outside of the DOM,
// if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
this._configure(options || {});
this._ensureElement();
this.initialize.apply(this, arguments);
this.delegateEvents();
};
// Cached regex to split keys for `delegate`.
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
// List of view options to be merged as properties.
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
// Set up all inheritable **Backbone.View** properties and methods.
_.extend(View.prototype, Events, {
// The default `tagName` of a View's element is `"div"`.
tagName: 'div',
// jQuery delegate for element lookup, scoped to DOM elements within the
// current view. This should be prefered to global lookups where possible.
$: function(selector) {
return this.$el.find(selector);
},
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// **render** is the core function that your view should override, in order
// to populate its element (`this.el`), with the appropriate HTML. The
// convention is for **render** to always return `this`.
render: function() {
return this;
},
// Remove this view by taking the element out of the DOM, and removing any
// applicable Backbone.Events listeners.
remove: function() {
this.$el.remove();
this.stopListening();
return this;
},
// For small amounts of DOM Elements, where a full-blown template isn't
// needed, use **make** to manufacture elements, one at a time.
//
// var el = this.make('li', {'class': 'row'}, this.model.escape('title'));
//
make: function(tagName, attributes, content) {
var el = document.createElement(tagName);
if (attributes) Backbone.$(el).attr(attributes);
if (content != null) Backbone.$(el).html(content);
return el;
},
// Change the view's element (`this.el` property), including event
// re-delegation.
setElement: function(element, delegate) {
if (this.$el) this.undelegateEvents();
this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
this.el = this.$el[0];
if (delegate !== false) this.delegateEvents();
return this;
},
// Set callbacks, where `this.events` is a hash of
//
// *{"event selector": "callback"}*
//
// {
// 'mousedown .title': 'edit',
// 'click .button': 'save'
// 'click .open': function(e) { ... }
// }
//
// pairs. Callbacks will be bound to the view, with `this` set properly.
// Uses event delegation for efficiency.
// Omitting the selector binds the event to `this.el`.
// This only works for delegate-able events: not `focus`, `blur`, and
// not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents: function(events) {
if (!(events || (events = _.result(this, 'events')))) return;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
if (!_.isFunction(method)) method = this[events[key]];
if (!method) throw new Error('Method "' + events[key] + '" does not exist');
var match = key.match(delegateEventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
this.$el.bind(eventName, method);
} else {
this.$el.delegate(selector, eventName, method);
}
}
},
// Clears all callbacks previously bound to the view with `delegateEvents`.
// You usually don't need to use this, but may wish to if you have multiple
// Backbone views attached to the same DOM element.
undelegateEvents: function() {
this.$el.unbind('.delegateEvents' + this.cid);
},
// Performs the initial configuration of a View with a set of options.
// Keys with special meaning *(model, collection, id, className)*, are
// attached directly to the view.
_configure: function(options) {
if (this.options) options = _.extend({}, _.result(this, 'options'), options);
_.extend(this, _.pick(options, viewOptions));
this.options = options;
},
// Ensure that the View has a DOM element to render into.
// If `this.el` is a string, pass it through `$()`, take the first
// matching element, and re-assign it to `el`. Otherwise, create
// an element from the `id`, `className` and `tagName` properties.
_ensureElement: function() {
if (!this.el) {
var attrs = _.extend({}, _.result(this, 'attributes'));
if (this.id) attrs.id = _.result(this, 'id');
if (this.className) attrs['class'] = _.result(this, 'className');
this.setElement(this.make(_.result(this, 'tagName'), attrs), false);
} else {
this.setElement(_.result(this, 'el'), false);
}
}
});
// Backbone.sync
// -------------
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
'update': 'PUT',
'patch': 'PATCH',
'delete': 'DELETE',
'read': 'GET'
};
// Override this function to change the manner in which Backbone persists
// models to the server. You will be passed the type of request, and the
// model in question. By default, makes a RESTful Ajax request
// to the model's `url()`. Some possible customizations could be:
//
// * Use `setTimeout` to batch rapid-fire updates into a single request.
// * Send up the models as XML instead of JSON.
// * Persist models via WebSockets instead of Ajax.
//
// Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
// as `POST`, with a `_method` parameter containing the true HTTP method,
// as well as all requests with the body as `application/x-www-form-urlencoded`
// instead of `application/json` with the model in a param named `model`.
// Useful when interfacing with server-side languages like **PHP** that make
// it difficult to read the body of `PUT` requests.
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
_.defaults(options || (options = {}), {
emulateHTTP: Backbone.emulateHTTP,
emulateJSON: Backbone.emulateJSON
});
// Default JSON-request options.
var params = {type: type, dataType: 'json'};
// Ensure that we have a URL.
if (!options.url) {
params.url = _.result(model, 'url') || urlError();
}
// Ensure that we have the appropriate request data.
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
params.contentType = 'application/json';
params.data = JSON.stringify(options.attrs || model.toJSON(options));
}
// For older servers, emulate JSON by encoding the request into an HTML-form.
if (options.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.data = params.data ? {model: params.data} : {};
}
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
// And an `X-HTTP-Method-Override` header.
if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
params.type = 'POST';
if (options.emulateJSON) params.data._method = type;
var beforeSend = options.beforeSend;
options.beforeSend = function(xhr) {
xhr.setRequestHeader('X-HTTP-Method-Override', type);
if (beforeSend) return beforeSend.apply(this, arguments);
};
}
// Don't process data on a non-GET request.
if (params.type !== 'GET' && !options.emulateJSON) {
params.processData = false;
}
var success = options.success;
options.success = function(resp, status, xhr) {
if (success) success(resp, status, xhr);
model.trigger('sync', model, resp, options);
};
var error = options.error;
options.error = function(xhr, status, thrown) {
if (error) error(model, xhr, options);
model.trigger('error', model, xhr, options);
};
// Make the request, allowing the user to override any Ajax options.
var xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
return xhr;
};
// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
Backbone.ajax = function() {
return Backbone.$.ajax.apply(Backbone.$, arguments);
};
// Helpers
// -------
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
var extend = function(protoProps, staticProps) {
var parent = this;
var child;
// The constructor function for the new subclass is either defined by you
// (the "constructor" property in your `extend` definition), or defaulted
// by us to simply call the parent's constructor.
if (protoProps && _.has(protoProps, 'constructor')) {
child = protoProps.constructor;
} else {
child = function(){ parent.apply(this, arguments); };
}
// Add static properties to the constructor function, if supplied.
_.extend(child, parent, staticProps);
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
var Surrogate = function(){ this.constructor = child; };
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate;
// Add prototype properties (instance properties) to the subclass,
// if supplied.
if (protoProps) _.extend(child.prototype, protoProps);
// Set a convenience property in case the parent's prototype is needed
// later.
child.__super__ = parent.prototype;
return child;
};
// Set up inheritance for the model, collection, router, view and history.
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
// Throw an error when a URL is needed, and none is supplied.
var urlError = function() {
throw new Error('A "url" property or function must be specified');
};
}).call(this);
/*
Copyright (c) 2011-2013 @WalmartLabs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
;;
(function() {
/*global cloneInheritVars, createInheritVars, createRegistryWrapper, getValue, inheritVars */
//support zepto.forEach on jQuery
if (!$.fn.forEach) {
$.fn.forEach = function(iterator, context) {
$.fn.each.call(this, function(index) {
iterator.call(context || this, this, index);
});
};
}
var viewNameAttributeName = 'data-view-name',
viewCidAttributeName = 'data-view-cid',
viewHelperAttributeName = 'data-view-helper';
//view instances
var viewsIndexedByCid = {};
if (!Handlebars.templates) {
Handlebars.templates = {};
}
var Thorax = this.Thorax = {
VERSION: '2.0.0rc4',
templatePathPrefix: '',
//view classes
Views: {},
//certain error prone pieces of code (on Android only it seems)
//are wrapped in a try catch block, then trigger this handler in
//the catch, with the name of the function or event that was
//trying to be executed. Override this with a custom handler
//to debug / log / etc
onException: function(name, err) {
throw err;
},
//deprecated, here to ensure existing projects aren't mucked with
templates: Handlebars.templates
};
Thorax.View = Backbone.View.extend({
constructor: function() {
var response = Backbone.View.apply(this, arguments);
_.each(inheritVars, function(obj) {
if (obj.ctor) {
obj.ctor.call(this, response);
}
}, this);
return response;
},
_configure: function(options) {
var self = this;
this._objectOptionsByCid = {};
this._boundDataObjectsByCid = {};
// Setup object event tracking
_.each(inheritVars, function(obj) {
self[obj.name] = [];
});
viewsIndexedByCid[this.cid] = this;
this.children = {};
this._renderCount = 0;
//this.options is removed in Thorax.View, we merge passed
//properties directly with the view and template context
_.extend(this, options || {});
// Setup helpers
bindHelpers.call(this);
_.each(inheritVars, function(obj) {
if (obj.configure) {
obj.configure.call(this);
}
}, this);
},
setElement : function() {
var response = Backbone.View.prototype.setElement.apply(this, arguments);
this.name && this.$el.attr(viewNameAttributeName, this.name);
this.$el.attr(viewCidAttributeName, this.cid);
return response;
},
_addChild: function(view) {
this.children[view.cid] = view;
if (!view.parent) {
view.parent = this;
}
this.trigger('child', view);
return view;
},
_removeChild: function(view) {
delete this.children[view.cid];
view.parent = null;
return view;
},
destroy: function(options) {
options = _.defaults(options || {}, {
children: true
});
_.each(this._boundDataObjectsByCid, this.unbindDataObject, this);
this.trigger('destroyed');
delete viewsIndexedByCid[this.cid];
_.each(this.children, function(child) {
this._removeChild(child);
if (options.children) {
child.destroy();
}
}, this);
if (this.parent) {
this.parent._removeChild(this);
}
if (this.el) {
this.undelegateEvents();
this.remove(); // Will call stopListening()
}
// Absolute worst case scenario, kill off some known fields to minimize the impact
// of being retained.
this.el = this.$el = undefined;
this.parent = undefined;
this.model = this.collection = this._collection = undefined;
this._helperOptions = undefined;
},
render: function(output) {
if (this._rendering) {
// Nested rendering of the same view instances can lead to some very nasty issues with
// the root render process overwriting any updated data that may have been output in the child
// execution. If in a situation where you need to rerender in response to an event that is
// triggered sync in the rendering lifecycle it's recommended to defer the subsequent render
// or refactor so that all preconditions are known prior to exec.
throw new Error('nested-render');
}
this._previousHelpers = _.filter(this.children, function(child) { return child._helperOptions; });
var children = {};
_.each(this.children, function(child, key) {
if (!child._helperOptions) {
children[key] = child;
}
});
this.children = children;
this._rendering = true;
try{
if (_.isUndefined(output) || (!_.isElement(output) && !Thorax.Util.is$(output) && !(output && output.el) && !_.isString(output) && !_.isFunction(output))) {
// try one more time to assign the template, if we don't
// yet have one we must raise
assignTemplate.call(this, 'template', {
required: true
});
output = this.renderTemplate(this.template);
} else if (_.isFunction(output)) {
output = this.renderTemplate(output);
}
} finally {
this._rendering = false;
}
// Destroy any helpers that may be lingering
_.each(this._previousHelpers, function(child) {
child.destroy();
child.parent = undefined;
});
this._previousHelpers = undefined;
//accept a view, string, Handlebars.SafeString or DOM element
this.html((output && output.el) || (output && output.string) || output);
++this._renderCount;
this.trigger('rendered');
return output;
},
context: function() {
return _.extend({}, (this.model && this.model.attributes) || {});
},
_getContext: function() {
return _.extend({}, this, getValue(this, 'context') || {});
},
// Private variables in handlebars / options.data in template helpers
_getData: function(data) {
return {
view: this,
cid: _.uniqueId('t'),
yield: function() {
// fn is seeded by template helper passing context to data
return data.fn && data.fn(data);
}
};
},
_getHelpers: function() {
if (this.helpers) {
return _.extend({}, Handlebars.helpers, this.helpers);
} else {
return Handlebars.helpers;
}
},
renderTemplate: function(file, context, ignoreErrors) {
var template;
context = context || this._getContext();
if (_.isFunction(file)) {
template = file;
} else {
template = Thorax.Util.getTemplate(file, ignoreErrors);
}
if (!template) {
return '';
} else {
return template(context, {
helpers: this._getHelpers(),
data: this._getData(context)
});
}
},
ensureRendered: function() {
!this._renderCount && this.render();
},
shouldRender: function(flag) {
// Render if flag is truthy or if we have already rendered and flag is undefined/null
return flag || (flag == null && this._renderCount);
},
conditionalRender: function(flag) {
if (this.shouldRender(flag)) {
this.render();
}
},
appendTo: function(el) {
this.ensureRendered();
$(el).append(this.el);
this.trigger('ready', {target: this});
},
html: function(html) {
if (_.isUndefined(html)) {
return this.el.innerHTML;
} else {
// Event for IE element fixes
this.trigger('before:append');
var element = this._replaceHTML(html);
this.trigger('append');
return element;
}
},
_replaceHTML: function(html) {
this.el.innerHTML = "";
return this.$el.append(html);
},
_anchorClick: function(event) {
var target = $(event.currentTarget),
href = target.attr('href');
// Route anything that starts with # or / (excluding //domain urls)
if (href && (href[0] === '#' || (href[0] === '/' && href[1] !== '/'))) {
Backbone.history.navigate(href, {
trigger: true
});
return false;
}
return true;
}
});
Thorax.View.extend = function() {
createInheritVars(this);
var child = Backbone.View.extend.apply(this, arguments);
child.__parent__ = this;
resetInheritVars(child);
return child;
};
createRegistryWrapper(Thorax.View, Thorax.Views);
function bindHelpers() {
if (this.helpers) {
_.each(this.helpers, function(helper, name) {
var view = this;
this.helpers[name] = function() {
var args = _.toArray(arguments),
options = _.last(args);
options.context = this;
return helper.apply(view, args);
};
}, this);
}
}
//$(selector).view() helper
$.fn.view = function(options) {
options = _.defaults(options || {}, {
helper: true
});
var selector = '[' + viewCidAttributeName + ']';
if (!options.helper) {
selector += ':not([' + viewHelperAttributeName + '])';
}
var el = $(this).closest(selector);
return (el && viewsIndexedByCid[el.attr(viewCidAttributeName)]) || false;
};
;;
/*global createRegistryWrapper:true, cloneEvents: true */
function createRegistryWrapper(klass, hash) {
var $super = klass.extend;
klass.extend = function() {
var child = $super.apply(this, arguments);
if (child.prototype.name) {
hash[child.prototype.name] = child;
}
return child;
};
}
function registryGet(object, type, name, ignoreErrors) {
var target = object[type],
value;
if (_.indexOf(name, '.') >= 0) {
var bits = name.split(/\./);
name = bits.pop();
_.each(bits, function(key) {
target = target[key];
});
}
target && (value = target[name]);
if (!value && !ignoreErrors) {
throw new Error(type + ': ' + name + ' does not exist.');
} else {
return value;
}
}
function assignTemplate(attributeName, options) {
var template;
// if attribute is the name of template to fetch
if (_.isString(this[attributeName])) {
template = Thorax.Util.getTemplate(this[attributeName], true);
// else try and fetch the template based on the name
} else if (this.name && !_.isFunction(this[attributeName])) {
template = Thorax.Util.getTemplate(this.name + (options.extension || ''), true);
}
// CollectionView and LayoutView have a defaultTemplate that may be used if none
// was found, regular views must have a template if render() is called
if (!template && attributeName === 'template' && this._defaultTemplate) {
template = this._defaultTemplate;
}
// if we found something, assign it
if (template && !_.isFunction(this[attributeName])) {
this[attributeName] = template;
}
// if nothing was found and it's required, throw
if (options.required && !_.isFunction(this[attributeName])) {
throw new Error('View ' + (this.name || this.cid) + ' requires: ' + attributeName);
}
}
// getValue is used instead of _.result because we
// need an extra scope parameter, and will minify
// better than _.result
function getValue(object, prop, scope) {
if (!(object && object[prop])) {
return null;
}
return _.isFunction(object[prop])
? object[prop].call(scope || object)
: object[prop];
}
var inheritVars = {};
function createInheritVars(self) {
// Ensure that we have our static event objects
_.each(inheritVars, function(obj) {
if (!self[obj.name]) {
self[obj.name] = [];
}
});
}
function resetInheritVars(self) {
// Ensure that we have our static event objects
_.each(inheritVars, function(obj) {
self[obj.name] = [];
});
}
function walkInheritTree(source, fieldName, isStatic, callback) {
var tree = [];
if (_.has(source, fieldName)) {
tree.push(source);
}
var iterate = source;
if (isStatic) {
while (iterate = iterate.__parent__) {
if (_.has(iterate, fieldName)) {
tree.push(iterate);
}
}
} else {
iterate = iterate.constructor;
while (iterate) {
if (iterate.prototype && _.has(iterate.prototype, fieldName)) {
tree.push(iterate.prototype);
}
iterate = iterate.__super__ && iterate.__super__.constructor;
}
}
var i = tree.length;
while (i--) {
_.each(getValue(tree[i], fieldName, source), callback);
}
}
function objectEvents(target, eventName, callback, context) {
if (_.isObject(callback)) {
var spec = inheritVars[eventName];
if (spec && spec.event) {
addEvents(target['_' + eventName + 'Events'], callback, context);
return true;
}
}
}
function addEvents(target, source, context) {
_.each(source, function(callback, eventName) {
if (_.isArray(callback)) {
_.each(callback, function(cb) {
target.push([eventName, cb, context]);
});
} else {
target.push([eventName, callback, context]);
}
});
}
function getOptionsData(options) {
if (!options || !options.data) {
throw new Error('Handlebars template compiled without data, use: Handlebars.compile(template, {data: true})');
}
return options.data;
}
// These whitelisted attributes will be the only ones passed
// from the options hash to Thorax.Util.tag
var htmlAttributesToCopy = ['id', 'className', 'tagName'];
// In helpers "tagName" or "tag" may be specified, as well
// as "class" or "className". Normalize to "tagName" and
// "className" to match the property names used by Backbone
// jQuery, etc. Special case for "className" in
// Thorax.Util.tag: will be rewritten as "class" in
// generated HTML.
function normalizeHTMLAttributeOptions(options) {
if (options.tag) {
options.tagName = options.tag;
delete options.tag;
}
if (options['class']) {
options.className = options['class'];
delete options['class'];
}
}
Thorax.Util = {
getViewInstance: function(name, attributes) {
attributes = attributes || {};
if (_.isString(name)) {
var Klass = registryGet(Thorax, 'Views', name, false);
return Klass.cid ? _.extend(Klass, attributes || {}) : new Klass(attributes);
} else if (_.isFunction(name)) {
return new name(attributes);
} else {
return name;
}
},
getTemplate: function(file, ignoreErrors) {
//append the template path prefix if it is missing
var pathPrefix = Thorax.templatePathPrefix,
template;
if (pathPrefix && file.substr(0, pathPrefix.length) !== pathPrefix) {
file = pathPrefix + file;
}
// Without extension
file = file.replace(/\.handlebars$/, '');
template = Handlebars.templates[file];
if (!template) {
// With extension
file = file + '.handlebars';
template = Handlebars.templates[file];
}
if (!template && !ignoreErrors) {
throw new Error('templates: ' + file + ' does not exist.');
}
return template;
},
//'selector' is not present in $('<p></p>')
//TODO: investigage a better detection method
is$: function(obj) {
return _.isObject(obj) && ('length' in obj);
},
expandToken: function(input, scope) {
if (input && input.indexOf && input.indexOf('{{') >= 0) {
var re = /(?:\{?[^{]+)|(?:\{\{([^}]+)\}\})/g,
match,
ret = [];
function deref(token, scope) {
if (token.match(/^("|')/) && token.match(/("|')$/)) {
return token.replace(/(^("|')|('|")$)/g, '');
}
var segments = token.split('.'),
len = segments.length;
for (var i = 0; scope && i < len; i++) {
if (segments[i] !== 'this') {
scope = scope[segments[i]];
}
}
return scope;
}
while (match = re.exec(input)) {
if (match[1]) {
var params = match[1].split(/\s+/);
if (params.length > 1) {
var helper = params.shift();
params = _.map(params, function(param) { return deref(param, scope); });
if (Handlebars.helpers[helper]) {
ret.push(Handlebars.helpers[helper].apply(scope, params));
} else {
// If the helper is not defined do nothing
ret.push(match[0]);
}
} else {
ret.push(deref(params[0], scope));
}
} else {
ret.push(match[0]);
}
}
input = ret.join('');
}
return input;
},
tag: function(attributes, content, scope) {
var htmlAttributes = _.omit(attributes, 'tagName'),
tag = attributes.tagName || 'div';
return '<' + tag + ' ' + _.map(htmlAttributes, function(value, key) {
if (_.isUndefined(value) || key === 'expand-tokens') {
return '';
}
var formattedValue = value;
if (scope) {
formattedValue = Thorax.Util.expandToken(value, scope);
}
return (key === 'className' ? 'class' : key) + '="' + Handlebars.Utils.escapeExpression(formattedValue) + '"';
}).join(' ') + '>' + (_.isUndefined(content) ? '' : content) + '</' + tag + '>';
}
};
;;
/*global createInheritVars, inheritVars */
Thorax.Mixins = {};
inheritVars.mixins = {
name: 'mixins',
configure: function() {
_.each(this.constructor.mixins, this.mixin, this);
_.each(this.mixins, this.mixin, this);
}
};
_.extend(Thorax.View, {
mixin: function(mixin) {
createInheritVars(this);
this.mixins.push(mixin);
},
registerMixin: function(name, callback, methods) {
Thorax.Mixins[name] = [callback, methods];
}
});
Thorax.View.prototype.mixin = function(name) {
if (!this._appliedMixins) {
this._appliedMixins = [];
}
if (_.indexOf(this._appliedMixins, name) === -1) {
this._appliedMixins.push(name);
if (_.isFunction(name)) {
name.call(this);
} else {
var mixin = Thorax.Mixins[name];
_.extend(this, mixin[1]);
//mixin callback may be an array of [callback, arguments]
if (_.isArray(mixin[0])) {
mixin[0][0].apply(this, mixin[0][1]);
} else {
mixin[0].apply(this, _.toArray(arguments).slice(1));
}
}
}
};
;;
/*global createInheritVars, inheritVars, objectEvents, walkInheritTree */
// Save a copy of the _on method to call as a $super method
var _on = Thorax.View.prototype.on;
inheritVars.event = {
name: '_events',
configure: function() {
var self = this;
walkInheritTree(this.constructor, '_events', true, function(event) {
self.on.apply(self, event);
});
walkInheritTree(this, 'events', false, function(handler, eventName) {
self.on(eventName, handler, self);
});
}
};
_.extend(Thorax.View, {
on: function(eventName, callback) {
createInheritVars(this);
if (objectEvents(this, eventName, callback)) {
return this;
}
//accept on({"rendered": handler})
if (_.isObject(eventName)) {
_.each(eventName, function(value, key) {
this.on(key, value);
}, this);
} else {
//accept on({"rendered": [handler, handler]})
if (_.isArray(callback)) {
_.each(callback, function(cb) {
this._events.push([eventName, cb]);
}, this);
//accept on("rendered", handler)
} else {
this._events.push([eventName, callback]);
}
}
return this;
}
});
_.extend(Thorax.View.prototype, {
on: function(eventName, callback, context) {
if (objectEvents(this, eventName, callback, context)) {
return this;
}
if (_.isObject(eventName) && arguments.length < 3) {
//accept on({"rendered": callback})
_.each(eventName, function(value, key) {
this.on(key, value, callback || this); // callback is context in this form of the call
}, this);
} else {
//accept on("rendered", callback, context)
//accept on("click a", callback, context)
_.each((_.isArray(callback) ? callback : [callback]), function(callback) {
var params = eventParamsFromEventItem.call(this, eventName, callback, context || this);
if (params.type === 'DOM') {
//will call _addEvent during delegateEvents()
if (!this._eventsToDelegate) {
this._eventsToDelegate = [];
}
this._eventsToDelegate.push(params);
} else {
this._addEvent(params);
}
}, this);
}
return this;
},
delegateEvents: function(events) {
this.undelegateEvents();
if (events) {
if (_.isFunction(events)) {
events = events.call(this);
}
this._eventsToDelegate = [];
this.on(events);
}
this._eventsToDelegate && _.each(this._eventsToDelegate, this._addEvent, this);
},
//params may contain:
//- name
//- originalName
//- selector
//- type "view" || "DOM"
//- handler
_addEvent: function(params) {
if (params.type === 'view') {
_.each(params.name.split(/\s+/), function(name) {
// Must pass context here so stopListening will clean up our junk
_on.call(this, name, bindEventHandler.call(this, 'view-event:', params), params.context || this);
}, this);
} else {
var boundHandler = bindEventHandler.call(this, 'dom-event:', params);
if (!params.nested) {
boundHandler = containHandlerToCurentView(boundHandler, this.cid);
}
var name = params.name + '.delegateEvents' + this.cid;
if (params.selector) {
this.$el.on(name, params.selector, boundHandler);
} else {
this.$el.on(name, boundHandler);
}
}
}
});
// When view is ready trigger ready event on all
// children that are present, then register an
// event that will trigger ready on new children
// when they are added
Thorax.View.on('ready', function(options) {
if (!this._isReady) {
this._isReady = true;
function triggerReadyOnChild(child) {
child.trigger('ready', options);
}
_.each(this.children, triggerReadyOnChild);
this.on('child', triggerReadyOnChild);
}
});
var eventSplitter = /^(nested\s+)?(\S+)(?:\s+(.+))?/;
var domEvents = [],
domEventRegexp;
function pushDomEvents(events) {
domEvents.push.apply(domEvents, events);
domEventRegexp = new RegExp('^(nested\\s+)?(' + domEvents.join('|') + ')(?:\\s|$)');
}
pushDomEvents([
'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout',
'touchstart', 'touchend', 'touchmove',
'click', 'dblclick',
'keyup', 'keydown', 'keypress',
'submit', 'change',
'focus', 'blur'
]);
function containHandlerToCurentView(handler, cid) {
return function(event) {
var view = $(event.target).view({helper: false});
if (view && view.cid === cid) {
event.originalContext = this;
handler(event);
}
};
}
function bindEventHandler(eventName, params) {
eventName += params.originalName;
var callback = params.handler,
method = _.isFunction(callback) ? callback : this[callback];
if (!method) {
throw new Error('Event "' + callback + '" does not exist ' + (this.name || this.cid) + ':' + eventName);
}
var context = params.context || this;
function ret() {
try {
method.apply(context, arguments);
} catch (e) {
Thorax.onException('thorax-exception: ' + (context.name || context.cid) + ':' + eventName, e);
}
}
// Backbone will delegate to _callback in off calls so we should still be able to support
// calling off on specific handlers.
ret._callback = method;
return ret;
}
function eventParamsFromEventItem(name, handler, context) {
var params = {
originalName: name,
handler: _.isString(handler) ? this[handler] : handler
};
if (name.match(domEventRegexp)) {
var match = eventSplitter.exec(name);
params.nested = !!match[1];
params.name = match[2];
params.type = 'DOM';
params.selector = match[3];
} else {
params.name = name;
params.type = 'view';
}
params.context = context;
return params;
}
;;
/*global getOptionsData, htmlAttributesToCopy, normalizeHTMLAttributeOptions, viewHelperAttributeName */
var viewPlaceholderAttributeName = 'data-view-tmp',
viewTemplateOverrides = {};
// Will be shared by HelperView and CollectionHelperView
var helperViewPrototype = {
_ensureElement: function() {
Thorax.View.prototype._ensureElement.apply(this, arguments);
this.$el.attr(viewHelperAttributeName, this._helperName);
},
_getContext: function() {
return this.parent._getContext.apply(this.parent, arguments);
}
};
Thorax.HelperView = Thorax.View.extend(helperViewPrototype);
// Ensure nested inline helpers will always have this.parent
// set to the view containing the template
function getParent(parent) {
// The `view` helper is a special case as it embeds
// a view instead of creating a new one
while (parent._helperName && parent._helperName !== 'view') {
parent = parent.parent;
}
return parent;
}
Handlebars.registerViewHelper = function(name, ViewClass, callback) {
if (arguments.length === 2) {
if (ViewClass.factory) {
callback = ViewClass.callback;
} else {
callback = ViewClass;
ViewClass = Thorax.HelperView;
}
}
Handlebars.registerHelper(name, function() {
var args = _.toArray(arguments),
options = args.pop(),
declaringView = getOptionsData(options).view;
var viewOptions = {
template: options.fn || Handlebars.VM.noop,
inverse: options.inverse,
options: options.hash,
declaringView: declaringView,
parent: getParent(declaringView),
_helperName: name,
_helperOptions: {
options: cloneHelperOptions(options),
args: _.clone(args)
}
};
normalizeHTMLAttributeOptions(options.hash);
_.extend(viewOptions, _.pick(options.hash, htmlAttributesToCopy));
// Check to see if we have an existing instance that we can reuse
var instance = _.find(declaringView._previousHelpers, function(child) {
return compareHelperOptions(viewOptions, child);
});
// Create the instance if we don't already have one
if (!instance) {
if (ViewClass.factory) {
instance = ViewClass.factory(args, viewOptions);
if (!instance) {
return '';
}
instance._helperName = viewOptions._helperName;
instance._helperOptions = viewOptions._helperOptions;
} else {
instance = new ViewClass(viewOptions);
}
args.push(instance);
declaringView._addChild(instance);
declaringView.trigger.apply(declaringView, ['helper', name].concat(args));
declaringView.trigger.apply(declaringView, ['helper:' + name].concat(args));
callback && callback.apply(this, args);
} else {
declaringView._previousHelpers = _.without(declaringView._previousHelpers, instance);
declaringView.children[instance.cid] = instance;
}
var htmlAttributes = _.pick(options.hash, htmlAttributesToCopy);
htmlAttributes[viewPlaceholderAttributeName] = instance.cid;
var expandTokens = options.hash['expand-tokens'];
return new Handlebars.SafeString(Thorax.Util.tag(htmlAttributes, '', expandTokens ? this : null));
});
var helper = Handlebars.helpers[name];
return helper;
};
Thorax.View.on('append', function(scope, callback) {
(scope || this.$el).find('[' + viewPlaceholderAttributeName + ']').forEach(function(el) {
var placeholderId = el.getAttribute(viewPlaceholderAttributeName),
view = this.children[placeholderId];
if (view) {
//see if the view helper declared an override for the view
//if not, ensure the view has been rendered at least once
if (viewTemplateOverrides[placeholderId]) {
view.render(viewTemplateOverrides[placeholderId]);
delete viewTemplateOverrides[placeholderId];
} else {
view.ensureRendered();
}
$(el).replaceWith(view.el);
callback && callback(view.el);
}
}, this);
});
/**
* Clones the helper options, dropping items that are known to change
* between rendering cycles as appropriate.
*/
function cloneHelperOptions(options) {
var ret = _.pick(options, 'fn', 'inverse', 'hash', 'data');
ret.data = _.omit(options.data, 'cid', 'view', 'yield');
return ret;
}
/**
* Checks for basic equality between two sets of parameters for a helper view.
*
* Checked fields include:
* - _helperName
* - All args
* - Hash
* - Data
* - Function and Invert (id based if possible)
*
* This method allows us to determine if the inputs to a given view are the same. If they
* are then we make the assumption that the rendering will be the same (or the child view will
* otherwise rerendering it by monitoring it's parameters as necessary) and reuse the view on
* rerender of the parent view.
*/
function compareHelperOptions(a, b) {
function compareValues(a, b) {
return _.every(a, function(value, key) {
return b[key] === value;
});
}
if (a._helperName !== b._helperName) {
return false;
}
a = a._helperOptions;
b = b._helperOptions;
// Implements a first level depth comparison
return a.args.length === b.args.length
&& compareValues(a.args, b.args)
&& _.isEqual(_.keys(a.options), _.keys(b.options))
&& _.every(a.options, function(value, key) {
if (key === 'data' || key === 'hash') {
return compareValues(a.options[key], b.options[key]);
} else if (key === 'fn' || key === 'inverse') {
if (b.options[key] === value) {
return true;
}
var other = b.options[key] || {};
return value && _.has(value, 'program') && !value.depth && other.program === value.program;
}
return b.options[key] === value;
});
}
;;
/*global getValue, inheritVars, walkInheritTree */
function dataObject(type, spec) {
spec = inheritVars[type] = _.defaults({
name: '_' + type + 'Events',
event: true
}, spec);
// Add a callback in the view constructor
spec.ctor = function() {
if (this[type]) {
// Need to null this.model/collection so setModel/Collection will
// not treat it as the old model/collection and immediately return
var object = this[type];
this[type] = null;
this[spec.set](object);
}
};
function setObject(dataObject, options) {
var old = this[type],
$el = getValue(this, spec.$el);
if (dataObject === old) {
return this;
}
if (old) {
this.unbindDataObject(old);
}
if (dataObject) {
this[type] = dataObject;
if (spec.loading) {
spec.loading.call(this);
}
this.bindDataObject(type, dataObject, _.extend({}, this.options, options));
$el && $el.attr(spec.cidAttrName, dataObject.cid);
dataObject.trigger('set', dataObject, old);
} else {
this[type] = false;
if (spec.change) {
spec.change.call(this, false);
}
$el && $el.removeAttr(spec.cidAttrName);
}
this.trigger('change:data-object', type, dataObject, old);
return this;
}
Thorax.View.prototype[spec.set] = setObject;
}
_.extend(Thorax.View.prototype, {
bindDataObject: function(type, dataObject, options) {
if (this._boundDataObjectsByCid[dataObject.cid]) {
return false;
}
this._boundDataObjectsByCid[dataObject.cid] = dataObject;
var options = this._modifyDataObjectOptions(dataObject, _.extend({}, inheritVars[type].defaultOptions, options));
this._objectOptionsByCid[dataObject.cid] = options;
bindEvents.call(this, type, dataObject, this.constructor);
bindEvents.call(this, type, dataObject, this);
var spec = inheritVars[type];
spec.bindCallback && spec.bindCallback.call(this, dataObject, options);
if (dataObject.shouldFetch && dataObject.shouldFetch(options)) {
loadObject(dataObject, options);
} else if (inheritVars[type].change) {
// want to trigger built in rendering without triggering event on model
inheritVars[type].change.call(this, dataObject, options);
}
return true;
},
unbindDataObject: function (dataObject) {
if (!this._boundDataObjectsByCid[dataObject.cid]) {
return false;
}
delete this._boundDataObjectsByCid[dataObject.cid];
this.stopListening(dataObject);
delete this._objectOptionsByCid[dataObject.cid];
return true;
},
_modifyDataObjectOptions: function(dataObject, options) {
return options;
}
});
function bindEvents(type, target, source) {
var context = this;
walkInheritTree(source, '_' + type + 'Events', true, function(event) {
// getEventCallback will resolve if it is a string or a method
// and return a method
var callback = getEventCallback(event[1], context),
eventContext = event[2] || context,
destroyedCount = 0;
function eventHandler() {
if (context.el) {
callback.apply(eventContext, arguments);
} else {
// If our event handler is removed by destroy while another event is processing then we
// we might see one latent event percolate through due to caching in the event loop. If we
// see multiple events this is a concern and a sign that something was not cleaned properly.
if (destroyedCount) {
throw new Error('destroyed-event:' + context.name + ':' + event[0]);
}
destroyedCount++;
}
}
eventHandler._callback = callback;
context.listenTo(target, event[0], eventHandler);
});
}
function loadObject(dataObject, options) {
if (dataObject.load) {
dataObject.load(function() {
options && options.success && options.success(dataObject);
}, options);
} else {
dataObject.fetch(options);
}
}
function getEventCallback(callback, context) {
if (_.isFunction(callback)) {
return callback;
} else {
return context[callback];
}
}
;;
/*global createRegistryWrapper, dataObject, getValue */
var modelCidAttributeName = 'data-model-cid';
Thorax.Model = Backbone.Model.extend({
isEmpty: function() {
return !this.isPopulated();
},
isPopulated: function() {
// We are populated if we have attributes set
var attributes = _.clone(this.attributes),
defaults = getValue(this, 'defaults') || {};
for (var default_key in defaults) {
if (attributes[default_key] != defaults[default_key]) {
return true;
}
delete attributes[default_key];
}
var keys = _.keys(attributes);
return keys.length > 1 || (keys.length === 1 && keys[0] !== this.idAttribute);
},
shouldFetch: function(options) {
// url() will throw if model has no `urlRoot` and no `collection`
// or has `collection` and `collection` has no `url`
var url;
try {
url = getValue(this, 'url');
} catch(e) {
url = false;
}
return options.fetch && !!url && !this.isPopulated();
}
});
Thorax.Models = {};
createRegistryWrapper(Thorax.Model, Thorax.Models);
dataObject('model', {
set: 'setModel',
defaultOptions: {
render: undefined, // Default to deferred rendering
fetch: true,
success: false,
errors: true
},
change: onModelChange,
$el: '$el',
cidAttrName: modelCidAttributeName
});
function onModelChange(model) {
var modelOptions = model && this._objectOptionsByCid[model.cid];
// !modelOptions will be true when setModel(false) is called
this.conditionalRender(modelOptions && modelOptions.render);
}
Thorax.View.on({
model: {
error: function(model, errors) {
if (this._objectOptionsByCid[model.cid].errors) {
this.trigger('error', errors, model);
}
},
change: function(model) {
onModelChange.call(this, model);
}
}
});
$.fn.model = function(view) {
var $this = $(this),
modelElement = $this.closest('[' + modelCidAttributeName + ']'),
modelCid = modelElement && modelElement.attr(modelCidAttributeName);
if (modelCid) {
var view = view || $this.view();
if (view && view.model && view.model.cid === modelCid) {
return view.model || false;
}
var collection = $this.collection(view);
if (collection) {
return collection.get(modelCid);
}
}
return false;
};
;;
/*global createRegistryWrapper, dataObject, getEventCallback, getValue, modelCidAttributeName, viewCidAttributeName */
var _fetch = Backbone.Collection.prototype.fetch,
_reset = Backbone.Collection.prototype.reset,
_replaceHTML = Thorax.View.prototype._replaceHTML,
collectionCidAttributeName = 'data-collection-cid',
collectionEmptyAttributeName = 'data-collection-empty',
collectionElementAttributeName = 'data-collection-element',
ELEMENT_NODE_TYPE = 1;
Thorax.Collection = Backbone.Collection.extend({
model: Thorax.Model || Backbone.Model,
initialize: function() {
this.cid = _.uniqueId('collection');
return Backbone.Collection.prototype.initialize.apply(this, arguments);
},
isEmpty: function() {
if (this.length > 0) {
return false;
} else {
return this.length === 0 && this.isPopulated();
}
},
isPopulated: function() {
return this._fetched || this.length > 0 || (!this.length && !getValue(this, 'url'));
},
shouldFetch: function(options) {
return options.fetch && !!getValue(this, 'url') && !this.isPopulated();
},
fetch: function(options) {
options = options || {};
var success = options.success;
options.success = function(collection, response) {
collection._fetched = true;
success && success(collection, response);
};
return _fetch.apply(this, arguments);
},
reset: function(models, options) {
this._fetched = !!models;
return _reset.call(this, models, options);
}
});
Thorax.Collections = {};
createRegistryWrapper(Thorax.Collection, Thorax.Collections);
dataObject('collection', {
set: 'setCollection',
bindCallback: onSetCollection,
defaultOptions: {
render: undefined, // Default to deferred rendering
fetch: true,
success: false,
errors: true
},
change: onCollectionReset,
$el: 'getCollectionElement',
cidAttrName: collectionCidAttributeName
});
Thorax.CollectionView = Thorax.View.extend({
_defaultTemplate: Handlebars.VM.noop,
_collectionSelector: '[' + collectionElementAttributeName + ']',
// preserve collection element if it was not created with {{collection}} helper
_replaceHTML: function(html) {
if (this.collection && this._objectOptionsByCid[this.collection.cid] && this._renderCount) {
var element;
var oldCollectionElement = this.getCollectionElement();
element = _replaceHTML.call(this, html);
if (!oldCollectionElement.attr('data-view-cid')) {
this.getCollectionElement().replaceWith(oldCollectionElement);
}
} else {
return _replaceHTML.call(this, html);
}
},
render: function() {
var shouldRender = this.shouldRender();
Thorax.View.prototype.render.apply(this, arguments);
if (!shouldRender) {
this.renderCollection();
}
},
//appendItem(model [,index])
//appendItem(html_string, index)
//appendItem(view, index)
appendItem: function(model, index, options) {
//empty item
if (!model) {
return;
}
var itemView,
$el = this.getCollectionElement();
options = _.defaults(options || {}, {
filter: true
});
//if index argument is a view
index && index.el && (index = $el.children().indexOf(index.el) + 1);
//if argument is a view, or html string
if (model.el || _.isString(model)) {
itemView = model;
model = false;
} else {
index = index || this.collection.indexOf(model) || 0;
itemView = this.renderItem(model, index);
}
if (itemView) {
if (itemView.cid) {
itemView.ensureRendered();
this._addChild(itemView);
}
//if the renderer's output wasn't contained in a tag, wrap it in a div
//plain text, or a mixture of top level text nodes and element nodes
//will get wrapped
if (_.isString(itemView) && !itemView.match(/^\s*</m)) {
itemView = '<div>' + itemView + '</div>';
}
var itemElement = itemView.$el ? itemView.$el : _.filter($($.trim(itemView)), function(node) {
//filter out top level whitespace nodes
return node.nodeType === ELEMENT_NODE_TYPE;
});
model && $(itemElement).attr(modelCidAttributeName, model.cid);
var previousModel = index > 0 ? this.collection.at(index - 1) : false;
if (!previousModel) {
$el.prepend(itemElement);
} else {
//use last() as appendItem can accept multiple nodes from a template
var last = $el.children('[' + modelCidAttributeName + '="' + previousModel.cid + '"]').last();
last.after(itemElement);
}
this.trigger('append', null, function(el) {
el.setAttribute(modelCidAttributeName, model.cid);
});
!options.silent && this.trigger('rendered:item', this, this.collection, model, itemElement, index);
options.filter && applyItemVisiblityFilter.call(this, model);
}
return itemView;
},
// updateItem only useful if there is no item view, otherwise
// itemView.render() provides the same functionality
updateItem: function(model) {
var $el = this.getCollectionElement(),
viewEl = $el.find('[' + modelCidAttributeName + '="' + model.cid + '"]');
// NOP For views
if (viewEl.attr(viewCidAttributeName)) {
return;
}
this.removeItem(viewEl);
this.appendItem(model);
},
removeItem: function(model) {
var viewEl = model;
if (model.cid) {
var $el = this.getCollectionElement();
viewEl = $el.find('[' + modelCidAttributeName + '="' + model.cid + '"]');
}
if (!viewEl.length) {
return false;
}
viewEl.remove();
var viewCid = viewEl.attr(viewCidAttributeName),
child = this.children[viewCid];
if (child) {
this._removeChild(child);
child.destroy();
}
return true;
},
renderCollection: function() {
if (this.collection) {
if (this.collection.isEmpty()) {
handleChangeFromNotEmptyToEmpty.call(this);
} else {
handleChangeFromEmptyToNotEmpty.call(this);
this.collection.forEach(function(item, i) {
this.appendItem(item, i);
}, this);
}
this.trigger('rendered:collection', this, this.collection);
} else {
handleChangeFromNotEmptyToEmpty.call(this);
}
},
emptyClass: 'empty',
renderEmpty: function() {
if (!this.emptyTemplate && !this.emptyView) {
assignTemplate.call(this, 'emptyTemplate', {
extension: '-empty',
required: false
});
}
if (this.emptyView) {
var viewOptions = {};
if (this.emptyTemplate) {
viewOptions.template = this.emptyTemplate;
}
var view = Thorax.Util.getViewInstance(this.emptyView, viewOptions);
view.ensureRendered();
return view;
} else {
return this.emptyTemplate && this.renderTemplate(this.emptyTemplate);
}
},
renderItem: function(model, i) {
if (!this.itemTemplate && !this.itemView) {
assignTemplate.call(this, 'itemTemplate', {
extension: '-item',
// only require an itemTemplate if an itemView
// is not present
required: !this.itemView
});
}
if (this.itemView) {
var viewOptions = {
model: model
};
if (this.itemTemplate) {
viewOptions.template = this.itemTemplate;
}
return Thorax.Util.getViewInstance(this.itemView, viewOptions);
} else {
return this.renderTemplate(this.itemTemplate, this.itemContext(model, i));
}
},
itemContext: function(model /*, i */) {
return model.attributes;
},
appendEmpty: function() {
var $el = this.getCollectionElement();
$el.empty();
var emptyContent = this.renderEmpty();
emptyContent && this.appendItem(emptyContent, 0, {
silent: true,
filter: false
});
this.trigger('rendered:empty', this, this.collection);
},
getCollectionElement: function() {
var element = this.$(this._collectionSelector);
return element.length === 0 ? this.$el : element;
}
});
Thorax.CollectionView.on({
collection: {
reset: onCollectionReset,
sort: onCollectionReset,
filter: function() {
applyVisibilityFilter.call(this);
},
change: function(model) {
this.updateItem(model);
applyItemVisiblityFilter.call(this, model);
},
add: function(model) {
var $el = this.getCollectionElement();
this.collection.length === 1 && $el.length && handleChangeFromEmptyToNotEmpty.call(this);
if ($el.length) {
var index = this.collection.indexOf(model);
this.appendItem(model, index);
}
},
remove: function(model) {
var $el = this.getCollectionElement();
this.removeItem(model);
this.collection.length === 0 && $el.length && handleChangeFromNotEmptyToEmpty.call(this);
}
}
});
Thorax.View.on({
collection: {
error: function(collection, message) {
if (this._objectOptionsByCid[collection.cid].errors) {
this.trigger('error', message, collection);
}
}
}
});
function onCollectionReset(collection) {
// Undefined to force conditional render
var options = (collection && this._objectOptionsByCid[collection.cid]) || undefined;
if (this.shouldRender(options && options.render)) {
this.renderCollection && this.renderCollection();
}
}
// Even if the view is not a CollectionView
// ensureRendered() to provide similar behavior
// to a model
function onSetCollection(collection) {
// Undefined to force conditional render
var options = (collection && this._objectOptionsByCid[collection.cid]) || undefined;
if (this.shouldRender(options && options.render)) {
// Ensure that something is there if we are going to render the collection.
this.ensureRendered();
}
}
function applyVisibilityFilter() {
if (this.itemFilter) {
this.collection.forEach(applyItemVisiblityFilter, this);
}
}
function applyItemVisiblityFilter(model) {
var $el = this.getCollectionElement();
this.itemFilter && $el.find('[' + modelCidAttributeName + '="' + model.cid + '"]')[itemShouldBeVisible.call(this, model) ? 'show' : 'hide']();
}
function itemShouldBeVisible(model) {
return this.itemFilter(model, this.collection.indexOf(model));
}
function handleChangeFromEmptyToNotEmpty() {
var $el = this.getCollectionElement();
this.emptyClass && $el.removeClass(this.emptyClass);
$el.removeAttr(collectionEmptyAttributeName);
$el.empty();
}
function handleChangeFromNotEmptyToEmpty() {
var $el = this.getCollectionElement();
this.emptyClass && $el.addClass(this.emptyClass);
$el.attr(collectionEmptyAttributeName, true);
this.appendEmpty();
}
//$(selector).collection() helper
$.fn.collection = function(view) {
if (view && view.collection) {
return view.collection;
}
var $this = $(this),
collectionElement = $this.closest('[' + collectionCidAttributeName + ']'),
collectionCid = collectionElement && collectionElement.attr(collectionCidAttributeName);
if (collectionCid) {
view = $this.view();
if (view) {
return view.collection;
}
}
return false;
};
;;
/*global inheritVars */
inheritVars.model.defaultOptions.populate = true;
var oldModelChange = inheritVars.model.change;
inheritVars.model.change = function() {
oldModelChange.apply(this, arguments);
// TODO : What can we do to remove this duplication?
var modelOptions = this.model && this._objectOptionsByCid[this.model.cid];
if (modelOptions && modelOptions.populate) {
this.populate(this.model.attributes, modelOptions.populate === true ? {} : modelOptions.populate);
}
};
inheritVars.model.defaultOptions.populate = true;
_.extend(Thorax.View.prototype, {
//serializes a form present in the view, returning the serialized data
//as an object
//pass {set:false} to not update this.model if present
//can pass options, callback or event in any order
serialize: function() {
var callback, options, event;
//ignore undefined arguments in case event was null
for (var i = 0; i < arguments.length; ++i) {
if (_.isFunction(arguments[i])) {
callback = arguments[i];
} else if (_.isObject(arguments[i])) {
if ('stopPropagation' in arguments[i] && 'preventDefault' in arguments[i]) {
event = arguments[i];
} else {
options = arguments[i];
}
}
}
if (event && !this._preventDuplicateSubmission(event)) {
return;
}
options = _.extend({
set: true,
validate: true,
children: true,
silent: true
}, options || {});
var attributes = options.attributes || {};
//callback has context of element
var view = this;
var errors = [];
eachNamedInput.call(this, options, function() {
var value = view._getInputValue(this, options, errors);
if (!_.isUndefined(value)) {
objectAndKeyFromAttributesAndName.call(this, attributes, this.name, {mode: 'serialize'}, function(object, key) {
if (!object[key]) {
object[key] = value;
} else if (_.isArray(object[key])) {
object[key].push(value);
} else {
object[key] = [object[key], value];
}
});
}
});
this.trigger('serialize', attributes, options);
if (options.validate) {
var validateInputErrors = this.validateInput(attributes);
if (validateInputErrors && validateInputErrors.length) {
errors = errors.concat(validateInputErrors);
}
this.trigger('validate', attributes, errors, options);
if (errors.length) {
this.trigger('error', errors);
return;
}
}
if (options.set && this.model) {
if (!this.model.set(attributes, {silent: options.silent})) {
return false;
}
}
callback && callback.call(this, attributes, _.bind(resetSubmitState, this));
return attributes;
},
_preventDuplicateSubmission: function(event, callback) {
event.preventDefault();
var form = $(event.target);
if ((event.target.tagName || '').toLowerCase() !== 'form') {
// Handle non-submit events by gating on the form
form = $(event.target).closest('form');
}
if (!form.attr('data-submit-wait')) {
form.attr('data-submit-wait', 'true');
if (callback) {
callback.call(this, event);
}
return true;
} else {
return false;
}
},
//populate a form from the passed attributes or this.model if present
populate: function(attributes, options) {
options = _.extend({
children: true
}, options || {});
var value,
attributes = attributes || this._getContext();
//callback has context of element
eachNamedInput.call(this, options, function() {
objectAndKeyFromAttributesAndName.call(this, attributes, this.name, {mode: 'populate'}, function(object, key) {
value = object && object[key];
if (!_.isUndefined(value)) {
//will only execute if we have a name that matches the structure in attributes
if (this.type === 'checkbox' && _.isBoolean(value)) {
this.checked = value;
} else if (this.type === 'checkbox' || this.type === 'radio') {
this.checked = value == this.value;
} else {
this.value = value;
}
}
});
});
this.trigger('populate', attributes);
},
//perform form validation, implemented by child class
validateInput: function(/* attributes, options, errors */) {},
_getInputValue: function(input /* , options, errors */) {
if (input.type === 'checkbox' || input.type === 'radio') {
if (input.checked) {
return input.value;
}
} else if (input.multiple === true) {
var values = [];
$('option', input).each(function() {
if (this.selected) {
values.push(this.value);
}
});
return values;
} else {
return input.value;
}
}
});
Thorax.View.on({
error: function() {
resetSubmitState.call(this);
// If we errored with a model we want to reset the content but leave the UI
// intact. If the user updates the data and serializes any overwritten data
// will be restored.
if (this.model && this.model.previousAttributes) {
this.model.set(this.model.previousAttributes(), {
silent: true
});
}
},
deactivated: function() {
resetSubmitState.call(this);
}
});
function eachNamedInput(options, iterator, context) {
var i = 0,
self = this;
this.$('select,input,textarea', options.root || this.el).each(function() {
if (!options.children) {
if (self !== $(this).view({helper: false})) {
return;
}
}
if (this.type !== 'button' && this.type !== 'cancel' && this.type !== 'submit' && this.name && this.name !== '') {
iterator.call(context || this, i, this);
++i;
}
});
}
//calls a callback with the correct object fragment and key from a compound name
function objectAndKeyFromAttributesAndName(attributes, name, options, callback) {
var key,
object = attributes,
keys = name.split('['),
mode = options.mode;
for (var i = 0; i < keys.length - 1; ++i) {
key = keys[i].replace(']', '');
if (!object[key]) {
if (mode === 'serialize') {
object[key] = {};
} else {
return callback.call(this, false, key);
}
}
object = object[key];
}
key = keys[keys.length - 1].replace(']', '');
callback.call(this, object, key);
}
function resetSubmitState() {
this.$('form').removeAttr('data-submit-wait');
}
;;
var layoutCidAttributeName = 'data-layout-cid';
Thorax.LayoutView = Thorax.View.extend({
_defaultTemplate: Handlebars.VM.noop,
render: function() {
var response = Thorax.View.prototype.render.apply(this, arguments);
if (this.template === Handlebars.VM.noop) {
// if there is no template setView will append to this.$el
ensureLayoutCid.call(this);
} else {
// if a template was specified is must declare a layout-element
ensureLayoutViewsTargetElement.call(this);
}
return response;
},
setView: function(view, options) {
options = _.extend({
scroll: true,
destroy: true
}, options || {});
if (_.isString(view)) {
view = new (Thorax.Util.registryGet(Thorax, 'Views', view, false))();
}
this.ensureRendered();
var oldView = this._view;
if (view === oldView) {
return false;
}
if (options.destroy && view) {
view._shouldDestroyOnNextSetView = true;
}
this.trigger('change:view:start', view, oldView, options);
if (oldView) {
this._removeChild(oldView);
oldView.$el.remove();
triggerLifecycleEvent.call(oldView, 'deactivated', options);
if (oldView._shouldDestroyOnNextSetView) {
oldView.destroy();
}
}
if (view) {
triggerLifecycleEvent.call(this, 'activated', options);
view.trigger('activated', options);
this._addChild(view);
this._view = view;
this._view.appendTo(getLayoutViewsTargetElement.call(this));
} else {
this._view = undefined;
}
this.trigger('change:view:end', view, oldView, options);
return view;
},
getView: function() {
return this._view;
}
});
Handlebars.registerHelper('layout-element', function(options) {
var view = getOptionsData(options).view;
// duck type check for LayoutView
if (!view.getView) {
throw new Error('layout-element must be used within a LayoutView');
}
options.hash[layoutCidAttributeName] = view.cid;
normalizeHTMLAttributeOptions(options.hash);
return new Handlebars.SafeString(Thorax.Util.tag.call(this, options.hash, '', this));
});
function triggerLifecycleEvent(eventName, options) {
options = options || {};
options.target = this;
this.trigger(eventName, options);
_.each(this.children, function(child) {
child.trigger(eventName, options);
});
}
function ensureLayoutCid() {
++this._renderCount;
//set the layoutCidAttributeName on this.$el if there was no template
this.$el.attr(layoutCidAttributeName, this.cid);
}
function ensureLayoutViewsTargetElement() {
if (!this.$('[' + layoutCidAttributeName + '="' + this.cid + '"]')[0]) {
throw new Error('No layout element found in ' + (this.name || this.cid));
}
}
function getLayoutViewsTargetElement() {
return this.$('[' + layoutCidAttributeName + '="' + this.cid + '"]')[0] || this.el[0] || this.el;
}
;;
/*global createRegistryWrapper */
//Router
function initializeRouter() {
Backbone.history || (Backbone.history = new Backbone.History());
Backbone.history.on('route', onRoute, this);
//router does not have a built in destroy event
//but ViewController does
this.on('destroyed', function() {
Backbone.history.off('route', onRoute, this);
});
}
Thorax.Router = Backbone.Router.extend({
constructor: function() {
var response = Thorax.Router.__super__.constructor.apply(this, arguments);
initializeRouter.call(this);
return response;
},
route: function(route, name, callback) {
if (!callback) {
callback = this[name];
}
//add a route:before event that is fired before the callback is called
return Backbone.Router.prototype.route.call(this, route, name, function() {
this.trigger.apply(this, ['route:before', route, name].concat(Array.prototype.slice.call(arguments)));
return callback.apply(this, arguments);
});
}
});
Thorax.Routers = {};
createRegistryWrapper(Thorax.Router, Thorax.Routers);
function onRoute(router /* , name */) {
if (this === router) {
this.trigger.apply(this, ['route'].concat(Array.prototype.slice.call(arguments, 1)));
}
}
;;
Thorax.CollectionHelperView = Thorax.CollectionView.extend({
// Forward render events to the parent
events: {
'rendered:item': forwardRenderEvent('rendered:item'),
'rendered:collection': forwardRenderEvent('rendered:collection'),
'rendered:empty': forwardRenderEvent('rendered:empty')
},
constructor: function(options) {
_.each(collectionOptionNames, function(viewAttributeName, helperOptionName) {
if (options.options[helperOptionName]) {
var value = options.options[helperOptionName];
if (viewAttributeName === 'itemTemplate' || viewAttributeName === 'emptyTemplate') {
value = Thorax.Util.getTemplate(value);
}
options[viewAttributeName] = value;
}
});
// Handlebars.VM.noop is passed in the handlebars options object as
// a default for fn and inverse, if a block was present. Need to
// check to ensure we don't pick the empty / null block up.
if (!options.itemTemplate && options.template && options.template !== Handlebars.VM.noop) {
options.itemTemplate = options.template;
options.template = Handlebars.VM.noop;
}
if (!options.emptyTemplate && options.inverse && options.inverse !== Handlebars.VM.noop) {
options.emptyTemplate = options.inverse;
options.inverse = Handlebars.VM.noop;
}
var response = Thorax.HelperView.call(this, options);
if (this.parent.name) {
if (!this.emptyTemplate) {
this.emptyTemplate = Thorax.Util.getTemplate(this.parent.name + '-empty', true);
}
if (!this.itemTemplate) {
// item template must be present if an itemView is not
this.itemTemplate = Thorax.Util.getTemplate(this.parent.name + '-item', !!this.itemView);
}
}
return response;
},
setAsPrimaryCollectionHelper: function() {
_.each(forwardableProperties, function(propertyName) {
forwardMissingProperty.call(this, propertyName);
}, this);
var self = this;
_.each(['itemFilter', 'itemContext', 'renderItem', 'renderEmpty'], function(propertyName) {
if (self.parent[propertyName] && !this[propertyName]) {
self[propertyName] = function() {
return self.parent[propertyName].apply(self.parent, arguments);
};
}
});
}
});
_.extend(Thorax.CollectionHelperView.prototype, helperViewPrototype);
var collectionOptionNames = {
'item-template': 'itemTemplate',
'empty-template': 'emptyTemplate',
'item-view': 'itemView',
'empty-view': 'emptyView',
'empty-class': 'emptyClass'
};
function forwardRenderEvent(eventName) {
return function() {
var args = _.toArray(arguments);
args.unshift(eventName);
this.parent.trigger.apply(this.parent, args);
}
}
var forwardableProperties = [
'itemTemplate',
'itemView',
'emptyTemplate',
'emptyView'
];
function forwardMissingProperty(propertyName) {
var parent = getParent(this);
if (!this[propertyName]) {
var prop = parent[propertyName];
if (prop){
this[propertyName] = prop;
}
}
}
Handlebars.registerViewHelper('collection', Thorax.CollectionHelperView, function(collection, view) {
if (arguments.length === 1) {
view = collection;
collection = view.parent.collection;
collection && view.setAsPrimaryCollectionHelper();
view.$el.attr(collectionElementAttributeName, 'true');
// propagate future changes to the parent's collection object
// to the helper view
view.listenTo(view.parent, 'change:data-object', function(type, dataObject) {
if (type === 'collection') {
view.setAsPrimaryCollectionHelper();
view.setCollection(dataObject);
}
});
}
collection && view.setCollection(collection);
});
Handlebars.registerHelper('collection-element', function(options) {
if (!getOptionsData(options).view.renderCollection) {
throw new Error("collection-element helper must be declared inside of a CollectionView");
}
var hash = options.hash;
normalizeHTMLAttributeOptions(hash);
hash.tagName = hash.tagName || 'div';
hash[collectionElementAttributeName] = true;
return new Handlebars.SafeString(Thorax.Util.tag.call(this, hash, '', this));
});
;;
Handlebars.registerHelper('empty', function(dataObject, options) {
if (arguments.length === 1) {
options = dataObject;
}
var view = getOptionsData(options).view;
if (arguments.length === 1) {
dataObject = view.model;
}
// listeners for the empty helper rather than listeners
// that are themselves empty
if (!view._emptyListeners) {
view._emptyListeners = {};
}
// duck type check for collection
if (dataObject && !view._emptyListeners[dataObject.cid] && dataObject.models && ('length' in dataObject)) {
view._emptyListeners[dataObject.cid] = true;
view.listenTo(dataObject, 'remove', function() {
if (dataObject.length === 0) {
view.render();
}
});
view.listenTo(dataObject, 'add', function() {
if (dataObject.length === 1) {
view.render();
}
});
view.listenTo(dataObject, 'reset', function() {
view.render();
});
}
return !dataObject || dataObject.isEmpty() ? options.fn(this) : options.inverse(this);
});
;;
Handlebars.registerHelper('template', function(name, options) {
var context = _.extend({fn: options && options.fn}, this, options ? options.hash : {});
var output = getOptionsData(options).view.renderTemplate(name, context);
return new Handlebars.SafeString(output);
});
Handlebars.registerHelper('yield', function(options) {
return getOptionsData(options).yield && options.data.yield();
});
;;
Handlebars.registerHelper('url', function(url) {
var fragment;
if (arguments.length > 2) {
fragment = _.map(_.head(arguments, arguments.length - 1), encodeURIComponent).join('/');
} else {
var options = arguments[1],
hash = (options && options.hash) || options;
if (hash && hash['expand-tokens']) {
fragment = Thorax.Util.expandToken(url, this);
} else {
fragment = url;
}
}
if (Backbone.history._hasPushState) {
var root = Backbone.history.options.root;
if (root === '/' && fragment.substr(0, 1) === '/') {
return fragment;
} else {
return root + fragment;
}
} else {
return '#' + fragment;
}
});
;;
/*global viewTemplateOverrides */
Handlebars.registerViewHelper('view', {
factory: function(args, options) {
var View = args.length >= 1 ? args[0] : Thorax.View;
return Thorax.Util.getViewInstance(View, options.options);
},
callback: function() {
var instance = arguments[arguments.length-1],
options = instance._helperOptions.options,
placeholderId = instance.cid;
if (options.fn) {
viewTemplateOverrides[placeholderId] = options.fn;
}
}
});
;;
var callMethodAttributeName = 'data-call-method',
triggerEventAttributeName = 'data-trigger-event';
Handlebars.registerHelper('button', function(method, options) {
if (arguments.length === 1) {
options = method;
method = options.hash.method;
}
var hash = options.hash,
expandTokens = hash['expand-tokens'];
delete hash['expand-tokens'];
if (!method && !options.hash.trigger) {
throw new Error("button helper must have a method name as the first argument or a 'trigger', or a 'method' attribute specified.");
}
normalizeHTMLAttributeOptions(hash);
hash.tagName = hash.tagName || 'button';
hash.trigger && (hash[triggerEventAttributeName] = hash.trigger);
delete hash.trigger;
method && (hash[callMethodAttributeName] = method);
return new Handlebars.SafeString(Thorax.Util.tag(hash, options.fn ? options.fn(this) : '', expandTokens ? this : null));
});
Handlebars.registerHelper('link', function() {
var args = _.toArray(arguments),
options = args.pop(),
hash = options.hash,
// url is an array that will be passed to the url helper
url = args.length === 0 ? [hash.href] : args,
expandTokens = hash['expand-tokens'];
delete hash['expand-tokens'];
if (!url[0] && url[0] !== '') {
throw new Error("link helper requires an href as the first argument or an 'href' attribute");
}
normalizeHTMLAttributeOptions(hash);
url.push(options);
hash.href = Handlebars.helpers.url.apply(this, url);
hash.tagName = hash.tagName || 'a';
hash.trigger && (hash[triggerEventAttributeName] = options.hash.trigger);
delete hash.trigger;
hash[callMethodAttributeName] = '_anchorClick';
return new Handlebars.SafeString(Thorax.Util.tag(hash, options.fn ? options.fn(this) : '', expandTokens ? this : null));
});
var clickSelector = '[' + callMethodAttributeName + '], [' + triggerEventAttributeName + ']';
function handleClick(event) {
var target = $(event.target),
view = target.view({helper: false}),
methodName = target.attr(callMethodAttributeName),
eventName = target.attr(triggerEventAttributeName),
methodResponse = false;
methodName && (methodResponse = view[methodName].call(view, event));
eventName && view.trigger(eventName, event);
target.tagName === "A" && methodResponse === false && event.preventDefault();
}
var lastClickHandlerEventName;
function registerClickHandler() {
unregisterClickHandler();
lastClickHandlerEventName = Thorax._fastClickEventName || 'click';
$(document).on(lastClickHandlerEventName, clickSelector, handleClick);
}
function unregisterClickHandler() {
lastClickHandlerEventName && $(document).off(lastClickHandlerEventName, clickSelector, handleClick);
}
$(document).ready(function() {
if (!Thorax._fastClickEventName) {
registerClickHandler();
}
});
;;
var elementPlaceholderAttributeName = 'data-element-tmp';
Handlebars.registerHelper('element', function(element, options) {
normalizeHTMLAttributeOptions(options.hash);
var cid = _.uniqueId('element'),
declaringView = getOptionsData(options).view,
htmlAttributes = _.pick(options.hash, htmlAttributesToCopy);
htmlAttributes[elementPlaceholderAttributeName] = cid;
declaringView._elementsByCid || (declaringView._elementsByCid = {});
declaringView._elementsByCid[cid] = element;
return new Handlebars.SafeString(Thorax.Util.tag(htmlAttributes));
});
Thorax.View.on('append', function(scope, callback) {
(scope || this.$el).find('[' + elementPlaceholderAttributeName + ']').forEach(function(el) {
var $el = $(el),
cid = $el.attr(elementPlaceholderAttributeName),
element = this._elementsByCid[cid];
// A callback function may be specified as the value
if (_.isFunction(element)) {
element = element.call(this);
}
$el.replaceWith(element);
callback && callback(element);
}, this);
});
;;
Handlebars.registerHelper('super', function(options) {
var declaringView = getOptionsData(options).view,
parent = declaringView.constructor && declaringView.constructor.__super__;
if (parent) {
var template = parent.template;
if (!template) {
if (!parent.name) {
throw new Error('Cannot use super helper when parent has no name or template.');
}
template = parent.name;
}
if (_.isString(template)) {
template = Thorax.Util.getTemplate(template, false);
}
return new Handlebars.SafeString(template(this, options));
} else {
return '';
}
});
;;
/*global collectionOptionNames, inheritVars */
var loadStart = 'load:start',
loadEnd = 'load:end',
rootObject;
Thorax.setRootObject = function(obj) {
rootObject = obj;
};
Thorax.loadHandler = function(start, end, context) {
var loadCounter = _.uniqueId('load');
return function(message, background, object) {
var self = context || this;
self._loadInfo = self._loadInfo || {};
var loadInfo = self._loadInfo[loadCounter];
function startLoadTimeout() {
// If the timeout has been set already but has not triggered yet do nothing
// Otherwise set a new timeout (either initial or for going from background to
// non-background loading)
if (loadInfo.timeout && !loadInfo.run) {
return;
}
var loadingTimeout = self._loadingTimeoutDuration !== undefined ?
self._loadingTimeoutDuration : Thorax.View.prototype._loadingTimeoutDuration;
loadInfo.timeout = setTimeout(function() {
try {
loadInfo.run = true;
start.call(self, loadInfo.message, loadInfo.background, loadInfo);
} catch (e) {
Thorax.onException('loadStart', e);
}
}, loadingTimeout * 1000);
}
if (!loadInfo) {
loadInfo = self._loadInfo[loadCounter] = _.extend({
isLoading: function() {
return loadInfo.events.length;
},
cid: loadCounter,
events: [],
timeout: 0,
message: message,
background: !!background
}, Backbone.Events);
startLoadTimeout();
} else {
clearTimeout(loadInfo.endTimeout);
loadInfo.message = message;
if (!background && loadInfo.background) {
loadInfo.background = false;
startLoadTimeout();
}
}
// Prevent binds to the same object multiple times as this can cause very bad things
// to happen for the load;load;end;end execution flow.
if (_.indexOf(loadInfo.events, object) >= 0) {
return;
}
loadInfo.events.push(object);
object.on(loadEnd, function endCallback() {
var loadingEndTimeout = self._loadingTimeoutEndDuration;
if (loadingEndTimeout === void 0) {
// If we are running on a non-view object pull the default timeout
loadingEndTimeout = Thorax.View.prototype._loadingTimeoutEndDuration;
}
var events = loadInfo.events,
index = _.indexOf(events, object);
if (index >= 0 && !object.isLoading()) {
events.splice(index, 1);
if (_.indexOf(events, object) < 0) {
// Last callback for this particlar object, remove the bind
object.off(loadEnd, endCallback);
}
}
if (!events.length) {
clearTimeout(loadInfo.endTimeout);
loadInfo.endTimeout = setTimeout(function() {
try {
if (!events.length) {
if (loadInfo.run) {
// Emit the end behavior, but only if there is a paired start
end.call(self, loadInfo.background, loadInfo);
loadInfo.trigger(loadEnd, loadInfo);
}
// If stopping make sure we don't run a start
clearTimeout(loadInfo.timeout);
loadInfo = self._loadInfo[loadCounter] = undefined;
}
} catch (e) {
Thorax.onException('loadEnd', e);
}
}, loadingEndTimeout * 1000);
}
});
};
};
/**
* Helper method for propagating load:start events to other objects.
*
* Forwards load:start events that occur on `source` to `dest`.
*/
Thorax.forwardLoadEvents = function(source, dest, once) {
function load(message, backgound, object) {
if (once) {
source.off(loadStart, load);
}
dest.trigger(loadStart, message, backgound, object);
}
source.on(loadStart, load);
return {
off: function() {
source.off(loadStart, load);
}
};
};
//
// Data load event generation
//
/**
* Mixing for generating load:start and load:end events.
*/
Thorax.mixinLoadable = function(target, useParent) {
_.extend(target, {
//loading config
_loadingClassName: 'loading',
_loadingTimeoutDuration: 0.33,
_loadingTimeoutEndDuration: 0.10,
// Propagates loading view parameters to the AJAX layer
onLoadStart: function(message, background, object) {
var that = useParent ? this.parent : this;
// Protect against race conditions
if (!that || !that.el) {
return;
}
if (!that.nonBlockingLoad && !background && rootObject && rootObject !== this) {
rootObject.trigger(loadStart, message, background, object);
}
that._isLoading = true;
$(that.el).addClass(that._loadingClassName);
// used by loading helpers
that.trigger('change:load-state', 'start', background);
},
onLoadEnd: function(/* background, object */) {
var that = useParent ? this.parent : this;
// Protect against race conditions
if (!that || !that.el) {
return;
}
that._isLoading = false;
$(that.el).removeClass(that._loadingClassName);
// used by loading helper
that.trigger('change:load-state', 'end');
}
});
};
Thorax.mixinLoadableEvents = function(target, useParent) {
_.extend(target, {
_loadCount: 0,
isLoading: function() {
return this._loadCount > 0;
},
loadStart: function(message, background) {
this._loadCount++;
var that = useParent ? this.parent : this;
that.trigger(loadStart, message, background, that);
},
loadEnd: function() {
this._loadCount--
var that = useParent ? this.parent : this;
that.trigger(loadEnd, that);
}
});
};
Thorax.mixinLoadable(Thorax.View.prototype);
Thorax.mixinLoadableEvents(Thorax.View.prototype);
if (Thorax.HelperView) {
Thorax.mixinLoadable(Thorax.HelperView.prototype, true);
Thorax.mixinLoadableEvents(Thorax.HelperView.prototype, true);
}
if (Thorax.CollectionHelperView) {
Thorax.mixinLoadable(Thorax.CollectionHelperView.prototype, true);
Thorax.mixinLoadableEvents(Thorax.CollectionHelperView.prototype, true);
}
Thorax.sync = function(method, dataObj, options) {
var self = this,
complete = options.complete;
options.complete = function() {
self._request = undefined;
self._aborted = false;
complete && complete.apply(this, arguments);
};
this._request = Backbone.sync.apply(this, arguments);
return this._request;
};
function bindToRoute(callback, failback) {
var fragment = Backbone.history.getFragment(),
routeChanged = false;
function routeHandler() {
if (fragment === Backbone.history.getFragment()) {
return;
}
routeChanged = true;
res.cancel();
failback && failback();
}
Backbone.history.on('route', routeHandler);
function finalizer() {
Backbone.history.off('route', routeHandler);
if (!routeChanged) {
callback.apply(this, arguments);
}
}
var res = _.bind(finalizer, this);
res.cancel = function() {
Backbone.history.off('route', routeHandler);
};
return res;
}
function loadData(callback, failback, options) {
if (this.isPopulated()) {
// Defer here to maintain async callback behavior for all loading cases
return _.defer(callback, this);
}
if (arguments.length === 2 && !_.isFunction(failback) && _.isObject(failback)) {
options = failback;
failback = false;
}
var self = this,
routeChanged = false,
successCallback = bindToRoute(_.bind(callback, self), function() {
routeChanged = true;
if (self._request) {
self._aborted = true;
self._request.abort();
}
failback && failback.call(self, false);
});
this.fetch(_.defaults({
success: successCallback,
error: function() {
successCallback.cancel();
if (!routeChanged && failback) {
failback.apply(self, [true].concat(_.toArray(arguments)));
}
}
}, options));
}
function fetchQueue(options, $super) {
if (options.resetQueue) {
// WARN: Should ensure that loaders are protected from out of band data
// when using this option
this.fetchQueue = undefined;
}
if (!this.fetchQueue) {
// Kick off the request
this.fetchQueue = [options];
options = _.defaults({
success: flushQueue(this, this.fetchQueue, 'success'),
error: flushQueue(this, this.fetchQueue, 'error'),
complete: flushQueue(this, this.fetchQueue, 'complete')
}, options);
// Handle callers that do not pass in a super class and wish to implement their own
// fetch behavior
if ($super) {
$super.call(this, options);
}
return options;
} else {
// Currently fetching. Queue and process once complete
this.fetchQueue.push(options);
}
}
function flushQueue(self, fetchQueue, handler) {
return function() {
var args = arguments;
// Flush the queue. Executes any callback handlers that
// may have been passed in the fetch options.
_.each(fetchQueue, function(options) {
if (options[handler]) {
options[handler].apply(this, args);
}
}, this);
// Reset the queue if we are still the active request
if (self.fetchQueue === fetchQueue) {
self.fetchQueue = undefined;
}
};
}
var klasses = [];
Thorax.Model && klasses.push(Thorax.Model);
Thorax.Collection && klasses.push(Thorax.Collection);
_.each(klasses, function(DataClass) {
var $fetch = DataClass.prototype.fetch;
Thorax.mixinLoadableEvents(DataClass.prototype, false);
_.extend(DataClass.prototype, {
sync: Thorax.sync,
fetch: function(options) {
options = options || {};
var self = this,
complete = options.complete;
options.complete = function() {
complete && complete.apply(this, arguments);
self.loadEnd();
};
self.loadStart(undefined, options.background);
return fetchQueue.call(this, options || {}, $fetch);
},
load: function(callback, failback, options) {
if (arguments.length === 2 && !_.isFunction(failback)) {
options = failback;
failback = false;
}
options = options || {};
if (!options.background && !this.isPopulated() && rootObject) {
// Make sure that the global scope sees the proper load events here
// if we are loading in standalone mode
Thorax.forwardLoadEvents(this, rootObject, true);
}
loadData.call(this, callback, failback, options);
}
});
});
Thorax.Util.bindToRoute = bindToRoute;
if (Thorax.Router) {
Thorax.Router.bindToRoute = Thorax.Router.prototype.bindToRoute = bindToRoute;
}
// Propagates loading view parameters to the AJAX layer
Thorax.View.prototype._modifyDataObjectOptions = function(dataObject, options) {
options.ignoreErrors = this.ignoreFetchError;
options.background = this.nonBlockingLoad;
return options;
};
// Thorax.CollectionHelperView inherits from CollectionView
// not HelperView so need to set it manually
Thorax.HelperView.prototype._modifyDataObjectOptions = Thorax.CollectionHelperView.prototype._modifyDataObjectOptions = function(dataObject, options) {
options.ignoreErrors = this.parent.ignoreFetchError;
options.background = this.parent.nonBlockingLoad;
return options;
};
inheritVars.collection.loading = function() {
var loadingView = this.loadingView,
loadingTemplate = this.loadingTemplate,
loadingPlacement = this.loadingPlacement;
//add "loading-view" and "loading-template" options to collection helper
if (loadingView || loadingTemplate) {
var callback = Thorax.loadHandler(_.bind(function() {
var item;
if (this.collection.length === 0) {
this.$el.empty();
}
if (loadingView) {
var instance = Thorax.Util.getViewInstance(loadingView);
this._addChild(instance);
if (loadingTemplate) {
instance.render(loadingTemplate);
} else {
instance.render();
}
item = instance;
} else {
item = this.renderTemplate(loadingTemplate);
}
var index = loadingPlacement
? loadingPlacement.call(this)
: this.collection.length
;
this.appendItem(item, index);
this.$el.children().eq(index).attr('data-loading-element', this.collection.cid);
}, this), _.bind(function() {
this.$el.find('[data-loading-element="' + this.collection.cid + '"]').remove();
}, this),
this.collection);
this.listenTo(this.collection, 'load:start', callback);
}
};
if (collectionOptionNames) {
collectionOptionNames['loading-template'] = 'loadingTemplate';
collectionOptionNames['loading-view'] = 'loadingView';
collectionOptionNames['loading-placement'] = 'loadingPlacement';
}
Thorax.View.on({
'load:start': Thorax.loadHandler(
function(message, background, object) {
this.onLoadStart(message, background, object);
},
function(background, object) {
this.onLoadEnd(object);
}),
collection: {
'load:start': function(message, background, object) {
this.trigger(loadStart, message, background, object);
}
},
model: {
'load:start': function(message, background, object) {
this.trigger(loadStart, message, background, object);
}
}
});
;;
Handlebars.registerHelper('loading', function(options) {
var view = getOptionsData(options).view;
view.off('change:load-state', onLoadStateChange, view);
view.on('change:load-state', onLoadStateChange, view);
return view._isLoading ? options.fn(this) : options.inverse(this);
});
function onLoadStateChange() {
this.render();
}
;;
var isIE = (/msie [\w.]+/).exec(navigator.userAgent.toLowerCase());
if (isIE) {
// IE will lose a reference to the elements if view.el.innerHTML = '';
// If they are removed one by one the references are not lost.
// For instance a view's childrens' `el`s will be lost if the view
// sets it's `el.innerHTML`.
Thorax.View.on('before:append', function() {
// note that detach is not available in Zepto,
// but IE should never run with Zepto
if (this._renderCount > 0) {
_.each(this._elementsByCid, function(element) {
$(element).detach();
});
_.each(this.children, function(child) {
child.$el.detach();
});
}
});
// Once nodes are detached their innerHTML gets nuked in IE
// so create a deep clone. This method is identical to the
// main implementation except for ".clone(true, true)" which
// will perform a deep clone with events and data
Thorax.CollectionView.prototype._replaceHTML = function(html) {
if (this.collection && this._objectOptionsByCid[this.collection.cid] && this._renderCount) {
var element;
var oldCollectionElement = this.getCollectionElement().clone(true, true);
element = _replaceHTML.call(this, html);
if (!oldCollectionElement.attr('data-view-cid')) {
this.getCollectionElement().replaceWith(oldCollectionElement);
}
} else {
return _replaceHTML.call(this, html);
}
};
}
;;
})();
//@ sourceMappingURL=thorax.js.map
|
examples/shopping-cart/src/containers/CartContainer.js | gaearon/redux | import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { checkout } from '../actions'
import { getTotal, getCartProducts } from '../reducers'
import Cart from '../components/Cart'
const CartContainer = ({ products, total, checkout }) => (
<Cart
products={products}
total={total}
onCheckoutClicked={() => checkout(products)} />
)
CartContainer.propTypes = {
products: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
title: PropTypes.string.isRequired,
price: PropTypes.number.isRequired,
quantity: PropTypes.number.isRequired
})).isRequired,
total: PropTypes.string,
checkout: PropTypes.func.isRequired
}
const mapStateToProps = (state) => ({
products: getCartProducts(state),
total: getTotal(state)
})
export default connect(
mapStateToProps,
{ checkout }
)(CartContainer)
|
src/components/infoPanel.component.vr.js | craigkj312/node-react-vr-starter | import React from 'react';
import { AppRegistry, asset, StyleSheet, Pano, Text, View, Image, VrButton, Linking } from 'react-vr';
import styles from '../styles/main.stylesheet';
export default class InfoPanel extends React.Component {
constructor(props) {
super(props)
this.state = {firstLink: styles.hyperlink,
secondLink: styles.hyperlink}
}
openURL(url) {
console.log(url);
// Linking.openURL(url).catch(err => console.error('An error occurred', err));
}
render() {
return (
<View style={styles.panel}>
<Image style={styles.image}
source={asset('vr-illustration.png')}
/>
<View style={styles.panelText}>
<Text style={styles.title}>
Welcome to Virtual Reality on Bluemix!
</Text>
<Text style={styles.info}>
Thanks for creating a
<Text style={this.state.firstLink}
onInput={this.openURL('https://github.com/craigkj312/node-react-vr-starter')}
onEnter={() => this.setState({firstLink: styles.hover})}
onExit={() => this.setState({firstLink: styles.hyperlink})}> Node React VR Starter App</Text>
<Text style={styles.info}>! To get started creating your virtual world check out the</Text>
<Text style={this.state.secondLink}
onInput={this.openURL('https://facebook.github.io/react-vr/docs/getting-started.html')}
onEnter={() => this.setState({secondLink: styles.hover})}
onExit={() => this.setState({secondLink: styles.hyperlink})}> React VR Documentation</Text>
<Text style={styles.info}>.</Text>
</Text>
</View>
</View>
);
}
}; |
Navigator.js | xxsnakerxx/react-native-ya-navigator | import React from 'react';
import PropTypes from 'prop-types';
import NavBar from './NavBar';
import Scene from './Scene';
import { getNavigationDelegate, replaceInstanceEventedProps } from './utils';
import FBNavigator from './FBNavigator';
import {
StyleSheet,
Platform,
BackHandler,
ViewPropTypes,
} from 'react-native';
const VALID_EVENTED_PROPS = [
'onPress',
'onValueChange',
'onChange',
'onSelection',
'onChangeText',
'onBlur',
'onFocus',
'onSelectionChange',
'onSubmitEditing',
];
export default class YANavigator extends React.Component {
static getDerivedStateFromProps(nextProps) {
return {
shouldHandleAndroidBack: nextProps.shouldHandleAndroidBack,
};
}
constructor(props) {
super(props);
this.state = {
shouldHandleAndroidBack: props.shouldHandleAndroidBack,
}
this.navBarParts = {};
}
componentDidMount() {
const navigatorMethods = [
'getCurrentRoutes',
'jumpBack',
'jumpForward',
'jumpTo',
'push',
'pop',
'popN',
'replace',
'replaceAtIndex',
'replacePrevious',
'replacePreviousAndPop',
'resetTo',
'immediatelyResetRouteStack',
'popToRoute',
'popToTop',
];
navigatorMethods.forEach((method) => {
this[method] = this.fbNavigator[method];
})
this.fbNavigator.setShouldHandleAndroidBack = this.setShouldHandleAndroidBack.bind(this);
this.fbNavigator.forceUpdateNavBar = this.forceUpdateNavBar.bind(this);
this.fbNavigator.showNavBar = this.showNavBar.bind(this);
this.fbNavigator.hideNavBar = this.hideNavBar.bind(this);
this.fbNavigator.navBarParts = this.navBarParts;
if (Platform.OS === 'android') {
this._backPressSub = BackHandler.addEventListener('hardwareBackPress', () => {
if (!this.state.shouldHandleAndroidBack) return false;
const navState = this.fbNavigator.state;
const presentedComponent =
navState.routeStack[navState.presentedIndex].component;
const navigationDelegate = getNavigationDelegate(presentedComponent);
if (navigationDelegate && navigationDelegate.onAndroidBackPress) {
navigationDelegate.onAndroidBackPress(navigator);
return true;
} else if (navState.routeStack.length > 1) {
this.pop();
return true;
}
return false;
});
}
}
componentDidUpdate(prevProps) {
if (this.props.initialRoute.component !== prevProps.initialRoute.component) {
this.resetTo(this.props.initialRoute);
}
}
componentWillUnmount() {
if (Platform.OS === 'android') {
this._backPressSub.remove();
this._backPressSub = null;
}
this.fbNavigator.navBarParts = null;
}
setShouldHandleAndroidBack(should) {
this.setState({
shouldHandleAndroidBack: should,
});
}
forceUpdateNavBar() {
this.fbNavigator._navBar.forceUpdate();
}
showNavBar(args) {
this.fbNavigator._navBar.show(args);
}
hideNavBar(args) {
this.fbNavigator._navBar.hide(args);
}
_renderScene = (route, navigator) => {
let Component;
const { eachSceneProps } = this.props;
if (typeof route.component === 'object') {
Component = React.cloneElement(route.component, {
navigator,
...route.props,
...eachSceneProps,
});
} else if (typeof route.component === 'function') {
Component = (
<route.component
navigator={navigator}
{...route.props}
{...eachSceneProps}
/>
)
}
return Component;
};
_configureScene = (route) => {
const navigationDelegate = getNavigationDelegate(route.component);
return (navigationDelegate && navigationDelegate.sceneConfig) ||
this.props.defaultSceneConfig;
};
_renderNavigationBar = () => {
const {
initialRoute,
initialRouteStack,
navBarStyle,
navBarBackBtn,
navBarUnderlay,
useNavigationBar,
navBarFixedHeight,
navBarCrossPlatformUI,
customEventedProps,
eachSceneProps,
} = this.props;
if (!useNavigationBar) return null;
const eventedProps = VALID_EVENTED_PROPS.concat(customEventedProps);
const navigationDelegate = getNavigationDelegate(
(initialRoute && initialRoute.component) ||
(initialRouteStack && initialRouteStack.length &&
initialRouteStack[initialRouteStack.length - 1].component)
);
const isHiddenOnInit = navigationDelegate ?
navigationDelegate.navBarIsHidden :
false;
return (
<NavBar
isHiddenOnInit={isHiddenOnInit}
style={navBarStyle}
backIcon={navBarBackBtn.icon}
backIconWidth={navBarBackBtn.iconWidth}
underlay={navBarUnderlay}
fixedHeight={navBarFixedHeight}
crossPlatformUI={navBarCrossPlatformUI}
routeMapper={{
navBarBackgroundColor: (route) => {
let navBarBackgroundColor = '';
const navigationDelegate = getNavigationDelegate(route.component);
if (navigationDelegate &&
navigationDelegate.navBarBackgroundColor) {
navBarBackgroundColor =
navigationDelegate.navBarBackgroundColor;
}
return navBarBackgroundColor;
},
LeftPart: (route, navigator, index, state) => {
let LeftPart = null;
const navigationDelegate = getNavigationDelegate(route.component);
if (navigationDelegate &&
navigationDelegate.renderNavBarLeftPart) {
navigationDelegate._events = navigationDelegate._events || [];
LeftPart = navigationDelegate.renderNavBarLeftPart({...route.props, ...eachSceneProps});
if (!LeftPart) return null;
const ref = (ref) => this.navBarParts[`${navigationDelegate.id ||
`${navigator.state.presentedIndex + 1}_scene`}_rightPart`] = ref;
if (typeof LeftPart === 'object' && React.isValidElement(LeftPart)) {
const children =
React.Children.toArray(LeftPart.props.children).map((child) => {
const {reactElement, events} =
replaceInstanceEventedProps(
child,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
return reactElement
})
const {reactElement, events} =
replaceInstanceEventedProps(
LeftPart,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
LeftPart = reactElement;
LeftPart = React.cloneElement(LeftPart, {ref}, children)
} else if (typeof LeftPart === 'function') {
const props = {};
LeftPart.propTypes && eventedProps.forEach((validProp) => {
if (LeftPart.propTypes[validProp]) {
const event = `onNavBarLeftPart${validProp.replace(/^on/, '')}`
if (navigationDelegate._events.indexOf(event) < 0) {
navigationDelegate._events.push(event)
}
props[validProp] = (e) => navigator.navigationContext
.emit(event, {route, e});
}
});
LeftPart = <LeftPart ref={ref} {...props} />
}
} else {
if (index > 0) {
// tell navBar to render back button
const prevRoute = state.routeStack[index - 1];
const previousComponent = prevRoute.component;
const previousNavigationDelegate = getNavigationDelegate(previousComponent);
let backBtnText = '';
if (previousNavigationDelegate &&
typeof previousNavigationDelegate.backBtnText === 'string') {
backBtnText = previousNavigationDelegate.backBtnText;
}
const navigationDelegate = state.routeStack[index] &&
getNavigationDelegate(state.routeStack[index].component);
const backBtnConfig = {
isBackBtn: true,
text: backBtnText,
onPress: () => {
navigator.pop();
navigator.navigationContext.emit('onNavBarBackBtnPress', {route});
},
textStyle: navBarBackBtn.textStyle,
}
if (navigationDelegate) {
if (navigationDelegate.navBarBackBtnColor) {
backBtnConfig.textStyle.color =
navigationDelegate.navBarBackBtnColor;
}
if (navigationDelegate.overrideBackBtnPress) {
navigationDelegate._events = navigationDelegate._events || [];
const event = 'onNavBarBackBtnPress'
if (navigationDelegate._events.indexOf(event) < 0) {
navigationDelegate._events.push(event)
}
backBtnConfig.onPress = () => navigator.navigationContext
.emit(event, {route});
}
}
return backBtnConfig;
}
}
return LeftPart;
},
RightPart: (route, navigator) => {
let RightPart = null;
const navigationDelegate = getNavigationDelegate(route.component);
if (navigationDelegate &&
navigationDelegate.renderNavBarRightPart) {
navigationDelegate._events = navigationDelegate._events || [];
RightPart = navigationDelegate.renderNavBarRightPart({...route.props, ...eachSceneProps});
if (!RightPart) return null;
const ref = (ref) => this.navBarParts[`${navigationDelegate.id ||
`${navigator.state.presentedIndex + 1}_scene`}_rightPart`] = ref;
if (typeof RightPart === 'object' && React.isValidElement(RightPart)) {
const children =
React.Children.toArray(RightPart.props.children).map((child) => {
const {reactElement, events} =
replaceInstanceEventedProps(
child,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
return reactElement
})
const {reactElement, events} =
replaceInstanceEventedProps(
RightPart,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
RightPart = reactElement;
RightPart = React.cloneElement(RightPart, {ref}, children)
} else if (typeof RightPart === 'function') {
const props = {};
RightPart.propTypes && eventedProps.forEach((validProp) => {
if (RightPart.propTypes[validProp]) {
const event = `onNavBarRightPart${validProp.replace(/^on/, '')}`
if (navigationDelegate._events.indexOf(event) < 0) {
navigationDelegate._events.push(event)
}
props[validProp] = (e) => navigator.navigationContext
.emit(event, {route, e});
}
});
RightPart = <RightPart ref={ref} {...props} />
}
}
return RightPart;
},
Title: (route, navigator) => {
let Title = null;
const navigationDelegate = getNavigationDelegate(route.component);
if (navigationDelegate &&
navigationDelegate.renderTitle) {
navigationDelegate._events = navigationDelegate._events || [];
Title = navigationDelegate.renderTitle({...route.props, ...eachSceneProps});
if (!Title) return null;
const ref = (ref) => this.navBarParts[`${navigationDelegate.id ||
`${navigator.state.presentedIndex + 1}_scene`}_title`] = ref;
if (typeof Title === 'object' && React.isValidElement(Title)) {
const children =
React.Children.toArray(Title.props.children).map((child) => {
const {reactElement, events} =
replaceInstanceEventedProps(
child,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
return reactElement
})
const {reactElement, events} =
replaceInstanceEventedProps(
Title,
eventedProps,
navigationDelegate._events,
route,
navigator.navigationContext
)
navigationDelegate._events.concat(events.filter((event) => {
return navigationDelegate._events.indexOf(event) < 0;
}));
Title = reactElement;
Title = React.cloneElement(Title, {ref}, children)
} else if (typeof Title === 'function') {
const props = {};
Title.propTypes && eventedProps.forEach((validProp) => {
if (Title.propTypes[validProp]) {
const event = `onNavBarTitle${validProp.replace(/^on/, '')}`
if (navigationDelegate._events.indexOf(event) < 0) {
navigationDelegate._events.push(event)
}
props[validProp] = (e) => navigator.navigationContext
.emit(event, {route, e});
}
});
Title = <Title ref={ref} {...props} />
}
}
return Title;
},
}} />
)
}
_onWillFocus = (route) => {
const component = route.component;
const state = this.fbNavigator && this.fbNavigator.state;
if (state) {
setTimeout(() => {
const index = state.presentedIndex;
for (let i = state.routeStack.length - 1; i > index; i--) {
if (state.routeStack[i] &&
state.routeStack[i].props &&
state.routeStack[i].props.onSceneWillBlur) {
state.routeStack[i].props.onSceneWillBlur(
route.__navigatorRouteID !== undefined
);
}
}
}, 100);
}
const navBar = navigator && navigator._navBar;
const navigationDelegate = getNavigationDelegate(component);
if (navBar && navigationDelegate) {
navigationDelegate.navBarIsHidden ?
navBar.hide() :
navBar.show();
}
}
_setFBNavigatorRef = (ref) => this.fbNavigator = ref;
render() {
const {
initialRoute,
initialRouteStack,
defaultSceneConfig,
style,
sceneStyle,
} = this.props;
return (
<FBNavigator
ref={this._setFBNavigatorRef}
initialRoute={initialRoute}
initialRouteStack={initialRouteStack}
renderScene={this._renderScene}
configureScene={this._configureScene}
defaultSceneConfig={defaultSceneConfig}
navigationBar={this._renderNavigationBar()}
sceneStyle={sceneStyle}
onWillFocus={this._onWillFocus}
style={[
styles.navigator,
style,
]}
/>
)
}
static propTypes = {
initialRoute: FBNavigator.propTypes.initialRoute,
initialRouteStack: FBNavigator.propTypes.initialRouteStack,
defaultSceneConfig: PropTypes.object,
useNavigationBar: PropTypes.bool,
style: ViewPropTypes.style,
navBarStyle: ViewPropTypes.style,
navBarFixedHeight: PropTypes.number,
navBarUnderlay: PropTypes.object,
navBarBackBtn: PropTypes.shape({
icon: PropTypes.object,
iconWidth: PropTypes.number,
textStyle: PropTypes.object,
}),
navBarCrossPlatformUI: PropTypes.bool,
sceneStyle: PropTypes.object,
eachSceneProps: PropTypes.object,
shouldHandleAndroidBack: PropTypes.bool,
customEventedProps: PropTypes.arrayOf(PropTypes.string),
};
static defaultProps = {
defaultSceneConfig: Platform.OS === 'android' ?
FBNavigator.SceneConfigs.FadeAndroid :
FBNavigator.SceneConfigs.PushFromRight,
useNavigationBar: true,
shouldHandleAndroidBack: true,
navBarFixedHeight: 0,
navBarCrossPlatformUI: false,
navBarBackBtn: {
textStyle: null,
icon: null,
iconWidth: 0,
},
customEventedProps: [],
};
static navBarHeight = Scene.navBarHeight;
}
const styles = StyleSheet.create({
navigator: {
flex: 1,
backgroundColor: '#fff',
},
})
YANavigator.Scene = Scene;
YANavigator.FBNavigator = FBNavigator;
|
src/containers/__tests__/AppointmentFormScreen.spec.js | Dennitz/Timetable | // @flow
import React from 'react';
import { shallow } from 'enzyme';
import navigatorMock from '../../lib/navigatorMock';
import { AppointmentFormScreen } from '../AppointmentFormScreen';
const props = {
dispatch: jest.fn(),
navigator: navigatorMock,
onSubmit: jest.fn(),
};
describe('AppointmentFormScreen', () => {
it('renders an AppointmentForm correctly', () => {
const wrapper = shallow(<AppointmentFormScreen {...props} />);
expect(wrapper).toMatchSnapshot();
});
});
|
examples/CardReveal.js | react-materialize/react-materialize | import React from 'react';
import Card from '../src/Card';
import CardTitle from '../src/CardTitle';
import Icon from '../src/Icon';
export default
<Card header={<CardTitle reveal image={"img/office.jpg"} waves='light'/>}
title="Card Title"
reveal={<p>Here is some more information about this product that is only revealed once clicked on.</p>}>
<p><a href="#">This is a link</a></p>
</Card>;
|
webpack/move_to_foreman/components/common/Dialog/Dialog.js | jlsherrill/katello | import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, Icon } from 'patternfly-react';
const Dialog = (props) => {
const buttons = (props.buttons)
? props.buttons
: (
<Button
key="cancel"
bsStyle="default"
className="btn-cancel"
onClick={props.onCancel}
>
{props.cancelLabel}
</Button>
);
return (
<Modal show={props.show}>
<Modal.Header>
<Button
className="close"
onClick={props.onCancel}
aria-hidden="true"
aria-label={props.cancelLabel}
>
<Icon type="pf" name="close" />
</Button>
<Modal.Title>{props.title}</Modal.Title>
</Modal.Header>
<Modal.Body>
{/* eslint-disable react/no-danger */}
<p dangerouslySetInnerHTML={props.dangerouslySetInnerHTML}>
{props.message}
</p>
{/* eslint-enable react/no-danger */}
</Modal.Body>
<Modal.Footer>
{buttons}
</Modal.Footer>
</Modal>
);
};
Dialog.propTypes = {
show: PropTypes.bool.isRequired,
onCancel: PropTypes.func.isRequired,
message: PropTypes.string,
title: PropTypes.string.isRequired,
cancelLabel: PropTypes.string,
dangerouslySetInnerHTML: PropTypes.shape({}),
buttons: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
};
Dialog.defaultProps = {
cancelLabel: __('Ok'),
dangerouslySetInnerHTML: undefined,
message: undefined,
buttons: undefined,
};
export default Dialog;
|
src/pages/landingPage/schedule/index.js | sunway-official/acm-admin | import React from 'react';
import { Component } from 'react';
import { graphql, compose } from 'react-apollo';
import { queries } from '../helpers';
import * as moment from 'moment';
import { functions } from '../helpers';
import ScheduleForm from './scheduleForm';
import Footer from '../section/footer';
import Header from '../section/header';
import Loading from 'components/render/renderLoading';
class LandingPageSchedule extends Component {
constructor(props) {
super(props);
this.sortActivities = this.sortActivities.bind(this);
}
sortActivities(events) {
var i;
var j;
var temp;
for (i = 0; i < events.length; i++) {
for (j = i + 1; j < events.length; j++) {
if (moment(events[i].start).isAfter(events[j].start)) {
temp = events[i];
events[i] = events[j];
events[j] = temp;
}
}
}
}
render() {
const {
loading,
getActivitiesByConferenceID,
} = this.props.GET_ACTIVITIES_BY_CONFERENCE_ID_QUERY;
if (loading) return <Loading />;
const events = functions.getEvents(getActivitiesByConferenceID);
this.sortActivities(events);
return (
<div className="landingpage-body">
<div className="container">
<div className="cbp-af-header">
<Header conference_id={this.props.match.params.conference_id} />
</div>
<div className="main">
<ScheduleForm events={events} />
<Footer conference_id={this.props.match.params.conference_id} />
</div>
</div>
</div>
);
}
}
export default compose(
graphql(queries.GET_ACTIVITIES_BY_CONFERENCE_ID_QUERY, {
options: ownProps => ({
variables: { conference_id: ownProps.match.params.conference_id },
}),
name: 'GET_ACTIVITIES_BY_CONFERENCE_ID_QUERY',
}),
)(LandingPageSchedule);
|
ajax/libs/jquery.fancytree/2.6.0/jquery.fancytree.js | him2him2/cdnjs | /*!
* jquery.fancytree.js
* Dynamic tree view control, with support for lazy loading of branches.
* https://github.com/mar10/fancytree/
*
* Copyright (c) 2006-2014, Martin Wendt (http://wwWendt.de)
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.6.0
* @date 2014-11-29T08:33
*/
/** Core Fancytree module.
*/
// Start of local namespace
;(function($, window, document, undefined) {
"use strict";
// prevent duplicate loading
if ( $.ui && $.ui.fancytree ) {
$.ui.fancytree.warn("Fancytree: ignored duplicate include");
return;
}
/* *****************************************************************************
* Private functions and variables
*/
function _assert(cond, msg){
// TODO: see qunit.js extractStacktrace()
if(!cond){
msg = msg ? ": " + msg : "";
// consoleApply("assert", [!!cond, msg]);
$.error("Fancytree assertion failed" + msg);
}
}
_assert($.ui, "Fancytree requires jQuery UI (http://jqueryui.com)");
function consoleApply(method, args){
var i, s,
fn = window.console ? window.console[method] : null;
if(fn){
try{
fn.apply(window.console, args);
} catch(e) {
// IE 8?
s = "";
for( i=0; i<args.length; i++){
s += args[i];
}
fn(s);
}
}
}
/*Return true if x is a FancytreeNode.*/
function _isNode(x){
return !!(x.tree && x.statusNodeType !== undefined);
}
/** Return true if dotted version string is equal or higher than requested version.
*
* See http://jsfiddle.net/mar10/FjSAN/
*/
function isVersionAtLeast(dottedVersion, major, minor, patch){
var i, v, t,
verParts = $.map($.trim(dottedVersion).split("."), function(e){ return parseInt(e, 10); }),
testParts = $.map(Array.prototype.slice.call(arguments, 1), function(e){ return parseInt(e, 10); });
for( i = 0; i < testParts.length; i++ ){
v = verParts[i] || 0;
t = testParts[i] || 0;
if( v !== t ){
return ( v > t );
}
}
return true;
}
/** Return a wrapper that calls sub.methodName() and exposes
* this : tree
* this._local : tree.ext.EXTNAME
* this._super : base.methodName()
*/
function _makeVirtualFunction(methodName, tree, base, extension, extName){
// $.ui.fancytree.debug("_makeVirtualFunction", methodName, tree, base, extension, extName);
// if(rexTestSuper && !rexTestSuper.test(func)){
// // extension.methodName() doesn't call _super(), so no wrapper required
// return func;
// }
// Use an immediate function as closure
var proxy = (function(){
var prevFunc = tree[methodName], // org. tree method or prev. proxy
baseFunc = extension[methodName], //
_local = tree.ext[extName],
_super = function(){
return prevFunc.apply(tree, arguments);
};
// Return the wrapper function
return function(){
var prevLocal = tree._local,
prevSuper = tree._super;
try{
tree._local = _local;
tree._super = _super;
return baseFunc.apply(tree, arguments);
}finally{
tree._local = prevLocal;
tree._super = prevSuper;
}
};
})(); // end of Immediate Function
return proxy;
}
/**
* Subclass `base` by creating proxy functions
*/
function _subclassObject(tree, base, extension, extName){
// $.ui.fancytree.debug("_subclassObject", tree, base, extension, extName);
for(var attrName in extension){
if(typeof extension[attrName] === "function"){
if(typeof tree[attrName] === "function"){
// override existing method
tree[attrName] = _makeVirtualFunction(attrName, tree, base, extension, extName);
}else if(attrName.charAt(0) === "_"){
// Create private methods in tree.ext.EXTENSION namespace
tree.ext[extName][attrName] = _makeVirtualFunction(attrName, tree, base, extension, extName);
}else{
$.error("Could not override tree." + attrName + ". Use prefix '_' to create tree." + extName + "._" + attrName);
}
}else{
// Create member variables in tree.ext.EXTENSION namespace
if(attrName !== "options"){
tree.ext[extName][attrName] = extension[attrName];
}
}
}
}
function _getResolvedPromise(context, argArray){
if(context === undefined){
return $.Deferred(function(){this.resolve();}).promise();
}else{
return $.Deferred(function(){this.resolveWith(context, argArray);}).promise();
}
}
function _getRejectedPromise(context, argArray){
if(context === undefined){
return $.Deferred(function(){this.reject();}).promise();
}else{
return $.Deferred(function(){this.rejectWith(context, argArray);}).promise();
}
}
function _makeResolveFunc(deferred, context){
return function(){
deferred.resolveWith(context);
};
}
function _getElementDataAsDict($el){
// Evaluate 'data-NAME' attributes with special treatment for 'data-json'.
var d = $.extend({}, $el.data()),
json = d.json;
delete d.fancytree; // added to container by widget factory
if( json ) {
delete d.json;
// <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)
d = $.extend(d, json);
}
return d;
}
// TODO: use currying
function _makeNodeTitleMatcher(s){
s = s.toLowerCase();
return function(node){
return node.title.toLowerCase().indexOf(s) >= 0;
};
}
function _makeNodeTitleStartMatcher(s){
var reMatch = new RegExp("^" + s, "i");
return function(node){
return reMatch.test(node.title);
};
}
var i,
FT = null, // initialized below
ENTITY_MAP = {"&": "&", "<": "<", ">": ">", "\"": """, "'": "'", "/": "/"},
//boolean attributes that can be set with equivalent class names in the LI tags
CLASS_ATTRS = "active expanded focus folder hideCheckbox lazy selected unselectable".split(" "),
CLASS_ATTR_MAP = {},
// Top-level Fancytree node attributes, that can be set by dict
NODE_ATTRS = "expanded extraClasses folder hideCheckbox key lazy refKey selected title tooltip unselectable".split(" "),
NODE_ATTR_MAP = {},
// Attribute names that should NOT be added to node.data
NONE_NODE_DATA_MAP = {"active": true, "children": true, "data": true, "focus": true};
for(i=0; i<CLASS_ATTRS.length; i++){ CLASS_ATTR_MAP[CLASS_ATTRS[i]] = true; }
for(i=0; i<NODE_ATTRS.length; i++){ NODE_ATTR_MAP[NODE_ATTRS[i]] = true; }
/* *****************************************************************************
* FancytreeNode
*/
/**
* Creates a new FancytreeNode
*
* @class FancytreeNode
* @classdesc A FancytreeNode represents the hierarchical data model and operations.
*
* @param {FancytreeNode} parent
* @param {NodeData} obj
*
* @property {Fancytree} tree The tree instance
* @property {FancytreeNode} parent The parent node
* @property {string} key Node id (must be unique inside the tree)
* @property {string} title Display name (may contain HTML)
* @property {object} data Contains all extra data that was passed on node creation
* @property {FancytreeNode[] | null | undefined} children Array of child nodes.<br>
* For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array
* to define a node that has no children.
* @property {boolean} expanded Use isExpanded(), setExpanded() to access this property.
* @property {string} extraClasses Addtional CSS classes, added to the node's `<span>`
* @property {boolean} folder Folder nodes have different default icons and click behavior.<br>
* Note: Also non-folders may have children.
* @property {string} statusNodeType null or type of temporarily generated system node like 'loading', or 'error'.
* @property {boolean} lazy True if this node is loaded on demand, i.e. on first expansion.
* @property {boolean} selected Use isSelected(), setSelected() to access this property.
* @property {string} tooltip Alternative description used as hover banner
*/
function FancytreeNode(parent, obj){
var i, l, name, cl;
this.parent = parent;
this.tree = parent.tree;
this.ul = null;
this.li = null; // <li id='key' ftnode=this> tag
this.statusNodeType = null; // if this is a temp. node to display the status of its parent
this._isLoading = false; // if this node itself is loading
this._error = null; // {message: '...'} if a load error occured
this.data = {};
// TODO: merge this code with node.toDict()
// copy attributes from obj object
for(i=0, l=NODE_ATTRS.length; i<l; i++){
name = NODE_ATTRS[i];
this[name] = obj[name];
}
// node.data += obj.data
if(obj.data){
$.extend(this.data, obj.data);
}
// copy all other attributes to this.data.NAME
for(name in obj){
if(!NODE_ATTR_MAP[name] && !$.isFunction(obj[name]) && !NONE_NODE_DATA_MAP[name]){
// node.data.NAME = obj.NAME
this.data[name] = obj[name];
}
}
// Fix missing key
if( this.key == null ){ // test for null OR undefined
if( this.tree.options.defaultKey ) {
this.key = this.tree.options.defaultKey(this);
_assert(this.key, "defaultKey() must return a unique key");
} else {
this.key = "_" + (FT._nextNodeKey++);
}
} else {
this.key = "" + this.key; // Convert to string (#217)
}
// Fix tree.activeNode
// TODO: not elegant: we use obj.active as marker to set tree.activeNode
// when loading from a dictionary.
if(obj.active){
_assert(this.tree.activeNode === null, "only one active node allowed");
this.tree.activeNode = this;
}
if( obj.selected ){ // #186
this.tree.lastSelectedNode = this;
}
// TODO: handle obj.focus = true
// Create child nodes
this.children = null;
cl = obj.children;
if(cl && cl.length){
this._setChildren(cl);
}
// Add to key/ref map (except for root node)
// if( parent ) {
this.tree._callHook("treeRegisterNode", this.tree, true, this);
// }
}
FancytreeNode.prototype = /** @lends FancytreeNode# */{
/* Return the direct child FancytreeNode with a given key, index. */
_findDirectChild: function(ptr){
var i, l,
cl = this.children;
if(cl){
if(typeof ptr === "string"){
for(i=0, l=cl.length; i<l; i++){
if(cl[i].key === ptr){
return cl[i];
}
}
}else if(typeof ptr === "number"){
return this.children[ptr];
}else if(ptr.parent === this){
return ptr;
}
}
return null;
},
// TODO: activate()
// TODO: activateSilently()
/* Internal helper called in recursive addChildren sequence.*/
_setChildren: function(children){
_assert(children && (!this.children || this.children.length === 0), "only init supported");
this.children = [];
for(var i=0, l=children.length; i<l; i++){
this.children.push(new FancytreeNode(this, children[i]));
}
},
/**
* Append (or insert) a list of child nodes.
*
* @param {NodeData[]} children array of child node definitions (also single child accepted)
* @param {FancytreeNode | string | Integer} [insertBefore] child node (or key or index of such).
* If omitted, the new children are appended.
* @returns {FancytreeNode} first child added
*
* @see FancytreeNode#applyPatch
*/
addChildren: function(children, insertBefore){
var i, l, pos,
firstNode = null,
nodeList = [];
if($.isPlainObject(children) ){
children = [children];
}
if(!this.children){
this.children = [];
}
for(i=0, l=children.length; i<l; i++){
nodeList.push(new FancytreeNode(this, children[i]));
}
firstNode = nodeList[0];
if(insertBefore == null){
this.children = this.children.concat(nodeList);
}else{
insertBefore = this._findDirectChild(insertBefore);
pos = $.inArray(insertBefore, this.children);
_assert(pos >= 0, "insertBefore must be an existing child");
// insert nodeList after children[pos]
this.children.splice.apply(this.children, [pos, 0].concat(nodeList));
}
if( !this.parent || this.parent.ul || this.tr ){
// render if the parent was rendered (or this is a root node)
this.render();
}
if( this.tree.options.selectMode === 3 ){
this.fixSelection3FromEndNodes();
}
return firstNode;
},
/**
* Append or prepend a node, or append a child node.
*
* This a convenience function that calls addChildren()
*
* @param {NodeData} node node definition
* @param {string} [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child')
* @returns {FancytreeNode} new node
*/
addNode: function(node, mode){
if(mode === undefined || mode === "over"){
mode = "child";
}
switch(mode){
case "after":
return this.getParent().addChildren(node, this.getNextSibling());
case "before":
return this.getParent().addChildren(node, this);
case "firstChild":
// Insert before the first child if any
var insertBefore = (this.children ? this.children[0] : null);
return this.addChildren(node, insertBefore);
case "child":
case "over":
return this.addChildren(node);
}
_assert(false, "Invalid mode: " + mode);
},
/**
* Append new node after this.
*
* This a convenience function that calls addNode(node, 'after')
*
* @param {NodeData} node node definition
* @returns {FancytreeNode} new node
*/
appendSibling: function(node){
return this.addNode(node, "after");
},
/**
* Modify existing child nodes.
*
* @param {NodePatch} patch
* @returns {$.Promise}
* @see FancytreeNode#addChildren
*/
applyPatch: function(patch) {
// patch [key, null] means 'remove'
if(patch === null){
this.remove();
return _getResolvedPromise(this);
}
// TODO: make sure that root node is not collapsed or modified
// copy (most) attributes to node.ATTR or node.data.ATTR
var name, promise, v,
IGNORE_MAP = { children: true, expanded: true, parent: true }; // TODO: should be global
for(name in patch){
v = patch[name];
if( !IGNORE_MAP[name] && !$.isFunction(v)){
if(NODE_ATTR_MAP[name]){
this[name] = v;
}else{
this.data[name] = v;
}
}
}
// Remove and/or create children
if(patch.hasOwnProperty("children")){
this.removeChildren();
if(patch.children){ // only if not null and not empty list
// TODO: addChildren instead?
this._setChildren(patch.children);
}
// TODO: how can we APPEND or INSERT child nodes?
}
if(this.isVisible()){
this.renderTitle();
this.renderStatus();
}
// Expand collapse (final step, since this may be async)
if(patch.hasOwnProperty("expanded")){
promise = this.setExpanded(patch.expanded);
}else{
promise = _getResolvedPromise(this);
}
return promise;
},
/** Collapse all sibling nodes.
* @returns {$.Promise}
*/
collapseSiblings: function() {
return this.tree._callHook("nodeCollapseSiblings", this);
},
/** Copy this node as sibling or child of `node`.
*
* @param {FancytreeNode} node source node
* @param {string} [mode=child] 'before' | 'after' | 'child'
* @param {Function} [map] callback function(NodeData) that could modify the new node
* @returns {FancytreeNode} new
*/
copyTo: function(node, mode, map) {
return node.addNode(this.toDict(true, map), mode);
},
/** Count direct and indirect children.
*
* @param {boolean} [deep=true] pass 'false' to only count direct children
* @returns {int} number of child nodes
*/
countChildren: function(deep) {
var cl = this.children, i, l, n;
if( !cl ){
return 0;
}
n = cl.length;
if(deep !== false){
for(i=0, l=n; i<l; i++){
n += cl[i].countChildren();
}
}
return n;
},
// TODO: deactivate()
/** Write to browser console if debugLevel >= 2 (prepending node info)
*
* @param {*} msg string or object or array of such
*/
debug: function(msg){
if( this.tree.options.debugLevel >= 2 ) {
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("log", arguments);
}
},
/** Deprecated.
* @deprecated since 2014-02-16. Use resetLazy() instead.
*/
discard: function(){
this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead.");
return this.resetLazy();
},
// TODO: expand(flag)
/**Find all nodes that contain `match` in the title.
*
* @param {string | function(node)} match string to search for, of a function that
* returns `true` if a node is matched.
* @returns {FancytreeNode[]} array of nodes (may be empty)
* @see FancytreeNode#findAll
*/
findAll: function(match) {
match = $.isFunction(match) ? match : _makeNodeTitleMatcher(match);
var res = [];
this.visit(function(n){
if(match(n)){
res.push(n);
}
});
return res;
},
/**Find first node that contains `match` in the title (not including self).
*
* @param {string | function(node)} match string to search for, of a function that
* returns `true` if a node is matched.
* @returns {FancytreeNode} matching node or null
* @example
* <b>fat</b> text
*/
findFirst: function(match) {
match = $.isFunction(match) ? match : _makeNodeTitleMatcher(match);
var res = null;
this.visit(function(n){
if(match(n)){
res = n;
return false;
}
});
return res;
},
/* Apply selection state (internal use only) */
_changeSelectStatusAttrs: function (state) {
var changed = false;
switch(state){
case false:
changed = ( this.selected || this.partsel );
this.selected = false;
this.partsel = false;
break;
case true:
changed = ( !this.selected || !this.partsel );
this.selected = true;
this.partsel = true;
break;
case undefined:
changed = ( this.selected || !this.partsel );
this.selected = false;
this.partsel = true;
break;
default:
_assert(false, "invalid state: " + state);
}
// this.debug("fixSelection3AfterLoad() _changeSelectStatusAttrs()", state, changed);
if( changed ){
this.renderStatus();
}
return changed;
},
/**
* Fix selection status, after this node was (de)selected in multi-hier mode.
* This includes (de)selecting all children.
*/
fixSelection3AfterClick: function() {
var flag = this.isSelected();
// this.debug("fixSelection3AfterClick()");
this.visit(function(node){
node._changeSelectStatusAttrs(flag);
});
this.fixSelection3FromEndNodes();
},
/**
* Fix selection status for multi-hier mode.
* Only end-nodes are considered to update the descendants branch and parents.
* Should be called after this node has loaded new children or after
* children have been modified using the API.
*/
fixSelection3FromEndNodes: function() {
// this.debug("fixSelection3FromEndNodes()");
_assert(this.tree.options.selectMode === 3, "expected selectMode 3");
// Visit all end nodes and adjust their parent's `selected` and `partsel`
// attributes. Return selection state true, false, or undefined.
function _walk(node){
var i, l, child, s, state, allSelected,someSelected,
children = node.children;
if( children && children.length ){
// check all children recursively
allSelected = true;
someSelected = false;
for( i=0, l=children.length; i<l; i++ ){
child = children[i];
// the selection state of a node is not relevant; we need the end-nodes
s = _walk(child);
if( s !== false ) {
someSelected = true;
}
if( s !== true ) {
allSelected = false;
}
}
state = allSelected ? true : (someSelected ? undefined : false);
}else{
// This is an end-node: simply report the status
// state = ( node.unselectable ) ? undefined : !!node.selected;
state = !!node.selected;
}
node._changeSelectStatusAttrs(state);
return state;
}
_walk(this);
// Update parent's state
this.visitParents(function(node){
var i, l, child, state,
children = node.children,
allSelected = true,
someSelected = false;
for( i=0, l=children.length; i<l; i++ ){
child = children[i];
// When fixing the parents, we trust the sibling status (i.e.
// we don't recurse)
if( child.selected || child.partsel ) {
someSelected = true;
}
if( !child.unselectable && !child.selected ) {
allSelected = false;
}
}
state = allSelected ? true : (someSelected ? undefined : false);
node._changeSelectStatusAttrs(state);
});
},
// TODO: focus()
/**
* Update node data. If dict contains 'children', then also replace
* the hole sub tree.
* @param {NodeData} dict
*
* @see FancytreeNode#addChildren
* @see FancytreeNode#applyPatch
*/
fromDict: function(dict) {
// copy all other attributes to this.data.xxx
for(var name in dict){
if(NODE_ATTR_MAP[name]){
// node.NAME = dict.NAME
this[name] = dict[name];
}else if(name === "data"){
// node.data += dict.data
$.extend(this.data, dict.data);
}else if(!$.isFunction(dict[name]) && !NONE_NODE_DATA_MAP[name]){
// node.data.NAME = dict.NAME
this.data[name] = dict[name];
}
}
if(dict.children){
// recursively set children and render
this.removeChildren();
this.addChildren(dict.children);
}
this.renderTitle();
/*
var children = dict.children;
if(children === undefined){
this.data = $.extend(this.data, dict);
this.render();
return;
}
dict = $.extend({}, dict);
dict.children = undefined;
this.data = $.extend(this.data, dict);
this.removeChildren();
this.addChild(children);
*/
},
/** Return the list of child nodes (undefined for unexpanded lazy nodes).
* @returns {FancytreeNode[] | undefined}
*/
getChildren: function() {
if(this.hasChildren() === undefined){ // TODO: only required for lazy nodes?
return undefined; // Lazy node: unloaded, currently loading, or load error
}
return this.children;
},
/** Return the first child node or null.
* @returns {FancytreeNode | null}
*/
getFirstChild: function() {
return this.children ? this.children[0] : null;
},
/** Return the 0-based child index.
* @returns {int}
*/
getIndex: function() {
// return this.parent.children.indexOf(this);
return $.inArray(this, this.parent.children); // indexOf doesn't work in IE7
},
/** Return the hierarchical child index (1-based, e.g. '3.2.4').
* @returns {string}
*/
getIndexHier: function(separator) {
separator = separator || ".";
var res = [];
$.each(this.getParentList(false, true), function(i, o){
res.push(o.getIndex() + 1);
});
return res.join(separator);
},
/** Return the parent keys separated by options.keyPathSeparator, e.g. "id_1/id_17/id_32".
* @param {boolean} [excludeSelf=false]
* @returns {string}
*/
getKeyPath: function(excludeSelf) {
var path = [],
sep = this.tree.options.keyPathSeparator;
this.visitParents(function(n){
if(n.parent){
path.unshift(n.key);
}
}, !excludeSelf);
return sep + path.join(sep);
},
/** Return the last child of this node or null.
* @returns {FancytreeNode | null}
*/
getLastChild: function() {
return this.children ? this.children[this.children.length - 1] : null;
},
/** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .
* @returns {int}
*/
getLevel: function() {
var level = 0,
dtn = this.parent;
while( dtn ) {
level++;
dtn = dtn.parent;
}
return level;
},
/** Return the successor node (under the same parent) or null.
* @returns {FancytreeNode | null}
*/
getNextSibling: function() {
// TODO: use indexOf, if available: (not in IE6)
if( this.parent ){
var i, l,
ac = this.parent.children;
for(i=0, l=ac.length-1; i<l; i++){ // up to length-2, so next(last) = null
if( ac[i] === this ){
return ac[i+1];
}
}
}
return null;
},
/** Return the parent node (null for the system root node).
* @returns {FancytreeNode | null}
*/
getParent: function() {
// TODO: return null for top-level nodes?
return this.parent;
},
/** Return an array of all parent nodes (top-down).
* @param {boolean} [includeRoot=false] Include the invisible system root node.
* @param {boolean} [includeSelf=false] Include the node itself.
* @returns {FancytreeNode[]}
*/
getParentList: function(includeRoot, includeSelf) {
var l = [],
dtn = includeSelf ? this : this.parent;
while( dtn ) {
if( includeRoot || dtn.parent ){
l.unshift(dtn);
}
dtn = dtn.parent;
}
return l;
},
/** Return the predecessor node (under the same parent) or null.
* @returns {FancytreeNode | null}
*/
getPrevSibling: function() {
if( this.parent ){
var i, l,
ac = this.parent.children;
for(i=1, l=ac.length; i<l; i++){ // start with 1, so prev(first) = null
if( ac[i] === this ){
return ac[i-1];
}
}
}
return null;
},
/** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded).
* @returns {boolean | undefined}
*/
hasChildren: function() {
if(this.lazy){
if(this.children == null ){
// null or undefined: Not yet loaded
return undefined;
}else if(this.children.length === 0){
// Loaded, but response was empty
return false;
}else if(this.children.length === 1 && this.children[0].isStatusNode() ){
// Currently loading or load error
return undefined;
}
return true;
}
return !!( this.children && this.children.length );
},
/** Return true if node has keyboard focus.
* @returns {boolean}
*/
hasFocus: function() {
return (this.tree.hasFocus() && this.tree.focusNode === this);
},
/** Write to browser console if debugLevel >= 1 (prepending node info)
*
* @param {*} msg string or object or array of such
*/
info: function(msg){
if( this.tree.options.debugLevel >= 1 ) {
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("info", arguments);
}
},
/** Return true if node is active (see also FancytreeNode#isSelected).
* @returns {boolean}
*/
isActive: function() {
return (this.tree.activeNode === this);
},
/** Return true if node is a direct child of otherNode.
* @param {FancytreeNode} otherNode
* @returns {boolean}
*/
isChildOf: function(otherNode) {
return (this.parent && this.parent === otherNode);
},
/** Return true, if node is a direct or indirect sub node of otherNode.
* @param {FancytreeNode} otherNode
* @returns {boolean}
*/
isDescendantOf: function(otherNode) {
if(!otherNode || otherNode.tree !== this.tree){
return false;
}
var p = this.parent;
while( p ) {
if( p === otherNode ){
return true;
}
p = p.parent;
}
return false;
},
/** Return true if node is expanded.
* @returns {boolean}
*/
isExpanded: function() {
return !!this.expanded;
},
/** Return true if node is the first node of its parent's children.
* @returns {boolean}
*/
isFirstSibling: function() {
var p = this.parent;
return !p || p.children[0] === this;
},
/** Return true if node is a folder, i.e. has the node.folder attribute set.
* @returns {boolean}
*/
isFolder: function() {
return !!this.folder;
},
/** Return true if node is the last node of its parent's children.
* @returns {boolean}
*/
isLastSibling: function() {
var p = this.parent;
return !p || p.children[p.children.length-1] === this;
},
/** Return true if node is lazy (even if data was already loaded)
* @returns {boolean}
*/
isLazy: function() {
return !!this.lazy;
},
/** Return true if node is lazy and loaded. For non-lazy nodes always return true.
* @returns {boolean}
*/
isLoaded: function() {
return !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node
},
/** Return true if children are currently beeing loaded, i.e. a Ajax request is pending.
* @returns {boolean}
*/
isLoading: function() {
return !!this._isLoading;
},
/**
* @deprecated since v2.4.0: Use isRootNode() instead
*/
isRoot: function() {
return this.isRootNode();
},
/** Return true if this is the (invisible) system root node.
* @returns {boolean}
*/
isRootNode: function() {
return (this.tree.rootNode === this);
},
/** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive).
* @returns {boolean}
*/
isSelected: function() {
return !!this.selected;
},
/** Return true if this node is a temporarily generated system node like
* 'loading', or 'error' (node.statusNodeType contains the type).
* @returns {boolean}
*/
isStatusNode: function() {
return !!this.statusNodeType;
},
/** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.
* @returns {boolean}
*/
isTopLevel: function() {
return (this.tree.rootNode === this.parent);
},
/** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.
* @returns {boolean}
*/
isUndefined: function() {
return this.hasChildren() === undefined; // also checks if the only child is a status node
},
/** Return true if all parent nodes are expanded. Note: this does not check
* whether the node is scrolled into the visible part of the screen.
* @returns {boolean}
*/
isVisible: function() {
var i, l,
parents = this.getParentList(false, false);
for(i=0, l=parents.length; i<l; i++){
if( ! parents[i].expanded ){ return false; }
}
return true;
},
/** Deprecated.
* @deprecated since 2014-02-16: use load() instead.
*/
lazyLoad: function(discard) {
this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.");
return this.load(discard);
},
/**
* Load all children of a lazy node if neccessary. The *expanded* state is maintained.
* @param {boolean} [forceReload=false] Pass true to discard any existing nodes before.
* @returns {$.Promise}
*/
load: function(forceReload) {
var res, source,
that = this;
_assert( this.isLazy(), "load() requires a lazy node" );
// _assert( forceReload || this.isUndefined(), "Pass forceReload=true to re-load a lazy node" );
if( !forceReload && !this.isUndefined() ) {
return _getResolvedPromise(this);
}
if( this.isLoaded() ){
this.resetLazy(); // also collapses
}
// This method is also called by setExpanded() and loadKeyPath(), so we
// have to avoid recursion.
source = this.tree._triggerNodeEvent("lazyLoad", this);
if( source === false ) { // #69
return _getResolvedPromise(this);
}
_assert(typeof source !== "boolean", "lazyLoad event must return source in data.result");
res = this.tree._callHook("nodeLoadChildren", this, source);
if( this.expanded ) {
res.always(function(){
that.render();
});
}
return res;
},
/** Expand all parents and optionally scroll into visible area as neccessary.
* Promise is resolved, when lazy loading and animations are done.
* @param {object} [opts] passed to `setExpanded()`.
* Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true}
* @returns {$.Promise}
*/
makeVisible: function(opts) {
var i,
that = this,
deferreds = [],
dfd = new $.Deferred(),
parents = this.getParentList(false, false),
len = parents.length,
effects = !(opts && opts.noAnimation === true),
scroll = !(opts && opts.scrollIntoView === false);
// Expand bottom-up, so only the top node is animated
for(i = len - 1; i >= 0; i--){
// that.debug("pushexpand" + parents[i]);
deferreds.push(parents[i].setExpanded(true, opts));
}
$.when.apply($, deferreds).done(function(){
// All expands have finished
// that.debug("expand DONE", scroll);
if( scroll ){
that.scrollIntoView(effects).done(function(){
// that.debug("scroll DONE");
dfd.resolve();
});
} else {
dfd.resolve();
}
});
return dfd.promise();
},
/** Move this node to targetNode.
* @param {FancytreeNode} targetNode
* @param {string} mode <pre>
* 'child': append this node as last child of targetNode.
* This is the default. To be compatble with the D'n'd
* hitMode, we also accept 'over'.
* 'before': add this node as sibling before targetNode.
* 'after': add this node as sibling after targetNode.</pre>
* @param {function} [map] optional callback(FancytreeNode) to allow modifcations
*/
moveTo: function(targetNode, mode, map) {
if(mode === undefined || mode === "over"){
mode = "child";
}
var pos,
prevParent = this.parent,
targetParent = (mode === "child") ? targetNode : targetNode.parent;
if(this === targetNode){
return;
}else if( !this.parent ){
throw "Cannot move system root";
}else if( targetParent.isDescendantOf(this) ){
throw "Cannot move a node to its own descendant";
}
// Unlink this node from current parent
if( this.parent.children.length === 1 ) {
if( this.parent === targetParent ){
return; // #258
}
this.parent.children = this.parent.lazy ? [] : null;
this.parent.expanded = false;
} else {
pos = $.inArray(this, this.parent.children);
_assert(pos >= 0);
this.parent.children.splice(pos, 1);
}
// Remove from source DOM parent
// if(this.parent.ul){
// this.parent.ul.removeChild(this.li);
// }
// Insert this node to target parent's child list
this.parent = targetParent;
if( targetParent.hasChildren() ) {
switch(mode) {
case "child":
// Append to existing target children
targetParent.children.push(this);
break;
case "before":
// Insert this node before target node
pos = $.inArray(targetNode, targetParent.children);
_assert(pos >= 0);
targetParent.children.splice(pos, 0, this);
break;
case "after":
// Insert this node after target node
pos = $.inArray(targetNode, targetParent.children);
_assert(pos >= 0);
targetParent.children.splice(pos+1, 0, this);
break;
default:
throw "Invalid mode " + mode;
}
} else {
targetParent.children = [ this ];
}
// Parent has no <ul> tag yet:
// if( !targetParent.ul ) {
// // This is the parent's first child: create UL tag
// // (Hidden, because it will be
// targetParent.ul = document.createElement("ul");
// targetParent.ul.style.display = "none";
// targetParent.li.appendChild(targetParent.ul);
// }
// // Issue 319: Add to target DOM parent (only if node was already rendered(expanded))
// if(this.li){
// targetParent.ul.appendChild(this.li);
// }^
// Let caller modify the nodes
if( map ){
targetNode.visit(map, true);
}
// Handle cross-tree moves
if( this.tree !== targetNode.tree ) {
// Fix node.tree for all source nodes
// _assert(false, "Cross-tree move is not yet implemented.");
this.warn("Cross-tree moveTo is experimantal!");
this.visit(function(n){
// TODO: fix selection state and activation, ...
n.tree = targetNode.tree;
}, true);
}
// A collaposed node won't re-render children, so we have to remove it manually
// if( !targetParent.expanded ){
// prevParent.ul.removeChild(this.li);
// }
// Update HTML markup
if( !prevParent.isDescendantOf(targetParent)) {
prevParent.render();
}
if( !targetParent.isDescendantOf(prevParent) && targetParent !== prevParent) {
targetParent.render();
}
// TODO: fix selection state
// TODO: fix active state
/*
var tree = this.tree;
var opts = tree.options;
var pers = tree.persistence;
// Always expand, if it's below minExpandLevel
// tree.logDebug ("%s._addChildNode(%o), l=%o", this, ftnode, ftnode.getLevel());
if ( opts.minExpandLevel >= ftnode.getLevel() ) {
// tree.logDebug ("Force expand for %o", ftnode);
this.bExpanded = true;
}
// In multi-hier mode, update the parents selection state
// DT issue #82: only if not initializing, because the children may not exist yet
// if( !ftnode.data.isStatusNode() && opts.selectMode==3 && !isInitializing )
// ftnode._fixSelectionState();
// In multi-hier mode, update the parents selection state
if( ftnode.bSelected && opts.selectMode==3 ) {
var p = this;
while( p ) {
if( !p.hasSubSel )
p._setSubSel(true);
p = p.parent;
}
}
// render this node and the new child
if ( tree.bEnableUpdate )
this.render();
return ftnode;
*/
},
/** Set focus relative to this node and optionally activate.
*
* @param {number} where The keyCode that would normally trigger this move,
* e.g. `$.ui.keyCode.LEFT` would collapse the node if it
* is expanded or move to the parent oterwise.
* @param {boolean} [activate=true]
* @returns {$.Promise}
*/
// navigate: function(where, activate) {
// console.time("navigate")
// this._navigate(where, activate)
// console.timeEnd("navigate")
// },
navigate: function(where, activate) {
var i, parents,
handled = true,
KC = $.ui.keyCode,
sib = null;
// Navigate to node
function _goto(n){
if( n ){
try { n.makeVisible(); } catch(e) {} // #272
// Node may still be hidden by a filter
if( ! $(n.span).is(":visible") ) {
n.debug("Navigate: skipping hidden node");
n.navigate(where, activate);
return;
}
return activate === false ? n.setFocus() : n.setActive();
}
}
switch( where ) {
case KC.BACKSPACE:
if( this.parent && this.parent.parent ) {
_goto(this.parent);
}
break;
case KC.LEFT:
if( this.expanded ) {
this.setExpanded(false);
_goto(this);
} else if( this.parent && this.parent.parent ) {
_goto(this.parent);
}
break;
case KC.RIGHT:
if( !this.expanded && (this.children || this.lazy) ) {
this.setExpanded();
_goto(this);
} else if( this.children && this.children.length ) {
_goto(this.children[0]);
}
break;
case KC.UP:
sib = this.getPrevSibling();
// #359: skip hidden sibling nodes, preventing a _goto() recursion
while( sib && !$(sib.span).is(":visible") ) {
sib = sib.getPrevSibling();
}
while( sib && sib.expanded && sib.children && sib.children.length ) {
sib = sib.children[sib.children.length - 1];
}
if( !sib && this.parent && this.parent.parent ){
sib = this.parent;
}
_goto(sib);
break;
case KC.DOWN:
if( this.expanded && this.children && this.children.length ) {
sib = this.children[0];
} else {
parents = this.getParentList(false, true);
for(i=parents.length-1; i>=0; i--) {
sib = parents[i].getNextSibling();
// #359: skip hidden sibling nodes, preventing a _goto() recursion
while( sib && !$(sib.span).is(":visible") ) {
sib = sib.getNextSibling();
}
if( sib ){ break; }
}
}
_goto(sib);
break;
default:
handled = false;
}
},
/**
* Remove this node (not allowed for system root).
*/
remove: function() {
return this.parent.removeChild(this);
},
/**
* Remove childNode from list of direct children.
* @param {FancytreeNode} childNode
*/
removeChild: function(childNode) {
return this.tree._callHook("nodeRemoveChild", this, childNode);
},
/**
* Remove all child nodes and descendents. This converts the node into a leaf.<br>
* If this was a lazy node, it is still considered 'loaded'; call node.resetLazy()
* in order to trigger lazyLoad on next expand.
*/
removeChildren: function() {
return this.tree._callHook("nodeRemoveChildren", this);
},
/**
* This method renders and updates all HTML markup that is required
* to display this node in its current state.<br>
* Note:
* <ul>
* <li>It should only be neccessary to call this method after the node object
* was modified by direct access to its properties, because the common
* API methods (node.setTitle(), moveTo(), addChildren(), remove(), ...)
* already handle this.
* <li> {@link FancytreeNode#renderTitle} and {@link FancytreeNode#renderStatus}
* are implied. If changes are more local, calling only renderTitle() or
* renderStatus() may be sufficient and faster.
* <li>If a node was created/removed, node.render() must be called <i>on the parent</i>.
* </ul>
*
* @param {boolean} [force=false] re-render, even if html markup was already created
* @param {boolean} [deep=false] also render all descendants, even if parent is collapsed
*/
render: function(force, deep) {
return this.tree._callHook("nodeRender", this, force, deep);
},
/** Create HTML markup for the node's outer <span> (expander, checkbox, icon, and title).
* @see Fancytree_Hooks#nodeRenderTitle
*/
renderTitle: function() {
return this.tree._callHook("nodeRenderTitle", this);
},
/** Update element's CSS classes according to node state.
* @see Fancytree_Hooks#nodeRenderStatus
*/
renderStatus: function() {
return this.tree._callHook("nodeRenderStatus", this);
},
/**
* Remove all children, collapse, and set the lazy-flag, so that the lazyLoad
* event is triggered on next expand.
*/
resetLazy: function() {
this.removeChildren();
this.expanded = false;
this.lazy = true;
this.children = undefined;
this.renderStatus();
},
/** Schedule activity for delayed execution (cancel any pending request).
* scheduleAction('cancel') will only cancel a pending request (if any).
* @param {string} mode
* @param {number} ms
*/
scheduleAction: function(mode, ms) {
if( this.tree.timer ) {
clearTimeout(this.tree.timer);
// this.tree.debug("clearTimeout(%o)", this.tree.timer);
}
this.tree.timer = null;
var self = this; // required for closures
switch (mode) {
case "cancel":
// Simply made sure that timer was cleared
break;
case "expand":
this.tree.timer = setTimeout(function(){
self.tree.debug("setTimeout: trigger expand");
self.setExpanded(true);
}, ms);
break;
case "activate":
this.tree.timer = setTimeout(function(){
self.tree.debug("setTimeout: trigger activate");
self.setActive(true);
}, ms);
break;
default:
throw "Invalid mode " + mode;
}
// this.tree.debug("setTimeout(%s, %s): %s", mode, ms, this.tree.timer);
},
/**
*
* @param {boolean | PlainObject} [effects=false] animation options.
* @param {object} [options=null] {topNode: null, effects: ..., parent: ...} this node will remain visible in
* any case, even if `this` is outside the scroll pane.
* @returns {$.Promise}
*/
scrollIntoView: function(effects, options) {
if( options !== undefined && _isNode(options) ) {
this.warn("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");
options = {topNode: options};
}
// this.$scrollParent = (this.options.scrollParent === "auto") ? $ul.scrollParent() : $(this.options.scrollParent);
// this.$scrollParent = this.$scrollParent.length ? this.$scrollParent || this.$container;
var topNodeY, nodeY, horzScrollbarHeight, containerOffsetTop,
opts = $.extend({
effects: (effects === true) ? {duration: 200, queue: false} : effects,
scrollOfs: this.tree.options.scrollOfs,
scrollParent: this.tree.options.scrollParent || this.tree.$container,
topNode: null
}, options),
dfd = new $.Deferred(),
that = this,
nodeHeight = $(this.span).height(),
$container = $(opts.scrollParent),
topOfs = opts.scrollOfs.top || 0,
bottomOfs = opts.scrollOfs.bottom || 0,
containerHeight = $container.height(),// - topOfs - bottomOfs,
scrollTop = $container.scrollTop(),
$animateTarget = $container,
isParentWindow = $container[0] === window,
topNode = opts.topNode || null,
newScrollTop = null;
// this.debug("scrollIntoView(), scrollTop=", scrollTop, opts.scrollOfs);
_assert($(this.span).is(":visible"), "scrollIntoView node is invisible"); // otherwise we cannot calc offsets
if( isParentWindow ) {
nodeY = $(this.span).offset().top;
topNodeY = (topNode && topNode.span) ? $(topNode.span).offset().top : 0;
$animateTarget = $("html,body");
} else {
_assert($container[0] !== document && $container[0] !== document.body, "scrollParent should be an simple element or `window`, not document or body.");
containerOffsetTop = $container.offset().top,
nodeY = $(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent
topNodeY = topNode ? $(topNode.span).offset().top - containerOffsetTop + scrollTop : 0;
horzScrollbarHeight = Math.max(0, ($container.innerHeight() - $container[0].clientHeight));
containerHeight -= horzScrollbarHeight;
}
// this.debug(" scrollIntoView(), nodeY=", nodeY, "containerHeight=", containerHeight);
if( nodeY < (scrollTop + topOfs) ){
// Node is above visible container area
newScrollTop = nodeY - topOfs;
// this.debug(" scrollIntoView(), UPPER newScrollTop=", newScrollTop);
}else if((nodeY + nodeHeight) > (scrollTop + containerHeight - bottomOfs)){
newScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;
// this.debug(" scrollIntoView(), LOWER newScrollTop=", newScrollTop);
// If a topNode was passed, make sure that it is never scrolled
// outside the upper border
if(topNode){
_assert(topNode.isRoot() || $(topNode.span).is(":visible"), "topNode must be visible");
if( topNodeY < newScrollTop ){
newScrollTop = topNodeY - topOfs;
// this.debug(" scrollIntoView(), TOP newScrollTop=", newScrollTop);
}
}
}
if(newScrollTop !== null){
// this.debug(" scrollIntoView(), SET newScrollTop=", newScrollTop);
if(opts.effects){
opts.effects.complete = function(){
dfd.resolveWith(that);
};
$animateTarget.stop(true).animate({
scrollTop: newScrollTop
}, opts.effects);
}else{
$animateTarget[0].scrollTop = newScrollTop;
dfd.resolveWith(this);
}
}else{
dfd.resolveWith(this);
}
return dfd.promise();
},
/**Activate this node.
* @param {boolean} [flag=true] pass false to deactivate
* @param {object} [opts] additional options. Defaults to {noEvents: false}
*/
setActive: function(flag, opts){
return this.tree._callHook("nodeSetActive", this, flag, opts);
},
/**Expand or collapse this node. Promise is resolved, when lazy loading and animations are done.
* @param {boolean} [flag=true] pass false to collapse
* @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false}
* @returns {$.Promise}
*/
setExpanded: function(flag, opts){
return this.tree._callHook("nodeSetExpanded", this, flag, opts);
},
/**Set keyboard focus to this node.
* @param {boolean} [flag=true] pass false to blur
* @see Fancytree#setFocus
*/
setFocus: function(flag){
return this.tree._callHook("nodeSetFocus", this, flag);
},
/**Select this node, i.e. check the checkbox.
* @param {boolean} [flag=true] pass false to deselect
*/
setSelected: function(flag){
return this.tree._callHook("nodeSetSelected", this, flag);
},
/**Mark a lazy node as 'error', 'loading', or 'ok'.
* @param {string} status 'error', 'ok'
* @param {string} [message]
* @param {string} [details]
*/
setStatus: function(status, message, details){
return this.tree._callHook("nodeSetStatus", this, status, message, details);
},
/**Rename this node.
* @param {string} title
*/
setTitle: function(title){
this.title = title;
this.renderTitle();
},
/**Sort child list by title.
* @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title).
* @param {boolean} [deep=false] pass true to sort all descendant nodes
*/
sortChildren: function(cmp, deep) {
var i,l,
cl = this.children;
if( !cl ){
return;
}
cmp = cmp || function(a, b) {
var x = a.title.toLowerCase(),
y = b.title.toLowerCase();
return x === y ? 0 : x > y ? 1 : -1;
};
cl.sort(cmp);
if( deep ){
for(i=0, l=cl.length; i<l; i++){
if( cl[i].children ){
cl[i].sortChildren(cmp, "$norender$");
}
}
}
if( deep !== "$norender$" ){
this.render();
}
},
/** Convert node (or whole branch) into a plain object.
*
* The result is compatible with node.addChildren().
*
* @param {boolean} [recursive=false] include child nodes
* @param {function} [callback] callback(dict) is called for every node, in order to allow modifications
* @returns {NodeData}
*/
toDict: function(recursive, callback) {
var i, l, node,
dict = {},
self = this;
$.each(NODE_ATTRS, function(i, a){
if(self[a] || self[a] === false){
dict[a] = self[a];
}
});
if(!$.isEmptyObject(this.data)){
dict.data = $.extend({}, this.data);
if($.isEmptyObject(dict.data)){
delete dict.data;
}
}
if( callback ){
callback(dict);
}
if( recursive ) {
if(this.hasChildren()){
dict.children = [];
for(i=0, l=this.children.length; i<l; i++ ){
node = this.children[i];
if( !node.isStatusNode() ){
dict.children.push(node.toDict(true, callback));
}
}
}else{
// dict.children = null;
}
}
return dict;
},
/** Flip expanded status. */
toggleExpanded: function(){
return this.tree._callHook("nodeToggleExpanded", this);
},
/** Flip selection status. */
toggleSelected: function(){
return this.tree._callHook("nodeToggleSelected", this);
},
toString: function() {
return "<FancytreeNode(#" + this.key + ", '" + this.title + "')>";
},
/** Call fn(node) for all child nodes.<br>
* Stop iteration, if fn() returns false. Skip current branch, if fn() returns "skip".<br>
* Return false if iteration was stopped.
*
* @param {function} fn the callback function.
* Return false to stop iteration, return "skip" to skip this node and
* its children only.
* @param {boolean} [includeSelf=false]
* @returns {boolean}
*/
visit: function(fn, includeSelf) {
var i, l,
res = true,
children = this.children;
if( includeSelf === true ) {
res = fn(this);
if( res === false || res === "skip" ){
return res;
}
}
if(children){
for(i=0, l=children.length; i<l; i++){
res = children[i].visit(fn, true);
if( res === false ){
break;
}
}
}
return res;
},
/** Call fn(node) for all child nodes and recursively load lazy children.<br>
* <b>Note:</b> If you need this method, you probably should consider to review
* your architecture! Recursivley loading nodes is a perfect way for lazy
* programmers to flood the server with requests ;-)
*
* @param {function} [fn] optional callback function.
* Return false to stop iteration, return "skip" to skip this node and
* its children only.
* @param {boolean} [includeSelf=false]
* @returns {$.Promise}
*/
visitAndLoad: function(fn, includeSelf, _recursion) {
var dfd, res, loaders,
node = this;
// node.debug("visitAndLoad");
if( fn && includeSelf === true ) {
res = fn(node);
if( res === false || res === "skip" ) {
return _recursion ? res : _getResolvedPromise();
}
}
if( !node.children && !node.lazy ) {
return _getResolvedPromise();
}
dfd = new $.Deferred();
loaders = [];
// node.debug("load()...");
node.load().done(function(){
// node.debug("load()... done.");
for(var i=0, l=node.children.length; i<l; i++){
res = node.children[i].visitAndLoad(fn, true, true);
if( res === false ) {
dfd.reject();
break;
} else if ( res !== "skip" ) {
loaders.push(res); // Add promise to the list
}
}
$.when.apply(this, loaders).then(function(){
dfd.resolve();
});
});
return dfd.promise();
},
/** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>
* Stop iteration, if fn() returns false.<br>
* Return false if iteration was stopped.
*
* @param {function} fn the callback function.
* Return false to stop iteration, return "skip" to skip this node and children only.
* @param {boolean} [includeSelf=false]
* @returns {boolean}
*/
visitParents: function(fn, includeSelf) {
// Visit parent nodes (bottom up)
if(includeSelf && fn(this) === false){
return false;
}
var p = this.parent;
while( p ) {
if(fn(p) === false){
return false;
}
p = p.parent;
}
return true;
},
/** Write warning to browser console (prepending node info)
*
* @param {*} msg string or object or array of such
*/
warn: function(msg){
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("warn", arguments);
}
};
/* *****************************************************************************
* Fancytree
*/
/**
* Construct a new tree object.
*
* @class Fancytree
* @classdesc The controller behind a fancytree.
* This class also contains 'hook methods': see {@link Fancytree_Hooks}.
*
* @param {Widget} widget
*
* @property {FancytreeOptions} options
* @property {FancytreeNode} rootNode
* @property {FancytreeNode} activeNode
* @property {FancytreeNode} focusNode
* @property {jQueryObject} $div
* @property {object} widget
* @property {object} ext
* @property {object} data
* @property {object} options
* @property {string} _id
* @property {string} statusClassPropName
* @property {string} ariaPropName
* @property {string} nodeContainerAttrName
* @property {string} $container
* @property {FancytreeNode} lastSelectedNode
*/
function Fancytree(widget) {
this.widget = widget;
this.$div = widget.element;
this.options = widget.options;
if( this.options && $.isFunction(this.options.lazyload) ) {
if( ! $.isFunction(this.options.lazyLoad ) ) {
this.options.lazyLoad = function() {
FT.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead.");
widget.options.lazyload.apply(this, arguments);
};
}
}
if( this.options && $.isFunction(this.options.loaderror) ) {
$.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead.");
}
this.ext = {}; // Active extension instances
// allow to init tree.data.foo from <div data-foo=''>
this.data = _getElementDataAsDict(this.$div);
this._id = $.ui.fancytree._nextId++;
this._ns = ".fancytree-" + this._id; // append for namespaced events
this.activeNode = null;
this.focusNode = null;
this._hasFocus = null;
this.lastSelectedNode = null;
this.systemFocusElement = null;
this.lastQuicksearchTerm = "";
this.lastQuicksearchTime = 0;
this.statusClassPropName = "span";
this.ariaPropName = "li";
this.nodeContainerAttrName = "li";
// Remove previous markup if any
this.$div.find(">ul.fancytree-container").remove();
// Create a node without parent.
var fakeParent = { tree: this },
$ul;
this.rootNode = new FancytreeNode(fakeParent, {
title: "root",
key: "root_" + this._id,
children: null,
expanded: true
});
this.rootNode.parent = null;
// Create root markup
$ul = $("<ul>", {
"class": "ui-fancytree fancytree-container"
}).appendTo(this.$div);
this.$container = $ul;
this.rootNode.ul = $ul[0];
if(this.options.debugLevel == null){
this.options.debugLevel = FT.debugLevel;
}
// Add container to the TAB chain
// See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant
this.$container.attr("tabindex", this.options.tabbable ? "0" : "-1");
if(this.options.aria){
this.$container
.attr("role", "tree")
.attr("aria-multiselectable", true);
}
}
Fancytree.prototype = /** @lends Fancytree# */{
/* Return a context object that can be re-used for _callHook().
* @param {Fancytree | FancytreeNode | EventData} obj
* @param {Event} originalEvent
* @param {Object} extra
* @returns {EventData}
*/
_makeHookContext: function(obj, originalEvent, extra) {
var ctx, tree;
if(obj.node !== undefined){
// obj is already a context object
if(originalEvent && obj.originalEvent !== originalEvent){
$.error("invalid args");
}
ctx = obj;
}else if(obj.tree){
// obj is a FancytreeNode
tree = obj.tree;
ctx = { node: obj, tree: tree, widget: tree.widget, options: tree.widget.options, originalEvent: originalEvent };
}else if(obj.widget){
// obj is a Fancytree
ctx = { node: null, tree: obj, widget: obj.widget, options: obj.widget.options, originalEvent: originalEvent };
}else{
$.error("invalid args");
}
if(extra){
$.extend(ctx, extra);
}
return ctx;
},
/* Trigger a hook function: funcName(ctx, [...]).
*
* @param {string} funcName
* @param {Fancytree|FancytreeNode|EventData} contextObject
* @param {any} [_extraArgs] optional additional arguments
* @returns {any}
*/
_callHook: function(funcName, contextObject, _extraArgs) {
var ctx = this._makeHookContext(contextObject),
fn = this[funcName],
args = Array.prototype.slice.call(arguments, 2);
if(!$.isFunction(fn)){
$.error("_callHook('" + funcName + "') is not a function");
}
args.unshift(ctx);
// this.debug("_hook", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args);
return fn.apply(this, args);
},
/* Check if current extensions dependencies are met and throw an error if not.
*
* This method may be called inside the `treeInit` hook for custom extensions.
*
* @param {string} extension name of the required extension
* @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present
* @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)
* @param {string} [message] optional error message (defaults to a descriptve error message)
*/
_requireExtension: function(name, required, before, message) {
before = !!before;
var thisName = this._local.name,
extList = this.options.extensions,
isBefore = $.inArray(name, extList) < $.inArray(thisName, extList),
isMissing = required && this.ext[name] == null,
badOrder = !isMissing && before != null && (before !== isBefore);
_assert(thisName && thisName !== name);
if( isMissing || badOrder ){
if( !message ){
if( isMissing || required ){
message = "'" + thisName + "' extension requires '" + name + "'";
if( badOrder ){
message += " to be registered " + (before ? "before" : "after") + " itself";
}
}else{
message = "If used together, `" + name + "` must be registered " + (before ? "before" : "after") + " `" + thisName + "`";
}
}
$.error(message);
return false;
}
return true;
},
/** Activate node with a given key and fire focus and activate events.
*
* A prevously activated node will be deactivated.
* If activeVisible option is set, all parents will be expanded as necessary.
* Pass key = false, to deactivate the current node only.
* @param {string} key
* @returns {FancytreeNode} activated node (null, if not found)
*/
activateKey: function(key) {
var node = this.getNodeByKey(key);
if(node){
node.setActive();
}else if(this.activeNode){
this.activeNode.setActive(false);
}
return node;
},
/** (experimental)
*
* @param {Array} patchList array of [key, NodePatch] arrays
* @returns {$.Promise} resolved, when all patches have been applied
* @see TreePatch
*/
applyPatch: function(patchList) {
var dfd, i, p2, key, patch, node,
patchCount = patchList.length,
deferredList = [];
for(i=0; i<patchCount; i++){
p2 = patchList[i];
_assert(p2.length === 2, "patchList must be an array of length-2-arrays");
key = p2[0];
patch = p2[1];
node = (key === null) ? this.rootNode : this.getNodeByKey(key);
if(node){
dfd = new $.Deferred();
deferredList.push(dfd);
node.applyPatch(patch).always(_makeResolveFunc(dfd, node));
}else{
this.warn("could not find node with key '" + key + "'");
}
}
// Return a promise that is resovled, when ALL patches were applied
return $.when.apply($, deferredList).promise();
},
/* TODO: implement in dnd extension
cancelDrag: function() {
var dd = $.ui.ddmanager.current;
if(dd){
dd.cancel();
}
},
*/
/** Return the number of nodes.
* @returns {integer}
*/
count: function() {
return this.rootNode.countChildren();
},
/** Write to browser console if debugLevel >= 2 (prepending tree name)
*
* @param {*} msg string or object or array of such
*/
debug: function(msg){
if( this.options.debugLevel >= 2 ) {
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("log", arguments);
}
},
// TODO: disable()
// TODO: enable()
// TODO: enableUpdate()
/** Find the next visible node that starts with `match`, starting at `startNode`
* and wrap-around at the end.
*
* @param {string|function} match
* @param {FancytreeNode} [startNode] defaults to first node
* @returns {FancytreeNode} matching node or null
*/
findNextNode: function(match, startNode, visibleOnly) {
var stopNode = null,
parentChildren = startNode.parent.children,
matchingNode = null,
walkVisible = function(parent, idx, fn) {
var i, grandParent,
parentChildren = parent.children,
siblingCount = parentChildren.length,
node = parentChildren[idx];
// visit node itself
if( node && fn(node) === false ) {
return false;
}
// visit descendants
if( node && node.children && node.expanded ) {
if( walkVisible(node, 0, fn) === false ) {
return false;
}
}
// visit subsequent siblings
for( i = idx + 1; i < siblingCount; i++ ) {
if( walkVisible(parent, i, fn) === false ) {
return false;
}
}
// visit parent's subsequent siblings
grandParent = parent.parent;
if( grandParent ) {
return walkVisible(grandParent, grandParent.children.indexOf(parent) + 1, fn);
} else {
// wrap-around: restart with first node
return walkVisible(parent, 0, fn);
}
};
match = (typeof match === "string") ? _makeNodeTitleStartMatcher(match) : match;
startNode = startNode || this.getFirstChild();
walkVisible(startNode.parent, parentChildren.indexOf(startNode), function(node){
// Stop iteration if we see the start node a second time
if( node === stopNode ) {
return false;
}
stopNode = stopNode || node;
// Ignore nodes hidden by a filter
if( ! $(node.span).is(":visible") ) {
node.debug("quicksearch: skipping hidden node");
return;
}
// Test if we found a match, but search for a second match if this
// was the currently active node
if( match(node) ) {
// node.debug("quicksearch match " + node.title, startNode);
matchingNode = node;
if( matchingNode !== startNode ) {
return false;
}
}
});
return matchingNode;
},
// TODO: fromDict
/**
* Generate INPUT elements that can be submitted with html forms.
*
* In selectMode 3 only the topmost selected nodes are considered.
*
* @param {boolean | string} [selected=true]
* @param {boolean | string} [active=true]
*/
generateFormElements: function(selected, active) {
// TODO: test case
var nodeList,
selectedName = (selected !== false) ? "ft_" + this._id + "[]" : selected,
activeName = (active !== false) ? "ft_" + this._id + "_active" : active,
id = "fancytree_result_" + this._id,
$result = $("#" + id);
if($result.length){
$result.empty();
}else{
$result = $("<div>", {
id: id
}).hide().insertAfter(this.$container);
}
if(selectedName){
nodeList = this.getSelectedNodes( this.options.selectMode === 3 );
$.each(nodeList, function(idx, node){
$result.append($("<input>", {
type: "checkbox",
name: selectedName,
value: node.key,
checked: true
}));
});
}
if(activeName && this.activeNode){
$result.append($("<input>", {
type: "radio",
name: activeName,
value: this.activeNode.key,
checked: true
}));
}
},
/**
* Return the currently active node or null.
* @returns {FancytreeNode}
*/
getActiveNode: function() {
return this.activeNode;
},
/** Return the first top level node if any (not the invisible root node).
* @returns {FancytreeNode | null}
*/
getFirstChild: function() {
return this.rootNode.getFirstChild();
},
/**
* Return node that has keyboard focus.
* @param {boolean} [ifTreeHasFocus=false] (not yet implemented)
* @returns {FancytreeNode}
*/
getFocusNode: function(ifTreeHasFocus) {
// TODO: implement ifTreeHasFocus
return this.focusNode;
},
/**
* Return node with a given key or null if not found.
* @param {string} key
* @param {FancytreeNode} [searchRoot] only search below this node
* @returns {FancytreeNode | null}
*/
getNodeByKey: function(key, searchRoot) {
// Search the DOM by element ID (assuming this is faster than traversing all nodes).
// $("#...") has problems, if the key contains '.', so we use getElementById()
var el, match;
if(!searchRoot){
el = document.getElementById(this.options.idPrefix + key);
if( el ){
return el.ftnode ? el.ftnode : null;
}
}
// Not found in the DOM, but still may be in an unrendered part of tree
// TODO: optimize with specialized loop
// TODO: consider keyMap?
searchRoot = searchRoot || this.rootNode;
match = null;
searchRoot.visit(function(node){
// window.console.log("getNodeByKey(" + key + "): ", node.key);
if(node.key === key) {
match = node;
return false;
}
}, true);
return match;
},
/** Return the invisible system root node.
* @returns {FancytreeNode}
*/
getRootNode: function() {
return this.rootNode;
},
/**
* Return an array of selected nodes.
* @param {boolean} [stopOnParents=false] only return the topmost selected
* node (useful with selectMode 3)
* @returns {FancytreeNode[]}
*/
getSelectedNodes: function(stopOnParents) {
var nodeList = [];
this.rootNode.visit(function(node){
if( node.selected ) {
nodeList.push(node);
if( stopOnParents === true ){
return "skip"; // stop processing this branch
}
}
});
return nodeList;
},
/** Return true if the tree control has keyboard focus
* @returns {boolean}
*/
hasFocus: function(){
return !!this._hasFocus;
},
/** Write to browser console if debugLevel >= 1 (prepending tree name)
* @param {*} msg string or object or array of such
*/
info: function(msg){
if( this.options.debugLevel >= 1 ) {
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("info", arguments);
}
},
/*
TODO: isInitializing: function() {
return ( this.phase=="init" || this.phase=="postInit" );
},
TODO: isReloading: function() {
return ( this.phase=="init" || this.phase=="postInit" ) && this.options.persist && this.persistence.cookiesFound;
},
TODO: isUserEvent: function() {
return ( this.phase=="userEvent" );
},
*/
/**
* Make sure that a node with a given ID is loaded, by traversing - and
* loading - its parents. This method is ment for lazy hierarchies.
* A callback is executed for every node as we go.
* @example
* tree.loadKeyPath("/_3/_23/_26/_27", function(node, status){
* if(status === "loaded") {
* console.log("loaded intermiediate node " + node);
* }else if(status === "ok") {
* node.activate();
* }
* });
*
* @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7')
* @param {function} callback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error')
* @returns {$.Promise}
*/
loadKeyPath: function(keyPathList, callback, _rootNode) {
var deferredList, dfd, i, path, key, loadMap, node, root, segList,
sep = this.options.keyPathSeparator,
self = this;
if(!$.isArray(keyPathList)){
keyPathList = [keyPathList];
}
// Pass 1: handle all path segments for nodes that are already loaded
// Collect distinct top-most lazy nodes in a map
loadMap = {};
for(i=0; i<keyPathList.length; i++){
root = _rootNode || this.rootNode;
path = keyPathList[i];
// strip leading slash
if(path.charAt(0) === sep){
path = path.substr(1);
}
// traverse and strip keys, until we hit a lazy, unloaded node
segList = path.split(sep);
while(segList.length){
key = segList.shift();
// node = _findDirectChild(root, key);
node = root._findDirectChild(key);
if(!node){
this.warn("loadKeyPath: key not found: " + key + " (parent: " + root + ")");
callback.call(this, key, "error");
break;
}else if(segList.length === 0){
callback.call(this, node, "ok");
break;
}else if(!node.lazy || (node.hasChildren() !== undefined )){
callback.call(this, node, "loaded");
root = node;
}else{
callback.call(this, node, "loaded");
// segList.unshift(key);
if(loadMap[key]){
loadMap[key].push(segList.join(sep));
}else{
loadMap[key] = [segList.join(sep)];
}
break;
}
}
}
// alert("loadKeyPath: loadMap=" + JSON.stringify(loadMap));
// Now load all lazy nodes and continue itearation for remaining paths
deferredList = [];
// Avoid jshint warning 'Don't make functions within a loop.':
function __lazyload(key, node, dfd){
callback.call(self, node, "loading");
node.load().done(function(){
self.loadKeyPath.call(self, loadMap[key], callback, node).always(_makeResolveFunc(dfd, self));
}).fail(function(errMsg){
self.warn("loadKeyPath: error loading: " + key + " (parent: " + root + ")");
callback.call(self, node, "error");
dfd.reject();
});
}
for(key in loadMap){
node = root._findDirectChild(key);
// alert("loadKeyPath: lazy node(" + key + ") = " + node);
dfd = new $.Deferred();
deferredList.push(dfd);
__lazyload(key, node, dfd);
}
// Return a promise that is resovled, when ALL paths were loaded
return $.when.apply($, deferredList).promise();
},
/** Re-fire beforeActivate and activate events. */
reactivate: function(setFocus) {
var node = this.activeNode;
if( node ) {
this.activeNode = null; // Force re-activating
node.setActive();
if( setFocus ){
node.setFocus();
}
}
},
/** Reload tree from source and return a promise.
* @param [source] optional new source (defaults to initial source data)
* @returns {$.Promise}
*/
reload: function(source) {
this._callHook("treeClear", this);
return this._callHook("treeLoad", this, source);
},
/**Render tree (i.e. create DOM elements for all top-level nodes).
* @param {boolean} [force=false] create DOM elemnts, even is parent is collapsed
* @param {boolean} [deep=false]
*/
render: function(force, deep) {
return this.rootNode.render(force, deep);
},
// TODO: selectKey: function(key, select)
// TODO: serializeArray: function(stopOnParents)
/**
* @param {boolean} [flag=true]
*/
setFocus: function(flag) {
return this._callHook("treeSetFocus", this, flag);
},
/**
* Return all nodes as nested list of {@link NodeData}.
*
* @param {boolean} [includeRoot=false] Returns the hidden system root node (and its children)
* @param {function} [callback(node)] Called for every node
* @returns {Array | object}
* @see FancytreeNode#toDict
*/
toDict: function(includeRoot, callback){
var res = this.rootNode.toDict(true, callback);
return includeRoot ? res : res.children;
},
/* Implicitly called for string conversions.
* @returns {string}
*/
toString: function(){
return "<Fancytree(#" + this._id + ")>";
},
/* _trigger a widget event with additional node ctx.
* @see EventData
*/
_triggerNodeEvent: function(type, node, originalEvent, extra) {
// this.debug("_trigger(" + type + "): '" + ctx.node.title + "'", ctx);
var ctx = this._makeHookContext(node, originalEvent, extra),
res = this.widget._trigger(type, originalEvent, ctx);
if(res !== false && ctx.result !== undefined){
return ctx.result;
}
return res;
},
/* _trigger a widget event with additional tree data. */
_triggerTreeEvent: function(type, originalEvent, extra) {
// this.debug("_trigger(" + type + ")", ctx);
var ctx = this._makeHookContext(this, originalEvent, extra),
res = this.widget._trigger(type, originalEvent, ctx);
if(res !== false && ctx.result !== undefined){
return ctx.result;
}
return res;
},
/** Call fn(node) for all nodes.
*
* @param {function} fn the callback function.
* Return false to stop iteration, return "skip" to skip this node and children only.
* @returns {boolean} false, if the iterator was stopped.
*/
visit: function(fn) {
return this.rootNode.visit(fn, false);
},
/** Write warning to browser console (prepending tree info)
*
* @param {*} msg string or object or array of such
*/
warn: function(msg){
Array.prototype.unshift.call(arguments, this.toString());
consoleApply("warn", arguments);
}
};
/**
* These additional methods of the {@link Fancytree} class are 'hook functions'
* that can be used and overloaded by extensions.
* (See <a href="https://github.com/mar10/fancytree/wiki/TutorialExtensions">writing extensions</a>.)
* @mixin Fancytree_Hooks
*/
$.extend(Fancytree.prototype,
/** @lends Fancytree_Hooks# */
{
/** Default handling for mouse click events.
*
* @param {EventData} ctx
*/
nodeClick: function(ctx) {
// this.tree.logDebug("ftnode.onClick(" + event.type + "): ftnode:" + this + ", button:" + event.button + ", which: " + event.which);
var activate, expand,
// event = ctx.originalEvent,
targetType = ctx.targetType,
node = ctx.node;
// TODO: use switch
// TODO: make sure clicks on embedded <input> doesn't steal focus (see table sample)
if( targetType === "expander" ) {
// Clicking the expander icon always expands/collapses
this._callHook("nodeToggleExpanded", ctx);
} else if( targetType === "checkbox" ) {
// Clicking the checkbox always (de)selects
this._callHook("nodeToggleSelected", ctx);
if( ctx.options.focusOnSelect ) { // #358
this._callHook("nodeSetFocus", ctx, true);
}
} else {
// Honor `clickFolderMode` for
expand = false;
activate = true;
if( node.folder ) {
switch( ctx.options.clickFolderMode ) {
case 2: // expand only
expand = true;
activate = false;
break;
case 3: // expand and activate
activate = true;
expand = true; //!node.isExpanded();
break;
// else 1 or 4: just activate
}
}
if( activate ) {
this.nodeSetFocus(ctx);
this._callHook("nodeSetActive", ctx, true);
}
if( expand ) {
if(!activate){
// this._callHook("nodeSetFocus", ctx);
}
// this._callHook("nodeSetExpanded", ctx, true);
this._callHook("nodeToggleExpanded", ctx);
}
}
// Make sure that clicks stop, otherwise <a href='#'> jumps to the top
// if(event.target.localName === "a" && event.target.className === "fancytree-title"){
// event.preventDefault();
// }
// TODO: return promise?
},
/** Collapse all other children of same parent.
*
* @param {EventData} ctx
* @param {object} callOpts
*/
nodeCollapseSiblings: function(ctx, callOpts) {
// TODO: return promise?
var ac, i, l,
node = ctx.node;
if( node.parent ){
ac = node.parent.children;
for (i=0, l=ac.length; i<l; i++) {
if ( ac[i] !== node && ac[i].expanded ){
this._callHook("nodeSetExpanded", ac[i], false, callOpts);
}
}
}
},
/** Default handling for mouse douleclick events.
* @param {EventData} ctx
*/
nodeDblclick: function(ctx) {
// TODO: return promise?
if( ctx.targetType === "title" && ctx.options.clickFolderMode === 4) {
// this.nodeSetFocus(ctx);
// this._callHook("nodeSetActive", ctx, true);
this._callHook("nodeToggleExpanded", ctx);
}
// TODO: prevent text selection on dblclicks
if( ctx.targetType === "title" ) {
ctx.originalEvent.preventDefault();
}
},
/** Default handling for mouse keydown events.
*
* NOTE: this may be called with node == null if tree (but no node) has focus.
* @param {EventData} ctx
*/
nodeKeydown: function(ctx) {
// TODO: return promise?
var matchNode, stamp, res,
event = ctx.originalEvent,
node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
which = event.which,
whichChar = String.fromCharCode(which),
clean = !(event.altKey || event.ctrlKey || event.metaKey || event.shiftKey),
$target = $(event.target),
handled = true,
activate = !(event.ctrlKey || !opts.autoActivate ),
KC = $.ui.keyCode;
// node.debug("ftnode.nodeKeydown(" + event.type + "): ftnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which);
// Set focus to first node, if no other node has the focus yet
if( !node ){
this.getFirstChild().setFocus();
node = ctx.node = this.focusNode;
node.debug("Keydown force focus on first node");
}
if( opts.quicksearch && clean && /\w/.test(whichChar) && !$target.is(":input:enabled") ) {
// Allow to search for longer streaks if typed in quickly
stamp = new Date().getTime();
if( stamp - tree.lastQuicksearchTime > 500 ) {
tree.lastQuicksearchTerm = "";
}
tree.lastQuicksearchTime = stamp;
tree.lastQuicksearchTerm += whichChar;
// tree.debug("quicksearch find", tree.lastQuicksearchTerm);
matchNode = tree.findNextNode(tree.lastQuicksearchTerm, tree.getActiveNode());
if( matchNode ) {
matchNode.setActive();
}
event.preventDefault();
return;
}
switch( which ) {
// charCodes:
case KC.NUMPAD_ADD: //107: // '+'
case 187: // '+' @ Chrome, Safari
tree.nodeSetExpanded(ctx, true);
break;
case KC.NUMPAD_SUBTRACT: // '-'
case 189: // '-' @ Chrome, Safari
tree.nodeSetExpanded(ctx, false);
break;
case KC.SPACE:
if(opts.checkbox){
tree.nodeToggleSelected(ctx);
}else{
tree.nodeSetActive(ctx, true);
}
break;
case KC.ENTER:
tree.nodeSetActive(ctx, true);
break;
case KC.BACKSPACE:
case KC.LEFT:
case KC.RIGHT:
case KC.UP:
case KC.DOWN:
res = node.navigate(event.which, activate);
break;
default:
handled = false;
}
if(handled){
event.preventDefault();
}
},
// /** Default handling for mouse keypress events. */
// nodeKeypress: function(ctx) {
// var event = ctx.originalEvent;
// },
// /** Trigger lazyLoad event (async). */
// nodeLazyLoad: function(ctx) {
// var node = ctx.node;
// if(this._triggerNodeEvent())
// },
/** Load child nodes (async).
*
* @param {EventData} ctx
* @param {object[]|object|string|$.Promise|function} source
* @returns {$.Promise} The deferred will be resolved as soon as the (ajax)
* data was rendered.
*/
nodeLoadChildren: function(ctx, source) {
var ajax, delay, dfd,
tree = ctx.tree,
node = ctx.node;
if($.isFunction(source)){
source = source();
}
// TOTHINK: move to 'ajax' extension?
if(source.url){
// `source` is an Ajax options object
ajax = $.extend({}, ctx.options.ajax, source);
if(ajax.debugDelay){
// simulate a slow server
delay = ajax.debugDelay;
if($.isArray(delay)){ // random delay range [min..max]
delay = delay[0] + Math.random() * (delay[1] - delay[0]);
}
node.debug("nodeLoadChildren waiting debug delay " + Math.round(delay) + "ms");
ajax.debugDelay = false;
dfd = $.Deferred(function (dfd) {
setTimeout(function () {
$.ajax(ajax)
.done(function () { dfd.resolveWith(this, arguments); })
.fail(function () { dfd.rejectWith(this, arguments); });
}, delay);
});
}else{
dfd = $.ajax(ajax);
}
// Defer the deferred: we want to be able to reject, even if ajax
// resolved ok.
source = new $.Deferred();
dfd.done(function (data, textStatus, jqXHR) {
var errorObj, res;
if(typeof data === "string"){
$.error("Ajax request returned a string (did you get the JSON dataType wrong?).");
}
// postProcess is similar to the standard ajax dataFilter hook,
// but it is also called for JSONP
if( ctx.options.postProcess ){
res = tree._triggerNodeEvent("postProcess", ctx, ctx.originalEvent, {response: data, error: null, dataType: this.dataType});
if( res.error ) {
errorObj = $.isPlainObject(res.error) ? res.error : {message: res.error};
errorObj = tree._makeHookContext(node, null, errorObj);
source.rejectWith(this, [errorObj]);
return;
}
data = $.isArray(res) ? res : data;
} else if (data && data.hasOwnProperty("d") && ctx.options.enableAspx ) {
// Process ASPX WebMethod JSON object inside "d" property
data = (typeof data.d === "string") ? $.parseJSON(data.d) : data.d;
}
source.resolveWith(this, [data]);
}).fail(function (jqXHR, textStatus, errorThrown) {
var errorObj = tree._makeHookContext(node, null, {
error: jqXHR,
args: Array.prototype.slice.call(arguments),
message: errorThrown,
details: jqXHR.status + ": " + errorThrown
});
source.rejectWith(this, [errorObj]);
});
}
if($.isFunction(source.promise)){
// `source` is a deferred, i.e. ajax request
_assert(!node.isLoading());
// node._isLoading = true;
tree.nodeSetStatus(ctx, "loading");
source.done(function (children) {
tree.nodeSetStatus(ctx, "ok");
}).fail(function(error){
var ctxErr;
if (error.node && error.error && error.message) {
// error is already a context object
ctxErr = error;
} else {
ctxErr = tree._makeHookContext(node, null, {
error: error, // it can be jqXHR or any custom error
args: Array.prototype.slice.call(arguments),
message: error ? (error.message || error.toString()) : ""
});
}
if( tree._triggerNodeEvent("loadError", ctxErr, null) !== false ) {
tree.nodeSetStatus(ctx, "error", ctxErr.message, ctxErr.details);
}
});
}
// $.when(source) resolves also for non-deferreds
return $.when(source).done(function(children){
var metaData;
if( $.isPlainObject(children) ){
// We got {foo: 'abc', children: [...]}
// Copy extra properties to tree.data.foo
_assert($.isArray(children.children), "source must contain (or be) an array of children");
_assert(node.isRoot(), "source may only be an object for root nodes");
metaData = children;
children = children.children;
delete metaData.children;
$.extend(tree.data, metaData);
}
_assert($.isArray(children), "expected array of children");
node._setChildren(children);
// trigger fancytreeloadchildren
tree._triggerNodeEvent("loadChildren", node);
// }).always(function(){
// node._isLoading = false;
});
},
/** [Not Implemented] */
nodeLoadKeyPath: function(ctx, keyPathList) {
// TODO: implement and improve
// http://code.google.com/p/dynatree/issues/detail?id=222
},
/**
* Remove a single direct child of ctx.node.
* @param {EventData} ctx
* @param {FancytreeNode} childNode dircect child of ctx.node
*/
nodeRemoveChild: function(ctx, childNode) {
var idx,
node = ctx.node,
opts = ctx.options,
subCtx = $.extend({}, ctx, {node: childNode}),
children = node.children;
// FT.debug("nodeRemoveChild()", node.toString(), childNode.toString());
if( children.length === 1 ) {
_assert(childNode === children[0]);
return this.nodeRemoveChildren(ctx);
}
if( this.activeNode && (childNode === this.activeNode || this.activeNode.isDescendantOf(childNode))){
this.activeNode.setActive(false); // TODO: don't fire events
}
if( this.focusNode && (childNode === this.focusNode || this.focusNode.isDescendantOf(childNode))){
this.focusNode = null;
}
// TODO: persist must take care to clear select and expand cookies
this.nodeRemoveMarkup(subCtx);
this.nodeRemoveChildren(subCtx);
idx = $.inArray(childNode, children);
_assert(idx >= 0);
// Unlink to support GC
childNode.visit(function(n){
n.parent = null;
}, true);
this._callHook("treeRegisterNode", this, false, childNode);
if ( opts.removeNode ){
opts.removeNode.call(ctx.tree, {type: "removeNode"}, subCtx);
}
// remove from child list
children.splice(idx, 1);
},
/**Remove HTML markup for all descendents of ctx.node.
* @param {EventData} ctx
*/
nodeRemoveChildMarkup: function(ctx) {
var node = ctx.node;
// FT.debug("nodeRemoveChildMarkup()", node.toString());
// TODO: Unlink attr.ftnode to support GC
if(node.ul){
if( node.isRoot() ) {
$(node.ul).empty();
} else {
$(node.ul).remove();
node.ul = null;
}
node.visit(function(n){
n.li = n.ul = null;
});
}
},
/**Remove all descendants of ctx.node.
* @param {EventData} ctx
*/
nodeRemoveChildren: function(ctx) {
var subCtx,
tree = ctx.tree,
node = ctx.node,
children = node.children,
opts = ctx.options;
// FT.debug("nodeRemoveChildren()", node.toString());
if(!children){
return;
}
if( this.activeNode && this.activeNode.isDescendantOf(node)){
this.activeNode.setActive(false); // TODO: don't fire events
}
if( this.focusNode && this.focusNode.isDescendantOf(node)){
this.focusNode = null;
}
// TODO: persist must take care to clear select and expand cookies
this.nodeRemoveChildMarkup(ctx);
// Unlink children to support GC
// TODO: also delete this.children (not possible using visit())
subCtx = $.extend({}, ctx);
node.visit(function(n){
n.parent = null;
tree._callHook("treeRegisterNode", tree, false, n);
if ( opts.removeNode ){
subCtx.node = n;
opts.removeNode.call(ctx.tree, {type: "removeNode"}, subCtx);
}
});
if( node.lazy ){
// 'undefined' would be interpreted as 'not yet loaded' for lazy nodes
node.children = [];
} else{
node.children = null;
}
this.nodeRenderStatus(ctx);
},
/**Remove HTML markup for ctx.node and all its descendents.
* @param {EventData} ctx
*/
nodeRemoveMarkup: function(ctx) {
var node = ctx.node;
// FT.debug("nodeRemoveMarkup()", node.toString());
// TODO: Unlink attr.ftnode to support GC
if(node.li){
$(node.li).remove();
node.li = null;
}
this.nodeRemoveChildMarkup(ctx);
},
/**
* Create `<li><span>..</span> .. </li>` tags for this node.
*
* This method takes care that all HTML markup is created that is required
* to display this node in it's current state.
*
* Call this method to create new nodes, or after the strucuture
* was changed (e.g. after moving this node or adding/removing children)
* nodeRenderTitle() and nodeRenderStatus() are implied.
*
* Note: if a node was created/removed, nodeRender() must be called for the
* parent.
* <code>
* <li id='KEY' ftnode=NODE>
* <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>
* <span class="fancytree-expander"></span>
* <span class="fancytree-checkbox"></span> // only present in checkbox mode
* <span class="fancytree-icon"></span>
* <a href="#" class="fancytree-title"> Node 1 </a>
* </span>
* <ul> // only present if node has children
* <li id='KEY' ftnode=NODE> child1 ... </li>
* <li id='KEY' ftnode=NODE> child2 ... </li>
* </ul>
* </li>
* </code>
*
* @param {EventData} ctx
* @param {boolean} [force=false] re-render, even if html markup was already created
* @param {boolean} [deep=false] also render all descendants, even if parent is collapsed
* @param {boolean} [collapsed=false] force root node to be collapsed, so we can apply animated expand later
*/
nodeRender: function(ctx, force, deep, collapsed, _recursive) {
/* This method must take care of all cases where the current data mode
* (i.e. node hierarchy) does not match the current markup.
*
* - node was not yet rendered:
* create markup
* - node was rendered: exit fast
* - children have been added
* - childern have been removed
*/
var childLI, childNode1, childNode2, i, l, next, subCtx,
node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
aria = opts.aria,
firstTime = false,
parent = node.parent,
isRootNode = !parent,
children = node.children;
// FT.debug("nodeRender(" + !!force + ", " + !!deep + ")", node.toString());
if( ! isRootNode && ! parent.ul ) {
// Calling node.collapse on a deep, unrendered node
return;
}
_assert(isRootNode || parent.ul, "parent UL must exist");
// if(node.li && (force || (node.li.parentNode !== node.parent.ul) ) ){
// if(node.li.parentNode !== node.parent.ul){
// // alert("unlink " + node + " (must be child of " + node.parent + ")");
// this.warn("unlink " + node + " (must be child of " + node.parent + ")");
// }
// // this.debug("nodeRemoveMarkup...");
// this.nodeRemoveMarkup(ctx);
// }
// Render the node
if( !isRootNode ){
// Discard markup on force-mode, or if it is not linked to parent <ul>
if(node.li && (force || (node.li.parentNode !== node.parent.ul) ) ){
if(node.li.parentNode !== node.parent.ul){
// alert("unlink " + node + " (must be child of " + node.parent + ")");
this.warn("unlink " + node + " (must be child of " + node.parent + ")");
}
// this.debug("nodeRemoveMarkup...");
this.nodeRemoveMarkup(ctx);
}
// Create <li><span /> </li>
// node.debug("render...");
if( !node.li ) {
// node.debug("render... really");
firstTime = true;
node.li = document.createElement("li");
node.li.ftnode = node;
if(aria){
// TODO: why doesn't this work:
// node.li.role = "treeitem";
// $(node.li).attr("role", "treeitem")
// .attr("aria-labelledby", "ftal_" + node.key);
}
if( node.key && opts.generateIds ){
node.li.id = opts.idPrefix + node.key;
}
node.span = document.createElement("span");
node.span.className = "fancytree-node";
if(aria){
$(node.span).attr("aria-labelledby", "ftal_" + node.key);
}
node.li.appendChild(node.span);
// Create inner HTML for the <span> (expander, checkbox, icon, and title)
this.nodeRenderTitle(ctx);
// Allow tweaking and binding, after node was created for the first time
if ( opts.createNode ){
opts.createNode.call(tree, {type: "createNode"}, ctx);
}
}else{
// this.nodeRenderTitle(ctx);
this.nodeRenderStatus(ctx);
}
// Allow tweaking after node state was rendered
if ( opts.renderNode ){
opts.renderNode.call(tree, {type: "renderNode"}, ctx);
}
}
// Visit child nodes
if( children ){
if( isRootNode || node.expanded || deep === true ) {
// Create a UL to hold the children
if( !node.ul ){
node.ul = document.createElement("ul");
if((collapsed === true && !_recursive) || !node.expanded){
// hide top UL, so we can use an animation to show it later
node.ul.style.display = "none";
}
if(aria){
$(node.ul).attr("role", "group");
}
if ( node.li ) { // issue #67
node.li.appendChild(node.ul);
} else {
node.tree.$div.append(node.ul);
}
}
// Add child markup
for(i=0, l=children.length; i<l; i++) {
subCtx = $.extend({}, ctx, {node: children[i]});
this.nodeRender(subCtx, force, deep, false, true);
}
// Remove <li> if nodes have moved to another parent
childLI = node.ul.firstChild;
while( childLI ){
childNode2 = childLI.ftnode;
if( childNode2 && childNode2.parent !== node ) {
node.debug("_fixParent: remove missing " + childNode2, childLI);
next = childLI.nextSibling;
childLI.parentNode.removeChild(childLI);
childLI = next;
}else{
childLI = childLI.nextSibling;
}
}
// Make sure, that <li> order matches node.children order.
childLI = node.ul.firstChild;
for(i=0, l=children.length-1; i<l; i++) {
childNode1 = children[i];
childNode2 = childLI.ftnode;
if( childNode1 !== childNode2 ) {
// node.debug("_fixOrder: mismatch at index " + i + ": " + childNode1 + " != " + childNode2);
node.ul.insertBefore(childNode1.li, childNode2.li);
} else {
childLI = childLI.nextSibling;
}
}
}
}else{
// No children: remove markup if any
if( node.ul ){
// alert("remove child markup for " + node);
this.warn("remove child markup for " + node);
this.nodeRemoveChildMarkup(ctx);
}
}
if( !isRootNode ){
// Update element classes according to node state
// this.nodeRenderStatus(ctx);
// Finally add the whole structure to the DOM, so the browser can render
if(firstTime){
parent.ul.appendChild(node.li);
}
}
},
/** Create HTML for the node's outer <span> (expander, checkbox, icon, and title).
*
* nodeRenderStatus() is implied.
* @param {EventData} ctx
* @param {string} [title] optinal new title
*/
nodeRenderTitle: function(ctx, title) {
// set node connector images, links and text
var id, iconSpanClass, nodeTitle, role, tabindex, tooltip,
node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
aria = opts.aria,
level = node.getLevel(),
ares = [],
iconSrc = node.data.icon;
if(title !== undefined){
node.title = title;
}
if(!node.span){
// Silently bail out if node was not rendered yet, assuming
// node.render() will be called as the node becomes visible
return;
}
// connector (expanded, expandable or simple)
// TODO: optimize this if clause
if( level < opts.minExpandLevel ) {
if( !node.lazy ) {
node.expanded = true;
}
if(level > 1){
if(aria){
ares.push("<span role='button' class='fancytree-expander fancytree-expander-fixed'></span>");
}else{
ares.push("<span class='fancytree-expander fancytree-expander-fixed''></span>");
}
}
// .. else (i.e. for root level) skip expander/connector alltogether
} else {
if(aria){
ares.push("<span role='button' class='fancytree-expander'></span>");
}else{
ares.push("<span class='fancytree-expander'></span>");
}
}
// Checkbox mode
if( opts.checkbox && node.hideCheckbox !== true && !node.isStatusNode() ) {
if(aria){
ares.push("<span role='checkbox' class='fancytree-checkbox'></span>");
}else{
ares.push("<span class='fancytree-checkbox'></span>");
}
}
// folder or doctype icon
role = aria ? " role='img'" : "";
if( iconSrc === true || (iconSrc !== false && opts.icons !== false) ) {
// opts.icons defines the default behavior, node.icon == true/false can override this
if ( iconSrc && typeof iconSrc === "string" ) {
// node.icon is an image url
iconSrc = (iconSrc.charAt(0) === "/") ? iconSrc : ((opts.imagePath || "") + iconSrc);
ares.push("<img src='" + iconSrc + "' class='fancytree-icon' alt='' />");
} else {
// See if node.iconClass or opts.iconClass() define a class name
iconSpanClass = (opts.iconClass && opts.iconClass.call(tree, node, ctx)) || node.data.iconclass || null;
if( iconSpanClass ) {
ares.push("<span " + role + " class='fancytree-custom-icon " + iconSpanClass + "'></span>");
} else {
ares.push("<span " + role + " class='fancytree-icon'></span>");
}
}
}
// node title
nodeTitle = "";
if ( opts.renderTitle ){
nodeTitle = opts.renderTitle.call(tree, {type: "renderTitle"}, ctx) || "";
}
if(!nodeTitle){
tooltip = node.tooltip ? " title='" + FT.escapeHtml(node.tooltip) + "'" : "";
id = aria ? " id='ftal_" + node.key + "'" : "";
role = aria ? " role='treeitem'" : "";
tabindex = opts.titlesTabbable ? " tabindex='0'" : "";
nodeTitle = "<span " + role + " class='fancytree-title'" + id + tooltip + tabindex + ">" + node.title + "</span>";
}
ares.push(nodeTitle);
// Note: this will trigger focusout, if node had the focus
//$(node.span).html(ares.join("")); // it will cleanup the jQuery data currently associated with SPAN (if any), but it executes more slowly
node.span.innerHTML = ares.join("");
// Update CSS classes
this.nodeRenderStatus(ctx);
},
/** Update element classes according to node state.
* @param {EventData} ctx
*/
nodeRenderStatus: function(ctx) {
// Set classes for current status
var node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
// nodeContainer = node[tree.nodeContainerAttrName],
hasChildren = node.hasChildren(),
isLastSib = node.isLastSibling(),
aria = opts.aria,
// $ariaElem = aria ? $(node[tree.ariaPropName]) : null,
$ariaElem = $(node.span).find(".fancytree-title"),
cn = opts._classNames,
cnList = [],
statusElem = node[tree.statusClassPropName];
if( !statusElem ){
// if this function is called for an unrendered node, ignore it (will be updated on nect render anyway)
return;
}
// Build a list of class names that we will add to the node <span>
cnList.push(cn.node);
if( tree.activeNode === node ){
cnList.push(cn.active);
// $(">span.fancytree-title", statusElem).attr("tabindex", "0");
// tree.$container.removeAttr("tabindex");
// }else{
// $(">span.fancytree-title", statusElem).removeAttr("tabindex");
// tree.$container.attr("tabindex", "0");
}
if( tree.focusNode === node ){
cnList.push(cn.focused);
if(aria){
// $(">span.fancytree-title", statusElem).attr("tabindex", "0");
// $(">span.fancytree-title", statusElem).attr("tabindex", "-1");
// TODO: is this the right element for this attribute?
$ariaElem
.attr("aria-activedescendant", true);
// .attr("tabindex", "-1");
}
}else if(aria){
// $(">span.fancytree-title", statusElem).attr("tabindex", "-1");
$ariaElem
.removeAttr("aria-activedescendant");
// .removeAttr("tabindex");
}
if( node.expanded ){
cnList.push(cn.expanded);
if(aria){
$ariaElem.attr("aria-expanded", true);
}
}else if(aria){
$ariaElem.removeAttr("aria-expanded");
}
if( node.folder ){
cnList.push(cn.folder);
}
if( hasChildren !== false ){
cnList.push(cn.hasChildren);
}
// TODO: required?
if( isLastSib ){
cnList.push(cn.lastsib);
}
if( node.lazy && node.children == null ){
cnList.push(cn.lazy);
}
if( node.partsel ){
cnList.push(cn.partsel);
}
if( node.unselectable ){
cnList.push(cn.unselectable);
}
if( node._isLoading ){
cnList.push(cn.loading);
}
if( node._error ){
cnList.push(cn.error);
}
if( node.selected ){
cnList.push(cn.selected);
if(aria){
$ariaElem.attr("aria-selected", true);
}
}else if(aria){
$ariaElem.attr("aria-selected", false);
}
if( node.extraClasses ){
cnList.push(node.extraClasses);
}
// IE6 doesn't correctly evaluate multiple class names,
// so we create combined class names that can be used in the CSS
if( hasChildren === false ){
cnList.push(cn.combinedExpanderPrefix + "n" +
(isLastSib ? "l" : "")
);
}else{
cnList.push(cn.combinedExpanderPrefix +
(node.expanded ? "e" : "c") +
(node.lazy && node.children == null ? "d" : "") +
(isLastSib ? "l" : "")
);
}
cnList.push(cn.combinedIconPrefix +
(node.expanded ? "e" : "c") +
(node.folder ? "f" : "")
);
// node.span.className = cnList.join(" ");
statusElem.className = cnList.join(" ");
// TODO: we should not set this in the <span> tag also, if we set it here:
// Maybe most (all) of the classes should be set in LI instead of SPAN?
if(node.li){
node.li.className = isLastSib ? cn.lastsib : "";
}
},
/** Activate node.
* flag defaults to true.
* If flag is true, the node is activated (must be a synchronous operation)
* If flag is false, the node is deactivated (must be a synchronous operation)
* @param {EventData} ctx
* @param {boolean} [flag=true]
* @param {object} [opts] additional options. Defaults to {noEvents: false}
*/
nodeSetActive: function(ctx, flag, callOpts) {
// Handle user click / [space] / [enter], according to clickFolderMode.
callOpts = callOpts || {};
var subCtx,
node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
noEvents = (callOpts.noEvents === true),
isActive = (node === tree.activeNode);
// flag defaults to true
flag = (flag !== false);
// node.debug("nodeSetActive", flag);
if(isActive === flag){
// Nothing to do
return _getResolvedPromise(node);
}else if(flag && !noEvents && this._triggerNodeEvent("beforeActivate", node, ctx.originalEvent) === false ){
// Callback returned false
return _getRejectedPromise(node, ["rejected"]);
}
if(flag){
if(tree.activeNode){
_assert(tree.activeNode !== node, "node was active (inconsistency)");
subCtx = $.extend({}, ctx, {node: tree.activeNode});
tree.nodeSetActive(subCtx, false);
_assert(tree.activeNode === null, "deactivate was out of sync?");
}
if(opts.activeVisible){
// tree.nodeMakeVisible(ctx);
node.makeVisible({scrollIntoView: false}); // nodeSetFocus will scroll
}
tree.activeNode = node;
tree.nodeRenderStatus(ctx);
tree.nodeSetFocus(ctx);
if( !noEvents ) {
tree._triggerNodeEvent("activate", node, ctx.originalEvent);
}
}else{
_assert(tree.activeNode === node, "node was not active (inconsistency)");
tree.activeNode = null;
this.nodeRenderStatus(ctx);
if( !noEvents ) {
ctx.tree._triggerNodeEvent("deactivate", node, ctx.originalEvent);
}
}
},
/** Expand or collapse node, return Deferred.promise.
*
* @param {EventData} ctx
* @param {boolean} [flag=true]
* @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false}
* @returns {$.Promise} The deferred will be resolved as soon as the (lazy)
* data was retrieved, rendered, and the expand animation finshed.
*/
nodeSetExpanded: function(ctx, flag, callOpts) {
callOpts = callOpts || {};
var _afterLoad, dfd, i, l, parents, prevAC,
node = ctx.node,
tree = ctx.tree,
opts = ctx.options,
noAnimation = (callOpts.noAnimation === true),
noEvents = (callOpts.noEvents === true);
// flag defaults to true
flag = (flag !== false);
// node.debug("nodeSetExpanded(" + flag + ")");
if((node.expanded && flag) || (!node.expanded && !flag)){
// Nothing to do
// node.debug("nodeSetExpanded(" + flag + "): nothing to do");
return _getResolvedPromise(node);
}else if(flag && !node.lazy && !node.hasChildren() ){
// Prevent expanding of empty nodes
// return _getRejectedPromise(node, ["empty"]);
return _getResolvedPromise(node);
}else if( !flag && node.getLevel() < opts.minExpandLevel ) {
// Prevent collapsing locked levels
return _getRejectedPromise(node, ["locked"]);
}else if ( !noEvents && this._triggerNodeEvent("beforeExpand", node, ctx.originalEvent) === false ){
// Callback returned false
return _getRejectedPromise(node, ["rejected"]);
}
// If this node inside a collpased node, no animation and scrolling is needed
if( !noAnimation && !node.isVisible() ) {
noAnimation = callOpts.noAnimation = true;
}
dfd = new $.Deferred();
// Auto-collapse mode: collapse all siblings
if( flag && !node.expanded && opts.autoCollapse ) {
parents = node.getParentList(false, true);
prevAC = opts.autoCollapse;
try{
opts.autoCollapse = false;
for(i=0, l=parents.length; i<l; i++){
// TODO: should return promise?
this._callHook("nodeCollapseSiblings", parents[i], callOpts);
}
}finally{
opts.autoCollapse = prevAC;
}
}
// Trigger expand/collapse after expanding
dfd.done(function(){
if( flag && opts.autoScroll && !noAnimation ) {
// Scroll down to last child, but keep current node visible
node.getLastChild().scrollIntoView(true, {topNode: node}).always(function(){
if( !noEvents ) {
ctx.tree._triggerNodeEvent(flag ? "expand" : "collapse", ctx);
}
});
} else {
if( !noEvents ) {
ctx.tree._triggerNodeEvent(flag ? "expand" : "collapse", ctx);
}
}
});
// vvv Code below is executed after loading finished:
_afterLoad = function(callback){
var duration, easing, isVisible, isExpanded;
node.expanded = flag;
// Create required markup, but make sure the top UL is hidden, so we
// can animate later
tree._callHook("nodeRender", ctx, false, false, true);
// If the currently active node is now hidden, deactivate it
// if( opts.activeVisible && this.activeNode && ! this.activeNode.isVisible() ) {
// this.activeNode.deactivate();
// }
// Expanding a lazy node: set 'loading...' and call callback
// if( bExpand && this.data.isLazy && this.childList === null && !this._isLoading ) {
// this._loadContent();
// return;
// }
// Hide children, if node is collapsed
if( node.ul ) {
isVisible = (node.ul.style.display !== "none");
isExpanded = !!node.expanded;
if ( isVisible === isExpanded ) {
node.warn("nodeSetExpanded: UL.style.display already set");
} else if ( !opts.fx || noAnimation ) {
node.ul.style.display = ( node.expanded || !parent ) ? "" : "none";
} else {
duration = opts.fx.duration || 200;
easing = opts.fx.easing;
// node.debug("nodeSetExpanded: animate start...");
$(node.ul).animate(opts.fx, duration, easing, function(){
// node.debug("nodeSetExpanded: animate done");
callback();
});
return;
}
}
callback();
};
// ^^^ Code above is executed after loading finshed.
// Load lazy nodes, if any. Then continue with _afterLoad()
if(flag && node.lazy && node.hasChildren() === undefined){
// node.debug("nodeSetExpanded: load start...");
node.load().done(function(){
// node.debug("nodeSetExpanded: load done");
if(dfd.notifyWith){ // requires jQuery 1.6+
dfd.notifyWith(node, ["loaded"]);
}
_afterLoad(function () { dfd.resolveWith(node); });
}).fail(function(errMsg){
_afterLoad(function () { dfd.rejectWith(node, ["load failed (" + errMsg + ")"]); });
});
/*
var source = tree._triggerNodeEvent("lazyLoad", node, ctx.originalEvent);
_assert(typeof source !== "boolean", "lazyLoad event must return source in data.result");
node.debug("nodeSetExpanded: load start...");
this._callHook("nodeLoadChildren", ctx, source).done(function(){
node.debug("nodeSetExpanded: load done");
if(dfd.notifyWith){ // requires jQuery 1.6+
dfd.notifyWith(node, ["loaded"]);
}
_afterLoad.call(tree);
}).fail(function(errMsg){
dfd.rejectWith(node, ["load failed (" + errMsg + ")"]);
});
*/
}else{
_afterLoad(function () { dfd.resolveWith(node); });
}
// node.debug("nodeSetExpanded: returns");
return dfd.promise();
},
/** Focus ot blur this node.
* @param {EventData} ctx
* @param {boolean} [flag=true]
*/
nodeSetFocus: function(ctx, flag) {
// ctx.node.debug("nodeSetFocus(" + flag + ")");
var ctx2,
tree = ctx.tree,
node = ctx.node;
flag = (flag !== false);
// Blur previous node if any
if(tree.focusNode){
if(tree.focusNode === node && flag){
// node.debug("nodeSetFocus(" + flag + "): nothing to do");
return;
}
ctx2 = $.extend({}, ctx, {node: tree.focusNode});
tree.focusNode = null;
this._triggerNodeEvent("blur", ctx2);
this._callHook("nodeRenderStatus", ctx2);
}
// Set focus to container and node
if(flag){
if( !this.hasFocus() ){
node.debug("nodeSetFocus: forcing container focus");
// Note: we pass _calledByNodeSetFocus=true
this._callHook("treeSetFocus", ctx, true, true);
}
// this.nodeMakeVisible(ctx);
node.makeVisible({scrollIntoView: false});
tree.focusNode = node;
// node.debug("FOCUS...");
// $(node.span).find(".fancytree-title").focus();
this._triggerNodeEvent("focus", ctx);
// if(ctx.options.autoActivate){
// tree.nodeSetActive(ctx, true);
// }
if(ctx.options.autoScroll){
node.scrollIntoView();
}
this._callHook("nodeRenderStatus", ctx);
}
},
/** (De)Select node, return new status (sync).
*
* @param {EventData} ctx
* @param {boolean} [flag=true]
*/
nodeSetSelected: function(ctx, flag) {
var node = ctx.node,
tree = ctx.tree,
opts = ctx.options;
// flag defaults to true
flag = (flag !== false);
node.debug("nodeSetSelected(" + flag + ")", ctx);
if( node.unselectable){
return;
}
// TODO: !!node.expanded is nicer, but doesn't pass jshint
// https://github.com/jshint/jshint/issues/455
// if( !!node.expanded === !!flag){
if((node.selected && flag) || (!node.selected && !flag)){
return !!node.selected;
}else if ( this._triggerNodeEvent("beforeSelect", node, ctx.originalEvent) === false ){
return !!node.selected;
}
if(flag && opts.selectMode === 1){
// single selection mode
if(tree.lastSelectedNode){
tree.lastSelectedNode.setSelected(false);
}
}else if(opts.selectMode === 3){
// multi.hier selection mode
node.selected = flag;
// this._fixSelectionState(node);
node.fixSelection3AfterClick();
}
node.selected = flag;
this.nodeRenderStatus(ctx);
tree.lastSelectedNode = flag ? node : null;
tree._triggerNodeEvent("select", ctx);
},
/** Show node status (ok, loading, error) using styles and a dummy child node.
*
* @param {EventData} ctx
* @param status
* @param message
* @param details
*/
nodeSetStatus: function(ctx, status, message, details) {
var node = ctx.node,
tree = ctx.tree;
// cn = ctx.options._classNames;
function _clearStatusNode() {
// Remove dedicated dummy node, if any
var firstChild = ( node.children ? node.children[0] : null );
if ( firstChild && firstChild.isStatusNode() ) {
try{
// I've seen exceptions here with loadKeyPath...
if(node.ul){
node.ul.removeChild(firstChild.li);
firstChild.li = null; // avoid leaks (DT issue 215)
}
}catch(e){}
if( node.children.length === 1 ){
node.children = [];
}else{
node.children.shift();
}
}
}
function _setStatusNode(data, type) {
// Create/modify the dedicated dummy node for 'loading...' or
// 'error!' status. (only called for direct child of the invisible
// system root)
var firstChild = ( node.children ? node.children[0] : null );
if ( firstChild && firstChild.isStatusNode() ) {
$.extend(firstChild, data);
// tree._callHook("nodeRender", firstChild);
tree._callHook("nodeRenderTitle", firstChild);
} else {
data.key = "_statusNode";
node._setChildren([data]);
node.children[0].statusNodeType = type;
tree.render();
}
return node.children[0];
}
switch( status ){
case "ok":
_clearStatusNode();
// $(node.span).removeClass(cn.loading).removeClass(cn.error);
node._isLoading = false;
node._error = null;
node.renderStatus();
break;
case "loading":
// $(node.span).removeClass(cn.error).addClass(cn.loading);
if( !node.parent ) {
_setStatusNode({
title: tree.options.strings.loading + (message ? " (" + message + ") " : ""),
tooltip: details,
extraClasses: "fancytree-statusnode-wait"
}, status);
}
node._isLoading = true;
node._error = null;
node.renderStatus();
break;
case "error":
// $(node.span).removeClass(cn.loading).addClass(cn.error);
_setStatusNode({
title: tree.options.strings.loadError + (message ? " (" + message + ") " : ""),
tooltip: details,
extraClasses: "fancytree-statusnode-error"
}, status);
node._isLoading = false;
node._error = { message: message, details: details };
node.renderStatus();
break;
default:
$.error("invalid node status " + status);
}
},
/**
*
* @param {EventData} ctx
*/
nodeToggleExpanded: function(ctx) {
return this.nodeSetExpanded(ctx, !ctx.node.expanded);
},
/**
* @param {EventData} ctx
*/
nodeToggleSelected: function(ctx) {
return this.nodeSetSelected(ctx, !ctx.node.selected);
},
/** Remove all nodes.
* @param {EventData} ctx
*/
treeClear: function(ctx) {
var tree = ctx.tree;
tree.activeNode = null;
tree.focusNode = null;
tree.$div.find(">ul.fancytree-container").empty();
// TODO: call destructors and remove reference loops
tree.rootNode.children = null;
},
/** Widget was created (called only once, even it re-initialized).
* @param {EventData} ctx
*/
treeCreate: function(ctx) {
},
/** Widget was destroyed.
* @param {EventData} ctx
*/
treeDestroy: function(ctx) {
},
/** Widget was (re-)initialized.
* @param {EventData} ctx
*/
treeInit: function(ctx) {
//this.debug("Fancytree.treeInit()");
this.treeLoad(ctx);
},
/** Parse Fancytree from source, as configured in the options.
* @param {EventData} ctx
* @param {object} [source] optional new source (use last data otherwise)
*/
treeLoad: function(ctx, source) {
var type, $ul,
tree = ctx.tree,
$container = ctx.widget.element,
dfd,
// calling context for root node
rootCtx = $.extend({}, ctx, {node: this.rootNode});
if(tree.rootNode.children){
this.treeClear(ctx);
}
source = source || this.options.source;
if(!source){
type = $container.data("type") || "html";
switch(type){
case "html":
$ul = $container.find(">ul:first");
$ul.addClass("ui-fancytree-source ui-helper-hidden");
source = $.ui.fancytree.parseHtml($ul);
// allow to init tree.data.foo from <ul data-foo=''>
this.data = $.extend(this.data, _getElementDataAsDict($ul));
break;
case "json":
// $().addClass("ui-helper-hidden");
source = $.parseJSON($container.text());
if(source.children){
if(source.title){tree.title = source.title;}
source = source.children;
}
break;
default:
$.error("Invalid data-type: " + type);
}
}else if(typeof source === "string"){
// TODO: source is an element ID
$.error("Not implemented");
}
// $container.addClass("ui-widget ui-widget-content ui-corner-all");
// Trigger fancytreeinit after nodes have been loaded
dfd = this.nodeLoadChildren(rootCtx, source).done(function(){
tree.render();
if( ctx.options.selectMode === 3 ){
tree.rootNode.fixSelection3FromEndNodes();
}
tree._triggerTreeEvent("init", null, { status: true });
}).fail(function(){
tree.render();
tree._triggerTreeEvent("init", null, { status: false });
});
return dfd;
},
/** Node was inserted into or removed from the tree.
* @param {EventData} ctx
* @param {boolean} add
* @param {FancytreeNode} node
*/
treeRegisterNode: function(ctx, add, node) {
},
/** Widget got focus.
* @param {EventData} ctx
* @param {boolean} [flag=true]
*/
treeSetFocus: function(ctx, flag, _calledByNodeSetFocus) {
flag = (flag !== false);
// this.debug("treeSetFocus(" + flag + "), _calledByNodeSetFocus: " + _calledByNodeSetFocus);
// this.debug(" focusNode: " + this.focusNode);
// this.debug(" activeNode: " + this.activeNode);
if( flag !== this.hasFocus() ){
this._hasFocus = flag;
this.$container.toggleClass("fancytree-treefocus", flag);
this._triggerTreeEvent(flag ? "focusTree" : "blurTree");
}
}
});
/* ******************************************************************************
* jQuery UI widget boilerplate
*/
/**
* The plugin (derrived from <a href=" http://api.jqueryui.com/jQuery.widget/">jQuery.Widget</a>).<br>
* This constructor is not called directly. Use `$(selector).fancytree({})`
* to initialize the plugin instead.<br>
* <pre class="sh_javascript sunlight-highlight-javascript">// Access widget methods and members:
* var tree = $("#tree").fancytree("getTree");
* var node = $("#tree").fancytree("getActiveNode", "1234");
* </pre>
*
* @mixin Fancytree_Widget
*/
$.widget("ui.fancytree",
/** @lends Fancytree_Widget# */
{
/**These options will be used as defaults
* @type {FancytreeOptions}
*/
options:
{
activeVisible: true,
ajax: {
type: "GET",
cache: false, // false: Append random '_' argument to the request url to prevent caching.
// timeout: 0, // >0: Make sure we get an ajax error if server is unreachable
dataType: "json" // Expect json format and pass json object to callbacks.
}, //
aria: false, // TODO: default to true
autoActivate: true,
autoCollapse: false,
// autoFocus: false,
autoScroll: false,
checkbox: false,
/**defines click behavior*/
clickFolderMode: 4,
debugLevel: null, // 0..2 (null: use global setting $.ui.fancytree.debugInfo)
disabled: false, // TODO: required anymore?
enableAspx: true, // TODO: document
extensions: [],
fx: { height: "toggle", duration: 200 },
generateIds: false,
icons: true,
idPrefix: "ft_",
focusOnSelect: false,
keyboard: true,
keyPathSeparator: "/",
minExpandLevel: 1,
quicksearch: false,
scrollOfs: {top: 0, bottom: 0},
scrollParent: null,
selectMode: 2,
strings: {
loading: "Loading…",
loadError: "Load error!"
},
tabbable: true,
titlesTabbable: false,
_classNames: {
node: "fancytree-node",
folder: "fancytree-folder",
combinedExpanderPrefix: "fancytree-exp-",
combinedIconPrefix: "fancytree-ico-",
hasChildren: "fancytree-has-children",
active: "fancytree-active",
selected: "fancytree-selected",
expanded: "fancytree-expanded",
lazy: "fancytree-lazy",
focused: "fancytree-focused",
partsel: "fancytree-partsel",
unselectable: "fancytree-unselectable",
lastsib: "fancytree-lastsib",
loading: "fancytree-loading",
error: "fancytree-error"
},
// events
lazyLoad: null,
postProcess: null
},
/* Set up the widget, Called on first $().fancytree() */
_create: function() {
this.tree = new Fancytree(this);
this.$source = this.source || this.element.data("type") === "json" ? this.element
: this.element.find(">ul:first");
// Subclass Fancytree instance with all enabled extensions
var extension, extName, i,
extensions = this.options.extensions,
base = this.tree;
for(i=0; i<extensions.length; i++){
extName = extensions[i];
extension = $.ui.fancytree._extensions[extName];
if(!extension){
$.error("Could not apply extension '" + extName + "' (it is not registered, did you forget to include it?)");
}
// Add extension options as tree.options.EXTENSION
// _assert(!this.tree.options[extName], "Extension name must not exist as option name: " + extName);
this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]);
// Add a namespace tree.ext.EXTENSION, to hold instance data
_assert(this.tree.ext[extName] === undefined, "Extension name must not exist as Fancytree.ext attribute: '" + extName + "'");
// this.tree[extName] = extension;
this.tree.ext[extName] = {};
// Subclass Fancytree methods using proxies.
_subclassObject(this.tree, base, extension, extName);
// current extension becomes base for the next extension
base = extension;
}
//
this.tree._callHook("treeCreate", this.tree);
// Note: 'fancytreecreate' event is fired by widget base class
// this.tree._triggerTreeEvent("create");
},
/* Called on every $().fancytree() */
_init: function() {
this.tree._callHook("treeInit", this.tree);
// TODO: currently we call bind after treeInit, because treeInit
// might change tree.$container.
// It would be better, to move ebent binding into hooks altogether
this._bind();
},
/* Use the _setOption method to respond to changes to options */
_setOption: function(key, value) {
var callDefault = true,
rerender = false;
switch( key ) {
case "aria":
case "checkbox":
case "icons":
case "minExpandLevel":
case "tabbable":
// case "nolink":
this.tree._callHook("treeCreate", this.tree);
rerender = true;
break;
case "source":
callDefault = false;
this.tree._callHook("treeLoad", this.tree, value);
break;
}
this.tree.debug("set option " + key + "=" + value + " <" + typeof(value) + ">");
if(callDefault){
// In jQuery UI 1.8, you have to manually invoke the _setOption method from the base widget
$.Widget.prototype._setOption.apply(this, arguments);
// TODO: In jQuery UI 1.9 and above, you use the _super method instead
// this._super( "_setOption", key, value );
}
if(rerender){
this.tree.render(true, false); // force, not-deep
}
},
/** Use the destroy method to clean up any modifications your widget has made to the DOM */
destroy: function() {
this._unbind();
this.tree._callHook("treeDestroy", this.tree);
// this.element.removeClass("ui-widget ui-widget-content ui-corner-all");
this.tree.$div.find(">ul.fancytree-container").remove();
this.$source && this.$source.removeClass("ui-helper-hidden");
// In jQuery UI 1.8, you must invoke the destroy method from the base widget
$.Widget.prototype.destroy.call(this);
// TODO: delete tree and nodes to make garbage collect easier?
// TODO: In jQuery UI 1.9 and above, you would define _destroy instead of destroy and not call the base method
},
// -------------------------------------------------------------------------
/* Remove all event handlers for our namespace */
_unbind: function() {
var ns = this.tree._ns;
this.element.unbind(ns);
this.tree.$container.unbind(ns);
$(document).unbind(ns);
},
/* Add mouse and kyboard handlers to the container */
_bind: function() {
var that = this,
opts = this.options,
tree = this.tree,
ns = tree._ns
// selstartEvent = ( $.support.selectstart ? "selectstart" : "mousedown" )
;
// Remove all previuous handlers for this tree
this._unbind();
//alert("keydown" + ns + "foc=" + tree.hasFocus() + tree.$container);
// tree.debug("bind events; container: ", tree.$container);
tree.$container.on("focusin" + ns + " focusout" + ns, function(event){
var node = FT.getNode(event),
flag = (event.type === "focusin");
// tree.debug("Tree container got event " + event.type, node, event);
// tree.treeOnFocusInOut.call(tree, event);
if(node){
// For example clicking into an <input> that is part of a node
tree._callHook("nodeSetFocus", node, flag);
}else{
tree._callHook("treeSetFocus", tree, flag);
}
}).on("selectstart" + ns, "span.fancytree-title", function(event){
// prevent mouse-drags to select text ranges
// tree.debug("<span title> got event " + event.type);
event.preventDefault();
}).on("keydown" + ns, function(event){
// TODO: also bind keyup and keypress
// tree.debug("got event " + event.type + ", hasFocus:" + tree.hasFocus());
// if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){
if(opts.disabled || opts.keyboard === false ){
return true;
}
var res,
node = tree.focusNode, // node may be null
ctx = tree._makeHookContext(node || tree, event),
prevPhase = tree.phase;
try {
tree.phase = "userEvent";
// If a 'fancytreekeydown' handler returns false, skip the default
// handling (implemented by tree.nodeKeydown()).
if(node){
res = tree._triggerNodeEvent("keydown", node, event);
}else{
res = tree._triggerTreeEvent("keydown", event);
}
if ( res === "preventNav" ){
res = true; // prevent keyboard navigation, but don't prevent default handling of embedded input controls
} else if ( res !== false ){
res = tree._callHook("nodeKeydown", ctx);
}
return res;
} finally {
tree.phase = prevPhase;
}
}).on("click" + ns + " dblclick" + ns, function(event){
if(opts.disabled){
return true;
}
var ctx,
et = FT.getEventTarget(event),
node = et.node,
tree = that.tree,
prevPhase = tree.phase;
if( !node ){
return true; // Allow bubbling of other events
}
ctx = tree._makeHookContext(node, event);
// that.tree.debug("event(" + event.type + "): node: ", node);
try {
tree.phase = "userEvent";
switch(event.type) {
case "click":
ctx.targetType = et.type;
return ( tree._triggerNodeEvent("click", ctx, event) === false ) ? false : tree._callHook("nodeClick", ctx);
case "dblclick":
ctx.targetType = et.type;
return ( tree._triggerNodeEvent("dblclick", ctx, event) === false ) ? false : tree._callHook("nodeDblclick", ctx);
}
// } catch(e) {
// // var _ = null; // DT issue 117 // TODO
// $.error(e);
} finally {
tree.phase = prevPhase;
}
});
},
/** Return the active node or null.
* @returns {FancytreeNode}
*/
getActiveNode: function() {
return this.tree.activeNode;
},
/** Return the matching node or null.
* @param {string} key
* @returns {FancytreeNode}
*/
getNodeByKey: function(key) {
return this.tree.getNodeByKey(key);
},
/** Return the invisible system root node.
* @returns {FancytreeNode}
*/
getRootNode: function() {
return this.tree.rootNode;
},
/** Return the current tree instance.
* @returns {Fancytree}
*/
getTree: function() {
return this.tree;
}
});
// $.ui.fancytree was created by the widget factory. Create a local shortcut:
FT = $.ui.fancytree;
/**
* Static members in the `$.ui.fancytree` namespace.<br>
* <br>
* <pre class="sh_javascript sunlight-highlight-javascript">// Access static members:
* var node = $.ui.fancytree.getNode(element);
* alert($.ui.fancytree.version);
* </pre>
*
* @mixin Fancytree_Static
*/
$.extend($.ui.fancytree,
/** @lends Fancytree_Static# */
{
/** @type {string} */
version: "2.6.0", // Set to semver by 'grunt release'
/** @type {string} */
buildType: "production", // Set to 'production' by 'grunt build'
/** @type {int} */
debugLevel: 1, // Set to 1 by 'grunt build'
// Used by $.ui.fancytree.debug() and as default for tree.options.debugLevel
_nextId: 1,
_nextNodeKey: 1,
_extensions: {},
// focusTree: null,
/** Expose class object as $.ui.fancytree._FancytreeClass */
_FancytreeClass: Fancytree,
/** Expose class object as $.ui.fancytree._FancytreeNodeClass */
_FancytreeNodeClass: FancytreeNode,
/* Feature checks to provide backwards compatibility */
jquerySupports: {
// http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at
positionMyOfs: isVersionAtLeast($.ui.version, 1, 9)
},
/** Throw an error if condition fails (debug method).
* @param {boolean} cond
* @param {string} msg
*/
assert: function(cond, msg){
return _assert(cond, msg);
},
/** Return a function that executes *fn* at most every *timeout* ms.
* @param {integer} timeout
* @param {function} fn
* @param {boolean} [invokeAsap=false]
* @param {any} [ctx]
*/
debounce : function(timeout, fn, invokeAsap, ctx) {
var timer;
if(arguments.length === 3 && typeof invokeAsap !== "boolean") {
ctx = invokeAsap;
invokeAsap = false;
}
return function() {
var args = arguments;
ctx = ctx || this;
invokeAsap && !timer && fn.apply(ctx, args);
clearTimeout(timer);
timer = setTimeout(function() {
invokeAsap || fn.apply(ctx, args);
timer = null;
}, timeout);
};
},
/** Write message to console if debugLevel >= 2
* @param {string} msg
*/
debug: function(msg){
/*jshint expr:true */
($.ui.fancytree.debugLevel >= 2) && consoleApply("log", arguments);
},
/** Write error message to console.
* @param {string} msg
*/
error: function(msg){
consoleApply("error", arguments);
},
/** Convert <, >, &, ", ', / to the equivalent entitites.
*
* @param {string} s
* @returns {string}
*/
escapeHtml: function(s){
return ("" + s).replace(/[&<>"'\/]/g, function (s) {
return ENTITY_MAP[s];
});
},
/** Inverse of escapeHtml().
*
* @param {string} s
* @returns {string}
*/
unescapeHtml: function(s){
var e = document.createElement("div");
e.innerHTML = s;
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
},
/** Return a {node: FancytreeNode, type: TYPE} object for a mouse event.
*
* @param {Event} event Mouse event, e.g. click, ...
* @returns {string} 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined
*/
getEventTargetType: function(event){
return this.getEventTarget(event).type;
},
/** Return a {node: FancytreeNode, type: TYPE} object for a mouse event.
*
* @param {Event} event Mouse event, e.g. click, ...
* @returns {object} Return a {node: FancytreeNode, type: TYPE} object
* TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined
*/
getEventTarget: function(event){
var tcn = event && event.target ? event.target.className : "",
res = {node: this.getNode(event.target), type: undefined};
// We use a fast version of $(res.node).hasClass()
// See http://jsperf.com/test-for-classname/2
if( /\bfancytree-title\b/.test(tcn) ){
res.type = "title";
}else if( /\bfancytree-expander\b/.test(tcn) ){
res.type = (res.node.hasChildren() === false ? "prefix" : "expander");
}else if( /\bfancytree-checkbox\b/.test(tcn) || /\bfancytree-radio\b/.test(tcn) ){
res.type = "checkbox";
}else if( /\bfancytree-icon\b/.test(tcn) ){
res.type = "icon";
}else if( /\bfancytree-node\b/.test(tcn) ){
// Somewhere near the title
res.type = "title";
}else if( event && event.target && $(event.target).closest(".fancytree-title").length ) {
// #228: clicking an embedded element inside a title
res.type = "title";
}
return res;
},
/** Return a FancytreeNode instance from element.
*
* @param {Element | jQueryObject | Event} el
* @returns {FancytreeNode} matching node or null
*/
getNode: function(el){
if(el instanceof FancytreeNode){
return el; // el already was a FancytreeNode
}else if(el.selector !== undefined){
el = el[0]; // el was a jQuery object: use the DOM element
}else if(el.originalEvent !== undefined){
el = el.target; // el was an Event
}
while( el ) {
if(el.ftnode) {
return el.ftnode;
}
el = el.parentNode;
}
return null;
},
/* Return a Fancytree instance from element.
* TODO: this function could help to get around the data('fancytree') / data('ui-fancytree') problem
* @param {Element | jQueryObject | Event} el
* @returns {Fancytree} matching tree or null
* /
getTree: function(el){
if(el instanceof Fancytree){
return el; // el already was a Fancytree
}else if(el.selector !== undefined){
el = el[0]; // el was a jQuery object: use the DOM element
}else if(el.originalEvent !== undefined){
el = el.target; // el was an Event
}
...
return null;
},
*/
/** Write message to console if debugLevel >= 1
* @param {string} msg
*/
info: function(msg){
/*jshint expr:true */
($.ui.fancytree.debugLevel >= 1) && consoleApply("info", arguments);
},
/**
* Parse tree data from HTML <ul> markup
*
* @param {jQueryObject} $ul
* @returns {NodeData[]}
*/
parseHtml: function($ul) {
// TODO: understand this:
/*jshint validthis:true */
var extraClasses, i, l, iPos, tmp, tmp2, classes, className,
$children = $ul.find(">li"),
children = [];
$children.each(function() {
var allData,
$li = $(this),
$liSpan = $li.find(">span:first", this),
$liA = $liSpan.length ? null : $li.find(">a:first"),
d = { tooltip: null, data: {} };
if( $liSpan.length ) {
d.title = $liSpan.html();
} else if( $liA && $liA.length ) {
// If a <li><a> tag is specified, use it literally and extract href/target.
d.title = $liA.html();
d.data.href = $liA.attr("href");
d.data.target = $liA.attr("target");
d.tooltip = $liA.attr("title");
} else {
// If only a <li> tag is specified, use the trimmed string up to
// the next child <ul> tag.
d.title = $li.html();
iPos = d.title.search(/<ul/i);
if( iPos >= 0 ){
d.title = d.title.substring(0, iPos);
}
}
d.title = $.trim(d.title);
// Make sure all fields exist
for(i=0, l=CLASS_ATTRS.length; i<l; i++){
d[CLASS_ATTRS[i]] = undefined;
}
// Initialize to `true`, if class is set and collect extraClasses
classes = this.className.split(" ");
extraClasses = [];
for(i=0, l=classes.length; i<l; i++){
className = classes[i];
if(CLASS_ATTR_MAP[className]){
d[className] = true;
}else{
extraClasses.push(className);
}
}
d.extraClasses = extraClasses.join(" ");
// Parse node options from ID, title and class attributes
tmp = $li.attr("title");
if( tmp ){
d.tooltip = tmp; // overrides <a title='...'>
}
tmp = $li.attr("id");
if( tmp ){
d.key = tmp;
}
// Add <li data-NAME='...'> as node.data.NAME
allData = _getElementDataAsDict($li);
if(allData && !$.isEmptyObject(allData)) {
// #56: Allow to set special node.attributes from data-...
for(i=0, l=NODE_ATTRS.length; i<l; i++){
tmp = NODE_ATTRS[i];
tmp2 = allData[tmp];
if( tmp2 != null ) {
delete allData[tmp];
d[tmp] = tmp2;
}
}
// All other data-... goes to node.data...
$.extend(d.data, allData);
}
// Recursive reading of child nodes, if LI tag contains an UL tag
$ul = $li.find(">ul:first");
if( $ul.length ) {
d.children = $.ui.fancytree.parseHtml($ul);
}else{
d.children = d.lazy ? undefined : null;
}
children.push(d);
// FT.debug("parse ", d, children);
});
return children;
},
/** Add Fancytree extension definition to the list of globally available extensions.
*
* @param {object} definition
*/
registerExtension: function(definition){
_assert(definition.name != null, "extensions must have a `name` property.");
_assert(definition.version != null, "extensions must have a `version` property.");
$.ui.fancytree._extensions[definition.name] = definition;
},
/** Write warning message to console.
* @param {string} msg
*/
warn: function(msg){
consoleApply("warn", arguments);
}
});
}(jQuery, window, document));
|
test/containers/CounterPage.spec.js | openexp/OpenEXP | import React from 'react';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { Provider } from 'react-redux';
import { createBrowserHistory } from 'history';
import { ConnectedRouter } from 'react-router-redux';
import CounterPage from '../../app/containers/CounterPage';
import { configureStore } from '../../app/store/configureStore';
Enzyme.configure({ adapter: new Adapter() });
function setup(initialState) {
const store = configureStore(initialState);
const history = createBrowserHistory();
const provider = (
<Provider store={store}>
<ConnectedRouter history={history}>
<CounterPage />
</ConnectedRouter>
</Provider>
);
const app = mount(provider);
return {
app,
buttons: app.find('button'),
p: app.find('.counter')
};
}
describe('containers', () => {
describe('App', () => {
it('should display initial count', () => {
const { p } = setup();
expect(p.text()).toMatch(/^0$/);
});
it('should display updated count after increment button click', () => {
const { buttons, p } = setup();
buttons.at(0).simulate('click');
expect(p.text()).toMatch(/^1$/);
});
it('should display updated count after decrement button click', () => {
const { buttons, p } = setup();
buttons.at(1).simulate('click');
expect(p.text()).toMatch(/^-1$/);
});
it('shouldnt change if even and if odd button clicked', () => {
const { buttons, p } = setup();
buttons.at(2).simulate('click');
expect(p.text()).toMatch(/^0$/);
});
it('should change if odd and if odd button clicked', () => {
const { buttons, p } = setup({ counter: 1 });
buttons.at(2).simulate('click');
expect(p.text()).toMatch(/^2$/);
});
});
});
|
ajax/libs/datatables/1.10.2/js/jquery.js | perfect-pixell/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}); |
src/routes.js | c-hernandez/codex-5e | import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from 'containers/App/App';
import HomePage from 'containers/HomePage/HomePage';
import SpellPage from 'containers/SpellPage/SpellPage';
export default (
<Route path="/" component={App}>
<IndexRoute component={HomePage} />
<Route path="/:spell" component={SpellPage} />
</Route>
);
|
test/components/TodoTextInput.spec.js | web-seminar/redux-todo-tdd-demo | import React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import {
createRenderer
} from 'react-addons-test-utils';
import TodoTextInput from '../../src/components/TodoTextInput';
function setup(propOverrides) {
const props = Object.assign({
onSave: spy(),
text: 'TDD Demo',
placeholder: 'What needs to be done?'
}, propOverrides);
const renderer = createRenderer();
renderer.render(
<TodoTextInput {...props} />
);
const output = renderer.getRenderOutput();
return {
props: props,
output: output,
renderer: renderer
};
}
describe('components', () => {
describe('TodoTextInput', () => {
it('should render correctly', () => {
const { output } = setup();
expect(output.props.placeholder).to.equal('What needs to be done?');
expect(output.props.value).to.equal('TDD Demo');
expect(output.props.className).to.equal('new-todo');
});
it('should update value on change', () => {
const { output, renderer } = setup();
output.props.onChange({ target: { value: 'Use Redux' } });
const updated = renderer.getRenderOutput();
expect(updated.props.value).to.equal('Use Redux');
});
it('should call onSave on return key press', () => {
const { output, props } = setup();
output.props.onKeyDown({ which: 13, target: { value: 'TDD Demo' } });
expect(props.onSave).to.have.been.calledWith('TDD Demo');
});
it('should reset state on return key press', () => {
const { output, renderer } = setup();
output.props.onKeyDown({ which: 13, target: { value: 'TDD Demo' } });
const updated = renderer.getRenderOutput();
expect(updated.props.value).to.equal('');
});
});
});
|
apps/jquery-1.10.2.js | BrightSet/LightOS | /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.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%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={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:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.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(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,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":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
|
web/components/shared/Button/index.js | skidding/flatris | // @flow
import classNames from 'classnames';
import React from 'react';
import type { Node } from 'react';
export type ButtonProps = {|
type?: 'button' | 'submit' | 'reset',
children: Node,
disabled?: boolean,
bgColor?: string,
color?: string,
colorDisabled?: string,
hoverEffect?: boolean,
onClick?: Function,
onMouseDown?: Function,
onMouseUp?: Function,
onTouchStart?: Function,
onTouchEnd?: Function,
|};
export default function Button({
type = 'button',
children,
bgColor = '#34495f',
color = '#fff',
colorDisabled = 'rgba(255, 255, 255, 0.6)',
hoverEffect = true,
...rest
}: ButtonProps) {
const classes = classNames('button', {
'hover-button': hoverEffect,
});
return (
<button type={type} className={classes} {...rest}>
{children}
<style jsx>{`
.button {
position: absolute;
width: 100%;
height: 100%;
display: block;
margin: 0;
padding: 0;
border: 0;
background: ${bgColor};
color: ${color};
font-family: -apple-system, BlinkMacSystemFont, Ubuntu,
'Helvetica Neue', sans-serif;
font-size: 1.2em;
font-weight: 600;
text-transform: uppercase;
outline: none;
cursor: pointer;
user-select: none;
touch-action: manipulation;
}
.button:disabled {
cursor: default;
color: ${colorDisabled};
}
.hover-button {
transform: translate3d(0, 0, 0);
transition: transform 0.2s;
}
.hover-button:focus,
.hover-button:hover {
transform: translate3d(0, -0.25em, 0);
}
.hover-button:active,
.hover-button:disabled {
transform: translate3d(0, 0, 0);
}
`}</style>
</button>
);
}
|
docs/src/ComponentsPage.js | roadmanfong/react-bootstrap | /* eslint react/no-did-mount-set-state: 0 */
import React from 'react';
import Affix from '../../src/Affix';
import Nav from '../../src/Nav';
import SubNav from '../../src/SubNav';
import NavItem from '../../src/NavItem';
import NavMain from './NavMain';
import PageHeader from './PageHeader';
import PropTable from './PropTable';
import PageFooter from './PageFooter';
import ReactPlayground from './ReactPlayground';
import Samples from './Samples';
import Anchor from './Anchor';
const ComponentsPage = React.createClass({
getInitialState() {
return {
activeNavItemHref: null,
navOffsetTop: null
};
},
handleNavItemSelect(key, href) {
this.setState({
activeNavItemHref: href
});
window.location = href;
},
componentDidMount() {
let elem = React.findDOMNode(this.refs.sideNav);
let domUtils = Affix.domUtils;
let sideNavOffsetTop = domUtils.getOffset(elem).top;
let sideNavMarginTop = parseInt(domUtils.getComputedStyles(elem.firstChild).marginTop, 10);
let topNavHeight = React.findDOMNode(this.refs.topNav).offsetHeight;
this.setState({
navOffsetTop: sideNavOffsetTop - topNavHeight - sideNavMarginTop,
navOffsetBottom: React.findDOMNode(this.refs.footer).offsetHeight
});
},
render() {
return (
<div>
<NavMain activePage='components' ref='topNav' />
<PageHeader
title='Components'
subTitle='' />
<div className='container bs-docs-container'>
<div className='row'>
<div className='col-md-9' role='main'>
{/* Buttons */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='buttons'>Buttons</Anchor> <small>Button</small></h1>
<h2><Anchor id='buttons-options'>Options</Anchor></h2>
<p>Use any of the available button style types to quickly create a styled button. Just modify the <code>bsStyle</code> prop.</p>
<ReactPlayground codeText={Samples.ButtonTypes} />
<div className='bs-callout bs-callout-warning'>
<h4>Button spacing</h4>
<p>Because React doesn't output newlines between elements, buttons on the same line are displayed
flush against each other. To preserve the spacing between multiple inline buttons, wrap your
button group in <code>{'<ButtonToolbar />'}</code>.</p>
</div>
<h2><Anchor id='buttons-sizes'>Sizes</Anchor></h2>
<p>Fancy larger or smaller buttons? Add <code>bsSize="large"</code>, <code>bsSize="small"</code>, or <code>bsSize="xsmall"</code> for additional sizes.</p>
<ReactPlayground codeText={Samples.ButtonSizes} />
<p>Create block level buttons—those that span the full width of a parent— by adding the <code>block</code> prop.</p>
<ReactPlayground codeText={Samples.ButtonBlock} />
<h2><Anchor id='buttons-active'>Active state</Anchor></h2>
<p>To set a buttons active state simply set the components <code>active</code> prop.</p>
<ReactPlayground codeText={Samples.ButtonActive} />
<h2><Anchor id='buttons-disabled'>Disabled state</Anchor></h2>
<p>Make buttons look unclickable by fading them back 50%. To do this add the <code>disabled</code> attribute to buttons.</p>
<ReactPlayground codeText={Samples.ButtonDisabled} />
<div className='bs-callout bs-callout-warning'>
<h4>Event handler functionality not impacted</h4>
<p>This prop will only change the <code>{'<Button />'}</code>’s appearance, not its
functionality. Use custom logic to disable the effect of the <code>onClick</code> handlers.</p>
</div>
<h2><Anchor id='buttons-tags'>Button tags</Anchor></h2>
<p>The DOM element tag is choosen automatically for you based on the props you supply. Passing
a <code>href</code> will result in the button using a <code>{'<a />'}</code> element otherwise
a <code>{'<button />'}</code> element will be used.</p>
<ReactPlayground codeText={Samples.ButtonTagTypes} />
<h2><Anchor id='buttons-loading'>Button loading state</Anchor></h2>
<p>When activating an asynchronous action from a button it is a good UX pattern to give the user
feedback as to the loading state, this can easily be done by updating
your <code>{'<Button />'}</code>’s props from a state change like below.</p>
<ReactPlayground codeText={Samples.ButtonLoading} />
<h3><Anchor id='buttons-props'>Props</Anchor></h3>
<PropTable component='Button'/>
</div>
{/* Button Groups */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='btn-groups'>Button groups</Anchor> <small>ButtonGroup, ButtonToolbar</small></h1>
<p className='lead'>Group a series of buttons together on a single line with the button group.</p>
<h3><Anchor id='btn-groups-single'>Basic example</Anchor></h3>
<p>Wrap a series of <code>{'<Button />'}</code>s in a <code>{'<ButtonGroup />'}</code>.</p>
<ReactPlayground codeText={Samples.ButtonGroupBasic} />
<h3><Anchor id='btn-groups-toolbar'>Button toolbar</Anchor></h3>
<p>Combine sets of <code>{'<ButtonGroup />'}</code>s into a <code>{'<ButtonToolbar />'}</code> for more complex components.</p>
<ReactPlayground codeText={Samples.ButtonToolbarBasic} />
<h3><Anchor id='btn-groups-sizing'>Sizing</Anchor></h3>
<p>Instead of applying button sizing props to every button in a group, just add <code>bsSize</code> prop to the <code>{'<ButtonGroup />'}</code>.</p>
<ReactPlayground codeText={Samples.ButtonGroupSizes} />
<h3><Anchor id='btn-groups-nested'>Nesting</Anchor></h3>
<p>You can place other button types within the <code>{'<ButtonGroup />'}</code> like <code>{'<DropdownButton />'}</code>s.</p>
<ReactPlayground codeText={Samples.ButtonGroupNested} />
<h3><Anchor id='btn-groups-vertical'>Vertical variation</Anchor></h3>
<p>Make a set of buttons appear vertically stacked rather than horizontally. <strong
className='text-danger'>Split button dropdowns are not supported here.</strong></p>
<p>Just add <code>vertical</code> to the <code>{'<ButtonGroup />'}</code>.</p>
<ReactPlayground codeText={Samples.ButtonGroupVertical} />
<br />
<p>Moreover, you can have buttons be block level elements so they take the full width of their container, just add <code>block</code> to the <code>{'<ButtonGroup />'}</code>, in addition to the <code>vertical</code> you just added.</p>
<ReactPlayground codeText={Samples.ButtonGroupBlock} />
<h3><Anchor id='btn-groups-justified'>Justified button groups</Anchor></h3>
<p>Make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with button dropdowns within the button group.</p>
<div className='bs-callout bs-callout-warning'>
<h4>Style issues</h4>
<p>There are some issues and workarounds required when using this property, please see <a href='http://getbootstrap.com/components/#btn-groups-justified'>bootstrap’s button group docs</a> for more specifics.</p>
</div>
<p>Just add <code>justified</code> to the <code>{'<ButtonGroup />'}</code>.</p>
<ReactPlayground codeText={Samples.ButtonGroupJustified} />
<h3><Anchor id='btn-groups-props'>Props</Anchor></h3>
<PropTable component='ButtonGroup'/>
</div>
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='btn-dropdowns'>Button dropdowns</Anchor></h1>
<p className='lead'>Use <code>{'<DropdownButton />'}</code> or <code>{'<SplitButton />'}</code> components to display a button with a dropdown menu.</p>
<h3><Anchor id='btn-dropdowns-single'>Single button dropdowns</Anchor></h3>
<p>Create a dropdown button with the <code>{'<DropdownButton />'}</code> component.</p>
<ReactPlayground codeText={Samples.DropdownButtonBasic} />
<h3><Anchor id='btn-dropdowns-split'>Split button dropdowns</Anchor></h3>
<p>Similarly, create split button dropdowns with the <code>{'<SplitButton />'}</code> component.</p>
<ReactPlayground codeText={Samples.SplitButtonBasic} />
<h3><Anchor id='btn-dropdowns-sizing'>Sizing</Anchor></h3>
<p>Button dropdowns work with buttons of all sizes.</p>
<ReactPlayground codeText={Samples.DropdownButtonSizes} />
<h3><Anchor id='btn-dropdowns-nocaret'>No caret variation</Anchor></h3>
<p>Remove the caret using the <code>noCaret</code> prop.</p>
<ReactPlayground codeText={Samples.DropdownButtonNoCaret} />
<h3><Anchor id='btn-dropdowns-dropup'>Dropup variation</Anchor></h3>
<p>Trigger dropdown menus that site above the button by adding the <code>dropup</code> prop.</p>
<ReactPlayground codeText={Samples.SplitButtonDropup} />
<h3><Anchor id='btn-dropdowns-right'>Dropdown right variation</Anchor></h3>
<p>Trigger dropdown menus that align to the right of the button using the <code>pullRight</code> prop.</p>
<ReactPlayground codeText={Samples.SplitButtonRight} />
<h3><Anchor id='btn-dropdowns-props'>Props</Anchor></h3>
<h4><Anchor id='btn-dropdowns-props-dropdown'>DropdownButton</Anchor></h4>
<PropTable component='DropdownButton'/>
<h4><Anchor id='btn-dropdowns-props-split'>SplitButton</Anchor></h4>
<PropTable component='SplitButton'/>
</div>
{/* Menu Item */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='menu-item'>Menu Item</Anchor> <small> MenuItem</small></h1>
<p>This is a component used in other components (see <a href="buttons">Buttons</a>, <a href="#navbars">Navbars</a>).</p>
<p>It supports the basic anchor properties <code>href</code>, <code>target</code>, <code>title</code>.</p>
<p>It also supports different properties of the normal Bootstrap MenuItem.
<ul>
<li><code>header</code>: To add a header label to sections</li>
<li><code>divider</code>: Adds an horizontal divider between sections</li>
<li><code>disabled</code>: shows the item as disabled, and prevents the onclick</li>
<li><code>eventKey</code>: passed to the callback</li>
<li><code>onSelect</code>: a callback that is called when the user clicks the item.</li>
</ul>
<p>The callback is called with the following arguments: <code>eventKey</code>, <code>href</code> and <code>target</code></p>
</p>
<ReactPlayground codeText={Samples.MenuItem} />
<h3><Anchor id='menu-item-props'>Props</Anchor></h3>
<PropTable component='MenuItem'/>
</div>
{/* Panels */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='panels'>Panels</Anchor> <small>Panel, PanelGroup, Accordion</small></h1>
<h3><Anchor id='panels-basic'>Basic example</Anchor></h3>
<p>By default, all the <code><Panel /></code> does is apply some basic border and padding to contain some content.</p>
<p>You can pass on any additional properties you need, e.g. a custom <code>onClick</code> handler, as it is shown in the example code. They all will apply to the wrapper <code>div</code> element.</p>
<ReactPlayground codeText={Samples.PanelBasic} />
<h3><Anchor id='panels-collapsible'>Collapsible Panel</Anchor></h3>
<ReactPlayground codeText={Samples.PanelCollapsible} />
<h3><Anchor id='panels-heading'>Panel with heading</Anchor></h3>
<p>Easily add a heading container to your panel with the <code>header</code> prop.</p>
<ReactPlayground codeText={Samples.PanelWithHeading} />
<h3><Anchor id='panels-footer'>Panel with footer</Anchor></h3>
<p>Pass buttons or secondary text in the <code>footer</code> prop. Note that panel footers do not inherit colors and borders when using contextual variations as they are not meant to be in the foreground.</p>
<ReactPlayground codeText={Samples.PanelWithFooter} />
<h3><Anchor id='panels-contextual'>Contextual alternatives</Anchor></h3>
<p>Like other components, easily make a panel more meaningful to a particular context by adding a <code>bsStyle</code> prop.</p>
<ReactPlayground codeText={Samples.PanelContextual} />
<h3><Anchor id='panels-tables'>With tables and list groups</Anchor></h3>
<p>Add the <code>fill</code> prop to <code><Table /></code> or <code><ListGroup /></code> elements to make them fill the panel.</p>
<ReactPlayground codeText={Samples.PanelListGroupFill} />
<h3><Anchor id='panels-controlled'>Controlled PanelGroups</Anchor></h3>
<p><code>PanelGroup</code>s can be controlled by a parent component. The <code>activeKey</code> prop dictates which panel is open.</p>
<ReactPlayground codeText={Samples.PanelGroupControlled} />
<h3><Anchor id='panels-uncontrolled'>Uncontrolled PanelGroups</Anchor></h3>
<p><code>PanelGroup</code>s can also be uncontrolled where they manage their own state. The <code>defaultActiveKey</code> prop dictates which panel is open when initially.</p>
<ReactPlayground codeText={Samples.PanelGroupUncontrolled} />
<h3><Anchor id='panels-accordion'>Accordions</Anchor></h3>
<p><code><Accordion /></code> aliases <code><PanelGroup accordion /></code>.</p>
<ReactPlayground codeText={Samples.PanelGroupAccordion} />
<h3><Anchor id='panels-props'>Props</Anchor></h3>
<h4><Anchor id='panels-props-accordion'>Panels, Accordion</Anchor></h4>
<PropTable component='Panel'/>
<h4><Anchor id='panels-props-group'>PanelGroup</Anchor></h4>
<PropTable component='PanelGroup'/>
</div>
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='modals'>Modals</Anchor> <small>Modal</small></h1>
<h3><Anchor id='modals-static'>Static Markup</Anchor></h3>
<p>A modal dialog component</p>
<ReactPlayground codeText={Samples.ModalStatic} />
<h3><Anchor id='modals-live'>Basic example</Anchor></h3>
<p></p>
<p>
A modal with header, body, and set of actions in the footer. Use <code>{'<Modal/>'}</code> in combination with other components to
show or hide your Modal. The <code>{'<Modal/>'}</code> Component comes with
a few convenient "sub components": <code>{'<Modal.Header/>'}</code>, <code>{'<Modal.Title/>'}</code>, <code>{'<Modal.Body/>'}</code>,
and <code>{'<Modal.Footer/>'}</code>, which you can use to build the Modal content.
</p>
<ReactPlayground codeText={Samples.Modal} />
<div className='bs-callout bs-callout-info'>
<h4>Additional Import Options</h4>
<p>
The Modal Header, Title, Body, and Footer components are available as static properties the <code>{'<Modal/>'}</code> component, but you can also,
import them directly from the <code>/lib</code> directory like: <code>{"require('react-bootstrap/lib/ModalHeader')"}</code>.
</p>
</div>
<h3><Anchor id='modals-contained'>Contained Modal</Anchor></h3>
<p>You will need to add the following css to your project and ensure that your container has the <code>modal-container</code> class.</p>
<pre>
{React.DOM.code(null,
'.modal-container {\n' +
' position: relative;\n' +
'}\n' +
'.modal-container .modal, .modal-container .modal-backdrop {\n' +
' position: absolute;\n' +
'}\n'
)}
</pre>
<ReactPlayground codeText={Samples.ModalContained} />
<h3><Anchor id='modal-default-sizing'>Sizing modals using standard Bootstrap props</Anchor></h3>
<p>You can specify a bootstrap large or small modal by using the "bsSize" prop.</p>
<ReactPlayground codeText={Samples.ModalDefaultSizing} />
<h3><Anchor id='modal-custom-sizing'>Sizing modals using custom CSS</Anchor></h3>
<p>You can apply custom css to the modal dialog div using the "dialogClassName" prop. Example is using a custom css class with width set to 90%.</p>
<ReactPlayground codeText={Samples.ModalCustomSizing} />
<h3><Anchor id='modals-props'>Props</Anchor></h3>
<h4><Anchor id='modals-props-modal'>Modal</Anchor></h4>
<PropTable component='Modal'/>
<h4><Anchor id='modals-props-modal-header'>Modal.Header</Anchor></h4>
<PropTable component='ModalHeader'/>
<h4><Anchor id='modals-props-modal-title'>Modal.Title</Anchor></h4>
<PropTable component='ModalTitle'/>
<h4><Anchor id='modals-props-modal-body'>Modal.Body</Anchor></h4>
<PropTable component='ModalBody'/>
<h4><Anchor id='modals-props-modal-footer'>Modal.Footer</Anchor></h4>
<PropTable component='ModalFooter'/>
</div>
{/* Tooltip */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='tooltips'>Tooltip</Anchor></h1>
<p>
Tooltip component for a more stylish alternative to that anchor tag <code>title</code> attribute.
</p>
<ReactPlayground codeText={Samples.TooltipBasic} exampleClassName='tooltip-static'/>
<h4><Anchor id='tooltips-overlay-trigger'>With OverlayTrigger</Anchor></h4>
<p>Attach and position tooltips with <code>OverlayTrigger</code>.</p>
<ReactPlayground codeText={Samples.TooltipPositioned} />
<h4><Anchor id='tooltips-in-text'>In text copy</Anchor></h4>
<p>Positioned tooltip in text copy.</p>
<ReactPlayground codeText={Samples.TooltipInCopy} />
<h3><Anchor id='tooltips-props'>Props</Anchor></h3>
<h4><Anchor id='overlays-trigger-props'>Overlay Trigger</Anchor></h4>
<PropTable component='OverlayTrigger'/>
<h4><Anchor id='tooltips-props-tooltip'>Tooltip</Anchor></h4>
<PropTable component='Tooltip'/>
</div>
{/* Popover */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='popovers'>Popovers</Anchor></h1>
<p>
The Popover, offers a more robust alternative to the Tooltip for displaying overlays of content.
</p>
<ReactPlayground codeText={Samples.PopoverBasic}/>
<h4><Anchor id='popovers-overlay-trigger'>With OverlayTrigger</Anchor></h4>
<p>The Popover component, like the Tooltip can be used with an <code>OverlayTrigger</code> Component, and positioned around it.</p>
<ReactPlayground codeText={Samples.PopoverPositioned} />
<h4><Anchor id='popovers-trigger-behaviors'>Trigger behaviors</Anchor></h4>
<p>It's inadvisable to use <code>"hover"</code> or <code>"focus"</code> triggers for popovers, because they have poor accessibility from keyboard and on mobile devices.</p>
<ReactPlayground codeText={Samples.PopoverTriggerBehaviors} />
<h4><Anchor id='popovers-in-container'>Popover component in container</Anchor></h4>
<ReactPlayground codeText={Samples.PopoverContained} exampleClassName='bs-example-popover-contained' />
<h4><Anchor id='popovers-positioned-scrolling'>Positioned popover components in scrolling container</Anchor></h4>
<ReactPlayground codeText={Samples.PopoverPositionedScrolling} exampleClassName='bs-example-popover-scroll' />
<h3><Anchor id='popover-props'>Props</Anchor></h3>
<PropTable component='Popover'/>
</div>
{/* Overlay */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='overlays'>Overlay</Anchor></h1>
<p>
The <code>OverlayTrigger</code> component is great for most use cases, but as a higher level abstraction it can lack the flexibility needed
to build more nuanced or custom behaviors into your Overlay components. For these cases it can be helpful to forgo the trigger and use
the <code>Overlay</code> component directly.
</p>
<ReactPlayground codeText={Samples.Overlay}/>
<h4><Anchor id='overlays-overlay'>Use Overlay instead of Tooltip and Popover</Anchor></h4>
<p>
You don't need to use the provided <code>Tooltip</code> or <code>Popover</code> components. Creating custom overlays
is as easy as wrapping some markup in an <code>Overlay</code> component
</p>
<ReactPlayground codeText={Samples.OverlayCustom} />
<h3><Anchor id='overlays-props'>Props</Anchor></h3>
<PropTable component='Overlay'/>
</div>
{/* Progress Bar */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='progress'>Progress bars</Anchor> <small>ProgressBar</small></h1>
<p className='lead'>Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.</p>
<h2><Anchor id='progress-basic'>Basic example</Anchor></h2>
<p>Default progress bar.</p>
<ReactPlayground codeText={Samples.ProgressBarBasic} />
<h2><Anchor id='progress-label'>With label</Anchor></h2>
<p>Add a <code>label</code> prop to show a visible percentage. For low percentages, consider adding a min-width to ensure the label's text is fully visible.</p>
<p>The following keys are interpolated with the current values: <code>%(min)s</code>, <code>%(max)s</code>, <code>%(now)s</code>, <code>%(percent)s</code>, <code>%(bsStyle)s</code></p>
<ReactPlayground codeText={Samples.ProgressBarWithLabel} />
<h2><Anchor id='progress-screenreader-label'>Screenreader only label</Anchor></h2>
<p>Add a <code>srOnly</code> prop to hide the label visually.</p>
<ReactPlayground codeText={Samples.ProgressBarScreenreaderLabel} />
<h2><Anchor id='progress-contextual'>Contextual alternatives</Anchor></h2>
<p>Progress bars use some of the same button and alert classes for consistent styles.</p>
<ReactPlayground codeText={Samples.ProgressBarContextual} />
<h2><Anchor id='progress-striped'>Striped</Anchor></h2>
<p>Uses a gradient to create a striped effect. Not available in IE8.</p>
<ReactPlayground codeText={Samples.ProgressBarStriped} />
<h2><Anchor id='progress-animated'>Animated</Anchor></h2>
<p>Add <code>active</code> prop to animate the stripes right to left. Not available in IE9 and below.</p>
<ReactPlayground codeText={Samples.ProgressBarAnimated} />
<h2><Anchor id='progress-stacked'>Stacked</Anchor></h2>
<p>Nest <code><ProgressBar /></code>s to stack them.</p>
<ReactPlayground codeText={Samples.ProgressBarStacked} />
<h3><Anchor id='progress-props'>ProgressBar</Anchor></h3>
<PropTable component='ProgressBar'/>
</div>
{/* Nav */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='navs'>Navs</Anchor> <small>Nav, NavItem</small></h1>
<p>Navs come in two styles, <code>pills</code> and <code>tabs</code>. Disable a tab by adding <code>disabled</code>.</p>
<ReactPlayground codeText={Samples.NavBasic} />
<h3><Anchor id='navs-dropdown'>Dropdown</Anchor></h3>
<p>Add dropdowns using the <code>DropdownButton</code> component. Just make sure to set <code>navItem</code> property to true.</p>
<ReactPlayground codeText={Samples.NavDropdown} />
<h3><Anchor id='navs-stacked'>Stacked</Anchor></h3>
<p>They can also be <code>stacked</code> vertically.</p>
<ReactPlayground codeText={Samples.NavStacked} />
<h3><Anchor id='navs-justified'>Justified</Anchor></h3>
<p>They can be <code>justified</code> to take the full width of their parent.</p>
<ReactPlayground codeText={Samples.NavJustified} />
<h3><Anchor id='navs-props'>Props</Anchor></h3>
<h4><Anchor id='navs-props-nav'>Nav</Anchor></h4>
<PropTable component='Nav'/>
<h4><Anchor id='navs-props-navitem'>NavItem</Anchor></h4>
<PropTable component='NavItem'/>
</div>
{/* Navbar */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='navbars'>Navbars</Anchor> <small>Navbar, Nav, NavItem</small></h1>
<p>Navbars are by default accessible and will provide <code>role="navigation"</code>.</p>
<p>They also supports all the different Bootstrap classes as properties. Just camelCase the css class and remove navbar from it. For example <code>navbar-fixed-top</code> becomes the property <code>fixedTop</code>. The different properties are <code>fixedTop</code>, <code>fixedBottom</code>, <code>staticTop</code>, <code>inverse</code>, <code>fluid</code>.</p>
<p>You can drag elements to the right by specifying the <code>right</code> property on a nav group.</p>
<h3><Anchor id='navbars-basic'>Navbar Basic Example</Anchor></h3>
<ReactPlayground codeText={Samples.NavbarBasic} />
<h3><Anchor id='navbars-brand'>Navbar Brand Example</Anchor></h3>
<p>You can specify a brand by passing in a string to <code>brand</code>, or you can pass in a renderable component.</p>
<ReactPlayground codeText={Samples.NavbarBrand} />
<h3><Anchor id='navbars-mobile-friendly'>Mobile Friendly</Anchor></h3>
<p>To have a mobile friendly Navbar, specify the property <code>toggleNavKey</code> on the Navbar with a value corresponding to an <code>eventKey</code> of one of his <code>Nav</code> children. This child will be the one collapsed.</p>
<p>By setting the property {React.DOM.code(null, 'defaultNavExpanded')} the Navbar will start expanded by default.</p>
<div className='bs-callout bs-callout-info'>
<h4>Scrollbar overflow</h4>
<p>The height of the collapsible is slightly smaller than the real height. To hide the scroll bar, add the following css to your style files.</p>
<pre>
{React.DOM.code(null,
'.navbar-collapse {\n' +
' overflow: hidden;\n' +
'}\n'
)}
</pre>
</div>
<ReactPlayground codeText={Samples.NavbarCollapsible} />
<h3><Anchor id='navbars-mobile-friendly-multiple'>Mobile Friendly (Multiple Nav Components)</Anchor></h3>
<p>To have a mobile friendly Navbar that handles multiple <code>Nav</code> components use <code>CollapsibleNav</code>. The <code>toggleNavKey</code> must still be set, however, the corresponding <code>eventKey</code> must now be on the <code>CollapsibleNav</code> component.</p>
<div className="bs-callout bs-callout-info">
<h4>Div collapse</h4>
<p>The <code>navbar-collapse</code> div gets created as the collapsible element which follows the <a href="http://getbootstrap.com/components/#navbar-default">bootstrap</a> collapsible navbar documentation.</p>
<pre><div class="collapse navbar-collapse"></div></pre>
</div>
<ReactPlayground codeText={Samples.CollapsibleNav} />
<h3><Anchor id='navbar-props'>Props</Anchor></h3>
<PropTable component='Navbar'/>
</div>
{/* Tabbed Areas */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='tabs'>Togglable tabs</Anchor> <small>TabbedArea, TabPane</small></h1>
<p>Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.</p>
<h3><Anchor id='tabs-uncontrolled'>Uncontrolled</Anchor></h3>
<p>Allow the component to control its own state.</p>
<ReactPlayground codeText={Samples.TabbedAreaUncontrolled} exampleClassName='bs-example-tabs' />
<h3><Anchor id='tabs-controlled'>Controlled</Anchor></h3>
<p>Pass down the active state on render via props.</p>
<ReactPlayground codeText={Samples.TabbedAreaControlled} exampleClassName='bs-example-tabs' />
<h3><Anchor id='tabs-no-animation'>No animation</Anchor></h3>
<p>Set the <code>animation</code> prop to <code>false</code></p>
<ReactPlayground codeText={Samples.TabbedAreaNoAnimation} exampleClassName='bs-example-tabs' />
<div className='bs-callout bs-callout-info'>
<h4>Extends tabbed navigation</h4>
<p>This plugin extends the <a href='#navs'>tabbed navigation component</a> to add tabbable areas.</p>
</div>
<h3><Anchor id='tabs-props'>Props</Anchor></h3>
<h4><Anchor id='tabs-props-area'>TabbedArea</Anchor></h4>
<PropTable component='TabbedArea'/>
<h4><Anchor id='tabs-props-pane'>TabPane</Anchor></h4>
<PropTable component='TabPane'/>
</div>
{/* Pager */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='pager'>Pager</Anchor> <small>Pager, PageItem</small></h1>
<p>Quick previous and next links.</p>
<h3><Anchor id='pager-default'>Centers by default</Anchor></h3>
<ReactPlayground codeText={Samples.PagerDefault} />
<h3><Anchor id='pager-aligned'>Aligned</Anchor></h3>
<p>Set the <code>previous</code> or <code>next</code> prop to <code>true</code>, to align left or right.</p>
<ReactPlayground codeText={Samples.PagerAligned} />
<h3><Anchor id='pager-disabled'>Disabled</Anchor></h3>
<p>Set the <code>disabled</code> prop to <code>true</code> to disable the link.</p>
<ReactPlayground codeText={Samples.PagerDisabled} />
<h3><Anchor id='pager-props'>Props</Anchor></h3>
<h4><Anchor id='pager-props-pager'>Pager</Anchor></h4>
<PropTable component='Pager'/>
<h4><Anchor id='pager-props-pageitem'>PageItem</Anchor></h4>
<PropTable component='PageItem'/>
</div>
{/* Pagination */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='pagination'>Pagination</Anchor> <small>Pagination</small></h1>
<p>Provide pagination links for your site or app with the multi-page pagination component. Set <code>items</code> to the number of pages. <code>activePage</code> prop dictates which page is active</p>
<ReactPlayground codeText={Samples.PaginationBasic} />
<h4><Anchor id='pagination-more'>More options</Anchor></h4>
<p>such as <code>first</code>, <code>last</code>, <code>previous</code>, <code>next</code> and <code>ellipsis</code>.</p>
<ReactPlayground codeText={Samples.PaginationAdvanced} />
<h3><Anchor id='pagination-props'>Props</Anchor></h3>
<PropTable component='Pagination'/>
</div>
{/* Alerts */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='alerts'>Alert messages</Anchor> <small>Alert</small></h1>
<p>Basic alert styles.</p>
<ReactPlayground codeText={Samples.AlertBasic} />
<h4><Anchor id='alerts-closeable'>Closeable alerts</Anchor></h4>
<p>just pass in a <code>onDismiss</code> function.</p>
<ReactPlayground codeText={Samples.AlertDismissable} />
<h4><Anchor id='alerts-auto-closeable'>Auto closeable</Anchor></h4>
<p>Auto close after a set time with <code>dismissAfter</code> prop.</p>
<ReactPlayground codeText={Samples.AlertAutoDismissable} />
<h3><Anchor id='alert-props'>Props</Anchor></h3>
<PropTable component='Alert'/>
</div>
{/* Carousels */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='carousels'>Carousels</Anchor> <small>Carousel, CarouselItem</small></h1>
<h3><Anchor id='carousels-uncontrolled'>Uncontrolled</Anchor></h3>
<p>Allow the component to control its own state.</p>
<ReactPlayground codeText={Samples.CarouselUncontrolled} exampleClassName='bs-example-tabs' />
<h3><Anchor id='carousels-controlled'>Controlled</Anchor></h3>
<p>Pass down the active state on render via props.</p>
<ReactPlayground codeText={Samples.CarouselControlled} exampleClassName='bs-example-tabs' />
<h3><Anchor id='carousels-props'>Props</Anchor></h3>
<h4><Anchor id='carousels-props-carousel'>Carousel</Anchor></h4>
<PropTable component='Carousel'/>
<h4><Anchor id='carousels-props-item'>CarouselItem</Anchor></h4>
<PropTable component='CarouselItem'/>
</div>
{/* Grids */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='grids'>Grids</Anchor> <small>Grid, Row, Col</small></h1>
<ReactPlayground codeText={Samples.GridBasic} exampleClassName='bs-example-tabs' />
<h3><Anchor id='grids-props'>Props</Anchor></h3>
<h4><Anchor id='grids-props-grid'>Grid</Anchor></h4>
<PropTable component='Grid'/>
<h4><Anchor id='grids-props-row'>Row</Anchor></h4>
<PropTable component='Row'/>
<h4><Anchor id='grids-props-col'>Col</Anchor></h4>
<PropTable component='Col'/>
</div>
{/* Thumbnail */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='thumbnail'>Thumbnail</Anchor></h1>
<p>Thumbnails are designed to showcase linked images with minimal required markup. You can extend the grid component with thumbnails.</p>
<h3><Anchor id='thumbnail-anchor'>Anchor Thumbnail</Anchor></h3>
<p>Creates an anchor wrapping an image.</p>
<ReactPlayground codeText={Samples.ThumbnailAnchor} />
<h3><Anchor id='thumbnail-divider'>Divider Thumbnail</Anchor></h3>
<p>Creates a divider wrapping an image and other children elements.</p>
<ReactPlayground codeText={Samples.ThumbnailDiv} />
<h3><Anchor id='thumbnail-props'>Props</Anchor></h3>
<PropTable component='Thumbnail'/>
</div>
{/* ListGroup */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='listgroup'>List group</Anchor> <small>ListGroup, ListGroupItem</small></h1>
<p>Quick previous and next links.</p>
<h3><Anchor id='listgroup-default'>Centers by default</Anchor></h3>
<ReactPlayground codeText={Samples.ListGroupDefault} />
<h3><Anchor id='listgroup-linked'>Linked</Anchor></h3>
<p>Set the <code>href</code> or <code>onClick</code> prop on <code>ListGroupItem</code>, to create a linked or clickable element.</p>
<ReactPlayground codeText={Samples.ListGroupLinked} />
<h3><Anchor id='listgroup-styling-state'>Styling by state</Anchor></h3>
<p>Set the <code>active</code> or <code>disabled</code> prop to <code>true</code> to mark or disable the item.</p>
<ReactPlayground codeText={Samples.ListGroupActive} />
<h3><Anchor id='listgroup-styling-color'>Styling by color</Anchor></h3>
<p>Set the <code>bsStyle</code> prop to style the item</p>
<ReactPlayground codeText={Samples.ListGroupStyle} />
<h3><Anchor id='listgroup-with-header'>With header</Anchor></h3>
<p>Set the <code>header</code> prop to create a structured item, with a heading and a body area.</p>
<ReactPlayground codeText={Samples.ListGroupHeader} />
<h3><Anchor id='listgroup-props'>Props</Anchor></h3>
<h4><Anchor id='listgroup-props-group'>ListGroup</Anchor></h4>
<PropTable component='ListGroup'/>
<h4><Anchor id='listgroup-props-item'>ListGroupItem</Anchor></h4>
<PropTable component='ListGroupItem'/>
</div>
{/* Labels */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='labels'>Labels</Anchor></h1>
<p>Create a <code>{'<Label>label</Label>'}</code> to highlight information</p>
<ReactPlayground codeText={Samples.Label} />
<h3><Anchor id='labels-variations'>Available variations</Anchor></h3>
<p>Add any of the below mentioned modifier classes to change the appearance of a label.</p>
<ReactPlayground codeText={Samples.LabelVariations} />
<h3><Anchor id='label-props'>Props</Anchor></h3>
<PropTable component='Label'/>
</div>
{/* Badges */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='badges'>Badges</Anchor></h1>
<p>Easily highlight new or unread items by adding a <code>{'<Badge>'}</code> to links, Bootstrap navs, and more.</p>
<ReactPlayground codeText={Samples.Badge} />
<div className='bs-callout bs-callout-info'>
<h4>Cross-browser compatibility</h4>
<p>Unlike regular Bootstrap badges self collapse even in Internet Explorer 8.</p>
</div>
<h3><Anchor id='badges-props'>Props</Anchor></h3>
<PropTable component='Badge'/>
</div>
{/* Jumbotron */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='jumbotron'>Jumbotron</Anchor></h1>
<p>A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.</p>
<ReactPlayground codeText={Samples.Jumbotron} />
<h3><Anchor id='jumbotron-props'>Props</Anchor></h3>
<PropTable component='Jumbotron'/>
</div>
{/* Page Header */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='page-header'>Page Header</Anchor></h1>
<p>A simple shell for an <code>h1</code> to appropriately space out and segment sections of content on a page. It can utilize the <code>h1</code>’s default <code>small</code> element, as well as most other components (with additional styles).</p>
<ReactPlayground codeText={Samples.PageHeader} />
</div>
{/* Wells */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='wells'>Wells</Anchor></h1>
<p>Use the well as a simple effect on an element to give it an inset effect.</p>
<ReactPlayground codeText={Samples.Well} />
<h2><Anchor id='wells-optional'>Optional classes</Anchor></h2>
<p>Control padding and rounded corners with two optional modifier classes.</p>
<ReactPlayground codeText={Samples.WellSizes} />
<h3><Anchor id='wells-props'>Props</Anchor></h3>
<PropTable component='Well'/>
</div>
{/* Glyphicons */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='glyphicons'>Glyphicons</Anchor></h1>
<p>Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.</p>
<ReactPlayground codeText={Samples.Glyphicon} />
<h3><Anchor id='glyphicons-props'>Props</Anchor></h3>
<PropTable component='Glyphicon'/>
</div>
{/* Tables */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='tables'>Tables</Anchor></h1>
<p>Use the <code>striped</code>, <code>bordered</code>, <code>condensed</code> and <code>hover</code> props to customise the table.</p>
<ReactPlayground codeText={Samples.TableBasic} />
<h2><Anchor id='table-responsive'>Responsive</Anchor></h2>
<p>Add <code>responsive</code> prop to make them scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.</p>
<ReactPlayground codeText={Samples.TableResponsive} />
<h3><Anchor id='table-props'>Props</Anchor></h3>
<PropTable component='Table'/>
</div>
{/* Input */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='input'>Input</Anchor></h1>
<p>Renders an input in bootstrap wrappers. Supports label, help, text input add-ons, validation and use as wrapper.
Use <code>getValue()</code> or <code>getChecked()</code> to get the current state.
The helper method <code>getInputDOMNode()</code> returns the internal input element. If you don't want the <code>form-group</code> class applied apply the prop named <code>standalone</code>.</p>
<ReactPlayground codeText={Samples.Input} />
<h3><Anchor id='input-types'>Types</Anchor></h3>
<p>Supports <code>select</code>, <code>textarea</code>, as well as standard HTML input types. <code>getValue()</code> returns an array for multiple select.</p>
<ReactPlayground codeText={Samples.InputTypes} />
<h3><Anchor id='input-static'>FormControls.Static</Anchor></h3>
<p>Static text can be added to your form controls through the use of the <code>FormControls.Static</code> component.</p>
<ReactPlayground codeText={Samples.StaticText} />
<h3><Anchor id='button-input-types'>Button Input Types</Anchor></h3>
<p>Form buttons are encapsulated by <code>ButtonInput</code>. Pass in <code>type="reset"</code> or <code>type="submit"</code> to suit your needs. Styling is the same as <code>Button</code>.</p>
<ReactPlayground codeText={Samples.ButtonInput} />
<h3><Anchor id='input-addons'>Add-ons</Anchor></h3>
<p>Use <code>addonBefore</code> and <code>addonAfter</code> for normal addons, <code>buttonBefore</code> and <code>buttonAfter</code> for button addons.
Exotic configurations may require some css on your side.</p>
<ReactPlayground codeText={Samples.InputAddons} />
<h3><Anchor id='input-sizes'>Sizes</Anchor></h3>
<p>Use <code>bsSize</code> to change the size of inputs. It also works with addons and most other options.</p>
<ReactPlayground codeText={Samples.InputSizes} />
<h3><Anchor id='input-validation'>Validation</Anchor></h3>
<p>Set <code>bsStyle</code> to one of <code>success</code>, <code>warning</code> or <code>error</code>.
Add <code>hasFeedback</code> to show glyphicon. Glyphicon may need additional styling if there is an add-on or no label.</p>
<ReactPlayground codeText={Samples.InputValidation} />
<h3><Anchor id='input-horizontal'>Horizontal forms</Anchor></h3>
<p>Use <code>labelClassName</code> and <code>wrapperClassName</code> properties to add col classes manually.
<code>checkbox</code> and <code>radio</code> types need special treatment because label wraps input.</p>
<ReactPlayground codeText={Samples.InputHorizontal} />
<h3><Anchor id='input-wrapper'>Use as a wrapper</Anchor></h3>
<p>If <code>type</code> is not set, child element(s) will be rendered instead of an input element.
<code>getValue()</code> will not work when used this way.</p>
<ReactPlayground codeText={Samples.InputWrapper} />
<h3><Anchor id='input-props'>Props</Anchor></h3>
<PropTable component='InputBase'/>
</div>
{/* Utilities */}
<div className='bs-docs-section'>
<h1 className='page-header'><Anchor id='utilities'>Utilities</Anchor> <small>Portal, Position</small></h1>
<h2><Anchor id='utilities-portal'>Portal</Anchor></h2>
<p>
A Component that renders its children into a new React "subtree" or <code>container</code>. The Portal component kind of like the React
equivalent to jQuery's <code>.appendTo()</code>, which is helpful for components that need to be appended to a DOM node other than
the component's direct parent. The Modal, and Overlay components use the Portal component internally.
</p>
<h3><Anchor id='utilities-portal-props'>Props</Anchor></h3>
<PropTable component='Portal'/>
<h2 id='utilities-position'><Anchor id='utilities-position'>Position</Anchor></h2>
<p>
A Component that absolutely positions its child to a <code>target</code> component or DOM node. Useful for creating custom
popups or tooltips. Used by the Overlay Components.
</p>
<h3><Anchor id='utilities-position-props'>Props</Anchor></h3>
<PropTable component='Position'/>
<h2><Anchor id='utilities-transitions'>Transitions</Anchor></h2>
<h3><Anchor id='utilities-collapse'>Collapse</Anchor></h3>
<p>Add a collapse toggle animation to an element or component.</p>
<ReactPlayground codeText={Samples.Collapse} />
<h4><Anchor id='utilities-collapse-props'>Props</Anchor></h4>
<PropTable component='Collapse'/>
<h3><Anchor id='utilities-fade'>Fade</Anchor></h3>
<p>Add a fade animation to a child element or component.</p>
<ReactPlayground codeText={Samples.Fade} />
<h4><Anchor id='utilities-fade-props'>Props</Anchor></h4>
<PropTable component='Fade'/>
</div>
</div>
<div className='col-md-3'>
<Affix
className='bs-docs-sidebar hidden-print'
role='complementary'
offsetTop={this.state.navOffsetTop}
offsetBottom={this.state.navOffsetBottom}>
<Nav
className='bs-docs-sidenav'
activeHref={this.state.activeNavItemHref}
onSelect={this.handleNavItemSelect}
ref='sideNav'>
<SubNav href='#buttons' key={1} text='Buttons'>
<NavItem href='#btn-groups' key={2}>Button groups</NavItem>
<NavItem href='#btn-dropdowns' key={3}>Button dropdowns</NavItem>
<NavItem href='#menu-item' key={25}>Menu Item</NavItem>
</SubNav>
<NavItem href='#panels' key={4}>Panels</NavItem>
<NavItem href='#modals' key={5}>Modals</NavItem>
<NavItem href='#tooltips' key={6}>Tooltips</NavItem>
<NavItem href='#popovers' key={7}>Popovers</NavItem>
<NavItem href='#overlays' key={27}>Overlays</NavItem>
<NavItem href='#progress' key={8}>Progress bars</NavItem>
<NavItem href='#navs' key={9}>Navs</NavItem>
<NavItem href='#navbars' key={10}>Navbars</NavItem>
<NavItem href='#tabs' key={11}>Togglable tabs</NavItem>
<NavItem href='#pager' key={12}>Pager</NavItem>
<NavItem href='#pagination' key={13}>Pagination</NavItem>
<NavItem href='#alerts' key={14}>Alerts</NavItem>
<NavItem href='#carousels' key={15}>Carousels</NavItem>
<NavItem href='#grids' key={16}>Grids</NavItem>
<NavItem href='#thumbnail' key={17}>Thumbnail</NavItem>
<NavItem href='#listgroup' key={18}>List group</NavItem>
<NavItem href='#labels' key={19}>Labels</NavItem>
<NavItem href='#badges' key={20}>Badges</NavItem>
<NavItem href='#jumbotron' key={21}>Jumbotron</NavItem>
<NavItem href='#page-header' key={22}>Page Header</NavItem>
<NavItem href='#wells' key={23}>Wells</NavItem>
<NavItem href='#glyphicons' key={24}>Glyphicons</NavItem>
<NavItem href='#tables' key={25}>Tables</NavItem>
<NavItem href='#input' key={26}>Input</NavItem>
<NavItem href='#utilities' key={28}>Utilities</NavItem>
</Nav>
<a className='back-to-top' href='#top'>
Back to top
</a>
</Affix>
</div>
</div>
</div>
<PageFooter ref='footer' />
</div>
);
}
});
export default ComponentsPage;
|
src/containers/Asians/TabControls/BreakRounds/EnterBreakRoundResults/Controls/InputProgress/index.js | westoncolemanl/tabbr-web | import React from 'react'
import Instance from './Instance'
export default ({
balProg
}) => {
return (
<div>
<Instance
finished={balProg.finished}
total={balProg.total}
title={'Ballots'}
/>
</div>
)
}
|
index.ios.js | zcs0843021123/Ranger | import React from 'react';
import {
AppRegistry,
} from 'react-native';
import SettingsConfig from './js/SettingsConfig';
import JsPractice from './js/JsPractice';
import EchartsDemo from './js/EchartsDemo';
// AppRegistry.registerComponent('Asuka', () => SettingsConfig);
AppRegistry.registerComponent('ReiAyanami', () => JsPractice);
|
ACL/src/ACL.js | CloudBoost/cloudboost | import React from 'react';
import ReactDOM from 'react-dom';
import { Modal, Button } from 'react-bootstrap';
import ACLRows from './aclRows.js'
// mui dependencies
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
class ACL extends React.Component {
constructor() {
super()
this.state = {
aclList: []
}
}
componentWillMount() {
this.generaliseACL(this.props.objectWithACL)
}
generaliseACL(props) {
let ACL = props.ACL.document ? props.ACL.document : props.ACL
let users = {}
let roles = {}
for (var k in ACL.read.allow.user) {
if (!users[ACL.read.allow.user[k]]) users[ACL.read.allow.user[k]] = {}
users[ACL.read.allow.user[k]].read = true
}
for (var k in ACL.read.deny.user) {
if (!users[ACL.read.deny.user[k]]) users[ACL.read.deny.user[k]] = {}
users[ACL.read.deny.user[k]].read = false
}
for (var k in ACL.write.allow.user) {
if (!users[ACL.write.allow.user[k]]) users[ACL.write.allow.user[k]] = {}
users[ACL.write.allow.user[k]].write = true
}
for (var k in ACL.write.deny.user) {
if (!users[ACL.write.deny.user[k]]) users[ACL.write.deny.user[k]] = {}
users[ACL.write.deny.user[k]].write = false
}
for (var k in ACL.read.allow.role) {
if (!roles[ACL.read.allow.role[k]]) roles[ACL.read.allow.role[k]] = {}
roles[ACL.read.allow.role[k]].read = true
}
for (var k in ACL.read.deny.role) {
if (!roles[ACL.read.deny.role[k]]) roles[ACL.read.deny.role[k]] = {}
roles[ACL.read.deny.role[k]].read = false
}
for (var k in ACL.write.allow.role) {
if (!roles[ACL.write.allow.role[k]]) roles[ACL.write.allow.role[k]] = {}
roles[ACL.write.allow.role[k]].write = true
}
for (var k in ACL.write.deny.role) {
if (!roles[ACL.write.deny.role[k]]) roles[ACL.write.deny.role[k]] = {}
roles[ACL.write.deny.role[k]].write = false
}
let usersList = []
let rolesList = []
usersList = Object.keys(users).map((x) => {
return {
id: x,
data: users[x],
type: 'user'
}
})
rolesList = Object.keys(roles).map((x) => {
return {
id: x,
data: roles[x],
type: 'role'
}
})
this.state.aclList = [...usersList, ...rolesList]
this.setState(this.state)
}
removeAcl(id) {
this.state.aclList = this.state.aclList.filter(x => x.id != id)
this.setState(this.state)
}
updateAclData(data, id) {
this.state.aclList = this.state.aclList.map((x) => {
if (x.id == id) {
x.data = data
}
return x
})
this.setState(this.state)
}
addAcl(obj) {
this.state.aclList.push(obj)
this.setState(this.state)
}
saveAcl() {
let AClObj = new CB.ACL()
for (var k in this.state.aclList) {
if (this.state.aclList[k].type == 'user' && this.state.aclList[k].id != 'all') {
let typeRead = this.state.aclList[k].data.read || false
let typeWrite = this.state.aclList[k].data.write || false
AClObj.setUserReadAccess(this.state.aclList[k].id, typeRead)
AClObj.setUserWriteAccess(this.state.aclList[k].id, typeWrite)
}
if (this.state.aclList[k].type == 'role') {
let typeRead = this.state.aclList[k].data.read || false
let typeWrite = this.state.aclList[k].data.write || false
AClObj.setRoleReadAccess(this.state.aclList[k].id, typeRead)
AClObj.setRoleWriteAccess(this.state.aclList[k].id, typeWrite)
}
if (this.state.aclList[k].id == 'all') {
AClObj.setPublicReadAccess(this.state.aclList[k].data.read)
AClObj.setPublicWriteAccess(this.state.aclList[k].data.write)
}
}
this.props.objectWithACL.ACL = AClObj
this.props.onACLSave(this.props.objectWithACL)
this.close()
}
close = () => {
this.props.closeACLModal()
}
render() {
return (
<Modal show={this.props.isOpenACLModal} onHide={this.close} dialogClassName={this.props.dialogClassName ? this.props.dialogClassName : "custom-modal"}>
<Modal.Header closeButton>
<Modal.Title>Edit ACL</Modal.Title>
</Modal.Header>
<Modal.Body>
<MuiThemeProvider>
<ACLRows
aclList={this.state.aclList}
removeAcl={this.removeAcl.bind(this)}
addAcl={this.addAcl.bind(this)}
updateAclData={this.updateAclData.bind(this)}
/>
</MuiThemeProvider>
</Modal.Body>
<Modal.Footer>
<Button onClick={this.close}>Cancel</Button>
<Button bsStyle="primary" onClick={this.saveAcl.bind(this)}>Save</Button>
</Modal.Footer>
</Modal>
);
}
}
// module.exports = ACL
export default ACL |
src/svg-icons/content/content-copy.js | lawrence-yu/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentContentCopy = (props) => (
<SvgIcon {...props}>
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>
</SvgIcon>
);
ContentContentCopy = pure(ContentContentCopy);
ContentContentCopy.displayName = 'ContentContentCopy';
ContentContentCopy.muiName = 'SvgIcon';
export default ContentContentCopy;
|
grunt/tasks/release.js | mohitbhatia1994/react | 'use strict';
var grunt = require('grunt');
var BOWER_PATH = '../react-bower/';
var BOWER_GLOB = [BOWER_PATH + '*.{js}'];
var BOWER_FILES = [
'react.js', 'react.min.js', 'JSXTransformer.js',
'react-with-addons.js', 'react-with-addons.min.js',
];
var GH_PAGES_PATH = '../react-gh-pages/';
var GH_PAGES_GLOB = [GH_PAGES_PATH + '*'];
var EXAMPLES_PATH = 'examples/';
var EXAMPLES_GLOB = [EXAMPLES_PATH + '**/*.*'];
var STARTER_PATH = 'starter/';
var STARTER_GLOB = [STARTER_PATH + '/**/*.*'];
var STARTER_BUILD_PATH = 'build/starter/';
var JS_PATH = 'build/';
var JS_GLOB = [JS_PATH + '/*.js'];
var VERSION;
var VERSION_STRING;
function _gitCommitAndTag(cwd, commitMsg, tag, cb) {
// `git add *` to make sure we catch untracked files
// `git add -u` to make sure we remove deleted files
// `git commit -m {commitMsg}`
// `git tag -a {tag}`
var opts = {cwd: cwd};
var gitAddAll = {
cmd: 'git',
args: ['add', '*'],
opts: opts,
};
var gitAddDel = {
cmd: 'git',
args: ['add', '-u'],
opts: opts,
};
var gitCommit = {
cmd: 'git',
args: ['commit', '-m', commitMsg],
opts: opts,
};
var gitTag = {
cmd: 'git',
args: ['tag', tag],
opts: opts,
};
grunt.util.spawn(gitAddAll, function() {
grunt.util.spawn(gitAddDel, function() {
grunt.util.spawn(gitCommit, function() {
if (tag) {
grunt.util.spawn(gitTag, cb);
} else {
cb();
}
});
});
});
}
function setup() {
if (!grunt.file.exists(BOWER_PATH)) {
grunt.log.error('Make sure you have the react-bower repository checked ' +
'out at ../react-bower');
return false;
}
if (!grunt.file.exists(GH_PAGES_PATH)) {
grunt.log.error('Make sure you have the react gh-pages branch checked ' +
'out at ../react-gh-pages.');
return false;
}
VERSION = grunt.config.data.pkg.version;
VERSION_STRING = 'v' + VERSION;
}
function bower() {
var done = this.async();
// clean out the bower folder in case we're removing files
var files = grunt.file.expand(BOWER_GLOB);
files.forEach(function(file) {
grunt.file.delete(file, {force: true});
});
// Now copy over build files
BOWER_FILES.forEach(function(file) {
grunt.file.copy('build/' + file, BOWER_PATH + file);
});
// Commit and tag the repo
_gitCommitAndTag(BOWER_PATH, VERSION_STRING, VERSION_STRING, done);
}
function docs() {
var done = this.async();
grunt.file.copy('build/react-' + VERSION + '.zip', 'docs/downloads/react-' + VERSION + '.zip');
grunt.file.copy('build/react.js', 'docs/js/react.js');
grunt.file.copy('build/JSXTransformer.js', 'docs/js/JSXTransformer.js');
var files = grunt.file.expand(GH_PAGES_GLOB);
files.forEach(function(file) {
grunt.file.delete(file, {force: true});
});
// Build the docs with `rake release`, which will compile the CSS & JS, then
// build jekyll into GH_PAGES_PATH
var rakeOpts = {
cmd: 'rake',
args: ['release'],
opts: {cwd: 'docs'},
};
grunt.util.spawn(rakeOpts, function() {
// Commit the repo. We don't really care about tagging this.
_gitCommitAndTag(GH_PAGES_PATH, VERSION_STRING, null, done);
});
}
function msg() {
// Just output a friendly reminder message for the rest of the process
grunt.log.subhead('Release *almost* complete...');
var steps = [
'Still todo:',
'* put files on CDN',
'* push changes to git repositories',
'* publish npm module (`npm publish .`)',
'* announce it on FB/Twitter/mailing list',
];
steps.forEach(function(ln) {
grunt.log.writeln(ln);
});
}
function starter() {
// Copy over examples/ to build/starter/examples/
// and starter/ to build/starter/
grunt.file.expand(EXAMPLES_GLOB).forEach(function(file) {
grunt.file.copy(
file,
STARTER_BUILD_PATH + file
);
});
grunt.file.expand(STARTER_GLOB).forEach(function(file) {
grunt.file.copy(
file,
'build/' + file
);
});
grunt.file.expand(JS_GLOB).forEach(function(file) {
grunt.file.copy(
file,
STARTER_BUILD_PATH + file
);
});
}
module.exports = {
setup: setup,
bower: bower,
docs: docs,
msg: msg,
starter: starter,
};
|
src/components/box/box.stories.js | teamleadercrm/teamleader-ui | import React from 'react';
import { addStoryInGroup, LOW_LEVEL_BLOCKS } from '../../../.storybook/utils';
import { number, select } from '@storybook/addon-knobs';
import { Box, TextBody, COLORS, TINTS } from '../../index';
const borderRadiusValues = ['square', 'circle', 'rounded'];
const displayValues = ['inline', 'inline-block', 'block', 'flex', 'inline-flex'];
const justifyContentValues = ['center', 'flex-start', 'flex-end', 'space-around', 'space-between', 'space-evenly'];
const textAlignValues = ['center', 'left', 'right'];
const marginOptions = {
range: true,
min: -8,
max: 8,
step: 1,
};
const paddingOptions = {
range: true,
min: 0,
max: 8,
step: 1,
};
export default {
component: Box,
title: addStoryInGroup(LOW_LEVEL_BLOCKS, 'Box'),
parameters: {
info: {
propTablesExclude: [TextBody],
},
},
};
export const basic = () => (
<Box
backgroundColor={select('Background color', COLORS, 'neutral')}
backgroundTint={select('Background tint', TINTS, 'light')}
borderWidth={number('Border width', 0)}
borderBottomWidth={number('Border bottom width', 0)}
borderLeftWidth={number('Border left width', 0)}
borderRightWidth={number('Border right width', 0)}
borderTopWidth={number('Border top width', 0)}
borderColor={select('Border color', COLORS, 'neutral')}
borderTint={select('Border tint', TINTS, 'dark')}
borderRadius={select('Border radius', borderRadiusValues, 'square')}
borderTopLeftRadius={select('Border top left radius', borderRadiusValues, 'square')}
borderTopRightRadius={select('Border top right radius', borderRadiusValues, 'square')}
borderBottomLeftRadius={select('Border bottom left radius', borderRadiusValues, 'square')}
borderBottomRightRadius={select('Border bottom right radius', borderRadiusValues, 'square')}
display={select('Display', displayValues, 'block')}
justifyContent={select('Justify Content', justifyContentValues, 'flex-start')}
margin={number('Margin', 0, marginOptions)}
marginBottom={number('Margin bottom', 0, marginOptions)}
marginLeft={number('Margin left', 0, marginOptions)}
marginRight={number('Margin right', 0, marginOptions)}
marginTop={number('Margin top', 0, marginOptions)}
padding={number('Padding', 3, paddingOptions)}
textAlign={select('Text align', textAlignValues, 'left')}
>
<TextBody>I'm body text inside a Box component</TextBody>
</Box>
);
|
js/app.js | pletcher/mission-hacks | import 'babel-polyfill'
import '../css/app.css'
import { browserHistory } from 'react-router'
import { Provider } from 'react-redux'
import { RelayRouter } from 'react-router-relay'
import cookies from 'lib/cookies'
import React from 'react'
import ReactDOM from 'react-dom'
import Relay from 'react-relay'
import routes from 'routes'
import store from 'store'
Relay.injectNetworkLayer(
new Relay.DefaultNetworkLayer('/graphql', {
headers: {
Authorization: `Bearer ${cookies.get('jwt')}`,
},
})
)
ReactDOM.render(
<Provider store={store}>
<RelayRouter history={browserHistory} routes={routes} />
</Provider>,
document.getElementById('root')
)
|
src/svg-icons/file/cloud-upload.js | owencm/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let FileCloudUpload = (props) => (
<SvgIcon {...props}>
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/>
</SvgIcon>
);
FileCloudUpload = pure(FileCloudUpload);
FileCloudUpload.displayName = 'FileCloudUpload';
FileCloudUpload.muiName = 'SvgIcon';
export default FileCloudUpload;
|
react-music-player/app/helloworld/index.js | zhongshanxian/SUM | import React from 'react';
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import Root from './Root';
render(
<AppContainer>
<Root />
</AppContainer>,
document.getElementById('root')
);
if (module.hot) {
module.hot.accept('./Root', () => {
const NewRoot = require('./Root').default;
render(
<AppContainer>
<NewRoot />
</AppContainer>,
document.getElementById('root')
);
});
}
|
app/javascript/mastodon/features/direct_timeline/components/conversations_list.js | NS-Kazuki/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ConversationContainer from '../containers/conversation_container';
import ScrollableList from '../../../components/scrollable_list';
import { debounce } from 'lodash';
export default class ConversationsList extends ImmutablePureComponent {
static propTypes = {
conversations: ImmutablePropTypes.list.isRequired,
hasMore: PropTypes.bool,
isLoading: PropTypes.bool,
onLoadMore: PropTypes.func,
shouldUpdateScroll: PropTypes.func,
};
getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id)
handleMoveUp = id => {
const elementIndex = this.getCurrentIndex(id) - 1;
this._selectChild(elementIndex);
}
handleMoveDown = id => {
const elementIndex = this.getCurrentIndex(id) + 1;
this._selectChild(elementIndex);
}
_selectChild (index) {
const element = this.node.node.querySelector(`article:nth-of-type(${index + 1}) .focusable`);
if (element) {
element.focus();
}
}
setRef = c => {
this.node = c;
}
handleLoadOlder = debounce(() => {
const last = this.props.conversations.last();
if (last && last.get('last_status')) {
this.props.onLoadMore(last.get('last_status'));
}
}, 300, { leading: true })
render () {
const { conversations, onLoadMore, ...other } = this.props;
return (
<ScrollableList {...other} onLoadMore={onLoadMore && this.handleLoadOlder} scrollKey='direct' ref={this.setRef}>
{conversations.map(item => (
<ConversationContainer
key={item.get('id')}
conversationId={item.get('id')}
onMoveUp={this.handleMoveUp}
onMoveDown={this.handleMoveDown}
/>
))}
</ScrollableList>
);
}
}
|
android/source/component/menuButton.js | cloudfavorites/favorites | import React, { Component } from 'react';
import {
Text,
View,
Image,
Alert,
TouchableOpacity
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import FloatButton from './floatButton';
import { FloatButtonStyles } from '../style';
const scrollButtonIcon = "ios-person";
const scrollButtonIconSize = 26;
class MenuButton extends Component {
constructor(props) {
super(props);
}
renderButtonContent(){
return (
<View>
<Icon name= { scrollButtonIcon }
size={ scrollButtonIconSize }
style={ FloatButtonStyles.icon }
/>
</View>
)
}
render() {
return (
<FloatButton onPress = { ()=> this.props.onPress() } style={ this.props.style }>
{ this.renderButtonContent() }
</FloatButton>
)
}
}
export default MenuButton;
|
client/node_modules/uu5g03/doc/main/server/public/data/source/uu5-forms-v3-internal-message.js | UnicornCollege/ucl.itkpd.configurator | import React from 'react';
import {BaseMixin, ContentMixin} from './../../common/common.js';
import {Div} from '../../bricks/bricks.js';
import './message.less';
export default React.createClass({
//@@viewOn:mixins
mixins: [
BaseMixin,
ContentMixin
],
//@@viewOff:mixins
//@@viewOn:statics
statics: {
tagName: "UU5.Forms.Message",
classNames: {
main: "uu5-forms-message"
}
},
//@@viewOff:statics
//@@viewOn:propTypes
propTypes: {
feedback: React.PropTypes.string
},
//@@viewOff:propTypes
//@@viewOn:getDefaultProps
getDefaultProps: function () {
return {
feedback: null
};
},
//@@viewOff:getDefaultProps
//@@viewOn:standardComponentLifeCycle
shouldComponentUpdate(newProps, newState){
let result = false;
if (newProps.content != this.props.content || newProps.feedback != this.props.feedback) {
result = true;
}
return result;
},
//@@viewOff:standardComponentLifeCycle
//@@viewOn:interface
//@@viewOff:interface
//@@viewOn:overridingMethods
//@@viewOff:overridingMethods
//@@viewOn:componentSpecificHelpers
_getMainPropsToPass(){
let mainAttrs = this.getMainPropsToPass();
mainAttrs.className += ' uu5-common-bg';
return mainAttrs;
},
//@@viewOff:componentSpecificHelpers
//@@viewOn:render
render: function () {
return (
//UU5.Bricks.Div is important for render content like html tags
<Div {...this._getMainPropsToPass()}>
{this.getChildren()}
</Div>
);
}
//@@viewOn:render
}); |
hello world/1.2 - component/src/components/main.js | wumouren/react-demo | import React from 'react';
export default class Main extends React.Component {
render() {
return (
<div>
<h1>这里是主要内容</h1>
</div>
)
}
} |
components/StoresListings.js | ben-scully/eMazon-Me | import React from 'react'
import { Link } from 'react-router'
import StoreTN from './StoreTN'
class StoresListings extends React.Component {
constructor(props) {
super(props)
}
render () {
return (
<div className="storesPage">
<h1>Stores Listings:</h1>
<div className="storesPageStoreTNs">
{this.props.storeTNs.map( tn =>
<div key={tn.storeID}>
<Link to={`/store/${tn.storeID}`}>
<StoreTN
name={tn.name}
logo={tn.logo}
items={tn.items} />
</Link>
</div>
)}
</div>
</div>
)}}
export default StoresListings
|
src/js/components/Retail/Login/partial/LoginFormOTP.js | ajainsyn/project | import React from 'react';
import { Link } from 'react-router-dom';
const LoginFormOTP = ({...props}) => {
return (
<div className="retail-login">
<div className="retail-login-header">
<h3>
Enter your One Time Password (OTP)
<span className="info-otp">Please check your registred mobile number 85xxxxxx25 for OTP</span>
</h3>
</div>
<form className="form-default">
<div className="form-box">
<label htmlFor="otp" className="form-label">One Time Passowrd (OTP)</label>
<input id="otp" name="otp" className="form-input" type="text" />
</div>
<div className="buttons">
<button className="btn btn-primary" onClick={props.backToLogin} >Back to login</button>
<Link to="/my-account" className="btn btn-default">Login to SYN Bank</Link>
</div>
</form>
</div>
)};
export default LoginFormOTP; |
client/src/app.js | inxilpro/react-redux-isomorphic-hot-boilerplate | 'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
import createProvider from './provider.js';
import createStore from './store';
// Determine if we have a debug session
let debugSession;
if (__DEV__) {
const matches = window.location.href.match(/[?&]debug_session=([^&]+)\b/);
if (matches && matches[1]) {
debugSession = matches[1];
}
}
// Load initial state from window
const initialState = window.__INITIAL_STATE__;
delete window.__INITIAL_STATE__;
const store = createStore(initialState, debugSession);
// Build provider component
const provider = createProvider(store);
// Render to DOM
ReactDOM.render(provider, document.getElementById('root'));
|
__tests__/App-test.js | concensus/react-native-ios-concensus | import 'react-native';
import React from 'react';
import App from '../App';
import renderer from 'react-test-renderer';
it('renders the loading screen', async () => {
const tree = renderer.create(<App />).toJSON();
expect(tree).toMatchSnapshot();
});
it('renders the root without loading screen', async () => {
const tree = renderer.create(<App skipLoadingScreen />).toJSON();
expect(tree).toMatchSnapshot();
});
|
src/Form/__tests__/FieldRadioButton-test.js | mesosphere/reactjs-components | jest.dontMock("../FieldRadioButton");
/* eslint-disable no-unused-vars */
var React = require("react");
/* eslint-enable no-unused-vars */
var TestUtils;
if (React.version.match(/15.[0-5]/)) {
TestUtils = require("react-addons-test-utils");
} else {
TestUtils = require("react-dom/test-utils");
}
var FieldRadioButton = require("../FieldRadioButton");
describe("FieldRadioButton", function() {
describe("#hasError", function() {
it("should return true when error contains name", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
startValue={[]}
validationError={{ foo: "bar" }}
/>
);
expect(instance.hasError()).toEqual(true);
});
it("should return false when error doesn't contains name", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
startValue={[]}
validationError={{ bar: "bar" }}
/>
);
expect(instance.hasError()).toEqual(false);
});
it("should return false when error is undefined", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton name="foo" startValue={[]} />
);
expect(instance.hasError()).toEqual(false);
});
});
describe("#getErrorMsg", function() {
it("should return a label if validationError is true", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
startValue={[]}
validationError={{ foo: "bar" }}
/>
);
expect(instance.getErrorMsg().type).toEqual("p");
});
it("should return null if validationError is false", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton name="foo" startValue={[]} />
);
expect(instance.getErrorMsg()).toEqual(null);
});
});
describe("#getLabel", function() {
it("should return a paragraph if showLabel has a value", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton name="foo" showLabel="bar" startValue={[]} />
);
expect(instance.getLabel().type).toEqual("p");
});
it("can handle a custom render function", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
showLabel={<h1>hello</h1>}
startValue={[]}
/>
);
expect(instance.getLabel().type).toEqual("h1");
});
it("should return null if showLabel doesn't has a value", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton name="foo" startValue={[]} />
);
expect(instance.getLabel()).toEqual(null);
});
});
describe("#getItems", function() {
beforeEach(function() {
this.handleEventSpy = jasmine.createSpy("handleEvent");
this.instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
handleEvent={this.handleEventSpy}
startValue={[
{ name: "foo" },
{ name: "bar", checked: true },
{ name: "quis", checked: false }
]}
labelClass="foo"
/>
);
this.children = TestUtils.scryRenderedDOMComponentsWithTag(
this.instance,
"label"
);
this.inputChildren = TestUtils.scryRenderedDOMComponentsWithTag(
this.instance,
"input"
);
});
it("should return an empty array if startValue is empty", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton name="foo" startValue={[]} />
);
expect(instance.getItems()).toEqual([]);
});
it("should display items pass in from startValue", function() {
expect(this.children.length).toEqual(3);
});
it("should display parent labelClass on all items", function() {
for (var i = 0; i < this.children.length; i++) {
expect(this.children[i].className).toContain("foo");
}
});
it("should override parent labelClass with item labelClass", function() {
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
startValue={[
{ name: "foo" },
{ name: "bar", checked: true, labelClass: "bar" },
{ name: "quis", checked: false }
]}
labelClass="foo"
/>
);
var children = TestUtils.scryRenderedDOMComponentsWithTag(
instance,
"label"
);
expect(children[1].className).toContain("bar");
});
it("should call handler with 'multipleChange' for items", function() {
TestUtils.Simulate.change(this.inputChildren[0], {
target: { checked: true }
});
var args = this.handleEventSpy.calls.mostRecent().args;
expect(args[0]).toEqual("multipleChange");
expect(args[1]).toEqual("foo");
expect(args[2]).toEqual([
{ name: "foo", checked: true },
{ name: "bar", checked: false }
]);
});
it("should call handleChange with 'change' on single item", function() {
var handleEventSpy = jasmine.createSpy("handleEvent");
var instance = TestUtils.renderIntoDocument(
<FieldRadioButton
name="foo"
handleEvent={handleEventSpy}
startValue={false}
labelClass="foo"
/>
);
var input = TestUtils.findRenderedDOMComponentWithTag(instance, "input");
TestUtils.Simulate.change(input, { target: { checked: true } });
var args = handleEventSpy.calls.mostRecent().args;
expect(args[0]).toEqual("change");
expect(args[1]).toEqual("foo");
expect(args[2]).toEqual(true);
});
it("should display the checked of each item", function() {
expect(this.inputChildren[0].checked).toEqual(false);
expect(this.inputChildren[1].checked).toEqual(true);
expect(this.inputChildren[2].checked).toEqual(false);
});
it("should change value of other checked items to false", function() {
this.instance.handleChange("multipleChange", "quis", {
target: { checked: true }
});
expect(this.handleEventSpy).toHaveBeenCalledWith(
// Event name
"multipleChange",
// Field name
"foo",
// Changed radio buttons
[{ name: "quis", checked: true }, { name: "bar", checked: false }],
// Event fired
{ target: { checked: true } }
);
});
});
});
|
ajax/libs/angular.js/1.0.0rc9/angular-scenario.js | steakknife/cdnjs | /*!
* jQuery JavaScript Library v1.7.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Wed Mar 21 12:46:34 2012 -0700
*/
(function( window, undefined ) {
'use strict';
// Use the correct document accordingly with window argument (sandbox)
var document = window.document,
navigator = window.navigator,
location = window.location;
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Used for trimming whitespace
trimLeft = /^\s+/,
trimRight = /\s+$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
// Useragent RegExp
rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Matches dashed string for camelizing
rdashAlpha = /-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + "" ).toUpperCase();
},
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// The deferred used on DOM ready
readyList,
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
// [[Class]] -> type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = selector;
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
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 = quickExpr.exec( selector );
}
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
doc = ( context ? context.ownerDocument || context : document );
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
}
} else {
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
}
return jQuery.merge( this, selector );
// 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: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.7.2",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return slice.call( this, 0 );
},
// 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 a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = this.constructor();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// 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 );
},
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.add( fn );
return this;
},
eq: function( i ) {
i = +i;
return i === -1 ?
this.slice( i ) :
this.slice( i, i + 1 );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ),
"slice", slice.call(arguments).join(",") );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
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: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// 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 ( length === i ) {
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({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// 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 ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// 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.fireWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).off( "ready" );
}
}
},
bindReady: function() {
if ( readyList ) {
return;
}
readyList = jQuery.Callbacks( "once memory" );
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
}
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
// 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 ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
// 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;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
var xml, tmp;
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;
},
noop: function() {},
// 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 && rnotwhite.test( 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.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction( object );
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
break;
}
}
}
}
return object;
},
// Use native String.trim function wherever possible
trim: trim ?
function( text ) {
return text == null ?
"" :
trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
},
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type( array );
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
}
}
return ret;
},
inArray: function( elem, array, i ) {
var len;
if ( array ) {
if ( indexOf ) {
return indexOf.call( array, elem, i );
}
len = array.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in array && array[ i ] === elem ) {
return i;
}
}
}
return -1;
},
merge: function( first, second ) {
var i = first.length,
j = 0;
if ( typeof second.length === "number" ) {
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value, key, ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( key in elems ) {
value = callback( elems[ key ], key, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return ret.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 ) {
if ( typeof context === "string" ) {
var 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
var args = slice.call( arguments, 2 ),
proxy = function() {
return fn.apply( context, 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 || proxy.guid || jQuery.guid++;
return proxy;
},
// Mutifunctional method to get and set values to a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
var exec,
bulk = key == null,
i = 0,
length = elems.length;
// Sets many values
if ( key && typeof key === "object" ) {
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
}
chainable = 1;
// Sets one value
} else if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = pass === undefined && jQuery.isFunction( value );
if ( bulk ) {
// Bulk operations only iterate when executing function values
if ( exec ) {
exec = fn;
fn = function( elem, key, value ) {
return exec.call( jQuery( elem ), value );
};
// Otherwise they run against the entire set
} else {
fn.call( elems, value );
fn = null;
}
}
if ( fn ) {
for (; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
}
chainable = 1;
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
sub: function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
}
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init( selector, context ) {
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
context = jQuerySub( context );
}
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
},
browser: {}
});
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
// IE doesn't match non-breaking spaces with \s
if ( rnotwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
};
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
jQuery.ready();
}
return jQuery;
})();
// String to Object flags format cache
var flagsCache = {};
// Convert String-formatted flags into Object-formatted ones and store in cache
function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
}
/*
* Create a callback list using the following parameters:
*
* flags: an optional list of space-separated flags that will change how
* the callback list behaves
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible flags:
*
* 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( flags ) {
// Convert flags from String-formatted to Object-formatted
// (we check in cache first)
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
var // Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = [],
// Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Add one or several callbacks to the list
add = function( args ) {
var i,
length,
elem,
type,
actual;
for ( i = 0, length = args.length; i < length; i++ ) {
elem = args[ i ];
type = jQuery.type( elem );
if ( type === "array" ) {
// Inspect recursively
add( elem );
} else if ( type === "function" ) {
// Add if not in unique mode and callback is not in
if ( !flags.unique || !self.has( elem ) ) {
list.push( elem );
}
}
}
},
// Fire callbacks
fire = function( context, args ) {
args = args || [];
memory = !flags.memory || [ context, args ];
fired = true;
firing = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
memory = true; // Mark as halted
break;
}
}
firing = false;
if ( list ) {
if ( !flags.once ) {
if ( stack && stack.length ) {
memory = stack.shift();
self.fireWith( memory[ 0 ], memory[ 1 ] );
}
} else if ( memory === true ) {
self.disable();
} else {
list = [];
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
var length = list.length;
add( 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, unless previous
// firing was halted (stopOnFalse)
} else if ( memory && memory !== true ) {
firingStart = length;
fire( memory[ 0 ], memory[ 1 ] );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
var args = arguments,
argIndex = 0,
argLength = args.length;
for ( ; argIndex < argLength ; argIndex++ ) {
for ( var i = 0; i < list.length; i++ ) {
if ( args[ argIndex ] === list[ i ] ) {
// Handle firingIndex and firingLength
if ( firing ) {
if ( i <= firingLength ) {
firingLength--;
if ( i <= firingIndex ) {
firingIndex--;
}
}
}
// Remove the element
list.splice( i--, 1 );
// If we have some unicity property then
// we only need to do this once
if ( flags.unique ) {
break;
}
}
}
}
}
return this;
},
// Control if a given callback is in the list
has: function( fn ) {
if ( list ) {
var i = 0,
length = list.length;
for ( ; i < length; i++ ) {
if ( fn === list[ i ] ) {
return true;
}
}
}
return false;
},
// Remove all callbacks from the list
empty: function() {
list = [];
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 || memory === true ) {
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 ( stack ) {
if ( firing ) {
if ( !flags.once ) {
stack.push( [ context, args ] );
}
} else if ( !( flags.once && memory ) ) {
fire( context, 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;
};
var // Static reference to slice
sliceDeferred = [].slice;
jQuery.extend({
Deferred: function( func ) {
var doneList = jQuery.Callbacks( "once memory" ),
failList = jQuery.Callbacks( "once memory" ),
progressList = jQuery.Callbacks( "memory" ),
state = "pending",
lists = {
resolve: doneList,
reject: failList,
notify: progressList
},
promise = {
done: doneList.add,
fail: failList.add,
progress: progressList.add,
state: function() {
return state;
},
// Deprecated
isResolved: doneList.fired,
isRejected: failList.fired,
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
return this;
},
always: function() {
deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
return this;
},
pipe: function( fnDone, fnFail, fnProgress ) {
return jQuery.Deferred(function( newDefer ) {
jQuery.each( {
done: [ fnDone, "resolve" ],
fail: [ fnFail, "reject" ],
progress: [ fnProgress, "notify" ]
}, function( handler, data ) {
var fn = data[ 0 ],
action = data[ 1 ],
returned;
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
} else {
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
}
});
} else {
deferred[ handler ]( newDefer[ action ] );
}
});
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
if ( obj == null ) {
obj = promise;
} else {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
}
}
return obj;
}
},
deferred = promise.promise({}),
key;
for ( key in lists ) {
deferred[ key ] = lists[ key ].fire;
deferred[ key + "With" ] = lists[ key ].fireWith;
}
// Handle state
deferred.done( function() {
state = "resolved";
}, failList.disable, progressList.lock ).fail( function() {
state = "rejected";
}, doneList.disable, progressList.lock );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( firstParam ) {
var args = sliceDeferred.call( arguments, 0 ),
i = 0,
length = args.length,
pValues = new Array( length ),
count = length,
pCount = length,
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
firstParam :
jQuery.Deferred(),
promise = deferred.promise();
function resolveFunc( i ) {
return function( value ) {
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
if ( !( --count ) ) {
deferred.resolveWith( deferred, args );
}
};
}
function progressFunc( i ) {
return function( value ) {
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
deferred.notifyWith( promise, pValues );
};
}
if ( length > 1 ) {
for ( ; i < length; i++ ) {
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
} else {
--count;
}
}
if ( !count ) {
deferred.resolveWith( deferred, args );
}
} else if ( deferred !== firstParam ) {
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
}
return promise;
}
});
jQuery.support = (function() {
var support,
all,
a,
select,
opt,
input,
fragment,
tds,
events,
eventName,
i,
isSupported,
div = document.createElement( "div" ),
documentElement = document.documentElement;
// Preliminary tests
div.setAttribute("className", "t");
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
all = div.getElementsByTagName( "*" );
a = div.getElementsByTagName( "a" )[ 0 ];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return {};
}
// First batch of supports tests
select = document.createElement( "select" );
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName( "input" )[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: ( a.getAttribute("href") === "/a" ),
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: ( input.value === "on" ),
// 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)
optSelected: opt.selected,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// Tests for enctype support on a form(#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// Will be defined later
submitBubbles: true,
changeBubbles: true,
focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
pixelMargin: true
};
// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// 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;
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( "onclick", function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
});
div.cloneNode( true ).fireEvent( "onclick" );
}
// Check if a radio maintains its value
// after being appended to the DOM
input = document.createElement("input");
input.value = "t";
input.setAttribute("type", "radio");
support.radioValue = input.value === "t";
input.setAttribute("checked", "checked");
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "name", "t" );
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
fragment.removeChild( input );
fragment.appendChild( div );
// Technique from Juriy Zaytsev
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for ( i in {
submit: 1,
change: 1,
focusin: 1
}) {
eventName = "on" + i;
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, "return;" );
isSupported = ( typeof div[ eventName ] === "function" );
}
support[ i + "Bubbles" ] = isSupported;
}
}
fragment.removeChild( div );
// Null elements to avoid leaks in IE
fragment = select = opt = div = input = null;
// Run tests that need a body at doc ready
jQuery(function() {
var container, outer, inner, table, td, offsetSupport,
marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
paddingMarginBorderVisibility, paddingMarginBorder,
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
conMarginTop = 1;
paddingMarginBorder = "padding:0;margin:0;border:";
positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
"<table " + style + "' cellpadding='0' cellspacing='0'>" +
"<tr><td></td></tr></table>";
container = document.createElement("div");
container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
body.insertBefore( container, body.firstChild );
// Construct the test element
div = document.createElement("div");
container.appendChild( div );
// 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).
// (only IE 8 fails this test)
div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
tds = div.getElementsByTagName( "td" );
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Check if empty table cells still have offsetWidth/Height
// (IE <= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( window.getComputedStyle ) {
div.innerHTML = "";
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.style.width = "2px";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
if ( typeof div.style.zoom !== "undefined" ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.innerHTML = "";
div.style.width = div.style.padding = "1px";
div.style.border = 0;
div.style.overflow = "hidden";
div.style.display = "inline";
div.style.zoom = 1;
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "block";
div.style.overflow = "visible";
div.innerHTML = "<div style='width:5px;'></div>";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
}
div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
div.innerHTML = html;
outer = div.firstChild;
inner = outer.firstChild;
td = outer.nextSibling.firstChild.firstChild;
offsetSupport = {
doesNotAddBorder: ( inner.offsetTop !== 5 ),
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
};
inner.style.position = "fixed";
inner.style.top = "20px";
// safari subtracts parent border width here which is 5px
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
inner.style.position = inner.style.top = "";
outer.style.overflow = "hidden";
outer.style.position = "relative";
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
if ( window.getComputedStyle ) {
div.style.marginTop = "1%";
support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
}
if ( typeof container.style.zoom !== "undefined" ) {
container.style.zoom = 1;
}
body.removeChild( container );
marginDiv = div = container = null;
jQuery.extend( support, offsetSupport );
});
return support;
})();
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([A-Z])/g;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var privateCache, thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// 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,
isEvents = name === "events";
// 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] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
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 ) {
elem[ internalKey ] = id = ++jQuery.uuid;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].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 );
}
}
privateCache = 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;
}
// Users should not attempt to inspect the internal events object using jQuery.data,
// it is undocumented and subject to change. But does anyone listen? No.
if ( isEvents && !thisCache[ name ] ) {
return privateCache.events;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// 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;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, i, l,
// Reference to internal data cache key
internalKey = jQuery.expando,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
// See jQuery.data for more information
id = isNode ? elem[ internalKey ] : internalKey;
// 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( " " );
}
}
}
for ( i = 0, l = name.length; i < l; 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 : 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;
}
}
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
// Ensure that `cache` is not a window object #10080
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
delete cache[ id ];
} else {
cache[ id ] = null;
}
// We destroyed the cache and need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
if ( isNode ) {
// 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 ( jQuery.support.deleteExpando ) {
delete elem[ internalKey ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
}
},
// For internal use only.
_data: function( elem, name, data ) {
return jQuery.data( elem, name, data, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var parts, part, attr, name, l,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attr = elem.attributes;
for ( l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.substring(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 );
});
}
parts = key.split( ".", 2 );
parts[1] = parts[1] ? "." + parts[1] : "";
part = parts[1] + "!";
return jQuery.access( this, function( value ) {
if ( value === undefined ) {
data = this.triggerHandler( "getData" + part, [ parts[0] ] );
// Try to fetch any internally stored data first
if ( data === undefined && elem ) {
data = jQuery.data( elem, key );
data = dataAttr( elem, key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
}
parts[1] = value;
this.each(function() {
var self = jQuery( this );
self.triggerHandler( "setData" + part, parts );
jQuery.data( this, key, value );
self.triggerHandler( "changeData" + part, parts );
});
}, null, value, arguments.length > 1, null, false );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
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 :
jQuery.isNumeric( 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 ) {
for ( var 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 handleQueueMarkDefer( elem, type, src ) {
var deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
defer = jQuery._data( elem, deferDataKey );
if ( defer &&
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
// Give room for hard-coded callbacks to fire first
// and eventually mark/queue something else on the element
setTimeout( function() {
if ( !jQuery._data( elem, queueDataKey ) &&
!jQuery._data( elem, markDataKey ) ) {
jQuery.removeData( elem, deferDataKey, true );
defer.fire();
}
}, 0 );
}
}
jQuery.extend({
_mark: function( elem, type ) {
if ( elem ) {
type = ( type || "fx" ) + "mark";
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
}
},
_unmark: function( force, elem, type ) {
if ( force !== true ) {
type = elem;
elem = force;
force = false;
}
if ( elem ) {
type = type || "fx";
var key = type + "mark",
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
if ( count ) {
jQuery._data( elem, key, count );
} else {
jQuery.removeData( elem, key, true );
handleQueueMarkDefer( elem, type, "mark" );
}
}
},
queue: function( elem, type, data ) {
var q;
if ( elem ) {
type = ( type || "fx" ) + "queue";
q = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !q || jQuery.isArray(data) ) {
q = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
q.push( data );
}
}
return q || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift(),
hooks = {};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
jQuery._data( elem, type + ".run", hooks );
fn.call( elem, function() {
jQuery.dequeue( elem, type );
}, hooks );
}
if ( !queue.length ) {
jQuery.removeData( elem, type + "queue " + type + ".run", true );
handleQueueMarkDefer( elem, type, "queue" );
}
}
});
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 );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
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 );
};
});
},
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, object ) {
if ( typeof type !== "string" ) {
object = type;
type = undefined;
}
type = type || "fx";
var defer = jQuery.Deferred(),
elements = this,
i = elements.length,
count = 1,
deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
tmp;
function resolve() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
}
while( i-- ) {
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
count++;
tmp.add( resolve );
}
}
resolve();
return defer.promise( object );
}
});
var rclass = /[\n\t\r]/g,
rspace = /\s+/,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
nodeHook, boolHook, fixSpecified;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.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 ) {}
});
},
addClass: function( value ) {
var classNames, i, l, elem,
setClass, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
classNames = value.split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 ) {
if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
var classNames, i, l, elem, className, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
classNames = ( value || "" ).split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
className = (" " + elem.className + " ").replace( rclass, " " );
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[ c ] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
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 ),
state = stateVal,
classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// toggle whole className
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 ) > -1 ) {
return true;
}
}
return false;
},
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 self = jQuery(this), val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.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 ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, i, max, option,
index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
i = one ? index : 0;
max = one ? index + 1 : options.length;
for ( ; i < max; i++ ) {
option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.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 );
}
}
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
if ( one && !values.length && options.length ) {
return jQuery( options[ index ] ).val();
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attr: function( elem, name, value, pass ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery( elem )[ name ]( value );
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === "undefined" ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
return;
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, "" + value );
return value;
}
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return ret === null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var propName, attrNames, name, l, isBool,
i = 0;
if ( value && elem.nodeType === 1 ) {
attrNames = value.toLowerCase().split( rspace );
l = attrNames.length;
for ( ; i < l; i++ ) {
name = attrNames[ i ];
if ( name ) {
propName = jQuery.propFix[ name ] || name;
isBool = rboolean.test( name );
// See #9699 for explanation of this approach (setting first, then removal)
// Do not do this for boolean attributes (see #10870)
if ( !isBool ) {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
// Set corresponding property to false for boolean attributes
if ( isBool && propName in elem ) {
elem[ propName ] = false;
}
}
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
} else if ( !jQuery.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 it's default in case type is set after value
// This is for element creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
},
// Use the value property for back compat
// Use the nodeHook for button elements in IE6/7 (#1954)
value: {
get: function( elem, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.get( elem, name );
}
return name in elem ?
elem.value :
null;
},
set: function( elem, value, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.set( elem, value, name );
}
// Does not return so that setAttribute is also used
elem.value = value;
}
}
},
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( 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 ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return 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/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
// Align boolean attributes with corresponding properties
// Fall back to attribute presence where some booleans are not supported
var attrNode,
property = jQuery.prop( elem, name );
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
var propName;
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
// value is true since we know at this point it's type boolean and not false
// Set boolean attributes to the same name and set the DOM property
propName = jQuery.propFix[ name ] || name;
if ( propName in elem ) {
// Only set the IDL specifically if it already exists on the element
elem[ propName ] = true;
}
elem.setAttribute( name, name.toLowerCase() );
}
return name;
}
};
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
fixSpecified = {
name: true,
id: true,
coords: true
};
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
ret.nodeValue :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
ret = document.createAttribute( name );
elem.setAttributeNode( ret );
}
return ( ret.nodeValue = value + "" );
}
};
// Apply the nodeHook to tabindex
jQuery.attrHooks.tabindex.set = nodeHook.set;
// 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 ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
if ( value === "" ) {
value = "false";
}
nodeHook.set( elem, value, name );
}
};
}
// Some attributes require a special call on IE
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret === null ? undefined : ret;
}
});
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Normalize to lowercase since IE uppercases css property names
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = "" + value );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( 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;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:textarea|input|select)$/i,
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
quickParse = function( selector ) {
var quick = rquickIs.exec( selector );
if ( quick ) {
// 0 1 2 3
// [ _, tag, id, class ]
quick[1] = ( quick[1] || "" ).toLowerCase();
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
}
return quick;
},
quickIs = function( elem, m ) {
var attrs = elem.attributes || {};
return (
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
(!m[2] || (attrs.id || {}).value === m[2]) &&
(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
);
},
hoverHack = function( events ) {
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
};
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, quick, handlers, special;
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
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
events = elemData.events;
if ( !events ) {
elemData.events = events = {};
}
eventHandle = elemData.handle;
if ( !eventHandle ) {
elemData.handle = eventHandle = 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 !== "undefined" && (!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
// jQuery(...).bind("mouseover mouseout", fn);
types = jQuery.trim( hoverHack(types) ).split( " " );
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = tns[1];
namespaces = ( tns[2] || "" ).split( "." ).sort();
// 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: tns[1],
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
quick: selector && quickParse( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
handlers = events[ type ];
if ( !handlers ) {
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;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
t, tns, type, origType, namespaces, origCount,
j, events, special, handle, eventType, handleObj;
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
for ( t = 0; t < types.length; t++ ) {
tns = rtypenamespace.exec( types[t] ) || [];
type = origType = tns[1];
namespaces = tns[2];
// 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;
eventType = events[ type ] || [];
origCount = eventType.length;
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
// Remove matching events
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
eventType.splice( j--, 1 );
if ( handleObj.selector ) {
eventType.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 ( eventType.length === 0 && origCount !== eventType.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery.removeData( elem, [ "events", "handle" ], true );
}
},
// Events that are safe to short-circuit if no handlers are attached.
// Native DOM events should not be added, they may have inline handlers.
customEvent: {
"getData": true,
"setData": true,
"changeData": true
},
trigger: function( event, data, elem, onlyHandlers ) {
// Don't do events on text and comment nodes
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
return;
}
// Event object or event type
var type = event.type || event,
namespaces = [],
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
// 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 ) {
// Exclusive events trigger only for the exact event (no namespaces)
type = type.slice(0, -1);
exclusive = true;
}
if ( type.indexOf( "." ) >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
// No jQuery handlers for this event type, and it can't have inline handlers
return;
}
// Caller can pass in an Event, Object, or just an event type string
event = typeof event === "object" ?
// jQuery.Event object
event[ jQuery.expando ] ? event :
// Object literal
new jQuery.Event( type, event ) :
// Just the event type (string)
new jQuery.Event( type );
event.type = type;
event.isTrigger = true;
event.exclusive = exclusive;
event.namespace = namespaces.join( "." );
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
// Handle a global trigger
if ( !elem ) {
// TODO: Stop taunting the data cache; remove global events and always attach to document
cache = jQuery.cache;
for ( i in cache ) {
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
}
}
return;
}
// 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 ? jQuery.makeArray( data ) : [];
data.unshift( event );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( 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)
eventPath = [[ elem, special.bindType || type ]];
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
old = null;
for ( ; cur; cur = cur.parentNode ) {
eventPath.push([ cur, bubbleType ]);
old = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( old && old === elem.ownerDocument ) {
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
}
}
// Fire handlers on the event path
for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
cur = eventPath[i][0];
event.type = eventPath[i][1];
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Note that this is a bare JS function and not a jQuery handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && 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)
// IE<9 dies on focus/blur to hidden element (#1486)
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
if ( old ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
elem[ type ]();
jQuery.event.triggered = undefined;
if ( old ) {
elem[ ontype ] = old;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
args = [].slice.call( arguments, 0 ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {},
handlerQueue = [],
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
// 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 that should run if there are delegated events
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !(event.button && event.type === "click") ) {
// Pregenerate a single jQuery object for reuse with .is()
jqcur = jQuery(this);
jqcur.context = this.ownerDocument || this;
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
// Don't process events on disabled elements (#6911, #8165)
if ( cur.disabled !== true ) {
selMatch = {};
matches = [];
jqcur[0] = cur;
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) {
selMatch[ sel ] = (
handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
);
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, matches: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( handlers.length > delegateCount ) {
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
}
// Run delegates first; they may want to stop propagation beneath us
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
matched = handlerQueue[ i ];
event.currentTarget = matched.elem;
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
handleObj = matched.matches[ j ];
// Triggered event must either 1) be non-exclusive and have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
event.data = handleObj.data;
event.handleObj = handleObj;
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
.apply( matched.elem, args );
if ( ret !== undefined ) {
event.result = ret;
if ( 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;
},
// Includes some event props shared by KeyEvent and MouseEvent
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
props: "attrChange attrName relatedNode srcElement 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 eventDoc, doc, body,
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;
}
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop,
originalEvent = event,
fixHook = jQuery.event.fixHooks[ event.type ] || {},
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = jQuery.Event( originalEvent );
for ( i = copy.length; i; ) {
prop = copy[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Target should not be a text node (#504, Safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
if ( event.metaKey === undefined ) {
event.metaKey = event.ctrlKey;
}
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady
},
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
focus: {
delegateType: "focusin"
},
blur: {
delegateType: "focusout"
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
},
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();
}
}
};
// Some plugins are using, but it's undocumented/deprecated and will be removed.
// The 1.7 special event interface should provide all the hooks needed now.
jQuery.event.handle = jQuery.event.dispatch;
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
if ( elem.detachEvent ) {
elem.detachEvent( "on" + type, 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.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? 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;
};
function returnFalse() {
return false;
}
function returnTrue() {
return 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 = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var target = this,
related = event.relatedTarget,
handleObj = event.handleObj,
selector = handleObj.selector,
ret;
// 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 ( !jQuery.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 && !form._submit_attached ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submit_bubble = true;
});
form._submit_attached = 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 ( !jQuery.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;
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 ) && !elem._change_attached ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
elem._change_attached = 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 ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) { // && selector != null
// ( 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 ) {
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
var 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 ( var 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 );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
live: function( types, data, fn ) {
jQuery( this.context ).on( types, this.selector, data, fn );
return this;
},
die: function( types, fn ) {
jQuery( this.context ).off( types, this.selector || "**", fn );
return this;
},
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 );
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
return jQuery.event.trigger( type, data, this[0], true );
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments,
guid = fn.guid || jQuery.guid++,
i = 0,
toggler = function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
};
// link all the functions, so any of them can unbind this click handler
toggler.guid = guid;
while ( i < args.length ) {
args[ i++ ].guid = guid;
}
return this.click( toggler );
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
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 ) {
if ( fn == null ) {
fn = data;
data = null;
}
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
if ( jQuery.attrFn ) {
jQuery.attrFn[ name ] = true;
}
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
expando = "sizcache" + (Math.random() + '').replace('.', ''),
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true,
rBackslash = /\\/g,
rReturn = /\r\n/g,
rNonWord = /\W/;
// Here we check if the JavaScript engine is using some sort of
// optimization where it does not always call our comparision
// function. If that is the case, discard the hasDuplicate value.
// Thus far that includes Google Chrome.
[0, 0].sort(function() {
baseHasDuplicate = false;
return 0;
});
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
return [];
}
if ( !selector || typeof selector !== "string" ) {
return results;
}
var m, set, checkSet, extra, ret, cur, pop, i,
prune = true,
contextXML = Sizzle.isXML( context ),
parts = [],
soFar = selector;
// Reset the position of the chunker regexp (start from head)
do {
chunker.exec( "" );
m = chunker.exec( soFar );
if ( m ) {
soFar = m[3];
parts.push( m[1] );
if ( m[2] ) {
extra = m[3];
break;
}
}
} while ( m );
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context, seed );
} else {
set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] ) {
selector += parts.shift();
}
set = posProcess( selector, set, seed );
}
}
} else {
// Take a shortcut and set the context if the root selector is an ID
// (but not if it'll be faster if the inner selector is an ID)
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ?
Sizzle.filter( ret.expr, ret.set )[0] :
ret.set[0];
}
if ( context ) {
ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ?
Sizzle.filter( ret.expr, ret.set ) :
ret.set;
if ( parts.length > 0 ) {
checkSet = makeArray( set );
} else {
prune = false;
}
while ( parts.length ) {
cur = parts.pop();
pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, contextXML );
}
} else {
checkSet = parts = [];
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
if ( !prune ) {
results.push.apply( results, checkSet );
} else if ( context && context.nodeType === 1 ) {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
results.push( set[i] );
}
}
} else {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
results.push( set[i] );
}
}
}
} else {
makeArray( checkSet, results );
}
if ( extra ) {
Sizzle( extra, origContext, results, seed );
Sizzle.uniqueSort( results );
}
return results;
};
Sizzle.uniqueSort = function( results ) {
if ( sortOrder ) {
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( var i = 1; i < results.length; i++ ) {
if ( results[i] === results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
}
return results;
};
Sizzle.matches = function( expr, set ) {
return Sizzle( expr, null, null, set );
};
Sizzle.matchesSelector = function( node, expr ) {
return Sizzle( expr, null, null, [node] ).length > 0;
};
Sizzle.find = function( expr, context, isXML ) {
var set, i, len, match, type, left;
if ( !expr ) {
return [];
}
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
type = Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
left = match[1];
match.splice( 1, 1 );
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace( rBackslash, "" );
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = typeof context.getElementsByTagName !== "undefined" ?
context.getElementsByTagName( "*" ) :
[];
}
return { set: set, expr: expr };
};
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
type, found, item, filter, left,
i, pass,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
filter = Expr.filter[ type ];
left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
pass = not ^ found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
/**
* Utility function for retreiving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
var getText = Sizzle.getText = function( elem ) {
var i, node,
nodeType = elem.nodeType,
ret = "";
if ( nodeType ) {
if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent || innerText for elements
if ( typeof elem.textContent === 'string' ) {
return elem.textContent;
} else if ( typeof elem.innerText === 'string' ) {
// Replace IE's carriage returns
return elem.innerText.replace( rReturn, '' );
} else {
// Traverse it's children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
} else {
// If no nodeType, this is expected to be an array
for ( i = 0; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
if ( node.nodeType !== 8 ) {
ret += getText( node );
}
}
}
return ret;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function( elem ) {
return elem.getAttribute( "href" );
},
type: function( elem ) {
return elem.getAttribute( "type" );
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !rNonWord.test( part ),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
if ( isPartStr && !rNonWord.test( part ) ) {
part = part.toLowerCase();
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
"~": function( checkSet, part, isXML ) {
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
find: {
ID: function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
},
NAME: function( match, context ) {
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [],
results = context.getElementsByName( match[1] );
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function( match, context ) {
if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( match[1] );
}
}
},
preFilter: {
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
match = " " + match[1].replace( rBackslash, "" ) + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
if ( !inplace ) {
result.push( elem );
}
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
return false;
},
ID: function( match ) {
return match[1].replace( rBackslash, "" );
},
TAG: function( match, curLoop ) {
return match[1].replace( rBackslash, "" ).toLowerCase();
},
CHILD: function( match ) {
if ( match[1] === "nth" ) {
if ( !match[2] ) {
Sizzle.error( match[0] );
}
match[2] = match[2].replace(/^\+|\s*/g, '');
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
else if ( match[2] ) {
Sizzle.error( match[0] );
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
var name = match[1] = match[1].replace( rBackslash, "" );
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
// Handle if an un-quoted value was used
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function( match, curLoop, inplace, result, not ) {
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
return true;
}
return match;
},
POS: function( match ) {
match.unshift( true );
return match;
}
},
filters: {
enabled: function( elem ) {
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function( elem ) {
return elem.disabled === true;
},
checked: function( elem ) {
return elem.checked === true;
},
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;
},
parent: function( elem ) {
return !!elem.firstChild;
},
empty: function( elem ) {
return !elem.firstChild;
},
has: function( elem, i, match ) {
return !!Sizzle( match[3], elem ).length;
},
header: function( elem ) {
return (/h\d/i).test( elem.nodeName );
},
text: function( elem ) {
var attr = elem.getAttribute( "type" ), type = elem.type;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
},
radio: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
},
checkbox: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
},
file: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
},
password: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
},
submit: function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && "submit" === elem.type;
},
image: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
},
reset: function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && "reset" === elem.type;
},
button: function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && "button" === elem.type || name === "button";
},
input: function( elem ) {
return (/input|select|textarea|button/i).test( elem.nodeName );
},
focus: function( elem ) {
return elem === elem.ownerDocument.activeElement;
}
},
setFilters: {
first: function( elem, i ) {
return i === 0;
},
last: function( elem, i, match, array ) {
return i === array.length - 1;
},
even: function( elem, i ) {
return i % 2 === 0;
},
odd: function( elem, i ) {
return i % 2 === 1;
},
lt: function( elem, i, match ) {
return i < match[3] - 0;
},
gt: function( elem, i, match ) {
return i > match[3] - 0;
},
nth: function( elem, i, match ) {
return match[3] - 0 === i;
},
eq: function( elem, i, match ) {
return match[3] - 0 === i;
}
},
filter: {
PSEUDO: function( elem, match, i, array ) {
var name = match[1],
filter = Expr.filters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
} else if ( name === "contains" ) {
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
} else if ( name === "not" ) {
var not = match[3];
for ( var j = 0, l = not.length; j < l; j++ ) {
if ( not[j] === elem ) {
return false;
}
}
return true;
} else {
Sizzle.error( name );
}
},
CHILD: function( elem, match ) {
var first, last,
doneName, parent, cache,
count, diff,
type = match[1],
node = elem;
switch ( type ) {
case "only":
case "first":
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
/* falls through */
case "last":
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
case "nth":
first = match[2];
last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
doneName = match[0];
parent = elem.parentNode;
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent[ expando ] = doneName;
}
diff = elem.nodeIndex - last;
if ( first === 0 ) {
return diff === 0;
} else {
return ( diff % first === 0 && diff / first >= 0 );
}
}
},
ID: function( elem, match ) {
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},
TAG: function( elem, match ) {
return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
},
CLASS: function( elem, match ) {
return (" " + (elem.className || elem.getAttribute("class")) + " ")
.indexOf( match ) > -1;
},
ATTR: function( elem, match ) {
var name = match[1],
result = Sizzle.attr ?
Sizzle.attr( elem, name ) :
Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
elem[ name ] :
elem.getAttribute( name ),
value = result + "",
type = match[2],
check = match[4];
return result == null ?
type === "!=" :
!type && Sizzle.attr ?
result != null :
type === "=" ?
value === check :
type === "*=" ?
value.indexOf(check) >= 0 :
type === "~=" ?
(" " + value + " ").indexOf(check) >= 0 :
!check ?
value && result !== false :
type === "!=" ?
value !== check :
type === "^=" ?
value.indexOf(check) === 0 :
type === "$=" ?
value.substr(value.length - check.length) === check :
type === "|=" ?
value === check || value.substr(0, check.length + 1) === check + "-" :
false;
},
POS: function( elem, match, i, array ) {
var name = match[2],
filter = Expr.setFilters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
}
}
}
};
var origPOS = Expr.match.POS,
fescape = function(all, num){
return "\\" + (num - 0 + 1);
};
for ( var type in Expr.match ) {
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
}
// Expose origPOS
// "global" as in regardless of relation to brackets/parens
Expr.match.globalPOS = origPOS;
var makeArray = function( array, results ) {
array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
return results;
}
return array;
};
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
// Also verifies that the returned array holds DOM nodes
// (which is not the case in the Blackberry browser)
try {
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// Provide a fallback method if it does not work
} catch( e ) {
makeArray = function( array, results ) {
var i = 0,
ret = results || [];
if ( toString.call(array) === "[object Array]" ) {
Array.prototype.push.apply( ret, array );
} else {
if ( typeof array.length === "number" ) {
for ( var l = array.length; i < l; i++ ) {
ret.push( array[i] );
}
} else {
for ( ; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder, siblingCheck;
if ( document.documentElement.compareDocumentPosition ) {
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
return a.compareDocumentPosition ? -1 : 1;
}
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
};
} else {
sortOrder = function( a, b ) {
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;
}
var al, bl,
ap = [],
bp = [],
aup = a.parentNode,
bup = b.parentNode,
cur = aup;
// If the nodes are siblings (or identical) we can do a quick check
if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
} else if ( !aup ) {
return -1;
} else if ( !bup ) {
return 1;
}
// Otherwise they're somewhere else in the tree so we need
// to build up a full list of the parentNodes for comparison
while ( cur ) {
ap.unshift( cur );
cur = cur.parentNode;
}
cur = bup;
while ( cur ) {
bp.unshift( cur );
cur = cur.parentNode;
}
al = ap.length;
bl = bp.length;
// Start walking down the tree looking for a discrepancy
for ( var i = 0; i < al && i < bl; i++ ) {
if ( ap[i] !== bp[i] ) {
return siblingCheck( ap[i], bp[i] );
}
}
// We ended someplace up the tree so do a sibling check
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
};
siblingCheck = function( a, b, ret ) {
if ( a === b ) {
return ret;
}
var cur = a.nextSibling;
while ( cur ) {
if ( cur === b ) {
return -1;
}
cur = cur.nextSibling;
}
return 1;
};
}
// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
var form = document.createElement("div"),
id = "script" + (new Date()).getTime(),
root = document.documentElement;
form.innerHTML = "<a name='" + id + "'/>";
// Inject it into the root element, check its status, and remove it quickly
root.insertBefore( form, root.firstChild );
// The workaround has to do additional checks after a getElementById
// Which slows things down for other browsers (hence the branching)
if ( document.getElementById( id ) ) {
Expr.find.ID = function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ?
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
[m] :
undefined :
[];
}
};
Expr.filter.ID = function( elem, match ) {
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
return elem.nodeType === 1 && node && node.nodeValue === match;
};
}
root.removeChild( form );
// release memory in IE
root = form = null;
})();
(function(){
// Check to see if the browser returns only elements
// when doing getElementsByTagName("*")
// Create a fake element
var div = document.createElement("div");
div.appendChild( document.createComment("") );
// Make sure no comments are found
if ( div.getElementsByTagName("*").length > 0 ) {
Expr.find.TAG = function( match, context ) {
var results = context.getElementsByTagName( match[1] );
// Filter out possible comments
if ( match[1] === "*" ) {
var tmp = [];
for ( var i = 0; results[i]; i++ ) {
if ( results[i].nodeType === 1 ) {
tmp.push( results[i] );
}
}
results = tmp;
}
return results;
};
}
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function( elem ) {
return elem.getAttribute( "href", 2 );
};
}
// release memory in IE
div = null;
})();
if ( document.querySelectorAll ) {
(function(){
var oldSizzle = Sizzle,
div = document.createElement("div"),
id = "__sizzle__";
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;
}
Sizzle = function( query, context, extra, seed ) {
context = context || document;
// Only use querySelectorAll on non-XML documents
// (ID selectors don't work in non-HTML documents)
if ( !seed && !Sizzle.isXML(context) ) {
// See if we find a selector to speed up
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
// Speed-up: Sizzle("TAG")
if ( match[1] ) {
return makeArray( context.getElementsByTagName( query ), extra );
// Speed-up: Sizzle(".CLASS")
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
return makeArray( context.getElementsByClassName( match[2] ), extra );
}
}
if ( context.nodeType === 9 ) {
// Speed-up: Sizzle("body")
// The body element only exists once, optimize finding it
if ( query === "body" && context.body ) {
return makeArray( [ context.body ], extra );
// Speed-up: Sizzle("#ID")
} else if ( match && match[3] ) {
var elem = context.getElementById( match[3] );
// 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[3] ) {
return makeArray( [ elem ], extra );
}
} else {
return makeArray( [], extra );
}
}
try {
return makeArray( context.querySelectorAll(query), extra );
} catch(qsaError) {}
// 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
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
var oldContext = context,
old = context.getAttribute( "id" ),
nid = old || id,
hasParent = context.parentNode,
relativeHierarchySelector = /^\s*[+~]/.test( query );
if ( !old ) {
context.setAttribute( "id", nid );
} else {
nid = nid.replace( /'/g, "\\$&" );
}
if ( relativeHierarchySelector && hasParent ) {
context = context.parentNode;
}
try {
if ( !relativeHierarchySelector || hasParent ) {
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
}
} catch(pseudoError) {
} finally {
if ( !old ) {
oldContext.removeAttribute( "id" );
}
}
}
}
return oldSizzle(query, context, extra, seed);
};
for ( var prop in oldSizzle ) {
Sizzle[ prop ] = oldSizzle[ prop ];
}
// release memory in IE
div = null;
})();
}
(function(){
var html = document.documentElement,
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
if ( matches ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9 fails this)
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
pseudoWorks = false;
try {
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( document.documentElement, "[test!='']:sizzle" );
} catch( pseudoError ) {
pseudoWorks = true;
}
Sizzle.matchesSelector = function( node, expr ) {
// Make sure that attribute selectors are quoted
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
if ( !Sizzle.isXML( node ) ) {
try {
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
var ret = matches.call( node, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || !disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9, so check for that
node.document && node.document.nodeType !== 11 ) {
return ret;
}
}
} catch(e) {}
}
return Sizzle(expr, null, null, [node]).length > 0;
};
}
})();
(function(){
var div = document.createElement("div");
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
// Opera can't find a second classname (in 9.6)
// Also, make sure that getElementsByClassName actually exists
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
return;
}
// Safari caches class attributes, doesn't catch changes (in 3.2)
div.lastChild.className = "e";
if ( div.getElementsByClassName("e").length === 1 ) {
return;
}
Expr.order.splice(1, 0, "CLASS");
Expr.find.CLASS = function( match, context, isXML ) {
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
return context.getElementsByClassName(match[1]);
}
};
// release memory in IE
div = null;
})();
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem[ expando ] === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem[ expando ] = doneName;
elem.sizset = i;
}
if ( elem.nodeName.toLowerCase() === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem[ expando ] === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem[ expando ] = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
match = elem;
break;
}
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
if ( document.documentElement.contains ) {
Sizzle.contains = function( a, b ) {
return a !== b && (a.contains ? a.contains(b) : true);
};
} else if ( document.documentElement.compareDocumentPosition ) {
Sizzle.contains = function( a, b ) {
return !!(a.compareDocumentPosition(b) & 16);
};
} else {
Sizzle.contains = function() {
return false;
};
}
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 : 0).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
var posProcess = function( selector, context, seed ) {
var match,
tmpSet = [],
later = "",
root = context.nodeType ? [context] : context;
// Position selectors must be done after the filter
// And so must :not(positional) so we move all PSEUDOs to the end
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
later += match[0];
selector = selector.replace( Expr.match.PSEUDO, "" );
}
selector = Expr.relative[selector] ? selector + "*" : selector;
for ( var i = 0, l = root.length; i < l; i++ ) {
Sizzle( selector, root[i], tmpSet, seed );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
Sizzle.selectors.attrMap = {};
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})();
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.globalPOS,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var self = this,
i, l;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
for ( i = 0, l = self.length; i < l; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
});
}
var ret = this.pushStack( "", "find", selector ),
length, n, r;
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( n = length; n < ret.length; n++ ) {
for ( r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// If this is a positional selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
POS.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var ret = [], i, l, cur = this[0];
// Array (deprecated as of jQuery 1.7)
if ( jQuery.isArray( selectors ) ) {
var level = 1;
while ( cur && cur.ownerDocument && cur !== context ) {
for ( i = 0; i < selectors.length; i++ ) {
if ( jQuery( cur ).is( selectors[ i ] ) ) {
ret.push({ selector: selectors[ i ], elem: cur, level: level });
}
}
cur = cur.parentNode;
level++;
}
return ret;
}
// String
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( i = 0, l = this.length; i < l; i++ ) {
cur = this[i];
while ( cur ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
} else {
cur = cur.parentNode;
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
break;
}
}
}
}
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
return this.pushStack( ret, "closest", selectors );
},
// 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.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 ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
andSelf: function() {
return this.add( this.prevObject );
}
});
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
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 jQuery.nth( elem, 2, "nextSibling" );
},
prev: function( elem ) {
return jQuery.nth( elem, 2, "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.makeArray( elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, slice.call( arguments ).join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
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;
},
nth: function( cur, result, dir, elem ) {
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType === 1 && ++num === result ) {
break;
}
}
return cur;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
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+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
},
safeFragment = createSafeFragment( document );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE can't serialize <link> and <script> tags normally
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "div<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( value ) {
return jQuery.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 );
},
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();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
var set = jQuery.clean( arguments );
set.push.apply( set, this.toArray() );
return this.pushStack( set, "before", arguments );
}
},
after: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
var set = this.pushStack( this, "after", arguments );
set.push.apply( set, jQuery.clean(arguments) );
return set;
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
jQuery.cleanData( [ elem ] );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
}
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 jQuery.access( this, function( value ) {
var elem = this[0] || {},
i = 0,
l = this.length;
if ( value === undefined ) {
return elem.nodeType === 1 ?
elem.innerHTML.replace( rinlinejQuery, "" ) :
null;
}
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( jQuery.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( elem.getElementsByTagName( "*" ) );
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( value ) {
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this), old = self.html();
self.replaceWith( value.call( this, i, old ) );
});
}
if ( typeof value !== "string" ) {
value = jQuery( value ).detach();
}
return this.each(function() {
var next = this.nextSibling,
parent = this.parentNode;
jQuery( this ).remove();
if ( next ) {
jQuery(next).before( value );
} else {
jQuery(parent).append( value );
}
});
} else {
return this.length ?
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
this;
}
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
var results, first, fragment, parent,
value = args[0],
scripts = [];
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
jQuery(this).domManip( args, table, callback, true );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
parent = value && value.parentNode;
// If we're in a fragment, just use that instead of building a new one
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
results = { fragment: parent };
} else {
results = jQuery.buildFragment( args, this, scripts );
}
fragment = results.fragment;
if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
first = fragment.firstChild;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
callback.call(
table ?
root(this[i], first) :
this[i],
// Make sure that we do not leak memory by inadvertently discarding
// the original fragment (which might have attached data) instead of
// using it; in addition, use the original fragment object for the last
// item instead of first because it can end up being emptied incorrectly
// in certain situations (Bug #8070).
// Fragments from the fragment cache must always be cloned and never used
// in place.
results.cacheable || ( l > 1 && i < lastIndex ) ?
jQuery.clone( fragment, true, true ) :
fragment
);
}
}
if ( scripts.length ) {
jQuery.each( scripts, function( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
type: "GET",
global: false,
url: elem.src,
async: false,
dataType: "script"
});
} else {
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
});
}
}
return this;
}
});
function root( elem, cur ) {
return jQuery.nodeName(elem, "table") ?
(elem.getElementsByTagName("tbody")[0] ||
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
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 cloneFixAttributes( src, dest ) {
var nodeName;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
// clearAttributes removes the attributes, which we don't want,
// but also removes the attachEvent events, which we *do* want
if ( dest.clearAttributes ) {
dest.clearAttributes();
}
// mergeAttributes, in contrast, only merges back on the
// original attributes, not the events
if ( dest.mergeAttributes ) {
dest.mergeAttributes( src );
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 fail to clone children inside object elements that use
// the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
// 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
if ( src.checked ) {
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.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;
// IE blanks contents when cloning scripts
} else if ( nodeName === "script" && dest.text !== src.text ) {
dest.text = src.text;
}
// Event data gets referenced instead of copied if the expando
// gets copied too
dest.removeAttribute( jQuery.expando );
// Clear flags for bubbling special change/submit events, they must
// be reattached when the newly cloned events are first activated
dest.removeAttribute( "_submit_attached" );
dest.removeAttribute( "_change_attached" );
}
jQuery.buildFragment = function( args, nodes, scripts ) {
var fragment, cacheable, cacheresults, doc,
first = args[ 0 ];
// nodes may contain either an explicit document object,
// a jQuery collection or context object.
// If nodes[0] contains a valid object to assign to doc
if ( nodes && nodes[0] ) {
doc = nodes[0].ownerDocument || nodes[0];
}
// Ensure that an attr object doesn't incorrectly stand in as a document object
// Chrome and Firefox seem to allow this to occur and will throw exception
// Fixes #8950
if ( !doc.createDocumentFragment ) {
doc = document;
}
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
first.charAt(0) === "<" && !rnocache.test( first ) &&
(jQuery.support.checkClone || !rchecked.test( first )) &&
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ first ];
if ( cacheresults && cacheresults !== 1 ) {
fragment = cacheresults;
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ first ] = cacheresults ? fragment : 1;
}
return { fragment: fragment, cacheable: cacheable };
};
jQuery.fragments = {};
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [],
insert = jQuery( selector ),
parent = this.length === 1 && this[0].parentNode;
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
return this;
} else {
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = ( i > 0 ? this.clone(true) : this ).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, name, insert.selector );
}
};
});
function getAll( elem ) {
if ( typeof elem.getElementsByTagName !== "undefined" ) {
return elem.getElementsByTagName( "*" );
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
return elem.querySelectorAll( "*" );
} else {
return [];
}
}
// Used in clean, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( elem.type === "checkbox" || elem.type === "radio" ) {
elem.defaultChecked = elem.checked;
}
}
// Finds all inputs and passes them to fixDefaultChecked
function findInputs( elem ) {
var nodeName = ( elem.nodeName || "" ).toLowerCase();
if ( nodeName === "input" ) {
fixDefaultChecked( elem );
// Skip scripts, get other children
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
}
}
// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
function shimCloneNode( elem ) {
var div = document.createElement( "div" );
safeFragment.appendChild( div );
div.innerHTML = elem.outerHTML;
return div.firstChild;
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var srcElements,
destElements,
i,
// IE<=8 does not properly clone detached, unknown element nodes
clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
elem.cloneNode( true ) :
shimCloneNode( elem );
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// IE copies events bound via attachEvent when using cloneNode.
// Calling detachEvent on the clone will also remove the events
// from the original. In order to get around this, we use some
// proprietary methods to clear the events. Thanks to MooTools
// guys for this hotness.
cloneFixAttributes( elem, clone );
// Using Sizzle here is crazy slow, so we use getElementsByTagName instead
srcElements = getAll( elem );
destElements = getAll( clone );
// Weird iteration because IE will replace the length property
// with an element if you are cloning the body and one of the
// elements on the page has a name or id of "length"
for ( i = 0; srcElements[i]; ++i ) {
// Ensure that the destination node is not null; Fixes #9587
if ( destElements[i] ) {
cloneFixAttributes( srcElements[i], destElements[i] );
}
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
cloneCopyEvent( elem, clone );
if ( deepDataAndEvents ) {
srcElements = getAll( elem );
destElements = getAll( clone );
for ( i = 0; srcElements[i]; ++i ) {
cloneCopyEvent( srcElements[i], destElements[i] );
}
}
}
srcElements = destElements = null;
// Return the cloned set
return clone;
},
clean: function( elems, context, fragment, scripts ) {
var checkScriptType, script, j,
ret = [];
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
continue;
}
// Convert html string into DOM nodes
if ( typeof elem === "string" ) {
if ( !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, "<$1></$2>");
// Trim whitespace, otherwise indexOf won't work as expected
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div"),
safeChildNodes = safeFragment.childNodes,
remove;
// Append wrapper element to unknown element safe doc fragment
if ( context === document ) {
// Use the fragment we've already created for this document
safeFragment.appendChild( div );
} else {
// Use a fragment created with the owner document
createSafeFragment( context ).appendChild( div );
}
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( depth-- ) {
div = div.lastChild;
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
for ( j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
}
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
elem = div.childNodes;
// Clear elements from DocumentFragment (safeFragment or otherwise)
// to avoid hoarding elements. Fixes #11356
if ( div ) {
div.parentNode.removeChild( div );
// Guard against -1 index exceptions in FF3.6
if ( safeChildNodes.length > 0 ) {
remove = safeChildNodes[ safeChildNodes.length - 1 ];
if ( remove && remove.parentNode ) {
remove.parentNode.removeChild( remove );
}
}
}
}
}
// Resets defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
var len;
if ( !jQuery.support.appendChecked ) {
if ( elem[0] && typeof (len = elem.length) === "number" ) {
for ( j = 0; j < len; j++ ) {
findInputs( elem[j] );
}
} else {
findInputs( elem );
}
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
ret = jQuery.merge( ret, elem );
}
}
if ( fragment ) {
checkScriptType = function( elem ) {
return !elem.type || rscriptType.test( elem.type );
};
for ( i = 0; ret[i]; i++ ) {
script = ret[i];
if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
} else {
if ( script.nodeType === 1 ) {
var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
}
fragment.appendChild( script );
}
}
}
return ret;
},
cleanData: function( elems ) {
var data, id,
cache = jQuery.cache,
special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
continue;
}
id = elem[ jQuery.expando ];
if ( id ) {
data = cache[ id ];
if ( data && data.events ) {
for ( var 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 );
}
}
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
if ( data.handle ) {
data.handle.elem = null;
}
}
if ( deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
delete cache[ id ];
}
}
}
});
var ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
// fixed for IE9, see #8346
rupper = /([A-Z]|^ms)/g,
rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
rrelNum = /^([\-+])=([\-+.\de]+)/,
rmargin = /^margin/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
// order is important!
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
curCSS,
getComputedStyle,
currentStyle;
jQuery.fn.css = function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
};
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;
} else {
return elem.style.opacity;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": 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": jQuery.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, origName = jQuery.camelCase( name ),
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || 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 NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( 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";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #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 ) {
var ret, hooks;
// Make sure that we're working with the right name
name = jQuery.camelCase( name );
hooks = jQuery.cssHooks[ name ];
name = jQuery.cssProps[ name ] || name;
// cssFloat needs a special treatment
if ( name === "cssFloat" ) {
name = "float";
}
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
return ret;
// Otherwise, if a way to get the computed value exists, use that
} else if ( curCSS ) {
return curCSS( elem, name );
}
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
var old = {},
ret, name;
// 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.call( elem );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
}
});
// DEPRECATED in 1.3, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;
if ( document.defaultView && document.defaultView.getComputedStyle ) {
getComputedStyle = function( elem, name ) {
var ret, defaultView, computedStyle, width,
style = elem.style;
name = name.replace( rupper, "-$1" ).toLowerCase();
if ( (defaultView = elem.ownerDocument.defaultView) &&
(computedStyle = defaultView.getComputedStyle( elem, null )) ) {
ret = computedStyle.getPropertyValue( name );
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
ret = jQuery.style( elem, name );
}
}
// A tribute to the "awesome hack by Dean Edwards"
// WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
// which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
width = style.width;
style.width = ret;
ret = computedStyle.width;
style.width = width;
}
return ret;
};
}
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
var left, rsLeft, uncomputed,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && (uncomputed = style[ name ]) ) {
ret = uncomputed;
}
// 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
if ( rnumnonpx.test( ret ) ) {
// Remember the original values
left = style.left;
rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
elem.runtimeStyle.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
elem.runtimeStyle.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
curCSS = getComputedStyle || currentStyle;
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
i = name === "width" ? 1 : 0,
len = 4;
if ( val > 0 ) {
if ( extra !== "border" ) {
for ( ; i < len; i += 2 ) {
if ( !extra ) {
val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
} else {
val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
}
}
}
return val + "px";
}
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test(val) ) {
return val;
}
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
// Add padding, border, margin
if ( extra ) {
for ( ; i < len; i += 2 ) {
val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
if ( extra !== "padding" ) {
val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
}
}
}
return val + "px";
}
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
if ( elem.offsetWidth !== 0 ) {
return getWidthOrHeight( elem, name, extra );
} else {
return jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
});
}
}
},
set: function( elem, value ) {
return rnum.test( value ) ?
value + "px" :
value;
}
};
});
if ( !jQuery.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) || "" ) ?
( parseFloat( RegExp.$1 ) / 100 ) + "" :
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 >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
// 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 there is no filter style applied in a css rule, we are done
if ( currentStyle && !currentStyle.filter ) {
return;
}
}
// otherwise, set new filter values
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
jQuery(function() {
// This hook cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, 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" }, function() {
if ( computed ) {
return curCSS( elem, "margin-right" );
} else {
return elem.style.marginRight;
}
});
}
};
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth,
height = elem.offsetHeight;
return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// 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,
// assumes a single number if not a string
parts = typeof value === "string" ? value.split(" ") : [ value ],
expanded = {};
for ( i = 0; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rhash = /#.*$/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rquery = /\?/,
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
rselectTextarea = /^(?:select|textarea)/i,
rspacesAjax = /\s+/,
rts = /([?&])_=[^&]*/,
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* 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 = {},
// Document location
ajaxLocation,
// Document location segments
ajaxLocParts,
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = ["*/"] + ["*"];
// #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 = "*";
}
if ( jQuery.isFunction( func ) ) {
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
i = 0,
length = dataTypes.length,
dataType,
list,
placeBefore;
// For each dataType in the dataTypeExpression
for ( ; i < length; i++ ) {
dataType = dataTypes[ i ];
// We control if we're asked to add before
// any existing element
placeBefore = /^\+/.test( dataType );
if ( placeBefore ) {
dataType = dataType.substr( 1 ) || "*";
}
list = structure[ dataType ] = structure[ dataType ] || [];
// then we add to the structure accordingly
list[ placeBefore ? "unshift" : "push" ]( func );
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
dataType /* internal */, inspected /* internal */ ) {
dataType = dataType || options.dataTypes[ 0 ];
inspected = inspected || {};
inspected[ dataType ] = true;
var list = structure[ dataType ],
i = 0,
length = list ? list.length : 0,
executeOnly = ( structure === prefilters ),
selection;
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
selection = list[ i ]( options, originalOptions, jqXHR );
// If we got redirected to another dataType
// we try there if executing only and not done already
if ( typeof selection === "string" ) {
if ( !executeOnly || inspected[ selection ] ) {
selection = undefined;
} else {
options.dataTypes.unshift( selection );
selection = inspectPrefiltersOrTransports(
structure, options, originalOptions, jqXHR, selection, inspected );
}
}
}
// If we're only executing or nothing was selected
// we try the catchall dataType if not done already
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
selection = inspectPrefiltersOrTransports(
structure, options, originalOptions, jqXHR, "*", inspected );
}
// unnecessary when only executing (prefilters)
// but it'll be ignored by the caller in that case
return selection;
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var key, deep,
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 );
}
}
jQuery.fn.extend({
load: function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
// Don't do a request if no elements are being requested
} else if ( !this.length ) {
return this;
}
var off = url.indexOf( " " );
if ( off >= 0 ) {
var selector = url.slice( off, url.length );
url = url.slice( 0, off );
}
// Default to a GET request
var type = "GET";
// If the second parameter was provided
if ( params ) {
// 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 ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST";
}
}
var self = this;
// Request the remote document
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
// Complete callback (responseText is used internally)
complete: function( jqXHR, status, responseText ) {
// Store the response as specified by the jqXHR object
responseText = jqXHR.responseText;
// If successful, inject the HTML into all the matched elements
if ( jqXHR.isResolved() ) {
// #4825: Get the actual response in case
// a dataFilter is present in ajaxSettings
jqXHR.done(function( r ) {
responseText = r;
});
// See if a selector was specified
self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div>")
// inject the contents of the document in, removing the scripts
// to avoid any 'Permission Denied' errors in IE
.append(responseText.replace(rscript, ""))
// Locate the specified elements
.find(selector) :
// If not, just inject the full result
responseText );
}
if ( callback ) {
self.each( callback, [ responseText, status, jqXHR ] );
}
}
});
return this;
},
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
return this.elements ? jQuery.makeArray( this.elements ) : this;
})
.filter(function(){
return this.name && !this.disabled &&
( this.checked || rselectTextarea.test( this.nodeName ) ||
rinput.test( this.type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val, i ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
jQuery.fn[ o ] = function( f ){
return this.on( o, f );
};
});
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({
type: method,
url: url,
data: data,
success: callback,
dataType: type
});
};
});
jQuery.extend({
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
// 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 ) {
if ( settings ) {
// Building a settings object
ajaxExtend( target, jQuery.ajaxSettings );
} else {
// Extending ajaxSettings
settings = target;
target = jQuery.ajaxSettings;
}
ajaxExtend( target, settings );
return target;
},
ajaxSettings: {
url: ajaxLocation,
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
processData: true,
async: true,
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
traditional: false,
headers: {},
*/
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": allTypes
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
// List of data converters
// 1) key format is "source_type destination_type" (a single space in-between)
// 2) the catchall symbol "*" can be used for source_type
converters: {
// Convert anything to text
"* text": window.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: {
context: true,
url: true
}
},
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 // Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events
// It's the callbackContext if one was provided in the options
// and if it's a DOM node or a jQuery collection
globalEventContext = callbackContext !== s &&
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
jQuery( callbackContext ) : jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks( "once memory" ),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// ifModified key
ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// Response headers
responseHeadersString,
responseHeaders,
// transport
transport,
// timeout handle
timeoutTimer,
// Cross-domain detection vars
parts,
// The jqXHR state
state = 0,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// Fake xhr
jqXHR = {
readyState: 0,
// Caches the header
setRequestHeader: function( name, value ) {
if ( !state ) {
var lname = name.toLowerCase();
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// 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 === undefined ? null : match;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Cancel the request
abort: function( statusText ) {
statusText = statusText || "abort";
if ( transport ) {
transport.abort( statusText );
}
done( 0, statusText );
return this;
}
};
// Callback for when everything is done
// It is defined here because jslint complains if it is declared
// at the end of the function (which would be more logical and readable)
function done( status, nativeStatusText, responses, headers ) {
// 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;
var isSuccess,
success,
error,
statusText = nativeStatusText,
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
lastModified,
etag;
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
jQuery.lastModified[ ifModifiedKey ] = lastModified;
}
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
jQuery.etag[ ifModifiedKey ] = etag;
}
}
// If not modified
if ( status === 304 ) {
statusText = "notmodified";
isSuccess = true;
// If we have data
} else {
try {
success = ajaxConvert( s, response );
statusText = "success";
isSuccess = true;
} catch(e) {
// We have a parsererror
statusText = "parsererror";
error = e;
}
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if ( !statusText || status ) {
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( "ajax" + ( isSuccess ? "Success" : "Error" ),
[ 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" );
}
}
}
// Attach deferreds
deferred.promise( jqXHR );
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
jqXHR.complete = completeDeferred.add;
// Status-dependent callbacks
jqXHR.statusCode = function( map ) {
if ( map ) {
var tmp;
if ( state < 2 ) {
for ( tmp in map ) {
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
}
} else {
tmp = map[ jqXHR.status ];
jqXHR.then( tmp, tmp );
}
}
return this;
};
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// We also use the url parameter if available
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
// Determine if a cross-domain request is in order
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 false;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
}
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Get ifModifiedKey before adding the anti-cache parameter
ifModifiedKey = s.url;
// Add anti-cache in url if needed
if ( s.cache === false ) {
var ts = jQuery.now(),
// try replacing _= if it is there
ret = s.url.replace( rts, "$1_=" + ts );
// if nothing was replaced, add timestamp to the end
s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
}
}
// 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 If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
ifModifiedKey = ifModifiedKey || s.url;
if ( jQuery.lastModified[ ifModifiedKey ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
}
if ( jQuery.etag[ ifModifiedKey ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
}
}
// 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
jqXHR.abort();
return false;
}
// 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;
}
}
}
return jqXHR;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a, traditional ) {
var s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : value;
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = 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 ( var prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
}
});
function buildParams( prefix, obj, traditional, add ) {
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 {
// If array item is non-scalar (array or object), encode its
// numeric index to resolve deserialization ambiguity issues.
// Note that rack (as of 1.0.0) can't currently deserialize
// nested arrays properly, and attempting to do so may cause
// a server error. Possible fixes are to modify rack's
// deserialization algorithm or to provide an option or flag
// to force array serialization to be shallow.
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( var name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
// This is still on the jQuery object... for now
// Want to move this to jQuery.ajax some day
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields,
ct,
type,
finalDataType,
firstDataType;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// 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
function ajaxConvert( s, response ) {
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
var dataTypes = s.dataTypes,
converters = {},
i,
key,
length = dataTypes.length,
tmp,
// Current and previous dataTypes
current = dataTypes[ 0 ],
prev,
// Conversion expression
conversion,
// Conversion function
conv,
// Conversion functions (transitive conversion)
conv1,
conv2;
// For each dataType in the chain
for ( i = 1; i < length; i++ ) {
// Create converters map
// with lowercased keys
if ( i === 1 ) {
for ( key in s.converters ) {
if ( typeof key === "string" ) {
converters[ key.toLowerCase() ] = s.converters[ key ];
}
}
}
// Get the dataTypes
prev = current;
current = dataTypes[ i ];
// If current is auto dataType, update it to prev
if ( current === "*" ) {
current = prev;
// If no auto and dataTypes are actually different
} else if ( prev !== "*" && prev !== current ) {
// Get the converter
conversion = prev + " " + current;
conv = converters[ conversion ] || converters[ "* " + current ];
// If there is no direct converter, search transitively
if ( !conv ) {
conv2 = undefined;
for ( conv1 in converters ) {
tmp = conv1.split( " " );
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
conv2 = converters[ tmp[1] + " " + current ];
if ( conv2 ) {
conv1 = converters[ conv1 ];
if ( conv1 === true ) {
conv = conv2;
} else if ( conv2 === true ) {
conv = conv1;
}
break;
}
}
}
}
// If we found no converter, dispatch an error
if ( !( conv || conv2 ) ) {
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
}
// If found converter is not an equivalence
if ( conv !== true ) {
// Convert with 1 or 2 converters accordingly
response = conv ? conv( response ) : conv2( conv1(response) );
}
}
}
return response;
}
var jsc = jQuery.now(),
jsre = /(\=)\?(&|$)|\?\?/i;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
return jQuery.expando + "_" + ( jsc++ );
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
if ( s.dataTypes[ 0 ] === "jsonp" ||
s.jsonp !== false && ( jsre.test( s.url ) ||
inspectData && jsre.test( s.data ) ) ) {
var responseContainer,
jsonpCallback = s.jsonpCallback =
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
previous = window[ jsonpCallback ],
url = s.url,
data = s.data,
replace = "$1" + jsonpCallback + "$2";
if ( s.jsonp !== false ) {
url = url.replace( jsre, replace );
if ( s.url === url ) {
if ( inspectData ) {
data = data.replace( jsre, replace );
}
if ( s.data === data ) {
// Add callback manually
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
}
}
}
s.url = url;
s.data = data;
// Install callback
window[ jsonpCallback ] = function( response ) {
responseContainer = [ response ];
};
// Clean-up function
jqXHR.always(function() {
// Set callback back to previous value
window[ jsonpCallback ] = previous;
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( previous ) ) {
window[ jsonpCallback ]( responseContainer[ 0 ] );
}
});
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( jsonpCallback + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Delegate to script
return "script";
}
});
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
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 || document.getElementsByTagName( "head" )[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement( "script" );
script.async = "async";
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 ( head && script.parentNode ) {
head.removeChild( script );
}
// Dereference the script
script = undefined;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709 and #4378).
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( 0, 1 );
}
}
};
}
});
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject ? function() {
// Abort all pending requests
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( 0, 1 );
}
} : false,
xhrId = 0,
xhrCallbacks;
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
(function( xhr ) {
jQuery.extend( jQuery.support, {
ajax: !!xhr,
cors: !!xhr && ( "withCredentials" in xhr )
});
})( jQuery.ajaxSettings.xhr() );
// Create transport if the browser can provide an xhr
if ( jQuery.support.ajax ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var xhr = s.xhr(),
handle,
i;
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.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 ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers[ "X-Requested-With" ] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( _ ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status,
statusText,
responseHeaders,
responses,
xml;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occured
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#11426)
try {
responses.text = xhr.responseText;
} catch( _ ) {
}
// 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 && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
// if we're in sync mode or it's in cache
// and has been retrieved directly (IE6 & IE7)
// we need to manually fire the callback
if ( !s.async || xhr.readyState === 4 ) {
callback();
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback(0,1);
}
}
};
}
});
}
var elemdisplay = {},
iframe, iframeDoc,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
timerId,
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
],
fxNow;
jQuery.fn.extend({
show: function( speed, easing, callback ) {
var elem, display;
if ( speed || speed === 0 ) {
return this.animate( genFx("show", 3), speed, easing, callback );
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
elem = this[ i ];
if ( elem.style ) {
display = elem.style.display;
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
display = 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 ( (display === "" && jQuery.css(elem, "display") === "none") ||
!jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
elem = this[ i ];
if ( elem.style ) {
display = elem.style.display;
if ( display === "" || display === "none" ) {
elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
}
}
}
return this;
}
},
hide: function( speed, easing, callback ) {
if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, easing, callback);
} else {
var elem, display,
i = 0,
j = this.length;
for ( ; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = jQuery.css( elem, "display" );
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
jQuery._data( elem, "olddisplay", display );
}
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
if ( this[i].style ) {
this[i].style.display = "none";
}
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2, callback ) {
var bool = typeof fn === "boolean";
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
this._toggle.apply( this, arguments );
} else if ( fn == null || bool ) {
this.each(function() {
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
});
} else {
this.animate(genFx("toggle", 3), fn, fn2, callback);
}
return this;
},
fadeTo: function( speed, to, easing, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed( speed, easing, callback );
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
}
// Do not change referenced properties as per-property easing will be lost
prop = jQuery.extend( {}, prop );
function doAnimation() {
// XXX 'this' does not always have a nodeName when running the
// test suite
if ( optall.queue === false ) {
jQuery._mark( this );
}
var opt = jQuery.extend( {}, optall ),
isElement = this.nodeType === 1,
hidden = isElement && jQuery(this).is(":hidden"),
name, val, p, e, hooks, replace,
parts, start, end, unit,
method;
// will store per property easing and be used to determine when an animation is complete
opt.animatedProperties = {};
// first pass over propertys to expand / normalize
for ( p in prop ) {
name = jQuery.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
}
if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
replace = hooks.expand( prop[ name ] );
delete prop[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'p' from above because we have the correct "name"
for ( p in replace ) {
if ( ! ( p in prop ) ) {
prop[ p ] = replace[ p ];
}
}
}
}
for ( name in prop ) {
val = prop[ name ];
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
if ( jQuery.isArray( val ) ) {
opt.animatedProperties[ name ] = val[ 1 ];
val = prop[ name ] = val[ 0 ];
} else {
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
}
if ( val === "hide" && hidden || val === "show" && !hidden ) {
return opt.complete.call( this );
}
if ( isElement && ( name === "height" || name === "width" ) ) {
// 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
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( jQuery.css( this, "display" ) === "inline" &&
jQuery.css( this, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.zoom = 1;
}
}
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
for ( p in prop ) {
e = new jQuery.fx( this, opt, p );
val = prop[ p ];
if ( rfxtypes.test( val ) ) {
// Tracks whether to show or hide based on private
// data attached to the element
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
if ( method ) {
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
e[ method ]();
} else {
e[ val ]();
}
} else {
parts = rfxnum.exec( val );
start = e.cur();
if ( parts ) {
end = parseFloat( parts[2] );
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" ) {
jQuery.style( this, p, (end || 1) + unit);
start = ( (end || 1) / e.cur() ) * start;
jQuery.style( this, p, start + unit);
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
}
// For JS strict compliance
return true;
}
return optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var index,
hadTimers = false,
timers = jQuery.timers,
data = jQuery._data( this );
// clear marker counters if we know they won't be
if ( !gotoEnd ) {
jQuery._unmark( true, this );
}
function stopQueue( elem, data, index ) {
var hooks = data[ index ];
jQuery.removeData( elem, index, true );
hooks.stop( gotoEnd );
}
if ( type == null ) {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
stopQueue( this, data, index );
}
}
} else if ( data[ index = type + ".run" ] && data[ index ].stop ){
stopQueue( this, data, index );
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
if ( gotoEnd ) {
// force the next step to be the last
timers[ index ]( true );
} else {
timers[ index ].saveState();
}
hadTimers = true;
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 ( !( gotoEnd && hadTimers ) ) {
jQuery.dequeue( this, type );
}
});
}
});
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout( clearFxNow, 0 );
return ( fxNow = jQuery.now() );
}
function clearFxNow() {
fxNow = undefined;
}
// Generate parameters to create a standard animation
function genFx( type, num ) {
var obj = {};
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
obj[ this ] = type;
});
return obj;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx( "show", 1 ),
slideUp: genFx( "hide", 1 ),
slideToggle: genFx( "toggle", 1 ),
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.extend({
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( noUnmark ) {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
} else if ( noUnmark !== false ) {
jQuery._unmark( this );
}
};
return opt;
},
easing: {
linear: function( p ) {
return p;
},
swing: function( p ) {
return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
}
},
timers: [],
fx: function( elem, options, prop ) {
this.options = options;
this.elem = elem;
this.prop = prop;
options.orig = options.orig || {};
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function() {
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
},
// Get the current size
cur: function() {
if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
return this.elem[ this.prop ];
}
var parsed,
r = jQuery.css( this.elem, this.prop );
// Empty strings, null, undefined and "auto" are converted to 0,
// complex values such as "rotate(1rad)" are returned as is,
// simple values such as "10px" are parsed to Float.
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
},
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx;
this.startTime = fxNow || createFxNow();
this.end = to;
this.now = this.start = from;
this.pos = this.state = 0;
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
function t( gotoEnd ) {
return self.step( gotoEnd );
}
t.queue = this.options.queue;
t.elem = this.elem;
t.saveState = function() {
if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
if ( self.options.hide ) {
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
} else if ( self.options.show ) {
jQuery._data( self.elem, "fxshow" + self.prop, self.end );
}
}
};
if ( t() && jQuery.timers.push(t) && !timerId ) {
timerId = setInterval( fx.tick, fx.interval );
}
},
// Simple 'show' function
show: function() {
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
// Remember where we started, so that we can go back to it later
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any flash of content
if ( dataShow !== undefined ) {
// This show is picking up where a previous hide or show left off
this.custom( this.cur(), dataShow );
} else {
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
}
// Start by showing the element
jQuery( this.elem ).show();
},
// Simple 'hide' function
hide: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
this.options.hide = true;
// Begin the animation
this.custom( this.cur(), 0 );
},
// Each step of an animation
step: function( gotoEnd ) {
var p, n, complete,
t = fxNow || createFxNow(),
done = true,
elem = this.elem,
options = this.options;
if ( gotoEnd || t >= options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
options.animatedProperties[ this.prop ] = true;
for ( p in options.animatedProperties ) {
if ( options.animatedProperties[ p ] !== true ) {
done = false;
}
}
if ( done ) {
// Reset the overflow
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
elem.style[ "overflow" + value ] = options.overflow[ index ];
});
}
// Hide the element if the "hide" operation was done
if ( options.hide ) {
jQuery( elem ).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( options.hide || options.show ) {
for ( p in options.animatedProperties ) {
jQuery.style( elem, p, options.orig[ p ] );
jQuery.removeData( elem, "fxshow" + p, true );
// Toggle data is no longer needed
jQuery.removeData( elem, "toggle" + p, true );
}
}
// Execute the complete function
// in the event that the complete function throws an exception
// we must ensure it won't be called twice. #5684
complete = options.complete;
if ( complete ) {
options.complete = false;
complete.call( elem );
}
}
return false;
} else {
// classical easing cannot be used with an Infinity duration
if ( options.duration == Infinity ) {
this.now = t;
} else {
n = t - this.startTime;
this.state = n / options.duration;
// Perform the easing function, defaults to swing
this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
this.now = this.start + ( (this.end - this.start) * this.pos );
}
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
tick: function() {
var timer,
timers = jQuery.timers,
i = 0;
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();
}
},
interval: 13,
stop: function() {
clearInterval( timerId );
timerId = null;
},
speeds: {
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function( fx ) {
jQuery.style( fx.elem, "opacity", fx.now );
},
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
// Ensure props that can't be negative don't go there on undershoot easing
jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
// exclude marginTop, marginLeft, marginBottom and marginRight from this list
if ( prop.indexOf( "margin" ) ) {
jQuery.fx.step[ prop ] = function( fx ) {
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
};
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
// Try to restore the default display value of an element
function defaultDisplay( nodeName ) {
if ( !elemdisplay[ nodeName ] ) {
var body = document.body,
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
display = elem.css( "display" );
elem.remove();
// If the simple way fails,
// get element's real default display by attaching it to a temp iframe
if ( display === "none" || display === "" ) {
// No iframe to use yet, so create it
if ( !iframe ) {
iframe = document.createElement( "iframe" );
iframe.frameBorder = iframe.width = iframe.height = 0;
}
body.appendChild( iframe );
// Create a cacheable copy of the iframe document on first call.
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
// document to it; WebKit & Firefox won't allow reusing the iframe document.
if ( !iframeDoc || !iframe.createElement ) {
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
iframeDoc.close();
}
elem = iframeDoc.createElement( nodeName );
iframeDoc.body.appendChild( elem );
display = jQuery.css( elem, "display" );
body.removeChild( iframe );
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return elemdisplay[ nodeName ];
}
var getOffset,
rtable = /^t(?:able|d|h)$/i,
rroot = /^(?:body|html)$/i;
if ( "getBoundingClientRect" in document.documentElement ) {
getOffset = function( elem, doc, docElem, box ) {
try {
box = elem.getBoundingClientRect();
} catch(e) {}
// Make sure we're not dealing with a disconnected DOM node
if ( !box || !jQuery.contains( docElem, elem ) ) {
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
}
var body = doc.body,
win = getWindow( doc ),
clientTop = docElem.clientTop || body.clientTop || 0,
clientLeft = docElem.clientLeft || body.clientLeft || 0,
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
top = box.top + scrollTop - clientTop,
left = box.left + scrollLeft - clientLeft;
return { top: top, left: left };
};
} else {
getOffset = function( elem, doc, docElem ) {
var computedStyle,
offsetParent = elem.offsetParent,
prevOffsetParent = elem,
body = doc.body,
defaultView = doc.defaultView,
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
top = elem.offsetTop,
left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
break;
}
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
top -= elem.scrollTop;
left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop;
left += elem.offsetLeft;
if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent;
offsetParent = elem.offsetParent;
}
if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevComputedStyle = computedStyle;
}
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
top += body.offsetTop;
left += body.offsetLeft;
}
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
var elem = this[0],
doc = elem && elem.ownerDocument;
if ( !doc ) {
return null;
}
if ( elem === doc.body ) {
return jQuery.offset.bodyOffset( elem );
}
return getOffset( elem, doc, doc.documentElement );
};
jQuery.offset = {
bodyOffset: function( body ) {
var top = body.offsetTop,
left = body.offsetLeft;
if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
}
return { top: top, left: left };
},
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// 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({
position: function() {
if ( !this[0] ) {
return null;
}
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract 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
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
// Add offsetParent borders
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
});
}
});
// 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 jQuery.access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
win.document.body[ 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 );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
var clientProp = "client" + name,
scrollProp = "scroll" + name,
offsetProp = "offset" + name;
// innerHeight and innerWidth
jQuery.fn[ "inner" + name ] = function() {
var elem = this[0];
return elem ?
elem.style ?
parseFloat( jQuery.css( elem, type, "padding" ) ) :
this[ type ]() :
null;
};
// outerHeight and outerWidth
jQuery.fn[ "outer" + name ] = function( margin ) {
var elem = this[0];
return elem ?
elem.style ?
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
this[ type ]() :
null;
};
jQuery.fn[ type ] = function( value ) {
return jQuery.access( this, function( elem, type, value ) {
var doc, docElemProp, orig, ret;
if ( jQuery.isWindow( elem ) ) {
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
doc = elem.document;
docElemProp = doc.documentElement[ clientProp ];
return jQuery.support.boxModel && docElemProp ||
doc.body && doc.body[ clientProp ] || docElemProp;
}
// Get document width or height
if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
doc = elem.documentElement;
// when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
// so we can't use max, as it'll choose the incorrect offset[Width/Height]
// instead we use the correct client[Width/Height]
// support:IE6
if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
return doc[ clientProp ];
}
return Math.max(
elem.body[ scrollProp ], doc[ scrollProp ],
elem.body[ offsetProp ], doc[ offsetProp ]
);
}
// Get width or height on the element
if ( value === undefined ) {
orig = jQuery.css( elem, type );
ret = parseFloat( orig );
return jQuery.isNumeric( ret ) ? ret : orig;
}
// Set the width or height on the element
jQuery( elem ).css( type, value );
}, type, value, arguments.length, null );
};
});
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use 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.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window );
/**
* @license AngularJS v1.0.0rc9
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document){
var _jQuery = window.jQuery.noConflict(true);
////////////////////////////////////
/**
* @ngdoc function
* @name angular.lowercase
* @function
*
* @description Converts the specified string to lowercase.
* @param {string} string String to be converted to lowercase.
* @returns {string} Lowercased string.
*/
var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;};
/**
* @ngdoc function
* @name angular.uppercase
* @function
*
* @description Converts the specified string to uppercase.
* @param {string} string String to be converted to uppercase.
* @returns {string} Uppercased string.
*/
var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;};
var manualLowercase = function(s) {
return isString(s)
? s.replace(/[A-Z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) | 32);})
: s;
};
var manualUppercase = function(s) {
return isString(s)
? s.replace(/[a-z]/g, function(ch) {return fromCharCode(ch.charCodeAt(0) & ~32);})
: s;
};
// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
// with correct but slower alternatives.
if ('i' !== 'I'.toLowerCase()) {
lowercase = manualLowercase;
uppercase = manualUppercase;
}
function fromCharCode(code) {return String.fromCharCode(code);}
var Error = window.Error,
/** holds major version number for IE or NaN for real browsers */
msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),
jqLite, // delay binding since jQuery could be loaded after us.
jQuery, // delay binding
slice = [].slice,
push = [].push,
toString = Object.prototype.toString,
/** @name angular */
angular = window.angular || (window.angular = {}),
angularModule,
/** @name angular.module.ng */
nodeName_,
uid = ['0', '0', '0'];
/**
* @ngdoc function
* @name angular.forEach
* @function
*
* @description
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
* object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value`
* is the value of an object property or an array element and `key` is the object property key or
* array element index. Specifying a `context` for the function is optional.
*
* Note: this function was previously known as `angular.foreach`.
*
<pre>
var values = {name: 'misko', gender: 'male'};
var log = [];
angular.forEach(values, function(value, key){
this.push(key + ': ' + value);
}, log);
expect(log).toEqual(['name: misko', 'gender:male']);
</pre>
*
* @param {Object|Array} obj Object to iterate over.
* @param {Function} iterator Iterator function.
* @param {Object=} context Object to become context (`this`) for the iterator function.
* @returns {Object|Array} Reference to `obj`.
*/
function forEach(obj, iterator, context) {
var key;
if (obj) {
if (isFunction(obj)){
for (key in obj) {
if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key);
}
}
} else if (obj.forEach && obj.forEach !== forEach) {
obj.forEach(iterator, context);
} else if (isObject(obj) && isNumber(obj.length)) {
for (key = 0; key < obj.length; key++)
iterator.call(context, obj[key], key);
} else {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key);
}
}
}
}
return obj;
}
function sortedKeys(obj) {
var keys = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys.sort();
}
function forEachSorted(obj, iterator, context) {
var keys = sortedKeys(obj);
for ( var i = 0; i < keys.length; i++) {
iterator.call(context, obj[keys[i]], keys[i]);
}
return keys;
}
/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
* @returns {function(*, string)}
*/
function reverseParams(iteratorFn) {
return function(value, key) { iteratorFn(key, value) };
}
/**
* A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric
* characters such as '012ABC'. The reason why we are not using simply a number counter is that
* the number string gets longer over time, and it can also overflow, where as the the nextId
* will grow much slower, it is a string, and it will never overflow.
*
* @returns an unique alpha-numeric string
*/
function nextUid() {
var index = uid.length;
var digit;
while(index) {
index--;
digit = uid[index].charCodeAt(0);
if (digit == 57 /*'9'*/) {
uid[index] = 'A';
return uid.join('');
}
if (digit == 90 /*'Z'*/) {
uid[index] = '0';
} else {
uid[index] = String.fromCharCode(digit + 1);
return uid.join('');
}
}
uid.unshift('0');
return uid.join('');
}
/**
* @ngdoc function
* @name angular.extend
* @function
*
* @description
* Extends the destination object `dst` by copying all of the properties from the `src` object(s)
* to `dst`. You can specify multiple `src` objects.
*
* @param {Object} dst Destination object.
* @param {...Object} src Source object(s).
*/
function extend(dst) {
forEach(arguments, function(obj){
if (obj !== dst) {
forEach(obj, function(value, key){
dst[key] = value;
});
}
});
return dst;
}
function int(str) {
return parseInt(str, 10);
}
function inherit(parent, extra) {
return extend(new (extend(function() {}, {prototype:parent}))(), extra);
}
/**
* @ngdoc function
* @name angular.noop
* @function
*
* @description
* A function that performs no operations. This function can be useful when writing code in the
* functional style.
<pre>
function foo(callback) {
var result = calculateResult();
(callback || angular.noop)(result);
}
</pre>
*/
function noop() {}
noop.$inject = [];
/**
* @ngdoc function
* @name angular.identity
* @function
*
* @description
* A function that returns its first argument. This function is useful when writing code in the
* functional style.
*
<pre>
function transformer(transformationFn, value) {
return (transformationFn || identity)(value);
};
</pre>
*/
function identity($) {return $;}
identity.$inject = [];
function valueFn(value) {return function() {return value;};}
/**
* @ngdoc function
* @name angular.isUndefined
* @function
*
* @description
* Determines if a reference is undefined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is undefined.
*/
function isUndefined(value){return typeof value == 'undefined';}
/**
* @ngdoc function
* @name angular.isDefined
* @function
*
* @description
* Determines if a reference is defined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is defined.
*/
function isDefined(value){return typeof value != 'undefined';}
/**
* @ngdoc function
* @name angular.isObject
* @function
*
* @description
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
* considered to be objects.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Object` but not `null`.
*/
function isObject(value){return value != null && typeof value == 'object';}
/**
* @ngdoc function
* @name angular.isString
* @function
*
* @description
* Determines if a reference is a `String`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `String`.
*/
function isString(value){return typeof value == 'string';}
/**
* @ngdoc function
* @name angular.isNumber
* @function
*
* @description
* Determines if a reference is a `Number`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Number`.
*/
function isNumber(value){return typeof value == 'number';}
/**
* @ngdoc function
* @name angular.isDate
* @function
*
* @description
* Determines if a value is a date.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Date`.
*/
function isDate(value){
return toString.apply(value) == '[object Date]';
}
/**
* @ngdoc function
* @name angular.isArray
* @function
*
* @description
* Determines if a reference is an `Array`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Array`.
*/
function isArray(value) {
return toString.apply(value) == '[object Array]';
}
/**
* @ngdoc function
* @name angular.isFunction
* @function
*
* @description
* Determines if a reference is a `Function`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Function`.
*/
function isFunction(value){return typeof value == 'function';}
/**
* Checks if `obj` is a window object.
*
* @private
* @param {*} obj Object to check
* @returns {boolean} True if `obj` is a window obj.
*/
function isWindow(obj) {
return obj && obj.document && obj.location && obj.alert && obj.setInterval;
}
function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch;
}
function isFile(obj) {
return toString.apply(obj) === '[object File]';
}
function isBoolean(value) {
return typeof value == 'boolean';
}
function trim(value) {
return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
}
/**
* @ngdoc function
* @name angular.isElement
* @function
*
* @description
* Determines if a reference is a DOM element (or wrapped jQuery element).
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
*/
function isElement(node) {
return node &&
(node.nodeName // we are a direct element
|| (node.bind && node.find)); // we have a bind and find method part of jQuery API
}
/**
* @param str 'key1,key2,...'
* @returns {object} in the form of {key1:true, key2:true, ...}
*/
function makeMap(str){
var obj = {}, items = str.split(","), i;
for ( i = 0; i < items.length; i++ )
obj[ items[i] ] = true;
return obj;
}
if (msie < 9) {
nodeName_ = function(element) {
element = element.nodeName ? element : element[0];
return (element.scopeName && element.scopeName != 'HTML')
? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName;
};
} else {
nodeName_ = function(element) {
return element.nodeName ? element.nodeName : element[0].nodeName;
};
}
function map(obj, iterator, context) {
var results = [];
forEach(obj, function(value, index, list) {
results.push(iterator.call(context, value, index, list));
});
return results;
}
/**
* @description
* Determines the number of elements in an array, the number of properties an object has, or
* the length of a string.
*
* Note: This function is used to augment the Object type in Angular expressions. See
* {@link angular.Object} for more information about Angular arrays.
*
* @param {Object|Array|string} obj Object, array, or string to inspect.
* @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object
* @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
*/
function size(obj, ownPropsOnly) {
var size = 0, key;
if (isArray(obj) || isString(obj)) {
return obj.length;
} else if (isObject(obj)){
for (key in obj)
if (!ownPropsOnly || obj.hasOwnProperty(key))
size++;
}
return size;
}
function includes(array, obj) {
return indexOf(array, obj) != -1;
}
function indexOf(array, obj) {
if (array.indexOf) return array.indexOf(obj);
for ( var i = 0; i < array.length; i++) {
if (obj === array[i]) return i;
}
return -1;
}
function arrayRemove(array, value) {
var index = indexOf(array, value);
if (index >=0)
array.splice(index, 1);
return value;
}
function isLeafNode (node) {
if (node) {
switch (node.nodeName) {
case "OPTION":
case "PRE":
case "TITLE":
return true;
}
}
return false;
}
/**
* @ngdoc function
* @name angular.copy
* @function
*
* @description
* Creates a deep copy of `source`, which should be an object or an array.
*
* * If no destination is supplied, a copy of the object or array is created.
* * If a destination is provided, all of its elements (for array) or properties (for objects)
* are deleted and then all elements/properties from the source are copied to it.
* * If `source` is not an object or array, `source` is returned.
*
* Note: this function is used to augment the Object type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {*} source The source that will be used to make a copy.
* Can be any type, including primitives, `null`, and `undefined`.
* @param {(Object|Array)=} destination Destination into which the source is copied. If
* provided, must be of the same type as `source`.
* @returns {*} The copy or updated `destination`, if `destination` was specified.
*/
function copy(source, destination){
if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
if (!destination) {
destination = source;
if (source) {
if (isArray(source)) {
destination = copy(source, []);
} else if (isDate(source)) {
destination = new Date(source.getTime());
} else if (isObject(source)) {
destination = copy(source, {});
}
}
} else {
if (source === destination) throw Error("Can't copy equivalent objects or arrays");
if (isArray(source)) {
while(destination.length) {
destination.pop();
}
for ( var i = 0; i < source.length; i++) {
destination.push(copy(source[i]));
}
} else {
forEach(destination, function(value, key){
delete destination[key];
});
for ( var key in source) {
destination[key] = copy(source[key]);
}
}
}
return destination;
}
/**
* Create a shallow copy of an object
*/
function shallowCopy(src, dst) {
dst = dst || {};
for(var key in src) {
if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {
dst[key] = src[key];
}
}
return dst;
}
/**
* @ngdoc function
* @name angular.equals
* @function
*
* @description
* Determines if two objects or two values are equivalent. Supports value types, arrays and
* objects.
*
* Two objects or values are considered equivalent if at least one of the following is true:
*
* * Both objects or values pass `===` comparison.
* * Both objects or values are of the same type and all of their properties pass `===` comparison.
* * Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal)
*
* During a property comparision, properties of `function` type and properties with names
* that begin with `$` are ignored.
*
* Scope and DOMWindow objects are being compared only be identify (`===`).
*
* @param {*} o1 Object or value to compare.
* @param {*} o2 Object or value to compare.
* @returns {boolean} True if arguments are equal.
*/
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
if (t1 == t2) {
if (t1 == 'object') {
if (isArray(o1)) {
if ((length = o1.length) == o2.length) {
for(key=0; key<length; key++) {
if (!equals(o1[key], o2[key])) return false;
}
return true;
}
} else if (isDate(o1)) {
return isDate(o2) && o1.getTime() == o2.getTime();
} else {
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2)) return false;
keySet = {};
for(key in o1) {
if (key.charAt(0) !== '$' && !isFunction(o1[key]) && !equals(o1[key], o2[key])) {
return false;
}
keySet[key] = true;
}
for(key in o2) {
if (!keySet[key] && key.charAt(0) !== '$' && !isFunction(o2[key])) return false;
}
return true;
}
}
}
return false;
}
function concat(array1, array2, index) {
return array1.concat(slice.call(array2, index));
}
function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0);
}
/**
* @ngdoc function
* @name angular.bind
* @function
*
* @description
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
* `fn`). You can supply optional `args` that are are prebound to the function. This feature is also
* known as [function currying](http://en.wikipedia.org/wiki/Currying).
*
* @param {Object} self Context which `fn` should be evaluated in.
* @param {function()} fn Function to be bound.
* @param {...*} args Optional arguments to be prebound to the `fn` function call.
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
*/
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
if (isFunction(fn) && !(fn instanceof RegExp)) {
return curryArgs.length
? function() {
return arguments.length
? fn.apply(self, curryArgs.concat(slice.call(arguments, 0)))
: fn.apply(self, curryArgs);
}
: function() {
return arguments.length
? fn.apply(self, arguments)
: fn.call(self);
};
} else {
// in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
return fn;
}
}
function toJsonReplacer(key, value) {
var val = value;
if (/^\$+/.test(key)) {
val = undefined;
} else if (isWindow(value)) {
val = '$WINDOW';
} else if (value && document === value) {
val = '$DOCUMENT';
} else if (isScope(value)) {
val = '$SCOPE';
}
return val;
}
/**
* @ngdoc function
* @name angular.toJson
* @function
*
* @description
* Serializes input into a JSON-formatted string.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
* @returns {string} Jsonified string representing `obj`.
*/
function toJson(obj, pretty) {
return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
}
/**
* @ngdoc function
* @name angular.fromJson
* @function
*
* @description
* Deserializes a JSON string.
*
* @param {string} json JSON string to deserialize.
* @returns {Object|Array|Date|string|number} Deserialized thingy.
*/
function fromJson(json) {
return isString(json)
? JSON.parse(json)
: json;
}
function toBoolean(value) {
if (value && value.length !== 0) {
var v = lowercase("" + value);
value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
} else {
value = false;
}
return value;
}
/**
* @returns {string} Returns the string representation of the element.
*/
function startingTag(element) {
element = jqLite(element).clone();
try {
// turns out IE does not let you set .html() on elements which
// are not allowed to have children. So we just ignore it.
element.html('');
} catch(e) {}
return jqLite('<div>').append(element).html().match(/^(<[^>]+>)/)[1];
}
/////////////////////////////////////////////////
/**
* Parses an escaped url query string into key-value pairs.
* @returns Object.<(string|boolean)>
*/
function parseKeyValue(/**string*/keyValue) {
var obj = {}, key_value, key;
forEach((keyValue || "").split('&'), function(keyValue){
if (keyValue) {
key_value = keyValue.split('=');
key = decodeURIComponent(key_value[0]);
obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
}
});
return obj;
}
function toKeyValue(obj) {
var parts = [];
forEach(obj, function(value, key) {
parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));
});
return parts.length ? parts.join('&') : '';
}
/**
* We need our custom mehtod because encodeURIComponent is too agressive and doesn't follow
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
* segments:
* segment = *pchar
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* pct-encoded = "%" HEXDIG HEXDIG
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriSegment(val) {
return encodeUriQuery(val, true).
replace(/%26/gi, '&').
replace(/%3D/gi, '=').
replace(/%2B/gi, '+');
}
/**
* This method is intended for encoding *key* or *value* parts of query component. We need a custom
* method becuase encodeURIComponent is too agressive and encodes stuff that doesn't have to be
* encoded per http://tools.ietf.org/html/rfc3986:
* query = *( pchar / "/" / "?" )
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriQuery(val, pctEncodeSpaces) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace((pctEncodeSpaces ? null : /%20/g), '+');
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngApp
*
* @element ANY
* @param {angular.Module} ngApp on optional application
* {@link angular.module module} name to load.
*
* @description
*
* Use this directive to auto-bootstrap on application. Only
* one directive can be used per HTML document. The directive
* designates the root of the application and is typically placed
* ot the root of the page.
*
* In the example below if the `ngApp` directive would not be placed
* on the `html` element then the document would not be compiled
* and the `{{ 1+2 }}` would not be resolved to `3`.
*
* `ngApp` is the easiest way to bootstrap an application.
*
<doc:example>
<doc:source>
I can add: 1 + 2 = {{ 1+2 }}
</doc:source>
</doc:example>
*
*/
function angularInit(element, bootstrap) {
var elements = [element],
appElement,
module,
names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
function append(element) {
element && elements.push(element);
}
forEach(names, function(name) {
names[name] = true;
append(document.getElementById(name));
name = name.replace(':', '\\:');
if (element.querySelectorAll) {
forEach(element.querySelectorAll('.' + name), append);
forEach(element.querySelectorAll('.' + name + '\\:'), append);
forEach(element.querySelectorAll('[' + name + ']'), append);
}
});
forEach(elements, function(element) {
if (!appElement) {
var className = ' ' + element.className + ' ';
var match = NG_APP_CLASS_REGEXP.exec(className);
if (match) {
appElement = element;
module = (match[2] || '').replace(/\s+/g, ',');
} else {
forEach(element.attributes, function(attr) {
if (!appElement && names[attr.name]) {
appElement = element;
module = attr.value;
}
});
}
}
});
if (appElement) {
bootstrap(appElement, module ? [module] : []);
}
}
/**
* @ngdoc function
* @name angular.bootstrap
* @description
* Use this function to manually start up angular application.
*
* See: {@link guide/dev_guide.bootstrap.manual_bootstrap Bootstrap}
*
* @param {Element} element DOM element which is the root of angular application.
* @param {Array<String|Function>=} modules an array of module declarations. See: {@link angular.module modules}
* @returns {angular.module.auto.$injector} Returns the newly created injector for this app.
*/
function bootstrap(element, modules) {
element = jqLite(element);
modules = modules || [];
modules.unshift('ng');
var injector = createInjector(modules);
injector.invoke(
['$rootScope', '$compile', '$injector', function(scope, compile, injector){
scope.$apply(function() {
element.data('$injector', injector);
compile(element)(scope);
});
}]
);
return injector;
}
var SNAKE_CASE_REGEXP = /[A-Z]/g;
function snake_case(name, separator){
separator = separator || '_';
return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
return (pos ? separator : '') + letter.toLowerCase();
});
}
function bindJQuery() {
// bind to jQuery if present;
jQuery = window.jQuery;
// reset to jQuery or default to us.
if (jQuery) {
jqLite = jQuery;
extend(jQuery.fn, {
scope: JQLitePrototype.scope,
controller: JQLitePrototype.controller,
injector: JQLitePrototype.injector,
inheritedData: JQLitePrototype.inheritedData
});
JQLitePatchJQueryRemove('remove', true);
JQLitePatchJQueryRemove('empty');
JQLitePatchJQueryRemove('html');
} else {
jqLite = JQLite;
}
angular.element = jqLite;
}
/**
* throw error of the argument is falsy.
*/
function assertArg(arg, name, reason) {
if (!arg) {
throw new Error("Argument '" + (name || '?') + "' is " + (reason || "required"));
}
return arg;
}
function assertArgFn(arg, name, acceptArrayAnnotation) {
if (acceptArrayAnnotation && isArray(arg)) {
arg = arg[arg.length - 1];
}
assertArg(isFunction(arg), name, 'not a function, got ' +
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}
/**
* @ngdoc interface
* @name angular.Module
* @description
*
* Interface for configuring angular {@link angular.module modules}.
*/
function setupModuleLoader(window) {
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
return ensure(ensure(window, 'angular', Object), 'module', function() {
/** @type {Object.<string, angular.Module>} */
var modules = {};
/**
* @ngdoc function
* @name angular.module
* @description
*
* The `angular.module` is a global place for creating and registering Angular modules. All
* modules (angular core or 3rd party) that should be available to an application must be
* registered using this mechanism.
*
*
* # Module
*
* A module is a collocation of services, directives, filters, and configure information. Module
* is used to configure the {@link angular.module.AUTO.$injector $injector}.
*
* <pre>
* // Create a new module
* var myModule = angular.module('myModule', []);
*
* // register a new service
* myModule.value('appName', 'MyCoolApp');
*
* // configure existing services inside initialization blocks.
* myModule.config(function($locationProvider) {
* // Configure existing providers
* $locationProvider.hashPrefix('!');
* });
* </pre>
*
* Then you can create an injector and load your modules like this:
*
* <pre>
* var injector = angular.injector(['ng', 'MyModule'])
* </pre>
*
* However it's more likely that you'll just use
* {@link angular.module.ng.$compileProvider.directive.ngApp ngApp} or
* {@link angular.bootstrap} to simplify this process for you.
*
* @param {!string} name The name of the module to create or retrieve.
* @param {Array.<string>=} requires If specified then new module is being created. If unspecified then the
* the module is being retrieved for further configuration.
* @param {Function} configFn Option configuration function for the module. Same as
* {@link angular.Module#config Module#config()}.
* @returns {module} new module with the {@link angular.Module} api.
*/
return function module(name, requires, configFn) {
if (requires && modules.hasOwnProperty(name)) {
modules[name] = null;
}
return ensure(modules, name, function() {
if (!requires) {
throw Error('No module: ' + name);
}
/** @type {!Array.<Array.<*>>} */
var invokeQueue = [];
/** @type {!Array.<Function>} */
var runBlocks = [];
var config = invokeLater('$injector', 'invoke');
/** @type {angular.Module} */
var moduleInstance = {
// Private state
_invokeQueue: invokeQueue,
_runBlocks: runBlocks,
/**
* @ngdoc property
* @name angular.Module#requires
* @propertyOf angular.Module
* @returns {Array.<string>} List of module names which must be loaded before this module.
* @description
* Holds the list of modules which the injector will load before the current module is loaded.
*/
requires: requires,
/**
* @ngdoc property
* @name angular.Module#name
* @propertyOf angular.Module
* @returns {string} Name of the module.
* @description
*/
name: name,
/**
* @ngdoc method
* @name angular.Module#provider
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerType Construction function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#provider $provide.provider()}.
*/
provider: invokeLater('$provide', 'provider'),
/**
* @ngdoc method
* @name angular.Module#factory
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} providerFunction Function for creating new instance of the service.
* @description
* See {@link angular.module.AUTO.$provide#factory $provide.factory()}.
*/
factory: invokeLater('$provide', 'factory'),
/**
* @ngdoc method
* @name angular.Module#service
* @methodOf angular.Module
* @param {string} name service name
* @param {Function} constructor A constructor function that will be instantiated.
* @description
* See {@link angular.module.AUTO.$provide#service $provide.service()}.
*/
service: invokeLater('$provide', 'service'),
/**
* @ngdoc method
* @name angular.Module#value
* @methodOf angular.Module
* @param {string} name service name
* @param {*} object Service instance object.
* @description
* See {@link angular.module.AUTO.$provide#value $provide.value()}.
*/
value: invokeLater('$provide', 'value'),
/**
* @ngdoc method
* @name angular.Module#constant
* @methodOf angular.Module
* @param {string} name constant name
* @param {*} object Constant value.
* @description
* Because the constant are fixed, they get applied before other provide methods.
* See {@link angular.module.AUTO.$provide#constant $provide.constant()}.
*/
constant: invokeLater('$provide', 'constant', 'unshift'),
/**
* @ngdoc method
* @name angular.Module#filter
* @methodOf angular.Module
* @param {string} name Filter name.
* @param {Function} filterFactory Factory function for creating new instance of filter.
* @description
* See {@link angular.module.ng.$filterProvider#register $filterProvider.register()}.
*/
filter: invokeLater('$filterProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#controller
* @methodOf angular.Module
* @param {string} name Controller name.
* @param {Function} constructor Controller constructor function.
* @description
* See {@link angular.module.ng.$controllerProvider#register $controllerProvider.register()}.
*/
controller: invokeLater('$controllerProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#directive
* @methodOf angular.Module
* @param {string} name directive name
* @param {Function} directiveFactory Factory function for creating new instance of
* directives.
* @description
* See {@link angular.module.ng.$compileProvider.directive $compileProvider.directive()}.
*/
directive: invokeLater('$compileProvider', 'directive'),
/**
* @ngdoc method
* @name angular.Module#config
* @methodOf angular.Module
* @param {Function} configFn Execute this function on module load. Useful for service
* configuration.
* @description
* Use this method to register work which needs to be performed on module loading.
*/
config: config,
/**
* @ngdoc method
* @name angular.Module#run
* @methodOf angular.Module
* @param {Function} initializationFn Execute this function after injector creation.
* Useful for application initialization.
* @description
* Use this method to register work which needs to be performed when the injector with
* with the current module is finished loading.
*/
run: function(block) {
runBlocks.push(block);
return this;
}
};
if (configFn) {
config(configFn);
}
return moduleInstance;
/**
* @param {string} provider
* @param {string} method
* @param {String=} insertMethod
* @returns {angular.Module}
*/
function invokeLater(provider, method, insertMethod) {
return function() {
invokeQueue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
}
}
});
};
});
}
/**
* @ngdoc property
* @name angular.version
* @description
* An object that contains information about the current AngularJS version. This object has the
* following properties:
*
* - `full` – `{string}` – Full version string, such as "0.9.18".
* - `major` – `{number}` – Major version number, such as "0".
* - `minor` – `{number}` – Minor version number, such as "9".
* - `dot` – `{number}` – Dot version number, such as "18".
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/
var version = {
full: '1.0.0rc9', // all of these placeholder strings will be replaced by rake's
major: 1, // compile task
minor: 0,
dot: 0,
codeName: 'eggplant-teleportation'
};
function publishExternalAPI(angular){
extend(angular, {
'bootstrap': bootstrap,
'copy': copy,
'extend': extend,
'equals': equals,
'element': jqLite,
'forEach': forEach,
'injector': createInjector,
'noop':noop,
'bind':bind,
'toJson': toJson,
'fromJson': fromJson,
'identity':identity,
'isUndefined': isUndefined,
'isDefined': isDefined,
'isString': isString,
'isFunction': isFunction,
'isObject': isObject,
'isNumber': isNumber,
'isElement': isElement,
'isArray': isArray,
'version': version,
'isDate': isDate,
'lowercase': lowercase,
'uppercase': uppercase,
'callbacks': {counter: 0}
});
angularModule = setupModuleLoader(window);
try {
angularModule('ngLocale');
} catch (e) {
angularModule('ngLocale', []).provider('$locale', $LocaleProvider);
}
angularModule('ng', ['ngLocale'], ['$provide',
function ngModule($provide) {
$provide.provider('$compile', $CompileProvider).
directive({
a: htmlAnchorDirective,
input: inputDirective,
textarea: inputDirective,
form: formDirective,
script: scriptDirective,
select: selectDirective,
style: styleDirective,
option: optionDirective,
ngBind: ngBindDirective,
ngBindHtmlUnsafe: ngBindHtmlUnsafeDirective,
ngBindTemplate: ngBindTemplateDirective,
ngClass: ngClassDirective,
ngClassEven: ngClassEvenDirective,
ngClassOdd: ngClassOddDirective,
ngCsp: ngCspDirective,
ngCloak: ngCloakDirective,
ngController: ngControllerDirective,
ngForm: ngFormDirective,
ngHide: ngHideDirective,
ngInclude: ngIncludeDirective,
ngInit: ngInitDirective,
ngNonBindable: ngNonBindableDirective,
ngPluralize: ngPluralizeDirective,
ngRepeat: ngRepeatDirective,
ngShow: ngShowDirective,
ngSubmit: ngSubmitDirective,
ngStyle: ngStyleDirective,
ngSwitch: ngSwitchDirective,
ngSwitchWhen: ngSwitchWhenDirective,
ngSwitchDefault: ngSwitchDefaultDirective,
ngOptions: ngOptionsDirective,
ngView: ngViewDirective,
ngTransclude: ngTranscludeDirective,
ngModel: ngModelDirective,
ngList: ngListDirective,
ngChange: ngChangeDirective,
required: requiredDirective,
ngRequired: requiredDirective,
ngValue: ngValueDirective
}).
directive(ngAttributeAliasDirectives).
directive(ngEventDirectives);
$provide.provider({
$anchorScroll: $AnchorScrollProvider,
$browser: $BrowserProvider,
$cacheFactory: $CacheFactoryProvider,
$controller: $ControllerProvider,
$defer: $DeferProvider,
$document: $DocumentProvider,
$exceptionHandler: $ExceptionHandlerProvider,
$filter: $FilterProvider,
$interpolate: $InterpolateProvider,
$http: $HttpProvider,
$httpBackend: $HttpBackendProvider,
$location: $LocationProvider,
$log: $LogProvider,
$parse: $ParseProvider,
$route: $RouteProvider,
$routeParams: $RouteParamsProvider,
$rootScope: $RootScopeProvider,
$q: $QProvider,
$sniffer: $SnifferProvider,
$templateCache: $TemplateCacheProvider,
$window: $WindowProvider
});
}
]);
}
//////////////////////////////////
//JQLite
//////////////////////////////////
/**
* @ngdoc function
* @name angular.element
* @function
*
* @description
* Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
* `angular.element` can be either an alias for [jQuery](http://api.jquery.com/jQuery/) function, if
* jQuery is available, or a function that wraps the element or string in Angular's jQuery lite
* implementation (commonly referred to as jqLite).
*
* Real jQuery always takes precedence over jqLite, provided it was loaded before `DOMContentLoaded`
* event fired.
*
* jqLite is a tiny, API-compatible subset of jQuery that allows
* Angular to manipulate the DOM. jqLite implements only the most commonly needed functionality
* within a very small footprint, so only a subset of the jQuery API - methods, arguments and
* invocation styles - are supported.
*
* Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never
* raw DOM references.
*
* ## Angular's jQuery lite provides the following methods:
*
* - [addClass()](http://api.jquery.com/addClass/)
* - [after()](http://api.jquery.com/after/)
* - [append()](http://api.jquery.com/append/)
* - [attr()](http://api.jquery.com/attr/)
* - [bind()](http://api.jquery.com/bind/)
* - [children()](http://api.jquery.com/children/)
* - [clone()](http://api.jquery.com/clone/)
* - [contents()](http://api.jquery.com/contents/)
* - [css()](http://api.jquery.com/css/)
* - [data()](http://api.jquery.com/data/)
* - [eq()](http://api.jquery.com/eq/)
* - [find()](http://api.jquery.com/find/) - Limited to lookups by tag name.
* - [hasClass()](http://api.jquery.com/hasClass/)
* - [html()](http://api.jquery.com/html/)
* - [next()](http://api.jquery.com/next/)
* - [parent()](http://api.jquery.com/parent/)
* - [prepend()](http://api.jquery.com/prepend/)
* - [prop()](http://api.jquery.com/prop/)
* - [ready()](http://api.jquery.com/ready/)
* - [remove()](http://api.jquery.com/remove/)
* - [removeAttr()](http://api.jquery.com/removeAttr/)
* - [removeClass()](http://api.jquery.com/removeClass/)
* - [removeData()](http://api.jquery.com/removeData/)
* - [replaceWith()](http://api.jquery.com/replaceWith/)
* - [text()](http://api.jquery.com/text/)
* - [toggleClass()](http://api.jquery.com/toggleClass/)
* - [unbind()](http://api.jquery.com/unbind/)
* - [val()](http://api.jquery.com/val/)
* - [wrap()](http://api.jquery.com/wrap/)
*
* ## In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite:
*
* - `controller(name)` - retrieves the controller of the current element or its parent. By default
* retrieves controller associated with the `ngController` directive. If `name` is provided as
* camelCase directive name, then the controller for this directive will be retrieved (e.g.
* `'ngModel'`).
* - `injector()` - retrieves the injector of the current element or its parent.
* - `scope()` - retrieves the {@link api/angular.module.ng.$rootScope.Scope scope} of the current
* element or its parent.
* - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
* parent element is reached.
*
* @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
* @returns {Object} jQuery object.
*/
var jqCache = JQLite.cache = {},
jqName = JQLite.expando = 'ng-' + new Date().getTime(),
jqId = 1,
addEventListenerFn = (window.document.addEventListener
? function(element, type, fn) {element.addEventListener(type, fn, false);}
: function(element, type, fn) {element.attachEvent('on' + type, fn);}),
removeEventListenerFn = (window.document.removeEventListener
? function(element, type, fn) {element.removeEventListener(type, fn, false); }
: function(element, type, fn) {element.detachEvent('on' + type, fn); });
function jqNextId() { return ++jqId; }
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
/**
* Converts snake_case to camelCase.
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function camelCase(name) {
return name.
replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
}).
replace(MOZ_HACK_REGEXP, 'Moz$1');
}
/////////////////////////////////////////////
// jQuery mutation patch
//
// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a
// $destroy event on all DOM nodes being removed.
//
/////////////////////////////////////////////
function JQLitePatchJQueryRemove(name, dispatchThis) {
var originalJqFn = jQuery.fn[name];
originalJqFn = originalJqFn.$original || originalJqFn;
removePatch.$original = originalJqFn;
jQuery.fn[name] = removePatch;
function removePatch() {
var list = [this],
fireEvent = dispatchThis,
set, setIndex, setLength,
element, childIndex, childLength, children,
fns, events;
while(list.length) {
set = list.shift();
for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {
element = jqLite(set[setIndex]);
if (fireEvent) {
events = element.data('events');
if ( (fns = events && events.$destroy) ) {
forEach(fns, function(fn){
fn.handler();
});
}
} else {
fireEvent = !fireEvent;
}
for(childIndex = 0, childLength = (children = element.children()).length;
childIndex < childLength;
childIndex++) {
list.push(jQuery(children[childIndex]));
}
}
}
return originalJqFn.apply(this, arguments);
}
}
/////////////////////////////////////////////
function JQLite(element) {
if (element instanceof JQLite) {
return element;
}
if (!(this instanceof JQLite)) {
if (isString(element) && element.charAt(0) != '<') {
throw Error('selectors not implemented');
}
return new JQLite(element);
}
if (isString(element)) {
var div = document.createElement('div');
// Read about the NoScope elements here:
// http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work!
div.removeChild(div.firstChild); // remove the superfluous div
JQLiteAddNodes(this, div.childNodes);
this.remove(); // detach the elements from the temporary DOM div.
} else {
JQLiteAddNodes(this, element);
}
}
function JQLiteClone(element) {
return element.cloneNode(true);
}
function JQLiteDealoc(element){
JQLiteRemoveData(element);
for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
JQLiteDealoc(children[i]);
}
}
function JQLiteUnbind(element, type, fn) {
var events = JQLiteData(element, 'events'),
handle = JQLiteData(element, 'handle');
if (!handle) return; //no listeners registered
if (isUndefined(type)) {
forEach(events, function(eventHandler, type) {
removeEventListenerFn(element, type, eventHandler);
delete events[type];
});
} else {
if (isUndefined(fn)) {
removeEventListenerFn(element, type, events[type]);
delete events[type];
} else {
arrayRemove(events[type], fn);
}
}
}
function JQLiteRemoveData(element) {
var cacheId = element[jqName],
cache = jqCache[cacheId];
if (cache) {
if (cache.handle) {
cache.events.$destroy && cache.handle({}, '$destroy');
JQLiteUnbind(element);
}
delete jqCache[cacheId];
element[jqName] = undefined; // ie does not allow deletion of attributes on elements.
}
}
function JQLiteData(element, key, value) {
var cacheId = element[jqName],
cache = jqCache[cacheId || -1];
if (isDefined(value)) {
if (!cache) {
element[jqName] = cacheId = jqNextId();
cache = jqCache[cacheId] = {};
}
cache[key] = value;
} else {
if (isDefined(key)) {
if (isObject(key)) {
if (!cacheId) element[jqName] = cacheId = jqNextId();
jqCache[cacheId] = cache = (jqCache[cacheId] || {});
extend(cache, key);
} else {
return cache ? cache[key] : undefined;
}
} else {
if (!cacheId) element[jqName] = cacheId = jqNextId();
return cache
? cache
: cache = jqCache[cacheId] = {};
}
}
}
function JQLiteHasClass(element, selector) {
return ((" " + element.className + " ").replace(/[\n\t]/g, " ").
indexOf( " " + selector + " " ) > -1);
}
function JQLiteRemoveClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
element.className = trim(
(" " + element.className + " ")
.replace(/[\n\t]/g, " ")
.replace(" " + trim(cssClass) + " ", " ")
);
});
}
}
function JQLiteAddClass(element, selector) {
if (selector) {
forEach(selector.split(' '), function(cssClass) {
if (!JQLiteHasClass(element, cssClass)) {
element.className = trim(element.className + ' ' + trim(cssClass));
}
});
}
}
function JQLiteAddNodes(root, elements) {
if (elements) {
elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))
? elements
: [ elements ];
for(var i=0; i < elements.length; i++) {
root.push(elements[i]);
}
}
}
function JQLiteController(element, name) {
return JQLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller');
}
function JQLiteInheritedData(element, name, value) {
element = jqLite(element);
// if element is the document object work with the html element instead
// this makes $(document).scope() possible
if(element[0].nodeType == 9) {
element = element.find('html');
}
while (element.length) {
if (value = element.data(name)) return value;
element = element.parent();
}
}
//////////////////////////////////////////
// Functions which are declared directly.
//////////////////////////////////////////
var JQLitePrototype = JQLite.prototype = {
ready: function(fn) {
var fired = false;
function trigger() {
if (fired) return;
fired = true;
fn();
}
this.bind('DOMContentLoaded', trigger); // works for modern browsers and IE9
// we can not use jqLite since we are not done loading and jQuery could be loaded later.
JQLite(window).bind('load', trigger); // fallback to window.onload for others
},
toString: function() {
var value = [];
forEach(this, function(e){ value.push('' + e);});
return '[' + value.join(', ') + ']';
},
eq: function(index) {
return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
},
length: 0,
push: push,
sort: [].sort,
splice: [].splice
};
//////////////////////////////////////////
// Functions iterating getter/setters.
// these functions return self on setter and
// value on get.
//////////////////////////////////////////
var BOOLEAN_ATTR = {};
forEach('multiple,selected,checked,disabled,readOnly,required'.split(','), function(value) {
BOOLEAN_ATTR[lowercase(value)] = value;
});
var BOOLEAN_ELEMENTS = {};
forEach('input,select,option,textarea,button,form'.split(','), function(value) {
BOOLEAN_ELEMENTS[uppercase(value)] = true;
});
function isBooleanAttr(element, name) {
return BOOLEAN_ELEMENTS[element.nodeName] && BOOLEAN_ATTR[name.toLowerCase()];
}
forEach({
data: JQLiteData,
inheritedData: JQLiteInheritedData,
scope: function(element) {
return JQLiteInheritedData(element, '$scope');
},
controller: JQLiteController ,
injector: function(element) {
return JQLiteInheritedData(element, '$injector');
},
removeAttr: function(element,name) {
element.removeAttribute(name);
},
hasClass: JQLiteHasClass,
css: function(element, name, value) {
name = camelCase(name);
if (isDefined(value)) {
element.style[name] = value;
} else {
var val;
if (msie <= 8) {
// this is some IE specific weirdness that jQuery 1.6.4 does not sure why
val = element.currentStyle && element.currentStyle[name];
if (val === '') val = 'auto';
}
val = val || element.style[name];
if (msie <= 8) {
// jquery weirdness :-/
val = (val === '') ? undefined : val;
}
return val;
}
},
attr: function(element, name, value){
var lowercasedName = lowercase(name);
if (BOOLEAN_ATTR[lowercasedName]) {
if (isDefined(value)) {
if (!!value) {
element[name] = true;
element.setAttribute(name, lowercasedName);
} else {
element[name] = false;
element.removeAttribute(lowercasedName);
}
} else {
return (element[name] ||
(element.attributes.getNamedItem(name)|| noop).specified)
? lowercasedName
: undefined;
}
} else if (isDefined(value)) {
element.setAttribute(name, value);
} else if (element.getAttribute) {
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
var ret = element.getAttribute(name, 2);
// normalize non-existing attributes to undefined (as jQuery)
return ret === null ? undefined : ret;
}
},
prop: function(element, name, value) {
if (isDefined(value)) {
element[name] = value;
} else {
return element[name];
}
},
text: extend((msie < 9)
? function(element, value) {
if (element.nodeType == 1 /** Element */) {
if (isUndefined(value))
return element.innerText;
element.innerText = value;
} else {
if (isUndefined(value))
return element.nodeValue;
element.nodeValue = value;
}
}
: function(element, value) {
if (isUndefined(value)) {
return element.textContent;
}
element.textContent = value;
}, {$dv:''}),
val: function(element, value) {
if (isUndefined(value)) {
return element.value;
}
element.value = value;
},
html: function(element, value) {
if (isUndefined(value)) {
return element.innerHTML;
}
for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
JQLiteDealoc(childNodes[i]);
}
element.innerHTML = value;
}
}, function(fn, name){
/**
* Properties: writes return selection, reads return first value
*/
JQLite.prototype[name] = function(arg1, arg2) {
var i, key;
// JQLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
// in a way that survives minification.
if (((fn.length == 2 && (fn !== JQLiteHasClass && fn !== JQLiteController)) ? arg1 : arg2) === undefined) {
if (isObject(arg1)) {
// we are a write, but the object properties are the key/values
for(i=0; i < this.length; i++) {
if (fn === JQLiteData) {
// data() takes the whole object in jQuery
fn(this[i], arg1);
} else {
for (key in arg1) {
fn(this[i], key, arg1[key]);
}
}
}
// return self for chaining
return this;
} else {
// we are a read, so read the first child.
if (this.length)
return fn(this[0], arg1, arg2);
}
} else {
// we are a write, so apply to all children
for(i=0; i < this.length; i++) {
fn(this[i], arg1, arg2);
}
// return self for chaining
return this;
}
return fn.$dv;
};
});
function createEventHandler(element, events) {
var eventHandler = function (event, type) {
if (!event.preventDefault) {
event.preventDefault = function() {
event.returnValue = false; //ie
};
}
if (!event.stopPropagation) {
event.stopPropagation = function() {
event.cancelBubble = true; //ie
};
}
if (!event.target) {
event.target = event.srcElement || document;
}
if (isUndefined(event.defaultPrevented)) {
var prevent = event.preventDefault;
event.preventDefault = function() {
event.defaultPrevented = true;
prevent.call(event);
};
event.defaultPrevented = false;
}
event.isDefaultPrevented = function() {
return event.defaultPrevented;
};
forEach(events[type || event.type], function(fn) {
try {
fn.call(element, event);
} catch (e) {
// Not much to do here since jQuery ignores these anyway
}
});
// Remove monkey-patched methods (IE),
// as they would cause memory leaks in IE8.
if (msie <= 8) {
// IE7/8 does not allow to delete property on native object
event.preventDefault = null;
event.stopPropagation = null;
event.isDefaultPrevented = null;
} else {
// It shouldn't affect normal browsers (native methods are defined on prototype).
delete event.preventDefault;
delete event.stopPropagation;
delete event.isDefaultPrevented;
}
};
eventHandler.elem = element;
return eventHandler;
}
//////////////////////////////////////////
// Functions iterating traversal.
// These functions chain results into a single
// selector.
//////////////////////////////////////////
forEach({
removeData: JQLiteRemoveData,
dealoc: JQLiteDealoc,
bind: function bindFn(element, type, fn){
var events = JQLiteData(element, 'events'),
handle = JQLiteData(element, 'handle');
if (!events) JQLiteData(element, 'events', events = {});
if (!handle) JQLiteData(element, 'handle', handle = createEventHandler(element, events));
forEach(type.split(' '), function(type){
var eventFns = events[type];
if (!eventFns) {
if (type == 'mouseenter' || type == 'mouseleave') {
var counter = 0;
events.mouseenter = [];
events.mouseleave = [];
bindFn(element, 'mouseover', function(event) {
counter++;
if (counter == 1) {
handle(event, 'mouseenter');
}
});
bindFn(element, 'mouseout', function(event) {
counter --;
if (counter == 0) {
handle(event, 'mouseleave');
}
});
} else {
addEventListenerFn(element, type, handle);
events[type] = [];
}
eventFns = events[type]
}
eventFns.push(fn);
});
},
unbind: JQLiteUnbind,
replaceWith: function(element, replaceNode) {
var index, parent = element.parentNode;
JQLiteDealoc(element);
forEach(new JQLite(replaceNode), function(node){
if (index) {
parent.insertBefore(node, index.nextSibling);
} else {
parent.replaceChild(node, element);
}
index = node;
});
},
children: function(element) {
var children = [];
forEach(element.childNodes, function(element){
if (element.nodeName != '#text')
children.push(element);
});
return children;
},
contents: function(element) {
return element.childNodes;
},
append: function(element, node) {
forEach(new JQLite(node), function(child){
if (element.nodeType === 1)
element.appendChild(child);
});
},
prepend: function(element, node) {
if (element.nodeType === 1) {
var index = element.firstChild;
forEach(new JQLite(node), function(child){
if (index) {
element.insertBefore(child, index);
} else {
element.appendChild(child);
index = child;
}
});
}
},
wrap: function(element, wrapNode) {
wrapNode = jqLite(wrapNode)[0];
var parent = element.parentNode;
if (parent) {
parent.replaceChild(wrapNode, element);
}
wrapNode.appendChild(element);
},
remove: function(element) {
JQLiteDealoc(element);
var parent = element.parentNode;
if (parent) parent.removeChild(element);
},
after: function(element, newElement) {
var index = element, parent = element.parentNode;
forEach(new JQLite(newElement), function(node){
parent.insertBefore(node, index.nextSibling);
index = node;
});
},
addClass: JQLiteAddClass,
removeClass: JQLiteRemoveClass,
toggleClass: function(element, selector, condition) {
if (isUndefined(condition)) {
condition = !JQLiteHasClass(element, selector);
}
(condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector);
},
parent: function(element) {
var parent = element.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
next: function(element) {
return element.nextSibling;
},
find: function(element, selector) {
return element.getElementsByTagName(selector);
},
clone: JQLiteClone
}, function(fn, name){
/**
* chaining functions
*/
JQLite.prototype[name] = function(arg1, arg2) {
var value;
for(var i=0; i < this.length; i++) {
if (value == undefined) {
value = fn(this[i], arg1, arg2);
if (value !== undefined) {
// any function which returns a value needs to be wrapped
value = jqLite(value);
}
} else {
JQLiteAddNodes(value, fn(this[i], arg1, arg2));
}
}
return value == undefined ? this : value;
};
});
/**
* Computes a hash of an 'obj'.
* Hash of a:
* string is string
* number is number as string
* object is either result of calling $$hashKey function on the object or uniquely generated id,
* that is also assigned to the $$hashKey property of the object.
*
* @param obj
* @returns {string} hash string such that the same input will have the same hash string.
* The resulting string key is in 'type:hashKey' format.
*/
function hashKey(obj) {
var objType = typeof obj,
key;
if (objType == 'object' && obj !== null) {
if (typeof (key = obj.$$hashKey) == 'function') {
// must invoke on object to keep the right this
key = obj.$$hashKey();
} else if (key === undefined) {
key = obj.$$hashKey = nextUid();
}
} else {
key = obj;
}
return objType + ':' + key;
}
/**
* HashMap which can use objects as keys
*/
function HashMap(array){
forEach(array, this.put, this);
}
HashMap.prototype = {
/**
* Store key value pair
* @param key key to store can be any type
* @param value value to store can be any type
*/
put: function(key, value) {
this[hashKey(key)] = value;
},
/**
* @param key
* @returns the value for the key
*/
get: function(key) {
return this[hashKey(key)];
},
/**
* Remove the key/value pair
* @param key
*/
remove: function(key) {
var value = this[key = hashKey(key)];
delete this[key];
return value;
}
};
/**
* A map where multiple values can be added to the same key such that they form a queue.
* @returns {HashQueueMap}
*/
function HashQueueMap() {}
HashQueueMap.prototype = {
/**
* Same as array push, but using an array as the value for the hash
*/
push: function(key, value) {
var array = this[key = hashKey(key)];
if (!array) {
this[key] = [value];
} else {
array.push(value);
}
},
/**
* Same as array shift, but using an array as the value for the hash
*/
shift: function(key) {
var array = this[key = hashKey(key)];
if (array) {
if (array.length == 1) {
delete this[key];
return array[0];
} else {
return array.shift();
}
}
}
};
/**
* @ngdoc function
* @name angular.injector
* @function
*
* @description
* Creates an injector function that can be used for retrieving services as well as for
* dependency injection (see {@link guide/dev_guide.di dependency injection}).
*
* @param {Array.<string|Function>} modules A list of module functions or their aliases. See
* {@link angular.module}. The `ng` module must be explicitly added.
* @returns {function()} Injector function. See {@link angular.module.AUTO.$injector $injector}.
*
* @example
* Typical usage
* <pre>
* // create an injector
* var $injector = angular.injector(['ng']);
*
* // use the injector to kick of your application
* // use the type inference to auto inject arguments, or use implicit injection
* $injector.invoke(function($rootScope, $compile, $document){
* $compile($document)($rootScope);
* $rootScope.$digest();
* });
* </pre>
*/
/**
* @ngdoc overview
* @name angular.module.AUTO
* @description
*
* Implicit module which gets automatically added to each {@link angular.module.AUTO.$injector $injector}.
*/
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(.+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
function inferInjectionArgs(fn) {
assertArgFn(fn);
if (!fn.$inject) {
var args = fn.$inject = [];
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
arg.replace(FN_ARG, function(all, underscore, name){
args.push(name);
});
});
}
return fn.$inject;
}
///////////////////////////////////////
/**
* @ngdoc object
* @name angular.module.AUTO.$injector
* @function
*
* @description
*
* `$injector` is used to retrieve object instances as defined by
* {@link angular.module.AUTO.$provide provider}, instantiate types, invoke methods,
* and load modules.
*
* The following always holds true:
*
* <pre>
* var $injector = angular.injector();
* expect($injector.get('$injector')).toBe($injector);
* expect($injector.invoke(function($injector){
* return $injector;
* }).toBe($injector);
* </pre>
*
* # Injection Function Annotation
*
* JavaScript does not have annotations, and annotations are needed for dependency injection. The
* following ways are all valid way of annotating function with injection arguments and are equivalent.
*
* <pre>
* // inferred (only works if code not minified/obfuscated)
* $inject.invoke(function(serviceA){});
*
* // annotated
* function explicit(serviceA) {};
* explicit.$inject = ['serviceA'];
* $inject.invoke(explicit);
*
* // inline
* $inject.invoke(['serviceA', function(serviceA){}]);
* </pre>
*
* ## Inference
*
* In JavaScript calling `toString()` on a function returns the function definition. The definition can then be
* parsed and the function arguments can be extracted. *NOTE:* This does not work with minfication, and obfuscation
* tools since these tools change the argument names.
*
* ## `$inject` Annotation
* By adding a `$inject` property onto a function the injection parameters can be specified.
*
* ## Inline
* As an array of injection names, where the last item in the array is the function to call.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#get
* @methodOf angular.module.AUTO.$injector
*
* @description
* Return an instance of the service.
*
* @param {string} name The name of the instance to retrieve.
* @return {*} The instance.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#invoke
* @methodOf angular.module.AUTO.$injector
*
* @description
* Invoke the method and supply the method arguments from the `$injector`.
*
* @param {!function} fn The function to invoke. The function arguments come form the function annotation.
* @param {Object=} self The `this` for the invoked method.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return the value returned by the invoked `fn` function.
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$injector#instantiate
* @methodOf angular.module.AUTO.$injector
* @description
* Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies
* all of the arguments to the constructor function as specified by the constructor annotation.
*
* @param {function} Type Annotated constructor function.
* @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before
* the `$injector` is consulted.
* @return new instance of `Type`.
*/
/**
* @ngdoc object
* @name angular.module.AUTO.$provide
*
* @description
*
* Use `$provide` to register new providers with the `$injector`. The providers are the factories for the instance.
* The providers share the same name as the instance they create with the `Provider` suffixed to them.
*
* A provider is an object with a `$get()` method. The injector calls the `$get` method to create a new instance of
* a service. The Provider can have additional methods which would allow for configuration of the provider.
*
* <pre>
* function GreetProvider() {
* var salutation = 'Hello';
*
* this.salutation = function(text) {
* salutation = text;
* };
*
* this.$get = function() {
* return function (name) {
* return salutation + ' ' + name + '!';
* };
* };
* }
*
* describe('Greeter', function(){
*
* beforeEach(module(function($provide) {
* $provide.provider('greet', GreetProvider);
* });
*
* it('should greet', inject(function(greet) {
* expect(greet('angular')).toEqual('Hello angular!');
* }));
*
* it('should allow configuration of salutation', function() {
* module(function(greetProvider) {
* greetProvider.salutation('Ahoj');
* });
* inject(function(greet) {
* expect(greet('angular')).toEqual('Ahoj angular!');
* });
* )};
*
* });
* </pre>
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#provider
* @methodOf angular.module.AUTO.$provide
* @description
*
* Register a provider for a service. The providers can be retrieved and can have additional configuration methods.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provider'` key.
* @param {(Object|function())} provider If the provider is:
*
* - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
* {@link angular.module.AUTO.$injector#invoke $injector.invoke()} when an instance needs to be created.
* - `Constructor`: a new instance of the provider will be created using
* {@link angular.module.AUTO.$injector#instantiate $injector.instantiate()}, then treated as `object`.
*
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#factory
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if only `$get` method is required.
*
* @param {string} name The name of the instance.
* @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand for
* `$provide.provider(name, {$get: $getFn})`.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#service
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for registering service of given class.
*
* @param {string} name The name of the instance.
* @param {Function} constructor A class (constructor function) that will be instantiated.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#value
* @methodOf angular.module.AUTO.$provide
* @description
*
* A short hand for configuring services if the `$get` method is a constant.
*
* @param {string} name The name of the instance.
* @param {*} value The value.
* @returns {Object} registered provider instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#constant
* @methodOf angular.module.AUTO.$provide
* @description
*
* A constant value, but unlike {@link angular.module.AUTO.$provide#value value} it can be injected
* into configuration function (other modules) and it is not interceptable by
* {@link angular.module.AUTO.$provide#decorator decorator}.
*
* @param {string} name The name of the constant.
* @param {*} value The constant value.
* @returns {Object} registered instance
*/
/**
* @ngdoc method
* @name angular.module.AUTO.$provide#decorator
* @methodOf angular.module.AUTO.$provide
* @description
*
* Decoration of service, allows the decorator to intercept the service instance creation. The
* returned instance may be the original instance, or a new instance which delegates to the
* original instance.
*
* @param {string} name The name of the service to decorate.
* @param {function()} decorator This function will be invoked when the service needs to be
* instanciated. The function is called using the {@link angular.module.AUTO.$injector#invoke
* injector.invoke} method and is therefore fully injectable. Local injection arguments:
*
* * `$delegate` - The original service instance, which can be monkey patched, configured,
* decorated or delegated to.
*/
function createInjector(modulesToLoad) {
var INSTANTIATING = {},
providerSuffix = 'Provider',
path = [],
loadedModules = new HashMap(),
providerCache = {
$provide: {
provider: supportObject(provider),
factory: supportObject(factory),
service: supportObject(service),
value: supportObject(value),
constant: supportObject(constant),
decorator: decorator
}
},
providerInjector = createInternalInjector(providerCache, function() {
throw Error("Unknown provider: " + path.join(' <- '));
}),
instanceCache = {},
instanceInjector = (instanceCache.$injector =
createInternalInjector(instanceCache, function(servicename) {
var provider = providerInjector.get(servicename + providerSuffix);
return instanceInjector.invoke(provider.$get, provider);
}));
forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });
return instanceInjector;
////////////////////////////////////
// $provider
////////////////////////////////////
function supportObject(delegate) {
return function(key, value) {
if (isObject(key)) {
forEach(key, reverseParams(delegate));
} else {
return delegate(key, value);
}
}
}
function provider(name, provider_) {
if (isFunction(provider_)) {
provider_ = providerInjector.instantiate(provider_);
}
if (!provider_.$get) {
throw Error('Provider ' + name + ' must define $get factory method.');
}
return providerCache[name + providerSuffix] = provider_;
}
function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); }
function service(name, constructor) {
return factory(name, ['$injector', function($injector) {
return $injector.instantiate(constructor);
}]);
}
function value(name, value) { return factory(name, valueFn(value)); }
function constant(name, value) {
providerCache[name] = value;
instanceCache[name] = value;
}
function decorator(serviceName, decorFn) {
var origProvider = providerInjector.get(serviceName + providerSuffix),
orig$get = origProvider.$get;
origProvider.$get = function() {
var origInstance = instanceInjector.invoke(orig$get, origProvider);
return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
};
}
////////////////////////////////////
// Module Loading
////////////////////////////////////
function loadModules(modulesToLoad){
var runBlocks = [];
forEach(modulesToLoad, function(module) {
if (loadedModules.get(module)) return;
loadedModules.put(module, true);
if (isString(module)) {
var moduleFn = angularModule(module);
runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
try {
for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {
var invokeArgs = invokeQueue[i],
provider = invokeArgs[0] == '$injector'
? providerInjector
: providerInjector.get(invokeArgs[0]);
provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
}
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isFunction(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + module;
throw e;
}
} else if (isArray(module)) {
try {
runBlocks.push(providerInjector.invoke(module));
} catch (e) {
if (e.message) e.message += ' from ' + String(module[module.length - 1]);
throw e;
}
} else {
assertArgFn(module, 'module');
}
});
return runBlocks;
}
////////////////////////////////////
// internal Injector
////////////////////////////////////
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (typeof serviceName !== 'string') {
throw Error('Service name expected');
}
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) {
throw Error('Circular dependency: ' + path.join(' <- '));
}
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
cache[serviceName] = INSTANTIATING;
return cache[serviceName] = factory(serviceName);
} finally {
path.shift();
}
}
}
function invoke(fn, self, locals){
var args = [],
$inject,
length,
key;
if (typeof fn == 'function') {
$inject = inferInjectionArgs(fn);
length = $inject.length;
} else {
if (isArray(fn)) {
$inject = fn;
length = $inject.length - 1;
fn = $inject[length];
}
assertArgFn(fn, 'fn');
}
for(var i = 0; i < length; i++) {
key = $inject[i];
args.push(
locals && locals.hasOwnProperty(key)
? locals[key]
: getService(key, path)
);
}
// Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
switch (self ? -1 : args.length) {
case 0: return fn();
case 1: return fn(args[0]);
case 2: return fn(args[0], args[1]);
case 3: return fn(args[0], args[1], args[2]);
case 4: return fn(args[0], args[1], args[2], args[3]);
case 5: return fn(args[0], args[1], args[2], args[3], args[4]);
case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
case 8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
case 9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
default: return fn.apply(self, args);
}
}
function instantiate(Type, locals) {
var Constructor = function() {},
instance, returnedValue;
Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;
instance = new Constructor();
returnedValue = invoke(Type, instance, locals);
return isObject(returnedValue) ? returnedValue : instance;
}
return {
invoke: invoke,
instantiate: instantiate,
get: getService
};
}
}
/**
* @ngdoc function
* @name angular.module.ng.$anchorScroll
* @requires $window
* @requires $location
* @requires $rootScope
*
* @description
* When called, it checks current value of `$location.hash()` and scroll to related element,
* according to rules specified in
* {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}.
*
* It also watches the `$location.hash()` and scroll whenever it changes to match any anchor.
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
*/
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
this.disableAutoScrolling = function() {
autoScrollingEnabled = false;
};
this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
var document = $window.document;
// helper function to get first anchor from a NodeList
// can't use filter.filter, as it accepts only instances of Array
// and IE can't convert NodeList to an array using [].slice
// TODO(vojta): use filter if we change it to accept lists as well
function getFirstAnchor(list) {
var result = null;
forEach(list, function(element) {
if (!result && lowercase(element.nodeName) === 'a') result = element;
});
return result;
}
function scroll() {
var hash = $location.hash(), elm;
// empty hash, scroll to the top of the page
if (!hash) $window.scrollTo(0, 0);
// element with given id
else if ((elm = document.getElementById(hash))) elm.scrollIntoView();
// first anchor with given name :-D
else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();
// no element and hash == 'top', scroll to the top of the page
else if (hash === 'top') $window.scrollTo(0, 0);
}
// does not scroll when user clicks on anchor link that is currently on
// (no url change, no $locaiton.hash() change), browser native does scroll
if (autoScrollingEnabled) {
$rootScope.$watch(function() {return $location.hash();}, function() {
$rootScope.$evalAsync(scroll);
});
}
return scroll;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$browser
* @requires $log
* @description
* This object has two goals:
*
* - hide all the global state in the browser caused by the window object
* - abstract away all the browser specific features and inconsistencies
*
* For tests we provide {@link angular.module.ngMock.$browser mock implementation} of the `$browser`
* service, which can be used for convenient testing of the application without the interaction with
* the real browser apis.
*/
/**
* @param {object} window The global window object.
* @param {object} document jQuery wrapped document.
* @param {function()} XHR XMLHttpRequest constructor.
* @param {object} $log console.log or an object with the same interface.
* @param {object} $sniffer $sniffer service
*/
function Browser(window, document, $log, $sniffer) {
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
self.isMock = false;
var outstandingRequestCount = 0;
var outstandingRequestCallbacks = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = completeOutstandingRequest;
self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
/**
* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
* counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
*/
function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while(outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
} catch (e) {
$log.error(e);
}
}
}
}
}
/**
* @private
* Note: this method is used only by scenario runner
* TODO(vojta): prefix this method with $$ ?
* @param {function()} callback Function that will be called when no outstanding request
*/
self.notifyWhenNoOutstandingRequests = function(callback) {
// force browser to execute all pollFns - this is needed so that cookies and other pollers fire
// at some deterministic time in respect to the test runner's actions. Leaving things up to the
// regular poller would result in flaky tests.
forEach(pollFns, function(pollFn){ pollFn(); });
if (outstandingRequestCount === 0) {
callback();
} else {
outstandingRequestCallbacks.push(callback);
}
};
//////////////////////////////////////////////////////////////
// Poll Watcher API
//////////////////////////////////////////////////////////////
var pollFns = [],
pollTimeout;
/**
* @ngdoc method
* @name angular.module.ng.$browser#addPollFn
* @methodOf angular.module.ng.$browser
*
* @param {function()} fn Poll function to add
*
* @description
* Adds a function to the list of functions that poller periodically executes,
* and starts polling if not started yet.
*
* @returns {function()} the added function
*/
self.addPollFn = function(fn) {
if (isUndefined(pollTimeout)) startPoller(100, setTimeout);
pollFns.push(fn);
return fn;
};
/**
* @param {number} interval How often should browser call poll functions (ms)
* @param {function()} setTimeout Reference to a real or fake `setTimeout` function.
*
* @description
* Configures the poller to run in the specified intervals, using the specified
* setTimeout fn and kicks it off.
*/
function startPoller(interval, setTimeout) {
(function check() {
forEach(pollFns, function(pollFn){ pollFn(); });
pollTimeout = setTimeout(check, interval);
})();
}
//////////////////////////////////////////////////////////////
// URL API
//////////////////////////////////////////////////////////////
var lastBrowserUrl = location.href,
baseElement = document.find('base');
/**
* @ngdoc method
* @name angular.module.ng.$browser#url
* @methodOf angular.module.ng.$browser
*
* @description
* GETTER:
* Without any argument, this method just returns current value of location.href.
*
* SETTER:
* With at least one argument, this method sets url to new value.
* If html5 history api supported, pushState/replaceState is used, otherwise
* location.href/location.replace is used.
* Returns its own instance to allow chaining
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to change url.
*
* @param {string} url New url (when used as setter)
* @param {boolean=} replace Should new url replace current history record ?
*/
self.url = function(url, replace) {
// setter
if (url) {
lastBrowserUrl = url;
if ($sniffer.history) {
if (replace) history.replaceState(null, '', url);
else {
history.pushState(null, '', url);
// Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462
baseElement.attr('href', baseElement.attr('href'));
}
} else {
if (replace) location.replace(url);
else location.href = url;
}
return self;
// getter
} else {
// the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
return location.href.replace(/%27/g,"'");
}
};
var urlChangeListeners = [],
urlChangeInit = false;
function fireUrlChange() {
if (lastBrowserUrl == self.url()) return;
lastBrowserUrl = self.url();
forEach(urlChangeListeners, function(listener) {
listener(self.url());
});
}
/**
* @ngdoc method
* @name angular.module.ng.$browser#onUrlChange
* @methodOf angular.module.ng.$browser
* @TODO(vojta): refactor to use node's syntax for events
*
* @description
* Register callback function that will be called, when url changes.
*
* It's only called when the url is changed by outside of angular:
* - user types different url into address bar
* - user clicks on history (forward/back) button
* - user clicks on a link
*
* It's not called when url is changed by $browser.url() method
*
* The listener gets called with new url as parameter.
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link angular.module.ng.$location $location service} to monitor url changes in angular apps.
*
* @param {function(string)} listener Listener function to be called when url changes.
* @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
*/
self.onUrlChange = function(callback) {
if (!urlChangeInit) {
// We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
// don't fire popstate when user change the address bar and don't fire hashchange when url
// changed by push/replaceState
// html5 history api - popstate event
if ($sniffer.history) jqLite(window).bind('popstate', fireUrlChange);
// hashchange event
if ($sniffer.hashchange) jqLite(window).bind('hashchange', fireUrlChange);
// polling
else self.addPollFn(fireUrlChange);
urlChangeInit = true;
}
urlChangeListeners.push(callback);
return callback;
};
//////////////////////////////////////////////////////////////
// Misc API
//////////////////////////////////////////////////////////////
/**
* Returns current <base href>
* (always relative - without domain)
*
* @returns {string=}
*/
self.baseHref = function() {
var href = baseElement.attr('href');
return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : href;
};
//////////////////////////////////////////////////////////////
// Cookies API
//////////////////////////////////////////////////////////////
var lastCookies = {};
var lastCookieString = '';
var cookiePath = self.baseHref();
/**
* @ngdoc method
* @name angular.module.ng.$browser#cookies
* @methodOf angular.module.ng.$browser
*
* @param {string=} name Cookie name
* @param {string=} value Cokkie value
*
* @description
* The cookies method provides a 'private' low level access to browser cookies.
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
* <ul>
* <li>cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify it</li>
* <li>cookies(name, value) -> set name to value, if value is undefined delete the cookie</li>
* <li>cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)</li>
* </ul>
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, index;
if (name) {
if (value === undefined) {
rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT";
} else {
if (isString(value)) {
cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) + ';path=' + cookiePath).length + 1;
if (cookieLength > 4096) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because it was too large ("+
cookieLength + " > 4096 bytes)!");
}
if (lastCookies.length > 20) {
$log.warn("Cookie '"+ name +"' possibly not set or overflowed because too many cookies " +
"were already set (" + lastCookies.length + " > 20 )");
}
}
}
} else {
if (rawDocument.cookie !== lastCookieString) {
lastCookieString = rawDocument.cookie;
cookieArray = lastCookieString.split("; ");
lastCookies = {};
for (i = 0; i < cookieArray.length; i++) {
cookie = cookieArray[i];
index = cookie.indexOf('=');
if (index > 0) { //ignore nameless cookies
lastCookies[unescape(cookie.substring(0, index))] = unescape(cookie.substring(index + 1));
}
}
}
return lastCookies;
}
};
/**
* @ngdoc method
* @name angular.module.ng.$browser#defer
* @methodOf angular.module.ng.$browser
* @param {function()} fn A function, who's execution should be defered.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
*
* @description
* Executes a fn asynchroniously via `setTimeout(fn, delay)`.
*
* Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
* `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
* via `$browser.defer.flush()`.
*
*/
self.defer = function(fn, delay) {
var timeoutId;
outstandingRequestCount++;
timeoutId = setTimeout(function() {
delete pendingDeferIds[timeoutId];
completeOutstandingRequest(fn);
}, delay || 0);
pendingDeferIds[timeoutId] = true;
return timeoutId;
};
/**
* THIS DOC IS NOT VISIBLE because ngdocs can't process docs for foo#method.method
*
* @name angular.module.ng.$browser#defer.cancel
* @methodOf angular.module.ng.$browser.defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$browser.defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
self.defer.cancel = function(deferId) {
if (pendingDeferIds[deferId]) {
delete pendingDeferIds[deferId];
clearTimeout(deferId);
completeOutstandingRequest(noop);
return true;
}
return false;
};
}
function $BrowserProvider(){
this.$get = ['$window', '$log', '$sniffer', '$document',
function( $window, $log, $sniffer, $document){
return new Browser($window, $document, $log, $sniffer);
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$cacheFactory
*
* @description
* Factory that constructs cache objects.
*
*
* @param {string} cacheId Name or id of the newly created cache.
* @param {object=} options Options object that specifies the cache behavior. Properties:
*
* - `{number=}` `capacity` — turns the cache into LRU cache.
*
* @returns {object} Newly created cache object with the following set of methods:
*
* - `{object}` `info()` — Returns id, size, and options of cache.
* - `{void}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache.
* - `{{*}} `get({string} key) — Returns cached value for `key` or undefined for cache miss.
* - `{void}` `remove({string} key) — Removes a key-value pair from the cache.
* - `{void}` `removeAll() — Removes all cached values.
* - `{void}` `destroy() — Removes references to this cache from $cacheFactory.
*
*/
function $CacheFactoryProvider() {
this.$get = function() {
var caches = {};
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
throw Error('cacheId ' + cacheId + ' taken');
}
var size = 0,
stats = extend({}, options, {id: cacheId}),
data = {},
capacity = (options && options.capacity) || Number.MAX_VALUE,
lruHash = {},
freshEnd = null,
staleEnd = null;
return caches[cacheId] = {
put: function(key, value) {
var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
refresh(lruEntry);
if (isUndefined(value)) return;
if (!(key in data)) size++;
data[key] = value;
if (size > capacity) {
this.remove(staleEnd.key);
}
},
get: function(key) {
var lruEntry = lruHash[key];
if (!lruEntry) return;
refresh(lruEntry);
return data[key];
},
remove: function(key) {
var lruEntry = lruHash[key];
if (lruEntry == freshEnd) freshEnd = lruEntry.p;
if (lruEntry == staleEnd) staleEnd = lruEntry.n;
link(lruEntry.n,lruEntry.p);
delete lruHash[key];
delete data[key];
size--;
},
removeAll: function() {
data = {};
size = 0;
lruHash = {};
freshEnd = staleEnd = null;
},
destroy: function() {
data = null;
stats = null;
lruHash = null;
delete caches[cacheId];
},
info: function() {
return extend({}, stats, {size: size});
}
};
/**
* makes the `entry` the freshEnd of the LRU linked list
*/
function refresh(entry) {
if (entry != freshEnd) {
if (!staleEnd) {
staleEnd = entry;
} else if (staleEnd == entry) {
staleEnd = entry.n;
}
link(entry.n, entry.p);
link(entry, freshEnd);
freshEnd = entry;
freshEnd.n = null;
}
}
/**
* bidirectionally links two entries of the LRU linked list
*/
function link(nextEntry, prevEntry) {
if (nextEntry != prevEntry) {
if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
}
}
}
cacheFactory.info = function() {
var info = {};
forEach(caches, function(cache, cacheId) {
info[cacheId] = cache.info();
});
return info;
};
cacheFactory.get = function(cacheId) {
return caches[cacheId];
};
return cacheFactory;
};
}
/**
* @ngdoc object
* @name angular.module.ng.$templateCache
*
* @description
* Cache used for storing html templates.
*
* See {@link angular.module.ng.$cacheFactory $cacheFactory}.
*
*/
function $TemplateCacheProvider() {
this.$get = ['$cacheFactory', function($cacheFactory) {
return $cacheFactory('templates');
}];
}
/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
*
* DOM-related variables:
*
* - "node" - DOM Node
* - "element" - DOM Element or Node
* - "$node" or "$element" - jqLite-wrapped node or element
*
*
* Compiler related stuff:
*
* - "linkFn" - linking fn of a single directive
* - "nodeLinkFn" - function that aggregates all linking fns for a particular node
* - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node
* - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
*/
/**
* @ngdoc function
* @name angular.module.ng.$compile
* @function
*
* @description
* Compiles a piece of HTML string or DOM into a template and produces a template function, which
* can then be used to link {@link angular.module.ng.$rootScope.Scope scope} and the template together.
*
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
* {@link angular.module.ng.$compileProvider.directive directives}. For each match it
* executes corresponding template function and collects the
* instance functions into a single template function which is then returned.
*
* The template function can then be used once to produce the view or as it is the case with
* {@link angular.module.ng.$compileProvider.directive.ngRepeat repeater} many-times, in which
* case each call results in a view that is a DOM clone of the original template.
*
<doc:example module="compile">
<doc:source>
<script>
// declare a new module, and inject the $compileProvider
angular.module('compile', [], function($compileProvider) {
// configure new 'compile' directive by passing a directive
// factory function. The factory function injects the '$compile'
$compileProvider.directive('compile', function($compile) {
// directive factory creates a link function
return function(scope, element, attrs) {
scope.$watch(
function(scope) {
// watch the 'compile' expression for changes
return scope.$eval(attrs.compile);
},
function(value) {
// when the 'compile' expression changes
// assign it into the current DOM
element.html(value);
// compile the new DOM and link it to the current
// scope.
// NOTE: we only compile .childNodes so that
// we don't get into infinite loop compiling ourselves
$compile(element.contents())(scope);
}
);
};
})
});
function Ctrl($scope) {
$scope.name = 'Angular';
$scope.html = 'Hello {{name}}';
}
</script>
<div ng-controller="Ctrl">
<input ng-model="name"> <br>
<textarea ng-model="html"></textarea> <br>
<div compile="html"></div>
</div>
</doc:source>
<doc:scenario>
it('should auto compile', function() {
expect(element('div[compile]').text()).toBe('Hello Angular');
input('html').enter('{{name}}!');
expect(element('div[compile]').text()).toBe('Angular!');
});
</doc:scenario>
</doc:example>
*
*
* @param {string|DOMElement} element Element or HTML string to compile into a template function.
* @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives.
* @param {number} maxPriority only apply directives lower then given priority (Only effects the
* root element(s), not their children)
* @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template
* (a DOM element/tree) to a scope. Where:
*
* * `scope` - A {@link angular.module.ng.$rootScope.Scope Scope} to bind to.
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
* called as: <br> `cloneAttachFn(clonedElement, scope)` where:
*
* * `clonedElement` - is a clone of the original `element` passed into the compiler.
* * `scope` - is the current scope with which the linking function is working with.
*
* Calling the linking function returns the element of the template. It is either the original element
* passed in, or the clone of the element if the `cloneAttachFn` is provided.
*
* After linking the view is not updated until after a call to $digest which typically is done by
* Angular automatically.
*
* If you need access to the bound view, there are two ways to do it:
*
* - If you are not asking the linking function to clone the template, create the DOM element(s)
* before you send them to the compiler and keep this reference around.
* <pre>
* var element = $compile('<p>{{total}}</p>')(scope);
* </pre>
*
* - if on the other hand, you need the element to be cloned, the view reference from the original
* example would not point to the clone, but rather to the original template that was cloned. In
* this case, you can access the clone via the cloneAttachFn:
* <pre>
* var templateHTML = angular.element('<p>{{total}}</p>'),
* scope = ....;
*
* var clonedElement = $compile(templateHTML)(scope, function(clonedElement, scope) {
* //attach the clone to DOM document at the right place
* });
*
* //now we have reference to the cloned DOM via `clone`
* </pre>
*
*
* For information on how the compiler works, see the
* {@link guide/dev_guide.compiler Angular HTML Compiler} section of the Developer Guide.
*/
/**
* @ngdoc service
* @name angular.module.ng.$compileProvider
* @function
*
* @description
*
*/
$CompileProvider.$inject = ['$provide'];
function $CompileProvider($provide) {
var hasDirectives = {},
Suffix = 'Directive',
COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
MULTI_ROOT_TEMPLATE_ERROR = 'Template must have exactly one root element. was: ';
/**
* @ngdoc function
* @name angular.module.ng.$compileProvider.directive
* @methodOf angular.module.ng.$compileProvider
* @function
*
* @description
* Register directives with the compiler.
*
* @param {string} name Name of the directive in camel-case. (ie <code>ngBind</code> which will match as
* <code>ng-bind</code>).
* @param {function} directiveFactory An injectable directive factroy function. See {@link guide/directive} for more
* info.
*/
this.directive = function registerDirective(name, directiveFactory) {
if (isString(name)) {
assertArg(directiveFactory, 'directive');
if (!hasDirectives.hasOwnProperty(name)) {
hasDirectives[name] = [];
$provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
function($injector, $exceptionHandler) {
var directives = [];
forEach(hasDirectives[name], function(directiveFactory) {
try {
var directive = $injector.invoke(directiveFactory);
if (isFunction(directive)) {
directive = { compile: valueFn(directive) };
} else if (!directive.compile && directive.link) {
directive.compile = valueFn(directive.link);
}
directive.priority = directive.priority || 0;
directive.name = directive.name || name;
directive.require = directive.require || (directive.controller && directive.name);
directive.restrict = directive.restrict || 'A';
directives.push(directive);
} catch (e) {
$exceptionHandler(e);
}
});
return directives;
}]);
}
hasDirectives[name].push(directiveFactory);
} else {
forEach(name, reverseParams(registerDirective));
}
return this;
};
this.$get = [
'$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',
'$controller',
function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
$controller) {
var LOCAL_MODE = {
attribute: function(localName, mode, parentScope, scope, attr) {
scope[localName] = attr[localName];
},
evaluate: function(localName, mode, parentScope, scope, attr) {
scope[localName] = parentScope.$eval(attr[localName]);
},
bind: function(localName, mode, parentScope, scope, attr) {
var getter = $interpolate(attr[localName]);
scope.$watch(
function() { return getter(parentScope); },
function(v) { scope[localName] = v; }
);
},
accessor: function(localName, mode, parentScope, scope, attr) {
var getter = noop,
setter = noop,
exp = attr[localName];
if (exp) {
getter = $parse(exp);
setter = getter.assign || function() {
throw Error("Expression '" + exp + "' not assignable.");
};
}
scope[localName] = function(value) {
return arguments.length ? setter(parentScope, value) : getter(parentScope);
};
},
expression: function(localName, mode, parentScope, scope, attr) {
scope[localName] = function(locals) {
$parse(attr[localName])(parentScope, locals);
};
}
};
var Attributes = function(element, attr) {
this.$$element = element;
this.$$observers = {};
this.$attr = attr || {};
};
Attributes.prototype = {
$normalize: directiveNormalize,
/**
* Set a normalized attribute on the element in a way such that all directives
* can share the attribute. This function properly handles boolean attributes.
* @param {string} key Normalized key. (ie ngAttribute)
* @param {string|boolean} value The value to set. If `null` attribute will be deleted.
* @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
* Defaults to true.
* @param {string=} attrName Optional none normalized name. Defaults to key.
*/
$set: function(key, value, writeAttr, attrName) {
var booleanKey = isBooleanAttr(this.$$element[0], key.toLowerCase());
if (booleanKey) {
this.$$element.prop(key, value);
attrName = booleanKey;
}
this[key] = value;
// translate normalized key to actual key
if (attrName) {
this.$attr[key] = attrName;
} else {
attrName = this.$attr[key];
if (!attrName) {
this.$attr[key] = attrName = snake_case(key, '-');
}
}
if (writeAttr !== false) {
if (value === null || value === undefined) {
this.$$element.removeAttr(attrName);
} else {
this.$$element.attr(attrName, value);
}
}
// fire observers
forEach(this.$$observers[key], function(fn) {
try {
fn(value);
} catch (e) {
$exceptionHandler(e);
}
});
},
/**
* Observe an interpolated attribute.
* The observer will never be called, if given attribute is not interpolated.
*
* @param {string} key Normalized key. (ie ngAttribute) .
* @param {function(*)} fn Function that will be called whenever the attribute value changes.
* @returns {function(*)} the `fn` Function passed in.
*/
$observe: function(key, fn) {
// keep only observers for interpolated attrs
if (this.$$observers[key]) {
this.$$observers[key].push(fn);
}
return fn;
}
};
return compile;
//================================
function compile($compileNode, transcludeFn, maxPriority) {
if (!($compileNode instanceof jqLite)) {
// jquery always rewraps, where as we need to preserve the original selector so that we can modify it.
$compileNode = jqLite($compileNode);
}
// We can not compile top level text elements since text nodes can be merged and we will
// not be able to attach scope data to them, so we will wrap them in <span>
forEach($compileNode, function(node, index){
if (node.nodeType == 3 /* text node */) {
$compileNode[index] = jqLite(node).wrap('<span>').parent()[0];
}
});
var compositeLinkFn = compileNodes($compileNode, transcludeFn, $compileNode, maxPriority);
return function(scope, cloneConnectFn){
assertArg(scope, 'scope');
// important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
// and sometimes changes the structure of the DOM.
var $linkNode = cloneConnectFn
? JQLitePrototype.clone.call($compileNode) // IMPORTANT!!!
: $compileNode;
$linkNode.data('$scope', scope);
safeAddClass($linkNode, 'ng-scope');
if (cloneConnectFn) cloneConnectFn($linkNode, scope);
if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode);
return $linkNode;
};
}
function wrongMode(localName, mode) {
throw Error("Unsupported '" + mode + "' for '" + localName + "'.");
}
function safeAddClass($element, className) {
try {
$element.addClass(className);
} catch(e) {
// ignore, since it means that we are trying to set class on
// SVG element, where class name is read-only.
}
}
/**
* Compile function matches each node in nodeList against the directives. Once all directives
* for a particular node are collected their compile functions are executed. The compile
* functions return values - the linking functions - are combined into a composite linking
* function, which is the a linking function for the node.
*
* @param {NodeList} nodeList an array of nodes to compile
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the
* rootElement must be set the jqLite collection of the compile root. This is
* needed so that the jqLite collection items can be replaced with widgets.
* @param {number=} max directive priority
* @returns {?function} A composite linking function of all of the matched directives or null.
*/
function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority) {
var linkFns = [],
nodeLinkFn, childLinkFn, directives, attrs, linkFnFound;
for(var i = 0; i < nodeList.length; i++) {
attrs = new Attributes();
// we must always refer to nodeList[i] since the nodes can be replaced underneath us.
directives = collectDirectives(nodeList[i], [], attrs, maxPriority);
nodeLinkFn = (directives.length)
? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement)
: null;
childLinkFn = (nodeLinkFn && nodeLinkFn.terminal)
? null
: compileNodes(nodeList[i].childNodes,
nodeLinkFn ? nodeLinkFn.transclude : transcludeFn);
linkFns.push(nodeLinkFn);
linkFns.push(childLinkFn);
linkFnFound = (linkFnFound || nodeLinkFn || childLinkFn);
}
// return a linking function if we have found anything, null otherwise
return linkFnFound ? compositeLinkFn : null;
function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn;
for(var i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
node = nodeList[n];
nodeLinkFn = linkFns[i++];
childLinkFn = linkFns[i++];
if (nodeLinkFn) {
if (nodeLinkFn.scope) {
childScope = scope.$new(isObject(nodeLinkFn.scope));
jqLite(node).data('$scope', childScope);
} else {
childScope = scope;
}
childTranscludeFn = nodeLinkFn.transclude;
if (childTranscludeFn || (!boundTranscludeFn && transcludeFn)) {
nodeLinkFn(childLinkFn, childScope, node, $rootElement,
(function(transcludeFn) {
return function(cloneFn) {
var transcludeScope = scope.$new();
return transcludeFn(transcludeScope, cloneFn).
bind('$destroy', bind(transcludeScope, transcludeScope.$destroy));
};
})(childTranscludeFn || transcludeFn)
);
} else {
nodeLinkFn(childLinkFn, childScope, node, undefined, boundTranscludeFn);
}
} else if (childLinkFn) {
childLinkFn(scope, node.childNodes, undefined, boundTranscludeFn);
}
}
}
}
/**
* Looks for directives on the given node ands them to the directive collection which is sorted.
*
* @param node node to search
* @param directives an array to which the directives are added to. This array is sorted before
* the function returns.
* @param attrs the shared attrs object which is used to populate the normalized attributes.
* @param {number=} max directive priority
*/
function collectDirectives(node, directives, attrs, maxPriority) {
var nodeType = node.nodeType,
attrsMap = attrs.$attr,
match,
className;
switch(nodeType) {
case 1: /* Element */
// use the node name: <directive>
addDirective(directives,
directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority);
// iterate over the attributes
for (var attr, name, nName, value, nAttrs = node.attributes,
j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
attr = nAttrs[j];
if (attr.specified) {
name = attr.name;
nName = directiveNormalize(name.toLowerCase());
attrsMap[nName] = name;
attrs[nName] = value = trim((msie && name == 'href')
? decodeURIComponent(node.getAttribute(name, 2))
: attr.value);
if (isBooleanAttr(node, nName)) {
attrs[nName] = true; // presence means true
}
addAttrInterpolateDirective(node, directives, value, nName);
addDirective(directives, nName, 'A', maxPriority);
}
}
// use class as directive
className = node.className;
if (isString(className)) {
while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
nName = directiveNormalize(match[2]);
if (addDirective(directives, nName, 'C', maxPriority)) {
attrs[nName] = trim(match[3]);
}
className = className.substr(match.index + match[0].length);
}
}
break;
case 3: /* Text Node */
addTextInterpolateDirective(directives, node.nodeValue);
break;
case 8: /* Comment */
try {
match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
if (match) {
nName = directiveNormalize(match[1]);
if (addDirective(directives, nName, 'M', maxPriority)) {
attrs[nName] = trim(match[2]);
}
}
} catch (e) {
// turns out that under some circumstances IE9 throws errors when one attempts to read comment's node value.
// Just ignore it and continue. (Can't seem to reproduce in test case.)
}
break;
}
directives.sort(byPriority);
return directives;
}
/**
* Once the directives have been collected their compile functions is executed. This method
* is responsible for inlining directive templates as well as terminating the application
* of the directives if the terminal directive has been reached..
*
* @param {Array} directives Array of collected directives to execute their compile function.
* this needs to be pre-sorted by priority order.
* @param {Node} compileNode The raw DOM node to apply the compile functions to
* @param {Object} templateAttrs The shared attribute function
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement} $rootElement If we are working on the root of the compile tree then this
* argument has the root jqLite array so that we can replace widgets on it.
* @returns linkFn
*/
function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, $rootElement) {
var terminalPriority = -Number.MAX_VALUE,
preLinkFns = [],
postLinkFns = [],
newScopeDirective = null,
newIsolatedScopeDirective = null,
templateDirective = null,
$compileNode = templateAttrs.$$element = jqLite(compileNode),
directive,
directiveName,
$template,
transcludeDirective,
childTranscludeFn = transcludeFn,
controllerDirectives,
linkFn,
directiveValue;
// executes all directives on the current element
for(var i = 0, ii = directives.length; i < ii; i++) {
directive = directives[i];
$template = undefined;
if (terminalPriority > directive.priority) {
break; // prevent further processing of directives
}
if (directiveValue = directive.scope) {
assertNoDuplicate('isolated scope', newIsolatedScopeDirective, directive, $compileNode);
if (isObject(directiveValue)) {
safeAddClass($compileNode, 'ng-isolate-scope');
newIsolatedScopeDirective = directive;
}
safeAddClass($compileNode, 'ng-scope');
newScopeDirective = newScopeDirective || directive;
}
directiveName = directive.name;
if (directiveValue = directive.controller) {
controllerDirectives = controllerDirectives || {};
assertNoDuplicate("'" + directiveName + "' controller",
controllerDirectives[directiveName], directive, $compileNode);
controllerDirectives[directiveName] = directive;
}
if (directiveValue = directive.transclude) {
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
transcludeDirective = directive;
terminalPriority = directive.priority;
if (directiveValue == 'element') {
$template = jqLite(compileNode);
$compileNode = templateAttrs.$$element =
jqLite('<!-- ' + directiveName + ': ' + templateAttrs[directiveName] + ' -->');
compileNode = $compileNode[0];
replaceWith($rootElement, jqLite($template[0]), compileNode);
childTranscludeFn = compile($template, transcludeFn, terminalPriority);
} else {
$template = jqLite(JQLiteClone(compileNode)).contents();
$compileNode.html(''); // clear contents
childTranscludeFn = compile($template, transcludeFn);
}
}
if (directiveValue = directive.template) {
assertNoDuplicate('template', templateDirective, directive, $compileNode);
templateDirective = directive;
$template = jqLite('<div>' + trim(directiveValue) + '</div>').contents();
compileNode = $template[0];
if (directive.replace) {
if ($template.length != 1 || compileNode.nodeType !== 1) {
throw new Error(MULTI_ROOT_TEMPLATE_ERROR + directiveValue);
}
replaceWith($rootElement, $compileNode, compileNode);
var newTemplateAttrs = {$attr: {}};
// combine directives from the original node and from the template:
// - take the array of directives for this element
// - split it into two parts, those that were already applied and those that weren't
// - collect directives from the template, add them to the second group and sort them
// - append the second group with new directives to the first group
directives = directives.concat(
collectDirectives(
compileNode,
directives.splice(i + 1, directives.length - (i + 1)),
newTemplateAttrs
)
);
mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
ii = directives.length;
} else {
$compileNode.html(directiveValue);
}
}
if (directive.templateUrl) {
assertNoDuplicate('template', templateDirective, directive, $compileNode);
templateDirective = directive;
nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i),
nodeLinkFn, $compileNode, templateAttrs, $rootElement, directive.replace,
childTranscludeFn);
ii = directives.length;
} else if (directive.compile) {
try {
linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
if (isFunction(linkFn)) {
addLinkFns(null, linkFn);
} else if (linkFn) {
addLinkFns(linkFn.pre, linkFn.post);
}
} catch (e) {
$exceptionHandler(e, startingTag($compileNode));
}
}
if (directive.terminal) {
nodeLinkFn.terminal = true;
terminalPriority = Math.max(terminalPriority, directive.priority);
}
}
nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope;
nodeLinkFn.transclude = transcludeDirective && childTranscludeFn;
// might be normal or delayed nodeLinkFn depending on if templateUrl is present
return nodeLinkFn;
////////////////////
function addLinkFns(pre, post) {
if (pre) {
pre.require = directive.require;
preLinkFns.push(pre);
}
if (post) {
post.require = directive.require;
postLinkFns.push(post);
}
}
function getControllers(require, $element) {
var value, retrievalMethod = 'data', optional = false;
if (isString(require)) {
while((value = require.charAt(0)) == '^' || value == '?') {
require = require.substr(1);
if (value == '^') {
retrievalMethod = 'inheritedData';
}
optional = optional || value == '?';
}
value = $element[retrievalMethod]('$' + require + 'Controller');
if (!value && !optional) {
throw Error("No controller: " + require);
}
return value;
} else if (isArray(require)) {
value = [];
forEach(require, function(require) {
value.push(getControllers(require, $element));
});
}
return value;
}
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
var attrs, $element, i, ii, linkFn, controller;
if (compileNode === linkNode) {
attrs = templateAttrs;
} else {
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
}
$element = attrs.$$element;
if (newScopeDirective && isObject(newScopeDirective.scope)) {
forEach(newScopeDirective.scope, function(mode, name) {
(LOCAL_MODE[mode] || wrongMode)(name, mode,
scope.$parent || scope, scope, attrs);
});
}
if (controllerDirectives) {
forEach(controllerDirectives, function(directive) {
var locals = {
$scope: scope,
$element: $element,
$attrs: attrs,
$transclude: boundTranscludeFn
};
forEach(directive.inject || {}, function(mode, name) {
(LOCAL_MODE[mode] || wrongMode)(name, mode,
newScopeDirective ? scope.$parent || scope : scope, locals, attrs);
});
controller = directive.controller;
if (controller == '@') {
controller = attrs[directive.name];
}
$element.data(
'$' + directive.name + 'Controller',
$controller(controller, locals));
});
}
// PRELINKING
for(i = 0, ii = preLinkFns.length; i < ii; i++) {
try {
linkFn = preLinkFns[i];
linkFn(scope, $element, attrs,
linkFn.require && getControllers(linkFn.require, $element));
} catch (e) {
$exceptionHandler(e, startingTag($element));
}
}
// RECURSION
childLinkFn && childLinkFn(scope, linkNode.childNodes, undefined, boundTranscludeFn);
// POSTLINKING
for(i = 0, ii = postLinkFns.length; i < ii; i++) {
try {
linkFn = postLinkFns[i];
linkFn(scope, $element, attrs,
linkFn.require && getControllers(linkFn.require, $element));
} catch (e) {
$exceptionHandler(e, startingTag($element));
}
}
}
}
/**
* looks up the directive and decorates it with exception handling and proper parameters. We
* call this the boundDirective.
*
* @param {string} name name of the directive to look up.
* @param {string} location The directive must be found in specific format.
* String containing any of theses characters:
*
* * `E`: element name
* * `A': attribute
* * `C`: class
* * `M`: comment
* @returns true if directive was added.
*/
function addDirective(tDirectives, name, location, maxPriority) {
var match = false;
if (hasDirectives.hasOwnProperty(name)) {
for(var directive, directives = $injector.get(name + Suffix),
i = 0, ii = directives.length; i<ii; i++) {
try {
directive = directives[i];
if ( (maxPriority === undefined || maxPriority > directive.priority) &&
directive.restrict.indexOf(location) != -1) {
tDirectives.push(directive);
match = true;
}
} catch(e) { $exceptionHandler(e); }
}
}
return match;
}
/**
* When the element is replaced with HTML template then the new attributes
* on the template need to be merged with the existing attributes in the DOM.
* The desired effect is to have both of the attributes present.
*
* @param {object} dst destination attributes (original DOM)
* @param {object} src source attributes (from the directive template)
*/
function mergeTemplateAttributes(dst, src) {
var srcAttr = src.$attr,
dstAttr = dst.$attr,
$element = dst.$$element;
// reapply the old attributes to the new element
forEach(dst, function(value, key) {
if (key.charAt(0) != '$') {
if (src[key]) {
value += (key === 'style' ? ';' : ' ') + src[key];
}
dst.$set(key, value, true, srcAttr[key]);
}
});
// copy the new attributes on the old attrs object
forEach(src, function(value, key) {
if (key == 'class') {
safeAddClass($element, value);
} else if (key == 'style') {
$element.attr('style', $element.attr('style') + ';' + value);
} else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
dst[key] = value;
dstAttr[key] = srcAttr[key];
}
});
}
function compileTemplateUrl(directives, beforeTemplateNodeLinkFn, $compileNode, tAttrs,
$rootElement, replace, childTranscludeFn) {
var linkQueue = [],
afterTemplateNodeLinkFn,
afterTemplateChildLinkFn,
beforeTemplateCompileNode = $compileNode[0],
origAsyncDirective = directives.shift(),
// The fact that we have to copy and patch the directive seems wrong!
derivedSyncDirective = extend({}, origAsyncDirective, {
controller: null, templateUrl: null, transclude: null
});
$compileNode.html('');
$http.get(origAsyncDirective.templateUrl, {cache: $templateCache}).
success(function(content) {
var compileNode, tempTemplateAttrs, $template;
if (replace) {
$template = jqLite('<div>' + trim(content) + '</div>').contents();
compileNode = $template[0];
if ($template.length != 1 || compileNode.nodeType !== 1) {
throw new Error(MULTI_ROOT_TEMPLATE_ERROR + content);
}
tempTemplateAttrs = {$attr: {}};
replaceWith($rootElement, $compileNode, compileNode);
collectDirectives(compileNode, directives, tempTemplateAttrs);
mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
} else {
compileNode = beforeTemplateCompileNode;
$compileNode.html(content);
}
directives.unshift(derivedSyncDirective);
afterTemplateNodeLinkFn = applyDirectivesToNode(directives, $compileNode, tAttrs, childTranscludeFn);
afterTemplateChildLinkFn = compileNodes($compileNode.contents(), childTranscludeFn);
while(linkQueue.length) {
var controller = linkQueue.pop(),
linkRootElement = linkQueue.pop(),
beforeTemplateLinkNode = linkQueue.pop(),
scope = linkQueue.pop(),
linkNode = compileNode;
if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
// it was cloned therefore we have to clone as well.
linkNode = JQLiteClone(compileNode);
replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
}
afterTemplateNodeLinkFn(function() {
beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, controller);
}, scope, linkNode, $rootElement, controller);
}
linkQueue = null;
}).
error(function(response, code, headers, config) {
throw Error('Failed to load template: ' + config.url);
});
return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, controller) {
if (linkQueue) {
linkQueue.push(scope);
linkQueue.push(node);
linkQueue.push(rootElement);
linkQueue.push(controller);
} else {
afterTemplateNodeLinkFn(function() {
beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, controller);
}, scope, node, rootElement, controller);
}
};
}
/**
* Sorting function for bound directives.
*/
function byPriority(a, b) {
return b.priority - a.priority;
}
function assertNoDuplicate(what, previousDirective, directive, element) {
if (previousDirective) {
throw Error('Multiple directives [' + previousDirective.name + ', ' +
directive.name + '] asking for ' + what + ' on: ' + startingTag(element));
}
}
function addTextInterpolateDirective(directives, text) {
var interpolateFn = $interpolate(text, true);
if (interpolateFn) {
directives.push({
priority: 0,
compile: valueFn(function(scope, node) {
var parent = node.parent(),
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
safeAddClass(parent.data('$binding', bindings), 'ng-binding');
scope.$watch(interpolateFn, function(value) {
node[0].nodeValue = value;
});
})
});
}
}
function addAttrInterpolateDirective(node, directives, value, name) {
var interpolateFn = $interpolate(value, true);
// no interpolation found -> ignore
if (!interpolateFn) return;
directives.push({
priority: 100,
compile: valueFn(function(scope, element, attr) {
if (name === 'class') {
// we need to interpolate classes again, in the case the element was replaced
// and therefore the two class attrs got merged - we want to interpolate the result
interpolateFn = $interpolate(attr[name], true);
}
// we define observers array only for interpolated attrs
// and ignore observers for non interpolated attrs to save some memory
attr.$$observers[name] = [];
attr[name] = undefined;
scope.$watch(interpolateFn, function(value) {
attr.$set(name, value);
});
})
});
}
/**
* This is a special jqLite.replaceWith, which can replace items which
* have no parents, provided that the containing jqLite collection is provided.
*
* @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes
* in the root of the tree.
* @param {JqLite} $element The jqLite element which we are going to replace. We keep the shell,
* but replace its DOM node reference.
* @param {Node} newNode The new DOM node.
*/
function replaceWith($rootElement, $element, newNode) {
var oldNode = $element[0],
parent = oldNode.parentNode,
i, ii;
if ($rootElement) {
for(i = 0, ii = $rootElement.length; i < ii; i++) {
if ($rootElement[i] == oldNode) {
$rootElement[i] = newNode;
break;
}
}
}
if (parent) {
parent.replaceChild(newNode, oldNode);
}
newNode[jqLite.expando] = oldNode[jqLite.expando];
$element[0] = newNode;
}
}];
}
var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;
/**
* Converts all accepted directives format into proper directive name.
* All of these will become 'myDirective':
* my:DiRective
* my-directive
* x-my-directive
* data-my:directive
*
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function directiveNormalize(name) {
return camelCase(name.replace(PREFIX_REGEXP, ''));
}
/**
* Closure compiler type information
*/
function nodesetLinkingFn(
/* angular.Scope */ scope,
/* NodeList */ nodeList,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
function directiveLinkingFn(
/* nodesetLinkingFn */ nodesetLinkingFn,
/* angular.Scope */ scope,
/* Node */ node,
/* Element */ rootElement,
/* function(Function) */ boundTranscludeFn
){}
/**
* @ngdoc object
* @name angular.module.ng.$controllerProvider
* @description
* The {@link angular.module.ng.$controller $controller service} is used by Angular to create new
* controllers.
*
* This provider allows controller registration via the
* {@link angular.module.ng.$controllerProvider#register register} method.
*/
function $ControllerProvider() {
var controllers = {};
/**
* @ngdoc function
* @name angular.module.ng.$controllerProvider#register
* @methodOf angular.module.ng.$controllerProvider
* @param {string} name Controller name
* @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
* annotations in the array notation).
*/
this.register = function(name, constructor) {
if (isObject(name)) {
extend(controllers, name)
} else {
controllers[name] = constructor;
}
};
this.$get = ['$injector', '$window', function($injector, $window) {
/**
* @ngdoc function
* @name angular.module.ng.$controller
* @requires $injector
*
* @param {Function|string} constructor If called with a function then it's considered to be the
* controller constructor function. Otherwise it's considered to be a string which is used
* to retrieve the controller constructor using the following steps:
*
* * check if a controller with given name is registered via `$controllerProvider`
* * check if evaluating the string on the current scope returns a constructor
* * check `window[constructor]` on the global `window` object
*
* @param {Object} locals Injection locals for Controller.
* @return {Object} Instance of given controller.
*
* @description
* `$controller` service is responsible for instantiating controllers.
*
* It's just simple call to {@link angular.module.AUTO.$injector $injector}, but extracted into
* a service, so that one can override this service with {@link https://gist.github.com/1649788
* BC version}.
*/
return function(constructor, locals) {
if(isString(constructor)) {
var name = constructor;
constructor = controllers.hasOwnProperty(name)
? controllers[name]
: getter(locals.$scope, name, true) || getter($window, name, true);
assertArgFn(constructor, name, true);
}
return $injector.instantiate(constructor, locals);
};
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$defer
* @requires $browser
*
* @description
* Delegates to {@link angular.module.ng.$browser#defer $browser.defer}, but wraps the `fn` function
* into a try/catch block and delegates any exceptions to
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* In tests you can use `$browser.defer.flush()` to flush the queue of deferred functions.
*
* @param {function()} fn A function, who's execution should be deferred.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$defer.cancel()`.
*/
/**
* @ngdoc function
* @name angular.module.ng.$defer#cancel
* @methodOf angular.module.ng.$defer
*
* @description
* Cancels a defered task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfuly canceled.
*/
function $DeferProvider(){
this.$get = ['$rootScope', '$browser', function($rootScope, $browser) {
function defer(fn, delay) {
return $browser.defer(function() {
$rootScope.$apply(fn);
}, delay);
}
defer.cancel = function(deferId) {
return $browser.defer.cancel(deferId);
};
return defer;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$document
* @requires $window
*
* @description
* A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document`
* element.
*/
function $DocumentProvider(){
this.$get = ['$window', function(window){
return jqLite(window.document);
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$exceptionHandler
* @requires $log
*
* @description
* Any uncaught exception in angular expressions is delegated to this service.
* The default implementation simply delegates to `$log.error` which logs it into
* the browser console.
*
* In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
* {@link angular.module.ngMock.$exceptionHandler mock $exceptionHandler}
*
* @param {Error} exception Exception associated with the error.
* @param {string=} cause optional information about the context in which
* the error was thrown.
*/
function $ExceptionHandlerProvider() {
this.$get = ['$log', function($log){
return function(exception, cause) {
$log.error.apply($log, arguments);
};
}];
}
/**
* @ngdoc function
* @name angular.module.ng.$interpolateProvider
* @function
*
* @description
*
* Used for configuring the interpolation markup. Deafults to `{{` and `}}`.
*/
function $InterpolateProvider() {
var startSymbol = '{{';
var endSymbol = '}}';
/**
* @ngdoc method
* @name angular.module.ng.$interpolateProvider#startSymbol
* @methodOf angular.module.ng.$interpolateProvider
* @description
* Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
*
* @prop {string=} value new value to set the starting symbol to.
*/
this.startSymbol = function(value){
if (value) {
startSymbol = value;
return this;
} else {
return startSymbol;
}
};
/**
* @ngdoc method
* @name angular.module.ng.$interpolateProvider#endSymbol
* @methodOf angular.module.ng.$interpolateProvider
* @description
* Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
*
* @prop {string=} value new value to set the ending symbol to.
*/
this.endSymbol = function(value){
if (value) {
endSymbol = value;
return this;
} else {
return startSymbol;
}
};
this.$get = ['$parse', function($parse) {
var startSymbolLength = startSymbol.length,
endSymbolLength = endSymbol.length;
/**
* @ngdoc function
* @name angular.module.ng.$interpolate
* @function
*
* @requires $parse
*
* @description
*
* Compiles a string with markup into an interpolation function. This service is used by the
* HTML {@link angular.module.ng.$compile $compile} service for data binding. See
* {@link angular.module.ng.$interpolateProvider $interpolateProvider} for configuring the
* interpolation markup.
*
*
<pre>
var $interpolate = ...; // injected
var exp = $interpolate('Hello {{name}}!');
expect(exp({name:'Angular'}).toEqual('Hello Angular!');
</pre>
*
*
* @param {string} text The text with markup to interpolate.
* @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
* embedded expression in order to return an interpolation function. Strings with no
* embedded expression will return null for the interpolation function.
* @returns {function(context)} an interpolation function which is used to compute the interpolated
* string. The function has these parameters:
*
* * `context`: an object against which any expressions embedded in the strings are evaluated
* against.
*
*/
return function(text, mustHaveExpression) {
var startIndex,
endIndex,
index = 0,
parts = [],
length = text.length,
hasInterpolation = false,
fn,
exp,
concat = [];
while(index < length) {
if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) &&
((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) {
(index != startIndex) && parts.push(text.substring(index, startIndex));
parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex)));
fn.exp = exp;
index = endIndex + endSymbolLength;
hasInterpolation = true;
} else {
// we did not find anything, so we have to add the remainder to the parts array
(index != length) && parts.push(text.substring(index));
index = length;
}
}
if (!(length = parts.length)) {
// we added, nothing, must have been an empty string.
parts.push('');
length = 1;
}
if (!mustHaveExpression || hasInterpolation) {
concat.length = length;
fn = function(context) {
for(var i = 0, ii = length, part; i<ii; i++) {
if (typeof (part = parts[i]) == 'function') {
part = part(context);
if (part == null || part == undefined) {
part = '';
} else if (typeof part != 'string') {
part = toJson(part);
}
}
concat[i] = part;
}
return concat.join('');
};
fn.exp = text;
fn.parts = parts;
return fn;
}
};
}];
}
var URL_MATCH = /^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
PATH_MATCH = /^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,
HASH_MATCH = PATH_MATCH,
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
/**
* Encode path using encodeUriSegment, ignoring forward slashes
*
* @param {string} path Path to encode
* @returns {string}
*/
function encodePath(path) {
var segments = path.split('/'),
i = segments.length;
while (i--) {
segments[i] = encodeUriSegment(segments[i]);
}
return segments.join('/');
}
function matchUrl(url, obj) {
var match = URL_MATCH.exec(url);
match = {
protocol: match[1],
host: match[3],
port: int(match[5]) || DEFAULT_PORTS[match[1]] || null,
path: match[6] || '/',
search: match[8],
hash: match[10]
};
if (obj) {
obj.$$protocol = match.protocol;
obj.$$host = match.host;
obj.$$port = match.port;
}
return match;
}
function composeProtocolHostPort(protocol, host, port) {
return protocol + '://' + host + (port == DEFAULT_PORTS[protocol] ? '' : ':' + port);
}
function pathPrefixFromBase(basePath) {
return basePath.substr(0, basePath.lastIndexOf('/'));
}
function convertToHtml5Url(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already html5 url
if (decodeURIComponent(match.path) != basePath || isUndefined(match.hash) ||
match.hash.indexOf(hashPrefix) !== 0) {
return url;
// convert hashbang url -> html5 url
} else {
return composeProtocolHostPort(match.protocol, match.host, match.port) +
pathPrefixFromBase(basePath) + match.hash.substr(hashPrefix.length);
}
}
function convertToHashbangUrl(url, basePath, hashPrefix) {
var match = matchUrl(url);
// already hashbang url
if (decodeURIComponent(match.path) == basePath) {
return url;
// convert html5 url -> hashbang url
} else {
var search = match.search && '?' + match.search || '',
hash = match.hash && '#' + match.hash || '',
pathPrefix = pathPrefixFromBase(basePath),
path = match.path.substr(pathPrefix.length);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
return composeProtocolHostPort(match.protocol, match.host, match.port) + basePath +
'#' + hashPrefix + path + search + hash;
}
}
/**
* LocationUrl represents an url
* This object is exposed as $location service when HTML5 mode is enabled and supported
*
* @constructor
* @param {string} url HTML5 url
* @param {string} pathPrefix
*/
function LocationUrl(url, pathPrefix) {
pathPrefix = pathPrefix || '';
/**
* Parse given html5 (regular) url string into properties
* @param {string} url HTML5 url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.path.indexOf(pathPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
}
this.$$path = decodeURIComponent(match.path.substr(pathPrefix.length));
this.$$search = parseKeyValue(match.search);
this.$$hash = match.hash && decodeURIComponent(match.hash) || '';
this.$$compose();
};
/**
* Compose url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
pathPrefix + this.$$url;
};
this.$$parse(url);
}
/**
* LocationHashbangUrl represents url
* This object is exposed as $location service when html5 history api is disabled or not supported
*
* @constructor
* @param {string} url Legacy url
* @param {string} hashPrefix Prefix for hash part (containing path and search)
*/
function LocationHashbangUrl(url, hashPrefix) {
var basePath;
/**
* Parse given hashbang url into properties
* @param {string} url Hashbang url
* @private
*/
this.$$parse = function(url) {
var match = matchUrl(url, this);
if (match.hash && match.hash.indexOf(hashPrefix) !== 0) {
throw 'Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '" !';
}
basePath = match.path + (match.search ? '?' + match.search : '');
match = HASH_MATCH.exec((match.hash || '').substr(hashPrefix.length));
if (match[1]) {
this.$$path = (match[1].charAt(0) == '/' ? '' : '/') + decodeURIComponent(match[1]);
} else {
this.$$path = '';
}
this.$$search = parseKeyValue(match[3]);
this.$$hash = match[5] && decodeURIComponent(match[5]) || '';
this.$$compose();
};
/**
* Compose hashbang url and update `absUrl` property
* @private
*/
this.$$compose = function() {
var search = toKeyValue(this.$$search),
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
basePath + (this.$$url ? '#' + hashPrefix + this.$$url : '');
};
this.$$parse(url);
}
LocationUrl.prototype = {
/**
* Has any change been replacing ?
* @private
*/
$$replace: false,
/**
* @ngdoc method
* @name angular.module.ng.$location#absUrl
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return full url representation with all segments encoded according to rules specified in
* {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
*
* @return {string}
*/
absUrl: locationGetter('$$absUrl'),
/**
* @ngdoc method
* @name angular.module.ng.$location#url
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return url (e.g. `/path?a=b#hash`) when called without any parameter.
*
* Change path, search and hash, when called with parameter and return `$location`.
*
* @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
* @return {string}
*/
url: function(url, replace) {
if (isUndefined(url))
return this.$$url;
var match = PATH_MATCH.exec(url);
if (match[1]) this.path(decodeURIComponent(match[1]));
if (match[2] || match[1]) this.search(match[3] || '');
this.hash(match[5] || '', replace);
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#protocol
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return protocol of current url.
*
* @return {string}
*/
protocol: locationGetter('$$protocol'),
/**
* @ngdoc method
* @name angular.module.ng.$location#host
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return host of current url.
*
* @return {string}
*/
host: locationGetter('$$host'),
/**
* @ngdoc method
* @name angular.module.ng.$location#port
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter only.
*
* Return port of current url.
*
* @return {Number}
*/
port: locationGetter('$$port'),
/**
* @ngdoc method
* @name angular.module.ng.$location#path
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return path of current url when called without any parameter.
*
* Change path when called with parameter and return `$location`.
*
* Note: Path should always begin with forward slash (/), this method will add the forward slash
* if it is missing.
*
* @param {string=} path New path
* @return {string}
*/
path: locationGetterSetter('$$path', function(path) {
return path.charAt(0) == '/' ? path : '/' + path;
}),
/**
* @ngdoc method
* @name angular.module.ng.$location#search
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return search part (as object) of current url when called without any parameter.
*
* Change search part when called with parameter and return `$location`.
*
* @param {string|object<string,string>=} search New search params - string or hash object
* @param {string=} paramValue If `search` is a string, then `paramValue` will override only a
* single search parameter. If the value is `null`, the parameter will be deleted.
*
* @return {string}
*/
search: function(search, paramValue) {
if (isUndefined(search))
return this.$$search;
if (isDefined(paramValue)) {
if (paramValue === null) {
delete this.$$search[search];
} else {
this.$$search[search] = paramValue;
}
} else {
this.$$search = isString(search) ? parseKeyValue(search) : search;
}
this.$$compose();
return this;
},
/**
* @ngdoc method
* @name angular.module.ng.$location#hash
* @methodOf angular.module.ng.$location
*
* @description
* This method is getter / setter.
*
* Return hash fragment when called without any parameter.
*
* Change hash fragment when called with parameter and return `$location`.
*
* @param {string=} hash New hash fragment
* @return {string}
*/
hash: locationGetterSetter('$$hash', identity),
/**
* @ngdoc method
* @name angular.module.ng.$location#replace
* @methodOf angular.module.ng.$location
*
* @description
* If called, all changes to $location during current `$digest` will be replacing current history
* record, instead of adding new one.
*/
replace: function() {
this.$$replace = true;
return this;
}
};
LocationHashbangUrl.prototype = inherit(LocationUrl.prototype);
function locationGetter(property) {
return function() {
return this[property];
};
}
function locationGetterSetter(property, preprocess) {
return function(value) {
if (isUndefined(value))
return this[property];
this[property] = preprocess(value);
this.$$compose();
return this;
};
}
/**
* @ngdoc object
* @name angular.module.ng.$location
*
* @requires $browser
* @requires $sniffer
* @requires $document
*
* @description
* The $location service parses the URL in the browser address bar (based on the {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL available to your application. Changes to the URL in the address bar are reflected into $location service and changes to $location are reflected into the browser address bar.
*
* **The $location service:**
*
* - Exposes the current URL in the browser address bar, so you can
* - Watch and observe the URL.
* - Change the URL.
* - Synchronizes the URL with the browser when the user
* - Changes the address bar.
* - Clicks the back or forward button (or clicks a History link).
* - Clicks on a link.
* - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
*
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
*/
/**
* @ngdoc object
* @name angular.module.ng.$locationProvider
* @description
* Use the `$locationProvider` to configure how the application deep linking paths are stored.
*/
function $LocationProvider(){
var hashPrefix = '',
html5Mode = false;
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#hashPrefix
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} prefix Prefix for hash part (containing path and search)
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.hashPrefix = function(prefix) {
if (isDefined(prefix)) {
hashPrefix = prefix;
return this;
} else {
return hashPrefix;
}
};
/**
* @ngdoc property
* @name angular.module.ng.$locationProvider#html5Mode
* @methodOf angular.module.ng.$locationProvider
* @description
* @param {string=} mode Use HTML5 strategy if available.
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.html5Mode = function(mode) {
if (isDefined(mode)) {
html5Mode = mode;
return this;
} else {
return html5Mode;
}
};
this.$get = ['$rootScope', '$browser', '$sniffer', '$document',
function( $rootScope, $browser, $sniffer, $document) {
var currentUrl,
basePath = $browser.baseHref() || '/',
pathPrefix = pathPrefixFromBase(basePath),
initUrl = $browser.url();
if (html5Mode) {
if ($sniffer.history) {
currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
} else {
currentUrl = new LocationHashbangUrl(convertToHashbangUrl(initUrl, basePath, hashPrefix),
hashPrefix);
}
// link rewriting
var u = currentUrl,
absUrlPrefix = composeProtocolHostPort(u.protocol(), u.host(), u.port()) + pathPrefix;
$document.bind('click', function(event) {
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
// currently we open nice url link and redirect then
if (event.ctrlKey || event.metaKey || event.which == 2) return;
var elm = jqLite(event.target);
// traverse the DOM up to find first A tag
while (elm.length && lowercase(elm[0].nodeName) !== 'a') {
elm = elm.parent();
}
var absHref = elm.prop('href');
if (!absHref ||
elm.attr('target') ||
absHref.indexOf(absUrlPrefix) !== 0) { // link to different domain or base path
return;
}
// update location with href without the prefix
currentUrl.url(absHref.substr(absUrlPrefix.length));
$rootScope.$apply();
event.preventDefault();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
window.angular['ff-684208-preventDefault'] = true;
});
} else {
currentUrl = new LocationHashbangUrl(initUrl, hashPrefix);
}
// rewrite hashbang url <> html5 url
if (currentUrl.absUrl() != initUrl) {
$browser.url(currentUrl.absUrl(), true);
}
// update $location when $browser url changes
$browser.onUrlChange(function(newUrl) {
if (currentUrl.absUrl() != newUrl) {
$rootScope.$evalAsync(function() {
currentUrl.$$parse(newUrl);
});
if (!$rootScope.$$phase) $rootScope.$digest();
}
});
// update browser
var changeCounter = 0;
$rootScope.$watch(function $locationWatch() {
if ($browser.url() != currentUrl.absUrl()) {
changeCounter++;
$rootScope.$evalAsync(function() {
$browser.url(currentUrl.absUrl(), currentUrl.$$replace);
currentUrl.$$replace = false;
});
}
return changeCounter;
});
return currentUrl;
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$log
* @requires $window
*
* @description
* Simple service for logging. Default implementation writes the message
* into the browser's console (if present).
*
* The main purpose of this service is to simplify debugging and troubleshooting.
*
* @example
<doc:example>
<doc:source>
<script>
function LogCtrl($log) {
this.$log = $log;
this.message = 'Hello World!';
}
</script>
<div ng-controller="LogCtrl">
<p>Reload this page with open console, enter text and hit the log button...</p>
Message:
<input type="text" ng-model="message"/>
<button ng-click="$log.log(message)">log</button>
<button ng-click="$log.warn(message)">warn</button>
<button ng-click="$log.info(message)">info</button>
<button ng-click="$log.error(message)">error</button>
</div>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $LogProvider(){
this.$get = ['$window', function($window){
return {
/**
* @ngdoc method
* @name angular.module.ng.$log#log
* @methodOf angular.module.ng.$log
*
* @description
* Write a log message
*/
log: consoleLog('log'),
/**
* @ngdoc method
* @name angular.module.ng.$log#warn
* @methodOf angular.module.ng.$log
*
* @description
* Write a warning message
*/
warn: consoleLog('warn'),
/**
* @ngdoc method
* @name angular.module.ng.$log#info
* @methodOf angular.module.ng.$log
*
* @description
* Write an information message
*/
info: consoleLog('info'),
/**
* @ngdoc method
* @name angular.module.ng.$log#error
* @methodOf angular.module.ng.$log
*
* @description
* Write an error message
*/
error: consoleLog('error')
};
function formatError(arg) {
if (arg instanceof Error) {
if (arg.stack) {
arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
? 'Error: ' + arg.message + '\n' + arg.stack
: arg.stack;
} else if (arg.sourceURL) {
arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
}
}
return arg;
}
function consoleLog(type) {
var console = $window.console || {},
logFn = console[type] || console.log || noop;
if (logFn.apply) {
return function() {
var args = [];
forEach(arguments, function(arg) {
args.push(formatError(arg));
});
return logFn.apply(console, args);
};
}
// we are IE which either doesn't have window.console => this is noop and we do nothing,
// or we are IE where console.log doesn't have apply so we log at least first 2 args
return function(arg1, arg2) {
logFn(arg1, arg2);
}
}
}];
}
var OPERATORS = {
'null':function(){return null;},
'true':function(){return true;},
'false':function(){return false;},
undefined:noop,
'+':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)+(isDefined(b)?b:0);},
'-':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)-(isDefined(b)?b:0);},
'*':function(self, locals, a,b){return a(self, locals)*b(self, locals);},
'/':function(self, locals, a,b){return a(self, locals)/b(self, locals);},
'%':function(self, locals, a,b){return a(self, locals)%b(self, locals);},
'^':function(self, locals, a,b){return a(self, locals)^b(self, locals);},
'=':noop,
'==':function(self, locals, a,b){return a(self, locals)==b(self, locals);},
'!=':function(self, locals, a,b){return a(self, locals)!=b(self, locals);},
'<':function(self, locals, a,b){return a(self, locals)<b(self, locals);},
'>':function(self, locals, a,b){return a(self, locals)>b(self, locals);},
'<=':function(self, locals, a,b){return a(self, locals)<=b(self, locals);},
'>=':function(self, locals, a,b){return a(self, locals)>=b(self, locals);},
'&&':function(self, locals, a,b){return a(self, locals)&&b(self, locals);},
'||':function(self, locals, a,b){return a(self, locals)||b(self, locals);},
'&':function(self, locals, a,b){return a(self, locals)&b(self, locals);},
// '|':function(self, locals, a,b){return a|b;},
'|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));},
'!':function(self, locals, a){return !a(self, locals);}
};
var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
function lex(text, csp){
var tokens = [],
token,
index = 0,
json = [],
ch,
lastCh = ':'; // can start regexp
while (index < text.length) {
ch = text.charAt(index);
if (is('"\'')) {
readString(ch);
} else if (isNumber(ch) || is('.') && isNumber(peek())) {
readNumber();
} else if (isIdent(ch)) {
readIdent();
// identifiers can only be if the preceding char was a { or ,
if (was('{,') && json[0]=='{' &&
(token=tokens[tokens.length-1])) {
token.json = token.text.indexOf('.') == -1;
}
} else if (is('(){}[].,;:')) {
tokens.push({
index:index,
text:ch,
json:(was(':[,') && is('{[')) || is('}]:,')
});
if (is('{[')) json.unshift(ch);
if (is('}]')) json.shift();
index++;
} else if (isWhitespace(ch)) {
index++;
continue;
} else {
var ch2 = ch + peek(),
fn = OPERATORS[ch],
fn2 = OPERATORS[ch2];
if (fn2) {
tokens.push({index:index, text:ch2, fn:fn2});
index += 2;
} else if (fn) {
tokens.push({index:index, text:ch, fn:fn, json: was('[,:') && is('+-')});
index += 1;
} else {
throwError("Unexpected next character ", index, index+1);
}
}
lastCh = ch;
}
return tokens;
function is(chars) {
return chars.indexOf(ch) != -1;
}
function was(chars) {
return chars.indexOf(lastCh) != -1;
}
function peek() {
return index + 1 < text.length ? text.charAt(index + 1) : false;
}
function isNumber(ch) {
return '0' <= ch && ch <= '9';
}
function isWhitespace(ch) {
return ch == ' ' || ch == '\r' || ch == '\t' ||
ch == '\n' || ch == '\v' || ch == '\u00A0'; // IE treats non-breaking space as \u00A0
}
function isIdent(ch) {
return 'a' <= ch && ch <= 'z' ||
'A' <= ch && ch <= 'Z' ||
'_' == ch || ch == '$';
}
function isExpOperator(ch) {
return ch == '-' || ch == '+' || isNumber(ch);
}
function throwError(error, start, end) {
end = end || index;
throw Error("Lexer Error: " + error + " at column" +
(isDefined(start)
? "s " + start + "-" + index + " [" + text.substring(start, end) + "]"
: " " + end) +
" in expression [" + text + "].");
}
function readNumber() {
var number = "";
var start = index;
while (index < text.length) {
var ch = lowercase(text.charAt(index));
if (ch == '.' || isNumber(ch)) {
number += ch;
} else {
var peekCh = peek();
if (ch == 'e' && isExpOperator(peekCh)) {
number += ch;
} else if (isExpOperator(ch) &&
peekCh && isNumber(peekCh) &&
number.charAt(number.length - 1) == 'e') {
number += ch;
} else if (isExpOperator(ch) &&
(!peekCh || !isNumber(peekCh)) &&
number.charAt(number.length - 1) == 'e') {
throwError('Invalid exponent');
} else {
break;
}
}
index++;
}
number = 1 * number;
tokens.push({index:start, text:number, json:true,
fn:function() {return number;}});
}
function readIdent() {
var ident = "",
start = index,
lastDot, peekIndex, methodName;
while (index < text.length) {
var ch = text.charAt(index);
if (ch == '.' || isIdent(ch) || isNumber(ch)) {
if (ch == '.') lastDot = index;
ident += ch;
} else {
break;
}
index++;
}
//check if this is not a method invocation and if it is back out to last dot
if (lastDot) {
peekIndex = index;
while(peekIndex < text.length) {
var ch = text.charAt(peekIndex);
if (ch == '(') {
methodName = ident.substr(lastDot - start + 1);
ident = ident.substr(0, lastDot - start);
index = peekIndex;
break;
}
if(isWhitespace(ch)) {
peekIndex++;
} else {
break;
}
}
}
var token = {
index:start,
text:ident
};
if (OPERATORS.hasOwnProperty(ident)) {
token.fn = token.json = OPERATORS[ident];
} else {
var getter = getterFn(ident, csp);
token.fn = extend(function(self, locals) {
return (getter(self, locals));
}, {
assign: function(self, value) {
return setter(self, ident, value);
}
});
}
tokens.push(token);
if (methodName) {
tokens.push({
index:lastDot,
text: '.',
json: false
});
tokens.push({
index: lastDot + 1,
text: methodName,
json: false
});
}
}
function readString(quote) {
var start = index;
index++;
var string = "";
var rawString = quote;
var escape = false;
while (index < text.length) {
var ch = text.charAt(index);
rawString += ch;
if (escape) {
if (ch == 'u') {
var hex = text.substring(index + 1, index + 5);
if (!hex.match(/[\da-f]{4}/i))
throwError( "Invalid unicode escape [\\u" + hex + "]");
index += 4;
string += String.fromCharCode(parseInt(hex, 16));
} else {
var rep = ESCAPE[ch];
if (rep) {
string += rep;
} else {
string += ch;
}
}
escape = false;
} else if (ch == '\\') {
escape = true;
} else if (ch == quote) {
index++;
tokens.push({
index:start,
text:rawString,
string:string,
json:true,
fn:function() { return string; }
});
return;
} else {
string += ch;
}
index++;
}
throwError("Unterminated quote", start);
}
}
/////////////////////////////////////////
function parser(text, json, $filter, csp){
var ZERO = valueFn(0),
value,
tokens = lex(text, csp),
assignment = _assignment,
functionCall = _functionCall,
fieldAccess = _fieldAccess,
objectIndex = _objectIndex,
filterChain = _filterChain;
if(json){
// The extra level of aliasing is here, just in case the lexer misses something, so that
// we prevent any accidental execution in JSON.
assignment = logicalOR;
functionCall =
fieldAccess =
objectIndex =
filterChain =
function() { throwError("is not valid json", {text:text, index:0}); };
value = primary();
} else {
value = statements();
}
if (tokens.length !== 0) {
throwError("is an unexpected token", tokens[0]);
}
return value;
///////////////////////////////////
function throwError(msg, token) {
throw Error("Syntax Error: Token '" + token.text +
"' " + msg + " at column " +
(token.index + 1) + " of the expression [" +
text + "] starting at [" + text.substring(token.index) + "].");
}
function peekToken() {
if (tokens.length === 0)
throw Error("Unexpected end of expression: " + text);
return tokens[0];
}
function peek(e1, e2, e3, e4) {
if (tokens.length > 0) {
var token = tokens[0];
var t = token.text;
if (t==e1 || t==e2 || t==e3 || t==e4 ||
(!e1 && !e2 && !e3 && !e4)) {
return token;
}
}
return false;
}
function expect(e1, e2, e3, e4){
var token = peek(e1, e2, e3, e4);
if (token) {
if (json && !token.json) {
throwError("is not valid json", token);
}
tokens.shift();
return token;
}
return false;
}
function consume(e1){
if (!expect(e1)) {
throwError("is unexpected, expecting [" + e1 + "]", peek());
}
}
function unaryFn(fn, right) {
return function(self, locals) {
return fn(self, locals, right);
};
}
function binaryFn(left, fn, right) {
return function(self, locals) {
return fn(self, locals, left, right);
};
}
function statements() {
var statements = [];
while(true) {
if (tokens.length > 0 && !peek('}', ')', ';', ']'))
statements.push(filterChain());
if (!expect(';')) {
// optimize for the common case where there is only one statement.
// TODO(size): maybe we should not support multiple statements?
return statements.length == 1
? statements[0]
: function(self, locals){
var value;
for ( var i = 0; i < statements.length; i++) {
var statement = statements[i];
if (statement)
value = statement(self, locals);
}
return value;
};
}
}
}
function _filterChain() {
var left = expression();
var token;
while(true) {
if ((token = expect('|'))) {
left = binaryFn(left, token.fn, filter());
} else {
return left;
}
}
}
function filter() {
var token = expect();
var fn = $filter(token.text);
var argsFn = [];
while(true) {
if ((token = expect(':'))) {
argsFn.push(expression());
} else {
var fnInvoke = function(self, locals, input){
var args = [input];
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self, locals));
}
return fn.apply(self, args);
};
return function() {
return fnInvoke;
};
}
}
}
function expression() {
return assignment();
}
function _assignment() {
var left = logicalOR();
var right;
var token;
if ((token = expect('='))) {
if (!left.assign) {
throwError("implies assignment but [" +
text.substring(0, token.index) + "] can not be assigned to", token);
}
right = logicalOR();
return function(self, locals){
return left.assign(self, right(self, locals), locals);
};
} else {
return left;
}
}
function logicalOR() {
var left = logicalAND();
var token;
while(true) {
if ((token = expect('||'))) {
left = binaryFn(left, token.fn, logicalAND());
} else {
return left;
}
}
}
function logicalAND() {
var left = equality();
var token;
if ((token = expect('&&'))) {
left = binaryFn(left, token.fn, logicalAND());
}
return left;
}
function equality() {
var left = relational();
var token;
if ((token = expect('==','!='))) {
left = binaryFn(left, token.fn, equality());
}
return left;
}
function relational() {
var left = additive();
var token;
if ((token = expect('<', '>', '<=', '>='))) {
left = binaryFn(left, token.fn, relational());
}
return left;
}
function additive() {
var left = multiplicative();
var token;
while ((token = expect('+','-'))) {
left = binaryFn(left, token.fn, multiplicative());
}
return left;
}
function multiplicative() {
var left = unary();
var token;
while ((token = expect('*','/','%'))) {
left = binaryFn(left, token.fn, unary());
}
return left;
}
function unary() {
var token;
if (expect('+')) {
return primary();
} else if ((token = expect('-'))) {
return binaryFn(ZERO, token.fn, unary());
} else if ((token = expect('!'))) {
return unaryFn(token.fn, unary());
} else {
return primary();
}
}
function primary() {
var primary;
if (expect('(')) {
primary = filterChain();
consume(')');
} else if (expect('[')) {
primary = arrayDeclaration();
} else if (expect('{')) {
primary = object();
} else {
var token = expect();
primary = token.fn;
if (!primary) {
throwError("not a primary expression", token);
}
}
var next, context;
while ((next = expect('(', '[', '.'))) {
if (next.text === '(') {
primary = functionCall(primary, context);
context = null;
} else if (next.text === '[') {
context = primary;
primary = objectIndex(primary);
} else if (next.text === '.') {
context = primary;
primary = fieldAccess(primary);
} else {
throwError("IMPOSSIBLE");
}
}
return primary;
}
function _fieldAccess(object) {
var field = expect().text;
var getter = getterFn(field, csp);
return extend(
function(self, locals) {
return getter(object(self, locals), locals);
},
{
assign:function(self, value, locals) {
return setter(object(self, locals), field, value);
}
}
);
}
function _objectIndex(obj) {
var indexFn = expression();
consume(']');
return extend(
function(self, locals){
var o = obj(self, locals),
i = indexFn(self, locals),
v, p;
if (!o) return undefined;
v = o[i];
if (v && v.then) {
p = v;
if (!('$$v' in v)) {
p.$$v = undefined;
p.then(function(val) { p.$$v = val; });
}
v = v.$$v;
}
return v;
}, {
assign:function(self, value, locals){
return obj(self, locals)[indexFn(self, locals)] = value;
}
});
}
function _functionCall(fn, contextGetter) {
var argsFn = [];
if (peekToken().text != ')') {
do {
argsFn.push(expression());
} while (expect(','));
}
consume(')');
return function(self, locals){
var args = [],
context = contextGetter ? contextGetter(self, locals) : self;
for ( var i = 0; i < argsFn.length; i++) {
args.push(argsFn[i](self, locals));
}
var fnPtr = fn(self, locals) || noop;
// IE stupidity!
return fnPtr.apply
? fnPtr.apply(context, args)
: fnPtr(args[0], args[1], args[2], args[3], args[4]);
};
}
// This is used with json array declaration
function arrayDeclaration () {
var elementFns = [];
if (peekToken().text != ']') {
do {
elementFns.push(expression());
} while (expect(','));
}
consume(']');
return function(self, locals){
var array = [];
for ( var i = 0; i < elementFns.length; i++) {
array.push(elementFns[i](self, locals));
}
return array;
};
}
function object () {
var keyValues = [];
if (peekToken().text != '}') {
do {
var token = expect(),
key = token.string || token.text;
consume(":");
var value = expression();
keyValues.push({key:key, value:value});
} while (expect(','));
}
consume('}');
return function(self, locals){
var object = {};
for ( var i = 0; i < keyValues.length; i++) {
var keyValue = keyValues[i];
var value = keyValue.value(self, locals);
object[keyValue.key] = value;
}
return object;
};
}
}
//////////////////////////////////////////////////
// Parser helper functions
//////////////////////////////////////////////////
function setter(obj, path, setValue) {
var element = path.split('.');
for (var i = 0; element.length > 1; i++) {
var key = element.shift();
var propertyObj = obj[key];
if (!propertyObj) {
propertyObj = {};
obj[key] = propertyObj;
}
obj = propertyObj;
}
obj[element.shift()] = setValue;
return setValue;
}
/**
* Return the value accesible from the object by path. Any undefined traversals are ignored
* @param {Object} obj starting object
* @param {string} path path to traverse
* @param {boolean=true} bindFnToScope
* @returns value as accesbile by path
*/
//TODO(misko): this function needs to be removed
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
var keys = path.split('.');
var key;
var lastInstance = obj;
var len = keys.length;
for (var i = 0; i < len; i++) {
key = keys[i];
if (obj) {
obj = (lastInstance = obj)[key];
}
}
if (!bindFnToScope && isFunction(obj)) {
return bind(lastInstance, obj);
}
return obj;
}
var getterFnCache = {};
/**
* Implementation of the "Black Hole" variant from:
* - http://jsperf.com/angularjs-parse-getter/4
* - http://jsperf.com/path-evaluation-simplified/7
*/
function cspSafeGetterFn(key0, key1, key2, key3, key4) {
return function(scope, locals) {
var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,
promise;
if (pathVal === null || pathVal === undefined) return pathVal;
pathVal = pathVal[key0];
if (pathVal && pathVal.then) {
if (!("$$v" in pathVal)) {
promise = pathVal;
promise.$$v = undefined;
promise.then(function(val) { promise.$$v = val; });
}
pathVal = pathVal.$$v;
}
if (!key1 || pathVal === null || pathVal === undefined) return pathVal;
pathVal = pathVal[key1];
if (pathVal && pathVal.then) {
if (!("$$v" in pathVal)) {
promise = pathVal;
promise.$$v = undefined;
promise.then(function(val) { promise.$$v = val; });
}
pathVal = pathVal.$$v;
}
if (!key2 || pathVal === null || pathVal === undefined) return pathVal;
pathVal = pathVal[key2];
if (pathVal && pathVal.then) {
if (!("$$v" in pathVal)) {
promise = pathVal;
promise.$$v = undefined;
promise.then(function(val) { promise.$$v = val; });
}
pathVal = pathVal.$$v;
}
if (!key3 || pathVal === null || pathVal === undefined) return pathVal;
pathVal = pathVal[key3];
if (pathVal && pathVal.then) {
if (!("$$v" in pathVal)) {
promise = pathVal;
promise.$$v = undefined;
promise.then(function(val) { promise.$$v = val; });
}
pathVal = pathVal.$$v;
}
if (!key4 || pathVal === null || pathVal === undefined) return pathVal;
pathVal = pathVal[key4];
if (pathVal && pathVal.then) {
if (!("$$v" in pathVal)) {
promise = pathVal;
promise.$$v = undefined;
promise.then(function(val) { promise.$$v = val; });
}
pathVal = pathVal.$$v;
}
return pathVal;
};
};
function getterFn(path, csp) {
if (getterFnCache.hasOwnProperty(path)) {
return getterFnCache[path];
}
var pathKeys = path.split('.'),
pathKeysLength = pathKeys.length,
fn;
if (csp) {
fn = (pathKeysLength < 6)
? cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4])
: function(scope, locals) {
var i = 0, val
do {
val = cspSafeGetterFn(
pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++]
)(scope, locals);
locals = undefined; // clear after first iteration
scope = val;
} while (i < pathKeysLength);
return val;
}
} else {
var code = 'var l, fn, p;\n';
forEach(pathKeys, function(key, index) {
code += 'if(s === null || s === undefined) return s;\n' +
'l=s;\n' +
's='+ (index
// we simply dereference 's' on any .dot notation
? 's'
// but if we are first then we check locals first, and if so read it first
: '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' +
'if (s && s.then) {\n' +
' if (!("$$v" in s)) {\n' +
' p=s;\n' +
' p.$$v = undefined;\n' +
' p.then(function(v) {p.$$v=v;});\n' +
'}\n' +
' s=s.$$v\n' +
'}\n';
});
code += 'return s;';
fn = Function('s', 'k', code); // s=scope, k=locals
fn.toString = function() { return code; };
}
return getterFnCache[path] = fn;
}
///////////////////////////////////
function $ParseProvider() {
var cache = {};
this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {
return function(exp) {
switch(typeof exp) {
case 'string':
return cache.hasOwnProperty(exp)
? cache[exp]
: cache[exp] = parser(exp, false, $filter, $sniffer.csp);
case 'function':
return exp;
default:
return noop;
}
};
}];
}
/**
* @ngdoc service
* @name angular.module.ng.$q
* @requires $rootScope
*
* @description
* A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).
*
* [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
* interface for interacting with an object that represents the result of an action that is
* performed asynchronously, and may or may not be finished at any given point in time.
*
* From the perspective of dealing with error handling, deferred and promise apis are to
* asynchronous programing what `try`, `catch` and `throw` keywords are to synchronous programing.
*
* <pre>
* // for the purpose of this example let's assume that variables `$q` and `scope` are
* // available in the current lexical scope (they could have been injected or passed in).
*
* function asyncGreet(name) {
* var deferred = $q.defer();
*
* setTimeout(function() {
* // since this fn executes async in a future turn of the event loop, we need to wrap
* // our code into an $apply call so that the model changes are properly observed.
* scope.$apply(function() {
* if (okToGreet(name)) {
* deferred.resolve('Hello, ' + name + '!');
* } else {
* deferred.reject('Greeting ' + name + ' is not allowed.');
* }
* });
* }, 1000);
*
* return deferred.promise;
* }
*
* var promise = asyncGreet('Robin Hood');
* promise.then(function(greeting) {
* alert('Success: ' + greeting);
* }, function(reason) {
* alert('Failed: ' + reason);
* );
* </pre>
*
* At first it might not be obvious why this extra complexity is worth the trouble. The payoff
* comes in the way of
* [guarantees that promise and deferred apis make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md).
*
* Additionally the promise api allows for composition that is very hard to do with the
* traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
* For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
* section on serial or parallel joining of promises.
*
*
* # The Deferred API
*
* A new instance of deferred is constructed by calling `$q.defer()`.
*
* The purpose of the deferred object is to expose the associated Promise instance as well as apis
* that can be used for signaling the successful or unsuccessful completion of the task.
*
* **Methods**
*
* - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
* constructed via `$q.reject`, the promise will be rejected instead.
* - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
* resolving it with a rejection constructed via `$q.reject`.
*
* **Properties**
*
* - promise – `{Promise}` – promise object associated with this deferred.
*
*
* # The Promise API
*
* A new promise instance is created when a deferred instance is created and can be retrieved by
* calling `deferred.promise`.
*
* The purpose of the promise object is to allow for interested parties to get access to the result
* of the deferred task when it completes.
*
* **Methods**
*
* - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved
* or rejected calls one of the success or error callbacks asynchronously as soon as the result
* is available. The callbacks are called with a single argument the result or rejection reason.
*
* This method *returns a new promise* which is resolved or rejected via the return value of the
* `successCallback` or `errorCallback`.
*
*
* # Chaining promises
*
* Because calling `then` api of a promise returns a new derived promise, it is easily possible
* to create a chain of promises:
*
* <pre>
* promiseB = promiseA.then(function(result) {
* return result + 1;
* });
*
* // promiseB will be resolved immediately after promiseA is resolved and it's value will be
* // the result of promiseA incremented by 1
* </pre>
*
* It is possible to create chains of any length and since a promise can be resolved with another
* promise (which will defer its resolution further), it is possible to pause/defer resolution of
* the promises at any point in the chain. This makes it possible to implement powerful apis like
* $http's response interceptors.
*
*
* # Differences between Kris Kowal's Q and $q
*
* There are three main differences:
*
* - $q is integrated with the {@link angular.module.ng.$rootScope.Scope} Scope model observation
* mechanism in angular, which means faster propagation of resolution or rejection into your
* models and avoiding unnecessary browser repaints, which would result in flickering UI.
* - $q promises are recognized by the templating engine in angular, which means that in templates
* you can treat promises attached to a scope as if they were the resulting values.
* - Q has many more features that $q, but that comes at a cost of bytes. $q is tiny, but contains
* all the important functionality needed for common async tasks.
*/
function $QProvider() {
this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback);
}, $exceptionHandler);
}];
}
/**
* Constructs a promise manager.
*
* @param {function(function)} nextTick Function for executing functions in the next turn.
* @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
* debugging purposes.
* @returns {object} Promise manager.
*/
function qFactory(nextTick, exceptionHandler) {
/**
* @ngdoc
* @name angular.module.ng.$q#defer
* @methodOf angular.module.ng.$q
* @description
* Creates a `Deferred` object which represents a task which will finish in the future.
*
* @returns {Deferred} Returns a new instance of deferred.
*/
var defer = function() {
var pending = [],
value, deferred;
deferred = {
resolve: function(val) {
if (pending) {
var callbacks = pending;
pending = undefined;
value = ref(val);
if (callbacks.length) {
nextTick(function() {
var callback;
for (var i = 0, ii = callbacks.length; i < ii; i++) {
callback = callbacks[i];
value.then(callback[0], callback[1]);
}
});
}
}
},
reject: function(reason) {
deferred.resolve(reject(reason));
},
promise: {
then: function(callback, errback) {
var result = defer();
var wrappedCallback = function(value) {
try {
result.resolve((callback || defaultCallback)(value));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
var wrappedErrback = function(reason) {
try {
result.resolve((errback || defaultErrback)(reason));
} catch(e) {
exceptionHandler(e);
result.reject(e);
}
};
if (pending) {
pending.push([wrappedCallback, wrappedErrback]);
} else {
value.then(wrappedCallback, wrappedErrback);
}
return result.promise;
}
}
};
return deferred;
};
var ref = function(value) {
if (value && value.then) return value;
return {
then: function(callback) {
var result = defer();
nextTick(function() {
result.resolve(callback(value));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#reject
* @methodOf angular.module.ng.$q
* @description
* Creates a promise that is resolved as rejected with the specified `reason`. This api should be
* used to forward rejection in a chain of promises. If you are dealing with the last promise in
* a promise chain, you don't need to worry about it.
*
* When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
* `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
* a promise error callback and you want to forward the error to the promise derived from the
* current promise, you have to "rethrow" the error by returning a rejection constructed via
* `reject`.
*
* <pre>
* promiseB = promiseA.then(function(result) {
* // success: do something and resolve promiseB
* // with the old or a new result
* return result;
* }, function(reason) {
* // error: handle the error if possible and
* // resolve promiseB with newPromiseOrValue,
* // otherwise forward the rejection to promiseB
* if (canHandle(reason)) {
* // handle the error and recover
* return newPromiseOrValue;
* }
* return $q.reject(reason);
* });
* </pre>
*
* @param {*} reason Constant, message, exception or an object representing the rejection reason.
* @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
*/
var reject = function(reason) {
return {
then: function(callback, errback) {
var result = defer();
nextTick(function() {
result.resolve((errback || defaultErrback)(reason));
});
return result.promise;
}
};
};
/**
* @ngdoc
* @name angular.module.ng.$q#when
* @methodOf angular.module.ng.$q
* @description
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
* This is useful when you are dealing with on object that might or might not be a promise, or if
* the promise comes from a source that can't be trusted.
*
* @param {*} value Value or a promise
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
var when = function(value, callback, errback) {
var result = defer(),
done;
var wrappedCallback = function(value) {
try {
return (callback || defaultCallback)(value);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
var wrappedErrback = function(reason) {
try {
return (errback || defaultErrback)(reason);
} catch (e) {
exceptionHandler(e);
return reject(e);
}
};
nextTick(function() {
ref(value).then(function(value) {
if (done) return;
done = true;
result.resolve(ref(value).then(wrappedCallback, wrappedErrback));
}, function(reason) {
if (done) return;
done = true;
result.resolve(wrappedErrback(reason));
});
});
return result.promise;
};
function defaultCallback(value) {
return value;
}
function defaultErrback(reason) {
return reject(reason);
}
/**
* @ngdoc
* @name angular.module.ng.$q#all
* @methodOf angular.module.ng.$q
* @description
* Combines multiple promises into a single promise that is resolved when all of the input
* promises are resolved.
*
* @param {Array.<Promise>} promises An array of promises.
* @returns {Promise} Returns a single promise that will be resolved with an array of values,
* each value coresponding to the promise at the same index in the `promises` array. If any of
* the promises is resolved with a rejection, this resulting promise will be resolved with the
* same rejection.
*/
function all(promises) {
var deferred = defer(),
counter = promises.length,
results = [];
if (counter) {
forEach(promises, function(promise, index) {
ref(promise).then(function(value) {
if (index in results) return;
results[index] = value;
if (!(--counter)) deferred.resolve(results);
}, function(reason) {
if (index in results) return;
deferred.reject(reason);
});
});
} else {
deferred.resolve(results);
}
return deferred.promise;
}
return {
defer: defer,
reject: reject,
when: when,
all: all
};
}
/**
* @ngdoc object
* @name angular.module.ng.$routeProvider
* @function
*
* @description
*
* Used for configuring routes. See {@link angular.module.ng.$route $route} for an example.
*/
function $RouteProvider(){
var routes = {};
/**
* @ngdoc method
* @name angular.module.ng.$routeProvider#when
* @methodOf angular.module.ng.$routeProvider
*
* @param {string} path Route path (matched against `$location.path`). If `$location.path`
* contains redudant trailing slash or is missing one, the route will still match and the
* `$location.path` will be updated to add or drop the trailing slash to exacly match the
* route definition.
* @param {Object} route Mapping information to be assigned to `$route.current` on route
* match.
*
* Object properties:
*
* - `controller` – `{function()=}` – Controller fn that should be associated with newly
* created scope.
* - `template` – `{string=}` – path to an html template that should be used by
* {@link angular.module.ng.$compileProvider.directive.ngView ngView} or
* {@link angular.module.ng.$compileProvider.directive.ngInclude ngInclude} directives.
* - `redirectTo` – {(string|function())=} – value to update
* {@link angular.module.ng.$location $location} path with and trigger route redirection.
*
* If `redirectTo` is a function, it will be called with the following parameters:
*
* - `{Object.<string>}` - route parameters extracted from the current
* `$location.path()` by applying the current route template.
* - `{string}` - current `$location.path()`
* - `{Object}` - current `$location.search()`
*
* The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`.
*
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only $location.search()
* changes.
*
* If the option is set to `false` and url in the browser changes, then
* `$routeUpdate` event is broadcasted on the root scope.
*
* @returns {Object} self
*
* @description
* Adds a new route definition to the `$route` service.
*/
this.when = function(path, route) {
routes[path] = extend({reloadOnSearch: true}, route);
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length-1] == '/')
? path.substr(0, path.length-1)
: path +'/';
routes[redirectPath] = {redirectTo: path};
}
return this;
};
/**
* @ngdoc method
* @name angular.module.ng.$routeProvider#otherwise
* @methodOf angular.module.ng.$routeProvider
*
* @description
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object} params Mapping information to be assigned to `$route.current`.
* @returns {Object} self
*/
this.otherwise = function(params) {
this.when(null, params);
return this;
};
this.$get = ['$rootScope', '$location', '$routeParams',
function( $rootScope, $location, $routeParams) {
/**
* @ngdoc object
* @name angular.module.ng.$route
* @requires $location
* @requires $routeParams
*
* @property {Object} current Reference to the current route definition.
* @property {Array.<Object>} routes Array of all configured routes.
*
* @description
* Is used for deep-linking URLs to controllers and views (HTML partials).
* It watches `$location.url()` and tries to map the path to an existing route definition.
*
* You can define routes through {@link angular.module.ng.$routeProvider $routeProvider}'s API.
*
* The `$route` service is typically used in conjunction with {@link angular.module.ng.$compileProvider.directive.ngView ngView}
* directive and the {@link angular.module.ng.$routeParams $routeParams} service.
*
* @example
This example shows how changing the URL hash causes the `$route` to match a route against the
URL, and the `ngView` pulls in the partial.
Note that this example is using {@link angular.module.ng.$compileProvider.directive.script inlined templates}
to get it working on jsfiddle as well.
<example module="ngView">
<file name="index.html">
<div ng-controller="MainCntl">
Choose:
<a href="Book/Moby">Moby</a> |
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
<a href="Book/Gatsby">Gatsby</a> |
<a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="Book/Scarlet">Scarlet Letter</a><br/>
<div ng-view></div>
<hr />
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.template = {{$route.current.template}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
</div>
</file>
<file name="book.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
</file>
<file name="chapter.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
Chapter Id: {{params.chapterId}}
</file>
<file name="script.js">
angular.module('ngView', [], function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {
template: 'book.html',
controller: BookCntl
});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
template: 'chapter.html',
controller: ChapterCntl
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}
function BookCntl($scope, $routeParams) {
$scope.name = "BookCntl";
$scope.params = $routeParams;
}
function ChapterCntl($scope, $routeParams) {
$scope.name = "ChapterCntl";
$scope.params = $routeParams;
}
</file>
<file name="scenario.js">
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</file>
</example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$beforeRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change.
*
* @param {Route} next Future route information.
* @param {Route} current Current route information.
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$afterRouteChange
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
* Broadcasted after a route change.
*
* @param {Route} current Current route information.
* @param {Route} previous Previous route information.
*/
/**
* @ngdoc event
* @name angular.module.ng.$route#$routeUpdate
* @eventOf angular.module.ng.$route
* @eventType broadcast on root scope
* @description
*
* The `reloadOnSearch` property has been set to false, and we are reusing the same
* instance of the Controller.
*/
var matcher = switchRouteMatcher,
dirty = 0,
forceReload = false,
$route = {
routes: routes,
/**
* @ngdoc method
* @name angular.module.ng.$route#reload
* @methodOf angular.module.ng.$route
*
* @description
* Causes `$route` service to reload theR current route even if
* {@link angular.module.ng.$location $location} hasn't changed.
*
* As a result of that, {@link angular.module.ng.$compileProvider.directive.ngView ngView}
* creates new scope, reinstantiates the controller.
*/
reload: function() {
dirty++;
forceReload = true;
}
};
$rootScope.$watch(function() { return dirty + $location.url(); }, updateRoute);
return $route;
/////////////////////////////////////////////////////
function switchRouteMatcher(on, when) {
// TODO(i): this code is convoluted and inefficient, we should construct the route matching
// regex only once and then reuse it
var regex = '^' + when.replace(/([\.\\\(\)\^\$])/g, "\\$1") + '$',
params = [],
dst = {};
forEach(when.split(/\W/), function(param) {
if (param) {
var paramRegExp = new RegExp(":" + param + "([\\W])");
if (regex.match(paramRegExp)) {
regex = regex.replace(paramRegExp, "([^\\/]*)$1");
params.push(param);
}
}
});
var match = on.match(new RegExp(regex));
if (match) {
forEach(params, function(name, index) {
dst[name] = match[index + 1];
});
}
return match ? dst : null;
}
function updateRoute() {
var next = parseRoute(),
last = $route.current;
if (next && last && next.$route === last.$route
&& equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) {
last.params = next.params;
copy(last.params, $routeParams);
$rootScope.$broadcast('$routeUpdate', last);
} else if (next || last) {
forceReload = false;
$rootScope.$broadcast('$beforeRouteChange', next, last);
$route.current = next;
if (next) {
if (next.redirectTo) {
if (isString(next.redirectTo)) {
$location.path(interpolate(next.redirectTo, next.params)).search(next.params)
.replace();
} else {
$location.url(next.redirectTo(next.pathParams, $location.path(), $location.search()))
.replace();
}
} else {
copy(next.params, $routeParams);
}
}
$rootScope.$broadcast('$afterRouteChange', next, last);
}
}
/**
* @returns the current active route, by matching it against the URL
*/
function parseRoute() {
// Match a route
var params, match;
forEach(routes, function(route, path) {
if (!match && (params = matcher($location.path(), path))) {
match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params});
match.$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
}
/**
* @returns interpolation of the redirect path with the parametrs
*/
function interpolate(string, params) {
var result = [];
forEach((string||'').split(':'), function(segment, i) {
if (i == 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
delete params[key];
}
});
return result.join('');
}
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$routeParams
* @requires $route
*
* @description
* Current set of route parameters. The route parameters are a combination of the
* {@link angular.module.ng.$location $location} `search()`, and `path()`. The `path` parameters
* are extracted when the {@link angular.module.ng.$route $route} path is matched.
*
* In case of parameter name collision, `path` params take precedence over `search` params.
*
* The service guarantees that the identity of the `$routeParams` object will remain unchanged
* (but its properties will likely change) even when a route change occurs.
*
* @example
* <pre>
* // Given:
* // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
* // Route: /Chapter/:chapterId/Section/:sectionId
* //
* // Then
* $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
* </pre>
*/
function $RouteParamsProvider() {
this.$get = valueFn({});
}
/**
* DESIGN NOTES
*
* The design decisions behind the scope ware heavily favored for speed and memory consumption.
*
* The typical use of scope is to watch the expressions, which most of the time return the same
* value as last time so we optimize the operation.
*
* Closures construction is expensive from speed as well as memory:
* - no closures, instead ups prototypical inheritance for API
* - Internal state needs to be stored on scope directly, which means that private state is
* exposed as $$____ properties
*
* Loop operations are optimized by using while(count--) { ... }
* - this means that in order to keep the same order of execution as addition we have to add
* items to the array at the begging (shift) instead of at the end (push)
*
* Child scopes are created and removed often
* - Using array would be slow since inserts in meddle are expensive so we use linked list
*
* There are few watches then a lot of observers. This is why you don't want the observer to be
* implemented in the same way as watch. Watch requires return of initialization function which
* are expensive to construct.
*/
/**
* @ngdoc object
* @name angular.module.ng.$rootScopeProvider
* @description
*
* Provider for the $rootScope service.
*/
/**
* @ngdoc function
* @name angular.module.ng.$rootScopeProvider#digestTtl
* @methodOf angular.module.ng.$rootScopeProvider
* @description
*
* Sets the number of digest iteration the scope should attempt to execute before giving up and
* assuming that the model is unstable.
*
* The current default is 10 iterations.
*
* @param {number} limit The number of digest iterations.
*/
/**
* @ngdoc object
* @name angular.module.ng.$rootScope
* @description
*
* Every application has a single root {@link angular.module.ng.$rootScope.Scope scope}.
* All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide
* event processing life-cycle. See {@link guide/dev_guide.scopes developer guide on scopes}.
*/
function $RootScopeProvider(){
var TTL = 10;
this.digestTtl = function(value) {
if (arguments.length) {
TTL = value;
}
return TTL;
};
this.$get = ['$injector', '$exceptionHandler', '$parse',
function( $injector, $exceptionHandler, $parse) {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope
*
* @description
* A root scope can be retrieved using the {@link angular.module.ng.$rootScope $rootScope} key from the
* {@link angular.module.AUTO.$injector $injector}. Child scopes are created using the
* {@link angular.module.ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
* compiled HTML template is executed.)
*
* Here is a simple scope snippet to show how you can interact with the scope.
* <pre>
angular.injector(['ng']).invoke(function($rootScope) {
var scope = $rootScope.$new();
scope.salutation = 'Hello';
scope.name = 'World';
expect(scope.greeting).toEqual(undefined);
scope.$watch('name', function() {
this.greeting = this.salutation + ' ' + this.name + '!';
}); // initialize the watch
expect(scope.greeting).toEqual(undefined);
scope.name = 'Misko';
// still old value, since watches have not been called yet
expect(scope.greeting).toEqual(undefined);
scope.$digest(); // fire all the watches
expect(scope.greeting).toEqual('Hello Misko!');
});
* </pre>
*
* # Inheritance
* A scope can inherit from a parent scope, as in this example:
* <pre>
var parent = $rootScope;
var child = parent.$new();
parent.salutation = "Hello";
child.name = "World";
expect(child.salutation).toEqual('Hello');
child.salutation = "Welcome";
expect(child.salutation).toEqual('Welcome');
expect(parent.salutation).toEqual('Hello');
* </pre>
*
* # Dependency Injection
* See {@link guide/dev_guide.di dependency injection}.
*
*
* @param {Object.<string, function()>=} providers Map of service factory which need to be provided
* for the current scope. Defaults to {@link angular.module.ng}.
* @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
* append/override services provided by `providers`. This is handy when unit-testing and having
* the need to override a default service.
* @returns {Object} Newly created scope.
*
*/
function Scope() {
this.$id = nextUid();
this.$$phase = this.$parent = this.$$watchers =
this.$$nextSibling = this.$$prevSibling =
this.$$childHead = this.$$childTail = null;
this['this'] = this.$root = this;
this.$$asyncQueue = [];
this.$$listeners = {};
}
/**
* @ngdoc property
* @name angular.module.ng.$rootScope.Scope#$id
* @propertyOf angular.module.ng.$rootScope.Scope
* @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
* debugging.
*/
Scope.prototype = {
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$new
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Creates a new child {@link angular.module.ng.$rootScope.Scope scope}.
*
* The parent scope will propagate the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope
* hierarchy using {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()}.
*
* {@link angular.module.ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for
* the scope and its child scopes to be permanently detached from the parent and thus stop
* participating in model change detection and listener notification by invoking.
*
* @params {boolean} isolate if true then the scoped does not prototypically inherit from the
* parent scope. The scope is isolated, as it can not se parent scope properties.
* When creating widgets it is useful for the widget to not accidently read parent
* state.
*
* @returns {Object} The newly created child scope.
*
*/
$new: function(isolate) {
var Child,
child;
if (isFunction(isolate)) {
// TODO: remove at some point
throw Error('API-CHANGE: Use $controller to instantiate controllers.');
}
if (isolate) {
child = new Scope();
child.$root = this.$root;
} else {
Child = function() {}; // should be anonymous; This is so that when the minifier munges
// the name it does not become random set of chars. These will then show up as class
// name in the debugger.
Child.prototype = this;
child = new Child();
child.$id = nextUid();
}
child['this'] = child;
child.$$listeners = {};
child.$parent = this;
child.$$asyncQueue = [];
child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null;
child.$$prevSibling = this.$$childTail;
if (this.$$childHead) {
this.$$childTail.$$nextSibling = child;
this.$$childTail = child;
} else {
this.$$childHead = this.$$childTail = child;
}
return child;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$watch
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Registers a `listener` callback to be executed whenever the `watchExpression` changes.
*
* - The `watchExpression` is called on every call to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and
* should return the value which will be watched. (Since {@link angular.module.ng.$rootScope.Scope#$digest $digest()}
* reruns when it detects changes the `watchExpression` can execute multiple times per
* {@link angular.module.ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
* - The `listener` is called only when the value from the current `watchExpression` and the
* previous call to `watchExpression' are not equal (with the exception of the initial run
* see below). The inequality is determined according to
* {@link angular.equals} function. To save the value of the object for later comparison
* {@link angular.copy} function is used. It also means that watching complex options will
* have adverse memory and performance implications.
* - The watch `listener` may change the model, which may trigger other `listener`s to fire. This
* is achieved by rerunning the watchers until no changes are detected. The rerun iteration
* limit is 100 to prevent infinity loop deadlock.
*
*
* If you want to be notified whenever {@link angular.module.ng.$rootScope.Scope#$digest $digest} is called,
* you can register an `watchExpression` function with no `listener`. (Since `watchExpression`,
* can execute multiple times per {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle when a change is
* detected, be prepared for multiple calls to your listener.)
*
* After a watcher is registered with the scope, the `listener` fn is called asynchronously
* (via {@link angular.module.ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
* watcher. In rare cases, this is undesirable because the listener is called when the result
* of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
* can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
* listener was called due to initialization.
*
*
* # Example
<pre>
// let's assume that scope was dependency injected as the $rootScope
var scope = $rootScope;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(newValue, oldValue) { counter = counter + 1; });
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*
*
* @param {(function()|string)} watchExpression Expression that is evaluated on each
* {@link angular.module.ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a
* call to the `listener`.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(scope)`: called with current `scope` as a parameter.
* @param {(function()|string)=} listener Callback called whenever the return value of
* the `watchExpression` changes.
*
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
* - `function(newValue, oldValue, scope)`: called with current and previous values as parameters.
*
* @param {boolean=} objectEquality Compare object for equality rather then for refference.
* @returns {function()} Returns a deregistration function for this listener.
*/
$watch: function(watchExp, listener, objectEquality) {
var scope = this,
get = compileToFn(watchExp, 'watch'),
array = scope.$$watchers,
watcher = {
fn: listener,
last: initWatchVal,
get: get,
exp: watchExp,
eq: !!objectEquality
};
// in the case user pass string, we need to compile it, do we really need this ?
if (!isFunction(listener)) {
var listenFn = compileToFn(listener || noop, 'listener');
watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);};
}
if (!array) {
array = scope.$$watchers = [];
}
// we use unshift since we use a while loop in $digest for speed.
// the while loop reads in reverse order.
array.unshift(watcher);
return function() {
arrayRemove(array, watcher);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$digest
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Process all of the {@link angular.module.ng.$rootScope.Scope#$watch watchers} of the current scope and its children.
* Because a {@link angular.module.ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the
* `$digest()` keeps calling the {@link angular.module.ng.$rootScope.Scope#$watch watchers} until no more listeners are
* firing. This means that it is possible to get into an infinite loop. This function will throw
* `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 100.
*
* Usually you don't call `$digest()` directly in
* {@link angular.module.ng.$compileProvider.directive.ngController controllers} or in
* {@link angular.module.ng.$compileProvider.directive directives}.
* Instead a call to {@link angular.module.ng.$rootScope.Scope#$apply $apply()} (typically from within a
* {@link angular.module.ng.$compileProvider.directive directives}) will force a `$digest()`.
*
* If you want to be notified whenever `$digest()` is called,
* you can register a `watchExpression` function with {@link angular.module.ng.$rootScope.Scope#$watch $watch()}
* with no `listener`.
*
* You may have a need to call `$digest()` from within unit-tests, to simulate the scope
* life-cycle.
*
* # Example
<pre>
var scope = ...;
scope.name = 'misko';
scope.counter = 0;
expect(scope.counter).toEqual(0);
scope.$watch('name', function(newValue, oldValue) {
counter = counter + 1;
});
expect(scope.counter).toEqual(0);
scope.$digest();
// no variable change
expect(scope.counter).toEqual(0);
scope.name = 'adam';
scope.$digest();
expect(scope.counter).toEqual(1);
</pre>
*
*/
$digest: function() {
var watch, value, last,
watchers,
asyncQueue,
length,
dirty, ttl = TTL,
next, current, target = this,
watchLog = [],
logIdx, logMsg;
flagPhase(target, '$digest');
do {
dirty = false;
current = target;
do {
asyncQueue = current.$$asyncQueue;
while(asyncQueue.length) {
try {
current.$eval(asyncQueue.shift());
} catch (e) {
$exceptionHandler(e);
}
}
if ((watchers = current.$$watchers)) {
// process our watches
length = watchers.length;
while (length--) {
try {
watch = watchers[length];
// Most common watches are on primitives, in which case we can short
// circuit it with === operator, only when === fails do we use .equals
if ((value = watch.get(current)) !== (last = watch.last) &&
!(watch.eq
? equals(value, last)
: (typeof value == 'number' && typeof last == 'number'
&& isNaN(value) && isNaN(last)))) {
dirty = true;
watch.last = watch.eq ? copy(value) : value;
watch.fn(value, ((last === initWatchVal) ? value : last), current);
if (ttl < 5) {
logIdx = 4 - ttl;
if (!watchLog[logIdx]) watchLog[logIdx] = [];
logMsg = (isFunction(watch.exp))
? 'fn: ' + (watch.exp.name || watch.exp.toString())
: watch.exp;
logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);
watchLog[logIdx].push(logMsg);
}
}
} catch (e) {
$exceptionHandler(e);
}
}
}
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $broadcast
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
if(dirty && !(ttl--)) {
throw Error(TTL + ' $digest() iterations reached. Aborting!\n' +
'Watchers fired in the last 5 iterations: ' + toJson(watchLog));
}
} while (dirty || asyncQueue.length);
this.$root.$$phase = null;
},
/**
* @ngdoc event
* @name angular.module.$rootScope.Scope#$destroy
* @eventOf angular.module.ng.$rootScope.Scope
* @eventType broadcast on scope being destroyed
*
* @description
* Broadcasted when a scope and its children are being destroyed.
*/
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$destroy
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Remove the current scope (and all of its children) from the parent scope. Removal implies
* that calls to {@link angular.module.ng.$rootScope.Scope#$digest $digest()} will no longer
* propagate to the current scope and its children. Removal also implies that the current
* scope is eligible for garbage collection.
*
* The `$destroy()` is usually used by directives such as
* {@link angular.module.ng.$compileProvider.directive.ngRepeat ngRepeat} for managing the
* unrolling of the loop.
*
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
* Application code can register a `$destroy` event handler that will give it chance to
* perform any necessary cleanup.
*/
$destroy: function() {
if (this.$root == this) return; // we can't remove the root node;
var parent = this.$parent;
this.$broadcast('$destroy');
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$eval
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the `expression` on the current scope returning the result. Any exceptions in the
* expression are propagated (uncaught). This is useful when evaluating engular expressions.
*
* # Example
<pre>
var scope = angular.module.ng.$rootScope.Scope();
scope.a = 1;
scope.b = 2;
expect(scope.$eval('a+b')).toEqual(3);
expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
</pre>
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope, locals)`: execute the function with the current `scope` parameter.
* @param {Object=} locals Hash object of local variables for the expression.
*
* @returns {*} The result of evaluating the expression.
*/
$eval: function(expr, locals) {
return $parse(expr)(this, locals);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$evalAsync
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Executes the expression on the current scope at a later point in time.
*
* The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that:
*
* - it will execute in the current script execution context (before any DOM rendering).
* - at least one {@link angular.module.ng.$rootScope.Scope#$digest $digest cycle} will be performed after
* `expression` execution.
*
* Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with the current `scope` parameter.
*
*/
$evalAsync: function(expr) {
this.$$asyncQueue.push(expr);
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$apply
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* `$apply()` is used to execute an expression in angular from outside of the angular framework.
* (For example from browser DOM events, setTimeout, XHR or third party libraries).
* Because we are calling into the angular framework we need to perform proper scope life-cycle
* of {@link angular.module.ng.$exceptionHandler exception handling},
* {@link angular.module.ng.$rootScope.Scope#$digest executing watches}.
*
* ## Life cycle
*
* # Pseudo-Code of `$apply()`
function $apply(expr) {
try {
return $eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
$root.$digest();
}
}
*
*
* Scope's `$apply()` method transitions through the following stages:
*
* 1. The {@link guide/dev_guide.expressions expression} is executed using the
* {@link angular.module.ng.$rootScope.Scope#$eval $eval()} method.
* 2. Any exceptions from the execution of the expression are forwarded to the
* {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
* 3. The {@link angular.module.ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression
* was executed using the {@link angular.module.ng.$rootScope.Scope#$digest $digest()} method.
*
*
* @param {(string|function())=} exp An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
* - `function(scope)`: execute the function with current `scope` parameter.
*
* @returns {*} The result of evaluating the expression.
*/
$apply: function(expr) {
try {
flagPhase(this, '$apply');
return this.$eval(expr);
} catch (e) {
$exceptionHandler(e);
} finally {
this.$root.$$phase = null;
this.$root.$digest();
}
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$on
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Listen on events of a given type. See {@link angular.module.ng.$rootScope.Scope#$emit $emit} for discussion of
* event life cycle.
*
* @param {string} name Event name to listen on.
* @param {function(event)} listener Function to call when the event is emitted.
* @returns {function()} Returns a deregistration function for this listener.
*
* The event listener function format is: `function(event)`. The `event` object passed into the
* listener has the following attributes
*
* - `targetScope` - {Scope}: the scope on which the event was `$emit`-ed or `$broadcast`-ed.
* - `currentScope` - {Scope}: the current scope which is handling the event.
* - `name` - {string}: Name of the event.
* - `cancel` - {function=}: calling `cancel` function will cancel further event propagation
* (available only for events that were `$emit`-ed).
* - `cancelled` - {boolean}: Whether the event was cancelled.
*/
$on: function(name, listener) {
var namedListeners = this.$$listeners[name];
if (!namedListeners) {
this.$$listeners[name] = namedListeners = [];
}
namedListeners.push(listener);
return function() {
arrayRemove(namedListeners, listener);
};
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$emit
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` upwards through the scope hierarchy notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$emit` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event traverses upwards toward the root scope and calls all registered
* listeners along the way. The event will stop propagating if one of the listeners cancels it.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object, see {@link angular.module.ng.$rootScope.Scope#$on}
*/
$emit: function(name, args) {
var empty = [],
namedListeners,
scope = this,
event = {
name: name,
targetScope: scope,
cancel: function() {event.cancelled = true;},
cancelled: false
},
listenerArgs = concat([event], arguments, 1),
i, length;
do {
namedListeners = scope.$$listeners[name] || empty;
event.currentScope = scope;
for (i=0, length=namedListeners.length; i<length; i++) {
try {
namedListeners[i].apply(null, listenerArgs);
if (event.cancelled) return event;
} catch (e) {
$exceptionHandler(e);
}
}
//traverse upwards
scope = scope.$parent;
} while (scope);
return event;
},
/**
* @ngdoc function
* @name angular.module.ng.$rootScope.Scope#$broadcast
* @methodOf angular.module.ng.$rootScope.Scope
* @function
*
* @description
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the
* registered {@link angular.module.ng.$rootScope.Scope#$on} listeners.
*
* The event life cycle starts at the scope on which `$broadcast` was called. All
* {@link angular.module.ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
* Afterwards, the event propagates to all direct and indirect scopes of the current scope and
* calls all registered listeners along the way. The event cannot be canceled.
*
* Any exception emmited from the {@link angular.module.ng.$rootScope.Scope#$on listeners} will be passed
* onto the {@link angular.module.ng.$exceptionHandler $exceptionHandler} service.
*
* @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object, see {@link angular.module.ng.$rootScope.Scope#$on}
*/
$broadcast: function(name, args) {
var target = this,
current = target,
next = target,
event = { name: name,
targetScope: target },
listenerArgs = concat([event], arguments, 1);
//down while you can, then up and next sibling or up and next sibling until back at root
do {
current = next;
event.currentScope = current;
forEach(current.$$listeners[name], function(listener) {
try {
listener.apply(null, listenerArgs);
} catch(e) {
$exceptionHandler(e);
}
});
// Insanity Warning: scope depth-first traversal
// yes, this code is a bit crazy, but it works and we have tests to prove it!
// this piece should be kept in sync with the traversal in $digest
if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) {
while(current !== target && !(next = current.$$nextSibling)) {
current = current.$parent;
}
}
} while ((current = next));
return event;
}
};
function flagPhase(scope, phase) {
var root = scope.$root;
if (root.$$phase) {
throw Error(root.$$phase + ' already in progress');
}
root.$$phase = phase;
}
return new Scope();
function compileToFn(exp, name) {
var fn = $parse(exp);
assertArgFn(fn, name);
return fn;
}
/**
* function used as an initial value for watchers.
* because it's uniqueue we can easily tell it apart from other values
*/
function initWatchVal() {}
}];
}
/**
* !!! This is an undocumented "private" service !!!
*
* @name angular.module.ng.$sniffer
* @requires $window
*
* @property {boolean} history Does the browser support html5 history api ?
* @property {boolean} hashchange Does the browser support hashchange event ?
*
* @description
* This is very simple implementation of testing browser's features.
*/
function $SnifferProvider() {
this.$get = ['$window', function($window) {
var eventSupport = {},
android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]);
return {
// Android has history.pushState, but it does not update location correctly
// so let's not use the history API at all.
// http://code.google.com/p/android/issues/detail?id=17471
// https://github.com/angular/angular.js/issues/904
history: !!($window.history && $window.history.pushState && !(android < 4)),
hashchange: 'onhashchange' in $window &&
// IE8 compatible mode lies
(!$window.document.documentMode || $window.document.documentMode > 7),
hasEvent: function(event) {
// IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
// it. In particular the event is not fired when backspace or delete key are pressed or
// when cut operation is performed.
if (event == 'input' && msie == 9) return false;
if (isUndefined(eventSupport[event])) {
var divElm = $window.document.createElement('div');
eventSupport[event] = 'on' + event in divElm;
}
return eventSupport[event];
},
// TODO(i): currently there is no way to feature detect CSP without triggering alerts
csp: false
};
}];
}
/**
* @ngdoc object
* @name angular.module.ng.$window
*
* @description
* A reference to the browser's `window` object. While `window`
* is globally available in JavaScript, it causes testability problems, because
* it is a global variable. In angular we always refer to it through the
* `$window` service, so it may be overriden, removed or mocked for testing.
*
* All expressions are evaluated with respect to current scope so they don't
* suffer from window globality.
*
* @example
<doc:example>
<doc:source>
<input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" />
<button ng-click="$window.alert(greeting)">ALERT</button>
</doc:source>
<doc:scenario>
</doc:scenario>
</doc:example>
*/
function $WindowProvider(){
this.$get = valueFn(window);
}
/**
* Parse headers into key value object
*
* @param {string} headers Raw headers as a string
* @returns {Object} Parsed headers as key value object
*/
function parseHeaders(headers) {
var parsed = {}, key, val, i;
if (!headers) return parsed;
forEach(headers.split('\n'), function(line) {
i = line.indexOf(':');
key = lowercase(trim(line.substr(0, i)));
val = trim(line.substr(i + 1));
if (key) {
if (parsed[key]) {
parsed[key] += ', ' + val;
} else {
parsed[key] = val;
}
}
});
return parsed;
}
/**
* Returns a function that provides access to parsed headers.
*
* Headers are lazy parsed when first requested.
* @see parseHeaders
*
* @param {(string|Object)} headers Headers to provide access to.
* @returns {function(string=)} Returns a getter function which if called with:
*
* - if called with single an argument returns a single header value or null
* - if called with no arguments returns an object containing all headers.
*/
function headersGetter(headers) {
var headersObj = isObject(headers) ? headers : undefined;
return function(name) {
if (!headersObj) headersObj = parseHeaders(headers);
if (name) {
return headersObj[lowercase(name)] || null;
}
return headersObj;
};
}
/**
* Chain all given functions
*
* This function is used for both request and response transforming
*
* @param {*} data Data to transform.
* @param {function(string=)} headers Http headers getter fn.
* @param {(function|Array.<function>)} fns Function or an array of functions.
* @returns {*} Transformed data.
*/
function transformData(data, headers, fns) {
if (isFunction(fns))
return fns(data, headers);
forEach(fns, function(fn) {
data = fn(data, headers);
});
return data;
}
function isSuccess(status) {
return 200 <= status && status < 300;
}
function $HttpProvider() {
var JSON_START = /^\s*(\[|\{[^\{])/,
JSON_END = /[\}\]]\s*$/,
PROTECTION_PREFIX = /^\)\]\}',?\n/;
var $config = this.defaults = {
// transform incoming response data
transformResponse: [function(data) {
if (isString(data)) {
// strip json vulnerability protection prefix
data = data.replace(PROTECTION_PREFIX, '');
if (JSON_START.test(data) && JSON_END.test(data))
data = fromJson(data, true);
}
return data;
}],
// transform outgoing request data
transformRequest: [function(d) {
return isObject(d) && !isFile(d) ? toJson(d) : d;
}],
// default headers
headers: {
common: {
'Accept': 'application/json, text/plain, */*',
'X-Requested-With': 'XMLHttpRequest'
},
post: {'Content-Type': 'application/json'},
put: {'Content-Type': 'application/json'}
}
};
var providerResponseInterceptors = this.responseInterceptors = [];
this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',
function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {
var defaultCache = $cacheFactory('$http'),
responseInterceptors = [];
forEach(providerResponseInterceptors, function(interceptor) {
responseInterceptors.push(
isString(interceptor)
? $injector.get(interceptor)
: $injector.invoke(interceptor)
);
});
/**
* @ngdoc function
* @name angular.module.ng.$http
* @requires $httpBacked
* @requires $browser
* @requires $cacheFactory
* @requires $rootScope
* @requires $q
* @requires $injector
*
* @description
* The `$http` service is a core Angular service that facilitates communication with the remote
* HTTP servers via browser's {@link https://developer.mozilla.org/en/xmlhttprequest
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
*
* For unit testing applications that use `$http` service, see
* {@link angular.module.ngMock.$httpBackend $httpBackend mock}.
*
* For a higher level of abstraction, please check out the {@link angular.module.ngResource.$resource
* $resource} service.
*
* The $http API is based on the {@link angular.module.ng.$q deferred/promise APIs} exposed by
* the $q service. While for simple usage patters this doesn't matter much, for advanced usage,
* it is important to familiarize yourself with these apis and guarantees they provide.
*
*
* # General usage
* The `$http` service is a function which takes a single argument — a configuration object —
* that is used to generate an http request and returns a {@link angular.module.ng.$q promise}
* with two $http specific methods: `success` and `error`.
*
* <pre>
* $http({method: 'GET', url: '/someUrl'}).
* success(function(data, status, headers, config) {
* // this callback will be called asynchronously
* // when the response is available
* }).
* error(function(data, status, headers, config) {
* // called asynchronously if an error occurs
* // or server returns response with status
* // code outside of the <200, 400) range
* });
* </pre>
*
* Since the returned value of calling the $http function is a Promise object, you can also use
* the `then` method to register callbacks, and these callbacks will receive a single argument –
* an object representing the response. See the api signature and type info below for more
* details.
*
*
* # Shortcut methods
*
* Since all invocation of the $http service require definition of the http method and url and
* POST and PUT requests require response body/data to be provided as well, shortcut methods
* were created to simplify using the api:
*
* <pre>
* $http.get('/someUrl').success(successCallback);
* $http.post('/someUrl', data).success(successCallback);
* </pre>
*
* Complete list of shortcut methods:
*
* - {@link angular.module.ng.$http#get $http.get}
* - {@link angular.module.ng.$http#head $http.head}
* - {@link angular.module.ng.$http#post $http.post}
* - {@link angular.module.ng.$http#put $http.put}
* - {@link angular.module.ng.$http#delete $http.delete}
* - {@link angular.module.ng.$http#jsonp $http.jsonp}
*
*
* # Setting HTTP Headers
*
* The $http service will automatically add certain http headers to all requests. These defaults
* can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
* object, which currently contains this default configuration:
*
* - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
* - `Accept: application/json, text/plain, * / *`
* - `X-Requested-With: XMLHttpRequest`
* - `$httpProvider.defaults.headers.post`: (header defaults for HTTP POST requests)
* - `Content-Type: application/json`
* - `$httpProvider.defaults.headers.put` (header defaults for HTTP PUT requests)
* - `Content-Type: application/json`
*
* To add or overwrite these defaults, simply add or remove a property from this configuration
* objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
* with name equal to the lower-cased http method name, e.g.
* `$httpProvider.defaults.headers.get['My-Header']='value'`.
*
* Additionally, the defaults can be set at runtime via the `$http.defaults` object in a similar
* fassion as described above.
*
*
* # Transforming Requests and Responses
*
* Both requests and responses can be transformed using transform functions. By default, Angular
* applies these transformations:
*
* Request transformations:
*
* - if the `data` property of the request config object contains an object, serialize it into
* JSON format.
*
* Response transformations:
*
* - if XSRF prefix is detected, strip it (see Security Considerations section below)
* - if json response is detected, deserialize it using a JSON parser
*
* To override these transformation locally, specify transform functions as `transformRequest`
* and/or `transformResponse` properties of the config object. To globally override the default
* transforms, override the `$httpProvider.defaults.transformRequest` and
* `$httpProvider.defaults.transformResponse` properties of the `$httpProvider`.
*
*
* # Caching
*
* To enable caching set the configuration property `cache` to `true`. When the cache is
* enabled, `$http` stores the response from the server in local cache. Next time the
* response is served from the cache without sending a request to the server.
*
* Note that even if the response is served from cache, delivery of the data is asynchronous in
* the same way that real requests are.
*
* If there are multiple GET requests for the same url that should be cached using the same
* cache, but the cache is not populated yet, only one request to the server will be made and
* the remaining requests will be fulfilled using the response for the first request.
*
*
* # Response interceptors
*
* Before you start creating interceptors, be sure to understand the
* {@link angular.module.ng.$q $q and deferred/promise APIs}.
*
* For purposes of global error handling, authentication or any kind of synchronous or
* asynchronous preprocessing of received responses, it is desirable to be able to intercept
* responses for http requests before they are handed over to the application code that
* initiated these requests. The response interceptors leverage the {@link angular.module.ng.$q
* promise apis} to fulfil this need for both synchronous and asynchronous preprocessing.
*
* The interceptors are service factories that are registered with the $httpProvider by
* adding them to the `$httpProvider.responseInterceptors` array. The factory is called and
* injected with dependencies (if specified) and returns the interceptor — a function that
* takes a {@link angular.module.ng.$q promise} and returns the original or a new promise.
*
* <pre>
* // register the interceptor as a service
* $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
* return function(promise) {
* return promise.then(function(response) {
* // do something on success
* }, function(response) {
* // do something on error
* if (canRecover(response)) {
* return responseOrNewPromise
* }
* return $q.reject(response);
* });
* }
* });
*
* $httpProvider.responseInterceptors.push('myHttpInterceptor');
*
*
* // register the interceptor via an anonymous factory
* $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {
* return function(promise) {
* // same as above
* }
* });
* </pre>
*
*
* # Security Considerations
*
* When designing web applications, consider security threats from:
*
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability}
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
*
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
* pre-configured with strategies that address these issues, but for this to work backend server
* cooperation is required.
*
* ## JSON Vulnerability Protection
*
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
* JSON Vulnerability} allows third party web-site to turn your JSON resource URL into
* {@link http://en.wikipedia.org/wiki/JSON#JSONP JSONP} request under some conditions. To
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
* Angular will automatically strip the prefix before processing it as JSON.
*
* For example if your server needs to return:
* <pre>
* ['one','two']
* </pre>
*
* which is vulnerable to attack, your server can return:
* <pre>
* )]}',
* ['one','two']
* </pre>
*
* Angular will strip the prefix, before processing the JSON.
*
*
* ## Cross Site Request Forgery (XSRF) Protection
*
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
* an unauthorized site can gain your user's private data. Angular provides following mechanism
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
* called `XSRF-TOKEN` and sets it as the HTTP header `X-XSRF-TOKEN`. Since only JavaScript that
* runs on your domain could read the cookie, your server can be assured that the XHR came from
* JavaScript running on your domain.
*
* To take advantage of this, your server needs to set a token in a JavaScript readable session
* cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the
* server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
* that only JavaScript running on your domain could have read the token. The token must be
* unique for each user and must be verifiable by the server (to prevent the JavaScript making
* up its own tokens). We recommend that the token is a digest of your site's authentication
* cookie with {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}.
*
*
* @param {object} config Object describing the request to be made and how it should be
* processed. The object has following properties:
*
* - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
* - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
* - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned to
* `?key1=value1&key2=value2` after the url. If the value is not a string, it will be JSONified.
* - **data** – `{string|Object}` – Data to be sent as the request message data.
* - **headers** – `{Object}` – Map of strings representing HTTP headers to send to the server.
* - **transformRequest** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* request body and headers and returns its transformed (typically serialized) version.
* - **transformResponse** – `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
* transform function or an array of such functions. The transform function takes the http
* response body and headers and returns its transformed (typically deserialized) version.
* - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
* GET request, otherwise if a cache instance built with
* {@link angular.module.ng.$cacheFactory $cacheFactory}, this cache will be used for
* caching.
* - **timeout** – `{number}` – timeout in milliseconds.
* - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
* requests with credentials} for more information.
*
* @returns {HttpPromise} Returns a {@link angular.module.ng.$q promise} object with the
* standard `then` method and two http specific methods: `success` and `error`. The `then`
* method takes two arguments a success and an error callback which will be called with a
* response object. The `success` and `error` methods take a single argument - a function that
* will be called when the request succeeds or fails respectively. The arguments passed into
* these functions are destructured representation of the response object passed into the
* `then` method. The response object has these properties:
*
* - **data** – `{string|Object}` – The response body transformed with the transform functions.
* - **status** – `{number}` – HTTP status code of the response.
* - **headers** – `{function([headerName])}` – Header getter function.
* - **config** – `{Object}` – The configuration object that was used to generate the request.
*
* @property {Array.<Object>} pendingRequests Array of config objects for currently pending
* requests. This is primarily meant to be used for debugging purposes.
*
*
* @example
<example>
<file name="index.html">
<div ng-controller="FetchCtrl">
<select ng-model="method">
<option>GET</option>
<option>JSONP</option>
</select>
<input type="text" ng-model="url" size="80"/>
<button ng-click="fetch()">fetch</button><br>
<button ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button>
<button ng-click="updateModel('JSONP', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button>
<pre>http status code: {{status}}</pre>
<pre>http response data: {{data}}</pre>
</div>
</file>
<file name="script.js">
function FetchCtrl($scope, $http, $templateCache) {
$scope.method = 'GET';
$scope.url = 'http-hello.html';
$scope.fetch = function() {
$scope.code = null;
$scope.response = null;
$http({method: $scope.method, url: $scope.url, cache: $templateCache}).
success(function(data, status) {
$scope.status = status;
$scope.data = data;
}).
error(function(data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
};
$scope.updateModel = function(method, url) {
$scope.method = method;
$scope.url = url;
};
}
</file>
<file name="http-hello.html">
Hello, $http!
</file>
<file name="scenario.js">
it('should make an xhr GET request', function() {
element(':button:contains("Sample GET")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('200');
expect(binding('data')).toMatch(/Hello, \$http!/);
});
it('should make a JSONP request to angularjs.org', function() {
element(':button:contains("Sample JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('200');
expect(binding('data')).toMatch(/Super Hero!/);
});
it('should make JSONP request to invalid URL and invoke the error handler',
function() {
element(':button:contains("Invalid JSONP")').click();
element(':button:contains("fetch")').click();
expect(binding('status')).toBe('0');
expect(binding('data')).toBe('Request failed');
});
</file>
</example>
*/
function $http(config) {
config.method = uppercase(config.method);
var reqTransformFn = config.transformRequest || $config.transformRequest,
respTransformFn = config.transformResponse || $config.transformResponse,
defHeaders = $config.headers,
reqHeaders = extend({'X-XSRF-TOKEN': $browser.cookies()['XSRF-TOKEN']},
defHeaders.common, defHeaders[lowercase(config.method)], config.headers),
reqData = transformData(config.data, headersGetter(reqHeaders), reqTransformFn),
promise;
// strip content-type if data is undefined
if (isUndefined(config.data)) {
delete reqHeaders['Content-Type'];
}
// send request
promise = sendReq(config, reqData, reqHeaders);
// transform future response
promise = promise.then(transformResponse, transformResponse);
// apply interceptors
forEach(responseInterceptors, function(interceptor) {
promise = interceptor(promise);
});
promise.success = function(fn) {
promise.then(function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
promise.error = function(fn) {
promise.then(null, function(response) {
fn(response.data, response.status, response.headers, config);
});
return promise;
};
return promise;
function transformResponse(response) {
// make a copy since the response must be cacheable
var resp = extend({}, response, {
data: transformData(response.data, response.headers, respTransformFn)
});
return (isSuccess(response.status))
? resp
: $q.reject(resp);
}
}
$http.pendingRequests = [];
/**
* @ngdoc method
* @name angular.module.ng.$http#get
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `GET` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#delete
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `DELETE` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#head
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `HEAD` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#jsonp
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `JSONP` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request.
* Should contain `JSON_CALLBACK` string.
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
createShortMethods('get', 'delete', 'head', 'jsonp');
/**
* @ngdoc method
* @name angular.module.ng.$http#post
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `POST` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
/**
* @ngdoc method
* @name angular.module.ng.$http#put
* @methodOf angular.module.ng.$http
*
* @description
* Shortcut method to perform `PUT` request
*
* @param {string} url Relative or absolute URL specifying the destination of the request
* @param {*} data Request content
* @param {Object=} config Optional configuration object
* @returns {HttpPromise} Future object
*/
createShortMethodsWithData('post', 'put');
/**
* @ngdoc property
* @name angular.module.ng.$http#defaults
* @propertyOf angular.module.ng.$http
*
* @description
* Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
* default headers as well as request and response transformations.
*
* See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.
*/
$http.defaults = $config;
return $http;
function createShortMethods(names) {
forEach(arguments, function(name) {
$http[name] = function(url, config) {
return $http(extend(config || {}, {
method: name,
url: url
}));
};
});
}
function createShortMethodsWithData(name) {
forEach(arguments, function(name) {
$http[name] = function(url, data, config) {
return $http(extend(config || {}, {
method: name,
url: url,
data: data
}));
};
});
}
/**
* Makes the request
*
* !!! ACCESSES CLOSURE VARS:
* $httpBackend, $config, $log, $rootScope, defaultCache, $http.pendingRequests
*/
function sendReq(config, reqData, reqHeaders) {
var deferred = $q.defer(),
promise = deferred.promise,
cache,
cachedResp,
url = buildUrl(config.url, config.params);
$http.pendingRequests.push(config);
promise.then(removePendingReq, removePendingReq);
if (config.cache && config.method == 'GET') {
cache = isObject(config.cache) ? config.cache : defaultCache;
}
if (cache) {
cachedResp = cache.get(url);
if (cachedResp) {
if (cachedResp.then) {
// cached request has already been sent, but there is no response yet
cachedResp.then(removePendingReq, removePendingReq);
return cachedResp;
} else {
// serving from cache
if (isArray(cachedResp)) {
resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2]));
} else {
resolvePromise(cachedResp, 200, {});
}
}
} else {
// put the promise for the non-transformed response into cache as a placeholder
cache.put(url, promise);
}
}
// if we won't have the response in cache, send the request to the backend
if (!cachedResp) {
$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
config.withCredentials);
}
return promise;
/**
* Callback registered to $httpBackend():
* - caches the response if desired
* - resolves the raw $http promise
* - calls $apply
*/
function done(status, response, headersString) {
if (cache) {
if (isSuccess(status)) {
cache.put(url, [status, response, parseHeaders(headersString)]);
} else {
// remove promise from the cache
cache.remove(url);
}
}
resolvePromise(response, status, headersString);
$rootScope.$apply();
}
/**
* Resolves the raw $http promise.
*/
function resolvePromise(response, status, headers) {
// normalize internal statuses to 0
status = Math.max(status, 0);
(isSuccess(status) ? deferred.resolve : deferred.reject)({
data: response,
status: status,
headers: headersGetter(headers),
config: config
});
}
function removePendingReq() {
var idx = indexOf($http.pendingRequests, config);
if (idx !== -1) $http.pendingRequests.splice(idx, 1);
}
}
function buildUrl(url, params) {
if (!params) return url;
var parts = [];
forEachSorted(params, function(value, key) {
if (value == null || value == undefined) return;
if (isObject(value)) {
value = toJson(value);
}
parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
});
return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');
}
}];
}
var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
throw new Error("This browser does not support XMLHttpRequest.");
};
/**
* @ngdoc object
* @name angular.module.ng.$httpBackend
* @requires $browser
* @requires $window
* @requires $document
*
* @description
* HTTP backend used by the {@link angular.module.ng.$http service} that delegates to
* XMLHttpRequest object or JSONP and deals with browser incompatibilities.
*
* You should never need to use this service directly, instead use the higher-level abstractions:
* {@link angular.module.ng.$http $http} or {@link angular.module.ngResource.$resource $resource}.
*
* During testing this implementation is swapped with {@link angular.module.ngMock.$httpBackend mock
* $httpBackend} which can be trained with responses.
*/
function $HttpBackendProvider() {
this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks,
$document[0], $window.location.protocol.replace(':', ''));
}];
}
function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout, withCredentials) {
$browser.$$incOutstandingRequestCount();
url = url || $browser.url();
if (lowercase(method) == 'jsonp') {
var callbackId = '_' + (callbacks.counter++).toString(36);
callbacks[callbackId] = function(data) {
callbacks[callbackId].data = data;
};
jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
function() {
if (callbacks[callbackId].data) {
completeRequest(callback, 200, callbacks[callbackId].data);
} else {
completeRequest(callback, -2);
}
delete callbacks[callbackId];
});
} else {
var xhr = new XHR();
xhr.open(method, url, true);
forEach(headers, function(value, key) {
if (value) xhr.setRequestHeader(key, value);
});
var status;
// In IE6 and 7, this might be called synchronously when xhr.send below is called and the
// response is in the cache. the promise api will ensure that to the app code the api is
// always async
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
completeRequest(
callback, status || xhr.status, xhr.responseText, xhr.getAllResponseHeaders());
}
};
if (withCredentials) {
xhr.withCredentials = true;
}
xhr.send(post || '');
if (timeout > 0) {
$browserDefer(function() {
status = -1;
xhr.abort();
}, timeout);
}
}
function completeRequest(callback, status, response, headersString) {
// URL_MATCH is defined in src/service/location.js
var protocol = (url.match(URL_MATCH) || ['', locationProtocol])[1];
// fix status code for file protocol (it's always 0)
status = (protocol == 'file') ? (response ? 200 : 404) : status;
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
status = status == 1223 ? 204 : status;
callback(status, response, headersString);
$browser.$$completeOutstandingRequest(noop);
}
};
function jsonpReq(url, done) {
// we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:
// - fetches local scripts via XHR and evals them
// - adds and immediately removes script elements from the document
var script = rawDocument.createElement('script'),
doneWrapper = function() {
rawDocument.body.removeChild(script);
if (done) done();
};
script.type = 'text/javascript';
script.src = url;
if (msie) {
script.onreadystatechange = function() {
if (/loaded|complete/.test(script.readyState)) doneWrapper();
};
} else {
script.onload = script.onerror = doneWrapper;
}
rawDocument.body.appendChild(script);
}
}
/**
* @ngdoc object
* @name angular.module.ng.$locale
*
* @description
* $locale service provides localization rules for various Angular components. As of right now the
* only public api is:
*
* * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
*/
function $LocaleProvider(){
this.$get = function() {
return {
id: 'en-us',
NUMBER_FORMATS: {
DECIMAL_SEP: '.',
GROUP_SEP: ',',
PATTERNS: [
{ // Decimal Pattern
minInt: 1,
minFrac: 0,
maxFrac: 3,
posPre: '',
posSuf: '',
negPre: '-',
negSuf: '',
gSize: 3,
lgSize: 3
},{ //Currency Pattern
minInt: 1,
minFrac: 2,
maxFrac: 2,
posPre: '\u00A4',
posSuf: '',
negPre: '(\u00A4',
negSuf: ')',
gSize: 3,
lgSize: 3
}
],
CURRENCY_SYM: '$'
},
DATETIME_FORMATS: {
MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December'
.split(','),
SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
AMPMS: ['AM','PM'],
medium: 'MMM d, y h:mm:ss a',
short: 'M/d/yy h:mm a',
fullDate: 'EEEE, MMMM d, y',
longDate: 'MMMM d, y',
mediumDate: 'MMM d, y',
shortDate: 'M/d/yy',
mediumTime: 'h:mm:ss a',
shortTime: 'h:mm a'
},
pluralCat: function(num) {
if (num === 1) {
return 'one';
}
return 'other';
}
};
};
}
/**
* @ngdoc object
* @name angular.module.ng.$filterProvider
* @description
*
* Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To
* achieve this a filter definition consists of a factory function which is annotated with dependencies and is
* responsible for creating a the filter function.
*
* <pre>
* // Filter registration
* function MyModule($provide, $filterProvider) {
* // create a service to demonstrate injection (not always needed)
* $provide.value('greet', function(name){
* return 'Hello ' + name + '!':
* });
*
* // register a filter factory which uses the
* // greet service to demonstrate DI.
* $filterProvider.register('greet', function(greet){
* // return the filter function which uses the greet service
* // to generate salutation
* return function(text) {
* // filters need to be forgiving so check input validity
* return text && greet(text) || text;
* };
* };
* }
* </pre>
*
* The filter function is registered with the `$injector` under the filter name suffixe with `Filter`.
* <pre>
* it('should be the same instance', inject(
* function($filterProvider) {
* $filterProvider.register('reverse', function(){
* return ...;
* });
* },
* function($filter, reverseFilter) {
* expect($filter('reverse')).toBe(reverseFilter);
* });
* </pre>
*
*
* For more information about how angular filters work, and how to create your own filters, see
* {@link guide/dev_guide.templates.filters Understanding Angular Filters} in the angular Developer
* Guide.
*/
/**
* @ngdoc method
* @name angular.module.ng.$filterProvider#register
* @methodOf angular.module.ng.$filterProvider
* @description
* Register filter factory function.
*
* @param {String} name Name of the filter.
* @param {function} fn The filter factory function which is injectable.
*/
/**
* @ngdoc function
* @name angular.module.ng.$filter
* @function
* @description
* Filters are used for formatting data displayed to the user.
*
* The general syntax in templates is as follows:
*
* {{ expression | [ filter_name ] }}
*
* @param {String} name Name of the filter function to retrieve
* @return {Function} the filter function
*/
$FilterProvider.$inject = ['$provide'];
function $FilterProvider($provide) {
var suffix = 'Filter';
function register(name, factory) {
return $provide.factory(name + suffix, factory);
}
this.register = register;
this.$get = ['$injector', function($injector) {
return function(name) {
return $injector.get(name + suffix);
}
}];
////////////////////////////////////////
register('currency', currencyFilter);
register('date', dateFilter);
register('filter', filterFilter);
register('json', jsonFilter);
register('limitTo', limitToFilter);
register('lowercase', lowercaseFilter);
register('number', numberFilter);
register('orderBy', orderByFilter);
register('uppercase', uppercaseFilter);
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.filter
* @function
*
* @description
* Selects a subset of items from `array` and returns it as a new array.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array The source array.
* @param {string|Object|function()} expression The predicate to be used for selecting items from
* `array`.
*
* Can be one of:
*
* - `string`: Predicate that results in a substring match using the value of `expression`
* string. All strings or objects with string properties in `array` that contain this string
* will be returned. The predicate can be negated by prefixing the string with `!`.
*
* - `Object`: A pattern object can be used to filter specific properties on objects contained
* by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
* which have property `name` containing "M" and property `phone` containing "1". A special
* property name `$` can be used (as in `{$:"text"}`) to accept a match against any
* property of the object. That's equivalent to the simple substring match with a `string`
* as described above.
*
* - `function`: A predicate function can be used to write arbitrary filters. The function is
* called for each element of `array`. The final result is an array of those elements that
* the predicate returned true for.
*
* @example
<doc:example>
<doc:source>
<div ng-init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'}]"></div>
Search: <input ng-model="searchText">
<table id="searchTextResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng-repeat="friend in friends | filter:searchText">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
<hr>
Any: <input ng-model="search.$"> <br>
Name only <input ng-model="search.name"><br>
Phone only <input ng-model="search.phone"å><br>
<table id="searchObjResults">
<tr><th>Name</th><th>Phone</th><tr>
<tr ng-repeat="friend in friends | filter:search">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<tr>
</table>
</doc:source>
<doc:scenario>
it('should search across all fields when filtering with a string', function() {
input('searchText').enter('m');
expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Mike', 'Adam']);
input('searchText').enter('76');
expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')).
toEqual(['John', 'Julie']);
});
it('should search in specific fields when filtering with a predicate object', function() {
input('search.$').enter('i');
expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Mike', 'Julie']);
});
</doc:scenario>
</doc:example>
*/
function filterFilter() {
return function(array, expression) {
if (!(array instanceof Array)) return array;
var predicates = [];
predicates.check = function(value) {
for (var j = 0; j < predicates.length; j++) {
if(!predicates[j](value)) {
return false;
}
}
return true;
};
var search = function(obj, text){
if (text.charAt(0) === '!') {
return !search(obj, text.substr(1));
}
switch (typeof obj) {
case "boolean":
case "number":
case "string":
return ('' + obj).toLowerCase().indexOf(text) > -1;
case "object":
for ( var objKey in obj) {
if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
return true;
}
}
return false;
case "array":
for ( var i = 0; i < obj.length; i++) {
if (search(obj[i], text)) {
return true;
}
}
return false;
default:
return false;
}
};
switch (typeof expression) {
case "boolean":
case "number":
case "string":
expression = {$:expression};
case "object":
for (var key in expression) {
if (key == '$') {
(function() {
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(value, text);
});
})();
} else {
(function() {
var path = key;
var text = (''+expression[key]).toLowerCase();
if (!text) return;
predicates.push(function(value) {
return search(getter(value, path), text);
});
})();
}
}
break;
case 'function':
predicates.push(expression);
break;
default:
return array;
}
var filtered = [];
for ( var j = 0; j < array.length; j++) {
var value = array[j];
if (predicates.check(value)) {
filtered.push(value);
}
}
return filtered;
}
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.currency
* @function
*
* @description
* Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
* symbol for current locale is used.
*
* @param {number} amount Input to filter.
* @param {string=} symbol Currency symbol or identifier to be displayed.
* @returns {string} Formatted number.
*
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.amount = 1234.56;
}
</script>
<div ng-controller="Ctrl">
<input type="number" ng-model="amount"> <br>
default currency symbol ($): {{amount | currency}}<br>
custom currency identifier (USD$): {{amount | currency:"USD$"}}
</div>
</doc:source>
<doc:scenario>
it('should init with 1234.56', function() {
expect(binding('amount | currency')).toBe('$1,234.56');
expect(binding('amount | currency:"USD$"')).toBe('USD$1,234.56');
});
it('should update', function() {
input('amount').enter('-1234');
expect(binding('amount | currency')).toBe('($1,234.00)');
expect(binding('amount | currency:"USD$"')).toBe('(USD$1,234.00)');
});
</doc:scenario>
</doc:example>
*/
currencyFilter.$inject = ['$locale'];
function currencyFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(amount, currencySymbol){
if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;
return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).
replace(/\u00A4/g, currencySymbol);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.number
* @function
*
* @description
* Formats a number as text.
*
* If the input is not a number an empty string is returned.
*
* @param {number|string} number Number to format.
* @param {(number|string)=} [fractionSize=2] Number of decimal places to round the number to.
* @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.val = 1234.56789;
}
</script>
<div ng-controller="Ctrl">
Enter number: <input ng-model='val'><br>
Default formatting: {{val | number}}<br>
No fractions: {{val | number:0}}<br>
Negative number: {{-val | number:4}}
</div>
</doc:source>
<doc:scenario>
it('should format numbers', function() {
expect(binding('val | number')).toBe('1,234.568');
expect(binding('val | number:0')).toBe('1,235');
expect(binding('-val | number:4')).toBe('-1,234.5679');
});
it('should update', function() {
input('val').enter('3374.333');
expect(binding('val | number')).toBe('3,374.333');
expect(binding('val | number:0')).toBe('3,374');
expect(binding('-val | number:4')).toBe('-3,374.3330');
});
</doc:scenario>
</doc:example>
*/
numberFilter.$inject = ['$locale'];
function numberFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(number, fractionSize) {
return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
fractionSize);
};
}
var DECIMAL_SEP = '.';
function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
if (isNaN(number) || !isFinite(number)) return '';
var isNegative = number < 0;
number = Math.abs(number);
var numStr = number + '',
formatedText = '',
parts = [];
if (numStr.indexOf('e') !== -1) {
formatedText = numStr;
} else {
var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
// determine fractionSize if it is not specified
if (isUndefined(fractionSize)) {
fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
}
var pow = Math.pow(10, fractionSize);
number = Math.round(number * pow) / pow;
var fraction = ('' + number).split(DECIMAL_SEP);
var whole = fraction[0];
fraction = fraction[1] || '';
var pos = 0,
lgroup = pattern.lgSize,
group = pattern.gSize;
if (whole.length >= (lgroup + group)) {
pos = whole.length - lgroup;
for (var i = 0; i < pos; i++) {
if ((pos - i)%group === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
}
for (i = pos; i < whole.length; i++) {
if ((whole.length - i)%lgroup === 0 && i !== 0) {
formatedText += groupSep;
}
formatedText += whole.charAt(i);
}
// format fraction part.
while(fraction.length < fractionSize) {
fraction += '0';
}
if (fractionSize) formatedText += decimalSep + fraction.substr(0, fractionSize);
}
parts.push(isNegative ? pattern.negPre : pattern.posPre);
parts.push(formatedText);
parts.push(isNegative ? pattern.negSuf : pattern.posSuf);
return parts.join('');
}
function padNumber(num, digits, trim) {
var neg = '';
if (num < 0) {
neg = '-';
num = -num;
}
num = '' + num;
while(num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
}
function dateGetter(name, size, offset, trim) {
return function(date) {
var value = date['get' + name]();
if (offset > 0 || value > -offset)
value += offset;
if (value === 0 && offset == -12 ) value = 12;
return padNumber(value, size, trim);
};
}
function dateStrGetter(name, shortForm) {
return function(date, formats) {
var value = date['get' + name]();
var get = uppercase(shortForm ? ('SHORT' + name) : name);
return formats[get][value];
};
}
function timeZoneGetter(date) {
var offset = date.getTimezoneOffset();
return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2);
}
function ampmGetter(date, formats) {
return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
}
var DATE_FORMATS = {
yyyy: dateGetter('FullYear', 4),
yy: dateGetter('FullYear', 2, 0, true),
y: dateGetter('FullYear', 1),
MMMM: dateStrGetter('Month'),
MMM: dateStrGetter('Month', true),
MM: dateGetter('Month', 2, 1),
M: dateGetter('Month', 1, 1),
dd: dateGetter('Date', 2),
d: dateGetter('Date', 1),
HH: dateGetter('Hours', 2),
H: dateGetter('Hours', 1),
hh: dateGetter('Hours', 2, -12),
h: dateGetter('Hours', 1, -12),
mm: dateGetter('Minutes', 2),
m: dateGetter('Minutes', 1),
ss: dateGetter('Seconds', 2),
s: dateGetter('Seconds', 1),
EEEE: dateStrGetter('Day'),
EEE: dateStrGetter('Day', true),
a: ampmGetter,
Z: timeZoneGetter
};
var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
NUMBER_STRING = /^\d+$/;
/**
* @ngdoc filter
* @name angular.module.ng.$filter.date
* @function
*
* @description
* Formats `date` to a string based on the requested `format`.
*
* `format` string can be composed of the following elements:
*
* * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
* * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
* * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
* * `'MMMM'`: Month in year (January-December)
* * `'MMM'`: Month in year (Jan-Dec)
* * `'MM'`: Month in year, padded (01-12)
* * `'M'`: Month in year (1-12)
* * `'dd'`: Day in month, padded (01-31)
* * `'d'`: Day in month (1-31)
* * `'EEEE'`: Day in Week,(Sunday-Saturday)
* * `'EEE'`: Day in Week, (Sun-Sat)
* * `'HH'`: Hour in day, padded (00-23)
* * `'H'`: Hour in day (0-23)
* * `'hh'`: Hour in am/pm, padded (01-12)
* * `'h'`: Hour in am/pm, (1-12)
* * `'mm'`: Minute in hour, padded (00-59)
* * `'m'`: Minute in hour (0-59)
* * `'ss'`: Second in minute, padded (00-59)
* * `'s'`: Second in minute (0-59)
* * `'a'`: am/pm marker
* * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-1200)
*
* `format` string can also be one of the following predefined
* {@link guide/dev_guide.i18n localizable formats}:
*
* * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
* (e.g. Sep 3, 2010 12:05:08 pm)
* * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm)
* * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale
* (e.g. Friday, September 3, 2010)
* * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010
* * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)
* * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
* * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm)
* * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm)
*
* `format` string can contain literal values. These need to be quoted with single quotes (e.g.
* `"h 'in the morning'"`). In order to output single quote, use two single quotes in a sequence
* (e.g. `"h o''clock"`).
*
* @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
* number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.SSSZ and it's
* shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ).
* @param {string=} format Formatting rules (see Description). If not specified,
* `mediumDate` is used.
* @returns {string} Formatted string or the input if input is not recognized as date/millis.
*
* @example
<doc:example>
<doc:source>
<span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
{{1288323623006 | date:'medium'}}<br>
<span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br>
<span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br>
</doc:source>
<doc:scenario>
it('should format date', function() {
expect(binding("1288323623006 | date:'medium'")).
toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
expect(binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).
toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} \-?\d{4}/);
expect(binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).
toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
});
</doc:scenario>
</doc:example>
*/
dateFilter.$inject = ['$locale'];
function dateFilter($locale) {
var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
function jsonStringToDate(string){
var match;
if (match = string.match(R_ISO8601_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
if (match[9]) {
tzHour = int(match[9] + match[10]);
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0));
return date;
}
return string;
}
return function(date, format) {
var text = '',
parts = [],
fn, match;
format = format || 'mediumDate';
format = $locale.DATETIME_FORMATS[format] || format;
if (isString(date)) {
if (NUMBER_STRING.test(date)) {
date = int(date);
} else {
date = jsonStringToDate(date);
}
}
if (isNumber(date)) {
date = new Date(date);
}
if (!isDate(date)) {
return date;
}
while(format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = concat(parts, match, 1);
format = parts.pop();
} else {
parts.push(format);
format = null;
}
}
forEach(parts, function(value){
fn = DATE_FORMATS[value];
text += fn ? fn(date, $locale.DATETIME_FORMATS)
: value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
});
return text;
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.json
* @function
*
* @description
* Allows you to convert a JavaScript object into JSON string.
*
* This filter is mostly useful for debugging. When using the double curly {{value}} notation
* the binding is automatically converted to JSON.
*
* @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
* @returns {string} JSON string.
*
*
* @example:
<doc:example>
<doc:source>
<pre>{{ {'name':'value'} | json }}</pre>
</doc:source>
<doc:scenario>
it('should jsonify filtered objects', function() {
expect(binding("{'name':'value'}")).toMatch(/\{\n "name": ?"value"\n}/);
});
</doc:scenario>
</doc:example>
*
*/
function jsonFilter() {
return function(object) {
return toJson(object, true);
};
}
/**
* @ngdoc filter
* @name angular.module.ng.$filter.lowercase
* @function
* @description
* Converts string to lowercase.
* @see angular.lowercase
*/
var lowercaseFilter = valueFn(lowercase);
/**
* @ngdoc filter
* @name angular.module.ng.$filter.uppercase
* @function
* @description
* Converts string to uppercase.
* @see angular.uppercase
*/
var uppercaseFilter = valueFn(uppercase);
/**
* @ngdoc function
* @name angular.module.ng.$filter.limitTo
* @function
*
* @description
* Creates a new array containing only a specified number of elements in an array. The elements
* are taken from either the beginning or the end of the source array, as specified by the
* value and sign (positive or negative) of `limit`.
*
* Note: This function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more information about Angular arrays.
*
* @param {Array} array Source array to be limited.
* @param {string|Number} limit The length of the returned array. If the `limit` number is
* positive, `limit` number of items from the beginning of the source array are copied.
* If the number is negative, `limit` number of items from the end of the source array are
* copied. The `limit` will be trimmed if it exceeds `array.length`
* @returns {Array} A new sub-array of length `limit` or less if input array had less than `limit`
* elements.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.numbers = [1,2,3,4,5,6,7,8,9];
$scope.limit = 3;
}
</script>
<div ng-controller="Ctrl">
Limit {{numbers}} to: <input type="integer" ng-model="limit">
<p>Output: {{ numbers | limitTo:limit }}</p>
</div>
</doc:source>
<doc:scenario>
it('should limit the numer array to first three items', function() {
expect(element('.doc-example-live input[ng-model=limit]').val()).toBe('3');
expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3]');
});
it('should update the output when -3 is entered', function() {
input('limit').enter(-3);
expect(binding('numbers | limitTo:limit')).toEqual('[7,8,9]');
});
it('should not exceed the maximum size of input array', function() {
input('limit').enter(100);
expect(binding('numbers | limitTo:limit')).toEqual('[1,2,3,4,5,6,7,8,9]');
});
</doc:scenario>
</doc:example>
*/
function limitToFilter(){
return function(array, limit) {
if (!(array instanceof Array)) return array;
limit = int(limit);
var out = [],
i, n;
// check that array is iterable
if (!array || !(array instanceof Array))
return out;
// if abs(limit) exceeds maximum length, trim it
if (limit > array.length)
limit = array.length;
else if (limit < -array.length)
limit = -array.length;
if (limit > 0) {
i = 0;
n = limit;
} else {
i = array.length + limit;
n = array.length;
}
for (; i<n; i++) {
out.push(array[i]);
}
return out;
}
}
/**
* @ngdoc function
* @name angular.module.ng.$filter.orderBy
* @function
*
* @description
* Orders a specified `array` by the `expression` predicate.
*
* Note: this function is used to augment the `Array` type in Angular expressions. See
* {@link angular.module.ng.$filter} for more informaton about Angular arrays.
*
* @param {Array} array The array to sort.
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
* used by the comparator to determine the order of elements.
*
* Can be one of:
*
* - `function`: Getter function. The result of this function will be sorted using the
* `<`, `=`, `>` operator.
* - `string`: An Angular expression which evaluates to an object to order by, such as 'name'
* to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control
* ascending or descending sort order (for example, +name or -name).
* - `Array`: An array of function or string predicates. The first predicate in the array
* is used for sorting, but when two items are equivalent, the next predicate is used.
*
* @param {boolean=} reverse Reverse the order the array.
* @returns {Array} Sorted copy of the source array.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.friends =
[{name:'John', phone:'555-1212', age:10},
{name:'Mary', phone:'555-9876', age:19},
{name:'Mike', phone:'555-4321', age:21},
{name:'Adam', phone:'555-5678', age:35},
{name:'Julie', phone:'555-8765', age:29}]
$scope.predicate = '-age';
}
</script>
<div ng-controller="Ctrl">
<pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
<hr/>
[ <a href="" ng-click="predicate=''">unsorted</a> ]
<table class="friend">
<tr>
<th><a href="" ng-click="predicate = 'name'; reverse=false">Name</a>
(<a href ng-click="predicate = '-name'; reverse=false">^</a>)</th>
<th><a href="" ng-click="predicate = 'phone'; reverse=!reverse">Phone Number</a></th>
<th><a href="" ng-click="predicate = 'age'; reverse=!reverse">Age</a></th>
<tr>
<tr ng-repeat="friend in friends | orderBy:predicate:reverse">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.age}}</td>
<tr>
</table>
</div>
</doc:source>
<doc:scenario>
it('should be reverse ordered by aged', function() {
expect(binding('predicate')).toBe('-age');
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '29', '21', '19', '10']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']);
});
it('should reorder the table when user selects different predicate', function() {
element('.doc-example-live a:contains("Name")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']);
expect(repeater('table.friend', 'friend in friends').column('friend.age')).
toEqual(['35', '10', '29', '19', '21']);
element('.doc-example-live a:contains("Phone")').click();
expect(repeater('table.friend', 'friend in friends').column('friend.phone')).
toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']);
expect(repeater('table.friend', 'friend in friends').column('friend.name')).
toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']);
});
</doc:scenario>
</doc:example>
*/
orderByFilter.$inject = ['$parse'];
function orderByFilter($parse){
return function(array, sortPredicate, reverseOrder) {
if (!(array instanceof Array)) return array;
if (!sortPredicate) return array;
sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
sortPredicate = map(sortPredicate, function(predicate){
var descending = false, get = predicate || identity;
if (isString(predicate)) {
if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
descending = predicate.charAt(0) == '-';
predicate = predicate.substring(1);
}
get = $parse(predicate);
}
return reverseComparator(function(a,b){
return compare(get(a),get(b));
}, descending);
});
var arrayCopy = [];
for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
return arrayCopy.sort(reverseComparator(comparator, reverseOrder));
function comparator(o1, o2){
for ( var i = 0; i < sortPredicate.length; i++) {
var comp = sortPredicate[i](o1, o2);
if (comp !== 0) return comp;
}
return 0;
}
function reverseComparator(comp, descending) {
return toBoolean(descending)
? function(a,b){return comp(b,a);}
: comp;
}
function compare(v1, v2){
var t1 = typeof v1;
var t2 = typeof v2;
if (t1 == t2) {
if (t1 == "string") v1 = v1.toLowerCase();
if (t1 == "string") v2 = v2.toLowerCase();
if (v1 === v2) return 0;
return v1 < v2 ? -1 : 1;
} else {
return t1 < t2 ? -1 : 1;
}
}
}
}
function ngDirective(directive) {
if (isFunction(directive)) {
directive = {
link: directive
}
}
directive.restrict = directive.restrict || 'AC';
return valueFn(directive);
}
/*
* Modifies the default behavior of html A tag, so that the default action is prevented when href
* attribute is empty.
*
* The reasoning for this change is to allow easy creation of action links with `ngClick` directive
* without changing the location or causing page reloads, e.g.:
* <a href="" ng-click="model.$save()">Save</a>
*/
var htmlAnchorDirective = valueFn({
restrict: 'E',
compile: function(element, attr) {
// turn <a href ng-click="..">link</a> into a link in IE
// but only if it doesn't have name attribute, in which case it's an anchor
if (!attr.href) {
attr.$set('href', '');
}
return function(scope, element) {
element.bind('click', function(event){
// if we have no href url, then don't navigate anywhere.
if (!element.attr('href')) {
event.preventDefault();
}
});
}
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngHref
* @restrict A
*
* @description
* Using Angular markup like {{hash}} in an href attribute makes
* the page open to a wrong URL, if the user clicks that link before
* angular has a chance to replace the {{hash}} with actual URL, the
* link will be broken and will most likely return a 404 error.
* The `ngHref` directive solves this problem.
*
* The buggy way to write it:
* <pre>
* <a href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <a ng-href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element A
* @param {template} ngHref any string which can contain `{{}}` markup.
*
* @example
* This example uses `link` variable inside `href` attribute:
<doc:example>
<doc:source>
<input ng-model="value" /><br />
<a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
<a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
<a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
<a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
<a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
<a id="link-6" ng-href="{{value}}">link</a> (link, change location)
</doc:source>
<doc:scenario>
it('should execute ng-click but not reload when href without value', function() {
element('#link-1').click();
expect(input('value').val()).toEqual('1');
expect(element('#link-1').attr('href')).toBe("");
});
it('should execute ng-click but not reload when href empty string', function() {
element('#link-2').click();
expect(input('value').val()).toEqual('2');
expect(element('#link-2').attr('href')).toBe("");
});
it('should execute ng-click and change url when ng-href specified', function() {
expect(element('#link-3').attr('href')).toBe("/123");
element('#link-3').click();
expect(browser().window().path()).toEqual('/123');
});
it('should execute ng-click but not reload when href empty string and name specified', function() {
element('#link-4').click();
expect(input('value').val()).toEqual('4');
expect(element('#link-4').attr('href')).toBe('');
});
it('should execute ng-click but not reload when no href but name specified', function() {
element('#link-5').click();
expect(input('value').val()).toEqual('5');
expect(element('#link-5').attr('href')).toBe('');
});
it('should only change url when only ng-href', function() {
input('value').enter('6');
expect(element('#link-6').attr('href')).toBe('6');
element('#link-6').click();
expect(browser().location().url()).toEqual('/6');
});
</doc:scenario>
</doc:example>
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngSrc
* @restrict A
*
* @description
* Using Angular markup like `{{hash}}` in a `src` attribute doesn't
* work right: The browser will fetch from the URL with the literal
* text `{{hash}}` until Angular replaces the expression inside
* `{{hash}}`. The `ngSrc` directive solves this problem.
*
* The buggy way to write it:
* <pre>
* <img src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* The correct way to write it:
* <pre>
* <img ng-src="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre>
*
* @element IMG
* @param {template} ngSrc any string which can contain `{{}}` markup.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngDisabled
* @restrict A
*
* @description
*
* The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
* <pre>
* <div ng-init="scope = { isDisabled: false }">
* <button disabled="{{scope.isDisabled}}">Disabled</button>
* </div>
* </pre>
*
* The HTML specs do not require browsers to preserve the special attributes such as disabled.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce the `ngDisabled` directive.
*
* @example
<doc:example>
<doc:source>
Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
<button ng-model="button" ng-disabled="checked">Button</button>
</doc:source>
<doc:scenario>
it('should toggle button', function() {
expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {expression} ngDisabled Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngChecked
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as checked.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce the `ngChecked` directive.
* @example
<doc:example>
<doc:source>
Check me to check both: <input type="checkbox" ng-model="master"><br/>
<input id="checkSlave" type="checkbox" ng-checked="master">
</doc:source>
<doc:scenario>
it('should check both checkBoxes', function() {
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy();
input('master').check();
expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {expression} ngChecked Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMultiple
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as multiple.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce the `ngMultiple` directive.
*
* @example
<doc:example>
<doc:source>
Check me check multiple: <input type="checkbox" ng-model="checked"><br/>
<select id="select" ng-multiple="checked">
<option>Misko</option>
<option>Igor</option>
<option>Vojta</option>
<option>Di</option>
</select>
</doc:source>
<doc:scenario>
it('should toggle multiple', function() {
expect(element('.doc-example-live #select').prop('multiple')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live #select').prop('multiple')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element SELECT
* @param {expression} ngMultiple Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngReadonly
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as readonly.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduce the `ngReadonly` directive.
* @example
<doc:example>
<doc:source>
Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
<input type="text" ng-readonly="checked" value="I'm Angular"/>
</doc:source>
<doc:scenario>
it('should toggle readonly attr', function() {
expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy();
input('checked').check();
expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element INPUT
* @param {string} expression Angular expression that will be evaluated.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngSelected
* @restrict A
*
* @description
* The HTML specs do not require browsers to preserve the special attributes such as selected.
* (The presence of them means true and absence means false)
* This prevents the angular compiler from correctly retrieving the binding expression.
* To solve this problem, we introduced the `ngSelected` directive.
* @example
<doc:example>
<doc:source>
Check me to select: <input type="checkbox" ng-model="selected"><br/>
<select>
<option>Hello!</option>
<option id="greet" ng-selected="selected">Greetings!</option>
</select>
</doc:source>
<doc:scenario>
it('should select Greetings!', function() {
expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy();
input('selected').check();
expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy();
});
</doc:scenario>
</doc:example>
*
* @element OPTION
* @param {string} expression Angular expression that will be evaluated.
*/
var ngAttributeAliasDirectives = {};
// boolean attrs are evaluated
forEach(BOOLEAN_ATTR, function(propName, attrName) {
var normalized = directiveNormalize('ng-' + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 100,
compile: function() {
return function(scope, element, attr) {
attr.$$observers[attrName] = [];
scope.$watch(attr[normalized], function(value) {
attr.$set(attrName, !!value);
});
};
}
};
};
});
// ng-src, ng-href are interpolated
forEach(['src', 'href'], function(attrName) {
var normalized = directiveNormalize('ng-' + attrName);
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 99, // it needs to run after the attributes are interpolated
compile: function() {
return function(scope, element, attr) {
var value = attr[normalized];
if (value == undefined) {
// undefined value means that the directive is being interpolated
// so just register observer
attr.$$observers[attrName] = [];
attr.$observe(normalized, function(value) {
attr.$set(attrName, value);
// on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist
// then calling element.setAttribute('src', 'foo') doesn't do anything, so we need
// to set the property as well to achieve the desired effect
if (msie) element.prop(attrName, value);
});
} else {
// value present means that no interpolation, so copy to native attribute.
attr.$set(attrName, value);
element.prop(attrName, value);
}
};
}
};
};
});
var nullFormCtrl = {
$addControl: noop,
$removeControl: noop,
$setValidity: noop,
$setDirty: noop
};
/**
* @ngdoc object
* @name angular.module.ng.$compileProvider.directive.form.FormController
*
* @property {boolean} $pristine True if user has not interacted with the form yet.
* @property {boolean} $dirty True if user has already interacted with the form.
* @property {boolean} $valid True if all of the containg forms and controls are valid.
* @property {boolean} $invalid True if at least one containing control or form is invalid.
*
* @property {Object} $error Is an object hash, containing references to all invalid controls or
* forms, where:
*
* - keys are validation tokens (error names) — such as `REQUIRED`, `URL` or `EMAIL`),
* - values are arrays of controls or forms that are invalid with given error.
*
* @description
* `FormController` keeps track of all its controls and nested forms as well as state of them,
* such as being valid/invalid or dirty/pristine.
*
* Each {@link angular.module.ng.$compileProvider.directive.form form} directive creates an instance
* of `FormController`.
*
*/
//asks for $scope to fool the BC controller module
FormController.$inject = ['$element', '$attrs', '$scope'];
function FormController(element, attrs) {
var form = this,
parentForm = element.parent().controller('form') || nullFormCtrl,
invalidCount = 0, // used to easily determine if we are valid
errors = form.$error = {};
// init state
form.$name = attrs.name;
form.$dirty = false;
form.$pristine = true;
form.$valid = true;
form.$invalid = false;
parentForm.$addControl(form);
// Setup initial state of the control
element.addClass(PRISTINE_CLASS);
toggleValidCss(true);
// convenience method for easy toggling of classes
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
element.
removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).
addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
}
form.$addControl = function(control) {
if (control.$name && !form.hasOwnProperty(control.$name)) {
form[control.$name] = control;
}
};
form.$removeControl = function(control) {
if (control.$name && form[control.$name] === control) {
delete form[control.$name];
}
forEach(errors, function(queue, validationToken) {
form.$setValidity(validationToken, true, control);
});
};
form.$setValidity = function(validationToken, isValid, control) {
var queue = errors[validationToken];
if (isValid) {
if (queue) {
arrayRemove(queue, control);
if (!queue.length) {
invalidCount--;
if (!invalidCount) {
toggleValidCss(isValid);
form.$valid = true;
form.$invalid = false;
}
errors[validationToken] = false;
toggleValidCss(true, validationToken);
parentForm.$setValidity(validationToken, true, form);
}
}
} else {
if (!invalidCount) {
toggleValidCss(isValid);
}
if (queue) {
if (includes(queue, control)) return;
} else {
errors[validationToken] = queue = [];
invalidCount++;
toggleValidCss(false, validationToken);
parentForm.$setValidity(validationToken, false, form);
}
queue.push(control);
form.$valid = false;
form.$invalid = true;
}
};
form.$setDirty = function() {
element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);
form.$dirty = true;
form.$pristine = false;
};
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngForm
* @restrict EAC
*
* @description
* Nestable alias of {@link angular.module.ng.$compileProvider.directive.form `form`} directive. HTML
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
* sub-group of controls needs to be determined.
*
* @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
* related scope, under this name.
*
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.form
* @restrict E
*
* @description
* Directive that instantiates
* {@link angular.module.ng.$compileProvider.directive.form.FormController FormController}.
*
* If `name` attribute is specified, the form controller is published onto the current scope under
* this name.
*
* # Alias: {@link angular.module.ng.$compileProvider.directive.ngForm `ngForm`}
*
* In angular forms can be nested. This means that the outer form is valid when all of the child
* forms are valid as well. However browsers do not allow nesting of `<form>` elements, for this
* reason angular provides {@link angular.module.ng.$compileProvider.directive.ngForm `ngForm`} alias
* which behaves identical to `<form>` but allows form nesting.
*
*
* # CSS classes
* - `ng-valid` Is set if the form is valid.
* - `ng-invalid` Is set if the form is invalid.
* - `ng-pristine` Is set if the form is pristine.
* - `ng-dirty` Is set if the form is dirty.
*
*
* # Submitting a form and preventing default action
*
* Since the role of forms in client-side Angular applications is different than in classical
* roundtrip apps, it is desirable for the browser not to translate the form submission into a full
* page reload that sends the data to the server. Instead some javascript logic should be triggered
* to handle the form submission in application specific way.
*
* For this reason, Angular prevents the default action (form submission to the server) unless the
* `<form>` element has an `action` attribute specified.
*
* You can use one of the following two ways to specify what javascript method should be called when
* a form is submitted:
*
* - {@link angular.module.ng.$compileProvider.directive.ngSubmit ngSubmit} directive on the form element
* - {@link angular.module.ng.$compileProvider.directive.ngClick ngClick} directive on the first
* button or input field of type submit (input[type=submit])
*
* To prevent double execution of the handler, use only one of ngSubmit or ngClick directives. This
* is because of the following form submission rules coming from the html spec:
*
* - If a form has only one input field then hitting enter in this field triggers form submit
* (`ngSubmit`)
* - if a form has has 2+ input fields and no buttons or input[type=submit] then hitting enter
* doesn't trigger submit
* - if a form has one or more input fields and one or more buttons or input[type=submit] then
* hitting enter in any of the input fields will trigger the click handler on the *first* button or
* input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)
*
* @param {string=} name Name of the form. If specified, the form controller will be published into
* related scope, under this name.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.userType = 'guest';
}
</script>
<form name="myForm" ng-controller="Ctrl">
userType: <input name="input" ng-model="userType" required>
<span class="error" ng-show="myForm.input.$error.REQUIRED">Required!</span><br>
<tt>userType = {{userType}}</tt><br>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('userType')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('userType').enter('');
expect(binding('userType')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var formDirectiveDir = {
name: 'form',
restrict: 'E',
controller: FormController,
compile: function() {
return {
pre: function(scope, formElement, attr, controller) {
if (!attr.action) {
formElement.bind('submit', function(event) {
event.preventDefault();
});
}
var parentFormCtrl = formElement.parent().controller('form'),
alias = attr.name || attr.ngForm;
if (alias) {
scope[alias] = controller;
}
if (parentFormCtrl) {
formElement.bind('$destroy', function() {
parentFormCtrl.$removeControl(controller);
if (alias) {
scope[alias] = undefined;
}
extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards
});
}
}
};
}
};
var formDirective = valueFn(formDirectiveDir);
var ngFormDirective = valueFn(extend(copy(formDirectiveDir), {restrict: 'EAC'}));
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
var inputType = {
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.text
*
* @description
* Standard HTML text input with angular data binding.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = 'guest';
$scope.word = /^\w*$/;
}
</script>
<form name="myForm" ng-controller="Ctrl">
Single word: <input type="text" name="input" ng-model="text"
ng-pattern="word" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.pattern">
Single word only!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if multi word', function() {
input('text').enter('hello world');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'text': textInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.number
*
* @description
* Text input with number validation and transformation. Sets the `number` validation
* error if not a valid number.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} min Sets the `min` validation error key if the value entered is less then `min`.
* @param {string=} max Sets the `max` validation error key if the value entered is greater then `min`.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.value = 12;
}
</script>
<form name="myForm" ng-controller="Ctrl">
Number: <input type="number" name="input" ng-model="value"
min="0" max="99" required>
<span class="error" ng-show="myForm.list.$error.required">
Required!</span>
<span class="error" ng-show="myForm.list.$error.number">
Not valid number!</span>
<tt>value = {{value}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('value').enter('');
expect(binding('value')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if over max', function() {
input('value').enter('123');
expect(binding('value')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'number': numberInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.url
*
* @description
* Text input with URL validation. Sets the `url` validation error key if the content is not a
* valid URL.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = 'http://google.com';
}
</script>
<form name="myForm" ng-controller="Ctrl">
URL: <input type="url" name="input" ng-model="text" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.url">
Not valid url!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
<tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('http://google.com');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not url', function() {
input('text').enter('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'url': urlInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.email
*
* @description
* Text input with email validation. Sets the `email` validation error key if not a valid email
* address.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.text = '[email protected]';
}
</script>
<form name="myForm" ng-controller="Ctrl">
Email: <input type="email" name="input" ng-model="text" required>
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.email">
Not valid email!</span>
<tt>text = {{text}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
<tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('text')).toEqual('[email protected]');
expect(binding('myForm.input.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('text').enter('');
expect(binding('text')).toEqual('');
expect(binding('myForm.input.$valid')).toEqual('false');
});
it('should be invalid if not email', function() {
input('text').enter('xxx');
expect(binding('myForm.input.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
'email': emailInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.radio
*
* @description
* HTML radio button.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string} value The value to which the expression should be set when selected.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.color = 'blue';
}
</script>
<form name="myForm" ng-controller="Ctrl">
<input type="radio" ng-model="color" value="red"> Red <br/>
<input type="radio" ng-model="color" value="green"> Green <br/>
<input type="radio" ng-model="color" value="blue"> Blue <br/>
<tt>color = {{color}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('color')).toEqual('blue');
input('color').select('red');
expect(binding('color')).toEqual('red');
});
</doc:scenario>
</doc:example>
*/
'radio': radioInputType,
/**
* @ngdoc inputType
* @name angular.module.ng.$compileProvider.directive.input.checkbox
*
* @description
* HTML checkbox.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} ngTrueValue The value to which the expression should be set when selected.
* @param {string=} ngFalseValue The value to which the expression should be set when not selected.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.value1 = true;
$scope.value2 = 'YES'
}
</script>
<form name="myForm" ng-controller="Ctrl">
Value1: <input type="checkbox" ng-model="value1"> <br/>
Value2: <input type="checkbox" ng-model="value2"
ng-true-value="YES" ng-false-value="NO"> <br/>
<tt>value1 = {{value1}}</tt><br/>
<tt>value2 = {{value2}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should change state', function() {
expect(binding('value1')).toEqual('true');
expect(binding('value2')).toEqual('YES');
input('value1').check();
input('value2').check();
expect(binding('value1')).toEqual('false');
expect(binding('value2')).toEqual('NO');
});
</doc:scenario>
</doc:example>
*/
'checkbox': checkboxInputType,
'hidden': noop,
'button': noop,
'submit': noop,
'reset': noop
};
function isEmpty(value) {
return isUndefined(value) || value === '' || value === null || value !== value;
}
function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
var listener = function() {
var value = trim(element.val());
if (ctrl.$viewValue !== value) {
scope.$apply(function() {
ctrl.$setViewValue(value);
});
}
};
// if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the
// input event on backspace, delete or cut
if ($sniffer.hasEvent('input')) {
element.bind('input', listener);
} else {
var timeout;
element.bind('keydown', function(event) {
var key = event.keyCode;
// ignore
// command modifiers arrows
if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
if (!timeout) {
timeout = $browser.defer(function() {
listener();
timeout = null;
});
}
});
// if user paste into input using mouse, we need "change" event to catch it
element.bind('change', listener);
}
ctrl.$render = function() {
element.val(isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);
};
// pattern validator
var pattern = attr.ngPattern,
patternValidator;
var validate = function(regexp, value) {
if (isEmpty(value) || regexp.test(value)) {
ctrl.$setValidity('pattern', true);
return value;
} else {
ctrl.$setValidity('pattern', false);
return undefined;
}
};
if (pattern) {
if (pattern.match(/^\/(.*)\/$/)) {
pattern = new RegExp(pattern.substr(1, pattern.length - 2));
patternValidator = function(value) {
return validate(pattern, value)
};
} else {
patternValidator = function(value) {
var patternObj = scope.$eval(pattern);
if (!patternObj || !patternObj.test) {
throw new Error('Expected ' + pattern + ' to be a RegExp but was ' + patternObj);
}
return validate(patternObj, value);
};
}
ctrl.$formatters.push(patternValidator);
ctrl.$parsers.push(patternValidator);
}
// min length validator
if (attr.ngMinlength) {
var minlength = int(attr.ngMinlength);
var minLengthValidator = function(value) {
if (!isEmpty(value) && value.length < minlength) {
ctrl.$setValidity('minlength', false);
return undefined;
} else {
ctrl.$setValidity('minlength', true);
return value;
}
};
ctrl.$parsers.push(minLengthValidator);
ctrl.$formatters.push(minLengthValidator);
}
// max length validator
if (attr.ngMaxlength) {
var maxlength = int(attr.ngMaxlength);
var maxLengthValidator = function(value) {
if (!isEmpty(value) && value.length > maxlength) {
ctrl.$setValidity('maxlength', false);
return undefined;
} else {
ctrl.$setValidity('maxlength', true);
return value;
}
};
ctrl.$parsers.push(maxLengthValidator);
ctrl.$formatters.push(maxLengthValidator);
}
}
function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
ctrl.$parsers.push(function(value) {
var empty = isEmpty(value);
if (empty || NUMBER_REGEXP.test(value)) {
ctrl.$setValidity('number', true);
return value === '' ? null : (empty ? value : parseFloat(value));
} else {
ctrl.$setValidity('number', false);
return undefined;
}
});
ctrl.$formatters.push(function(value) {
return isEmpty(value) ? '' : '' + value;
});
if (attr.min) {
var min = parseFloat(attr.min);
var minValidator = function(value) {
if (!isEmpty(value) && value < min) {
ctrl.$setValidity('min', false);
return undefined;
} else {
ctrl.$setValidity('min', true);
return value;
}
};
ctrl.$parsers.push(minValidator);
ctrl.$formatters.push(minValidator);
}
if (attr.max) {
var max = parseFloat(attr.max);
var maxValidator = function(value) {
if (!isEmpty(value) && value > max) {
ctrl.$setValidity('max', false);
return undefined;
} else {
ctrl.$setValidity('max', true);
return value;
}
};
ctrl.$parsers.push(maxValidator);
ctrl.$formatters.push(maxValidator);
}
ctrl.$formatters.push(function(value) {
if (isEmpty(value) || isNumber(value)) {
ctrl.$setValidity('number', true);
return value;
} else {
ctrl.$setValidity('number', false);
return undefined;
}
});
}
function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var urlValidator = function(value) {
if (isEmpty(value) || URL_REGEXP.test(value)) {
ctrl.$setValidity('url', true);
return value;
} else {
ctrl.$setValidity('url', false);
return undefined;
}
};
ctrl.$formatters.push(urlValidator);
ctrl.$parsers.push(urlValidator);
}
function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var emailValidator = function(value) {
if (isEmpty(value) || EMAIL_REGEXP.test(value)) {
ctrl.$setValidity('email', true);
return value;
} else {
ctrl.$setValidity('email', false);
return undefined;
}
};
ctrl.$formatters.push(emailValidator);
ctrl.$parsers.push(emailValidator);
}
function radioInputType(scope, element, attr, ctrl) {
// make the name unique, if not defined
if (isUndefined(attr.name)) {
element.attr('name', nextUid());
}
element.bind('click', function() {
if (element[0].checked) {
scope.$apply(function() {
ctrl.$setViewValue(attr.value);
});
}
});
ctrl.$render = function() {
var value = attr.value;
element[0].checked = (value == ctrl.$viewValue);
};
attr.$observe('value', ctrl.$render);
}
function checkboxInputType(scope, element, attr, ctrl) {
var trueValue = attr.ngTrueValue,
falseValue = attr.ngFalseValue;
if (!isString(trueValue)) trueValue = true;
if (!isString(falseValue)) falseValue = false;
element.bind('click', function() {
scope.$apply(function() {
ctrl.$setViewValue(element[0].checked);
});
});
ctrl.$render = function() {
element[0].checked = ctrl.$viewValue;
};
ctrl.$formatters.push(function(value) {
return value === trueValue;
});
ctrl.$parsers.push(function(value) {
return value ? trueValue : falseValue;
});
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.textarea
*
* @description
* HTML textarea element control with angular data-binding. The data-binding and validation
* properties of this element are exactly the same as those of the
* {@link angular.module.ng.$compileProvider.directive.input input element}.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.input
* @restrict E
*
* @description
* HTML input element control with angular data-binding. Input control follows HTML5 input types
* and polyfills the HTML5 validation behavior for older browsers.
*
* @param {string} ngModel Assignable angular expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
* @param {string=} required Sets `required` validation error key if the value is not entered.
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
* minlength.
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
* maxlength.
* @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
* RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
* patterns defined as scope expressions.
* @param {string=} ngChange Angular expression to be executed when input changes due to user
* interaction with the input element.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.user = {name: 'guest', last: 'visitor'};
}
</script>
<div ng-controller="Ctrl">
<form name="myForm">
User name: <input type="text" name="userName" ng-model="user.name" required>
<span class="error" ng-show="myForm.userName.$error.required">
Required!</span><br>
Last name: <input type="text" name="lastName" ng-model="user.last"
ng-minlength="3" ng-maxlength="10">
<span class="error" ng-show="myForm.lastName.$error.minlength">
Too short!</span>
<span class="error" ng-show="myForm.lastName.$error.maxlength">
Too long!</span><br>
</form>
<hr>
<tt>user = {{user}}</tt><br/>
<tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>
<tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>
<tt>myForm.userName.$error = {{myForm.lastName.$error}}</tt><br>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
<tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br>
<tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br>
</div>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if empty when required', function() {
input('user.name').enter('');
expect(binding('user')).toEqual('{"last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('false');
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be valid if empty when min length is set', function() {
input('user.last').enter('');
expect(binding('user')).toEqual('{"name":"guest","last":""}');
expect(binding('myForm.lastName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
it('should be invalid if less than required min length', function() {
input('user.last').enter('xx');
expect(binding('user')).toEqual('{"name":"guest"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/minlength/);
expect(binding('myForm.$valid')).toEqual('false');
});
it('should be invalid if longer than max length', function() {
input('user.last').enter('some ridiculously long name');
expect(binding('user'))
.toEqual('{"name":"guest"}');
expect(binding('myForm.lastName.$valid')).toEqual('false');
expect(binding('myForm.lastName.$error')).toMatch(/maxlength/);
expect(binding('myForm.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) {
return {
restrict: 'E',
require: '?ngModel',
link: function(scope, element, attr, ctrl) {
if (ctrl) {
(inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer,
$browser);
}
}
};
}];
var VALID_CLASS = 'ng-valid',
INVALID_CLASS = 'ng-invalid',
PRISTINE_CLASS = 'ng-pristine',
DIRTY_CLASS = 'ng-dirty';
/**
* @ngdoc object
* @name angular.module.ng.$compileProvider.directive.ngModel.NgModelController
*
* @property {string} $viewValue Actual string value in the view.
* @property {*} $modelValue The value in the model, that the control is bound to.
* @property {Array.<Function>} $parsers Whenever the control reads value from the DOM, it executes
* all of these functions to sanitize / convert the value as well as validate.
*
* @property {Array.<Function>} $formatters Whenever the model value changes, it executes all of
* these functions to convert the value as well as validate.
*
* @property {Object} $error An bject hash with all errors as keys.
*
* @property {boolean} $pristine True if user has not interacted with the control yet.
* @property {boolean} $dirty True if user has already interacted with the control.
* @property {boolean} $valid True if there is no error.
* @property {boolean} $invalid True if at least one error on the control.
*
* @description
*
*/
var NgModelController = ['$scope', '$exceptionHandler', '$attrs', 'ngModel', '$element',
function($scope, $exceptionHandler, $attr, ngModel, $element) {
this.$viewValue = Number.NaN;
this.$modelValue = Number.NaN;
this.$parsers = [];
this.$formatters = [];
this.$viewChangeListeners = [];
this.$pristine = true;
this.$dirty = false;
this.$valid = true;
this.$invalid = false;
this.$render = noop;
this.$name = $attr.name;
var parentForm = $element.inheritedData('$formController') || nullFormCtrl,
invalidCount = 0, // used to easily determine if we are valid
$error = this.$error = {}; // keep invalid keys here
// Setup initial state of the control
$element.addClass(PRISTINE_CLASS);
toggleValidCss(true);
// convenience method for easy toggling of classes
function toggleValidCss(isValid, validationErrorKey) {
validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
$element.
removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey).
addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
}
/**
* @ngdoc function
* @name angular.module.ng.$compileProvider.directive.ngModel.NgModelController#$setValidity
* @methodOf angular.module.ng.$compileProvider.directive.ngModel.NgModelController
*
* @description
* Change the validity state, and notifies the form when the control changes validity. (i.e. it
* does not notify form if given validator is already marked as invalid).
*
* This method should be called by validators - i.e. the parser or formatter functions.
*
* @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign
* to `$error[validationErrorKey]=isValid` so that it is available for data-binding.
* The `validationErrorKey` should be in camelCase and will get converted into dash-case
* for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
* class and can be bound to as `{{someForm.someControl.$error.myError}}` .
* @param {boolean} isValid Whether the current state is valid (true) or invalid (false).
*/
this.$setValidity = function(validationErrorKey, isValid) {
if ($error[validationErrorKey] === !isValid) return;
if (isValid) {
if ($error[validationErrorKey]) invalidCount--;
if (!invalidCount) {
toggleValidCss(true);
this.$valid = true;
this.$invalid = false;
}
} else {
toggleValidCss(false);
this.$invalid = true;
this.$valid = false;
invalidCount++;
}
$error[validationErrorKey] = !isValid;
toggleValidCss(isValid, validationErrorKey);
parentForm.$setValidity(validationErrorKey, isValid, this);
};
/**
* @ngdoc function
* @name angular.module.ng.$compileProvider.directive.ngModel.NgModelController#$setViewValue
* @methodOf angular.module.ng.$compileProvider.directive.ngModel.NgModelController
*
* @description
* Read a value from view.
*
* This method should be called from within a DOM event handler.
* For example {@link angular.module.ng.$compileProvider.directive.input input} or
* {@link angular.module.ng.$compileProvider.directive.select select} directives call it.
*
* It internally calls all `formatters` and if resulted value is valid, updates the model and
* calls all registered change listeners.
*
* @param {string} value Value from the view.
*/
this.$setViewValue = function(value) {
this.$viewValue = value;
// change to dirty
if (this.$pristine) {
this.$dirty = true;
this.$pristine = false;
$element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS);
parentForm.$setDirty();
}
forEach(this.$parsers, function(fn) {
value = fn(value);
});
if (this.$modelValue !== value) {
this.$modelValue = value;
ngModel(value);
forEach(this.$viewChangeListeners, function(listener) {
try {
listener();
} catch(e) {
$exceptionHandler(e);
}
})
}
};
// model -> value
var ctrl = this;
$scope.$watch(function() {
return ngModel();
}, function(value) {
// ignore change from view
if (ctrl.$modelValue === value) return;
var formatters = ctrl.$formatters,
idx = formatters.length;
ctrl.$modelValue = value;
while(idx--) {
value = formatters[idx](value);
}
if (ctrl.$viewValue !== value) {
ctrl.$viewValue = value;
ctrl.$render();
}
});
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngModel
*
* @element input
*
* @description
* Is directive that tells Angular to do two-way data binding. It works together with `input`,
* `select`, `textarea`. You can easily write your own directives to use `ngModel` as well.
*
* `ngModel` is responsible for:
*
* - binding the view into the model, which other directives such as `input`, `textarea` or `select`
* require,
* - providing validation behavior (i.e. required, number, email, url),
* - keeping state of the control (valid/invalid, dirty/pristine, validation errors),
* - setting related css class onto the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`),
* - register the control with parent {@link angular.module.ng.$compileProvider.directive.form form}.
*
* For basic examples, how to use `ngModel`, see:
*
* - {@link angular.module.ng.$compileProvider.directive.input input}
* - {@link angular.module.ng.$compileProvider.directive.input.text text}
* - {@link angular.module.ng.$compileProvider.directive.input.checkbox checkbox}
* - {@link angular.module.ng.$compileProvider.directive.input.radio radio}
* - {@link angular.module.ng.$compileProvider.directive.input.number number}
* - {@link angular.module.ng.$compileProvider.directive.input.email email}
* - {@link angular.module.ng.$compileProvider.directive.input.url url}
* - {@link angular.module.ng.$compileProvider.directive.select select}
* - {@link angular.module.ng.$compileProvider.directive.textarea textarea}
*
*/
var ngModelDirective = [function() {
return {
inject: {
ngModel: 'accessor'
},
require: ['ngModel', '^?form'],
controller: NgModelController,
link: function(scope, element, attr, ctrls) {
// notify others, especially parent forms
var modelCtrl = ctrls[0],
formCtrl = ctrls[1] || nullFormCtrl;
formCtrl.$addControl(modelCtrl);
element.bind('$destroy', function() {
formCtrl.$removeControl(modelCtrl);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngChange
* @restrict E
*
* @description
* Evaluate given expression when user changes the input.
* The expression is not evaluated when the value change is coming from the model.
*
* Note, this directive requires `ngModel` to be present.
*
* @element input
*
* @example
* <doc:example>
* <doc:source>
* <script>
* function Controller($scope) {
* $scope.counter = 0;
* $scope.change = function() {
* $scope.counter++;
* };
* }
* </script>
* <div ng-controller="Controller">
* <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
* <input type="checkbox" ng-model="confirmed" id="ng-change-example2" />
* <label for="ng-change-example2">Confirmed</label><br />
* debug = {{confirmed}}<br />
* counter = {{counter}}
* </div>
* </doc:source>
* <doc:scenario>
* it('should evaluate the expression if changing from view', function() {
* expect(binding('counter')).toEqual('0');
* element('#ng-change-example1').click();
* expect(binding('counter')).toEqual('1');
* expect(binding('confirmed')).toEqual('true');
* });
*
* it('should not evaluate the expression if changing from model', function() {
* element('#ng-change-example2').click();
* expect(binding('counter')).toEqual('0');
* expect(binding('confirmed')).toEqual('true');
* });
* </doc:scenario>
* </doc:example>
*/
var ngChangeDirective = valueFn({
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
ctrl.$viewChangeListeners.push(function() {
scope.$eval(attr.ngChange);
});
}
});
var requiredDirective = [function() {
return {
require: '?ngModel',
link: function(scope, elm, attr, ctrl) {
if (!ctrl) return;
var validator = function(value) {
if (attr.required && (isEmpty(value) || value === false)) {
ctrl.$setValidity('required', false);
return;
} else {
ctrl.$setValidity('required', true);
return value;
}
};
ctrl.$formatters.push(validator);
ctrl.$parsers.unshift(validator);
attr.$observe('required', function() {
validator(ctrl.$viewValue);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngList
*
* @description
* Text input that converts between comma-seperated string into an array of strings.
*
* @element input
* @param {string=} ngList optional delimiter that should be used to split the value. If
* specified in form `/something/` then the value will be converted into a regular expression.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.names = ['igor', 'misko', 'vojta'];
}
</script>
<form name="myForm" ng-controller="Ctrl">
List: <input name="namesInput" ng-model="names" ng-list required>
<span class="error" ng-show="myForm.list.$error.required">
Required!</span>
<tt>names = {{names}}</tt><br/>
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
expect(binding('names')).toEqual('["igor","misko","vojta"]');
expect(binding('myForm.namesInput.$valid')).toEqual('true');
});
it('should be invalid if empty', function() {
input('names').enter('');
expect(binding('names')).toEqual('[]');
expect(binding('myForm.namesInput.$valid')).toEqual('false');
});
</doc:scenario>
</doc:example>
*/
var ngListDirective = function() {
return {
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
var match = /\/(.*)\//.exec(attr.ngList),
separator = match && new RegExp(match[1]) || attr.ngList || ',';
var parse = function(viewValue) {
var list = [];
if (viewValue) {
forEach(viewValue.split(separator), function(value) {
if (value) list.push(trim(value));
});
}
return list;
};
ctrl.$parsers.push(parse);
ctrl.$formatters.push(function(value) {
if (isArray(value) && !equals(parse(ctrl.$viewValue), value)) {
return value.join(', ');
}
return undefined;
});
}
};
};
var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
var ngValueDirective = [function() {
return {
priority: 100,
compile: function(tpl, tplAttr) {
if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {
return function(scope, elm, attr) {
attr.$set('value', scope.$eval(attr.ngValue));
};
} else {
return function(scope, elm, attr) {
attr.$$observers.value = [];
scope.$watch(attr.ngValue, function(value) {
attr.$set('value', value, false);
});
};
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngBind
*
* @description
* The `ngBind` attribute tells Angular to replace the text content of the specified HTML element
* with the value of a given expression, and to update the text content when the value of that
* expression changes.
*
* Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
* `{{ expression }}` which is similar but less verbose.
*
* Once scenario in which the use of `ngBind` is prefered over `{{ expression }}` binding is when
* it's desirable to put bindings into template that is momentarily displayed by the browser in its
* raw state before Angular compiles it. Since `ngBind` is an element attribute, it makes the
* bindings invisible to the user while the page is loading.
*
* An alternative solution to this problem would be using the
* {@link angular.module.ng.$compileProvider.directive.ngCloak ngCloak} directive.
*
*
* @element ANY
* @param {expression} ngBind {@link guide/dev_guide.expressions Expression} to evaluate.
*
* @example
* Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.name = 'Whirled';
}
</script>
<div ng-controller="Ctrl">
Enter name: <input type="text" ng-model="name"><br>
Hello <span ng-bind="name"></span>!
</div>
</doc:source>
<doc:scenario>
it('should check ng-bind', function() {
expect(using('.doc-example-live').binding('name')).toBe('Whirled');
using('.doc-example-live').input('name').enter('world');
expect(using('.doc-example-live').binding('name')).toBe('world');
});
</doc:scenario>
</doc:example>
*/
var ngBindDirective = ngDirective(function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBind);
scope.$watch(attr.ngBind, function(value) {
element.text(value == undefined ? '' : value);
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngBindTemplate
*
* @description
* The `ngBindTemplate` directive specifies that the element
* text should be replaced with the template in ngBindTemplate.
* Unlike ngBind the ngBindTemplate can contain multiple `{{` `}}`
* expressions. (This is required since some HTML elements
* can not have SPAN elements such as TITLE, or OPTION to name a few.)
*
* @element ANY
* @param {string} ngBindTemplate template of form
* <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
*
* @example
* Try it here: enter text in text box and watch the greeting change.
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.salutation = 'Hello';
$scope.name = 'World';
}
</script>
<div ng-controller="Ctrl">
Salutation: <input type="text" ng-model="salutation"><br>
Name: <input type="text" ng-model="name"><br>
<pre ng-bind-template="{{salutation}} {{name}}!"></pre>
</div>
</doc:source>
<doc:scenario>
it('should check ng-bind', function() {
expect(using('.doc-example-live').binding('salutation')).
toBe('Hello');
expect(using('.doc-example-live').binding('name')).
toBe('World');
using('.doc-example-live').input('salutation').enter('Greetings');
using('.doc-example-live').input('name').enter('user');
expect(using('.doc-example-live').binding('salutation')).
toBe('Greetings');
expect(using('.doc-example-live').binding('name')).
toBe('user');
});
</doc:scenario>
</doc:example>
*/
var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
return function(scope, element, attr) {
// TODO: move this to scenario runner
var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
element.addClass('ng-binding').data('$binding', interpolateFn);
attr.$observe('ngBindTemplate', function(value) {
element.text(value);
});
}
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngBindHtmlUnsafe
*
* @description
* Creates a binding that will innerHTML the result of evaluating the `expression` into the current
* element. *The innerHTML-ed content will not be sanitized!* You should use this directive only if
* {@link angular.module.ngSanitize.directive.ngBindHtml ngBindHtml} directive is too
* restrictive and when you absolutely trust the source of the content you are binding to.
*
* See {@link angular.module.ngSanitize.$sanitize $sanitize} docs for examples.
*
* @element ANY
* @param {expression} ngBindHtmlUnsafe {@link guide/dev_guide.expressions Expression} to evaluate.
*/
var ngBindHtmlUnsafeDirective = [function() {
return function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtmlUnsafe);
scope.$watch(attr.ngBindHtmlUnsafe, function(value) {
element.html(value || '');
});
};
}];
function classDirective(name, selector) {
name = 'ngClass' + name;
return ngDirective(function(scope, element, attr) {
scope.$watch(attr[name], function(newVal, oldVal) {
if (selector === true || scope.$index % 2 === selector) {
if (oldVal && (newVal !== oldVal)) {
if (isObject(oldVal) && !isArray(oldVal))
oldVal = map(oldVal, function(v, k) { if (v) return k });
element.removeClass(isArray(oldVal) ? oldVal.join(' ') : oldVal);
}
if (isObject(newVal) && !isArray(newVal))
newVal = map(newVal, function(v, k) { if (v) return k });
if (newVal) element.addClass(isArray(newVal) ? newVal.join(' ') : newVal); }
}, true);
});
}
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngClass
*
* @description
* The `ngClass` allows you to set CSS class on HTML element dynamically by databinding an
* expression that represents all classes to be added.
*
* The directive won't add duplicate classes if a particular class was already set.
*
* When the expression changes, the previously added classes are removed and only then the classes
* new classes are added.
*
* @element ANY
* @param {expression} ngClass {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class
* names, an array, or a map of class names to boolean values.
*
* @example
<example>
<file name="index.html">
<input type="button" value="set" ng-click="myVar='my-class'">
<input type="button" value="clear" ng-click="myVar=''">
<br>
<span ng-class="myVar">Sample Text</span>
</file>
<file name="style.css">
.my-class {
color: red;
}
</file>
<file name="scenario.js">
it('should check ng-class', function() {
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/my-class/);
using('.doc-example-live').element(':button:first').click();
expect(element('.doc-example-live span').prop('className')).
toMatch(/my-class/);
using('.doc-example-live').element(':button:last').click();
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/my-class/);
});
</file>
</example>
*/
var ngClassDirective = classDirective('', true);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngClassOdd
*
* @description
* The `ngClassOdd` and `ngClassEven` directives work exactly as
* {@link angular.module.ng.$compileProvider.directive.ngClass ngClass}, except it works in
* conjunction with `ngRepeat` and takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.module.ng.$compileProvider.directive.ngRepeat ngRepeat}.
*
* @element ANY
* @param {expression} ngClassOdd {@link guide/dev_guide.expressions Expression} to eval. The result
* of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<example>
<file name="index.html">
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
{{name}}
</span>
</li>
</ol>
</file>
<file name="style.css">
.odd {
color: red;
}
.even {
color: blue;
}
</file>
<file name="scenario.js">
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/even/);
});
</file>
</example>
*/
var ngClassOddDirective = classDirective('Odd', 0);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngClassEven
*
* @description
* The `ngClassOdd` and `ngClassEven` works exactly as
* {@link angular.module.ng.$compileProvider.directive.ngClass ngClass}, except it works in
* conjunction with `ngRepeat` and takes affect only on odd (even) rows.
*
* This directive can be applied only within a scope of an
* {@link angular.module.ng.$compileProvider.directive.ngRepeat ngRepeat}.
*
* @element ANY
* @param {expression} ngClassEven {@link guide/dev_guide.expressions Expression} to eval. The
* result of the evaluation can be a string representing space delimited class names or an array.
*
* @example
<example>
<file name="index.html">
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
{{name}}
</span>
</li>
</ol>
</file>
<file name="style.css">
.odd {
color: red;
}
.even {
color: blue;
}
</file>
<file name="scenario.js">
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
expect(element('.doc-example-live li:last span').prop('className')).
toMatch(/even/);
});
</file>
</example>
*/
var ngClassEvenDirective = classDirective('Even', 1);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngCloak
*
* @description
* The `ngCloak` directive is used to prevent the Angular html template from being briefly
* displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
* directive to avoid the undesirable flicker effect caused by the html template display.
*
* The directive can be applied to the `<body>` element, but typically a fine-grained application is
* prefered in order to benefit from progressive rendering of the browser view.
*
* `ngCloak` works in cooperation with a css rule that is embedded within `angular.js` and
* `angular.min.js` files. Following is the css rule:
*
* <pre>
* [ng\:cloak], [ng-cloak], .ng-cloak {
* display: none;
* }
* </pre>
*
* When this css rule is loaded by the browser, all html elements (including their children) that
* are tagged with the `ng-cloak` directive are hidden. When Angular comes across this directive
* during the compilation of the template it deletes the `ngCloak` element attribute, which
* makes the compiled element visible.
*
* For the best result, `angular.js` script must be loaded in the head section of the html file;
* alternatively, the css rule (above) must be included in the external stylesheet of the
* application.
*
* Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they
* cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css
* class `ngCloak` in addition to `ngCloak` directive as shown in the example below.
*
* @element ANY
*
* @example
<doc:example>
<doc:source>
<div id="template1" ng-cloak>{{ 'hello' }}</div>
<div id="template2" ng-cloak class="ng-cloak">{{ 'hello IE7' }}</div>
</doc:source>
<doc:scenario>
it('should remove the template directive and css class', function() {
expect(element('.doc-example-live #template1').attr('ng-cloak')).
not().toBeDefined();
expect(element('.doc-example-live #template2').attr('ng-cloak')).
not().toBeDefined();
});
</doc:scenario>
</doc:example>
*
*/
var ngCloakDirective = ngDirective({
compile: function(element, attr) {
attr.$set('ngCloak', undefined);
element.removeClass('ng-cloak');
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngController
*
* @description
* The `ngController` directive assigns behavior to a scope. This is a key aspect of how angular
* supports the principles behind the Model-View-Controller design pattern.
*
* MVC components in angular:
*
* * Model — The Model is data in scope properties; scopes are attached to the DOM.
* * View — The template (HTML with data bindings) is rendered into the View.
* * Controller — The `ngController` directive specifies a Controller class; the class has
* methods that typically express the business logic behind the application.
*
* Note that an alternative way to define controllers is via the `{@link angular.module.ng.$route}`
* service.
*
* @element ANY
* @scope
* @param {expression} ngController Name of a globally accessible constructor function or an
* {@link guide/dev_guide.expressions expression} that on the current scope evaluates to a
* constructor function.
*
* @example
* Here is a simple form for editing user contact information. Adding, removing, clearing, and
* greeting are methods declared on the controller (see source tab). These methods can
* easily be called from the angular markup. Notice that the scope becomes the `this` for the
* controller's instance. This allows for easy access to the view data from the controller. Also
* notice that any changes to the data are automatically reflected in the View without the need
* for a manual update.
<doc:example>
<doc:source>
<script>
function SettingsController($scope) {
$scope.name = "John Smith";
$scope.contacts = [
{type:'phone', value:'408 555 1212'},
{type:'email', value:'[email protected]'} ];
$scope.greet = function() {
alert(this.name);
};
$scope.addContact = function() {
this.contacts.push({type:'email', value:'[email protected]'});
};
$scope.removeContact = function(contactToRemove) {
var index = this.contacts.indexOf(contactToRemove);
this.contacts.splice(index, 1);
};
$scope.clearContact = function(contact) {
contact.type = 'phone';
contact.value = '';
};
}
</script>
<div ng-controller="SettingsController">
Name: <input type="text" ng-model="name"/>
[ <a href="" ng-click="greet()">greet</a> ]<br/>
Contact:
<ul>
<li ng-repeat="contact in contacts">
<select ng-model="contact.type">
<option>phone</option>
<option>email</option>
</select>
<input type="text" ng-model="contact.value"/>
[ <a href="" ng-click="clearContact(contact)">clear</a>
| <a href="" ng-click="removeContact(contact)">X</a> ]
</li>
<li>[ <a href="" ng-click="addContact()">add</a> ]</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check controller', function() {
expect(element('.doc-example-live div>:input').val()).toBe('John Smith');
expect(element('.doc-example-live li:nth-child(1) input').val())
.toBe('408 555 1212');
expect(element('.doc-example-live li:nth-child(2) input').val())
.toBe('[email protected]');
element('.doc-example-live li:first a:contains("clear")').click();
expect(element('.doc-example-live li:first input').val()).toBe('');
element('.doc-example-live li:last a:contains("add")').click();
expect(element('.doc-example-live li:nth-child(3) input').val())
.toBe('[email protected]');
});
</doc:scenario>
</doc:example>
*/
var ngControllerDirective = [function() {
return {
scope: true,
controller: '@'
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngCsp
* @priority 1000
*
* @description
* Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support.
* This directive should be used on the root element of the application (typically the `<html>`
* element or other element with the {@link angular.module.ng.$compileProvider.directive.ngApp ngApp}
* directive).
*
* If enabled the performance of template expression evaluator will suffer slightly, so don't enable
* this mode unless you need it.
*
* @element html
*/
var ngCspDirective = ['$sniffer', function($sniffer) {
return {
priority: 1000,
compile: function() {
$sniffer.csp = true;
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngClick
*
* @description
* The ngClick allows you to specify custom behavior when
* element is clicked.
*
* @element ANY
* @param {expression} ngClick {@link guide/dev_guide.expressions Expression} to evaluate upon
* click. (Event object is available as `$event`)
*
* @example
<doc:example>
<doc:source>
<button ng-click="count = count + 1" ng-init="count=0">
Increment
</button>
count: {{count}}
</doc:source>
<doc:scenario>
it('should check ng-click', function() {
expect(binding('count')).toBe('0');
element('.doc-example-live :button').click();
expect(binding('count')).toBe('1');
});
</doc:scenario>
</doc:example>
*/
/*
* A directive that allows creation of custom onclick handlers that are defined as angular
* expressions and are compiled and executed within the current scope.
*
* Events that are handled via these handler are always configured not to propagate further.
*/
var ngEventDirectives = {};
forEach(
'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(' '),
function(name) {
var directiveName = directiveNormalize('ng-' + name);
ngEventDirectives[directiveName] = ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr[directiveName]);
element.bind(lowercase(name), function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
});
});
};
}];
}
);
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngDblclick
*
* @description
* The `ngDblclick` directive allows you to specify custom behavior on dblclick event.
*
* @element ANY
* @param {expression} ngDblclick {@link guide/dev_guide.expressions Expression} to evaluate upon
* dblclick. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMousedown
*
* @description
* The ngMousedown directive allows you to specify custom behavior on mousedown event.
*
* @element ANY
* @param {expression} ngMousedown {@link guide/dev_guide.expressions Expression} to evaluate upon
* mousedown. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMouseup
*
* @description
* Specify custom behavior on mouseup event.
*
* @element ANY
* @param {expression} ngMouseup {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseup. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMouseover
*
* @description
* Specify custom behavior on mouseover event.
*
* @element ANY
* @param {expression} ngMouseover {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseover. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMouseenter
*
* @description
* Specify custom behavior on mouseenter event.
*
* @element ANY
* @param {expression} ngMouseenter {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseenter. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMouseleave
*
* @description
* Specify custom behavior on mouseleave event.
*
* @element ANY
* @param {expression} ngMouseleave {@link guide/dev_guide.expressions Expression} to evaluate upon
* mouseleave. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngMousemove
*
* @description
* Specify custom behavior on mousemove event.
*
* @element ANY
* @param {expression} ngMousemove {@link guide/dev_guide.expressions Expression} to evaluate upon
* mousemove. (Event object is available as `$event`)
*
* @example
* See {@link angular.module.ng.$compileProvider.directive.ngClick ngClick}
*/
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngSubmit
*
* @description
* Enables binding angular expressions to onsubmit events.
*
* Additionally it prevents the default action (which for form means sending the request to the
* server and reloading the current page).
*
* @element form
* @param {expression} ngSubmit {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.list = [];
$scope.text = 'hello';
$scope.submit = function() {
if (this.text) {
this.list.push(this.text);
this.text = '';
}
};
}
</script>
<form ng-submit="submit()" ng-controller="Ctrl">
Enter text and hit enter:
<input type="text" ng-model="text" name="text" />
<input type="submit" id="submit" value="Submit" />
<pre>list={{list}}</pre>
</form>
</doc:source>
<doc:scenario>
it('should check ng-submit', function() {
expect(binding('list')).toBe('[]');
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('["hello"]');
expect(input('text').val()).toBe('');
});
it('should ignore empty strings', function() {
expect(binding('list')).toBe('[]');
element('.doc-example-live #submit').click();
element('.doc-example-live #submit').click();
expect(binding('list')).toBe('["hello"]');
});
</doc:scenario>
</doc:example>
*/
var ngSubmitDirective = ngDirective(function(scope, element, attrs) {
element.bind('submit', function() {
scope.$apply(attrs.ngSubmit);
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngInclude
* @restrict ECA
*
* @description
* Fetches, compiles and includes an external HTML fragment.
*
* Keep in mind that Same Origin Policy applies to included resources
* (e.g. ngInclude won't work for cross-domain requests on all browsers and for
* file:// access on some browsers).
*
* @scope
*
* @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
* @param {string=} onload Expression to evaluate when a new partial is loaded.
*
* @param {string=} autoscroll Whether `ngInclude` should call {@link angular.module.ng.$anchorScroll
* $anchorScroll} to scroll the viewport after the content is loaded.
*
* - If the attribute is not set, disable scrolling.
* - If the attribute is set without value, enable scrolling.
* - Otherwise enable scrolling only if the expression evaluates to truthy value.
*
* @example
<example>
<file name="index.html">
<div ng-controller="Ctrl">
<select ng-model="template" ng-options="t.name for t in templates">
<option value="">(blank)</option>
</select>
url of the template: <tt>{{template.url}}</tt>
<hr/>
<div ng-include src="template.url"></div>
</div>
</file>
<file name="script.js">
function Ctrl($scope) {
$scope.templates =
[ { name: 'template1.html', url: 'template1.html'}
, { name: 'template2.html', url: 'template2.html'} ];
$scope.template = $scope.templates[0];
}
</file>
<file name="template1.html">
Content of template1.html
</file>
<file name="template2.html">
Content of template2.html
</file>
<file name="scenario.js">
it('should load template1.html', function() {
expect(element('.doc-example-live [ng-include]').text()).
toMatch(/Content of template1.html/);
});
it('should load template2.html', function() {
select('template').option('1');
expect(element('.doc-example-live [ng-include]').text()).
toMatch(/Content of template2.html/);
});
it('should change to blank', function() {
select('template').option('');
expect(element('.doc-example-live [ng-include]').text()).toEqual('');
});
</file>
</example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$compileProvider.directive.ngInclude#$includeContentLoaded
* @eventOf angular.module.ng.$compileProvider.directive.ngInclude
* @eventType emit on the current ngInclude scope
* @description
* Emitted every time the ngInclude content is reloaded.
*/
var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile',
function($http, $templateCache, $anchorScroll, $compile) {
return {
restrict: 'ECA',
terminal: true,
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
return function(scope, element) {
var changeCounter = 0,
childScope;
var clearContent = function() {
if (childScope) {
childScope.$destroy();
childScope = null;
}
element.html('');
};
scope.$watch(srcExp, function(src) {
var thisChangeId = ++changeCounter;
if (src) {
$http.get(src, {cache: $templateCache}).success(function(response) {
if (thisChangeId !== changeCounter) return;
if (childScope) childScope.$destroy();
childScope = scope.$new();
element.html(response);
$compile(element.contents())(childScope);
if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}
childScope.$emit('$includeContentLoaded');
scope.$eval(onloadExp);
}).error(function() {
if (thisChangeId === changeCounter) clearContent();
});
} else clearContent();
});
};
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngInit
*
* @description
* The `ngInit` directive specifies initialization tasks to be executed
* before the template enters execution mode during bootstrap.
*
* @element ANY
* @param {expression} ngInit {@link guide/dev_guide.expressions Expression} to eval.
*
* @example
<doc:example>
<doc:source>
<div ng-init="greeting='Hello'; person='World'">
{{greeting}} {{person}}!
</div>
</doc:source>
<doc:scenario>
it('should check greeting', function() {
expect(binding('greeting')).toBe('Hello');
expect(binding('person')).toBe('World');
});
</doc:scenario>
</doc:example>
*/
var ngInitDirective = ngDirective({
compile: function() {
return {
pre: function(scope, element, attrs) {
scope.$eval(attrs.ngInit);
}
}
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngNonBindable
* @priority 1000
*
* @description
* Sometimes it is necessary to write code which looks like bindings but which should be left alone
* by angular. Use `ngNonBindable` to make angular ignore a chunk of HTML.
*
* @element ANY
*
* @example
* In this example there are two location where a simple binding (`{{}}`) is present, but the one
* wrapped in `ngNonBindable` is left alone.
*
* @example
<doc:example>
<doc:source>
<div>Normal: {{1 + 2}}</div>
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
</doc:source>
<doc:scenario>
it('should check ng-non-bindable', function() {
expect(using('.doc-example-live').binding('1 + 2')).toBe('3');
expect(using('.doc-example-live').element('div:last').text()).
toMatch(/1 \+ 2/);
});
</doc:scenario>
</doc:example>
*/
var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngPluralize
* @restrict EA
*
* @description
* # Overview
* `ngPluralize` is a directive that displays messages according to en-US localization rules.
* These rules are bundled with angular.js and the rules can be overridden
* (see {@link guide/dev_guide.i18n Angular i18n} dev guide). You configure ngPluralize directive
* by specifying the mappings between
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} and the strings to be displayed.
*
* # Plural categories and explicit number rules
* There are two
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
* plural categories} in Angular's default en-US locale: "one" and "other".
*
* While a pural category may match many numbers (for example, in en-US locale, "other" can match
* any number that is not 1), an explicit number rule can only match one number. For example, the
* explicit number rule for "3" matches the number 3. You will see the use of plural categories
* and explicit number rules throughout later parts of this documentation.
*
* # Configuring ngPluralize
* You configure ngPluralize by providing 2 attributes: `count` and `when`.
* You can also provide an optional attribute, `offset`.
*
* The value of the `count` attribute can be either a string or an {@link guide/dev_guide.expressions
* Angular expression}; these are evaluated on the current scope for its binded value.
*
* The `when` attribute specifies the mappings between plural categories and the actual
* string to be displayed. The value of the attribute should be a JSON object so that Angular
* can interpret it correctly.
*
* The following example shows how to configure ngPluralize:
*
* <pre>
* <ng-pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
* 'one': '1 person is viewing.',
* 'other': '{} people are viewing.'}">
* </ng-pluralize>
*</pre>
*
* In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
* specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
* would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
* other numbers, for example 12, so that instead of showing "12 people are viewing", you can
* show "a dozen people are viewing".
*
* You can use a set of closed braces(`{}`) as a placeholder for the number that you want substituted
* into pluralized strings. In the previous example, Angular will replace `{}` with
* <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
* for <span ng-non-bindable>{{numberExpression}}</span>.
*
* # Configuring ngPluralize with offset
* The `offset` attribute allows further customization of pluralized text, which can result in
* a better user experience. For example, instead of the message "4 people are viewing this document",
* you might display "John, Kate and 2 others are viewing this document".
* The offset attribute allows you to offset a number by any desired value.
* Let's take a look at an example:
*
* <pre>
* <ng-pluralize count="personCount" offset=2
* when="{'0': 'Nobody is viewing.',
* '1': '{{person1}} is viewing.',
* '2': '{{person1}} and {{person2}} are viewing.',
* 'one': '{{person1}}, {{person2}} and one other person are viewing.',
* 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
* </ng-pluralize>
* </pre>
*
* Notice that we are still using two plural categories(one, other), but we added
* three explicit number rules 0, 1 and 2.
* When one person, perhaps John, views the document, "John is viewing" will be shown.
* When three people view the document, no explicit number rule is found, so
* an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
* In this case, plural category 'one' is matched and "John, Marry and one other person are viewing"
* is shown.
*
* Note that when you specify offsets, you must provide explicit number rules for
* numbers from 0 up to and including the offset. If you use an offset of 3, for example,
* you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
* plural categories "one" and "other".
*
* @param {string|expression} count The variable to be bounded to.
* @param {string} when The mapping between plural category to its correspoding strings.
* @param {number=} offset Offset to deduct from the total number.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.person1 = 'Igor';
$scope.person2 = 'Misko';
$scope.personCount = 1;
}
</script>
<div ng-controller="Ctrl">
Person 1:<input type="text" ng-model="person1" value="Igor" /><br/>
Person 2:<input type="text" ng-model="person2" value="Misko" /><br/>
Number of People:<input type="text" ng-model="personCount" value="1" /><br/>
<!--- Example with simple pluralization rules for en locale --->
Without Offset:
<ng-pluralize count="personCount"
when="{'0': 'Nobody is viewing.',
'one': '1 person is viewing.',
'other': '{} people are viewing.'}">
</ng-pluralize><br>
<!--- Example with offset --->
With Offset(2):
<ng-pluralize count="personCount" offset=2
when="{'0': 'Nobody is viewing.',
'1': '{{person1}} is viewing.',
'2': '{{person1}} and {{person2}} are viewing.',
'one': '{{person1}}, {{person2}} and one other person are viewing.',
'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
</ng-pluralize>
</div>
</doc:source>
<doc:scenario>
it('should show correct pluralized string', function() {
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('1 person is viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor is viewing.');
using('.doc-example-live').input('personCount').enter('0');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('Nobody is viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Nobody is viewing.');
using('.doc-example-live').input('personCount').enter('2');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('2 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor and Misko are viewing.');
using('.doc-example-live').input('personCount').enter('3');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('3 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and one other person are viewing.');
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live ng-pluralize:first').text()).
toBe('4 people are viewing.');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
});
it('should show data-binded names', function() {
using('.doc-example-live').input('personCount').enter('4');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Igor, Misko and 2 other people are viewing.');
using('.doc-example-live').input('person1').enter('Di');
using('.doc-example-live').input('person2').enter('Vojta');
expect(element('.doc-example-live ng-pluralize:last').text()).
toBe('Di, Vojta and 2 other people are viewing.');
});
</doc:scenario>
</doc:example>
*/
var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {
var BRACE = /{}/g;
return {
restrict: 'EA',
link: function(scope, element, attr) {
var numberExp = attr.count,
whenExp = element.attr(attr.$attr.when), // this is because we have {{}} in attrs
offset = attr.offset || 0,
whens = scope.$eval(whenExp),
whensExpFns = {};
forEach(whens, function(expression, key) {
whensExpFns[key] =
$interpolate(expression.replace(BRACE, '{{' + numberExp + '-' + offset + '}}'));
});
scope.$watch(function() {
var value = parseFloat(scope.$eval(numberExp));
if (!isNaN(value)) {
//if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise,
//check it against pluralization rules in $locale service
if (!whens[value]) value = $locale.pluralCat(value - offset);
return whensExpFns[value](scope, element, true);
} else {
return '';
}
}, function(newVal) {
element.text(newVal);
});
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngRepeat
*
* @description
* The `ngRepeat` directive instantiates a template once per item from a collection. Each template
* instance gets its own scope, where the given loop variable is set to the current collection item,
* and `$index` is set to the item index or key.
*
* Special properties are exposed on the local scope of each template instance, including:
*
* * `$index` – `{number}` – iterator offset of the repeated element (0..length-1)
* * `$position` – `{string}` – position of the repeated element in the iterator. One of:
* * `'first'`,
* * `'middle'`
* * `'last'`
*
*
* @element ANY
* @scope
* @priority 1000
* @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. Two
* formats are currently supported:
*
* * `variable in expression` – where variable is the user defined loop variable and `expression`
* is a scope expression giving the collection to enumerate.
*
* For example: `track in cd.tracks`.
*
* * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
* and `expression` is the scope expression giving the collection to enumerate.
*
* For example: `(name, age) in {'adam':10, 'amalie':12}`.
*
* @example
* This example initializes the scope to a list of names and
* then uses `ngRepeat` to display every person:
<doc:example>
<doc:source>
<div ng-init="friends = [{name:'John', age:25}, {name:'Mary', age:28}]">
I have {{friends.length}} friends. They are:
<ul>
<li ng-repeat="friend in friends">
[{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
</li>
</ul>
</div>
</doc:source>
<doc:scenario>
it('should check ng-repeat', function() {
var r = using('.doc-example-live').repeater('ul li');
expect(r.count()).toBe(2);
expect(r.row(0)).toEqual(["1","John","25"]);
expect(r.row(1)).toEqual(["2","Mary","28"]);
});
</doc:scenario>
</doc:example>
*/
var ngRepeatDirective = ngDirective({
transclude: 'element',
priority: 1000,
terminal: true,
compile: function(element, attr, linker) {
return function(scope, iterStartElement, attr){
var expression = attr.ngRepeat;
var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),
lhs, rhs, valueIdent, keyIdent;
if (! match) {
throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '" +
expression + "'.");
}
lhs = match[1];
rhs = match[2];
match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);
if (!match) {
throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" +
lhs + "'.");
}
valueIdent = match[3] || match[1];
keyIdent = match[2];
// Store a list of elements from previous run. This is a hash where key is the item from the
// iterator, and the value is an array of objects with following properties.
// - scope: bound scope
// - element: previous element.
// - index: position
// We need an array of these objects since the same object can be returned from the iterator.
// We expect this to be a rare case.
var lastOrder = new HashQueueMap();
scope.$watch(function(scope){
var index, length,
collection = scope.$eval(rhs),
collectionLength = size(collection, true),
childScope,
// Same as lastOrder but it has the current state. It will become the
// lastOrder on the next iteration.
nextOrder = new HashQueueMap(),
key, value, // key/value of iteration
array, last, // last object information {scope, element, index}
cursor = iterStartElement; // current position of the node
if (!isArray(collection)) {
// if object, extract keys, sort them and use to determine order of iteration over obj props
array = [];
for(key in collection) {
if (collection.hasOwnProperty(key) && key.charAt(0) != '$') {
array.push(key);
}
}
array.sort();
} else {
array = collection || [];
}
// we are not using forEach for perf reasons (trying to avoid #call)
for (index = 0, length = array.length; index < length; index++) {
key = (collection === array) ? index : array[index];
value = collection[key];
last = lastOrder.shift(value);
if (last) {
// if we have already seen this object, then we need to reuse the
// associated scope/element
childScope = last.scope;
nextOrder.push(value, last);
if (index === last.index) {
// do nothing
cursor = last.element;
} else {
// existing item which got moved
last.index = index;
// This may be a noop, if the element is next, but I don't know of a good way to
// figure this out, since it would require extra DOM access, so let's just hope that
// the browsers realizes that it is noop, and treats it as such.
cursor.after(last.element);
cursor = last.element;
}
} else {
// new item which we don't know about
childScope = scope.$new();
}
childScope[valueIdent] = value;
if (keyIdent) childScope[keyIdent] = key;
childScope.$index = index;
childScope.$position = index === 0 ?
'first' :
(index == collectionLength - 1 ? 'last' : 'middle');
if (!last) {
linker(childScope, function(clone){
cursor.after(clone);
last = {
scope: childScope,
element: (cursor = clone),
index: index
};
nextOrder.push(value, last);
});
}
}
//shrink children
for (key in lastOrder) {
if (lastOrder.hasOwnProperty(key)) {
array = lastOrder[key];
while(array.length) {
value = array.pop();
value.element.remove();
value.scope.$destroy();
}
}
}
lastOrder = nextOrder;
});
};
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngShow
*
* @description
* The `ngShow` and `ngHide` directives show or hide a portion of the DOM tree (HTML)
* conditionally.
*
* @element ANY
* @param {expression} ngShow If the {@link guide/dev_guide.expressions expression} is truthy
* then the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng-model="checked"><br/>
Show: <span ng-show="checked">I show up when your checkbox is checked.</span> <br/>
Hide: <span ng-hide="checked">I hide when your checkbox is checked.</span>
</doc:source>
<doc:scenario>
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
//TODO(misko): refactor to remove element from the DOM
var ngShowDirective = ngDirective(function(scope, element, attr){
scope.$watch(attr.ngShow, function(value){
element.css('display', toBoolean(value) ? '' : 'none');
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngHide
*
* @description
* The `ngHide` and `ngShow` directives hide or show a portion
* of the HTML conditionally.
*
* @element ANY
* @param {expression} ngHide If the {@link guide/dev_guide.expressions expression} truthy then
* the element is shown or hidden respectively.
*
* @example
<doc:example>
<doc:source>
Click me: <input type="checkbox" ng-model="checked"><br/>
Show: <span ng-show="checked">I show up when you checkbox is checked?</span> <br/>
Hide: <span ng-hide="checked">I hide when you checkbox is checked?</span>
</doc:source>
<doc:scenario>
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
</doc:scenario>
</doc:example>
*/
//TODO(misko): refactor to remove element from the DOM
var ngHideDirective = ngDirective(function(scope, element, attr){
scope.$watch(attr.ngHide, function(value){
element.css('display', toBoolean(value) ? 'none' : '');
});
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngStyle
*
* @description
* The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.
*
* @element ANY
* @param {expression} ngStyle {@link guide/dev_guide.expressions Expression} which evals to an
* object whose keys are CSS style names and values are corresponding values for those CSS
* keys.
*
* @example
<example>
<file name="index.html">
<input type="button" value="set" ng-click="myStyle={color:'red'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
</file>
<file name="style.css">
span {
color: black;
}
</file>
<file name="scenario.js">
it('should check ng-style', function() {
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
element('.doc-example-live :button[value=set]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)');
element('.doc-example-live :button[value=clear]').click();
expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');
});
</file>
</example>
*/
var ngStyleDirective = ngDirective(function(scope, element, attr) {
scope.$watch(attr.ngStyle, function(newStyles, oldStyles) {
if (oldStyles && (newStyles !== oldStyles)) {
forEach(oldStyles, function(val, style) { element.css(style, '');});
}
if (newStyles) element.css(newStyles);
}, true);
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngSwitch
* @restrict EA
*
* @description
* Conditionally change the DOM structure.
*
* @usageContent
* <ANY ng-switch-when="matchValue1">...</ANY>
* <ANY ng-switch-when="matchValue2">...</ANY>
* ...
* <ANY ng-switch-default>...</ANY>
*
* @scope
* @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.
* @paramDescription
* On child elments add:
*
* * `ngSwitchWhen`: the case statement to match against. If match then this
* case will be displayed.
* * `ngSwitchDefault`: the default case when no other casses match.
*
* @example
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.items = ['settings', 'home', 'other'];
$scope.selection = $scope.items[0];
}
</script>
<div ng-controller="Ctrl">
<select ng-model="selection" ng-options="item for item in items">
</select>
<tt>selection={{selection}}</tt>
<hr/>
<div ng-switch on="selection" >
<div ng-switch-when="settings">Settings Div</div>
<span ng-switch-when="home">Home Span</span>
<span ng-switch-default>default</span>
</div>
</div>
</doc:source>
<doc:scenario>
it('should start in settings', function() {
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Settings Div/);
});
it('should change to home', function() {
select('selection').option('home');
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Home Span/);
});
it('should select deafault', function() {
select('selection').option('other');
expect(element('.doc-example-live [ng-switch]').text()).toMatch(/default/);
});
</doc:scenario>
</doc:example>
*/
var NG_SWITCH = 'ng-switch';
var ngSwitchDirective = valueFn({
restrict: 'EA',
compile: function(element, attr) {
var watchExpr = attr.ngSwitch || attr.on,
cases = {};
element.data(NG_SWITCH, cases);
return function(scope, element){
var selectedTransclude,
selectedElement,
selectedScope;
scope.$watch(watchExpr, function(value) {
if (selectedElement) {
selectedScope.$destroy();
selectedElement.remove();
selectedElement = selectedScope = null;
}
if ((selectedTransclude = cases['!' + value] || cases['?'])) {
scope.$eval(attr.change);
selectedScope = scope.$new();
selectedTransclude(selectedScope, function(caseElement) {
selectedElement = caseElement;
element.append(caseElement);
});
}
});
};
}
});
var ngSwitchWhenDirective = ngDirective({
transclude: 'element',
priority: 500,
compile: function(element, attrs, transclude) {
var cases = element.inheritedData(NG_SWITCH);
assertArg(cases);
cases['!' + attrs.ngSwitchWhen] = transclude;
}
});
var ngSwitchDefaultDirective = ngDirective({
transclude: 'element',
priority: 500,
compile: function(element, attrs, transclude) {
var cases = element.inheritedData(NG_SWITCH);
assertArg(cases);
cases['?'] = transclude;
}
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngTransclude
*
* @description
* Insert the transcluded DOM here.
*
* @element ANY
*
* @example
<doc:example module="transclude">
<doc:source>
<script>
function Ctrl($scope) {
$scope.title = 'Lorem Ipsum';
$scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
}
angular.module('transclude', [])
.directive('pane', function(){
return {
restrict: 'E',
transclude: true,
scope: 'isolate',
locals: { title:'bind' },
template: '<div style="border: 1px solid black;">' +
'<div style="background-color: gray">{{title}}</div>' +
'<div ng-transclude></div>' +
'</div>'
};
});
</script>
<div ng-controller="Ctrl">
<input ng-model="title"><br>
<textarea ng-model="text"></textarea> <br/>
<pane title="{{title}}">{{text}}</pane>
</div>
</doc:source>
<doc:scenario>
it('should have transcluded', function() {
input('title').enter('TITLE');
input('text').enter('TEXT');
expect(binding('title')).toEqual('TITLE');
expect(binding('text')).toEqual('TEXT');
});
</doc:scenario>
</doc:example>
*
*/
var ngTranscludeDirective = ngDirective({
controller: ['$transclude', '$element', function($transclude, $element) {
$transclude(function(clone) {
$element.append(clone);
});
}]
});
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.ngView
* @restrict ECA
*
* @description
* # Overview
* `ngView` is a directive that complements the {@link angular.module.ng.$route $route} service by
* including the rendered template of the current route into the main layout (`index.html`) file.
* Every time the current route changes, the included view changes with it according to the
* configuration of the `$route` service.
*
* @scope
* @example
<example module="ngView">
<file name="index.html">
<div ng-controller="MainCntl">
Choose:
<a href="Book/Moby">Moby</a> |
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
<a href="Book/Gatsby">Gatsby</a> |
<a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="Book/Scarlet">Scarlet Letter</a><br/>
<div ng-view></div>
<hr />
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.template = {{$route.current.template}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
</div>
</file>
<file name="book.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
</file>
<file name="chapter.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
Chapter Id: {{params.chapterId}}
</file>
<file name="script.js">
angular.module('ngView', [], function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {
template: 'book.html',
controller: BookCntl
});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
template: 'chapter.html',
controller: ChapterCntl
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}
function BookCntl($scope, $routeParams) {
$scope.name = "BookCntl";
$scope.params = $routeParams;
}
function ChapterCntl($scope, $routeParams) {
$scope.name = "ChapterCntl";
$scope.params = $routeParams;
}
</file>
<file name="scenario.js">
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</file>
</example>
*/
/**
* @ngdoc event
* @name angular.module.ng.$compileProvider.directive.ngView#$viewContentLoaded
* @eventOf angular.module.ng.$compileProvider.directive.ngView
* @eventType emit on the current ngView scope
* @description
* Emitted every time the ngView content is reloaded.
*/
var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$compile',
'$controller',
function($http, $templateCache, $route, $anchorScroll, $compile,
$controller) {
return {
restrict: 'ECA',
terminal: true,
link: function(scope, element, attr) {
var changeCounter = 0,
lastScope,
onloadExp = attr.onload || '';
scope.$on('$afterRouteChange', update);
update();
function destroyLastScope() {
if (lastScope) {
lastScope.$destroy();
lastScope = null;
}
}
function update() {
var template = $route.current && $route.current.template,
thisChangeId = ++changeCounter;
function clearContent() {
// ignore callback if another route change occured since
if (thisChangeId === changeCounter) {
element.html('');
destroyLastScope();
}
}
if (template) {
$http.get(template, {cache: $templateCache}).success(function(response) {
// ignore callback if another route change occured since
if (thisChangeId === changeCounter) {
element.html(response);
destroyLastScope();
var link = $compile(element.contents()),
current = $route.current,
controller;
lastScope = current.scope = scope.$new();
if (current.controller) {
controller = $controller(current.controller, {$scope: lastScope});
element.contents().data('$ngControllerController', controller);
}
link(lastScope);
lastScope.$emit('$viewContentLoaded');
lastScope.$eval(onloadExp);
// $anchorScroll might listen on event...
$anchorScroll();
}
}).error(clearContent);
} else {
clearContent();
}
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.script
*
* @description
* Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the
* template can be used by `ngInclude`, `ngView` or directive templates.
*
* @restrict E
* @param {'text/ng-template'} type must be set to `'text/ng-template'`
*
* @example
<doc:example>
<doc:source>
<script type="text/ng-template" id="/tpl.html">
Content of the template.
</script>
<a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
<div id="tpl-content" ng-include src="currentTpl"></div>
</doc:source>
<doc:scenario>
it('should load template defined inside script tag', function() {
element('#tpl-link').click();
expect(element('#tpl-content').text()).toMatch(/Content of the template/);
});
</doc:scenario>
</doc:example>
*/
var scriptDirective = ['$templateCache', function($templateCache) {
return {
restrict: 'E',
terminal: true,
compile: function(element, attr) {
if (attr.type == 'text/ng-template') {
var templateUrl = attr.id,
// IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent
text = element[0].text;
$templateCache.put(templateUrl, text);
}
}
};
}];
/**
* @ngdoc directive
* @name angular.module.ng.$compileProvider.directive.select
* @restrict E
*
* @description
* HTML `SELECT` element with angular data-binding.
*
* # `ngOptions`
*
* Optionally `ngOptions` attribute can be used to dynamically generate a list of `<option>`
* elements for a `<select>` element using an array or an object obtained by evaluating the
* `ngOptions` expression.
*˝˝
* When an item in the select menu is select, the value of array element or object property
* represented by the selected option will be bound to the model identified by the `ngModel`
* directive of the parent select element.
*
* Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
* be nested into the `<select>` element. This element will then represent `null` or "not selected"
* option. See example below for demonstration.
*
* Note: `ngOptions` provides iterator facility for `<option>` element which should be used instead
* of {@link angular.module.ng.$compileProvider.directive.ngRepeat ngRepeat} when you want the
* `select` model to be bound to a non-string value. This is because an option element can currently
* be bound to string values only.
*
* @param {string} name assignable expression to data-bind to.
* @param {string=} required The control is considered valid only if value is entered.
* @param {comprehension_expression=} ngOptions in one of the following forms:
*
* * for array data sources:
* * `label` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`for`** `value` **`in`** `array`
* * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array`
* * for object data sources:
* * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
* * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
* * `select` **`as`** `label` **`group by`** `group`
* **`for` `(`**`key`**`,`** `value`**`) in`** `object`
*
* Where:
*
* * `array` / `object`: an expression which evaluates to an array / object to iterate over.
* * `value`: local variable which will refer to each item in the `array` or each property value
* of `object` during iteration.
* * `key`: local variable which will refer to a property name in `object` during iteration.
* * `label`: The result of this expression will be the label for `<option>` element. The
* `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
* * `select`: The result of this expression will be bound to the model of the parent `<select>`
* element. If not specified, `select` expression will default to `value`.
* * `group`: The result of this expression will be used to group options using the `<optgroup>`
* DOM element.
*
* @example
<doc:example>
<doc:source>
<script>
function MyCntrl($scope) {
$scope.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
$scope.color = $scope.colors[2]; // red
}
</script>
<div ng-controller="MyCntrl">
<ul>
<li ng-repeat="color in colors">
Name: <input ng-model="color.name">
[<a href ng-click="colors.splice($index, 1)">X</a>]
</li>
<li>
[<a href ng-click="colors.push({})">add</a>]
</li>
</ul>
<hr/>
Color (null not allowed):
<select ng-model="color" ng-options="c.name for c in colors"></select><br>
Color (null allowed):
<span class="nullable">
<select ng-model="color" ng-options="c.name for c in colors">
<option value="">-- chose color --</option>
</select>
</span><br/>
Color grouped by shade:
<select ng-model="color" ng-options="c.name group by c.shade for c in colors">
</select><br/>
Select <a href ng-click="color={name:'not in list'}">bogus</a>.<br>
<hr/>
Currently selected: {{ {selected_color:color} }}
<div style="border:solid 1px black; height:20px"
ng-style="{'background-color':color.name}">
</div>
</div>
</doc:source>
<doc:scenario>
it('should check ng-options', function() {
expect(binding('{selected_color:color}')).toMatch('red');
select('color').option('0');
expect(binding('{selected_color:color}')).toMatch('black');
using('.nullable').select('color').option('');
expect(binding('{selected_color:color}')).toMatch('null');
});
</doc:scenario>
</doc:example>
*/
var ngOptionsDirective = valueFn({ terminal: true });
var selectDirective = ['$compile', '$parse', function($compile, $parse) {
//00001111100000000000222200000000000000000000003333000000000000044444444444444444000000000555555555555555550000000666666666666666660000000000000007777
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,
nullModelCtrl = {$setViewValue: noop};
return {
restrict: 'E',
require: ['select', '?ngModel'],
controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
var self = this,
optionsMap = {},
ngModelCtrl = nullModelCtrl,
nullOption,
unknownOption;
self.databound = $attrs.ngModel;
self.init = function(ngModelCtrl_, nullOption_, unknownOption_) {
ngModelCtrl = ngModelCtrl_;
nullOption = nullOption_;
unknownOption = unknownOption_;
}
self.addOption = function(value) {
optionsMap[value] = true;
if (ngModelCtrl.$viewValue == value) {
$element.val(value);
if (unknownOption.parent()) unknownOption.remove();
}
};
self.removeOption = function(value) {
if (this.hasOption(value)) {
delete optionsMap[value];
if (ngModelCtrl.$viewValue == value) {
this.renderUnknownOption(value);
}
}
};
self.renderUnknownOption = function(val) {
var unknownVal = '? ' + hashKey(val) + ' ?';
unknownOption.val(unknownVal);
$element.prepend(unknownOption);
$element.val(unknownVal);
unknownOption.prop('selected', true); // needed for IE
}
self.hasOption = function(value) {
return optionsMap.hasOwnProperty(value);
}
$scope.$on('$destroy', function() {
// disable unknown option so that we don't do work when the whole select is being destroyed
self.renderUnknownOption = noop;
});
}],
link: function(scope, element, attr, ctrls) {
// if ngModel is not defined, we don't need to do anything
if (!ctrls[1]) return;
var selectCtrl = ctrls[0],
ngModelCtrl = ctrls[1],
multiple = attr.multiple,
optionsExp = attr.ngOptions,
nullOption = false, // if false, user will not be able to select it (used by ngOptions)
emptyOption,
// we can't just jqLite('<option>') since jqLite is not smart enough
// to create it in <select> and IE barfs otherwise.
optionTemplate = jqLite(document.createElement('option')),
optGroupTemplate =jqLite(document.createElement('optgroup')),
unknownOption = optionTemplate.clone();
// find "null" option
for(var i = 0, children = element.children(), ii = children.length; i < ii; i++) {
if (children[i].value == '') {
emptyOption = nullOption = children.eq(i);
break;
}
}
selectCtrl.init(ngModelCtrl, nullOption, unknownOption);
// required validator
if (multiple && (attr.required || attr.ngRequired)) {
var requiredValidator = function(value) {
ngModelCtrl.$setValidity('required', !attr.required || (value && value.length));
return value;
};
ngModelCtrl.$parsers.push(requiredValidator);
ngModelCtrl.$formatters.unshift(requiredValidator);
attr.$observe('required', function() {
requiredValidator(ngModelCtrl.$viewValue);
});
}
if (optionsExp) Options(scope, element, ngModelCtrl);
else if (multiple) Multiple(scope, element, ngModelCtrl);
else Single(scope, element, ngModelCtrl, selectCtrl);
////////////////////////////
function Single(scope, selectElement, ngModelCtrl, selectCtrl) {
ngModelCtrl.$render = function() {
var viewValue = ngModelCtrl.$viewValue;
if (selectCtrl.hasOption(viewValue)) {
if (unknownOption.parent()) unknownOption.remove();
selectElement.val(viewValue);
if (viewValue === '') emptyOption.prop('selected', true); // to make IE9 happy
} else {
if (isUndefined(viewValue) && emptyOption) {
selectElement.val('');
} else {
selectCtrl.renderUnknownOption(viewValue);
}
}
};
selectElement.bind('change', function() {
scope.$apply(function() {
if (unknownOption.parent()) unknownOption.remove();
ngModelCtrl.$setViewValue(selectElement.val());
});
});
}
function Multiple(scope, selectElement, ctrl) {
var lastView;
ctrl.$render = function() {
var items = new HashMap(ctrl.$viewValue);
forEach(selectElement.children(), function(option) {
option.selected = isDefined(items.get(option.value));
});
};
// we have to do it on each watch since ngModel watches reference, but
// we need to work of an array, so we need to see if anything was inserted/removed
scope.$watch(function() {
if (!equals(lastView, ctrl.$viewValue)) {
lastView = copy(ctrl.$viewValue);
ctrl.$render();
}
});
selectElement.bind('change', function() {
scope.$apply(function() {
var array = [];
forEach(selectElement.children(), function(option) {
if (option.selected) {
array.push(option.value);
}
});
ctrl.$setViewValue(array);
});
});
}
function Options(scope, selectElement, ctrl) {
var match;
if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {
throw Error(
"Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
" but got '" + optionsExp + "'.");
}
var displayFn = $parse(match[2] || match[1]),
valueName = match[4] || match[6],
keyName = match[5],
groupByFn = $parse(match[3] || ''),
valueFn = $parse(match[2] ? match[1] : valueName),
valuesFn = $parse(match[7]),
// This is an array of array of existing option groups in DOM. We try to reuse these if possible
// optionGroupsCache[0] is the options with no option group
// optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element
optionGroupsCache = [[{element: selectElement, label:''}]];
if (nullOption) {
// compile the element since there might be bindings in it
$compile(nullOption)(scope);
// remove the class, which is added automatically because we recompile the element and it
// becomes the compilation root
nullOption.removeClass('ng-scope');
// we need to remove it before calling selectElement.html('') because otherwise IE will
// remove the label from the element. wtf?
nullOption.remove();
}
// clear contents, we'll add what's needed based on the model
selectElement.html('');
selectElement.bind('change', function() {
scope.$apply(function() {
var optionGroup,
collection = valuesFn(scope) || [],
locals = {},
key, value, optionElement, index, groupIndex, length, groupLength;
if (multiple) {
value = [];
for (groupIndex = 0, groupLength = optionGroupsCache.length;
groupIndex < groupLength;
groupIndex++) {
// list of options for that group. (first item has the parent)
optionGroup = optionGroupsCache[groupIndex];
for(index = 1, length = optionGroup.length; index < length; index++) {
if ((optionElement = optionGroup[index].element)[0].selected) {
key = optionElement.val();
if (keyName) locals[keyName] = key;
locals[valueName] = collection[key];
value.push(valueFn(scope, locals));
}
}
}
} else {
key = selectElement.val();
if (key == '?') {
value = undefined;
} else if (key == ''){
value = null;
} else {
locals[valueName] = collection[key];
if (keyName) locals[keyName] = key;
value = valueFn(scope, locals);
}
}
ctrl.$setViewValue(value);
});
});
ctrl.$render = render;
// TODO(vojta): can't we optimize this ?
scope.$watch(render);
function render() {
var optionGroups = {'':[]}, // Temporary location for the option groups before we render them
optionGroupNames = [''],
optionGroupName,
optionGroup,
option,
existingParent, existingOptions, existingOption,
modelValue = ctrl.$modelValue,
values = valuesFn(scope) || [],
keys = keyName ? sortedKeys(values) : values,
groupLength, length,
groupIndex, index,
locals = {},
selected,
selectedSet = false, // nothing is selected yet
lastElement,
element;
if (multiple) {
selectedSet = new HashMap(modelValue);
} else if (modelValue === null || nullOption) {
// if we are not multiselect, and we are null then we have to add the nullOption
optionGroups[''].push({selected:modelValue === null, id:'', label:''});
selectedSet = true;
}
// We now build up the list of options we need (we merge later)
for (index = 0; length = keys.length, index < length; index++) {
locals[valueName] = values[keyName ? locals[keyName]=keys[index]:index];
optionGroupName = groupByFn(scope, locals) || '';
if (!(optionGroup = optionGroups[optionGroupName])) {
optionGroup = optionGroups[optionGroupName] = [];
optionGroupNames.push(optionGroupName);
}
if (multiple) {
selected = selectedSet.remove(valueFn(scope, locals)) != undefined;
} else {
selected = modelValue === valueFn(scope, locals);
selectedSet = selectedSet || selected; // see if at least one item is selected
}
optionGroup.push({
id: keyName ? keys[index] : index, // either the index into array or key from object
label: displayFn(scope, locals) || '', // what will be seen by the user
selected: selected // determine if we should be selected
});
}
if (!multiple && !selectedSet) {
// nothing was selected, we have to insert the undefined item
optionGroups[''].unshift({id:'?', label:'', selected:true});
}
// Now we need to update the list of DOM nodes to match the optionGroups we computed above
for (groupIndex = 0, groupLength = optionGroupNames.length;
groupIndex < groupLength;
groupIndex++) {
// current option group name or '' if no group
optionGroupName = optionGroupNames[groupIndex];
// list of options for that group. (first item has the parent)
optionGroup = optionGroups[optionGroupName];
if (optionGroupsCache.length <= groupIndex) {
// we need to grow the optionGroups
existingParent = {
element: optGroupTemplate.clone().attr('label', optionGroupName),
label: optionGroup.label
};
existingOptions = [existingParent];
optionGroupsCache.push(existingOptions);
selectElement.append(existingParent.element);
} else {
existingOptions = optionGroupsCache[groupIndex];
existingParent = existingOptions[0]; // either SELECT (no group) or OPTGROUP element
// update the OPTGROUP label if not the same.
if (existingParent.label != optionGroupName) {
existingParent.element.attr('label', existingParent.label = optionGroupName);
}
}
lastElement = null; // start at the beginning
for(index = 0, length = optionGroup.length; index < length; index++) {
option = optionGroup[index];
if ((existingOption = existingOptions[index+1])) {
// reuse elements
lastElement = existingOption.element;
if (existingOption.label !== option.label) {
lastElement.text(existingOption.label = option.label);
}
if (existingOption.id !== option.id) {
lastElement.val(existingOption.id = option.id);
}
if (existingOption.element.selected !== option.selected) {
lastElement.prop('selected', (existingOption.selected = option.selected));
}
} else {
// grow elements
// if it's a null option
if (option.id === '' && nullOption) {
// put back the pre-compiled element
element = nullOption;
} else {
// jQuery(v1.4.2) Bug: We should be able to chain the method calls, but
// in this version of jQuery on some browser the .text() returns a string
// rather then the element.
(element = optionTemplate.clone())
.val(option.id)
.attr('selected', option.selected)
.text(option.label);
}
existingOptions.push(existingOption = {
element: element,
label: option.label,
id: option.id,
selected: option.selected
});
if (lastElement) {
lastElement.after(element);
} else {
existingParent.element.append(element);
}
lastElement = element;
}
}
// remove any excessive OPTIONs in a group
index++; // increment since the existingOptions[0] is parent element not OPTION
while(existingOptions.length > index) {
existingOptions.pop().element.remove();
}
}
// remove any excessive OPTGROUPs from select
while(optionGroupsCache.length > groupIndex) {
optionGroupsCache.pop()[0].element.remove();
}
}
}
}
}
}];
var optionDirective = ['$interpolate', function($interpolate) {
var nullSelectCtrl = {
addOption: noop,
removeOption: noop
};
return {
restrict: 'E',
priority: 100,
require: '^select',
compile: function(element, attr) {
if (isUndefined(attr.value)) {
var interpolateFn = $interpolate(element.text(), true);
if (!interpolateFn) {
attr.$set('value', element.text());
}
}
return function (scope, element, attr, selectCtrl) {
if (selectCtrl.databound) {
// For some reason Opera defaults to true and if not overridden this messes up the repeater.
// We don't want the view to drive the initialization of the model anyway.
element.prop('selected', false);
} else {
selectCtrl = nullSelectCtrl;
}
if (interpolateFn) {
scope.$watch(interpolateFn, function(newVal, oldVal) {
attr.$set('value', newVal);
if (newVal !== oldVal) selectCtrl.removeOption(oldVal);
selectCtrl.addOption(newVal);
});
} else {
selectCtrl.addOption(attr.value);
}
element.bind('$destroy', function() {
selectCtrl.removeOption(attr.value);
});
};
}
}
}];
var styleDirective = valueFn({
restrict: 'E',
terminal: true
});
/**
* Setup file for the Scenario.
* Must be first in the compilation/bootstrap list.
*/
// Public namespace
angular.scenario = angular.scenario || {};
/**
* Defines a new output format.
*
* @param {string} name the name of the new output format
* @param {function()} fn function(context, runner) that generates the output
*/
angular.scenario.output = angular.scenario.output || function(name, fn) {
angular.scenario.output[name] = fn;
};
/**
* Defines a new DSL statement. If your factory function returns a Future
* it's returned, otherwise the result is assumed to be a map of functions
* for chaining. Chained functions are subject to the same rules.
*
* Note: All functions on the chain are bound to the chain scope so values
* set on "this" in your statement function are available in the chained
* functions.
*
* @param {string} name The name of the statement
* @param {function()} fn Factory function(), return a function for
* the statement.
*/
angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
angular.scenario.dsl[name] = function() {
function executeStatement(statement, args) {
var result = statement.apply(this, args);
if (angular.isFunction(result) || result instanceof angular.scenario.Future)
return result;
var self = this;
var chain = angular.extend({}, result);
angular.forEach(chain, function(value, name) {
if (angular.isFunction(value)) {
chain[name] = function() {
return executeStatement.call(self, value, arguments);
};
} else {
chain[name] = value;
}
});
return chain;
}
var statement = fn.apply(this, arguments);
return function() {
return executeStatement.call(this, statement, arguments);
};
};
};
/**
* Defines a new matcher for use with the expects() statement. The value
* this.actual (like in Jasmine) is available in your matcher to compare
* against. Your function should return a boolean. The future is automatically
* created for you.
*
* @param {string} name The name of the matcher
* @param {function()} fn The matching function(expected).
*/
angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
angular.scenario.matcher[name] = function(expected) {
var prefix = 'expect ' + this.future.name + ' ';
if (this.inverse) {
prefix += 'not ';
}
var self = this;
this.addFuture(prefix + name + ' ' + angular.toJson(expected),
function(done) {
var error;
self.actual = self.future.value;
if ((self.inverse && fn.call(self, expected)) ||
(!self.inverse && !fn.call(self, expected))) {
error = 'expected ' + angular.toJson(expected) +
' but was ' + angular.toJson(self.actual);
}
done(error);
});
};
};
/**
* Initialize the scenario runner and run !
*
* Access global window and document object
* Access $runner through closure
*
* @param {Object=} config Config options
*/
angular.scenario.setUpAndRun = function(config) {
var href = window.location.href;
var body = _jQuery(document.body);
var output = [];
var objModel = new angular.scenario.ObjectModel($runner);
if (config && config.scenario_output) {
output = config.scenario_output.split(',');
}
angular.forEach(angular.scenario.output, function(fn, name) {
if (!output.length || indexOf(output,name) != -1) {
var context = body.append('<div></div>').find('div:last');
context.attr('id', name);
fn.call({}, context, $runner, objModel);
}
});
if (!/^http/.test(href) && !/^https/.test(href)) {
body.append('<p id="system-error"></p>');
body.find('#system-error').text(
'Scenario runner must be run using http or https. The protocol ' +
href.split(':')[0] + ':// is not supported.'
);
return;
}
var appFrame = body.append('<div id="application"></div>').find('#application');
var application = new angular.scenario.Application(appFrame);
$runner.on('RunnerEnd', function() {
appFrame.css('display', 'none');
appFrame.find('iframe').attr('src', 'about:blank');
});
$runner.on('RunnerError', function(error) {
if (window.console) {
console.log(formatException(error));
} else {
// Do something for IE
alert(error);
}
});
$runner.run(application);
};
/**
* Iterates through list with iterator function that must call the
* continueFunction to continute iterating.
*
* @param {Array} list list to iterate over
* @param {function()} iterator Callback function(value, continueFunction)
* @param {function()} done Callback function(error, result) called when
* iteration finishes or an error occurs.
*/
function asyncForEach(list, iterator, done) {
var i = 0;
function loop(error, index) {
if (index && index > i) {
i = index;
}
if (error || i >= list.length) {
done(error);
} else {
try {
iterator(list[i++], loop);
} catch (e) {
done(e);
}
}
}
loop();
}
/**
* Formats an exception into a string with the stack trace, but limits
* to a specific line length.
*
* @param {Object} error The exception to format, can be anything throwable
* @param {Number=} [maxStackLines=5] max lines of the stack trace to include
* default is 5.
*/
function formatException(error, maxStackLines) {
maxStackLines = maxStackLines || 5;
var message = error.toString();
if (error.stack) {
var stack = error.stack.split('\n');
if (stack[0].indexOf(message) === -1) {
maxStackLines++;
stack.unshift(error.message);
}
message = stack.slice(0, maxStackLines).join('\n');
}
return message;
}
/**
* Returns a function that gets the file name and line number from a
* location in the stack if available based on the call site.
*
* Note: this returns another function because accessing .stack is very
* expensive in Chrome.
*
* @param {Number} offset Number of stack lines to skip
*/
function callerFile(offset) {
var error = new Error();
return function() {
var line = (error.stack || '').split('\n')[offset];
// Clean up the stack trace line
if (line) {
if (line.indexOf('@') !== -1) {
// Firefox
line = line.substring(line.indexOf('@')+1);
} else {
// Chrome
line = line.substring(line.indexOf('(')+1).replace(')', '');
}
}
return line || '';
};
}
/**
* Triggers a browser event. Attempts to choose the right event if one is
* not specified.
*
* @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement
* @param {string} type Optional event type.
* @param {Array.<string>=} keys Optional list of pressed keys
* (valid values: 'alt', 'meta', 'shift', 'ctrl')
*/
function browserTrigger(element, type, keys) {
if (element && !element.nodeName) element = element[0];
if (!element) return;
if (!type) {
type = {
'text': 'change',
'textarea': 'change',
'hidden': 'change',
'password': 'change',
'button': 'click',
'submit': 'click',
'reset': 'click',
'image': 'click',
'checkbox': 'click',
'radio': 'click',
'select-one': 'change',
'select-multiple': 'change'
}[lowercase(element.type)] || 'click';
}
if (lowercase(nodeName_(element)) == 'option') {
element.parentNode.value = element.value;
element = element.parentNode;
type = 'change';
}
keys = keys || [];
function pressed(key) {
return indexOf(keys, key) !== -1;
}
if (msie < 9) {
switch(element.type) {
case 'radio':
case 'checkbox':
element.checked = !element.checked;
break;
}
// WTF!!! Error: Unspecified error.
// Don't know why, but some elements when detached seem to be in inconsistent state and
// calling .fireEvent() on them will result in very unhelpful error (Error: Unspecified error)
// forcing the browser to compute the element position (by reading its CSS)
// puts the element in consistent state.
element.style.posLeft;
// TODO(vojta): create event objects with pressed keys to get it working on IE<9
var ret = element.fireEvent('on' + type);
if (lowercase(element.type) == 'submit') {
while(element) {
if (lowercase(element.nodeName) == 'form') {
element.fireEvent('onsubmit');
break;
}
element = element.parentNode;
}
}
return ret;
} else {
var evnt = document.createEvent('MouseEvents'),
originalPreventDefault = evnt.preventDefault,
iframe = _jQuery('#application iframe')[0],
appWindow = iframe ? iframe.contentWindow : window,
fakeProcessDefault = true,
finalProcessDefault;
// igor: temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=684208
appWindow.angular['ff-684208-preventDefault'] = false;
evnt.preventDefault = function() {
fakeProcessDefault = false;
return originalPreventDefault.apply(evnt, arguments);
};
evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, pressed('ctrl'), pressed('alt'),
pressed('shift'), pressed('meta'), 0, element);
element.dispatchEvent(evnt);
finalProcessDefault = !(appWindow.angular['ff-684208-preventDefault'] || !fakeProcessDefault);
delete appWindow.angular['ff-684208-preventDefault'];
return finalProcessDefault;
}
}
/**
* Don't use the jQuery trigger method since it works incorrectly.
*
* jQuery notifies listeners and then changes the state of a checkbox and
* does not create a real browser event. A real click changes the state of
* the checkbox and then notifies listeners.
*
* To work around this we instead use our own handler that fires a real event.
*/
(function(fn){
var parentTrigger = fn.trigger;
fn.trigger = function(type) {
if (/(click|change|keydown|blur|input)/.test(type)) {
var processDefaults = [];
this.each(function(index, node) {
processDefaults.push(browserTrigger(node, type));
});
// this is not compatible with jQuery - we return an array of returned values,
// so that scenario runner know whether JS code has preventDefault() of the event or not...
return processDefaults;
}
return parentTrigger.apply(this, arguments);
};
})(_jQuery.fn);
/**
* Finds all bindings with the substring match of name and returns an
* array of their values.
*
* @param {string} bindExp The name to match
* @return {Array.<string>} String of binding values
*/
_jQuery.fn.bindings = function(windowJquery, bindExp) {
var result = [], match,
bindSelector = '.ng-binding:visible';
if (angular.isString(bindExp)) {
bindExp = bindExp.replace(/\s/g, '');
match = function (actualExp) {
if (actualExp) {
actualExp = actualExp.replace(/\s/g, '');
if (actualExp == bindExp) return true;
if (actualExp.indexOf(bindExp) == 0) {
return actualExp.charAt(bindExp.length) == '|';
}
}
}
} else if (bindExp) {
match = function(actualExp) {
return actualExp && bindExp.exec(actualExp);
}
} else {
match = function(actualExp) {
return !!actualExp;
};
}
var selection = this.find(bindSelector);
if (this.is(bindSelector)) {
selection = selection.add(this);
}
function push(value) {
if (value == undefined) {
value = '';
} else if (typeof value != 'string') {
value = angular.toJson(value);
}
result.push('' + value);
}
selection.each(function() {
var element = windowJquery(this),
binding;
if (binding = element.data('$binding')) {
if (typeof binding == 'string') {
if (match(binding)) {
push(element.scope().$eval(binding));
}
} else {
if (!angular.isArray(binding)) {
binding = [binding];
}
for(var fns, j=0, jj=binding.length; j<jj; j++) {
fns = binding[j];
if (fns.parts) {
fns = fns.parts;
} else {
fns = [fns];
}
for (var scope, fn, i = 0, ii = fns.length; i < ii; i++) {
if(match((fn = fns[i]).exp)) {
push(fn(scope = scope || element.scope()));
}
}
}
}
}
});
return result;
};
/**
* Represents the application currently being tested and abstracts usage
* of iframes or separate windows.
*
* @param {Object} context jQuery wrapper around HTML context.
*/
angular.scenario.Application = function(context) {
this.context = context;
context.append(
'<h2>Current URL: <a href="about:blank">None</a></h2>' +
'<div id="test-frames"></div>'
);
};
/**
* Gets the jQuery collection of frames. Don't use this directly because
* frames may go stale.
*
* @private
* @return {Object} jQuery collection
*/
angular.scenario.Application.prototype.getFrame_ = function() {
return this.context.find('#test-frames iframe:last');
};
/**
* Gets the window of the test runner frame. Always favor executeAction()
* instead of this method since it prevents you from getting a stale window.
*
* @private
* @return {Object} the window of the frame
*/
angular.scenario.Application.prototype.getWindow_ = function() {
var contentWindow = this.getFrame_().prop('contentWindow');
if (!contentWindow)
throw 'Frame window is not accessible.';
return contentWindow;
};
/**
* Changes the location of the frame.
*
* @param {string} url The URL. If it begins with a # then only the
* hash of the page is changed.
* @param {function()} loadFn function($window, $document) Called when frame loads.
* @param {function()} errorFn function(error) Called if any error when loading.
*/
angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorFn) {
var self = this;
var frame = this.getFrame_();
//TODO(esprehn): Refactor to use rethrow()
errorFn = errorFn || function(e) { throw e; };
if (url === 'about:blank') {
errorFn('Sandbox Error: Navigating to about:blank is not allowed.');
} else if (url.charAt(0) === '#') {
url = frame.attr('src').split('#')[0] + url;
frame.attr('src', url);
this.executeAction(loadFn);
} else {
frame.remove();
this.context.find('#test-frames').append('<iframe>');
frame = this.getFrame_();
frame.load(function() {
frame.unbind();
try {
self.executeAction(loadFn);
} catch (e) {
errorFn(e);
}
}).attr('src', url);
}
this.context.find('> h2 a').attr('href', url).text(url);
};
/**
* Executes a function in the context of the tested application. Will wait
* for all pending angular xhr requests before executing.
*
* @param {function()} action The callback to execute. function($window, $document)
* $document is a jQuery wrapped document.
*/
angular.scenario.Application.prototype.executeAction = function(action) {
var self = this;
var $window = this.getWindow_();
if (!$window.document) {
throw 'Sandbox Error: Application document not accessible.';
}
if (!$window.angular) {
return action.call(this, $window, _jQuery($window.document));
}
angularInit($window.document, function(element) {
var $injector = $window.angular.element(element).injector();
var $element = _jQuery(element);
$element.injector = function() {
return $injector;
};
$injector.invoke(function($browser){
$browser.notifyWhenNoOutstandingRequests(function() {
action.call(self, $window, $element);
});
});
});
};
/**
* The representation of define blocks. Don't used directly, instead use
* define() in your tests.
*
* @param {string} descName Name of the block
* @param {Object} parent describe or undefined if the root.
*/
angular.scenario.Describe = function(descName, parent) {
this.only = parent && parent.only;
this.beforeEachFns = [];
this.afterEachFns = [];
this.its = [];
this.children = [];
this.name = descName;
this.parent = parent;
this.id = angular.scenario.Describe.id++;
/**
* Calls all before functions.
*/
var beforeEachFns = this.beforeEachFns;
this.setupBefore = function() {
if (parent) parent.setupBefore.call(this);
angular.forEach(beforeEachFns, function(fn) { fn.call(this); }, this);
};
/**
* Calls all after functions.
*/
var afterEachFns = this.afterEachFns;
this.setupAfter = function() {
angular.forEach(afterEachFns, function(fn) { fn.call(this); }, this);
if (parent) parent.setupAfter.call(this);
};
};
// Shared Unique ID generator for every describe block
angular.scenario.Describe.id = 0;
// Shared Unique ID generator for every it (spec)
angular.scenario.Describe.specId = 0;
/**
* Defines a block to execute before each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.beforeEach = function(body) {
this.beforeEachFns.push(body);
};
/**
* Defines a block to execute after each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.afterEach = function(body) {
this.afterEachFns.push(body);
};
/**
* Creates a new describe block that's a child of this one.
*
* @param {string} name Name of the block. Appended to the parent block's name.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.describe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
this.children.push(child);
body.call(child);
};
/**
* Same as describe() but makes ddescribe blocks the only to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.ddescribe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
child.only = true;
this.children.push(child);
body.call(child);
};
/**
* Use to disable a describe block.
*/
angular.scenario.Describe.prototype.xdescribe = angular.noop;
/**
* Defines a test.
*
* @param {string} name Name of the test.
* @param {function()} vody Body of the block.
*/
angular.scenario.Describe.prototype.it = function(name, body) {
this.its.push({
id: angular.scenario.Describe.specId++,
definition: this,
only: this.only,
name: name,
before: this.setupBefore,
body: body,
after: this.setupAfter
});
};
/**
* Same as it() but makes iit tests the only test to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.iit = function(name, body) {
this.it.apply(this, arguments);
this.its[this.its.length-1].only = true;
};
/**
* Use to disable a test block.
*/
angular.scenario.Describe.prototype.xit = angular.noop;
/**
* Gets an array of functions representing all the tests (recursively).
* that can be executed with SpecRunner's.
*
* @return {Array<Object>} Array of it blocks {
* definition : Object // parent Describe
* only: boolean
* name: string
* before: Function
* body: Function
* after: Function
* }
*/
angular.scenario.Describe.prototype.getSpecs = function() {
var specs = arguments[0] || [];
angular.forEach(this.children, function(child) {
child.getSpecs(specs);
});
angular.forEach(this.its, function(it) {
specs.push(it);
});
var only = [];
angular.forEach(specs, function(it) {
if (it.only) {
only.push(it);
}
});
return (only.length && only) || specs;
};
/**
* A future action in a spec.
*
* @param {string} name of the future action
* @param {function()} future callback(error, result)
* @param {function()} Optional. function that returns the file/line number.
*/
angular.scenario.Future = function(name, behavior, line) {
this.name = name;
this.behavior = behavior;
this.fulfilled = false;
this.value = undefined;
this.parser = angular.identity;
this.line = line || function() { return ''; };
};
/**
* Executes the behavior of the closure.
*
* @param {function()} doneFn Callback function(error, result)
*/
angular.scenario.Future.prototype.execute = function(doneFn) {
var self = this;
this.behavior(function(error, result) {
self.fulfilled = true;
if (result) {
try {
result = self.parser(result);
} catch(e) {
error = e;
}
}
self.value = error || result;
doneFn(error, result);
});
};
/**
* Configures the future to convert it's final with a function fn(value)
*
* @param {function()} fn function(value) that returns the parsed value
*/
angular.scenario.Future.prototype.parsedWith = function(fn) {
this.parser = fn;
return this;
};
/**
* Configures the future to parse it's final value from JSON
* into objects.
*/
angular.scenario.Future.prototype.fromJson = function() {
return this.parsedWith(angular.fromJson);
};
/**
* Configures the future to convert it's final value from objects
* into JSON.
*/
angular.scenario.Future.prototype.toJson = function() {
return this.parsedWith(angular.toJson);
};
/**
* Maintains an object tree from the runner events.
*
* @param {Object} runner The scenario Runner instance to connect to.
*
* TODO(esprehn): Every output type creates one of these, but we probably
* want one global shared instance. Need to handle events better too
* so the HTML output doesn't need to do spec model.getSpec(spec.id)
* silliness.
*
* TODO(vojta) refactor on, emit methods (from all objects) - use inheritance
*/
angular.scenario.ObjectModel = function(runner) {
var self = this;
this.specMap = {};
this.listeners = [];
this.value = {
name: '',
children: {}
};
runner.on('SpecBegin', function(spec) {
var block = self.value,
definitions = [];
angular.forEach(self.getDefinitionPath(spec), function(def) {
if (!block.children[def.name]) {
block.children[def.name] = {
id: def.id,
name: def.name,
children: {},
specs: {}
};
}
block = block.children[def.name];
definitions.push(def.name);
});
var it = self.specMap[spec.id] =
block.specs[spec.name] =
new angular.scenario.ObjectModel.Spec(spec.id, spec.name, definitions);
// forward the event
self.emit('SpecBegin', it);
});
runner.on('SpecError', function(spec, error) {
var it = self.getSpec(spec.id);
it.status = 'error';
it.error = error;
// forward the event
self.emit('SpecError', it, error);
});
runner.on('SpecEnd', function(spec) {
var it = self.getSpec(spec.id);
complete(it);
// forward the event
self.emit('SpecEnd', it);
});
runner.on('StepBegin', function(spec, step) {
var it = self.getSpec(spec.id);
var step = new angular.scenario.ObjectModel.Step(step.name);
it.steps.push(step);
// forward the event
self.emit('StepBegin', it, step);
});
runner.on('StepEnd', function(spec) {
var it = self.getSpec(spec.id);
var step = it.getLastStep();
if (step.name !== step.name)
throw 'Events fired in the wrong order. Step names don\'t match.';
complete(step);
// forward the event
self.emit('StepEnd', it, step);
});
runner.on('StepFailure', function(spec, step, error) {
var it = self.getSpec(spec.id),
modelStep = it.getLastStep();
modelStep.setErrorStatus('failure', error, step.line());
it.setStatusFromStep(modelStep);
// forward the event
self.emit('StepFailure', it, modelStep, error);
});
runner.on('StepError', function(spec, step, error) {
var it = self.getSpec(spec.id),
modelStep = it.getLastStep();
modelStep.setErrorStatus('error', error, step.line());
it.setStatusFromStep(modelStep);
// forward the event
self.emit('StepError', it, modelStep, error);
});
runner.on('RunnerEnd', function() {
self.emit('RunnerEnd');
});
function complete(item) {
item.endTime = new Date().getTime();
item.duration = item.endTime - item.startTime;
item.status = item.status || 'success';
}
};
/**
* Adds a listener for an event.
*
* @param {string} eventName Name of the event to add a handler for
* @param {function()} listener Function that will be called when event is fired
*/
angular.scenario.ObjectModel.prototype.on = function(eventName, listener) {
eventName = eventName.toLowerCase();
this.listeners[eventName] = this.listeners[eventName] || [];
this.listeners[eventName].push(listener);
};
/**
* Emits an event which notifies listeners and passes extra
* arguments.
*
* @param {string} eventName Name of the event to fire.
*/
angular.scenario.ObjectModel.prototype.emit = function(eventName) {
var self = this,
args = Array.prototype.slice.call(arguments, 1),
eventName = eventName.toLowerCase();
if (this.listeners[eventName]) {
angular.forEach(this.listeners[eventName], function(listener) {
listener.apply(self, args);
});
}
};
/**
* Computes the path of definition describe blocks that wrap around
* this spec.
*
* @param spec Spec to compute the path for.
* @return {Array<Describe>} The describe block path
*/
angular.scenario.ObjectModel.prototype.getDefinitionPath = function(spec) {
var path = [];
var currentDefinition = spec.definition;
while (currentDefinition && currentDefinition.name) {
path.unshift(currentDefinition);
currentDefinition = currentDefinition.parent;
}
return path;
};
/**
* Gets a spec by id.
*
* @param {string} The id of the spec to get the object for.
* @return {Object} the Spec instance
*/
angular.scenario.ObjectModel.prototype.getSpec = function(id) {
return this.specMap[id];
};
/**
* A single it block.
*
* @param {string} id Id of the spec
* @param {string} name Name of the spec
* @param {Array<string>=} definitionNames List of all describe block names that wrap this spec
*/
angular.scenario.ObjectModel.Spec = function(id, name, definitionNames) {
this.id = id;
this.name = name;
this.startTime = new Date().getTime();
this.steps = [];
this.fullDefinitionName = (definitionNames || []).join(' ');
};
/**
* Adds a new step to the Spec.
*
* @param {string} step Name of the step (really name of the future)
* @return {Object} the added step
*/
angular.scenario.ObjectModel.Spec.prototype.addStep = function(name) {
var step = new angular.scenario.ObjectModel.Step(name);
this.steps.push(step);
return step;
};
/**
* Gets the most recent step.
*
* @return {Object} the step
*/
angular.scenario.ObjectModel.Spec.prototype.getLastStep = function() {
return this.steps[this.steps.length-1];
};
/**
* Set status of the Spec from given Step
*
* @param {angular.scenario.ObjectModel.Step} step
*/
angular.scenario.ObjectModel.Spec.prototype.setStatusFromStep = function(step) {
if (!this.status || step.status == 'error') {
this.status = step.status;
this.error = step.error;
this.line = step.line;
}
};
/**
* A single step inside a Spec.
*
* @param {string} step Name of the step
*/
angular.scenario.ObjectModel.Step = function(name) {
this.name = name;
this.startTime = new Date().getTime();
};
/**
* Helper method for setting all error status related properties
*
* @param {string} status
* @param {string} error
* @param {string} line
*/
angular.scenario.ObjectModel.Step.prototype.setErrorStatus = function(status, error, line) {
this.status = status;
this.error = error;
this.line = line;
};
/**
* The representation of define blocks. Don't used directly, instead use
* define() in your tests.
*
* @param {string} descName Name of the block
* @param {Object} parent describe or undefined if the root.
*/
angular.scenario.Describe = function(descName, parent) {
this.only = parent && parent.only;
this.beforeEachFns = [];
this.afterEachFns = [];
this.its = [];
this.children = [];
this.name = descName;
this.parent = parent;
this.id = angular.scenario.Describe.id++;
/**
* Calls all before functions.
*/
var beforeEachFns = this.beforeEachFns;
this.setupBefore = function() {
if (parent) parent.setupBefore.call(this);
angular.forEach(beforeEachFns, function(fn) { fn.call(this); }, this);
};
/**
* Calls all after functions.
*/
var afterEachFns = this.afterEachFns;
this.setupAfter = function() {
angular.forEach(afterEachFns, function(fn) { fn.call(this); }, this);
if (parent) parent.setupAfter.call(this);
};
};
// Shared Unique ID generator for every describe block
angular.scenario.Describe.id = 0;
// Shared Unique ID generator for every it (spec)
angular.scenario.Describe.specId = 0;
/**
* Defines a block to execute before each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.beforeEach = function(body) {
this.beforeEachFns.push(body);
};
/**
* Defines a block to execute after each it or nested describe.
*
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.afterEach = function(body) {
this.afterEachFns.push(body);
};
/**
* Creates a new describe block that's a child of this one.
*
* @param {string} name Name of the block. Appended to the parent block's name.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.describe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
this.children.push(child);
body.call(child);
};
/**
* Same as describe() but makes ddescribe blocks the only to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.ddescribe = function(name, body) {
var child = new angular.scenario.Describe(name, this);
child.only = true;
this.children.push(child);
body.call(child);
};
/**
* Use to disable a describe block.
*/
angular.scenario.Describe.prototype.xdescribe = angular.noop;
/**
* Defines a test.
*
* @param {string} name Name of the test.
* @param {function()} vody Body of the block.
*/
angular.scenario.Describe.prototype.it = function(name, body) {
this.its.push({
id: angular.scenario.Describe.specId++,
definition: this,
only: this.only,
name: name,
before: this.setupBefore,
body: body,
after: this.setupAfter
});
};
/**
* Same as it() but makes iit tests the only test to run.
*
* @param {string} name Name of the test.
* @param {function()} body Body of the block.
*/
angular.scenario.Describe.prototype.iit = function(name, body) {
this.it.apply(this, arguments);
this.its[this.its.length-1].only = true;
};
/**
* Use to disable a test block.
*/
angular.scenario.Describe.prototype.xit = angular.noop;
/**
* Gets an array of functions representing all the tests (recursively).
* that can be executed with SpecRunner's.
*
* @return {Array<Object>} Array of it blocks {
* definition : Object // parent Describe
* only: boolean
* name: string
* before: Function
* body: Function
* after: Function
* }
*/
angular.scenario.Describe.prototype.getSpecs = function() {
var specs = arguments[0] || [];
angular.forEach(this.children, function(child) {
child.getSpecs(specs);
});
angular.forEach(this.its, function(it) {
specs.push(it);
});
var only = [];
angular.forEach(specs, function(it) {
if (it.only) {
only.push(it);
}
});
return (only.length && only) || specs;
};
/**
* Runner for scenarios
*
* Has to be initialized before any test is loaded,
* because it publishes the API into window (global space).
*/
angular.scenario.Runner = function($window) {
this.listeners = [];
this.$window = $window;
this.rootDescribe = new angular.scenario.Describe();
this.currentDescribe = this.rootDescribe;
this.api = {
it: this.it,
iit: this.iit,
xit: angular.noop,
describe: this.describe,
ddescribe: this.ddescribe,
xdescribe: angular.noop,
beforeEach: this.beforeEach,
afterEach: this.afterEach
};
angular.forEach(this.api, angular.bind(this, function(fn, key) {
this.$window[key] = angular.bind(this, fn);
}));
};
/**
* Emits an event which notifies listeners and passes extra
* arguments.
*
* @param {string} eventName Name of the event to fire.
*/
angular.scenario.Runner.prototype.emit = function(eventName) {
var self = this;
var args = Array.prototype.slice.call(arguments, 1);
eventName = eventName.toLowerCase();
if (!this.listeners[eventName])
return;
angular.forEach(this.listeners[eventName], function(listener) {
listener.apply(self, args);
});
};
/**
* Adds a listener for an event.
*
* @param {string} eventName The name of the event to add a handler for
* @param {string} listener The fn(...) that takes the extra arguments from emit()
*/
angular.scenario.Runner.prototype.on = function(eventName, listener) {
eventName = eventName.toLowerCase();
this.listeners[eventName] = this.listeners[eventName] || [];
this.listeners[eventName].push(listener);
};
/**
* Defines a describe block of a spec.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.describe = function(name, body) {
var self = this;
this.currentDescribe.describe(name, function() {
var parentDescribe = self.currentDescribe;
self.currentDescribe = this;
try {
body.call(this);
} finally {
self.currentDescribe = parentDescribe;
}
});
};
/**
* Same as describe, but makes ddescribe the only blocks to run.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.ddescribe = function(name, body) {
var self = this;
this.currentDescribe.ddescribe(name, function() {
var parentDescribe = self.currentDescribe;
self.currentDescribe = this;
try {
body.call(this);
} finally {
self.currentDescribe = parentDescribe;
}
});
};
/**
* Defines a test in a describe block of a spec.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.it = function(name, body) {
this.currentDescribe.it(name, body);
};
/**
* Same as it, but makes iit tests the only tests to run.
*
* @see Describe.js
*
* @param {string} name Name of the block
* @param {function()} body Body of the block
*/
angular.scenario.Runner.prototype.iit = function(name, body) {
this.currentDescribe.iit(name, body);
};
/**
* Defines a function to be called before each it block in the describe
* (and before all nested describes).
*
* @see Describe.js
*
* @param {function()} Callback to execute
*/
angular.scenario.Runner.prototype.beforeEach = function(body) {
this.currentDescribe.beforeEach(body);
};
/**
* Defines a function to be called after each it block in the describe
* (and before all nested describes).
*
* @see Describe.js
*
* @param {function()} Callback to execute
*/
angular.scenario.Runner.prototype.afterEach = function(body) {
this.currentDescribe.afterEach(body);
};
/**
* Creates a new spec runner.
*
* @private
* @param {Object} scope parent scope
*/
angular.scenario.Runner.prototype.createSpecRunner_ = function(scope) {
var child = scope.$new();
var Cls = angular.scenario.SpecRunner;
// Export all the methods to child scope manually as now we don't mess controllers with scopes
// TODO(vojta): refactor scenario runner so that these objects are not tightly coupled as current
for (var name in Cls.prototype)
child[name] = angular.bind(child, Cls.prototype[name]);
Cls.call(child);
return child;
};
/**
* Runs all the loaded tests with the specified runner class on the
* provided application.
*
* @param {angular.scenario.Application} application App to remote control.
*/
angular.scenario.Runner.prototype.run = function(application) {
var self = this;
var $root = angular.injector(['ng']).get('$rootScope');
angular.extend($root, this);
angular.forEach(angular.scenario.Runner.prototype, function(fn, name) {
$root[name] = angular.bind(self, fn);
});
$root.application = application;
$root.emit('RunnerBegin');
asyncForEach(this.rootDescribe.getSpecs(), function(spec, specDone) {
var dslCache = {};
var runner = self.createSpecRunner_($root);
angular.forEach(angular.scenario.dsl, function(fn, key) {
dslCache[key] = fn.call($root);
});
angular.forEach(angular.scenario.dsl, function(fn, key) {
self.$window[key] = function() {
var line = callerFile(3);
var scope = runner.$new();
// Make the dsl accessible on the current chain
scope.dsl = {};
angular.forEach(dslCache, function(fn, key) {
scope.dsl[key] = function() {
return dslCache[key].apply(scope, arguments);
};
});
// Make these methods work on the current chain
scope.addFuture = function() {
Array.prototype.push.call(arguments, line);
return angular.scenario.SpecRunner.
prototype.addFuture.apply(scope, arguments);
};
scope.addFutureAction = function() {
Array.prototype.push.call(arguments, line);
return angular.scenario.SpecRunner.
prototype.addFutureAction.apply(scope, arguments);
};
return scope.dsl[key].apply(scope, arguments);
};
});
runner.run(spec, function() {
runner.$destroy();
specDone.apply(this, arguments);
});
},
function(error) {
if (error) {
self.emit('RunnerError', error);
}
self.emit('RunnerEnd');
});
};
/**
* This class is the "this" of the it/beforeEach/afterEach method.
* Responsibilities:
* - "this" for it/beforeEach/afterEach
* - keep state for single it/beforeEach/afterEach execution
* - keep track of all of the futures to execute
* - run single spec (execute each future)
*/
angular.scenario.SpecRunner = function() {
this.futures = [];
this.afterIndex = 0;
};
/**
* Executes a spec which is an it block with associated before/after functions
* based on the describe nesting.
*
* @param {Object} spec A spec object
* @param {function()} specDone function that is called when the spec finshes. Function(error, index)
*/
angular.scenario.SpecRunner.prototype.run = function(spec, specDone) {
var self = this;
this.spec = spec;
this.emit('SpecBegin', spec);
try {
spec.before.call(this);
spec.body.call(this);
this.afterIndex = this.futures.length;
spec.after.call(this);
} catch (e) {
this.emit('SpecError', spec, e);
this.emit('SpecEnd', spec);
specDone();
return;
}
var handleError = function(error, done) {
if (self.error) {
return done();
}
self.error = true;
done(null, self.afterIndex);
};
asyncForEach(
this.futures,
function(future, futureDone) {
self.step = future;
self.emit('StepBegin', spec, future);
try {
future.execute(function(error) {
if (error) {
self.emit('StepFailure', spec, future, error);
self.emit('StepEnd', spec, future);
return handleError(error, futureDone);
}
self.emit('StepEnd', spec, future);
self.$window.setTimeout(function() { futureDone(); }, 0);
});
} catch (e) {
self.emit('StepError', spec, future, e);
self.emit('StepEnd', spec, future);
handleError(e, futureDone);
}
},
function(e) {
if (e) {
self.emit('SpecError', spec, e);
}
self.emit('SpecEnd', spec);
// Call done in a timeout so exceptions don't recursively
// call this function
self.$window.setTimeout(function() { specDone(); }, 0);
}
);
};
/**
* Adds a new future action.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFuture = function(name, behavior, line) {
var future = new angular.scenario.Future(name, angular.bind(this, behavior), line);
this.futures.push(future);
return future;
};
/**
* Adds a new future action to be executed on the application window.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior, line) {
var self = this;
var NG = /\[ng\\\:/;
return this.addFuture(name, function(done) {
this.application.executeAction(function($window, $document) {
//TODO(esprehn): Refactor this so it doesn't need to be in here.
$document.elements = function(selector) {
var args = Array.prototype.slice.call(arguments, 1);
selector = (self.selector || '') + ' ' + (selector || '');
selector = _jQuery.trim(selector) || '*';
angular.forEach(args, function(value, index) {
selector = selector.replace('$' + (index + 1), value);
});
var result = $document.find(selector);
if (selector.match(NG)) {
result = result.add(selector.replace(NG, '[ng-'), $document);
}
if (!result.length) {
throw {
type: 'selector',
message: 'Selector ' + selector + ' did not match any elements.'
};
}
return result;
};
try {
behavior.call(self, $window, $document, done);
} catch(e) {
if (e.type && e.type === 'selector') {
done(e.message);
} else {
throw e;
}
}
});
}, line);
};
/**
* Shared DSL statements that are useful to all scenarios.
*/
/**
* Usage:
* pause() pauses until you call resume() in the console
*/
angular.scenario.dsl('pause', function() {
return function() {
return this.addFuture('pausing for you to resume', function(done) {
this.emit('InteractivePause', this.spec, this.step);
this.$window.resume = function() { done(); };
});
};
});
/**
* Usage:
* sleep(seconds) pauses the test for specified number of seconds
*/
angular.scenario.dsl('sleep', function() {
return function(time) {
return this.addFuture('sleep for ' + time + ' seconds', function(done) {
this.$window.setTimeout(function() { done(null, time * 1000); }, time * 1000);
});
};
});
/**
* Usage:
* browser().navigateTo(url) Loads the url into the frame
* browser().navigateTo(url, fn) where fn(url) is called and returns the URL to navigate to
* browser().reload() refresh the page (reload the same URL)
* browser().window.href() window.location.href
* browser().window.path() window.location.pathname
* browser().window.search() window.location.search
* browser().window.hash() window.location.hash without # prefix
* browser().location().url() see angular.module.ng.$location#url
* browser().location().path() see angular.module.ng.$location#path
* browser().location().search() see angular.module.ng.$location#search
* browser().location().hash() see angular.module.ng.$location#hash
*/
angular.scenario.dsl('browser', function() {
var chain = {};
chain.navigateTo = function(url, delegate) {
var application = this.application;
return this.addFuture("browser navigate to '" + url + "'", function(done) {
if (delegate) {
url = delegate.call(this, url);
}
application.navigateTo(url, function() {
done(null, url);
}, done);
});
};
chain.reload = function() {
var application = this.application;
return this.addFutureAction('browser reload', function($window, $document, done) {
var href = $window.location.href;
application.navigateTo(href, function() {
done(null, href);
}, done);
});
};
chain.window = function() {
var api = {};
api.href = function() {
return this.addFutureAction('window.location.href', function($window, $document, done) {
done(null, $window.location.href);
});
};
api.path = function() {
return this.addFutureAction('window.location.path', function($window, $document, done) {
done(null, $window.location.pathname);
});
};
api.search = function() {
return this.addFutureAction('window.location.search', function($window, $document, done) {
done(null, $window.location.search);
});
};
api.hash = function() {
return this.addFutureAction('window.location.hash', function($window, $document, done) {
done(null, $window.location.hash.replace('#', ''));
});
};
return api;
};
chain.location = function() {
var api = {};
api.url = function() {
return this.addFutureAction('$location.url()', function($window, $document, done) {
done(null, $document.injector().get('$location').url());
});
};
api.path = function() {
return this.addFutureAction('$location.path()', function($window, $document, done) {
done(null, $document.injector().get('$location').path());
});
};
api.search = function() {
return this.addFutureAction('$location.search()', function($window, $document, done) {
done(null, $document.injector().get('$location').search());
});
};
api.hash = function() {
return this.addFutureAction('$location.hash()', function($window, $document, done) {
done(null, $document.injector().get('$location').hash());
});
};
return api;
};
return function() {
return chain;
};
});
/**
* Usage:
* expect(future).{matcher} where matcher is one of the matchers defined
* with angular.scenario.matcher
*
* ex. expect(binding("name")).toEqual("Elliott")
*/
angular.scenario.dsl('expect', function() {
var chain = angular.extend({}, angular.scenario.matcher);
chain.not = function() {
this.inverse = true;
return chain;
};
return function(future) {
this.future = future;
return chain;
};
});
/**
* Usage:
* using(selector, label) scopes the next DSL element selection
*
* ex.
* using('#foo', "'Foo' text field").input('bar')
*/
angular.scenario.dsl('using', function() {
return function(selector, label) {
this.selector = _jQuery.trim((this.selector||'') + ' ' + selector);
if (angular.isString(label) && label.length) {
this.label = label + ' ( ' + this.selector + ' )';
} else {
this.label = this.selector;
}
return this.dsl;
};
});
/**
* Usage:
* binding(name) returns the value of the first matching binding
*/
angular.scenario.dsl('binding', function() {
return function(name) {
return this.addFutureAction("select binding '" + name + "'", function($window, $document, done) {
var values = $document.elements().bindings($window.angular.element, name);
if (!values.length) {
return done("Binding selector '" + name + "' did not match.");
}
done(null, values[0]);
});
};
});
/**
* Usage:
* input(name).enter(value) enters value in input with specified name
* input(name).check() checks checkbox
* input(name).select(value) selects the radio button with specified name/value
* input(name).val() returns the value of the input.
*/
angular.scenario.dsl('input', function() {
var chain = {};
var supportInputEvent = 'oninput' in document.createElement('div');
chain.enter = function(value, event) {
return this.addFutureAction("input '" + this.name + "' enter '" + value + "'", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
input.val(value);
input.trigger(event || supportInputEvent && 'input' || 'change');
done();
});
};
chain.check = function() {
return this.addFutureAction("checkbox '" + this.name + "' toggle", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox');
input.trigger('click');
done();
});
};
chain.select = function(value) {
return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'", function($window, $document, done) {
var input = $document.
elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio');
input.trigger('click');
done();
});
};
chain.val = function() {
return this.addFutureAction("return input val", function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
done(null,input.val());
});
};
return function(name) {
this.name = name;
return chain;
};
});
/**
* Usage:
* repeater('#products table', 'Product List').count() number of rows
* repeater('#products table', 'Product List').row(1) all bindings in row as an array
* repeater('#products table', 'Product List').column('product.name') all values across all rows in an array
*/
angular.scenario.dsl('repeater', function() {
var chain = {};
chain.count = function() {
return this.addFutureAction("repeater '" + this.label + "' count", function($window, $document, done) {
try {
done(null, $document.elements().length);
} catch (e) {
done(null, 0);
}
});
};
chain.column = function(binding) {
return this.addFutureAction("repeater '" + this.label + "' column '" + binding + "'", function($window, $document, done) {
done(null, $document.elements().bindings($window.angular.element, binding));
});
};
chain.row = function(index) {
return this.addFutureAction("repeater '" + this.label + "' row '" + index + "'", function($window, $document, done) {
var matches = $document.elements().slice(index, index + 1);
if (!matches.length)
return done('row ' + index + ' out of bounds');
done(null, matches.bindings($window.angular.element));
});
};
return function(selector, label) {
this.dsl.using(selector, label);
return chain;
};
});
/**
* Usage:
* select(name).option('value') select one option
* select(name).options('value1', 'value2', ...) select options from a multi select
*/
angular.scenario.dsl('select', function() {
var chain = {};
chain.option = function(value) {
return this.addFutureAction("select '" + this.name + "' option '" + value + "'", function($window, $document, done) {
var select = $document.elements('select[ng\\:model="$1"]', this.name);
var option = select.find('option[value="' + value + '"]');
if (option.length) {
select.val(value);
} else {
option = select.find('option:contains("' + value + '")');
if (option.length) {
select.val(option.val());
}
}
select.trigger('change');
done();
});
};
chain.options = function() {
var values = arguments;
return this.addFutureAction("select '" + this.name + "' options '" + values + "'", function($window, $document, done) {
var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name);
select.val(values);
select.trigger('change');
done();
});
};
return function(name) {
this.name = name;
return chain;
};
});
/**
* Usage:
* element(selector, label).count() get the number of elements that match selector
* element(selector, label).click() clicks an element
* element(selector, label).query(fn) executes fn(selectedElements, done)
* element(selector, label).{method}() gets the value (as defined by jQuery, ex. val)
* element(selector, label).{method}(value) sets the value (as defined by jQuery, ex. val)
* element(selector, label).{method}(key) gets the value (as defined by jQuery, ex. attr)
* element(selector, label).{method}(key, value) sets the value (as defined by jQuery, ex. attr)
*/
angular.scenario.dsl('element', function() {
var KEY_VALUE_METHODS = ['attr', 'css', 'prop'];
var VALUE_METHODS = [
'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width',
'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset'
];
var chain = {};
chain.count = function() {
return this.addFutureAction("element '" + this.label + "' count", function($window, $document, done) {
try {
done(null, $document.elements().length);
} catch (e) {
done(null, 0);
}
});
};
chain.click = function() {
return this.addFutureAction("element '" + this.label + "' click", function($window, $document, done) {
var elements = $document.elements();
var href = elements.attr('href');
var eventProcessDefault = elements.trigger('click')[0];
if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) {
this.application.navigateTo(href, function() {
done();
}, done);
} else {
done();
}
});
};
chain.query = function(fn) {
return this.addFutureAction('element ' + this.label + ' custom query', function($window, $document, done) {
fn.call(this, $document.elements(), done);
});
};
angular.forEach(KEY_VALUE_METHODS, function(methodName) {
chain[methodName] = function(name, value) {
var args = arguments,
futureName = (args.length == 1)
? "element '" + this.label + "' get " + methodName + " '" + name + "'"
: "element '" + this.label + "' set " + methodName + " '" + name + "' to " + "'" + value + "'";
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
done(null, element[methodName].apply(element, args));
});
};
});
angular.forEach(VALUE_METHODS, function(methodName) {
chain[methodName] = function(value) {
var args = arguments,
futureName = (args.length == 0)
? "element '" + this.label + "' " + methodName
: futureName = "element '" + this.label + "' set " + methodName + " to '" + value + "'";
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
done(null, element[methodName].apply(element, args));
});
};
});
return function(selector, label) {
this.dsl.using(selector, label);
return chain;
};
});
/**
* Matchers for implementing specs. Follows the Jasmine spec conventions.
*/
angular.scenario.matcher('toEqual', function(expected) {
return angular.equals(this.actual, expected);
});
angular.scenario.matcher('toBe', function(expected) {
return this.actual === expected;
});
angular.scenario.matcher('toBeDefined', function() {
return angular.isDefined(this.actual);
});
angular.scenario.matcher('toBeTruthy', function() {
return this.actual;
});
angular.scenario.matcher('toBeFalsy', function() {
return !this.actual;
});
angular.scenario.matcher('toMatch', function(expected) {
return new RegExp(expected).test(this.actual);
});
angular.scenario.matcher('toBeNull', function() {
return this.actual === null;
});
angular.scenario.matcher('toContain', function(expected) {
return includes(this.actual, expected);
});
angular.scenario.matcher('toBeLessThan', function(expected) {
return this.actual < expected;
});
angular.scenario.matcher('toBeGreaterThan', function(expected) {
return this.actual > expected;
});
/**
* User Interface for the Scenario Runner.
*
* TODO(esprehn): This should be refactored now that ObjectModel exists
* to use angular bindings for the UI.
*/
angular.scenario.output('html', function(context, runner, model) {
var specUiMap = {},
lastStepUiMap = {};
context.append(
'<div id="header">' +
' <h1><span class="angular">AngularJS</span>: Scenario Test Runner</h1>' +
' <ul id="status-legend" class="status-display">' +
' <li class="status-error">0 Errors</li>' +
' <li class="status-failure">0 Failures</li>' +
' <li class="status-success">0 Passed</li>' +
' </ul>' +
'</div>' +
'<div id="specs">' +
' <div class="test-children"></div>' +
'</div>'
);
runner.on('InteractivePause', function(spec) {
var ui = lastStepUiMap[spec.id];
ui.find('.test-title').
html('paused... <a href="javascript:resume()">resume</a> when ready.');
});
runner.on('SpecBegin', function(spec) {
var ui = findContext(spec);
ui.find('> .tests').append(
'<li class="status-pending test-it"></li>'
);
ui = ui.find('> .tests li:last');
ui.append(
'<div class="test-info">' +
' <p class="test-title">' +
' <span class="timer-result"></span>' +
' <span class="test-name"></span>' +
' </p>' +
'</div>' +
'<div class="scrollpane">' +
' <ol class="test-actions"></ol>' +
'</div>'
);
ui.find('> .test-info .test-name').text(spec.name);
ui.find('> .test-info').click(function() {
var scrollpane = ui.find('> .scrollpane');
var actions = scrollpane.find('> .test-actions');
var name = context.find('> .test-info .test-name');
if (actions.find(':visible').length) {
actions.hide();
name.removeClass('open').addClass('closed');
} else {
actions.show();
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
name.removeClass('closed').addClass('open');
}
});
specUiMap[spec.id] = ui;
});
runner.on('SpecError', function(spec, error) {
var ui = specUiMap[spec.id];
ui.append('<pre></pre>');
ui.find('> pre').text(formatException(error));
});
runner.on('SpecEnd', function(spec) {
var ui = specUiMap[spec.id];
spec = model.getSpec(spec.id);
ui.removeClass('status-pending');
ui.addClass('status-' + spec.status);
ui.find("> .test-info .timer-result").text(spec.duration + "ms");
if (spec.status === 'success') {
ui.find('> .test-info .test-name').addClass('closed');
ui.find('> .scrollpane .test-actions').hide();
}
updateTotals(spec.status);
});
runner.on('StepBegin', function(spec, step) {
var ui = specUiMap[spec.id];
spec = model.getSpec(spec.id);
step = spec.getLastStep();
ui.find('> .scrollpane .test-actions').append('<li class="status-pending"></li>');
var stepUi = lastStepUiMap[spec.id] = ui.find('> .scrollpane .test-actions li:last');
stepUi.append(
'<div class="timer-result"></div>' +
'<div class="test-title"></div>'
);
stepUi.find('> .test-title').text(step.name);
var scrollpane = stepUi.parents('.scrollpane');
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
});
runner.on('StepFailure', function(spec, step, error) {
var ui = lastStepUiMap[spec.id];
addError(ui, step.line, error);
});
runner.on('StepError', function(spec, step, error) {
var ui = lastStepUiMap[spec.id];
addError(ui, step.line, error);
});
runner.on('StepEnd', function(spec, step) {
var stepUi = lastStepUiMap[spec.id];
spec = model.getSpec(spec.id);
step = spec.getLastStep();
stepUi.find('.timer-result').text(step.duration + 'ms');
stepUi.removeClass('status-pending');
stepUi.addClass('status-' + step.status);
var scrollpane = specUiMap[spec.id].find('> .scrollpane');
scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight'));
});
/**
* Finds the context of a spec block defined by the passed definition.
*
* @param {Object} The definition created by the Describe object.
*/
function findContext(spec) {
var currentContext = context.find('#specs');
angular.forEach(model.getDefinitionPath(spec), function(defn) {
var id = 'describe-' + defn.id;
if (!context.find('#' + id).length) {
currentContext.find('> .test-children').append(
'<div class="test-describe" id="' + id + '">' +
' <h2></h2>' +
' <div class="test-children"></div>' +
' <ul class="tests"></ul>' +
'</div>'
);
context.find('#' + id).find('> h2').text('describe: ' + defn.name);
}
currentContext = context.find('#' + id);
});
return context.find('#describe-' + spec.definition.id);
}
/**
* Updates the test counter for the status.
*
* @param {string} the status.
*/
function updateTotals(status) {
var legend = context.find('#status-legend .status-' + status);
var parts = legend.text().split(' ');
var value = (parts[0] * 1) + 1;
legend.text(value + ' ' + parts[1]);
}
/**
* Add an error to a step.
*
* @param {Object} The JQuery wrapped context
* @param {function()} fn() that should return the file/line number of the error
* @param {Object} the error.
*/
function addError(context, line, error) {
context.find('.test-title').append('<pre></pre>');
var message = _jQuery.trim(line() + '\n\n' + formatException(error));
context.find('.test-title pre:last').text(message);
}
});
/**
* Generates JSON output into a context.
*/
angular.scenario.output('json', function(context, runner, model) {
model.on('RunnerEnd', function() {
context.text(angular.toJson(model.value));
});
});
/**
* Generates XML output into a context.
*/
angular.scenario.output('xml', function(context, runner, model) {
var $ = function(args) {return new context.init(args);};
model.on('RunnerEnd', function() {
var scenario = $('<scenario></scenario>');
context.append(scenario);
serializeXml(scenario, model.value);
});
/**
* Convert the tree into XML.
*
* @param {Object} context jQuery context to add the XML to.
* @param {Object} tree node to serialize
*/
function serializeXml(context, tree) {
angular.forEach(tree.children, function(child) {
var describeContext = $('<describe></describe>');
describeContext.attr('id', child.id);
describeContext.attr('name', child.name);
context.append(describeContext);
serializeXml(describeContext, child);
});
var its = $('<its></its>');
context.append(its);
angular.forEach(tree.specs, function(spec) {
var it = $('<it></it>');
it.attr('id', spec.id);
it.attr('name', spec.name);
it.attr('duration', spec.duration);
it.attr('status', spec.status);
its.append(it);
angular.forEach(spec.steps, function(step) {
var stepContext = $('<step></step>');
stepContext.attr('name', step.name);
stepContext.attr('duration', step.duration);
stepContext.attr('status', step.status);
it.append(stepContext);
if (step.error) {
var error = $('<error></error>');
stepContext.append(error);
error.text(formatException(stepContext.error));
}
});
});
}
});
/**
* Creates a global value $result with the result of the runner.
*/
angular.scenario.output('object', function(context, runner, model) {
runner.$window.$result = model.value;
});
bindJQuery();
publishExternalAPI(angular);
var $runner = new angular.scenario.Runner(window),
scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1],
config = {};
angular.forEach(script.attributes, function(attr) {
var match = attr.name.match(/ng[:\-](.*)/);
if (match) {
config[match[1]] = attr.value || true;
}
});
if (config.autotest) {
JQLite(document).ready(function() {
angular.scenario.setUpAndRun(config);
});
}
})(window, document);
angular.element(document).find('head').append('<style type="text/css">@charset "UTF-8";\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],\n.ng-cloak, .x-ng-cloak {\n display: none;\n}\n\nng\\:form {\n display: block;\n}\n</style>');
angular.element(document).find('head').append('<style type="text/css">@charset "UTF-8";\n/* CSS Document */\n\n/** Structure */\nbody {\n font-family: Arial, sans-serif;\n margin: 0;\n font-size: 14px;\n}\n\n#system-error {\n font-size: 1.5em;\n text-align: center;\n}\n\n#json, #xml {\n display: none;\n}\n\n#header {\n position: fixed;\n width: 100%;\n}\n\n#specs {\n padding-top: 50px;\n}\n\n#header .angular {\n font-family: Courier New, monospace;\n font-weight: bold;\n}\n\n#header h1 {\n font-weight: normal;\n float: left;\n font-size: 30px;\n line-height: 30px;\n margin: 0;\n padding: 10px 10px;\n height: 30px;\n}\n\n#application h2,\n#specs h2 {\n margin: 0;\n padding: 0.5em;\n font-size: 1.1em;\n}\n\n#status-legend {\n margin-top: 10px;\n margin-right: 10px;\n}\n\n#header,\n#application,\n.test-info,\n.test-actions li {\n overflow: hidden;\n}\n\n#application {\n margin: 10px;\n}\n\n#application iframe {\n width: 100%;\n height: 758px;\n}\n\n#application .popout {\n float: right;\n}\n\n#application iframe {\n border: none;\n}\n\n.tests li,\n.test-actions li,\n.test-it li,\n.test-it ol,\n.status-display {\n list-style-type: none;\n}\n\n.tests,\n.test-it ol,\n.status-display {\n margin: 0;\n padding: 0;\n}\n\n.test-info {\n margin-left: 1em;\n margin-top: 0.5em;\n border-radius: 8px 0 0 8px;\n -webkit-border-radius: 8px 0 0 8px;\n -moz-border-radius: 8px 0 0 8px;\n cursor: pointer;\n}\n\n.test-info:hover .test-name {\n text-decoration: underline;\n}\n\n.test-info .closed:before {\n content: \'\\25b8\\00A0\';\n}\n\n.test-info .open:before {\n content: \'\\25be\\00A0\';\n font-weight: bold;\n}\n\n.test-it ol {\n margin-left: 2.5em;\n}\n\n.status-display,\n.status-display li {\n float: right;\n}\n\n.status-display li {\n padding: 5px 10px;\n}\n\n.timer-result,\n.test-title {\n display: inline-block;\n margin: 0;\n padding: 4px;\n}\n\n.test-actions .test-title,\n.test-actions .test-result {\n display: table-cell;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n\n.test-actions {\n display: table;\n}\n\n.test-actions li {\n display: table-row;\n}\n\n.timer-result {\n width: 4em;\n padding: 0 10px;\n text-align: right;\n font-family: monospace;\n}\n\n.test-it pre,\n.test-actions pre {\n clear: left;\n color: black;\n margin-left: 6em;\n}\n\n.test-describe {\n padding-bottom: 0.5em;\n}\n\n.test-describe .test-describe {\n margin: 5px 5px 10px 2em;\n}\n\n.test-actions .status-pending .test-title:before {\n content: \'\\00bb\\00A0\';\n}\n\n.scrollpane {\n max-height: 20em;\n overflow: auto;\n}\n\n/** Colors */\n\n#header {\n background-color: #F2C200;\n}\n\n#specs h2 {\n border-top: 2px solid #BABAD1;\n}\n\n#specs h2,\n#application h2 {\n background-color: #efefef;\n}\n\n#application {\n border: 1px solid #BABAD1;\n}\n\n.test-describe .test-describe {\n border-left: 1px solid #BABAD1;\n border-right: 1px solid #BABAD1;\n border-bottom: 1px solid #BABAD1;\n}\n\n.status-display {\n border: 1px solid #777;\n}\n\n.status-display .status-pending,\n.status-pending .test-info {\n background-color: #F9EEBC;\n}\n\n.status-display .status-success,\n.status-success .test-info {\n background-color: #B1D7A1;\n}\n\n.status-display .status-failure,\n.status-failure .test-info {\n background-color: #FF8286;\n}\n\n.status-display .status-error,\n.status-error .test-info {\n background-color: black;\n color: white;\n}\n\n.test-actions .status-success .test-title {\n color: #30B30A;\n}\n\n.test-actions .status-failure .test-title {\n color: #DF0000;\n}\n\n.test-actions .status-error .test-title {\n color: black;\n}\n\n.test-actions .timer-result {\n color: #888;\n}\n</style>'); |
ajax/libs/material-ui/5.0.0-alpha.28/internal/svg-icons/MoreHoriz.min.js | cdnjs/cdnjs | import*as React from"react";import createSvgIcon from"../../utils/createSvgIcon";import{jsx as _jsx}from"react/jsx-runtime";export default createSvgIcon(_jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"); |
app/containers/App/index.js | Princess310/onehower-frontend | /**
*
* App.react.js
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a necessity for you then you can refactor it and remove
* the linting exception.
*/
import React from 'react';
import Grid from 'components/Grid';
import Gallery from 'components/Gallery';
import withProgressBar from 'components/ProgressBar';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
function App(props) {
return (
<MuiThemeProvider>
<div>
{React.Children.toArray(props.children)}
<Gallery />
<Grid />
</div>
</MuiThemeProvider>
);
}
App.propTypes = {
children: React.PropTypes.node,
};
export default withProgressBar(App);
|
app/containers/LanguageProvider/index.js | Generic35/ScalableReactRedux | /*
*
* LanguageProvider
*
* this component connects the redux state language locale to the
* IntlProvider component and i18n messages (loaded from `app/translations`)
*/
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { IntlProvider } from 'react-intl';
import { selectLocale } from './selectors';
export class LanguageProvider extends React.Component { // eslint-disable-line react/prefer-stateless-function
render() {
return (
<IntlProvider locale={this.props.locale} messages={this.props.messages[this.props.locale]}>
{React.Children.only(this.props.children)}
</IntlProvider>
);
}
}
LanguageProvider.propTypes = {
locale: React.PropTypes.string,
messages: React.PropTypes.object,
children: React.PropTypes.element.isRequired,
};
const mapStateToProps = createSelector(
selectLocale(),
(locale) => ({ locale })
);
function mapDispatchToProps(dispatch) {
return {
dispatch,
};
}
export default connect(mapStateToProps, mapDispatchToProps)(LanguageProvider);
|
node_modules/antd/es/progress/progress.js | ZSMingNB/react-news | import _extends from 'babel-runtime/helpers/extends';
import _defineProperty from 'babel-runtime/helpers/defineProperty';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
import PropTypes from 'prop-types';
import React from 'react';
import Icon from '../icon';
import { Circle } from 'rc-progress';
import classNames from 'classnames';
var statusColorMap = {
normal: '#108ee9',
exception: '#ff5500',
success: '#87d068'
};
var Progress = function (_React$Component) {
_inherits(Progress, _React$Component);
function Progress() {
_classCallCheck(this, Progress);
return _possibleConstructorReturn(this, (Progress.__proto__ || Object.getPrototypeOf(Progress)).apply(this, arguments));
}
_createClass(Progress, [{
key: 'render',
value: function render() {
var _classNames;
var props = this.props;
var prefixCls = props.prefixCls,
className = props.className,
_props$percent = props.percent,
percent = _props$percent === undefined ? 0 : _props$percent,
status = props.status,
format = props.format,
trailColor = props.trailColor,
type = props.type,
strokeWidth = props.strokeWidth,
width = props.width,
showInfo = props.showInfo,
_props$gapDegree = props.gapDegree,
gapDegree = _props$gapDegree === undefined ? 0 : _props$gapDegree,
gapPosition = props.gapPosition,
restProps = __rest(props, ["prefixCls", "className", "percent", "status", "format", "trailColor", "type", "strokeWidth", "width", "showInfo", "gapDegree", "gapPosition"]);
var progressStatus = parseInt(percent.toString(), 10) >= 100 && !('status' in props) ? 'success' : status || 'normal';
var progressInfo = void 0;
var progress = void 0;
var textFormatter = format || function (percentNumber) {
return percentNumber + '%';
};
if (showInfo) {
var text = void 0;
var iconType = type === 'circle' || type === 'dashboard' ? '' : '-circle';
if (progressStatus === 'exception') {
text = format ? textFormatter(percent) : React.createElement(Icon, { type: 'cross' + iconType });
} else if (progressStatus === 'success') {
text = format ? textFormatter(percent) : React.createElement(Icon, { type: 'check' + iconType });
} else {
text = textFormatter(percent);
}
progressInfo = React.createElement(
'span',
{ className: prefixCls + '-text' },
text
);
}
if (type === 'line') {
var percentStyle = {
width: percent + '%',
height: strokeWidth || 10
};
progress = React.createElement(
'div',
null,
React.createElement(
'div',
{ className: prefixCls + '-outer' },
React.createElement(
'div',
{ className: prefixCls + '-inner' },
React.createElement('div', { className: prefixCls + '-bg', style: percentStyle })
)
),
progressInfo
);
} else if (type === 'circle' || type === 'dashboard') {
var circleSize = width || 132;
var circleStyle = {
width: circleSize,
height: circleSize,
fontSize: circleSize * 0.16 + 6
};
var circleWidth = strokeWidth || 6;
var gapPos = gapPosition || type === 'dashboard' && 'bottom' || 'top';
var gapDeg = gapDegree || type === 'dashboard' && 75;
progress = React.createElement(
'div',
{ className: prefixCls + '-inner', style: circleStyle },
React.createElement(Circle, { percent: percent, strokeWidth: circleWidth, trailWidth: circleWidth, strokeColor: statusColorMap[progressStatus], trailColor: trailColor, prefixCls: prefixCls, gapDegree: gapDeg, gapPosition: gapPos }),
progressInfo
);
}
var classString = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, prefixCls + '-' + (type === 'dashboard' && 'circle' || type), true), _defineProperty(_classNames, prefixCls + '-status-' + progressStatus, true), _defineProperty(_classNames, prefixCls + '-show-info', showInfo), _classNames), className);
return React.createElement(
'div',
_extends({}, restProps, { className: classString }),
progress
);
}
}]);
return Progress;
}(React.Component);
export default Progress;
Progress.defaultProps = {
type: 'line',
percent: 0,
showInfo: true,
trailColor: '#f3f3f3',
prefixCls: 'ant-progress'
};
Progress.propTypes = {
status: PropTypes.oneOf(['normal', 'exception', 'active', 'success']),
type: PropTypes.oneOf(['line', 'circle', 'dashboard']),
showInfo: PropTypes.bool,
percent: PropTypes.number,
width: PropTypes.number,
strokeWidth: PropTypes.number,
trailColor: PropTypes.string,
format: PropTypes.func,
gapDegree: PropTypes.number
}; |
packages/react-scripts/scripts/utils/verifyPackageTree.js | maletor/create-react-app | // @remove-file-on-eject
/**
* Copyright (c) 2015-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.
*/
'use strict';
const chalk = require('chalk');
const fs = require('fs');
const path = require('path');
// We assume that having wrong versions of these
// in the tree will likely break your setup.
// This is a relatively low-effort way to find common issues.
function verifyPackageTree() {
const depsToCheck = [
// These are packages most likely to break in practice.
// See https://github.com/facebookincubator/create-react-app/issues/1795 for reasons why.
// I have not included Babel here because plugins typically don't import Babel (so it's not affected).
'eslint',
'jest',
'webpack',
'webpack-dev-server',
];
// Inlined from semver-regex, MIT license.
// Don't want to make this a dependency after ejecting.
const getSemverRegex = () =>
/\bv?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b/gi;
const ownPackageJson = require('../../package.json');
const expectedVersionsByDep = {};
// Gather wanted deps
depsToCheck.forEach(dep => {
const expectedVersion = ownPackageJson.dependencies[dep];
if (!expectedVersion) {
throw new Error('This dependency list is outdated, fix it.');
}
if (!getSemverRegex().test(expectedVersion)) {
throw new Error(
`The ${dep} package should be pinned, instead got version ${expectedVersion}.`
);
}
expectedVersionsByDep[dep] = expectedVersion;
});
// Verify we don't have other versions up the tree
let currentDir = __dirname;
// eslint-disable-next-line no-constant-condition
while (true) {
const previousDir = currentDir;
currentDir = path.resolve(currentDir, '..');
if (currentDir === previousDir) {
// We've reached the root.
break;
}
const maybeNodeModules = path.resolve(currentDir, 'node_modules');
if (!fs.existsSync(maybeNodeModules)) {
continue;
}
depsToCheck.forEach(dep => {
const maybeDep = path.resolve(maybeNodeModules, dep);
if (!fs.existsSync(maybeDep)) {
return;
}
const maybeDepPackageJson = path.resolve(maybeDep, 'package.json');
if (!fs.existsSync(maybeDepPackageJson)) {
return;
}
const depPackageJson = JSON.parse(
fs.readFileSync(maybeDepPackageJson, 'utf8')
);
const expectedVersion = expectedVersionsByDep[dep];
if (depPackageJson.version !== expectedVersion) {
console.error(
chalk.red(
`\nThere might be a problem with the project dependency tree.\n` +
`It is likely ${chalk.bold(
'not'
)} a bug in Create React App, but something you need to fix locally.\n\n`
) +
`The ${chalk.bold(
ownPackageJson.name
)} package provided by Create React App requires a dependency:\n\n` +
chalk.green(
` "${chalk.bold(dep)}": "${chalk.bold(expectedVersion)}"\n\n`
) +
`Don't try to install it manually: your package manager does it automatically.\n` +
`However, a different version of ${chalk.bold(
dep
)} was detected higher up in the tree:\n\n` +
` ${chalk.bold(chalk.red(maybeDep))} (version: ${chalk.bold(
chalk.red(depPackageJson.version)
)}) \n\n` +
`Manually installing incompatible versions is known to cause hard-to-debug issues.\n` +
`To fix the dependency tree, try following the steps below in the exact order:\n\n` +
` ${chalk.cyan('1.')} Delete ${chalk.bold(
'package-lock.json'
)} (${chalk.underline('not')} ${chalk.bold(
'package.json'
)}!) and/or ${chalk.bold(
'yarn.lock'
)} in your project folder.\n\n` +
` ${chalk.cyan('2.')} Delete ${chalk.bold(
'node_modules'
)} in your project folder.\n\n` +
` ${chalk.cyan('3.')} Remove "${chalk.bold(
dep
)}" from ${chalk.bold('dependencies')} and/or ${chalk.bold(
'devDependencies'
)} in the ${chalk.bold(
'package.json'
)} file in your project folder.\n\n` +
` ${chalk.cyan('4.')} Run ${chalk.bold(
'npm install'
)} or ${chalk.bold(
'yarn'
)}, depending on the package manager you use.\n\n` +
`In most cases, this should be enough to fix the problem.\n` +
`If this has not helped, there are a few other things you can try:\n\n` +
` ${chalk.cyan('5.')} If you used ${chalk.bold(
'npm'
)}, install ${chalk.bold(
'yarn'
)} (http://yarnpkg.com/) and repeat the above steps with it instead.\n` +
` This may help because npm has known issues with package hoisting which may get resolved in future versions.\n\n` +
` ${chalk.cyan('6.')} Check if ${chalk.bold(
maybeDep
)} is outside your project directory.\n` +
` For example, you might have accidentally installed something in your home folder.\n\n` +
` ${chalk.cyan('7.')} Try running ${chalk.bold(
`npm ls ${dep}`
)} in your project folder.\n` +
` This will tell you which ${chalk.underline(
'other'
)} package (apart from the expected ${chalk.bold(
ownPackageJson.name
)}) installed ${chalk.bold(dep)}.\n\n` +
`If nothing else helps, add ${chalk.bold(
'SKIP_PREFLIGHT_CHECK=true'
)} to an ${chalk.bold('.env')} file in your project.\n` +
`That would permanently disable this preflight check in case you want to proceed anyway.\n\n` +
chalk.cyan(
`P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!\n`
)
);
process.exit(1);
}
});
}
}
module.exports = verifyPackageTree;
|
website/src/pages/index.js | nuke-build/nuke | import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
export default function Home() {
const {siteConfig} = useDocusaurusContext();
return (
<div>
<h1>Something exciting is building...</h1>
<h3>Come back soon!</h3>
</div>
);
}
|
public/localization/nl-BE.js | easybird/easybird.be_blog | module.exports = {
generic: {
LOCALE_DISPLAY: 'Nederlands',
PENCILBLUE: 'PencilBlue',
ALL_RIGHTS: 'Alle rechten voorbehouden',
NONE: 'Geen',
LEFT: 'Links',
CENTER: 'Centreren',
RIGHT: 'Rechts',
YES: 'Ja',
NO: 'Nee',
NEW: 'Nieuw',
LOGIN: 'Login',
LOGOUT: 'Uitloggen',
SIGN_UP: 'Registreer',
NAME: 'Naam',
USERNAME: 'Gebruikersnaam',
PASSWORD: 'Wachtwoord',
DATE: 'Datum',
HOME: 'Home',
BACK_HOME: 'Terug naar de startpagina',
WRITER: 'Schrijver',
READER: 'Lezer',
EDITOR: 'Bewerker',
MANAGING_EDITOR: 'Beherend bewerker',
ADMINISTRATOR: 'Administrator',
COLUMN_INCHES: 'Kolom breedte (inches)',
CONTENT: 'Inhoud',
META_DATA: 'Meta data',
SEO: 'SEO',
FORM_INCOMPLETE: 'Het formulier is onvolledig',
INVALID_UID: 'Er is geen unieke id opgegeven',
ERROR_SAVING: 'Er was een fout tijdens het opslaan',
ERROR_DELETING: 'Er was een fout tijdens het verwijderen',
INSUFFICIENT_CREDENTIALS: 'U bent niet gemachtigd om deze taak uit te voeren',
SAVE: 'Opslaan',
SAVE_DRAFT: 'Concept opslaan',
DRAFT_SAVED: 'Concept is bewaard',
LAST_SAVED: 'Laatst opgeslagen',
PREVIEW: 'Voorbeeld',
CANCEL: 'Annuleer',
EDIT: 'Bewerk',
DELETE: 'Verwijder',
SUBMIT: 'Verzend',
SELECT: 'Selecteer',
MANAGE: 'Beheer',
SORT: 'Orden',
NOW: 'Nu',
CONFIRM_DELETE: 'Bent u zeker dat u wil verwijderen',
LOAD_FILE: 'Laad bestand',
SELECT_FILE: 'Selecteer bestand',
NO_ARTICLES: 'Geen artikels die voldoen aan de criteria',
ACCOUNT: 'Account',
EMAIL: 'Email',
PREFERENCES: 'Voorkeuren',
COMMENT: 'Commentaar',
COMMENTS: 'Commentaren',
SUBMIT_COMMENT: 'Verzend u commentaar',
LOGIN_TO_COMMENT: 'Login om te reageren',
COMMENT_SUBMITTED: 'U commentaar is verzonden',
COMMENT_ERROR: 'Er is iets fout gelopen bij het verzenden van uw commentaar',
DATE_ADDED: 'Datum toegevoegd',
LAST_MODIFIED: 'Laatst bewerkt',
CHECK: 'Check',
AVAILABLE: 'Beschikbaar',
UNAVAILABLE: 'Niet beschikbaar',
INSTALLED_ON: 'Geïnstalleerd op',
VERSION: 'Versie',
ACTIVE_PLUGINS: 'Actieve Plugins',
INACTIVE_PLUGINS: 'Inactieve Plugins',
AVAILABLE_PLUGINS: 'Beschikbare Plugins',
RESET_SETTINGS: 'Reset instellingen',
UNINSTALL: 'Deinstalleer',
INSTALL: 'Installeer',
ACTIVE_PLUGIN_DESCRIPTION: 'Plugins die reeds geïnstalleerd zijn en werken tijdens de opstart van het systeem.',
INACTIVE_PLUGIN_DESCRIPTION: 'Plugins die reeds geïnstalleerd zijn of deels geïnstalleerd zijn, maar niet correct opstarten.',
AVAILABLE_PLUGIN_DESCRIPTION: 'Plugins die beschikbaar zijn, gedownload zijn en klaar zijn om geïnstalleerd te worden.',
PLEASE_WAIT: 'Gelieve te wachten',
VALID_ACTION_REQUIRED: 'Een geldige actie is nodig',
VALID_IDENTIFIER_REQUIRED: 'Een geldige identiteit wordt verwacht',
INSTALL_FAILED: 'De poging om de plugin [%s] the installeren is mislukt',
INSTALL_SUCCESS: 'De plugin [%s] zijn met succes geïnstalleerd',
UNINSTALL_FAILED: 'De poging om de plugin [%s] te installeren is mislukt',
UNINSTALL_SUCCESS: 'De plugin [%s] is succesvol gedeïnstalleerd',
PLUGIN_NOT_FOUND: 'De plugin [%s] werd niet gevonden',
RESET_SETTINGS_FAILED: 'De poging om de instellingen voor de plugin [%s] te resetten is mislukt',
RESET_SETTINGS_SUCCESS: 'De instellingen voor de plugin [%s] zijn met succes gereset',
INITIALIZE: 'Initialiseren',
INITIALIZATION_FAILED: 'De poging om de plugin [%s] te initialiseren is mislukt',
INITIALIZATION_SUCCESS: 'De plugin is succesvol geïnitialiseerd',
PERMISSION: 'Permissie',
PERMISSIONS: 'Permissies',
ACCESS_USER: 'Gebruiker',
ACCESS_WRITER: 'Schrijver',
ACCESS_EDITOR: 'Bewerker',
ACCESS_MANAGING_EDITOR: 'Beherend bewerker',
ACCESS_ADMINISTRATOR: 'Administrator',
UID: 'UID',
AUTHOR_INFORMATION: 'Auteursinformatie',
WEBSITE: 'Website',
CONTRIBUTORS: 'Bijdragers',
ERRORS: 'Errors',
ERRORED: 'Errored',
ACTIVE: 'Actief',
INACTIVE: 'Inactief',
STATUS: 'Status',
THEME_INFORMATION: 'Thema informatie',
TEMPLATES: 'Sjablonen',
SET_THEME_FAILED: 'De poging om het thema [%\'s] te activeren is mislukt',
SET_THEME_SUCCESS: 'Het thema [%\'s] is succesvol geactiveerd',
SAVE_PLUGIN_SETTINGS_SUCCESS: 'De instellingen zijn succesvol bewaard',
SAVE_PUGIN_SETTINGS_FAILURE: 'Er is een probleem opgetreden tijdens het opslaan van de instellingen',
SET_THEME: 'Thema toepassen',
SITE_LOGO_UPLOAD_FAILURE: 'De poging om een nieuw logo te uploaden is mislukt',
SITE_LOGO_UPLOAD_SUCCESS: 'Het logo is met succes geüpload',
TYPE: 'Type',
CONTAINER: 'Container',
SECTION: 'Sectie',
ARTICLE: 'Artikel',
PAGE: 'Pagina',
URL: 'URL',
LINK: 'Link',
CONTENT_SEARCH_EXPLANATION: 'Zoeken naar een atikel of pagina d.m.v de titel en subtitel.',
PARENT_NAV_ITEM: 'Parent Navigatie Item',
NAVIGATION: 'Navigatie',
NAV_MAP: 'Navigatie Map',
NEW_NAV_ITEM: 'Nieuw Navigatie Item',
EDIT_NAVIGATION: 'Bewerk Navigatie Item',
DESCRIPTION: 'Omschrijving',
NAV_MAP_SAVED: 'De navigatie map was succesvol opgeslagen',
SECTIONS: 'Secties',
SERVER: 'Server',
PROCESS_TYPE: 'Process Type',
UPTIME: 'Uptime',
MEMORY_USED: 'Gebruikt geheugen',
SECONDS_ABBR: 'Secs',
NO_AVAILABLE_PLUGINS: 'Geen beschikbare plugins',
READ_MORE: 'Lees meer',
READ_FULL: 'Lees het volledige verhaal',
THEME_DEFAULT: 'Standaard thema',
USER: 'User',
SUBSCRIBE: 'Abboneren',
PRIVACY_POLICY: 'Privacy policy',
MAKE_PB_BETTER: 'Help het verbeteren van PencilBlue door je installatiegegevens te verzenden',
CLOSE: 'Sluit',
APPLY_SETTINGS: 'Pas instellingen toe',
CONFIGURATION_SETTINGS: 'Configureer instellingen',
EXISTING_CUSTOM_OBJECT: 'Het zelfgemaakt object met deze naam bestaat al',
OPTIONS_PARAM_MUST_BE_OBJECT: 'De optie parameter moet een object zijn',
WHERE_CLAUSE_MUST_BE_OBJECT: 'De waar parameter moet een object zijn',
COLLECTION_MUST_BE_STR: 'De collectie parameter moet een string zijn',
COMMAND_MUST_BE_OBJECT: 'Het commando moet een geldig object zijn',
PROCEDURE_MUST_BE_OBJECT: 'Er is een geldig procedureel object nodig om deze index operatie uit te voeren',
OBJ_TO_PARAMS_MUST_BE: 'Het obj moet een object zijn en de paramter moet een string zijn',
EMAIL_NOT_CONFIGURED: 'Email is niet geconfigureerd op deze server',
INVALID_URL: 'Er werd een ongeldig URL opgegeven',
INVALID_MEDIA_URL: 'De media url bevat niet de informatie om te importeren',
UNSUPPORTED_MEDIA: 'Het opgegeven media type is niet ondersteund',
OBJECT_NOT_FOUND: 'Het gevraagd object werd niet gevonden in het systeem',
REQUIRED_FIELD: 'Dit veld is verplicht',
INVALID_FILE: 'Er werd een ongeldig bestand voorzien',
COMPLETE: 'Voltooi',
WYSIWYG: 'WYSIWYG',
THUMBNAIL: 'Thumbnail',
ERROR_CREATING_USER: 'Er is een fout opgetreden tijdens het creëren van de gebruiker',
ERROR_SETTING_ACTIVE_THEME: 'Er is een fout opgetreden tijdens het instellen van uw thema',
ERROR_SETTING_CONTENT_SETTINGS: 'Er is een fout opgetreden tijdens het instellen van de standaard inhoudsinstellingen',
ERROR_SETTING_SYS_INITIALIZED: 'Er is een fout opgetreden tijdens het initialiseren van de systeeminstellingen',
ERROR_SETTING_CALLHOME: 'Er is een fout opgetreden tijdens het isntellen van de raporterings voorkeuren'
},
error: {
ERROR: 'Error',
PAGE_NOT_FOUND: 'De pagina kan niet gevonden worden'
},
timestamp: {
JAN: 'Januari',
FEB: 'Februari',
MAR: 'Maart',
APR: 'April',
MAY: 'Mei',
JUN: 'Juni',
JUL: 'Juli',
AUG: 'Augustus',
SEP: 'September',
OCT: 'Oktober',
NOV: 'November',
DEC: 'December',
TIME_AM: 'AM',
TIME_PM: 'PM'
},
setup: {
REGISTER_ADMIN: 'Registreer het eerste administaror account'
},
login: {
ADMIN_LOGIN: 'Schrijver, bewerker, en administrator login',
USERNAME_OR_EMAIL: 'Gebruikersnaam of e-mailadres',
INVALID_LOGIN: 'Ongeldige gebruikersnaam en wachtwoord combinatie',
READY_TO_USE: 'PencilBlue is klaar voor gebruik',
ACCOUNT_CREATED: 'Uw account is succesvol aangemaakt, u kunt nu inloggen',
FORGOT_PASSWORD: 'Wachtwoord vergeten'
},
admin: {
DASHBOARD: 'Dashboard',
CONTENT: 'Inhoud',
PAGES: 'Pagina\'s',
ARTICLES: 'Artikels',
TOPICS: 'Topics',
MEDIA: 'Media',
CUSTOM_OBJECTS: 'Zelfgemaakte objecten',
PLUGINS: 'Plugins',
THEMES: 'Thema\'s',
LAYOUT: 'Layout',
FRONTEND: 'Frontend plugins',
BACKEND: 'Backend plugins',
INSTALL_PLUGIN: 'Installeer een plugin',
USERS: 'Gebruikers',
SETTINGS: 'Instellingen',
VIEW_SITE: 'Bekijk site',
SITE_SETTINGS: 'Site instellingen',
SITE_LOGO: 'Site logo',
AUTHOR: 'Auteur',
ACCOUNT: 'Account',
CUSTOM_VARIABLES: 'Zelfgemaakte variabelen',
CUSTOM_VARIABLE_KEY: 'Unieke naam voor de variabele',
CUSTOM_VARIABLE_VALUE: 'Waarde geassocieerd met de variabele',
ACTIVE_TOPICS: 'Sleep hier geassocieerde topics',
INACTIVE_TOPICS: 'Sleep hier niet-geassocieerde topics',
FOCUS_KEYWORD: 'Focus sleutelwoord',
FOCUS_KEYWORD_PLACEHOLDER: 'De top sleutelwoorden geassocieerd met de inhoud',
SEO_TITLE: 'SEO titel',
SEO_TITLE_PLACEHOLDER: 'Gelimiteerd tot 70 karakters',
META_DESC: 'Meta omschrijving',
META_DESC_PLACEHOLDER: 'Gelimiteerd tot 156 karakters',
META_KEYWORDS: 'Meta sleutelwoorden',
META_KEYWORDS_PLACEHOLDER: 'kommagescheiden sleutelwoorden',
CREATED: 'is aangemaakt',
ADDED: 'is toegevoegd',
EDITED: 'is bewerkt',
DELETED: 'is verwijderd',
SAVED: 'is opgeslagen',
NARROW_RESULTS: 'Beperk resultaten',
URL_KEY: 'URL sleutel',
FEED_UNAVAILABLE: 'De nieuwsfeed kon niet geladen worden.'
},
topics: {
MANAGE_TOPICS: 'Beheer topics',
NEW_TOPIC: 'Nieuw topic',
TOPIC_NAME: 'Topic naam',
EXISTING_TOPIC: 'Er bestaat reeds een topic met deze naam',
TOPICS_CREATED: 'De topics zijn succesvol gecreëerd',
IMPORT_TOPICS: 'Importeer topics',
IMPORT_TOPICS_HELP: 'Hier kan je een CSV bestand importeren met topic namen. Dit bestand mag geen andere informatie bevatten.',
TOPICS_CSV_FILE: 'CSV bestand met topic namen',
},
media: {
MANAGE_MEDIA: 'Beheer media',
NEW_MEDIA: 'Nieuwe media',
LINK_OR_UPLOAD: 'Link of upload',
LINK_TO_MEDIA: 'Link naar media',
UPLOAD_MEDIA: 'Upload media',
MEDIA_URL: 'Media URL',
MEDIA_URL_PLACEHOLDER: 'Afbeelding, YouTube, Vimeo of Dailymotion link',
LOAD_LINK: 'Link laden',
UPLOAD: 'UPLOAD',
MEDIA_NAME: 'Media naam',
CAPTION: 'Onderschrift',
RELATED_MEDIA: 'Sleep hier geassocieerde media',
UNRELATED_MEDIA: 'Sleep hier niet-geassocieerde media',
MEDIA_FORMATTING: 'Media opmaken',
MAXIMUM_HEIGHT: 'Maximum hoogte',
LINK_TO_IMAGE: 'Link naar afbeelding',
UPLOAD_IMAGE: 'Upload afbeelding',
IMAGE_URL: 'Afbeelding URL',
IMAGE_URL_PLACEHOLDER: '.jpg, .png, .gif, or .svg',
FILE_TOO_BIG: 'Het bestand is groter dan de toegestane grootte'
},
pages: {
MANAGE_PAGES: 'Beheer pagina\'s',
NEW_PAGE: 'Nieuwe pagina',
PAGE_URL: 'Pagina URL',
CUSTOM_URL: 'zelfgemaakte-url',
TEMPLATE: 'Sjabloon',
HEADLINE: 'Titel',
SUBHEADING: 'Subtitel',
PUBLISH_DATE: 'Datum van publicatie'
},
articles: {
MANAGE_ARTICLES: 'Beheer artikels',
NEW_ARTICLE: 'Nieuw artikel',
ARTICLE_URL: 'Artikel URL',
CUSTOM_URL: 'zelfgemaakte-url',
STANDALONE_TEMPLATE: 'Alleenstaand sjabloon',
HEADLINE: 'Titel',
SUBHEADING: 'Subtitel',
PUBLISH_DATE: 'Datum van publicatie',
ACTIVE_SECTIONS: 'Sleep hier geassocieerde secties',
INACTIVE_SECTIONS: 'Sleep hier niet-geassocieerde secties',
PUBLISHED: 'Gepubliceerd',
UNPUBLISHED: 'Ongepubliceerd',
DRAFT: 'Concept',
ALLOW_COMMENTS: 'Commentaar toelaten',
INSERT_READ_MORE: 'Voeg een lees meer knop toe',
},
wysiwyg: {
NORMAL_TEXT: 'Normale tekst',
QUOTE: 'Citaat',
PRE: 'Pre',
HEADING_1: 'Hoofding 1',
HEADING_2: 'Hoofding 2',
HEADING_3: 'Hoofding 3',
HEADING_4: 'Hoofding 4',
HEADING_5: 'Hoofding 5',
HEADING_6: 'Hoofding 6',
ADD_LINK: 'Voeg link toe',
LINK_URL: 'Link URL',
LINK_TEXT: 'Link tekst',
LINK_IN_TAB: 'Open link in een niewe tab/venster',
TEST_LINK: 'Test link',
INSERT_LINK: 'Link invoegen',
ADD_MEDIA: 'Voeg media toe',
INSERT_MEDIA: 'Media invoegen',
SELECT_MEDIA: 'Selecteer media om in te voegen',
ASSOCIATE_MEDIA: 'Associeer media met inhoud',
BOLD: 'Vet',
ITALIC: 'Cursief',
UNDERLINE: 'Onderlijnen',
STRIKETHROUGH: 'Doorhalen',
CLEAR_STYLES: 'Verwijder alle stijlen',
ALIGN_LEFT: 'Links aligneren',
ALIGN_CENTER: 'Centreren',
ALIGN_RIGHT: 'Rechts aligneren',
JUSTIFY: 'Uitvullen',
ORDERED_LIST: 'Geordende lijst',
UNORDERED_LIST: 'Ongeordende lijst',
INSERT_OBJECT: 'Object invoegen',
WYSIWYG_VIEW: 'WYSIWYG zicht',
HTML_VIEW: 'HTML zicht',
MARKDOWN_VIEW: 'Markdown zicht',
TOGGLE_FULLSCREEN: 'Trigger volledig scherm'
},
comments: {
MANAGE_COMMENTS: 'Beheer commentaar',
CONFIRM_DELETE_COMMENT: 'Ben je zeker dat je deze commentaar wilt verwijderen',
COMMENTS_DISABLED: 'Commentaar is uitgeschakeld',
ENABLE_HERE: 'Schakel ze hier in'
},
custom_objects: {
MANAGE_OBJECT_TYPES: 'Beheer object types',
NEW_OBJECT_TYPE: 'Nieuw object type',
MANAGE_OBJECTS: 'Beheer objecten',
NEW_OBJECT: 'Nieuw object',
SORT_SAVED: 'Sortering opgeslagen',
FIELDS: 'Velden',
ADD_FIELD: 'Voeg veld toe',
VALUE: 'Waarde',
TEXT: 'tekst',
BOOLEAN: 'Boolean',
NUMBER: 'Nummer',
PEER_OBJECT: 'Peer object',
CHILD_OBJECTS: 'Child objecten',
OBJECT_TYPE: 'Object type',
FIELD_TYPES: 'Veld types',
ACTIVE_OBJECTS: 'Sleep hier geassocieerde objecten',
INACTIVE_OBJECTS: 'Sleep hier niet-geassocieerde secties',
OBJECTS: 'objecten',
OBJECT: 'object',
DESCRIPTION: 'Omschrijving',
INVALID_FIELD: 'Er werd een ongeldig veld ingegeven.Zorg ervoor dat het veld een unieke naam heeft.'
},
users: {
MANAGE_USERS: 'Beheer gebruikers',
UNVERIFIED_USERS: 'Ongeverifieerde gebruikers',
NEW_USER: 'Niewe gebruiker',
ACCOUNT_INFO: 'Account informatie',
PERSONAL_INFO: 'Persoonlijke informatie',
USERNAME: 'Gebruikersnaam',
USER_PHOTO: 'Gebruikers foto',
FIRST_NAME: 'Voornaam',
LAST_NAME: 'Familienaam',
POSITION: 'Positie',
EMAIL: 'Email',
PASSWORD: 'Wachtwoord',
CHANGE_PASSWORD: 'Wijzig wachtwoord',
RESET_PASSWORD: 'Reset wachtwoord',
CURRENT_PASSWORD: 'Huidig wachtwoord',
CONFIRM_PASSWORD: 'Bevestig wachtwoord',
GENERATE: 'Genereer',
USER_TYPE: 'Gebruikers type',
CREATE_USER: 'Creëer Gebruiker',
USER_DELETE_SELF: 'Gebruiker kan niet zichzelf verwijderen',
PASSWORD_MISMATCH: 'Wachtwoorden komen niet overeen',
EXISTING_USERNAME: 'Gebruikersnaam is reeds geregistreerd',
EXISTING_EMAIL: 'E-mailadres is reeds geregistreerd',
USER_CREATED: 'De gebruiker is succesvol aangemaakt',
USER_EDITED: 'De gebruiker is succesvol bewerkt',
CREATE_ACCOUNT: 'Maak een account aan',
LOGIN_EXISTING: 'Login in een bestaand account',
VERIFICATION_SENT: 'Verificatie mail is verzonden naar',
YOUR_VERIFICATION: 'Een verificatie mail is verzonden naar jouw e-mailadres',
YOUR_PASSWORD_RESET: 'Een wachtwoord reset mail is verstuurd naar jouw e-mailadres',
CHECK_INBOX: 'Gelieve uw inbox te bekijken en te klikken op de voorziene link',
RESEND_VERIFICATION: 'De verificatie mail herzenden',
USER_VERIFIED: 'Dit e-mailadres is reeds geverifieerd',
NOT_REGISTERED: 'Deze gebruikersnaam / e-mailadres is niet geregistreerd',
INVALID_VERIFICATION: 'De verificatie parameters waren incorrect. Gelieve uw e-mailadres opnieuw op te geven.',
EMAIL_VERIFIED: 'Bedankt om uw e-mailadres te verifiëren. U mag nu inloggen.',
MANAGE_ACCOUNT: 'Beheer account',
PROFILE: 'Profiel',
PROFILE_EDITED: 'Uw profiel is succesvol aangepast',
OLD_PASSWORD: 'Oud wachtwoord',
NEW_PASSWORD: 'Nieuw wachtwoord',
INVALID_PASSWORD: 'Verkeerd wachtwoord',
PASSWORD_CHANGED: 'Uw wachtwoord is succesvol aangepast',
NO_PERMISSIONS: 'Geen enkele geïnstalleerde plugin heeft restricties',
CONFIRM_VERIFY: 'Bent u zeker dat u dit wilt verifiëren',
VERIFY: 'verifiëer',
VERIFIED: 'was geverifieerd',
LOCALE_PREFERENCE: 'Lokale voorkeuren'
},
plugins: {
MANAGE_PLUGINS: 'Beheer plugins',
NO_ACTIVE_PLUGINS: 'Geen actieve plugins',
NO_INACTIVE_PLUGINS: 'Geen inactieve plugins',
ABOUT: 'Over',
INSTALLING: 'Installeren',
UNINSTALLING: 'deïnstalleren',
RESETTING: 'Resetten',
INITIALIZING: 'Initialiseren',
ACTIVATING: 'Activeren',
ACTION_ERROR: 'Er trad een error op tijdens het uitvoeren van de actie'
},
themes: {
MANAGE_THEMES: 'Beheer thema\'s'
},
site_settings: {
CONFIGURATION: 'Configuratie',
EDIT_CONFIGURATION: 'Om de configuratie aan te passen, creëer een config.json file in de hoofdmap (root)',
SITE_NAME: 'Site naam',
SITE_ROOT: 'Site root',
DOCUMENT_ROOT: 'Document root',
IP_ADDRESS: 'IP adres',
PORT: 'Poort',
DB_TYPE: 'Database type',
DB_NAME: 'Database naam',
DB_SERVERS: 'Database server(s)',
CONTENT_SETTINGS: 'Inhoudsinstellingen',
LIBRARIES: 'Bibliotheken',
LIBRARY_SETTINGS: 'Bibliotheek instellingen',
LIBRARY_CLUSTER: 'Als je PencilBlue op een cluster server draait, is een restart nodig om alle veranderingen door te voeren',
ARTICLES_PER_PAGE: 'Artikels per pagina',
AUTO_BREAK_ARTICLES: 'Automatisch artikels afbreken na # aantal paragrafen',
READ_MORE_TEXT: 'Lees meer',
DONT_BREAK: 'Niet afbreken',
TIMESTAMP: 'Tijdstempel',
DISPLAY_TIMESTAMP: 'Toon tijdstempels in artikels',
DATE_FORMAT: 'Datum formaat',
TWO_DIGIT_DATE: 'Maanden en dagen met twee cijfers voorstellen',
DISPLAY_HOURS_MINUTES: 'Toon uren en minuten',
TIME_FORMAT: 'Tijdformaat',
TWO_DIGIT_TIME: 'Uren met twee cijfers voorstellen',
AUTHORS: 'AUTEURS',
DISPLAY_BYLINES: 'Toon de auteur bij de artikels',
DISPLAY_AUTHOR_PHOTO: 'Toon de auteur bij de foto\'s',
DISPLAY_AUTHOR_POSITION: 'Toon auteur positie',
ALLOW_COMMENTS: 'Laat gebruikers toe om te reageren',
COMMENTS_ON: 'Laat reacties standaard toe',
REQUIRE_ACCOUNT: 'Verplicht een account om te reageren',
REQUIRE_VERIFICATION: 'Verplicht gebruikers om hun e-mailadres te verifiëren',
SMTP: 'SMTP',
TEST: 'Test',
FROM_NAME: 'Van naam',
FROM_ADDRESS: 'Van adres',
VERIFICATION_SUBJECT: 'Verificatie onderwerp',
VERIFICATION_CONTENT: 'Verificatie inhoud',
SERVICE: 'Service',
CUSTOM: 'Zelfgemaakt',
HOST: 'Host',
SECURE_CONNECTION: 'Secure connection (SSL)',
EMAIL_SETTINGS: 'Email instellingen',
EMAIL_DIRECTIVES_DESCRIPTION: 'Directives: ^verification_url^, ^first_name^, ^last_name^',
SEND_TEST_EMAIL: 'Zend test email',
SEND: 'Zend',
USE_CDN: 'Gebruik CDNs (standaard)',
USE_BOWER: 'Gebruiker Bower',
TEST_EMAIL_SUCCESS: 'Test email succesvol verzonden'
}
};
|
src/checkbox/__tests__/CheckBox.js | martinezguillaume/react-native-elements | import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import CheckBox from '../CheckBox';
describe('CheckBox Component', () => {
it('should render without issues', () => {
const component = shallow(<CheckBox />);
expect(component.length).toBe(1);
expect(toJson(component)).toMatchSnapshot();
});
it('should use TouchableOpacity as default component', () => {
const component = shallow(<CheckBox />);
expect(component.find('TouchableOpacity').length).toBe(1);
});
it('should allow to pass custom component', () => {
const View = jest.fn();
const component = shallow(<CheckBox component={View} />);
expect(component.find('View').length).toBe(1);
});
it('should render title in Text', () => {
const component = shallow(<CheckBox title="Custom Text" checked />);
expect(component.props().children.props.children[1].props.children).toBe(
'Custom Text'
);
});
it('should render with icon and checked', () => {
const component = shallow(
<CheckBox
iconType="font-awesome"
checkedColor="red"
containerStyle={{ backgroundColor: 'red' }}
/>
);
expect(component.length).toBe(1);
expect(toJson(component)).toMatchSnapshot();
});
it('should render with icon and iconRight', () => {
const component = shallow(
<CheckBox
iconType="font-awesome"
iconRight
uncheckedColor="blue"
rigth
center
/>
);
expect(component.length).toBe(1);
expect(toJson(component)).toMatchSnapshot();
});
});
|
src/svg-icons/social/school.js | mit-cml/iot-website-source | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let SocialSchool = (props) => (
<SvgIcon {...props}>
<path d="M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"/>
</SvgIcon>
);
SocialSchool = pure(SocialSchool);
SocialSchool.displayName = 'SocialSchool';
SocialSchool.muiName = 'SvgIcon';
export default SocialSchool;
|
ajax/libs/webshim/1.14.4/dev/shims/combos/26.js | ruslanas/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 <[email protected]>
// 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:""" 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).is('.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();
}
});
}
});
}
});
|
user_guide/searchindex.js | Gilolume/PPE_appli_frais | Search.setIndex({envversion:42,terms:{represent:[25,115,13,79],mybackup:75,yellow:[6,129],poorli:91,four:[149,87,53,135,54,125,121,130,124],prefix:[87,94,2,29],oldest:130,hate:131,optimize_databas:75,forget:[50,103],whose:29,accur:[0,29,114,151,41,93],aug:91,emailaddress:50,my_control:[101,110],site_url:[81,96,21,7,29],illustr:[133,96,149],swap:[41,87,94,110,29],up8:91,under:[142,27,94,33,149,10,0,97,32,29,34,79,109,139,103,131,66,105,106],up6:91,lord:91,up4:91,up5:91,up2:91,spec:96,myselect:92,up1:91,merchant:77,digit:[125,28,55,29],kudo:29,everi:[62,52,136,19,146,53,44,79,149,8,139,140,122,110,103,141,42,106],risk:[103,128,29],"void":[137,87,45,7,90,130,93,96,53,97,55,103,105,106,143,144,112,29,115,81,121,41],internet:[33,96,29],http_host:[30,33],mime_typ:97,del_dir:114,stripslash:[135,29],upstream:29,start_cach:[149,29],applicationconfig:125,set_templ:[143,124],rename_t:[76,29],total_seg:[150,29],ci_db_query_build:149,fopen_write_cr:113,email_attachment_unred:29,preg_match:29,csrf_hash:99,encrypt_nam:[128,29],cmd:49,upload:[92,51,101,54,29],previou:[10,55,33,51,29],sri:91,vector:[79,29],red:[142,145,150,130,6,129,9,50,124],wednesdai:124,enjoy:138,mysqli_driv:35,zlib:29,up35:91,abil:[27,29,125,79,122,106],direct:[28,149,29,54,80,81,9,139],str_repeat:[6,135,33,29],enjoi:[63,54],dowload:16,second:[137,0,2,5,98,45,7,87,92,90,48,91,9,50,11,96,134,135,13,55,136,101,6,103,140,78,143,19,144,107,66,21,108,145,148,109,149,112,146,147,23,75,76,29,114,97,33,81,150,82,152,115,106],aggreg:87,clear_var:[108,29],kaliningrad:91,eldoc:80,even:[87,125,7,9,92,50,132,12,53,97,56,139,93,141,65,110,146,27,29,79,48,150,151],hide:29,date_rss:91,item2:[103,33],neg:[125,5,103,29],get_extens:29,item1:103,exit_unknown_fil:[113,45],calcul:[53,41,87,29],poison:29,yoursit:96,blur:43,num_tag_open:62,"new":[0,3,5,125,7,139,128,141,48,91,74,9,50,131,93,51,95,96,134,53,54,148,99,100,101,102,56,57,103,15,16,17,106,62,19,120,72,66,28,109,110,149,112,71,27,73,23,75,76,29,30,115,33,34,81,150,35,36,37,119,39,67,154,123,153,147,155],net:[29,66,109,139,58,105],ever:[30,92,130,33,139],groupid:125,metadata:89,blog_model:78,med:92,elimin:[115,151,29],kilobyt:128,behavior:[0,29],get_month_nam:19,form_button:[92,29],never:[0,134,29,30,115,33,125,109,110,103,139],last_row:55,here:[0,1,79,5,125,98,92,128,129,48,49,50,11,96,134,53,13,55,136,148,101,6,103,105,78,62,143,19,141,144,147,21,22,108,68,145,74,139,71,27,23,149,29,114,97,33,80,81,151,121,43,41,106,153,124],met:[25,103,66,79],directory_map:[11,29],smtp_timeout:[23,29],ci_calendar:19,path:[11,75,144,29,114,44,78,45,34,88,87,145,90,129,49,94,146,105,132],up45:91,sess_table_nam:[103,33],interpret:29,get_smiley_link:13,forum:[131,141,138,8],row_start:124,anymor:29,characterss:121,loos:[27,52,143,65,125,6],precis:[41,152,34,29],datetim:[96,55,91,29],"_output":[0,29],niue:91,permit:[0,2,3,44,45,92,128,129,9,50,10,94,69,97,98,6,57,103,105,106,130,65,107,149,148,109,96,112,23,75,76,77,29,79,34,150,82,40,41,124],"_fetch_from_arrai":29,blog_config:7,heading_title_cel:19,"_cooki":[106,33,139,29],portabl:[92,2,81],http_x_client_ip:[106,29],message_kei:137,myanmar:91,get_cooki:[106,90,33,29],another_mark_start:41,releas:[42,105,29],unix:[19,29,125,66,91,103,106],cell_start:124,strai:29,mysqli:[29,94,146,87,33,35,70,78],newspac:29,cont:23,txt:[75,144,29,107,140,112,105],unit:[51,116,141,91,29],highli:[52,34,105],set_profiler_sect:[83,97],describ:[5,79,125,45,7,128,9,50,131,151,53,13,14,139,141,21,74,111,26,23,149,78,29,34,83,54,124],would:[137,0,28,43,125,7,9,128,92,122,48,91,74,49,50,93,151,94,12,53,135,54,98,14,6,57,103,132,104,62,143,19,147,108,38,110,25,112,27,136,23,149,29,97,78,81,150,37,115,41,139,124],information_about_someth:125,afterward:[128,79,29],get_filenam:[114,29],dnt:29,program:[79,70],call:[141,34,29],asset:[5,139],typo:[3,29],recommend:[147,23,12,29,125,64,108,79,8,151,128,148,139,141,153,105,70],old_nam:76,protect_braced_quot:20,care:[113,0,148,87,66,79,22,25,9,103,146,106],type:[85,5,1,87,125,44,45,34,47,92,90,122,48,91,9,126,11,12,134,135,13,55,100,102,98,139,16,6,119,142,144,107,94,145,149,25,69,152,71,147,38,75,76,29,114,78,80,46,81,82,118,105,40],until:[62,97,29,33,34,90,103,50,41,141],uniqid:29,set_tempdata:[103,29],error_php:71,unescap:29,product_id_rul:130,inflect:29,notif:29,error_messag:137,notic:[43,13,125,45,128,129,9,50,96,134,53,97,103,143,19,21,22,149,77,29,115,79,151,121,41,124],unbuffered_row:[55,29],warn:[53,103,125,57,29],glass:130,start_dai:19,exce:50,stdclass:55,wm_opac:53,up7:91,last_tag_clos:62,hold:[79,141,109,29],max_filename_incr:[128,29],must:[137,0,86,2,3,43,125,98,45,79,92,128,129,91,9,50,131,94,96,78,134,53,54,55,83,148,101,57,103,58,18,143,130,19,66,108,153,13,28,109,110,25,149,112,146,113,145,23,75,76,29,114,97,33,80,81,37,121,41,141,139],composer_autoload:[44,29],sha256:79,join:[125,103,149,29],some_t:[47,55,48],setup:[25,125,58,141],work:[10,141,29],up3:91,krasnoyarsk:91,form_open:[29,22,130,102,92,50,140],sharp:43,undeliv:23,show_other_dai:19,slash:[136,29,125,135,33,98,7,150,148,129,139],abridg:91,root:[71,0,94,75,141,114,54,98,21,128,103,132,106],newfoundland:91,overrid:[113,0,11,29,110,98,99,83,129,27,146],csv_from_result:[75,29],segment_on:87,create_databas:[76,29],num_row:[111,55,29],give:[29,27,79,149,76,63,125,13,45,81,139,90,6,103,143,50,111,141],send_request:96,greater_than_equal_to:50,smtp:[68,23,29],pg_escape_str:29,indic:[142,43,10,53,98,29,45,7,125,128,91,130,50,104,146],captcha:29,somefil:114,encypt:79,caution:[79,29],unavail:29,want:[137,0,2,43,44,45,7,34,129,92,50,93,94,12,134,53,135,136,55,148,98,103,132,104,105,78,62,143,141,144,65,108,38,109,149,112,79,23,75,76,29,114,115,33,46,81,39,121,122,41,106,84],array_column:[25,29],fieldset:92,mysql_:2,unsign:[103,145,28,76,121],bag:125,read_fil:[114,29],save_queri:[82,83,29],manipul:[89,51,125,29],quot:[142,1,75,87,125,135,20,29,48,92],up575:91,march:29,how:[141,29],enforc:29,hor:53,disappear:43,show_error:[113,80,28,45,29],answer:[135,34],verifi:[94,148,29,145,103,50,16],"_escape_identifi":29,config:[0,13,5,44,45,92,90,129,48,91,9,132,51,11,147,12,54,98,14,6,105,141,64,94,110,25,149,146,113,27,75,29,114,78,34,81,151,83,122],updat:[87,29,34,48,82,141],lao:91,recogn:[25,29],tablenam:[149,48],some_field_nam:128,after:[29,0,149,76,64,98,54,55,34,151,83,129,135,92,122],altogeth:33,diagram:129,befor:[0,149,29,110,98,48,47,129,18,27,146,141],wrong:[103,128,139,81,29],mark_as_temp:[103,29],offlin:[117,99,100,101,102,56,57,58,59,17,61,120,15,71,72,73,74,119,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],random_str:[135,29],mailpath:23,post_imag:6,dbprefix:[71,94,149,78,87,29,48,146],averag:149,allowed_fil:29,util:[89,149,94,12,29],attempt:[0,29,66,81,110,139,106,140,105,93],third:[5,7,92,50,11,134,135,6,103,78,142,19,144,21,22,108,149,147,23,75,29,114,115,33,80,81,82,121],fewer:[94,149,29],username_cal:50,bootstrap:29,greet:96,imposs:[79,109,29],alias:[87,98,29],maintain:[10,86,147,29,53,115,33,65,127,109,9,103,131,112,141],environ:[94,34,29],localdomain:29,reloc:29,enter:[142,143,29],exclus:[114,29],expected_result:143,order:[87,76,29],dblclick:43,wine:129,oper:[113,27,149,29,34,47,105,141],form_submit:[92,130],composit:29,feedback:103,shorten:[125,121],offici:[127,103,33,29],failur:[137,87,125,7,128,91,130,50,12,53,55,148,103,140,142,149,66,108,23,25,96,112,28,75,76,29,114,79,80,48,150,121,124],becaus:[0,33,7,8,92,130,50,12,98,18,103,140,105,106,21,109,25,70,113,149,79,81,121],jpeg:[128,97],field_exist:[47,87],privileg:75,affect:[43,12,29,125,33,98,14,87,82,18,149],highlight_phras:[147,29],japan:91,flexibl:[5,52,74,134,29,33,68],vari:[125,29],myfil:[148,108,134],suffix:29,code_to_run:43,cli:29,img:[6,145,23,29],inflector:[88,29],fwrite:29,add_data:112,not_group_start:149,reduce_multipl:[135,29],inadvert:29,better:[27,29,125,79,122,110,9,131,141],or_group_start:149,persist:[142,94,23,87,29,109,103],comprehens:[50,8],hidden:[43,11,0,125,29,22,130,83,92,140],img_url:145,increment_str:[135,29],them:[137,0,28,87,125,44,119,79,155,106,128,122,91,74,9,50,93,94,95,12,58,53,136,13,55,83,148,99,100,101,102,56,57,153,98,103,15,16,17,60,62,113,130,120,149,72,65,140,121,21,108,123,38,110,25,96,115,71,27,73,23,141,76,29,30,31,32,33,34,59,35,36,37,118,54,39,40,154,61,139,117,67],row_end:124,thei:[43,1,79,0,125,98,7,34,87,9,92,49,50,147,12,78,134,53,135,54,55,14,99,100,102,57,103,18,19,141,20,21,68,28,25,96,27,136,23,149,76,29,115,33,80,46,81,41,106],fragment:[28,134],safe:[147,79,69,29,33,46,81,130,103,92,12,140],compress_output:[56,29],"break":[149,29],sqlite3:[33,70,29],db_name:76,get_mim:[113,105,29],"_remove_invisible_charact":29,request_uri:[106,64,29],drop_tabl:[76,29],choic:[79,135,33,7,6,103,50],grammat:29,mytabl:[149,111,75,34,124],f4v:29,my_mark_start:41,odbc:[94,33,70,29],bonu:9,timeout:[66,23,96,146,87],each:[137,0,136,3,43,125,44,7,87,130,143,129,91,52,92,50,93,11,12,135,54,55,151,138,103,132,142,63,19,121,21,22,108,94,28,25,96,111,112,146,27,23,149,29,115,79,34,83,40,122,41,124],debug:[45,83,12,48,29],went:21,european:91,oblig:7,side:[62,43,136,96,29,125,33,128,149],mean:[43,79,12,91,87,125,129,33,136,22,68,102,56,7,109,130,103,111,141],monolith:84,list:[94,87,29],wm_vrt_offset:53,saturdai:[19,124],flock:29,ommit:25,extract:[25,23,108,106],tgz:29,depress:6,network:29,goe:[127,33,79,109,29],open:[0,149,10,29,44,78,49,110,27,9,141,132],dst:91,dsn:[94,23,146,29],rewrit:[37,151,29],sprintf:[50,33],got:29,force_download:[75,144,29],forth:147,"_reindex_seg":29,database2_nam:146,is_:29,linear:109,navig:[49,62,140],written:[62,0,94,29,53,33,45,21,22,151,81,143,121,18,27,127,103,114],smtp_host:23,somesit:126,situat:[94,79,149,34,29],given:[137,130,19,29,53,33,103,108,114,50,121,91,40,25,12,131,150,112,84],quoted_printable_encod:[25,105,29],standard:29,add_drop:75,element:[85,27,136,75,134,108,29,115,33,21,22,43,92,128,142,25,50,124],"_truncat":29,error_url_miss:137,blog_descript:[28,76],memory_usag:[41,97,83],md5:[79,69,29,135,33,139],anchor_class:29,angl:53,isp:103,openssl:[33,79],"001_add_blog":28,filter:[98,29],link_tag:[6,29],att:81,mvc:[63,134,78,65,136,131],pagin:[51,11,34,29],isn:[137,142,75,76,29,98,79,45,149,50,106],iphon:93,codeignit:29,confus:[115,29],bite:43,rand:[149,29],rang:[147,53,79,91,131,112],render:[62,0,136,33,29,97,13,80,14,22,21,82,83,133,129,18,115,43,139,140],fetch_directori:29,accent:[147,29],clariti:[125,56,21,91,29],hellip:147,exit_unknown_method:113,restrict:[77,114,128,105,139,84,57],hook:[110,80,29],instruct:[125,44,51,29],autoinit:29,messag:[75,87,29,48,151,49,12,105,141],wasn:[21,29],daylight_sav:91,agre:10,primari:[94,96,76,149,29,87,21,7,47,145,121,103],hood:[27,79],form_label:[92,29],nomin:100,top:[62,43,11,136,29,53,115,54,45,14,50],reverse_nam:55,result_arrai:[149,29,115,55,21,111],downsid:103,cumul:[149,76],master:[53,91,7,141],too:[94,23,29,125,33,139],similarli:[92,103,90,33,137],my_view:29,gilbert:91,john:[96,53,115,92,49,141,124],ci_rout:33,rempath:148,prep_url:[50,81,29],library_src:43,is_doubl:143,namespac:29,tool:29,notice_area:43,albert:142,took:141,user_ag:[35,37,101,29],alpha_numeric_spac:[50,29],sha1:[135,139,69,29],western:91,somewhat:79,local_tim:19,error_:137,crawl:29,technic:[52,136,80,103,139,50],fileperm:114,target:[43,149,87,53,29,81,121,92,112,141],keyword:[125,6,149,29],consequ:101,provid:[137,43,79,87,125,126,45,7,47,128,129,91,130,50,131,93,10,94,69,55,14,100,6,103,140,106,19,20,22,38,109,139,25,27,23,149,76,77,29,115,33,80,81,150,39,121,84,124],previous_url:19,set_error:[121,29],older:[103,33,147,109,29],tree:112,told:[0,50],returned_valu:114,project:[10,94,127,49,131,84,141],matter:[103,41,64],solomon:91,rfc2616:29,entri:[29,96,78,66,33,98,81,6,121],date_rfc1123:91,minut:[103,66,18,91],beginn:79,explicitli:[114,146,81,29],file_exceeds_limit:29,week_dai:19,ran:[142,22,124],ram:79,mind:[62,142,79,48,109,139,103],auto_clear:23,raw:[143,23,75,76,29,53,97,66,79,80,103,121,25,50],seed:[79,149,21,29],rar:29,manner:[29,97,79,125,33,2,103,28,141],increment:[19,29,135,66,79,128,109],super_class:125,seen:[133,131,33,121],seem:[125,142,3,18,29],incompat:29,encode_php_tag:[50,69],translate_uri_dash:[98,29],result_object:55,cal_cell_end_oth:19,is_php:[113,105,29],captal:29,is_nul:143,myusernam:[146,78],latter:[125,22],encode_from_legaci:[101,109,29],common_funct:25,thorough:[121,84,29],week_day_cel:19,point2:41,contact:[139,81],transmit:29,data1:115,moscow:91,simplifi:[82,111,87,34,29],set_rul:[50,22,29],endfor:151,trans_complet:[12,87],though:[43,79,29,53,33,7,125,103],option_nam:130,scripto:43,my_arrai:92,legibl:125,unknowingli:139,next_link:[62,29],mario:142,regular:[87,76,29],letter:[29,0,136,109,78,125,135,33,137,91],herebi:77,svg10:6,mdate:91,"_set_uri_str":29,cap:[145,29],everyth:[142,5,79,96,29,33,22,148,130,103],prematur:56,yourdomain:90,tradit:[89,27,78],cal_cell_end:19,simplic:[52,149,78],don:[86,79,87,125,7,91,50,97,98,136,103,140,141,142,19,65,66,68,109,139,146,27,23,29,33,34,48,121],mailtyp:[23,108],doc:29,tempdata:29,clean_file_nam:29,trans_start:[87,12,29],blog_author:76,max_width:128,doe:[141,29],dblib:29,dummi:33,declar:[0,76,29,114,143,55,7,25,125,6,129,110,9,103],probabl:[103,79,34,22],wildcard:[87,149,48,29],no_file_select:29,detriment:34,left:[62,0,147,75,149,43,53,115,136,21,150,125,153,96,140],sum:[149,29],dot:29,class_nam:[38,55,104],reactor:[127,29],visitor:[29,33,56,139,106,93],whitelist:[140,29],random:[142,79,149,29,135,33,145,128,109,49,140],"__ci_var":103,endwhil:151,radiu:142,use_page_numb:[62,29],advisori:[103,33],radio:[92,50,29],earth:29,form_error:[92,50],autoload:[44,27,78,146,29],fennec:29,maxlength:[92,130,29],involv:[10,19,143,53,128,96,104],absolut:[94,148,29,53,107,79,128,92,103],arcfour:79,layout:[86,75,124],acquir:[114,103,127],libari:29,field2:[149,106],menu:[92,50,134,91,29],explain:[63,19,33,103,108,139,128,96,9,50,141],configur:29,apach:[5,128,14,106],errantli:29,secretsmittypass:96,wm_pad:53,theme:43,explic:29,rich:[131,84],iconv_en:113,display_respons:96,folder:[0,13,44,49,11,95,54,56,57,15,16,17,18,72,94,145,71,27,73,74,29,114,80,34,35,36,37,39,123,153,154,155],changedir:148,set_head:[124,97,23,81,29],csrf_verifi:29,nasti:22,enable_profil:[83,97],stop:[29,23,149,87,97,41],compli:23,consecut:20,font_path:145,report:29,my_app_index:108,directory_nam:134,tge:29,bat:[125,80],bar:[62,148,125,98,66,97,80,108,122,18,103,9,50,132],first_url:[62,29],emb:[139,23],ietf:29,baz:125,form_hidden:[92,130,29],patch:[106,98,141,29],twice:[149,29],bad:[29,147,79,96,78,33],ruleset:29,local_to_gmt:91,septemb:29,steal:103,"_ci_view_fil":29,mssql_get_last_messag:29,guiana:91,odbc_field_:29,urldecod:50,rollback:[12,29],datatyp:[143,96,76],num:[135,6,98,152],mandatori:79,result:[87,2,34,146,29],auto_incr:[28,76,29,21,145,121],fail:[12,29,53,66,79,48,87,101,96,121,50,140,141],themselv:[68,125,38],"_call_hook":29,best:[10,48],subject:[143,23,77,29,126,141],brazil:91,awar:[80,29],set_userdata:103,said:[103,33,79],new_path:112,databas:29,wikipedia:49,source_dir:[114,11,29],figur:87,"_error_numb":29,mua:29,invalu:125,drawn:29,awai:53,irc:8,approach:141,attribut:[85,76,29,114,33,55,81,130,6,91,92,105],inabl:125,accord:[50,96],socket_typ:66,extend:[49,0,87,29],newnam:[23,29],column_to_drop:76,session_dummy_driv:103,boss:149,"_execut":29,"_get":[106,33,139,29],week_row_end:19,html4:6,html5:[6,33,147,29],recent:139,http_raw_post_data:29,natur:[50,149,29],advertis:29,subfold:29,unaffect:29,form_validation_lang:[137,50,29],unfound:29,cop:[96,134],protect:29,accident:29,expos:[103,29],trale:29,howev:[0,33,125,98,7,130,128,129,9,50,131,132,96,53,135,97,55,56,103,105,141,62,143,66,109,110,112,149,115,79,48,122,139],against:[28,149,29,108,121,69],compile_bind:[87,29],logic:[18,87,149,14,29],mydirectori:11,boldlist:6,login:[98,81],browser:[0,97,90,129,49,93,133,134,53,54,14,56,18,103,140,106,144,108,22,21,139,147,136,29,115,33,81,41],com:[0,136,5,125,6,92,90,49,50,131,96,134,135,13,98,102,126,103,106,62,19,145,148,71,23,29,33,34,81,150,82,37,121,43,141,128],col:[92,13],rehash:25,tough:141,debugg:29,log_path:29,set_checkbox:[92,50,29],standardize_newlin:29,loader:[43,11,75,76,29,44,66,116,35,36,51,110],ascii_to_ent:[147,29],wider:53,guid:[38,29,24,9,139,146,104,141],assum:[79,87,7,92,50,132,94,12,13,136,56,57,62,19,74,109,71,72,73,23,149,29,33,34,48,35,37],"_parse_query_str":29,user_data:[33,153,29],duplic:[97,135,121,29],reciev:126,welcome_messag:[110,108,29],"_request":139,chrome:29,unwant:125,three:[62,28,96,149,29,53,98,20,45,34,22,92,23,48,103,9,50,135,124,139,114],been:[137,43,87,45,129,91,50,69,134,97,55,99,100,101,102,103,105,106,21,108,109,71,28,149,76,29,31,33,34,118,119,141,124],legend:[53,92],formsuccess:50,plaintext:23,ar_cach:29,trigger:[29,43,52,5,80,33,45,139,128,129,107,50,140],interest:84,basic:29,clear_attach:23,mytext:144,openssl_random_pseudo_byt:[25,140],hesit:125,quickli:80,up65:91,life:140,rfc5321:29,html_entity_decod:[140,29],unset_userdata:[103,33,29],eastern:91,suppress:[62,125,7,29],magic_quotes_runtim:29,search:[62,5,149,64,135,33,29,81,150,68,48,25,131,106,71,93],anywher:[27,41,83,97,18],lift:146,child:[68,38],"catch":[125,98,29],suar:6,blog_control:78,ugli:[125,145],ident:[0,2,125,7,34,9,90,91,92,50,53,55,101,6,106,130,20,110,113,27,38,149,76,29,115,46,81,150,41],quantiti:[92,130,29],cache_set_path:87,mitig:[139,29],properti:[43,86,28,29,53,97,20,33,55,108,99,125,122,9,103,130,106],air:124,aim:[33,79],form_upload:92,weren:29,form_validation_:[33,29],get_compiled_upd:[149,29],publicli:[29,13,79,33,7,103,141],allow_get_arrai:106,aid:29,vagu:141,anchor:[29,43,27,33,81,128,50],redisexcept:29,opt:[103,131,33],template1:115,form_clos:92,printabl:29,set_delimit:115,somelibrari:125,tabl:[94,87,111,29],toolkit:[131,84],filename2:137,memcach:29,need:[137,0,2,3,43,125,44,7,8,87,49,90,92,5,48,91,9,50,122,128,131,93,133,52,147,12,134,53,13,98,136,99,100,101,102,18,103,132,16,78,62,143,130,141,144,64,65,66,94,21,22,108,145,28,149,109,110,96,112,79,27,23,75,146,29,30,97,33,80,34,81,150,83,118,121,115,129,41,106,139,84,124],marco:29,cond:149,conf:[3,29],wm_shadow_dist:53,tediou:50,master_dim:[53,29],sever:[63,74,96,76,29,87,55,149,68,143,91,110,130,50,153,132],log_date_format:29,disabl:[94,12,29,87,45,34,14,82,151,129,149,105],invalid_dimens:29,harmoni:29,incorrectli:29,perform:29,suggest:[27,33,108,29],make:[10,141,76,146,29],db_result:29,camellia:79,"ros\u00e9n":29,complex:[149,65,136,6,121,50,84],strip_quot:[135,29],split:[63,147,87],chatroom:8,"__set":[103,55,29],complet:[143,23,12,149,29,53,33,45,108,8,87,147,6,150,121,103,111,124,93],elli:127,prev_link:[62,29],evid:98,http_x_forwarded_for:[106,29],blue:[50,6,129,148,124],rail:127,cache_overrid:129,evil:29,hand:[92,0,28,50],fairli:[65,103,128,139],rais:[48,29],upload_lang:29,bia:103,techniqu:[139,79,140],dhaka:29,charlim:147,kept:[43,13,29,115,33,109,126,130,103,141,140,106],undesir:139,scenario:50,java:105,post_dat:91,linkifi:81,flush_cach:[149,29],min:[149,29],fatal:[125,66,98,29],taint:139,inherit:[0,86,19,29],stop_cach:[149,29],client:[29,43,94,23,87,30,33,128],shortli:50,thi:[10,141,29],endif:[130,151],gzip:[75,56,29],programm:[125,131,8],next_row:[55,29],url_suffix:[62,71,81,29],identifi:[87,141,29],just:[142,1,79,87,44,9,92,49,50,12,53,135,102,103,140,106,62,21,22,108,68,28,139,149,27,23,75,76,29,33,80,81],safe_mod:29,wm_font_siz:53,photo:[53,112,144],ordin:81,array_replac:[25,29],up55:91,via:[149,76,29,48,75,141],stringenc:125,human:[71,5,29,80,81,91,40,50],yet:[12,21,22,121,50,105],languag:[11,29,125,44,88,91,110,49,84],previous:[58,29],shoud:7,group_bi:[149,29],xmlhttprequest:29,greenwich:91,easi:[62,5,29,79,108,137,101,103,106],explictli:62,declin:141,had:[101,33,29],"_end":41,ci_vers:[113,29],is_float:143,x_axi:53,ak_my_design:147,"0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz":145,date_iso8601:[91,29],swap_pr:[94,29],els:[0,125,126,45,128,50,93,12,139,105,106,22,96,149,29,30,33,80,48,150,114,151,121],ffffff:53,save:[0,23,149,91,134,29,125,98,66,79,45,34,7,130,128,18,109,49],hat:127,transit:[101,6,29],gave:[121,29,8],sanit:[69,29,21,22,139,50,140,105],applic:[0,86,149,110,29,44,87,45,14,34,49,94,24,18,27,9,129,105,146],csprng:25,get_compiled_select:[149,29],measur:[53,54,57],preserv:[53,103,121,140,29],disposit:[23,29],regard:[52,19,149,53,45,108,125,139,50,153],credit:141,lightbox:6,distanc:53,or_where_in:[149,29],rewrite_short_tag:[37,29],background:[103,145,33,147,29],field_nam:[87,29,55,34,47,128,50],cape:91,database_nam:[94,75],apart:122,hmac_kei:79,"_parse_request_uri":29,handpick:127,"_csrf_set_hash":29,specif:[94,87,146,29],"_displai":[97,129,29],insert_id:[82,29],arbitrari:[41,96,94,48,29],manual:[94,34,29],certificat:94,get_client_info:2,varieti:[80,84,29],multiselect:92,night:6,funcion:29,unnecessari:[139,112],underli:[103,94,80,87],www:[23,96,29,13,98,81,6,54,121,103,105],right:[62,43,136,96,10,77,0,53,115,29,21,150,130,129,49,149,41,147,84,141],old:[62,145,79,29,97,33,81,139,148,109,103,50,153,70],deal:[137,27,69,77,29,79,87,50],negat:[66,29],interv:91,excerpt:121,user_model:78,dead:29,fetchabl:48,born:112,intern:[137,79,29,125,33,55,81,100,37,139,130,103],printer:6,elaps:[41,83,91,87],interf:29,successfulli:[148,29,126,33,45,22,128,121,130,50],password_needs_rehash:25,transmiss:79,less_than_equal_to:50,thu:[50,139,98,96,29],total:[83,87,55,111,29],ico:6,bottom:[71,43,136,29,53,97,83,91],file_get_cont:[114,97,33,29],subclass:[86,29],not_lik:[149,29],raw_nam:128,pmachin:29,equal:[43,149,143,29,50,105,124],word_length:[145,29],rdfa:6,overcom:98,condit:[29,149,77,87,125,33,22,48,103],foo:[143,1,148,29,125,98,66,97,80,108,92,101,122,18,9,103,132],my_tabl:[82,111,55,149,124],localhost:[43,94,96,78,29,103,146],core:[149,29],plu:[92,143,6,81,7],who:[10,78,125,98,110,139],cal_cell_start_todai:19,passwordconfirm:50,name_of_last_city_us:125,someclass:[9,134],insecur:[33,7,29],pose:14,cellpad:[130,143,19,124],add_dir:112,set_alt_messag:23,scrollabl:29,repositori:[137,80,141],post:[142,0,78,29,98,81,83,92,139],"super":[96,29,125,136,108,122,109,9],shuck:147,unsaf:[103,33],um4:91,um7:91,first_tag_clos:62,um1:91,troubl:[33,141],um3:91,um2:91,get_flash_kei:103,invoice_id:149,is_ajax_request:[106,29],um9:91,um8:91,surround:62,reduce_double_slash:[135,29],distinct:[43,149,29],dinner:135,form_validation_rul:33,enable_query_str:[62,5,71,29],algo:25,span:[92,147,121,29],commit:[52,141,12,131,29],ci_db_util:[75,108],my_mark_end:41,produc:[62,143,79,12,76,29,33,55,34,81,108,82,101,6,48,91,92,149,111,150,147],match:[0,130,79,149,29,125,136,33,98,108,92,87,25,143,103,9,50,131,78],set_insert_batch:149,email_filed_smtp_login:29,"float":[147,152],encod:[51,29,125,79,81,139,101,116,109,121,25,50,105,106],active_group:[94,33,123],down:[38,53,55,22,125,28,91,92,139],creativ:[131,84],count_al:[82,87,149,29],captcha_id:145,formerli:[149,69,29],wrap:[147,13,29],make_column:[13,124],set_test_item:[143,29],storag:[87,29],east:91,cipher:[94,109],git:[42,141],invalid_filetyp:29,wai:[137,0,79,7,47,128,122,91,49,50,69,134,55,151,18,103,140,105,106,143,65,21,108,68,109,139,96,146,27,28,149,29,114,33,46,83,41,141],"_prep_quoted_print":29,array1:25,post_get:[106,33,29],transform:[48,81,29],happi:[6,141],avail:[34,29],width:[43,130,145,29,53,81,125,128,6,92],reli:[52,75,76,29,30,33,125,103],request_method:[106,29],editor:[0,96,134,125,54,7,128,49,50],db_active_rec:[35,29],add_column:[76,29],wav:29,srednekolymsk:91,get_random_byt:[140,29],fork:141,sess_destroi:[103,29],head:29,medium:[92,124],is_cli:[49,106,33,105,29],form:[5,134,29,80,55,126,145,91,27,139,104,141],offer:[25,50,33,89,79],forc:[94,144,64,114,29,81,128,139,131,84],ucfirst:[125,86,33,136,29],hackeron:141,forg:29,fore:46,aren:[50,31,29],sess_driv:[103,33,108,29],upload_path:128,renam:[94,29],nonexistent_librari:108,stand:139,"true":[27,94,55,12,76,29,44,78,45,149,48,47,83,129,80,25,75,105,87,146],something_els:80,table_open:[19,124],reset:29,absent:[41,21],input:[29,78,87,48,110,25,105],function_us:[113,105,29],validation_lang:29,new_nam:76,exact_length:[50,29],heading_row_end:[19,124],filename_bad_char:29,maximum:[147,52,23,149,29,53,115,79,47,128,18,109,25,50,131],tell:[137,27,94,28,75,76,149,78,53,108,150,68,143,103],independ:[2,149,87,108,130,12],toggl:[19,29],my_articl:5,field3:149,emit:29,trim:[50,135,33,29],up11:91,e_warn:29,featur:[137,0,33,5,125,44,89,129,9,50,51,53,97,55,57,103,146,141,19,66,74,139,149,70,23,75,29,79,34,150,151,153],p7r:29,delete_cach:[18,29],stronger:79,"abstract":[12,29,125,21,89,70],mirror:148,myotherclass:129,futur:[103,33,79,29],some_data:106,uri:[18,87,34,29],input_stream:[106,33,29],cal_row_start:19,exist:[87,76,141,34,29],p7c:29,"_ci_load":29,p7a:29,request:[0,23,149,29,30,97,33,55,108,83,5,18,98,139,141,105,106],umark_temp:103,stanleyxu:29,p7m:29,check:[75,29,125,107,45,92,126,49,101,129,40,25,139,82,105,141],assembl:149,site_nam:7,mp4:29,is_load:[113,108,7,29],"7zip":29,higher:[53,98,79,45,25,103],download_help:[35,29],when:[0,94,12,76,29,44,80,55,34,48,87,82,18,25,149,146,105,141],refactor:29,active_record:[123,33,29],"_set_head":29,test:[94,87,141,29],presum:[6,79],uri_protocol:[3,29],roll:[28,12,87],realiti:142,is_http:[113,105,29],relat:[69,76,29,125,135,33,22,128,6,103,3],intend:[62,0,23,149,91,29,53,135,63,33,103,87,143,121,54,109,27,130,50,132],phoenix:91,benefici:34,get_output:[97,129],image_properti:6,min_height:[128,29],query_toggle_count:[83,29],insensit:[140,97,98,29],intent:[125,103,33],consid:[0,79,19,146,29,44,33,80,46,48,150,87,149,143,103,92,50,41,124,131,115],sql:[94,75,87,29,149,48,82,12,111,70],iso8601:[96,29],idenitif:97,shortnam:29,outdat:139,bitbucket:29,receiv:[0,23,29,108,103,50],known_str:25,longer:[43,79,29,125,33,55,108,101,18,109,103,50,141],furthermor:[125,33,79],function_nam:105,htdoc:[114,139],pseudo:[143,79,19,29,115,97,41,131],withhold:29,dohash:[101,69,29],vietnam:91,ignor:[62,1,28,75,149,29,65,115,20,33,46,79,103,112],cal_novemb:29,time:[87,44,9,81,91,92,78,135,6,18,139,104,105,141,142,145,110,75,29,33,34,48,83],reply_to:23,backward:[0,28,29,126,13,55,130,101,33,109,43,103,106],stick:[79,141],"_data_seek":29,recipi:[126,23,29],concept:[9,103,21,26,143],session_destroi:103,flac:29,chain:[87,76,29],whoever:141,skip:[75,76,29,114,45,55,149,101,92,103],global:[137,27,52,3,146,29,44,33,45,34,7,108,139,94,129,103,9,50,106,105,78],focus:52,invent:139,cyril:29,function_trigg:[71,5],unit_test:143,superglob:[103,33,29],seriou:[139,101],set_valu:[92,50,29],archive_filepath:112,blog_titl:[115,28,76],"_insert_batch":29,insert_entri:78,menubar:29,hierarch:0,form_textarea:[92,29],middl:[53,147,29],depend:[94,87,34,48,29],zone:[91,29],pem:[94,29],decim:[50,41,87,29],readabl:[144,29,114,80,125,91,103,141],worth:[103,79],deject:6,certainli:[33,79],decis:[23,109,29],text:[0,149,76,29,80,45,34,49,27,25,139,105],get_the_file_properties_from_the_fil:125,oversight:29,query_str:[3,29],update_str:[82,87,29],sourc:[10,11,148,29,53,79,6,25,131,146,141],string:[94,87,146,29],could:[43,2,125,45,79,49,50,131,132,96,136,56,103,105,141,21,28,76,29,97,33,81,84],wm_font_color:[53,29],unfamiliar:22,revalid:97,lru:66,url_encod:105,octob:29,word:[71,5,94,147,29,125,98,33,55,81,145,40,130,41,146],brows:[130,27,103,93],cool:43,set_messag:[50,29],save_handl:103,level:[11,29,125,33,45,6,103,112],did:[0,149,134,29,53,136,45,22,8,125,121,49,141],die:[125,97],hawaii:91,iter:[125,115,66,135,25,124],item:[71,5,149,134,29,44,87,142,151,92,110,51,57,27,9,129,122,135,105],unsupport:29,public_html:148,team:[127,28,29],cooki:[27,139,29],div:[62,43,19,29,80,21,92,50],exit_databas:113,"15t16":91,round:[142,43,6,96],dir:11,prevent:[137,43,145,28,96,0,125,98,29,45,149,22,81,142,54,139,106,140,105,79],slower:103,secrion:79,user_str:25,"_file_mime_typ":29,sign:[10,29],shuffl:27,first_link:[62,29],product_name_saf:[130,29],last_activity_idx:100,myarchiv:112,afghanistan:91,appear:[71,43,79,19,5,53,20,29,98,46,145,18,91,96,50,147],repli:23,scaffold:[71,72,95,3,29,101,37,57],favour:29,current:[137,43,2,87,126,7,47,91,130,50,11,13,55,102,18,105,106,19,108,153,148,149,70,28,75,76,29,97,80,34,81,83,141,42],sinc:[0,87,9,92,50,131,93,12,53,97,56,18,103,106,130,65,108,68,109,25,149,112,113,27,75,76,29,115,33,34,81,150],ampersand:1,screenx:81,domain2:[30,33],domain1:[30,33],boost:34,file_path:128,or_not_group_start:149,if_exist:76,burn:142,image_mirror_gd:29,deriv:[25,79,22],dropdown:92,compos:[44,29],gener:[149,76,87,29,34,89,141],unauthor:[97,105],french:[137,91],check_exist:107,satisfi:[25,103],add_field:[28,76,29],slow:43,modif:[10,31,33,99,100,37,102,103],address:[29,126,14,81,6,92,141],myradio:92,along:[96,29,53,97,80,7,128,50],window_nam:81,userguid:29,latest_stuff:112,wait:96,box:[92,103,79,139],insan:57,error_suffix:[50,29],my_email:[9,33],ini_set:125,shift:[34,29],bot:[81,93],"_version":29,odbc_insert_id:29,a_filter_uri:29,membership:91,"_trans_depth":29,filename_help:101,valid_url:[50,29],commonli:[137,139,50,131,140,84,93],ourselv:33,some_act:128,semant:[125,46,29],regardless:[0,23,29,53,79,48,147,28,106],iana:23,extra:[62,43,79,0,29,21,22,103,92,50],activ:[5,149,29,33,143,82,101,91,130,103,41,131],modul:53,prefer:[76,149,34,146,29],ellislab:[127,33,29],instad:29,paramat:[23,29],ftp_unable_to_remam:29,createfromformat:55,visibl:[43,143,29],marker:[53,103,41,29],instal:[94,80,105,29],mobil:[93,29],eccentr:29,regex:[50,98,29],newslett:92,serpent:79,memori:[0,75,29,55,83,18],sake:[21,78],pref:[75,19],visit:[0,33,96,134,13,136,8,149,128,109,49,50,93],test_mod:87,perm:[114,148],subvers:29,permitted_uri_char:[33,57,29],live:[103,66,14,48],handler:[103,33,98,144,29],form_reset:[92,29],value2:23,value1:23,criteria:[50,98],msg:[109,121],scope:[45,29],australian:91,checkout:130,prep:[92,139,29],heading_previous_cel:19,um5:91,capit:[0,136,78,125,33,40,9],mcrypt_mode_ecb:[109,29],minim:[52,149,65,151,138,139,92,50,131,84],python:80,peopl:[23,98,121,130,139,131,153,84,146],claus:[125,82,149,76,29],array_item:103,enhanc:29,uniquid:29,visual:[53,29],um6:91,list_fil:148,prototyp:[137,94,96,146,78,98,7,150,145,128,129,91,121,9,50,124,123],omsk:91,postgresql:[94,29,33,48,82,103,70],effort:[33,42,138,121],easiest:125,is_imag:[140,128,69,29],fly:[23,29,37,151,101,112],orwher:[101,149,29],graphic:[133,6],auto_link:[81,29],prepar:[142,128,22],pretend:29,judg:68,uniqu:[135,149,29],image_arrai:13,cat:41,json_pretty_print:97,reappear:43,invalid_select:125,is_count:40,whatev:[142,28,87,125,29,108,48,148,81],purpos:[137,52,79,77,29,53,97,33,45,108,81,114,125,91,115,103,106],misc_kei:137,materi:[79,87],object_nam:108,problemat:[33,29],heart:0,validli:126,explor:[63,29,138,33,8],stream:[79,29],"_applic":[66,33,118,119],slightli:[125,147,149],backslash:98,agent:[29,51,23,116,33,100,128,119,139,106],choke:141,critic:[139,141],abort:[97,45,29],indefinit:10,uruguai:91,unfortun:[139,79,34,105],occur:[29,125,135,80,108,48,14,7],contribut:[10,29],pink:6,alwai:[0,33,43,125,7,92,49,93,11,9,98,99,103,106,66,139,25,76,29,114,79,80,48,150,30,41,141],differenti:[139,14,29],multipl:[94,141,29],keep_flashdata:[103,29],filename1:137,charset:[87,29,46,92,6,25],ping:146,write:[75,87,29,34,48,82,149,141],set_item:[43,7],purg:98,foreach:[27,23,75,134,125,115,151,55,21,150,47,128,91,130,149,111,131],pure:[30,115,33,55,151,9,41],familiar:[62,143,12,134,79,80,151,121,103],tild:139,xhtml:[6,23,29],tbodi:124,clean_str:29,map:[11,136,96,13,98,108],example_field:48,pg_escape_liter:29,http_refer:29,http_x_requested_with:106,max:[47,121,149,29],sql_mode:29,spot:40,usabl:[33,140,105,79],mac:[49,125,93,29],socket:[66,121,29],mymethod:129,query_string_seg:62,"_ci_class":29,mai:[85,0,79,43,125,45,7,34,130,129,52,92,50,93,10,11,96,134,53,87,98,14,137,101,103,132,140,105,21,108,109,139,149,147,136,28,75,76,29,115,33,46,121,122],end:[33,125,7,129,91,50,94,135,97,55,56,103,140,143,109,112,147,148,149,29,79,34,151,121,41],underscor:[0,29,125,98,81,40,139,141],validation_error:[92,50,22],data:[87,29,34,48,47,82,111,146],grow:131,man:29,statu:[43,97,75,29,155,33,45,149,81,87,82,48,103,105],practic:[27,14,48,78],conscious:127,foo_bar:108,stdin:[106,105,29],"_get_ip":29,inform:[10,94,29,34,146,141],"switch":[29,94,79,87,125,33,50,146],preced:[29,125,20,98,91,112],combin:[0,149,29,125,33,55,6,91,92,139,140,106],block:[29,125,115,80,151,83,103,131,141,124],"_clean_input_data":29,callabl:29,tbody_open:124,purifi:33,allowed_domain:[30,33],remove_invisible_charact:[113,105],pipe:[50,128,29],search_path:29,old_encrypted_str:109,approv:[137,140],show_prev_next:29,upload_form:128,increas:[125,103,135,54,29],nbsp:[124,6,33,19,29],or_where_not_in:[149,29],ttl:[103,66,29],get_magic_quotes_gpc:29,file_permiss:[53,29],still:[94,79,29,30,33,21,8,125,103,25,50,64],mark_as_flash:103,ttf:[53,145],dynam:[5,29,80,34,18,9],entiti:[147,1,69,29,135,20,33,46,6,121,50,140],smitti:96,conjunct:20,newprefix_tablenam:48,group:[94,87,146,29],thank:[103,29],polici:105,form_multiselect:[92,29],"_backup":29,users_model:50,mybutton:92,platform:[94,2,75,29,87,149,68,82,103,12,105,93],window:[141,29,125,66,81,49,106,140,105,93],new_table_nam:76,unset_tempdata:[103,29],intl:29,javascript_loc:43,mail:[23,29,126,33,81,68,92,103,141],main:[71,0,11,29,114,54,45,86,113,94,122,92,141,132],countabl:40,getfileproperti:125,explanatori:128,non:[147,97,76,29,125,98,20,33,55,139,101,6,107,25,103,124,105,106],halt:[103,29],jame:149,displai:[94,29,45,13,80,87,82,83,129,18,91,92,139],thumb_mark:53,initi:[94,87,34,29],alt_path:137,or_not_lik:[149,29],date_rfc822:[33,91],safari:[93,29],disappoint:50,ci_cart:130,now:[49,0,29],discuss:[139,136,38,149,104],nor:[135,33,149,48,79],havingor:29,pastebin:141,term:[62,27,2,79,108,137,9,103],argentina:91,name:[94,2,149,76,29,87,55,34,48,47,82,111,146],mysql_get_client_info:2,opera:29,cellspac:[130,143,19,124],drop:29,separ:[94,149,29,125,135,45,81,40,9,146],is_really_writ:[113,105,29],allman:[125,141],januari:[19,29],hijack:[139,140],pizza:6,compil:[96,87,53,29,48,83,149],failov:[94,29],domain:[29,30,33,80,90,103,106],"_get_mod_tim":29,img_path:145,cal_cell_no_content_todai:19,cookie_httponli:[103,29],replac:[75,29,48,47,151,25,149],stopped_by_extens:29,um95:91,continu:[96,134,29,125,98,22,109,121,50,41],ensur:[142,94,29,125,66,79,108,109,139],redistribut:10,backport:25,significantli:[131,110],viewpath:[113,29],year:[127,19,91,29],min_width:[128,29],happen:[23,134,29,79,34,33,129,103,41,112,141],set_realpath:[107,29],heading_row_start:[19,124],html_escap:[92,113,33,105,29],slide:43,shown:[62,27,136,79,19,149,29,53,115,33,128,81,151,145,83,130,50,41,137,147,155],accomplish:[96,76],referenc:[115,91,29],"3rd":29,space:[139,29],old_fil:148,mysql_escape_str:29,data_to_cach:66,"_remap":[49,0],trans_commit:[12,29],profil:[24,29],mess:110,get_file_properti:125,danijelb:29,tb_data:121,is_int:143,correct:[29,143,148,149,87,125,79,46,82,128,139,50],image_lib:[35,53,11,29],group_two:146,get_head:[97,29],ci_typographi:[46,20],migrat:[51,116,153,29],ibas:[70,29],xhtml1:6,tmpf:103,cart:[51,29],"_error_messag":29,cut:[55,29],ajax:[43,106,140,103,29],mime:[144,29,114,57,39,105],set_update_batch:[149,29],org:[6,23,29],"byte":[29,125,79,83,152,140],card:[130,79,109],error_str:[50,28],insert_str:[82,145,87,121],reusabl:52,time_refer:[91,29],suffici:103,global_xss_filt:29,nice_d:[91,29],yup:109,modest:29,british:[127,77],unavoid:101,turn:[62,33,12,134,29,13,34,81,150,82,128,148,149,92,139,105,106],place:[0,54,87,125,7,139,128,129,9,50,94,96,53,13,98,14,18,103,141,62,143,19,66,21,108,28,110,112,147,23,149,76,29,97,33,34,83,41,153],cal_days_in_month:[91,29],legacy_mod:109,log_messag:[113,45,12,29],okai:125,row_id:130,principl:[9,63],nicknam:96,think:[79,109,141],lambda:129,ci_benchmark:41,loki97:79,directli:[0,33,87,122,9,10,134,135,54,18,139,106,143,133,21,103,149,38,75,76,29,78],ci_lang:[85,137],onc:[137,43,45,130,128,122,9,93,96,53,29,18,138,103,104,106,143,19,20,21,108,145,109,139,111,112,27,148,75,76,78,115,79,34,121,124],arrai:[94,87,146,29],zab:125,housekeep:34,yourself:[137,0,43,125,130,103,141],tag_open:147,fast:[142,43,66,89,18,103],oppos:[33,79,29],additionali:103,fiji:91,ruri_to_assoc:[150,29],"__construct":[0,78,125,29,21,101,122,110,9,103,128],size:[142,145,130,96,29,53,79,150,114,128,6,152,139,92,50,124],truncate_t:29,file_exceeds_form_limit:29,twofish:79,silent:[33,29],convent:29,gif:[53,43,128],w43l:29,associ:[0,130,79,19,76,149,29,33,55,34,81,47,82,90,6,129,105,145,92,75,87],fmt:91,malform:29,assort:29,max_length:[47,50,147],utliz:149,circl:6,where_in:[149,29],white:[145,29],conveni:[43,28,30,44,33,114,140,106],my_foo:66,get_package_path:108,especi:103,programat:48,copi:[79,119,7,141,9,95,117,53,135,136,99,100,101,102,56,57,58,59,17,61,120,15,71,72,73,74,77,29,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],specifi:[137,0,97,5,98,7,130,128,129,48,91,92,50,93,94,96,134,53,135,87,55,6,142,57,103,105,78,62,19,147,66,108,145,148,109,25,149,112,146,27,23,75,76,29,114,79,81,82,106,124],oci_execut:29,cfb8:79,xhtml11:6,"short":[141,29],enclos:149,mostli:75,full_tag_open:62,necessarili:103,alnum:135,"_compile_queri":29,png:[53,114,128,81,29],imagecr:29,serv:[0,79,96,64,65,97,29,45,34,125,133,106,78],wide:[83,79,106],ciphertext:79,client_nam:128,instanc:[137,87,125,98,34,128,129,9,50,96,135,97,55,101,62,19,108,109,146,147,23,149,76,29,79,46,122,124],form_item_id:85,sha512:79,didn:[142,103,33,29],posix:29,param2:2,param1:2,were:[29,43,28,96,0,6,33,140,79,99,100,102,56,139,92,103,131,58,84],posit:[147,96,76,29,53,66,87,55,25],get_csrf_hash:[99,140],zsh:29,typographi:[88,29],seri:[113,43,29],pre:[96,29,20,97,46,130,50,106],lowest:[23,45],sai:[137,0,2,29,53,78,98,34,79,125,81,109,103,130,50,139,132],explode_nam:29,upload_success:128,xml_from_result:[75,29],"_prep_q_encod":29,delim:75,argument:[49,149,29],month_typ:19,dash:[1,29,98,81,40,139],db2:146,doctyp:[6,29],suhosin:[105,29],post_model:142,ssl_ca:94,num_field:[55,34],seppo:29,page1:149,"_env":29,caus:[43,23,12,29,125,98,33,45,14,87,92,128,129,107,9,103,112,147],"_create_databas":[101,29],engin:[71,5,76,64,115,33,29,81,151,48,103],squar:[50,6],advic:139,greek:29,destroi:[130,106,109,29],"_pi":29,note:[149,76,29,55,48,111,146,141],date_rfc2822:91,ideal:50,jefferson:142,take:[114,0,1,54,87,125,98,119,117,129,48,91,9,50,150,67,96,58,13,55,99,100,101,102,56,57,138,103,15,16,17,61,142,120,121,108,22,123,145,109,146,71,72,73,74,76,29,30,31,32,33,34,81,59,35,36,37,118,60,39,40,106,153,154,155,124],advis:[103,79,48,81,70],interior:125,green:[50,6,148,124],bcrypt:139,noth:[62,137,23,147,21,68,56,103,50],getwher:[101,149,29],error_messages_lang:137,realpath:29,begin:[63,54,149,29,125,135,13,18,50,42],sure:[0,12,5,125,78,55,149,99,56,110,9,139,141],incorpor:[65,137],trace:29,normal:[0,54,43,98,7,9,122,91,49,50,133,53,135,97,55,136,18,106,62,143,65,110,147,23,149,29,150,151],"_update_batch":29,mydata2:112,price:[130,131],group_on:146,compress:[112,75,94,56,29],clearer:141,default_domain:[30,33],"_assign_to_config":29,abus:29,sublicens:77,pair:[62,19,29,33,55,87,149,41],seeksegmenttim:29,henc:33,hotfix:141,get_total_dai:[19,29],fetch_class:29,icon:[6,81],exact:[50,33,147],image_res:53,view_fil:29,synonym:[5,131],textarea:[92,13,22,29],view_fold:[54,29],later:[136,28,149,33,21,22,100,103],option_valu:130,escape_like_str:[87,48,29],rotation_angl:53,runtim:125,pattern:[149,29,65,136,98,8,89,139,111],addit:[85,5,33,43,125,98,45,130,92,50,131,93,96,53,13,55,14,137,100,103,142,19,23,76,29,97,79,54,41],mb_strpo:25,axi:53,salt:[25,79],sess_expir:[103,33],gracefulli:146,shop:51,shot:[130,106],signoff:141,uncondit:29,show:[0,149,29,107,13,45,48,91,92,41,111],german:137,pconnect:[94,78,146,29],hmac:29,crime_is_up:150,concurr:33,shoe:[71,0,150,5],permiss:[148,77,53,128,114,37,18,49,103],hack:[82,129,106,69,29],threshold:[37,45,29],pull:[6,141,134,91,29],line:[94,75,29,149,151,12,146,141],fifth:130,help:[43,54,125,45,34,47,48,91,50,93,147,96,13,136,101,6,139,140,141,62,20,65,28,113,27,23,75,76,29,80,46,81,150,83,152],exit_user_input:113,userdata:[103,33,29],onli:[137,0,13,43,125,98,45,7,87,92,90,129,48,91,52,9,50,131,128,93,11,96,53,135,54,55,142,6,56,57,126,103,132,140,105,18,62,143,130,141,20,66,94,21,22,68,145,148,79,109,139,25,149,70,147,23,75,76,146,29,114,97,33,80,34,81,121,115,122,41,106,64,124],snack:129,ratio:53,favor:[142,69,84,29],romanian:29,transact:[89,87,29],ini_get:[125,29],xma:130,next_tag_clos:62,black:145,datestr:91,mydata1:112,filectim:29,first:[137,0,2,5,125,98,45,119,7,87,92,90,122,91,74,9,50,95,12,78,58,135,130,13,55,83,148,99,100,101,102,56,57,105,82,123,141,15,16,17,18,106,19,120,144,64,6,147,108,145,28,139,25,149,72,146,71,27,73,23,75,76,29,30,31,32,33,34,81,59,35,36,37,118,60,39,67,154,41,61,153,117,155],overwritten:[128,33,29],query2:55,over:[43,19,63,53,29,98,21,81,87,125,6,91,92,96,105],mypic:[53,128],nearli:[53,81,130,110,9,84],variou:[27,19,29,128,39,50,112,93],get:[0,79,87,98,45,89,90,129,130,50,51,54,55,101,56,57,139,78,66,111,23,149,29,33,34,48,83],sst:29,imagecreatetruecolor:29,sss:80,secondari:48,ssl:[23,148,105,29],cannot:[113,27,94,76,29,107,79,103,42,141],mypic_thumb:53,neither:[53,79],requir:[94,12,76,29,55,82,149,111,146,141],truli:131,reveal:[68,43],item_nam:7,output_compress:29,outperform:103,borrow:127,email:[11,29,55,82,9,111,104],todo_list:[96,134],twelv:124,euro:91,default_control:[0,98,29],ini:[147,29,125,107,151,128,103],ci_cach:66,ent_compat:140,where:[0,87,125,129,91,9,94,134,55,14,18,104,105,141,147,145,25,146,71,27,38,149,29,78,34,48,82],summari:[9,43],wiki:[138,8],msdownload:29,a_long_link_that_should_not_be_wrap:23,smiley_j:[13,29],marquesa:91,password_get_info:25,send_email:[126,33,29],smiley_t:13,"_display_cach":[129,29],my_input:110,calendar:[51,101,29],another_method:38,element_path:43,concern:[130,103,33,140],infinit:29,detect:[28,3,29,30,97,33,79,87,53,128,81,25,140,93],"_base_class":29,controller_trigg:[71,5],review:33,auto_head:29,ubiquit:103,label:[85,50,76,92,29],db_pconnect:[87,29],enough:[142,50,79,139],between:[2,125,9,50,131,94,12,53,135,98,14,18,139,105,65,112,23,149,29,115,40,41],my_app:108,"import":[79,8,151,56,109,139,9,103,131],paramet:[2,141,34,29],across:[33,14,79],dir_read_mod:113,assumpt:52,"_clean_input_kei":29,aleutian:91,august:29,parent:[0,38,78,29,110,9],sku_567zyx:130,cycl:[135,23,18],reorgan:29,set_content_typ:[97,29],blog_nam:[76,121],come:[137,43,136,29,44,66,33,98,14,7,89,139,128,115,103,131,140,106],sess_upd:29,repertoir:43,fit:77,rsa:29,file_read_mod:113,controller_info:83,pertain:34,groupbi:[101,149,29],contract:77,inconsist:29,open_basedir:114,improv:29,log_threshold:29,create_link:[62,29],cal_cell_end_todai:19,undocu:33,item3:103,frameset:6,color:[142,145,130,147,29,53,33,150,92,6,9,50,124],colspan:[130,19,124],list_field:[47,87,55,29],period:[96,29,20,128,91,130,139,106],pop:81,photo2:23,photo3:23,exploit:[140,29],up13:91,colon:[94,29,151,139,130,103],example_t:48,exclud:[112,5,23,97,114],cancel:[149,96],up14:91,consider:[53,29],returned_email:23,damag:[79,77],needlessli:29,"_remove_url_suffix":29,semicolon:[151,140,29],coupl:[52,96,64,29,110,9,50],dynamic_output:53,west:91,rebuild:29,fopen_read:113,mari:124,mark:[29,147,64,33,48,100,83,92,103,41,105],locpath:148,individu:[75,76,29,66,34,111],certifi:[10,141],trig:29,thead:124,ci_sha:29,short_open_tag:125,repons:[105,121],decrypt:[139,109],thousand:29,georgia:91,rubi:127,get_id:121,proven:[139,33,79],"_drop_databas":[101,29],thing:[97,125,8,49,50,136,14,139,140,141,19,66,108,22,21,103,149,76,29,33,80,81],repres:[62,5,29,53,98,33,55,21,65,121,25],former:29,those:[137,5,33,125,7,139,130,50,93,96,53,135,97,98,136,99,103,78,62,20,110,76,29,79,34,141,124],sound:141,blowfish:79,firstnam:[115,96],amend:29,rtype:80,singleton:108,wm_shadow_color:[53,29],cast:[125,79,29],netpbm:[53,68,29],is_robot:[93,29],base64:[50,79,96,139],outcom:149,send_success:121,bufferedtext:125,margin:[92,131],show_next_prev:19,assoc_to_uri:150,glanc:51,advantag:[76,125,8,92,109,138,9,103,105,106],protect_identifi:[87,48,29],cache_item_id:66,up9:91,destin:[53,128,148,98],prev_tag_open:62,or_hav:[149,29],list_databas:[75,29],my_dog_spot:40,eras:103,img_width:145,hash:29,blog_id:[28,76],ascii:[147,148,29,145,121,105],ship:130,subtot:130,par:29,ci_image_lib:[53,29],xml_encod:125,author:[94,77,29,125,48,130],obfusc:81,alphabet:50,intermediari:65,same:[0,2,149,10,146,29,55,49,27,9,141,76],jsmith:96,binari:[148,29,112,79,25,140],html:[5,11,134,29,80,45,91,92,139,105],pad:[53,79,29],file_4:135,raw_output:25,pai:29,document:29,form_fieldset:[92,29],week:[19,91],php_sapi_nam:29,screenshot:141,utf8:[94,123,76,146,110],nest:[149,78,12,108,29],assist:[85,27,1,147,145,29,114,45,80,11,81,135,90,6,142,126,92,139],driver:[94,2,34,146,29],someon:[23,79,145,57,109,130,50],modify_column:[76,29],companion:147,driven:141,capabl:[5,52,29],my_sess:108,mani:[94,12,76,135,34,48,127,6,49,139,141],extern:[125,103,140,29],encrypt:[51,94,69,29,135,54,139],rewriterul:5,disallow:[147,140,57,29],return_object:87,sanitize_filenam:[140,69,29],"_ci":29,appropri:[62,10,136,96,29,125,79,45,149,87,82,152,103],new_entri:96,mcrypt_blowfish:109,markup:[43,128,6],page:[149,29,34,111,146,141],custom_row_object:55,without:[137,0,2,43,125,45,7,9,128,92,129,48,91,49,50,12,53,97,55,103,58,106,107,66,21,108,145,109,139,27,38,149,76,77,29,79,81,83,121,122,41,141],compression_level:112,titl:[13,128,81,50,96,134,135,136,55,6,140,142,21,22,111,149,29,115,78,80,48,121,124],index_kei:25,model:[29,44,49,24,9,122,141,132],get_content_typ:[97,29],dimension:[94,134,29,115,6,129,130,124],insert_batch:[149,29],keyup:43,execut:[87,76,29],among:[130,103,93,29],rule3:50,rule2:50,rule1:50,allowed_typ:[128,29],directory_separ:29,gd_load:29,"_post":[29,142,78,125,33,145,83,92,139],"_get_config":29,kill:29,cambodia:91,aspect:[53,19,29],touch:103,monei:142,less_than:[50,29],speed:[43,18,103,29],filter_var:[126,33,29],product_lookup_by_id:98,versu:125,is_cal:[50,29],fh4kdkkkaoe30njgoe92rkdkkobec333:130,except:[5,125,55,7,9,90,91,92,50,53,135,98,101,103,20,66,110,149,76,29,115,33,46,81,150,35,151,41,84,124],param:[29,0,79,75,43,125,33,80,103,108,129,96,9,50,62,124],desktop:[112,96,75,144],non_existent_fil:107,my_shap:142,blob:[103,33],versa:53,constant:[105,29],mb_convert_encod:29,process_:0,word_censor:[147,29],earli:129,gd2:53,hover:43,around:[29,87,125,66,13,48,92,50],code:[141,146,29],read:[136,87,125,8,50,131,78,134,54,101,138,103,104,105,106,63,144,108,22,148,4,139,111,112,27,38,149,29,114,33,34,48,83,41,153],escape_str:[87,48,29],messsag:23,"_convert_text":125,is_allowed_filetyp:29,grid:[145,29],darn:147,mom:[96,134],world:29,js_insert_smilei:[33,29],"_write_cach":0,blackberri:29,whitespac:29,some_funct:[92,2],changelog:[141,29],preg_replace_ev:29,integ:[143,11,149,76,29,53,55,82,125,103,50],server:[94,75,29,87,45,34,14,151,18,146,105,132],set_status_head:[113,97,105,29],benefit:[38,12,125,149,48,91,92,50],photo1:23,either:[43,79,125,128,2,91,50,92,102,96,53,98,101,6,103,140,78,62,143,20,109,149,146,23,75,29,33,34,81,141],cascad:29,output:[75,76,29,48,49,18,25,82],tower:141,nice:[50,22,147],json_unescaped_slash:97,yyyi:91,what:[94,141,34,48,29],affected_row:[82,111,149,29],method_exist:0,juli:29,blog_label:76,http_header:83,authent:29,word_wrap:[147,29],error_db:[71,87],set_new:22,first_row:55,form_help:35,slice:6,caribbean:91,mood:6,easili:[5,97,149,79,21,101,122,109,131],deliveri:[124,29],kml:29,definit:[76,29,33,80,92,122,9],token:[125,97,140,29],protocol:[23,3,64,135,29,81,68,148,103,106],ac3:29,exit:[28,29,125,97,45,9],inject:[128,29],xtea:79,"_parse_cli_arg":29,apostroph:20,complic:103,overli:[125,34,29],exp_pre_email_address:125,refer:29,get_last_ten_entri:78,mailto:81,total_item:[130,29],shadow:53,power:[43,136,22],pdo_sqlit:29,garbag:103,inspect:130,ci_load:[108,29],max_height:128,broken:[139,23,38,29],apantbyigi1bpvxztjgcsag8gzl8pdwwa84:109,fopen_read_write_cr:113,found:[137,0,79,44,45,7,90,129,91,135,97,98,136,23,103,105,106,66,108,38,139,25,28,75,29,33,150,152,121,141,155],mime_content_typ:29,thailand:91,referr:93,appli:[29,141,87,53,33,98,125,90,103,50,124,139,106],isset:[29,125,55,14,103,106],earlier:[136,149,134,121,21,22,103,50],callback_:50,src:[6,145,23,29],central:91,greatli:12,discern:[128,29],island:91,previous_row:55,request_filenam:5,exit__auto_max:[113,45],greater:[1,74,125,91,50,105],mcrypt_dev_urandom:[25,79],is_numer:[139,143,29],degre:[53,115,52],intens:[114,46,34],phpdomain:80,reset_queri:[149,29],table_nam:[75,76,87,33,55,48,47,82,111],slash_rseg:150,luck:142,backup:29,processor:46,routin:[27,52,75,29,34,128,139,50],effici:[93,29],max_siz:128,status_cod:45,coupon:130,lastli:[80,150,3,34,96],image_width:128,date_rang:[91,29],quietli:125,super_class_vers:125,strip:[147,23,69,29,135,22,139,121,50],your:[141,29],clipperton:91,call_user_func_arrai:0,unit_test_lang:35,wm_font_path:53,"_detect_uri":29,area:[53,13,98],met_win_open:81,odbc_num_row:29,"_explode_seg":29,overwrit:[128,7,29],xw82g9q3r495893iajdh473990rikw23:130,ci_unit_test:143,strict:[94,87,29],pre_system:129,interfac:[149,29,53,45,49,103,131,84,106],low:[125,147,33,79,29],mbstring:[25,29],ipv6:[50,106,118,29],submiss:[125,145,91,139,50,140],strictli:114,filter_uri:29,lang:[85,113,137,29,125,33,108,7,50,93],up10:91,programmat:[27,28,33,29],str_replac:125,bsc:115,conclud:103,bundl:[103,80],designfellow:29,"_session":[103,33,29],mb_strlen:[25,29],procedur:[50,27,129,45,29],cubrid_affected_row:29,cryptograph:[33,140,109,79],openxml:29,conclus:51,sess_expire_on_clos:[103,33,29],orlik:[101,149,29],notat:[53,114,29],mathml:6,possibl:[79,125,122,130,132,52,53,97,98,136,101,57,138,139,141,62,108,21,109,110,149,38,75,29,115,33,34,54,153],"default":[94,12,76,29,55,149,82,75,146,141],error_prefix:[50,29],delete_fil:[114,148,29],lowercas:[29,78,125,33,81,22,109,106],eschew:84,grasp:80,my_calendar:108,embed:[134,29],deadlock:[103,29],remove_spac:128,up12:91,expect:[63,75,29,125,115,136,45,103,143,8,139,128,102,121,9,96,150,140,141],cbc:[79,29],creat:[10,141,34,146,29],multibyt:29,certain:[71,0,94,33,149,43,44,29,80,34,5,25,139,141],tahiti:91,site_id:76,valid_usernam:50,mode:[94,87,29],strongli:[33,57,70],undergon:29,print_debugg:[23,29],file:[10,141,29],next_url:19,fill:[50,29],incorrect:[92,125,79,108,29],again:[43,79,136,108,50,103,141],image_typ:128,googl:[143,29],hex:[53,79,69,29],collector:103,bhutan:91,conn_id:[2,34,29],prepend:[149,29,79,108,48,150,90,50,106],field:[94,87,29],valid:[0,94,12,29,98,25,104],collis:[137,29,66,33,108,7,106],rdbm:29,is_unix:91,no_file_typ:29,writabl:[29,114,45,34,145,37,18,128,112,105],you:[0,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,137,87,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,48,117,118,119,120,121,122,123,124,125,128,129,130,131,132,134,135,136,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155],mcrypt_create_iv:[25,140],architectur:[51,86],poor:68,create_kei:79,sequenc:[94,28,29,79,82,6],symbol:[114,107,29],pear:[84,29],multidimension:[92,50,6],track:[45,28,12,103,29],dropbox:141,rsegment:[33,150,29],localhost1:94,typecast:29,regex_match:50,deliber:109,ci_zip:112,segment_two:87,redud:33,cookie_domain:[103,3],wm_use_drop_shadow:29,descript:[94,141],session_id:[103,33,29],smtp_user:23,mimic:20,mass:101,potenti:[139,1,38,70,29],up115:91,escap:[82,111,87,29],w3c:[6,91,29],newli:[50,109],unset:[103,33,139,29],is_uniqu:[50,29],disp:23,file_upload:11,all:[10,141,29],db_backup_filenam:75,new_field:33,filename_pi:101,lack:[103,33],dollar:[98,29],month:[125,91,29],new_list:124,atlant:91,correl:[129,18],mp3:29,microtim:145,wm_type:53,follow:[0,1,3,5,7,9,11,12,13,18,20,21,22,38,25,26,27,28,29,33,34,39,40,41,43,44,45,46,47,49,50,52,53,55,23,56,57,62,63,66,69,71,72,73,74,75,76,77,78,79,80,81,83,85,90,91,92,93,94,95,96,97,98,100,101,6,103,104,106,107,108,110,111,113,114,48,121,122,123,125,126,128,129,133,134,135,136,137,139,140,142,143,144,145,146,147,149,152],alt:[6,23,29],disk:[53,66,79],children:29,abid:54,library_path:53,content:29,iconv:[25,29],number:[87,125,55,88,90,91,94,98,83,6,18,139,105,142,145,25,38,149,76,29,82,151],get_file_info:[114,29],script_nam:29,sess_regenerate_destroi:103,wmv:29,spirit:29,mistakenli:29,init:[71,72,73,74,3,29,95,57],use_sect:[108,7],spearhead:127,queri:[2,34,29],read_dir:[112,29],wma:29,cgi:29,db_backup:29,adapt:[66,149,87],"case":[137,0,86,79,5,125,98,9,128,122,92,50,94,12,53,54,55,126,103,140,104,105,106,130,149,147,66,108,22,109,110,96,115,27,148,75,76,29,30,97,33,81,114,40,139,155],liter:[92,139,143,98,29],straightforward:103,ingredi:79,fals:[27,94,105,12,76,29,55,78,45,149,48,47,83,80,98,25,75,87,146],passconf:50,keydown:43,get_new:21,verb:29,mechan:[143,79,76,29,33,129,109,103],verd:91,fall:[25,30,66,33],veri:[142,125,89,90,129,48,9,50,131,93,52,12,53,136,148,56,103,62,19,108,68,28,149,71,23,75,115,34,81,41],get_clickable_smilei:13,condition:[53,23,96],subsubsubsubsect:80,mysql_set_charset:29,norfolk:91,"_filter_uri":29,my_array_help:27,tag_clos:147,last_nam:96,e_strict:29,emul:[0,103],small:[63,52,23,29,125,79,82,92,131,84,124],require_onc:71,e_notic:29,dimens:53,trans_strict:[12,87],getimages:29,samoa:91,ten:124,"__get":[103,55,29],my_blog:96,product_lookup:98,sync:29,past:[33,91,79],zero:[135,79,45,34,150,37,128,103,130,50,84,106],postgr:[82,94,70,29],db_conn:108,pass:[87,141,146,29],overlin:80,further:[0,52,97,63,29,34,6,121,25,103,146],nba:50,return_path:[23,29],directory_depth:11,trick:[103,139,29],server_path:114,sub:[80,34,29],trans_rollback:[12,29],sun:[19,91],section:29,abl:[43,29,125,98,79,55,8,126,83,121,9,50,105],brief:[128,79],ci_encrypt:[79,109],delet:[76,87,29,34,48,82],abbrevi:[53,137,19],last_login:55,primary_kei:47,intersect:29,is_bool:143,some_method:[0,38,75,76,80,9],ci_migr:[28,29],"public":[0,79,125,9,128,122,49,50,10,94,96,134,13,55,136,6,103,78,21,22,110,28,149,29,33,54,141,42],contrast:[131,12],millisecond:43,full:[137,0,54,43,125,8,89,128,9,131,93,94,69,53,97,101,6,139,132,105,62,143,149,68,96,111,75,29,114,115,34,81,150,41,124],iran:91,agent_str:93,pacif:91,variat:[55,29],where_not_in:[149,29],misspel:29,decid:[106,79,96,29],behaviour:[23,33,29],coco:91,shouldn:[103,33,7],username_check:50,imap_8bit:29,is_allowed_typ:29,is_object:[143,29],ci_pagin:62,method:[87,141,76,146,29],strong:[147,79,29,33,130,139,124],modifi:[10,87,29],preserve_filepath:112,valu:[141,29],leav:[143,23,69,29,53,79,22,81,125,102,129,57,139,50],min_length:50,valid_ip:[50,106,29],ahead:55,server_info:29,popen:29,observ:29,prior:[28,29,128,74,129,109],amount:[12,53,97,149,83,18,130,50,41,131,84],pick:125,action:[43,130,149,77,0,53,98,29,80,47,92,128,102,129,49,50,140],another_t:34,narrow:139,detectifi:29,diamet:142,hash_algo:69,display_error:[87,29],gost:79,intermedi:8,screeni:81,africa:91,example_librari:9,hash_hmac:79,remap:29,deprec:[94,69,76,29,114,126,13,81,100,101,6,91,135,92,153,70],href:[19,29,115,21,81,6],famili:79,um45:91,demonstr:[147,23,13,22,128,6,112],decrement:[66,19,29],"_start":41,establish:[146,87],trans_off:[12,87],select:[87,29,34,48,47,82,111],metaweblog:96,test_nam:143,ci_env:[14,29],hexadecim:[25,79],helper:29,internation:29,faint:53,two:[0,79,98,45,7,34,47,9,92,50,132,12,135,55,139,141,130,145,109,110,146,71,27,23,149,29,33,46,83,41],page_titl:134,fopen_read_writ:113,autonom:[52,87],res_datatyp:143,taken:[28,42,29],select_max:[149,29],"_object_to_arrai":29,minor:29,more:[85,0,79,5,125,98,45,119,8,92,129,91,49,50,131,52,12,78,134,53,135,54,55,14,100,101,102,153,126,103,6,34,142,63,130,19,147,65,66,94,22,108,68,96,25,69,146,27,136,23,149,29,30,97,33,46,81,37,118,105,121,41,139],emoticon:13,flaw:[139,29],desir:[85,137,28,149,146,29,125,20,13,55,14,128,148,139,132,84,124],create_thumb:53,hundr:[93,29],mozilla:93,relative_path:140,photoblog:96,flag:[143,149,76,87,29,139,141],driver_name_subclass_2:86,driver_name_subclass_3:86,broke:[141,29],driver_name_subclass_1:86,known:[149,29,33,139,110,25,103,93],mathml1:6,mathml2:6,trans_statu:[87,12,29],cach:29,fopen_write_create_strict:113,"_stringify_attribut":113,town:76,none:[23,19,29,53,87,139,128,28,103,25,75],endpoint:140,suitabl:[125,135,33,69],hour:[103,91,145],hous:[96,134],list_tabl:[47,87,29],der:29,outlin:109,dev:[25,125,33,140,79],detect_mim:128,orderbi:[101,149,29],remain:[18,145,34,22,29],paragraph:[50,1,29],nine:124,caveat:103,learn:[12,54,98,108,7,138,103,131,84],group_end:149,male:150,explod:125,typograph:46,subclass_prefix:[9,27,37,110],scan:29,up875:91,challeng:131,server_protocol:106,share:[94,19,29,34,103,3,132],"404_overrid":[98,29],templat:[71,51,87,29,45,151,84],sphere:6,minimum:[62,50,128,149],unreli:[105,29],set_row:55,phrase:147,blog_head:115,ci_upload:[128,29],unlucki:139,cours:[79,33,98,109,103,92,50,131],newlin:[23,75,29,125,135,20,46,6,50,106],first_nam:[50,96],secur:29,rather:[137,5,87,9,92,50,131,52,12,134,98,100,141,143,94,108,146,76,29,115,33,48,106],anoth:[0,23,12,76,149,29,33,103,7,108,151,139,128,122,75,96,50,93,112,79],smtp_port:23,perhap:[9,27,110,103,50],fame:103,narrowli:52,some_cooki:106,url_titl:[81,29],unabl:[114,121],"_unseri":29,reject:52,iso:[23,91],csv:29,simpl:[0,79,5,45,89,92,49,50,131,94,96,134,6,103,62,143,19,147,28,109,27,23,149,29,115,33,80,81,121,43,84],needl:[25,27],css:[43,97,147,33,81,6,91,139],"_thumb":53,convert_accented_charact:[147,29],regener:[103,140,29],plant:96,sandwich:91,resourc:[94,12,87,29,55,34,48,122,149],indian:91,whats_wrong_with_css:81,smiley_view:13,show_404:[113,0,29,45,136,98,21,155],variant:137,invok:[71,5,52,38,129,110,50,41,104,106],reflect:[41,29],catalog:98,buffer:[125,23,56,29],mutat:29,subdriv:29,unlink:29,lanka:91,circumst:[97,29],github:141,product_typ:98,system_path:54,footer:[65,136,21,22,134],ani:[85,0,2,5,125,155,45,47,92,129,48,91,9,95,12,105,135,13,98,83,56,57,139,15,16,17,18,142,113,141,72,145,74,110,146,71,27,73,38,149,29,114,80,34,81,35,36,37,54,39,122,123,153,154,87],onto:97,overnight:124,in_particular:125,callback:29,image_height:128,yyyymmddhhiiss:28,hash_equ:[25,29],media:6,stricton:[94,29],set_hash:29,cal_cell_start_oth:19,checkbox:[92,50,141,29],rotat:[53,68,29],no_result:150,migration_vers:28,azerbaijan:91,file_s:128,cook:91,through:[0,38,19,29,135,63,33,55,21,108,90,103,92,96,131,124,140,105,106],reconnect:29,hierarchi:[80,134],fff:53,helo:29,password_hash:25,orig_path_info:29,style:29,config_item:[113,33,105,29],ip_address:[29,33,145,118,121,103,106],border:[143,19,29,145,130,124],end_char:[147,121],dbname:[94,146,29],resort:103,bypass:133,number_lang:152,delici:3,might:[137,0,79,5,98,45,8,90,129,50,94,96,134,53,13,55,136,18,103,105,78,143,141,64,21,22,108,145,147,23,75,29,114,33,151,106,153,124],alter:[28,76,29,153,33,100,148,118,110,103,140],wouldn:29,ci_db_result:[149,55,87],"return":[0,86,87,98,45,47,9,122,49,55,105,25,149,111,146,27,75,76,29,78,80,48,82],prev_tag_clos:62,than:[85,0,1,79,5,125,98,45,9,129,48,92,132,94,12,134,55,100,139,105,141,130,147,109,146,27,149,76,29,33,34,81,84],accept_charset:[93,29],file_5:135,sentenc:20,pollut:29,file_1:135,sess_use_databas:33,ff0:[147,33],ssss:80,framework:[9,127,110,29],cer:29,compound:[149,29],timezone_menu:[91,29],custom_result_object:55,bigger:145,"_helper":108,redesign:29,table_data:124,set_mod:109,cubrid:[33,70,29],troubleshoot:51,my_cach:66,userid:96,gmt_to_loc:91,refresh:[18,81,29],micro:145,achiev:[0,33,55,18,103],alreadi:[137,43,79,47,50,97,55,103,141,143,108,28,149,112,115,23,75,76,29,31,33,121],innodb:[12,76],sha384:79,is_fals:143,fulli:[11,29,125,54,129,18,57],intervent:[97,109],backtrac:29,errata:29,truncat:[147,149,29],do_upload:[128,29],weight:103,needless:29,korea:91,hard:[53,92,79,103,29],addressbook:131,ci_session_dummy_driv:103,crontab:29,realli:[79,12,29,33,34,81,68,48,139,103,131,105,141],playstat:29,finish:[130,148,108],next_tag_open:62,connect:[94,2,29],fist:29,todd:149,attachment_cid:[23,29],http:[0,83,45,105,29],db_forg:29,beyond:[52,149],todo:[151,134],orient:27,some_valu:103,ftp:[125,51,29],vladivostok:91,safeti:103,or_lik:[149,29],miss:[94,29,125,81,145,70],nepal:91,form_fieldset_clos:[92,29],publish:[96,77],thirdparamet:91,send_error:121,health:45,add_kei:[28,76,29],print:[147,23,149,29,107,81,151,6,40,49],dir_write_mod:[113,29],bui:130,subsubsect:80,occurr:135,w3school:81,file_nam:[50,128,108,134,29],textil:80,asp:81,proxi:[96,29],mylibrari:33,advanc:[125,63,33,29],create_captcha:145,samara:91,differ:[137,2,125,7,91,130,50,131,93,10,96,53,98,14,103,132,78,62,143,19,21,22,108,148,112,79,23,149,146,29,31,33,81,41,153,124],asc:149,quick:141,reason:[62,0,94,79,96,149,29,125,135,33,34,48,108,130,56,121,49,103,139,141],base:[5,2,87,49,129,91,92,10,12,135,54,14,6,141,127,144,33,110,149,111,71,75,76,29,30,78,34,81,114,152,42],believ:103,sku_123abc:130,ask:[141,29],teach:63,phd:115,basi:[18,29],thrown:[66,29],"_blank":81,english:[137,147,3,29,35,50,93],omit:[75,149,29,125,33,103,121,130,19],success:[23,12,76,29,114,80,66,87,55,149,7,48,130,75],caption:[124,29],golli:147,get_config:[113,29],csr:29,threat:140,"_error_handl":[113,29],cache_query_str:29,undergo:29,file_writ:29,assign:[137,27,136,23,75,76,134,29,78,55,21,7,108,149,128,122,48,9,103,41,79],update_batch:[149,29],feed:[6,48,29],major:[53,149,80],notifi:23,obviou:[49,141],row_arrai:[111,55,21],feel:[115,101,138],articl:[5,19,87,21,81,49,103,131],lastnam:[115,96],ci_db:108,mod_mim:128,sometim:[47,50,75,96],footprint:[52,84],cell_end:124,done:[137,0,136,54,96,29,30,97,33,80,21,79,83,133,129,138,27,115,103,141,78],least:[29,79,103,139,50,105],directory_trigg:29,form_open_multipart:[92,128,29],stabl:[42,141],init_unit_test:72,file_parti:29,guess:[125,29],error_arrai:[50,29],script:[43,87,125,45,9,129,49,50,69,53,97,55,56,103,140,105,106,143,65,139,28,149,29,114,33,81,30,121],column_kei:25,interact:[49,79],gpg:29,yekaterinburg:91,construct:[62,63,29,130,122,9],tradition:12,header2:23,stori:103,underlin:80,order_bi:[149,29],accept:[43,79,87,125,55,91,92,50,93,94,96,135,136,98,102,103,140,105,106,19,145,139,23,149,76,29,115,33,81,121,6,141,124],cfg:29,dbdriver:[94,146,78],is_arrai:[125,27,143],scheme:[28,136,29],store:29,schema:[121,94,28,21,29],free:[125,103,55,77],adher:[125,84],statement:[149,76,87,29,48,151,75],ctype_digit:[139,29],behind:[53,26],compens:29,php_sapi:105,johndo:[92,50,103],count_all_result:[149,29],php_error:[45,29],apppath:[113,114,29],pars:[125,97,13,81,29],logged_in:[103,81],myclass:[62,85,149,125,129,9],grace:29,fred:[135,148,124],king:76,kind:[147,77,135,33,45,103],cookie_secur:[103,29],aac:29,abr:19,remot:[148,96,29],orhav:[101,29],remov:[149,76,29,14,18,139,105],migration_en:28,dtd:6,jqueri:29,reus:[103,149,21],pragma:[97,29],str:[1,87,125,92,50,69,135,13,140,105,143,20,40,25,147,23,29,46,81,150,82,121],consumpt:55,stale:101,toward:[53,103],beij:91,"_sanitize_glob":29,fixat:103,randomli:[139,145],cleaner:[131,29],comput:[49,149,96],mpeg3:29,deleg:136,strengthen:29,sssss:80,beforehand:29,favicon:6,packag:[125,100,54,29],is_support:[66,29],sport:50,expir:[29,97,34,145,90,18,103,106],mod_rewrit:5,reset_valid:[50,29],"null":[149,76,87,29,55,25,105],format_numb:130,query_build:[11,33,94,108],option:[137,0,79,3,5,125,98,45,7,92,128,129,91,74,9,50,131,93,151,94,12,134,53,87,55,14,148,6,18,107,103,140,78,62,143,130,19,149,83,66,108,123,28,109,110,25,96,146,71,147,23,75,76,29,114,97,33,80,81,150,37,152,43,106,153,84,124],sell:77,mountain:91,reset_data:149,nozero:135,"_prep_filenam":29,relationship:98,lib:29,remote_addr:103,replyto:23,self:[113,128,29],violat:29,troublesom:29,port:[94,23,96,29,66,148,103],undeclar:147,also:[114,0,28,5,125,98,45,119,79,87,49,90,92,129,48,91,74,9,50,93,151,94,95,12,134,105,135,13,55,14,137,148,141,140,56,57,136,103,15,16,17,106,62,130,120,149,65,83,66,67,21,108,38,139,25,96,112,71,72,73,23,75,76,29,30,97,33,80,34,81,150,35,36,37,54,39,121,43,123,42,128,124],"_is_ascii":29,elapsed_tim:[41,97,87],brace:[125,115,151,20],signup:50,vnd:29,file_typ:128,distribut:[94,77,29,108,103,42],backtrack_limit:29,victim:139,choos:[43,28,12,149,29,53,79,46,81,109,103,50,146],reach:21,chart:51,font_siz:[145,29],most:[79,3,45,139,128,91,9,50,131,93,147,12,53,55,18,103,146,104,143,19,20,65,66,148,109,110,96,112,70,27,23,29,115,33,48,121,124],plai:68,protect_al:1,whether:[137,43,1,97,87,125,45,7,34,47,130,90,91,92,50,93,10,11,12,53,135,13,14,6,56,103,140,105,106,142,143,19,144,107,66,94,22,108,149,148,109,139,25,69,112,146,136,23,75,77,29,114,115,79,80,46,81,121,141,128],plan:141,myisam:12,last_act:[100,33,103,29],selector:43,my_const:125,charg:77,xlarg:92,tonga:91,x11r6:53,clear:[23,29,53,79,34,108,89,33,103,112,84,124],bdb:12,cover:[10,96,8],ci_db_forg:[76,108],roughli:109,"2nd":29,ext:[71,29],part:[137,10,1,23,96,27,53,63,29,98,149,114,125,109,110,25,103,141,112,147,124],clean:[96,134,29,66,33,69,141,140,106],enctyp:128,latest:[28,141,136,29],awesom:136,s_c_ver:125,mcrypt_mode_cfb:109,pdo_mysql:29,carefulli:[79,153,34,109],alphanumer:29,phooei:147,top_level_onli:[114,101],row_object:55,appver:29,session:[51,94,29,54,83,122,9,16,123],particularli:[12,29,136,98,46,108,131,140],worri:[79,45,91,141],exit_error:[113,45],font:[53,145,29],fine:[49,81],find:[137,0,44,45,7,128,131,93,12,98,56,103,78,142,64,65,96,27,29,115,79,34,151,121,141,153],impact:[101,79],access:[0,2,5,125,98,7,122,9,94,13,55,99,139,105,78,66,109,149,111,79,38,75,76,29,114,33,34,81,83,54,42,84],pretti:[33,106],url_help:[27,21],myutil:75,unattend:103,ruin:29,mypassword:[50,146,78],solut:[79,115,33,126,25,103,84],is_referr:[93,29],validate_url:[121,29],couldn:29,cursor:29,factor:[52,33,149,34],"_server":[29,30,33,14,103,106],i_respond:96,charcter:79,unus:[103,29],albeit:142,ssl_verifi:94,amount_paid:149,express:[149,29],ffield_nam:29,blank:[23,75,29,53,129,108,81,125,56,57,50,106],nativ:[94,2,12,87,29,55,48,122,110,25,105],ci_log:29,mainten:29,quotes_to_ent:[135,29],xss_clean:[90,69,101,29],liabl:77,post_controller_constructor:[129,29],restart:29,set_capt:124,callback_foo:50,builder:29,repair_t:75,uri_seg:[62,29],date_cooki:91,crt:29,set_dbprefix:[149,48,29],whenev:[125,33,45,34,29],full_tag_clos:62,rfc:[23,91,79,29],common:[12,29],newest_first:130,greater_than:[50,29],empty_t:[149,29],delete_dir:[148,29],uri_to_assoc:[150,29],crl:29,arr:125,set:[94,12,76,29,87,55,34,48,82,149,111,146,141],blog_templ:115,php_eol:[49,106],backtrack:29,cookie_prefix:[103,90,3,106],vinc:142,utf8_en:[113,29],seg:150,simpler:[129,29],see:[43,79,0,125,98,110,7,34,9,128,5,91,49,50,94,12,134,97,55,14,101,57,138,126,103,58,105,106,19,147,66,21,22,108,145,96,69,111,146,27,136,149,76,29,114,33,80,46,81,37,122,139],sec:80,arg:[135,124],transpar:[53,97,29],reserv:29,horizont:53,flavor:[3,108],php:29,chose:[103,79,109],legend_text:92,simultan:146,mt_rand:135,inconveni:[13,33],someth:[0,54,130,128,129,91,9,50,93,94,96,134,97,98,14,56,103,106,62,108,145,112,71,148,149,115,80,81,121,141],strtolow:[98,29],particip:131,debat:29,imagejpeg:29,inner:[149,129,29],won:[23,149,79,97,33,55,34,81,83,122,98,103],migration_t:28,source_imag:53,mismatch:29,ssl_cipher:94,experi:[68,103],nope:109,compliment:111,altern:29,stored_procedur:29,prefix_singl:87,latin:[139,29],imagemagick:[53,68,29],numer:[11,28,19,29,114,135,33,98,149,130,152,91,139,25,50,106],all_userdata:29,this_string_is_entirely_too_long_and_might_break_my_design:147,javascript:[51,29,13,80,101,81,90,92,139,105],output_paramet:96,isol:29,call_hook:29,some_par:38,incident:33,"_create_t":29,raw_input_stream:[106,29],distinguish:125,slash_item:[33,7],date_lang:91,classnam:[43,37],struct:96,verbos:[125,14],water:96,last:[29,19,87,97,55,108,48,82,151,106],delimit:[23,75,29,33,98,81,128],is_write_typ:[87,29],hyperlink:81,is_natural_no_zero:50,event:[29,34,81,128,7,92,50,106],pg_exec:48,imageid:145,pdo:[94,29,55,82,146,70],add_suffix:137,context:[103,79],forgotten:139,mb_enabl:[25,113,29],pdf:[23,80,29],author_id:82,prng:29,whole:[10,33,55,79,29],wm_y_transp:53,load:[75,76,29,55,80,34,122,111,146],xspf:29,markdown:80,simpli:[137,0,79,43,126,45,7,130,128,129,48,9,50,131,132,12,134,53,135,136,100,103,106,62,143,149,108,148,110,96,112,71,27,23,75,29,115,33,34,81,37,121,122,41,141,124],cast5:79,point:[141,149,34,105,29],instanti:[0,52,96,87,29,55,129,103,122,146],schedul:33,any_in_arrai:27,arbitrarili:50,header:[0,144,134,29,125,81,83,105],fashion:[63,79],littl:[115,143,153,34,121],total_rseg:150,linux:[49,103,93],mistak:[33,29],db_connect:[87,29],csrf_exclude_uri:[140,29],file_exist:136,backend:[66,3,29],expressionengin:[53,127,33],identif:29,unsuccess:12,user_id:149,devic:[125,93,29],create_t:[28,76,29],empti:[0,75,76,29,125,6,55,81,102,91,92,149],implicit:29,whom:77,secret:[139,79,109],comment_textarea_alia:13,wm_hor_align:53,your_lang:[152,91],cell_alt_start:124,devis:29,nonexist:29,invis:43,save_path:103,load_class:[113,29],valid_email:[126,50,33,29],imag:[51,23,69,29,13,128,7,145,101,6,81,139,50,153,154,155,146],array_replace_recurs:[25,29],restrictor:149,unnecessarili:29,gap:28,phpdocument:29,coordin:53,understand:[10,12,57,138,96,103],file_write_mod:[113,29],func:[50,29],demand:[33,12],other_db:[75,76],vulner:[33,141,29],weekdai:19,include_bas:108,foreign_char:[147,101],ignit:29,look:[47,141,48,29],localhost2:94,bill:135,histor:[135,33,79],cluster:[34,109],"_has_oper":29,"while":[79,125,98,45,130,50,11,96,53,55,14,138,103,106,94,28,146,147,23,149,29,114,33,80,151,42],unifi:29,smart:12,abov:[0,54,5,98,7,92,128,129,48,91,9,50,94,147,96,134,53,135,13,55,151,6,142,18,103,146,78,62,143,130,19,141,20,66,21,22,108,123,79,109,110,149,111,112,70,27,23,75,76,77,29,114,115,33,81,82,83,121,43,122,41,106,124],checksum:29,anonym:[50,29],ci_output:97,loop:[125,55,29],javascript_ajax_img:43,subsect:80,real:[23,96,134,29,80,127,41],pound:147,uri_str:[83,150,81,29],nl2br_except_pr:[46,20],readi:[29,53,13,108,138,111],member_ag:149,"3g2":29,pakistan:91,last_link:[62,29],jpg:[147,23,144,53,97,145,128,6,112],password_default:25,itself:[149,29,125,45,79,55,103,50,131,155,141],rid:101,saferplu:79,recompil:112,row_alt_start:124,form_checkbox:[92,29],shirt:[92,130,98],grant:77,limit_charact:121,msexcel:29,belong:33,myconst:125,up95:91,shorter:[50,33],redisplai:50,decod:[29,79,46,101,109,139,140],onclick:92,octal:[53,114,148],date_rfc1036:91,blogview:134,conflict:[28,7,29],bom:125,parse_templ:19,archiv:[33,112,21,29],imagin:136,optim:[34,29],"3gp":29,defeat:6,ssl_kei:94,piec:[96,66,79,21,109,121,103],moment:[41,12],strength:101,mousedown:43,user:[125,98,45,48,91,9,94,13,55,18,139,104,142,145,110,25,38,75,76,29,114,80,34,81,151],"_exception_handl":[113,29],extrem:[68,101,131],repopul:[50,29],robust:[126,23],wherev:18,new_data:109,transitori:109,cilex:80,recreat:[148,112],subpackag:125,travers:[140,11,69],task:[49,27,131,84,103],unicod:[125,29],discourag:[125,33],eleg:38,somet:82,exit__auto_min:[113,45],parenthes:149,honor:29,person:[10,23,77,140,108,128,112],tb_id:121,gambier:91,elev:112,traffic:[96,134],table_exist:[47,87],result_id:[2,34],anybodi:103,full_path:128,predetermin:50,add_package_path:108,ci_secur:[140,69,46,29],ceo:127,"_file":29,rule:[0,29],obscur:[53,79],vietnames:29,shape:[142,6,96],unix_to_tim:91,mysql:[94,75,76,29,87,149,48,82,91,12,146,153,70],love:[131,6],question:[29,135,64,34,48,8,6,138,141],sidebar:134,failsaf:106,move:[54,55,132,29],sandal:0,errand:134,point1:41,restructuredtext:80,theoret:79,m4u:29,mydatabas:[146,78],num_link:[62,29],label_text:92,tweak:29,xml_rpc_respons:96,unlik:[27,96,125,66,33,45,81,130,106],subsequ:[29,133,43,87,108,18],app:[68,41],myothermethod:129,useless:[82,83,33,29],bin:53,australia:91,varchar:[28,76,145,21,100,118,121,103],format:[27,86,75,29,55,80,94,82,151,25,139,141],improperli:29,is_writ:105,file_ext_tolow:[128,29],get_post:29,intuit:68,corner_styl:43,nginx:14,game:142,backtick:[48,29],insert:[87,34,29],is_resourc:[143,29],bit:[29,79,87,33,80,109,103,131,141],characterist:79,array_pop:27,intel:93,table2:[149,75],table3:149,table1:[149,75],captcha_tim:145,heading_cell_start:124,post_system:129,userfil:128,alpha_numer:50,resolv:[107,141,29],enable_hook:[129,57],collect:[27,21,34],"boolean":[79,87,125,47,130,128,48,91,92,50,93,11,96,134,53,98,6,57,103,140,105,78,62,143,19,144,94,108,148,112,146,71,23,75,29,114,115,33,81,37,121,106],mycustomclass:92,highlight_str:147,password_verifi:25,popular:[103,66,79,12],smtp_crypto:23,word_limit:[147,29],xmlrpc_client:96,encount:[29,33,45,108,151,140,106],mylist:6,often:[94,2,20,125,79,14,8,33,136,103],mcrypt_rijndael_256:109,sess_match_ip:103,fcpath:113,creation:[53,29],some:[137,0,2,43,125,126,45,79,8,47,92,143,5,91,9,50,122,93,10,94,96,134,53,13,98,14,101,56,138,103,140,105,106,62,63,144,147,66,21,22,108,28,110,25,149,146,113,27,136,23,75,29,114,115,33,80,34,81,129,41,139,87],back:[62,28,12,29,30,66,33,98,21,22,34,87,75,96,25,50,131,140,79],if_not_exist:76,sampl:[86,76],get_zip:112,error_gener:[71,45],redi:29,phpredi:[103,66],scale:84,chocol:108,culprit:29,sku_965qr:130,exect:29,exec:[105,29],per:[98,75,18,29],foreign:[75,29],usernam:[137,94,23,96,78,55,149,151,148,103,92,50,146],substitut:115,larg:[0,23,75,29,125,33,55,150,68,92,9,96,84,124],error_views_path:29,unsanit:48,reproduc:141,newdata:103,machin:28,id_:98,object:[87,2,34,146,29],run:[89,94,2,149,76,29,87,55,34,48,47,82],field_id:13,irkutsk:91,raspberri:29,agreement:[51,131],cal_cell_content_todai:19,step:[27,64,54,34,139,141],form_dropdown:[92,29],news_item:21,db_driver:29,prep_for_form:[50,29],concoct:109,victoria:91,mssql:[87,70,29],cautious:109,reduce_linebreak:46,sess_encrypt_cooki:[33,108,29],constraint:[139,28,76,29],row:[82,111,87,149,29],extract_url:121,prove:[125,126],highlight_cod:[147,29],manag:29,rowcount:29,idl:[87,146,29],microsecond:[87,29],add_row:124,product_opt:130,mcrypt:[33,29,79,101,109,58],update_entri:[96,78],uncach:149,cookie_path:[103,3],reduct:29,upload_data:128,primarili:63,init_pagin:29,within:[0,2,76,29,80,122,18],pdostat:29,upgrad:[51,139,29],product_edit:98,ci_except:29,jimmi:135,todai:19,alpha:[29,135,139,130,50,106],contributor:127,announc:127,total_queri:87,pcre:29,websit:[30,103,33,29],inclus:29,institut:[127,77],bangladesh:91,next_prev_url:[19,29],spam:[81,121],fledg:8,proprietari:29,sock:66,stylesheet:[147,6,81,7],submit:[137,92,90,91,50,130,102,10,9,53,135,55,6,57,139,141,19,133,22,145,149,112,146,75,29,34,48,82,128,124],custom:29,optimize_t:[75,29],flashdata:[33,109,29],forward:[28,98,33,55,7,150,92,140],update_post:96,cur_tag_open:62,files:114,zealand:91,properli:[0,79,149,29,115,33,80,21,48,139,103,155],repeatedli:79,great:[131,6,141,29],twenti:62,current_url:[81,29],add_insert:75,perman:[125,103,101,109],link:[27,3,29,125,107,13,80,81,6],translat:[114,98,75,76,29],newer:[25,125,70,141,29],atom:[66,91,29],azor:91,ci_form_valid:50,ci_:[9,27,101,110,29],angri:6,info:[69,29,114,45,98,46,81,105],bevel:43,utf:[23,29,125,6,97,108,102,39,121,92,93],consist:[71,10,147,29,143,137,101,103],cid:23,myfield:92,seven:[96,19,124],mod_mime_fix:[128,29],cal_cell_cont:19,highlight:[147,19,29,125,33,80,124],similar:87,curv:138,ci_input:[69,29,33,90,110,106],enlarg:118,exit_success:113,rowid:130,bind:[87,29],flow:[125,51,129,141],parser:[51,116,125,29,84,141],hash_pbkdf:139,mouseup:43,doesn:[52,54,149,29,126,33,55,136,79,25,151,92,105,139,9,103,41,112,64],dog:[43,41,40],convert_text:125,incomplet:[121,29],oof:125,guarante:[103,140,42],apache_request_head:106,rewritecond:5,gecko:93,bracket:[129,29],another_mark_end:41,anyth:[94,79,29,33,98,81,130,109,92,139,41,141,132],crypt:25,sequenti:[28,29],form_valid:[104,29],invalid:[19,96,29,53,125,91,103,50,140],id_123:98,smtp_pass:23,setenv:14,bad_filenam:29,librari:[0,86,149,29,44,80,122,110,146,105,141],trans_begin:[12,29],ellipsi:[147,20],xss_filter:33,particular:[137,87,7,47,129,130,50,132,12,134,135,55,103,93,147,149,96,146,27,75,77,78,34,81,82,121,41],is_mobil:[93,29],ctr:79,draw:145,rijndael:79,introduc:[63,125,21,8,153,105],drop_column:[76,29],elsewher:[130,103],js_library_driv:43,wrongli:29,eval:[151,105,29],less:[147,1,29,125,45,52,81,50],curtail:121,cal_cell_no_cont:19,smilei:[88,29],um35:91,index_pag:[6,64,81,29],curl:49,algorithm:[69,29,101,109,25,139],vice:53,svg:6,callback_username_check:50,sftp:148,parse_smilei:13,depth:[124,11,79,29],xmlrpc_server:96,get_userdata:[137,103],image_librari:53,far:[50,96,103,87],fresh:[149,33,99,100,101,102],script_head:43,slash_seg:150,scroll:43,set_output:97,oop:[9,137,29],fopen_read_write_create_destruct:113,basic11:6,partial:[124,29],examin:[130,133,96,149],scratch:[131,84],mysql_to_unix:91,rewriteengin:5,ellips:[147,6,29],last_upd:97,urandom:[25,33,140,79],do_hash:[101,69,29],router:[35,133,110,33,29],compact:125,ci_session_driv:103,privat:[94,29],current_us:34,get_mime_by_extens:[114,29],you_said:96,friendli:[71,5,64,79,80,29,81],send:[142,0,75,144,134,29,114,126,33,81,87,125,90,129,92,139,41,146,141],code_start:41,lower:[94,29,135,79,98,81,128,9,105,106],blaze:103,opposit:[43,91],aris:77,function_exist:[105,29],bcc_batch_siz:23,sent:[0,87,126,45,129,50,133,96,97,56,18,103,141,142,144,108,23,76,29,115,121,41],passiv:148,unzip:54,convert_ascii:121,whichev:149,"_plugin":29,disclos:141,vlc:29,plain_text:79,account:[0,106,91,84,29],blog_id_site_id:76,ofb8:79,spoof:29,syntax:[89,146,149,48,29],smtp_keepal:[23,29],relev:[94,46],tri:[29,64,30,33,7,57,140],db_debug:[94,78,146,29],byte_format:[152,29],magic:[103,29],succeed:87,http_client_ip:[106,29],notabl:[33,55,29],non_existent_directori:107,ci_config:[33,81,7,29],lombardi:142,kmz:29,"try":[94,149,48,29],last_queri:[82,83,87,29],noninfring:77,mysubmit:92,pleas:[114,0,54,3,4,43,119,7,34,92,141,91,147,9,50,131,151,95,69,78,58,53,135,13,83,99,100,101,102,56,57,103,146,15,16,17,61,130,120,72,66,97,108,153,123,139,74,104,109,110,25,111,79,71,27,73,38,149,29,30,31,32,33,46,81,59,35,36,37,118,60,39,67,154,41,106,42,117,155],malici:[139,140],impli:77,constrain_by_prefix:[87,29],use_t:29,set_radio:[92,50,29],myuser:54,anoym:129,cfb:79,encourag:[79,138,29,33,98,7,68,81,57,109,121,9,139,153,100],crop:[53,68,29],date_atom:[33,91],cron:[49,149],video:29,ci_db_driv:[87,29],download:[75,29],odd:150,click:[27,43,125,13,81,92],show_debug_backtrac:113,compat:29,index:[113,0,29,55,110,45,34,14,129,80,98,49,139,111,132],phpdoc:141,sapi:106,compar:[149,29],use_global_url_suffix:[62,29],page2:149,slight:33,"_set_overrid":29,cal_cel_oth:19,xor_encod:29,experiment:[43,33],helper3:27,helper2:27,helper1:27,text_watermark:29,this_string_is_:147,bird:41,can:[0,2,5,7,8,9,11,12,13,14,19,20,21,22,23,25,27,28,29,30,33,34,37,38,41,43,44,45,46,47,49,50,53,54,55,56,18,62,63,65,66,71,75,76,78,79,80,81,82,83,137,87,90,91,92,93,94,96,97,98,100,6,103,104,105,106,108,109,110,111,112,114,115,48,121,122,124,125,128,129,130,131,132,133,134,135,136,139,140,141,142,143,144,145,146,147,148,149,150,151],ci_sessions_timestamp:103,sybas:[33,29],imagepng:29,preg_quot:29,is_cli_request:29,elips:6,len:135,sqlsrv_cursor_stat:29,closur:[129,29],hkk:29,logout:103,blog_name_blog_label:76,session_write_clos:103,safer:[82,149,48],vertic:53,encryption_kei:109,crypt_blowfish:25,design:[5,79,19,29,115,13,48,68,109,130,139,131,124,78],select_avg:[149,29],ineffect:33,metro:150,larger:[53,101,45,29],technolog:[127,77],alaska:91,mb_substr:25,migration_typ:[28,29],cert:29,ci_pars:115,another_field:[33,76],heading_cell_end:124,"_fetch_uri_str":29,typic:[62,0,11,96,91,134,27,53,98,78,55,34,48,108,65,109,139,130,103,93],set_ciph:109,wm_hor_offset:53,chanc:[142,103,33],subsubsubsect:80,field1:[149,106],firefox:29,danger:[105,29],foreign_key_check:[75,29],new_fil:148,approxim:109,base_url:[9,102,122,81,29],bad_dat:91,standpoint:52,api:[43,96,29,79,14,140],blog:[0,28,149,134,27,115,13,98,34,81,108,148,121,78],oval:6,apc:29,file_ext:128,day_typ:19,blog_set:7,heading_next_cel:19,sorri:103,tailor:[53,62,23,79],cache_expir:0,zip:[51,116,75,29],commun:[94,96,29,127,103,141],ci_control:[113,0,136,28,96,134,78,13,21,101,122,49,50,128],doubl:[1,75,149,29,125,135,20,98,46,92,96],seamless:109,my_arch:112,"throw":29,implic:[30,33,110],eleven:[147,124],usr:[53,23],clear_data:112,expiri:[103,141],start:[87,29],rick:[127,82,48],sort:[130,103,96,150],comparison:[125,143,149,29],wincach:29,error_lang:137,benchmark:[0,110,129,29],about:[87,141,29],balanc:149,wm_text:53,prefetch:[55,29],trail:[148,29,135,33,98,7,150,129],from:[2,87,29,34,111,146,141],extens:[27,94,144,134,29,114,44,87,80,145,25,37,9,105],actual:[62,43,136,79,144,29,98,33,45,115,137,126,145,107,25,103,105,70],getter:103,harvest:[19,81,29],focu:[43,131,80,84,63],firebird:[70,75,29],signific:50,retriev:[111,87,34,29],alia:[33,19,149,29,97,13,55,46,81,108,87,135,90,91,103,92,69,141,105,106],crazi:149,cumbersom:12,annoi:6,smart_escape_str:29,obvious:2,collat:[94,76,29],meet:[52,125,79,139,50,141],valid_base64:[50,29],has_userdata:[103,29],aliv:29,control:[141,149,34,29],distrubut:103,sqlite:[94,70,29],weaker:79,tap:[129,29],pre_control:129,chosen:[54,12,79,66,33,100,103],process:[12,29,55,82,18,146],lock:[114,103,33,29],tax:34,high:[147,52,29,79,139,109,121,103],tag:29,entry_id:121,tab:[75,29,125,80,81,140],epallerol:29,sought:149,onlin:12,serial:[34,29],image_size_str:128,everywher:103,surfac:29,is_str:143,filepath:[129,148,112,108],soon:[33,153],tamper:29,six:124,database_exist:[75,29],xml_convert:1,build_str:125,crlf:[23,29],copyright:[53,77],subdirectori:[38,108,29],instead:[0,1,125,55,47,49,129,91,92,69,9,135,13,98,6,139,141,144,110,149,146,27,75,76,29,114,34,151,40,122],reestablish:[87,29],zip_fil:112,convers:[29,14,108,20],stock:[100,37],docblock:[125,29],loui:142,likewis:53,prolif:125,overridden:[0,109,29],singular:[52,40,29],interchang:[79,108],fran:29,table_clos:[19,124],act:[136,96,134,29,33,108,90,140,105,106],sundai:[19,91],pasteur:142,my_cached_item:66,server_addr:29,attent:[68,29],discard:[108,29],redund:29,dbutil:[75,108],exit_config:113,trim_slash:[135,29],chown:103,some_var:45,ssl_cert:94,"20121031100537_add_blog":28,friendlier:90,light:109,m4a:29,robot:[6,93,29],suppress_debug:148,issu:29,webroot:139,days_in_month:[19,91,29],wordwrap:[23,29],allow:[114,0,79,125,98,7,92,128,91,9,50,131,52,12,53,135,13,55,151,57,103,140,106,62,143,130,19,149,66,94,108,74,110,96,71,28,75,29,30,115,33,34,81,150,82,37,152,121,139,124],append_output:[97,29],fallback:[125,33,141,29],per_pag:62,furnish:77,json_encod:97,y_axi:53,include_path:[114,29],screensend:87,cryptographi:79,sess_regener:103,insight:8,optgroup:[92,29],product_id:150,passion:6,comma:[23,75,29,103,121,50,141],gender:150,is_dir:148,georg:142,bunch:33,get_csrf_token_nam:[99,140],enclosur:75,cubird:76,outer:149,reilli:135,pecl:103,wget:49,adjust_d:19,maxlifetim:103,fetch_:33,form_password:92,button:[92,50,29],apache2:107,therefor:[86,29,30,33,34,103,130,50],pixel:[53,128],img_height:145,double_encod:29,docx:29,fourth:[92,147,23,75,91],handl:29,auto:[146,12,29],remove_package_path:108,overal:29,camino:93,auth:[98,29],p10:29,mention:[103,79,29],p12:29,password_bcrypt:25,overkil:[9,27,110],tbody_clos:124,front:[114,133,29],profiler_no_memori:29,csrf_protect:[140,29],escape_identifi:[87,29],strive:52,models_info:114,another_nam:103,somewher:112,"_remove_evil_attribut":29,xml:29,edit:[98,81,29],unlimit:76,wm_x_transp:53,tran:6,json_unescaped_unicod:97,ping_url:121,scrollbar:81,myfold:[148,112],mystyl:6,batch:[23,149,29],disregard:74,mycheck:92,error_report:45,register_glob:29,pygment:80,few:[79,19,29,30,33,98,22,8,125,57,121,25,103,131,141,105,106],yakutsk:91,better_d:91,due:[43,79,75,29,33,149,143,101,103],intellig:[134,29,81,68,7,146],chunk:115,einstein:142,product:[71,0,94,28,29,33,98,14,7,150,5,54,139,130,103,79],consum:[41,83,29],sha224:79,meta:[47,6,55,29],"static":[119,51,117,99,100,101,102,56,57,58,59,60,61,63,120,21,18,15,71,72,73,74,29,30,31,32,33,16,35,36,37,118,17,39,67,123,153,154,155],driver_nam:[86,29],connor:135,password:[94,146,29],our:[52,79,149,108,136,103,33,21,22,8,139,138,121,49,50,131,141],meth:[23,80],hiddenemail:92,"_after":76,special:[38,96,76,29,103,139,121,92,50,106],out:[113,142,28,96,77,29,53,54,34,22,8,87,125,151,23,139,92,103,141,105,79],variabl:[0,94,75,29,55,151,45,14,48,83,122,27,9,149,146,105,132],set_flashdata:103,reload:50,influenc:79,parse_str:[115,29],hmac_digest:79,some_librari:125,categori:[125,27],thoma:142,clockwis:53,rel:[11,23,78,53,107,29,108,114,128,6,129,139],inaccess:49,inspir:127,rec:6,plural:[40,29],char_set:[94,123,76,146,29],math:6,random_el:[142,27],default_templ:19,ecb:79,insid:[137,38,3,29,115,33,80,149,22,129,110,103,122,112,132],sendmail:[68,23,29],frank:149,msssql:29,sess_cookie_nam:103,umark_flash:103,readm:[103,80],get_var:[108,29],get_wher:[149,21,29],transliter:147,invas:29,csrf_regener:[140,29],group_id:125,chatham:91,bleed:127,greedi:[125,29],prefix_tablenam:48,marginleft:43,get_day_nam:19,select_sum:[149,29],nowher:107,indent:141,should_do_someth:80,tripled:79,migration_add_blog:28,unnam:29,lexer:80,put:[0,33,55,49,128,92,50,132,12,134,53,13,98,18,103,106,62,143,64,21,145,139,96,23,149,29,79,34,48,121,41,124],email_lang:137,timer:[0,41,97,48],keep:[34,29],profiler_no_memory_usag:29,length:[147,87,135,29,47,18,25,139],unidentifi:93,wrote:[21,141],outsid:[43,5,79,147,29],url:[0,29,98,49,24,27,9,122,82,105],retain:[103,109,29],do_xss_clean:[101,29],timezon:29,south:91,softwar:[143,77,65,79,45,138],cache_info:66,delete_cooki:[90,29],diplay_error:53,blown:[115,143],blogger:96,ci_ftp:148,qualiti:[53,68,141],echo:[75,76,55,48,47,82,149,111],whoop:136,date:[149,111,78,75,29],proxy_ip:[106,29],oci8:[70,29],pgp:29,quick_refer:29,owner:[103,139],child_on:38,shortcut:6,facil:141,b99ccdf16028f015540f341130b6d8ec:130,utc:91,prioriti:[23,29,79,45,108,103],forgeri:[139,29],"long":[27,23,19,76,29,125,79,145,139,25,103,132,106],fair:12,timestamp:[28,19,29,33,145,91,103],newus:103,unknown:[151,33],licens:[10,51,29],perfectli:0,mkdir:[103,148],system:[94,12,29,44,34,48,149,141],wrapper:[66,55,87],attach:[68,143,23,29],attack:[29,79,22,128,139,103,140,106],physic:23,which:[0,2,3,43,125,98,79,8,92,143,5,48,91,74,9,50,131,132,52,12,134,106,53,135,54,55,14,100,57,153,103,146,140,105,18,62,63,130,19,141,144,147,66,94,108,145,23,109,96,25,69,112,115,27,136,38,149,29,30,97,33,34,81,150,82,83,39,121,28,139,124],termin:[49,121,105,81,29],erron:29,"final":[0,147,129,29],ssl_capath:94,ipv4:[50,106],find_migr:28,haystack:[25,27],lot:[55,46,22,110,103,140],big:29,methodolog:129,fetch_method:29,col_arrai:13,third_parti:29,shall:77,accompani:33,essenti:141,ogg:29,exactli:[149,76,29,53,98,55,115,109,103,9,50,106],haven:[50,79,108,22,103],kamchatka:91,rss:[65,6,91],prune:49,detail:[43,79,96,29,53,66,33,45,14,7,108,68,125,90,57,139,9,103,111,101,131],jsref:81,structur:[89,29],charact:[1,79,87,125,91,92,50,93,94,53,135,97,98,6,57,103,140,105,106,20,22,109,139,25,147,23,75,76,29,114,33,80,46,81,118,39,121],claim:77,your_str:62,htaccess:[5,29,114,54,14,139,131],session_data:[103,83],sens:[65,27,33,29],becom:[62,5,52,23,19,27,53,79,108,81,125,136,140,124],sensit:[103,86,75,139,29],foobarbaz:66,signifi:145,stricter:140,pgsql:94,accept_lang:[93,29],send_error_messag:96,"function":[141,29],counter:53,codeignitor:29,faster:[115,79,81,56,103,131,84],terribl:[50,91],falsi:92,explicit:[125,29],basepath:[71,113,28,19,29,108,9],respons:[28,134,29,97,45,34,81,121],clearli:125,correspond:[137,3,125,44,7,128,50,96,134,53,135,13,98,103,104,19,21,22,4,115,34,150,83],sufix:62,corrupt:29,have:[0,3,5,6,7,8,9,10,12,13,14,15,16,17,123,19,21,22,23,25,28,29,30,31,32,33,34,35,36,37,38,39,43,45,46,47,50,52,53,55,56,57,58,59,60,61,62,121,71,72,73,74,75,76,78,79,80,81,83,87,90,91,92,94,95,96,97,98,99,100,101,102,103,106,108,109,110,115,48,117,118,119,120,67,122,125,128,129,130,132,134,136,138,139,141,142,143,145,146,148,149,150,18,153,154,155],close:[141,29],get_metadata:[66,29],member_nam:87,superobject:[129,29],pg_version:29,tb_date:121,migration_auto_latest:28,admin:[33,75],in_arrai:[30,27,33],rout:[49,0,129,24,29],fileproperti:125,accuraci:29,tighten:29,mix:[137,142,87,98,45,7,90,91,92,50,96,135,97,55,6,103,140,105,106,62,143,144,66,21,108,23,25,112,147,28,149,80,128,81,150,152,124],discret:[27,38,29,90,50,124,106],cheatsheet:29,hkdf:79,codeigniter_profil:29,anchor_popup:[81,29],listen:[103,96],mit:29,singl:[94,87,141,34,29],uppercas:[0,29,125,135,109,106],address_info:92,unless:[79,125,90,130,10,134,53,97,55,57,103,142,143,20,108,109,25,112,149,76,29,33,46,128],post_control:129,ci_cor:29,oracl:[94,70,149,29],galleri:53,textmat:80,row_alt_end:124,header1:23,get_request_head:[106,33,29],eight:124,max_filenam:[128,29],deploi:[28,29],segment:[87,141,34,29],"class":[141,29],page_query_str:62,newprefix:48,placement:29,expert:79,child_two:38,gather:[47,93],upset:6,set_error_delimit:[50,29],character_limit:[147,29],face:20,inde:[125,29],my_log:33,determin:[82,87,34,29],built:[92,128,136,81,106],constrain:29,stark:131,plaintext_str:109,fact:[103,33,134,109,79],my_bio:112,ci_user_ag:93,cal_cell_start:19,extension_load:109,send_respons:96,ci_sess:[100,33,118,153,103],model_nam:[108,78],watch:[45,21],bring:[127,101],new_imag:53,format_charact:[29,20],trivial:[103,141],anywai:[79,29],texb:[53,145],redirect:[5,23,96,29,98,81,122,9],dbcollat:[94,123,76,146,29],textual:19,locat:[137,0,54,43,45,7,129,91,9,50,93,94,53,13,136,103,132,104,78,66,108,71,27,29,33,81,150,121],strip_image_tag:[50,69,29],blog_entri:115,holder:77,illus:142,calendar_lang:3,mug:130,should:[0,3,5,6,8,9,13,15,16,17,18,19,21,23,25,28,29,30,31,32,33,34,35,36,37,39,43,44,45,49,50,53,54,55,56,57,58,59,60,61,70,71,72,73,74,75,76,79,80,81,137,91,92,94,96,98,99,100,101,102,103,106,108,109,114,48,117,118,119,120,67,123,124,125,128,129,130,133,134,136,139,141,143,146,147,153,154,155],jan:19,lightest:52,smallest:52,suppor:29,intrigu:6,elseif:[125,151,93],local:[113,0,87,29,80,110,9],hope:8,mb_mime_encodehead:29,meant:[137,103],um10:91,strip_slash:135,invalid_files:29,gettyp:29,server_url:96,sess_match_userag:[33,29],convert:[147,1,69,29,135,46,81,91,92],error_404:[71,98,45,155,29],wordi:125,made:[43,52,136,149,134,29,31,33,21,22,99,100,102,56,42,141],csrf:29,orig_data:109,db1:146,target_vers:28,in_list:[50,29],edg:[53,127,29],cur_tag_clos:62,endless:[25,29],application_config:125,getuserinfo:96,dishearten:6,enabl:29,organ:[34,29],nl2br:[46,20],upper:[53,106],or_wher:[149,29],bounc:43,htmlspecialchar:[50,124,105,29],sha:79,csrf_token_nam:[99,140],image_url:13,integr:[49,147,79],contain:[85,0,1,5,125,98,45,34,47,90,129,48,91,92,11,69,135,13,55,100,102,139,6,141,142,147,107,94,145,25,149,111,152,146,71,27,38,75,76,29,114,78,80,46,81,118,119,40,87],menuitem:115,grab:136,view:[87,149,34,29],conform:139,legaci:[0,33,103,109,29],avg:[149,29],cal_cell_blank:19,parse_exec_var:[97,29],frame:6,knowledg:[10,103],exit_unknown_class:113,group_nam:146,qty:[130,29],popup:81,rc2:79,equip:40,form_input:[92,130,29],my_uri:29,sphinxcontrib:80,entitl:7,thead_open:124,unexist:29,log_file_extens:29,error:[94,87,141,29],segment_arrai:150,adodb:12,correctli:[147,136,29,126,20,79,45,82,112,141],record:[10,149,29,33,21,22,101,103,140],mimes_typ:29,pointer:[63,55,29],boundari:29,last_visit:29,var_dump:[125,66],state:[43,52,23,149,0,29,143,18,91,92,103],stacktrac:141,ci_trackback:121,progress:43,multiplelanguag:137,equiv:6,thumbnail:53,get_compiled_insert:[149,29],get_dir_file_info:[114,29],perfect:[53,22],core_class:37,sole:106,bed:142,kei:[94,87,29],vrt:53,weak:139,matic:96,simple_queri:[87,48,29],salli:151,fopen_write_create_destruct:113,job:[49,136],entir:[62,27,148,75,29,125,115,63,54,55,34,14,110,103,9,50,41,66],joe:[148,149,135,98,150,151,92],has_rul:50,poof:29,parenthesi:[125,149,29],thumb:53,proxy_port:96,date_rfc850:91,quote_identifi:29,plugin:[71,123,95,39,29],wrapchar:23,goal:[51,131,84],mpg:29,cell_alt_end:124,foobaz:125,etc:[43,2,87,125,47,9,122,49,50,93,11,96,134,97,103,140,141,19,147,107,40,94,68,139,146,27,23,149,76,29,79,80,34,82,121],cachedir:[37,146,94,29],grain:81,mysecretkei:108,tld:[30,33],db_set_charset:[87,29],gmdate:97,fopen_read_write_create_strict:113,messagebodi:50,onchang:92,comment:[0,29,149,34,27],shirts_on_sal:92,unmark:103,sqlsrv_cursor_client_buff:29,ci_db_pdo_driv:29,img_id:[145,29],hyphen:29,heavi:[103,34,146],print_r:[125,75,148,19,96],chmod:[103,148,29],walk:55,image_reproport:29,rpc:[51,116,139,29],"0script":105,respect:[94,75,29,135,33,98,92,101,25,50],tuesdai:19,mcrypt_mode_cbc:[109,29],append:[62,94,23,134,29,135,97,81,128,7,92],utf8_general_ci:[94,146,76,123],april:29,quit:[27,96,143,125,80,6,18,121,131],foofoo:125,tort:77,addition:[76,29,125,44,33,108,7,6,104,106],endforeach:[134,128,21,151,130,131],get_inst:29,form_prep:[92,29],watermark:29,compon:[52,19,29,130,103,141],json:97,write_fil:[114,75],treat:[5,12,87,29,6,112],date_w3c:91,popul:[19,29],xlsx:29,curli:[29,20],both:[79,89,122,130,50,96,53,13,103,105,141,109,149,112,75,76,29,30,33,80,81,150,54,106],censor:147,overlay_watermark:29,interbas:[82,70,75,29],togeth:[62,149,134,136,48,145,50],raw_data:79,user_guid:37,fail_gracefulli:[108,7],mouseov:43,present:[94,29],opac:53,request_head:[106,29],replic:103,multi:[94,134,29,115,6,129,130,103,124],cypher:109,"14t16":91,plain:[13,69,29,97,33,79,109,115,25,139],align:[53,130],some_photo:112,harder:142,log_file_permiss:29,harden:[105,29],defin:[55,76,105,29],filename_secur:29,suport:91,encrypted_str:109,hex2bin:[25,79,29],decept:6,wild:29,get_compiled_delet:[149,29],sess_time_to_upd:[103,123],"8bit":25,mydogspot:40,layer:[25,139,70,21,29],purchas:130,customiz:[62,94],cell:29,almost:[103,11,79,150],field_data:[47,87,55,34,29],site:29,langfil:137,some_class:[80,110],ruri_str:[150,29],svg11:6,bigint:[103,145],substanti:[110,77,29],lightweight:137,sting:93,incom:[96,121],unneed:29,symbolic_permiss:[114,29],test_datatyp:143,free_result:[55,34,29],uniti:29,human_to_unix:[91,29],let:[94,2,149,87,29,34,48,47,18],welcom:[98,134,110],ciper:79,parti:[80,21],cross:[69,29,31,6,139,105,106],ci_tabl:124,member:[149,87,34,127,50,106],code_end:41,data_seek:[55,29],pingomat:96,android:29,fubar:108,difficult:53,prais:8,immedi:[129,18,29],columbia:[127,77],hostnam:[29,94,148,78,30,33,87,146],equival:[125,147,13,136],keepal:29,db_select:[87,146,29],upon:[10,29,53,87,8,50,131,106],effect:[34,29],coffe:130,dai:[124,29,19,91,8],column_nam:76,retriv:106,raboof:125,having_or:29,sooner:[100,33],build:[0,94,54,96,5,53,80,33,45,34,81,65,138,98,149,97,132,140,131,84,114],set_:92,alpha_dash:50,expand:[29,22,8],andretti:142,ofb:79,orig_nam:128,set_empti:124,off:[62,0,148,12,10,29,34,82,128,92,139,141],center:[53,136],reuse_query_str:[62,29],epub:80,unl:33,colour:29,well:[137,43,125,91,49,50,131,93,11,98,6,103,105,62,143,70,23,149,29,114,33,151,84],set_cooki:[90,106,29],weblog:[96,121],exampl:[94,2,87,29,34,146,141],command:[149,146,75,29],filesystem:28,undefin:[143,29],audio:29,loss:103,sibl:38,usual:[5,79,96,43,53,33,98,108,81,147,90,148,103,50,131,112,128,106],next:[33,149,29,135,13,55,34,14,141],taller:53,display_overrid:129,newest:[130,28],camel:40,drop_databas:[76,29],half:103,obtain:[137,77],tcp:[103,66],jar:29,settabl:29,ci_xmlrpc:[96,29],some_cookie2:106,rest:[98,94,78,80,8],glue:136,new_post:96,sku:130,web:34,"50off":130,filter_validate_email:126,fopen:[114,29],idiom:137,disagre:141,multipart:[92,128,29],arandom:25,smith:[49,96],my_backup:112,myprefix_:106,add:[0,5,44,9,48,92,94,147,134,135,55,6,56,57,98,141,64,145,110,149,146,71,27,75,76,29,80,81,37,152,40],wm_vrt_align:53,error_email_miss:137,foobar:[125,142,78],display_pag:62,logger:29,suit:[53,143],warrant:101,old_table_nam:76,gmt:[97,91],exot:106,set_mim:144,xmlrpc:[125,96,29],agnost:87,vanuatu:91,http_x_cluster_client_ip:[106,29],foreign_charact:29,camelcas:125,five:[130,135,124],know:[0,79,75,76,33,98,136,22,47,139,141,109,110,49,103,106,68,70],fscommand:29,convert_xml:121,octal_permiss:[114,29],set_select:[92,50,29],height:[142,43,29,53,81,145,128,6],recurs:[11,148,29,101,25,112],get_item:[130,29],desc:149,xss:[105,29],resid:3,like:[0,1,2,3,5,125,98,7,47,49,128,92,129,48,91,74,9,50,131,93,151,94,147,12,134,53,13,55,14,148,87,101,142,57,103,132,140,105,78,62,143,130,19,115,20,65,108,22,153,145,28,109,110,25,96,112,79,71,27,136,23,149,146,29,97,33,80,34,81,150,82,37,54,121,43,122,41,106,139,84,124],lost:[103,29],safe_mailto:81,um11:91,up105:91,sessionhandlerinterfac:103,num_tag_clos:62,interfer:103,session_regenerate_id:103,unord:[6,29],necessari:[0,149,87,125,29,92,16],active_r:[71,123,29],messi:50,lose:[125,142,79],resiz:[53,43,68,81,29],get_temp_kei:103,xsl:29,path_info:3,cdr:29,exceed:[23,146,87],revers:29,"_html_entity_decode_callback":29,migration_path:[28,29],suppli:[2,87,126,45,47,128,92,50,94,53,13,140,105,106,143,19,108,145,25,111,112,148,149,29,114,33,81,141],stat:[0,29],kdb:29,daylight:91,"export":29,superclass:125,proper:[29,79,149,87,125,33,45,128,50,140],home:[136,93],use_strict:143,form_item:50,transport:96,auto_typographi:[29,46,20],week_row_start:19,trust:[94,29],lead:[125,135,150,98,29],broad:[84,26],avoid:[137,23,29,125,66,33,7,150,128,103,92,50,106],lean:[115,131],februari:29,leap:91,log_error:[137,37,45,29],default_method:0,speak:76,myfunct:129,um12:91,congratul:[103,22],liabil:77,acronym:29,journal:98,"10px":92,usag:[89,149,76,29,55,34,47],values_pars:29,facilit:29,maintain_ratio:[53,29],host:[94,87,66,29,6,103,84,146],hash_pbkdf2:[25,139,29],nutshel:[49,0],cal_cell_oth:19,although:[62,27,79,29,33,48,18,50,131,84],offset:[62,149,29,53,66,55,150,91,25],product_name_rul:130,parserequest:29,slug:[135,21,22],stage:129,rsegment_arrai:150,sbin:23,rare:[103,101,79,48],interven:97,last_citi:125,column:[87,29],prop:53,sqlsrv:[94,33,70,29],error_username_miss:137,entity_decod:[140,46,29],includ:[5,2,43,125,44,87,130,128,91,9,50,131,10,11,96,134,54,136,148,101,138,103,140,105,78,141,147,21,22,108,33,139,149,112,27,23,75,76,77,29,114,115,79,80,81,150,83,106,153,154,155],member_id:[92,96,34,87],constructor:[146,122,29],cal_row_end:19,repercuss:57,powerpoint:29,is_tru:143,creating_librari:37,set_data:[50,29],own:[0,12,29,34,48,122,25,149,141],delete_al:29,payment:149,inlin:[23,6,13,29],"_ci_autoload":29,easy_instal:80,automat:[2,141,34,29],first_tag_open:62,warranti:77,guard:[79,109,121],wm_overlay_path:53,awhil:29,col_limit:124,relicens:29,hang:8,mere:[142,141],merg:[149,77,29,108,7,141],is_brows:[93,29],beep:147,myform:[92,50],ctype_alpha:29,unix_start:91,val:[149,125,97,108,145,50,124],pictur:[6,23],myforg:76,transfer:[106,79,148,29],howland:91,support:29,db_query_build:[149,29],beer:129,language_kei:[85,137],macintosh:93,standard_d:[91,29],much:[28,29,33,108,91,25,103,131,84,106],pool:[145,29],filemtim:29,"var":[29,125,66,108,103,105],venezuelan:91,"_lang":137,application_fold:[54,132],reduc:[135,66,139,46,34],total_row:62,unexpect:103,unwrap:23,bcc_batch_mod:[23,29],brand:93,my_model:123,multical:29,"_util":0,is_natur:50,bodi:[23,149,134,29,115,13,55,136,128,126,50],gain:[100,66,79,34,109],select_min:[149,29],dbforg:[108,28,76,33,29],eas:29,highest:[23,112],eat:6,count:[87,29],group_start:149,cleanup:29,temp:115,rc4:79,wish:[137,43,125,45,7,130,129,92,11,96,134,53,54,98,18,103,106,143,19,147,108,109,149,27,148,75,76,79,81,150,41],unload:43,writeabl:114,flip:53,ci_model:[101,21,78],asynchron:140,directori:[94,87,44,29,34,18],below:[5,79,43,45,7,92,128,129,91,9,50,12,134,53,13,55,103,130,19,147,21,108,145,110,96,111,146,27,23,149,76,29,78,80,34,83,139,155,124],item_valu:7,limit:[111,2,29],tini:6,fetch:[142,149,134,29,66,33,55,47,25],view_cascad:108,otherwis:[137,0,79,126,92,90,130,53,98,14,103,105,106,108,139,25,113,23,75,77,29,33,41,141],problem:[147,29,33,45,138,103,50,141],weblogupd:96,reliabl:[147,29,30,33,81,103,93],evalu:[125,143,29],timespan:[91,29],"int":[87,45,90,91,130,11,96,135,97,55,148,6,103,140,105,106,19,66,21,145,28,109,25,147,23,149,76,114,79,80,150,152,121,41,124],dure:[137,27,78,29,139,83,129,103,25,50],filenam:[137,27,28,69,144,29,53,140,33,125,128,7,114,37,23,129,110,9,75,112],novemb:29,implement:[137,79,12,149,29,33,103,87,25,121,9,50],some_nam:103,userag:23,path_cach:125,mistaken:125,ing:29,up1275:91,httponli:[103,90,106],inc:127,spell:29,my_:[9,27,37,66,110],last_tag_open:62,percent:[139,91],front_control:71,virtual:103,plular:40,other:[5,79,3,87,125,45,47,9,90,92,129,91,49,10,12,134,135,54,14,6,139,105,123,130,19,109,146,71,27,149,29,33,80,128,81,141],bool:[137,43,1,97,87,126,45,7,130,90,91,92,50,93,11,69,53,135,13,55,6,103,140,105,106,142,143,144,107,66,40,108,149,148,25,96,112,23,75,76,114,115,80,46,81,121,128,124],bin2hex:79,rememb:[134,30,33,34,48,108,49,50],unix_to_human:91,php4:0,php5:107,php7:29,myphoto:112,key_prefix:[66,29],repeat:[135,6,29],misc_model:33,my_db:76,repeat_password:92,oci_fetch:29,june:[19,29],ci_email:[9,23],"_parse_argv":29,news_model:[21,22],theother:135,is_ascii:29,sess_save_path:[103,33,29],mondai:[19,124],has_opt:130,throughout:[29,27,78,44,79,45,137,133,140,146],trackback:[51,116,29],clean_email:29,malsup:43,basketbal:50,stai:[130,142],experienc:[53,103,125,79],thead_clos:124,sphinx:80,amp:1,strpo:125,came:139,baker:91,root_path:112,extran:29,bcc:[23,29],form_radio:[92,29],"_protect_identifi":29,portion:[25,149,45,77],emerg:141,ci_uri:[150,29]},objtypes:{"0":"php:method","1":"php:function","2":"php:class"},objnames:{"0":["php","method","PHP method"],"1":["php","function","PHP function"],"2":["php","class","PHP class"]},filenames:["general/controllers","helpers/xml_helper","database/call_function","installation/upgrade_b11","installation/upgrading","general/urls","helpers/html_helper","libraries/config","tutorial/conclusion","general/creating_libraries","DCO","helpers/directory_helper","database/transactions","helpers/smiley_helper","general/environments","installation/upgrade_163","installation/upgrade_162","installation/upgrade_161","general/caching","libraries/calendar","libraries/typography","tutorial/news_section","tutorial/create_news_items","libraries/email","general/index","general/compatibility_functions","overview/index","general/helpers","libraries/migration","changelog","installation/upgrade_303","installation/upgrade_302","installation/upgrade_301","installation/upgrade_300","database/caching","installation/upgrade_152","installation/upgrade_153","installation/upgrade_150","general/drivers","installation/upgrade_154","helpers/inflector_helper","libraries/benchmark","installation/downloads","libraries/javascript","general/autoloader","general/errors","helpers/typography_helper","database/metadata","database/queries","general/cli","libraries/form_validation","index","overview/goals","libraries/image_lib","installation/index","database/results","installation/upgrade_141","installation/upgrade_140","installation/upgrade_220","installation/upgrade_221","installation/upgrade_222","installation/upgrade_223","libraries/pagination","tutorial/index","installation/troubleshooting","overview/mvc","libraries/caching","installation/upgrade_212","overview/features","helpers/security_helper","general/requirements","installation/upgrade_130","installation/upgrade_131","installation/upgrade_132","installation/upgrade_133","database/utilities","database/forge","license","general/models","libraries/encryption","documentation/index","helpers/url_helper","database/helpers","general/profiling","general/welcome","helpers/language_helper","general/creating_drivers","database/db_driver_reference","helpers/index","database/index","helpers/cookie_helper","helpers/date_helper","helpers/form_helper","libraries/user_agent","database/configuration","installation/upgrade_120","libraries/xmlrpc","libraries/output","general/routing","installation/upgrade_202","installation/upgrade_203","installation/upgrade_200","installation/upgrade_201","libraries/sessions","general/libraries","general/common_functions","libraries/input","helpers/path_helper","libraries/loader","libraries/encrypt","general/core_classes","database/examples","libraries/zip","general/reserved_names","helpers/file_helper","libraries/parser","libraries/index","installation/upgrade_214","installation/upgrade_211","installation/upgrade_210","installation/upgrade_213","libraries/trackback","general/ancillary_classes","installation/upgrade_160","libraries/table","general/styleguide","helpers/email_helper","general/credits","libraries/file_uploading","general/hooks","libraries/cart","overview/at_a_glance","general/managing_apps","overview/appflow","general/views","helpers/string_helper","tutorial/static_pages","libraries/language","overview/getting_started","general/security","libraries/security","contributing/index","helpers/array_helper","libraries/unit_testing","helpers/download_helper","helpers/captcha_helper","database/connecting","helpers/text_helper","libraries/ftp","database/query_builder","libraries/uri","general/alternative_php","helpers/number_helper","installation/upgrade_170","installation/upgrade_171","installation/upgrade_172"],titles:["Controllers","XML Helper","Custom Function Calls","Upgrading From Beta 1.0 to Beta 1.1","Upgrading From a Previous Version","CodeIgniter URLs","HTML Helper","Config Class","Conclusion","Creating Libraries","Developer’s Certificate of Origin 1.1","Directory Helper","Transactions","Smiley Helper","Handling Multiple Environments","Upgrading from 1.6.2 to 1.6.3","Upgrading from 1.6.1 to 1.6.2","Upgrading from 1.6.0 to 1.6.1","Web Page Caching","Calendaring Class","Typography Class","News section","Create news items","Email Class","General Topics","Compatibility Functions","CodeIgniter Overview","Helper Functions","Migrations Class","Change Log","Upgrading from 3.0.2 to 3.0.3","Upgrading from 3.0.1 to 3.0.2","Upgrading from 3.0.0 to 3.0.1","Upgrading from 2.2.x to 3.0.x","Database Caching Class","Upgrading from 1.5.0 to 1.5.2","Upgrading from 1.5.2 to 1.5.3","Upgrading from 1.4.1 to 1.5.0","Using CodeIgniter Drivers","Upgrading from 1.5.3 to 1.5.4","Inflector Helper","Benchmarking Class","Downloading CodeIgniter","Javascript Class","Auto-loading Resources","Error Handling","Typography Helper","Database Metadata","Queries","Running via the CLI","Form Validation","CodeIgniter User Guide","Design and Architectural Goals","Image Manipulation Class","Installation Instructions","Generating Query Results","Upgrading from 1.4.0 to 1.4.1","Upgrading from 1.3.3 to 1.4.0","Upgrading from 2.1.4 to 2.2.x","Upgrading from 2.2.0 to 2.2.1","Upgrading from 2.2.1 to 2.2.2","Upgrading from 2.2.2 to 2.2.3","Pagination Class","Tutorial","Troubleshooting","Model-View-Controller","Caching Driver","Upgrading from 2.1.1 to 2.1.2","CodeIgniter Features","Security Helper","Server Requirements","Upgrading from 1.2 to 1.3","Upgrading from 1.3 to 1.3.1","Upgrading from 1.3.1 to 1.3.2","Upgrading from 1.3.2 to 1.3.3","Database Utility Class","Database Forge Class","The MIT License (MIT)","Models","Encryption Library","Writing CodeIgniter Documentation","URL Helper","Query Helper Methods","Profiling Your Application","Welcome to CodeIgniter","Language Helper","Creating Drivers","DB Driver Reference","Helpers","Database Reference","Cookie Helper","Date Helper","Form Helper","User Agent Class","Database Configuration","Upgrading From Beta 1.0 to Final 1.2","XML-RPC and XML-RPC Server Classes","Output Class","URI Routing","Upgrading from 2.0.1 to 2.0.2","Upgrading from 2.0.2 to 2.0.3","Upgrading from 1.7.2 to 2.0.0","Upgrading from 2.0.0 to 2.0.1","Session Library","Using CodeIgniter Libraries","Common Functions","Input Class","Path Helper","Loader Class","Encrypt Class","Creating Core System Classes","Database Quick Start: Example Code","Zip Encoding Class","Reserved Names","File Helper","Template Parser Class","Libraries","Upgrading from 2.1.3 to 2.1.4","Upgrading from 2.1.0 to 2.1.1","Upgrading from 2.0.3 to 2.1.0","Upgrading from 2.1.2 to 2.1.3","Trackback Class","Creating Ancillary Classes","Upgrading from 1.5.4 to 1.6.0","HTML Table Class","PHP Style Guide","Email Helper","Credits","File Uploading Class","Hooks - Extending the Framework Core","Shopping Cart Class","CodeIgniter at a Glance","Managing your Applications","Application Flow Chart","Views","String Helper","Static pages","Language Class","Getting Started With CodeIgniter","Security","Security Class","Contributing to CodeIgniter","Array Helper","Unit Testing Class","Download Helper","CAPTCHA Helper","Connecting to your Database","Text Helper","FTP Class","Query Builder Class","URI Class","Alternate PHP Syntax for View Files","Number Helper","Upgrading from 1.6.3 to 1.7.0","Upgrading from 1.7.0 to 1.7.1","Upgrading from 1.7.1 to 1.7.2"],objects:{"":{"CI_DB_driver::platform":[87,0,1,""],"CI_DB_forge::add_field":[76,0,1,""],mysql_to_unix:[91,1,1,""],"CI_DB_query_builder::or_where_in":[149,0,1,""],"CI_Input::get_request_header":[106,0,1,""],"CI_Calendar::get_total_days":[19,0,1,""],"CI_URI::segment":[150,0,1,""],"CI_FTP::delete_dir":[148,0,1,""],auto_link:[81,1,1,""],form_textarea:[92,1,1,""],"CI_Session::keep_flashdata":[103,0,1,""],"CI_DB_utility::repair_table":[75,0,1,""],"CI_DB_driver::update_string":[87,0,1,""],get_file_info:[114,1,1,""],base_url:[81,1,1,""],site_url:[81,1,1,""],"CI_DB_forge::add_column":[76,0,1,""],"CI_Output::set_output":[97,0,1,""],CI_Security:[140,2,1,""],"CI_DB_result::last_row":[55,0,1,""],form_prep:[92,1,1,""],"CI_DB_query_builder::not_like":[149,0,1,""],"CI_DB_driver::cache_delete_all":[87,0,1,""],"CI_Encrypt::encode":[109,0,1,""],date_range:[91,1,1,""],underscore:[40,1,1,""],"CI_DB_query_builder::get_compiled_delete":[149,0,1,""],"CI_DB_driver::simple_query":[87,0,1,""],force_download:[144,1,1,""],"CI_Calendar::get_day_names":[19,0,1,""],"CI_Cache::is_supported":[66,0,1,""],byte_format:[152,1,1,""],"CI_Migration::latest":[28,0,1,""],"CI_DB_driver::trans_complete":[87,0,1,""],"CI_DB_driver::reconnect":[87,0,1,""],"CI_DB_utility::database_exists":[75,0,1,""],heading:[6,1,1,""],"CI_FTP::mirror":[148,0,1,""],CI_DB_query_builder:[149,2,1,""],CI_Loader:[108,2,1,""],nbs:[6,1,1,""],doctype:[6,1,1,""],word_limiter:[147,1,1,""],write_file:[114,1,1,""],"CI_DB_driver::db_select":[87,0,1,""],"CI_Unit_test::set_test_items":[143,0,1,""],sanitize_filename:[69,1,1,""],"CI_Image_lib::rotate":[53,0,1,""],standard_date:[91,1,1,""],mdate:[91,1,1,""],"CI_Calendar::get_month_name":[19,0,1,""],"CI_DB_query_builder::limit":[149,0,1,""],"CI_Input::server":[106,0,1,""],"CI_Output::_display":[97,0,1,""],"CI_DB_query_builder::where":[149,0,1,""],xss_clean:[69,1,1,""],"CI_Input::get_post":[106,0,1,""],"CI_DB_forge::drop_database":[76,0,1,""],"CI_Form_validation::error_string":[50,0,1,""],"CI_DB_driver::trans_strict":[87,0,1,""],"CI_Trackback::send":[121,0,1,""],camelize:[40,1,1,""],form_button:[92,1,1,""],"CI_User_agent::version":[93,0,1,""],"CI_URI::uri_string":[150,0,1,""],directory_map:[11,1,1,""],strip_image_tags:[69,1,1,""],"CI_Upload::do_upload":[128,0,1,""],gmt_to_local:[91,1,1,""],"CI_DB_query_builder::get":[149,0,1,""],"CI_DB_driver::list_tables":[87,0,1,""],current_url:[81,1,1,""],"CI_Lang::line":[137,0,1,""],mb_substr:[25,1,1,""],"CI_Input::input_stream":[106,0,1,""],"CI_Cart::contents":[130,0,1,""],"CI_Xmlrpc::send_error_message":[96,0,1,""],"CI_DB_result::first_row":[55,0,1,""],"CI_DB_query_builder::or_where":[149,0,1,""],"CI_DB_query_builder::having":[149,0,1,""],"CI_Config::slash_item":[7,0,1,""],"CI_Table::clear":[124,0,1,""],"CI_DB_driver::trans_start":[87,0,1,""],"CI_Cart::remove":[130,0,1,""],"CI_Upload::data":[128,0,1,""],CI_Benchmark:[41,2,1,""],"CI_Output::cache":[97,0,1,""],"CI_Zip::get_zip":[112,0,1,""],CI_DB_driver:[87,2,1,""],Some_class:[80,2,1,""],form_reset:[92,1,1,""],"CI_DB_query_builder::select_min":[149,0,1,""],"CI_FTP::rename":[148,0,1,""],"CI_Trackback::receive":[121,0,1,""],"CI_Loader::helper":[108,0,1,""],form_fieldset_close:[92,1,1,""],"CI_DB_result::free_result":[55,0,1,""],"CI_DB_utility::backup":[75,0,1,""],"CI_DB_result::unbuffered_row":[55,0,1,""],"CI_Session::set_userdata":[103,0,1,""],"CI_Trackback::convert_ascii":[121,0,1,""],"CI_Security::xss_clean":[140,0,1,""],set_select:[92,1,1,""],quotes_to_entities:[135,1,1,""],form_open:[92,1,1,""],"CI_URI::slash_segment":[150,0,1,""],"Some_class::should_do_something":[80,0,1,""],"CI_FTP::connect":[148,0,1,""],"CI_Loader::view":[108,0,1,""],"CI_Image_lib::display_errors":[53,0,1,""],"CI_DB_driver::trans_status":[87,0,1,""],"CI_Encryption::encrypt":[79,0,1,""],"CI_DB_query_builder::or_not_group_start":[149,0,1,""],"CI_Migration::version":[28,0,1,""],CI_DB_result:[55,2,1,""],"CI_DB_query_builder::replace":[149,0,1,""],"CI_DB_driver::cache_delete":[87,0,1,""],"CI_Trackback::extract_urls":[121,0,1,""],"CI_Form_validation::set_message":[50,0,1,""],array_column:[25,1,1,""],url_title:[81,1,1,""],get_instance:[122,1,1,""],CI_Lang:[137,2,1,""],trim_slashes:[135,1,1,""],xml_convert:[1,1,1,""],"CI_DB_query_builder::or_having":[149,0,1,""],"CI_DB_query_builder::from":[149,0,1,""],show_error:[45,1,1,""],"CI_DB_query_builder::offset":[149,0,1,""],singular:[40,1,1,""],"CI_DB_result::field_data":[55,0,1,""],show_404:[45,1,1,""],array_replace_recursive:[25,1,1,""],random_element:[142,1,1,""],"CI_Security::sanitize_filename":[140,0,1,""],form_checkbox:[92,1,1,""],"CI_Trackback::validate_url":[121,0,1,""],"CI_User_agent::is_robot":[93,0,1,""],"CI_Email::message":[23,0,1,""],"CI_FTP::close":[148,0,1,""],create_captcha:[145,1,1,""],"CI_Config::item":[7,0,1,""],"CI_DB_driver::db_pconnect":[87,0,1,""],"CI_Cart::destroy":[130,0,1,""],"CI_Input::user_agent":[106,0,1,""],element:[142,1,1,""],"CI_Encryption::create_key":[79,0,1,""],days_in_month:[91,1,1,""],"CI_Session::unset_userdata":[103,0,1,""],"CI_Encrypt::set_mode":[109,0,1,""],"CI_DB_utility::csv_from_result":[75,0,1,""],"CI_Cache::decrement":[66,0,1,""],"CI_DB_query_builder::get_compiled_update":[149,0,1,""],"CI_Form_validation::error":[50,0,1,""],form_submit:[92,1,1,""],"CI_DB_driver::count_all":[87,0,1,""],"CI_DB_result::num_rows":[55,0,1,""],"CI_DB_driver::field_exists":[87,0,1,""],"CI_Trackback::limit_characters":[121,0,1,""],CI_Output:[97,2,1,""],password_hash:[25,1,1,""],CI_Encrypt:[109,2,1,""],"CI_Table::set_caption":[124,0,1,""],CI_Image_lib:[53,2,1,""],config_item:[105,1,1,""],"CI_Migration::find_migrations":[28,0,1,""],get_clickable_smileys:[13,1,1,""],form_password:[92,1,1,""],"CI_DB_query_builder::truncate":[149,0,1,""],"CI_Email::from":[23,0,1,""],"CI_FTP::delete_file":[148,0,1,""],ellipsize:[147,1,1,""],CI_Config:[7,2,1,""],"CI_Typography::nl2br_except_pre":[20,0,1,""],"CI_Zip::clear_data":[112,0,1,""],timezone_menu:[91,1,1,""],now:[91,1,1,""],"CI_DB_query_builder::count_all_results":[149,0,1,""],set_value:[92,1,1,""],strip_slashes:[135,1,1,""],"CI_DB_query_builder::or_where_not_in":[149,0,1,""],"CI_User_agent::accept_lang":[93,0,1,""],"CI_DB_query_builder::where_not_in":[149,0,1,""],highlight_phrase:[147,1,1,""],CI_Encryption:[79,2,1,""],"CI_Input::ip_address":[106,0,1,""],smiley_js:[13,1,1,""],"CI_URI::slash_rsegment":[150,0,1,""],"CI_DB_driver::db_set_charset":[87,0,1,""],"CI_Encrypt::set_cipher":[109,0,1,""],"CI_DB_driver::version":[87,0,1,""],"CI_Xmlrpc::timeout":[96,0,1,""],is_really_writable:[105,1,1,""],"CI_DB_driver::elapsed_time":[87,0,1,""],set_realpath:[107,1,1,""],"CI_Benchmark::elapsed_time":[41,0,1,""],nice_date:[91,1,1,""],"CI_DB_query_builder::update":[149,0,1,""],"CI_URI::segment_array":[150,0,1,""],CI_Cache:[66,2,1,""],"CI_DB_query_builder::reset_query":[149,0,1,""],"CI_Session::umark_flash":[103,0,1,""],"CI_DB_query_builder::not_group_start":[149,0,1,""],plural:[40,1,1,""],remove_invisible_characters:[105,1,1,""],"CI_Calendar::adjust_date":[19,0,1,""],"CI_DB_driver::call_function":[87,0,1,""],hash_equals:[25,1,1,""],CI_Pagination:[62,2,1,""],is_countable:[40,1,1,""],"CI_DB_result::list_fields":[55,0,1,""],"CI_Input::post_get":[106,0,1,""],"CI_Security::get_csrf_hash":[140,0,1,""],"CI_Table::set_template":[124,0,1,""],"CI_Image_lib::resize":[53,0,1,""],"CI_Config::load":[7,0,1,""],"CI_DB_driver::table_exists":[87,0,1,""],link_tag:[6,1,1,""],"CI_User_agent::mobile":[93,0,1,""],"CI_DB_query_builder::start_cache":[149,0,1,""],"CI_Email::bcc":[23,0,1,""],"CI_DB_driver::list_fields":[87,0,1,""],"CI_Encrypt::encode_from_legacy":[109,0,1,""],"CI_DB_driver::db_connect":[87,0,1,""],"CI_DB_query_builder::insert":[149,0,1,""],increment_string:[135,1,1,""],"CI_Email::reply_to":[23,0,1,""],"CI_Cache::cache_info":[66,0,1,""],"CI_DB_query_builder::select":[149,0,1,""],"CI_DB_query_builder::flush_cache":[149,0,1,""],"CI_Cart::product_options":[130,0,1,""],"CI_Loader::database":[108,0,1,""],"CI_Benchmark::memory_usage":[41,0,1,""],prep_url:[81,1,1,""],"CI_URI::uri_to_assoc":[150,0,1,""],encode_php_tags:[69,1,1,""],"CI_DB_query_builder::empty_table":[149,0,1,""],"CI_DB_query_builder::get_where":[149,0,1,""],"CI_Calendar::initialize":[19,0,1,""],"CI_DB_query_builder::group_end":[149,0,1,""],"CI_Parser::set_delimiters":[115,0,1,""],"CI_DB_query_builder::select_sum":[149,0,1,""],"CI_DB_forge::add_key":[76,0,1,""],"CI_Config::site_url":[7,0,1,""],"CI_Form_validation::has_rule":[50,0,1,""],"CI_URI::total_segments":[150,0,1,""],"CI_Email::attach":[23,0,1,""],"CI_Session::__set":[103,0,1,""],"CI_DB_forge::drop_column":[76,0,1,""],"CI_DB_utility::list_databases":[75,0,1,""],reduce_double_slashes:[135,1,1,""],"CI_Loader::dbforge":[108,0,1,""],"CI_Table::add_row":[124,0,1,""],"CI_Upload::initialize":[128,0,1,""],valid_email:[126,1,1,""],"CI_DB_result::next_row":[55,0,1,""],CI_Unit_test:[143,2,1,""],"CI_Cache::increment":[66,0,1,""],"CI_Session::sess_regenerate":[103,0,1,""],index_page:[81,1,1,""],delete_files:[114,1,1,""],is_php:[105,1,1,""],"CI_Email::set_alt_message":[23,0,1,""],"CI_Output::append_output":[97,0,1,""],"CI_Encryption::decrypt":[79,0,1,""],"CI_Table::set_heading":[124,0,1,""],humanize:[40,1,1,""],"CI_Session::__get":[103,0,1,""],anchor_popup:[81,1,1,""],"CI_DB_query_builder::get_compiled_select":[149,0,1,""],"CI_DB_result::data_seek":[55,0,1,""],"CI_Session::sess_destroy":[103,0,1,""],"CI_Trackback::data":[121,0,1,""],"CI_DB_utility::xml_from_result":[75,0,1,""],"CI_Session::flashdata":[103,0,1,""],"CI_DB_driver::cache_off":[87,0,1,""],"CI_Loader::model":[108,0,1,""],"CI_Unit_test::active":[143,0,1,""],"CI_Session::has_userdata":[103,0,1,""],"CI_Cache::save":[66,0,1,""],"CI_Xmlrpc::server":[96,0,1,""],"CI_DB_query_builder::set_update_batch":[149,0,1,""],"CI_Session::userdata":[103,0,1,""],CI_Email:[23,2,1,""],"CI_Session::umark_temp":[103,0,1,""],set_status_header:[105,1,1,""],convert_accented_characters:[147,1,1,""],CI_Cart:[130,2,1,""],alternator:[135,1,1,""],"CI_Session::set_tempdata":[103,0,1,""],"CI_Unit_test::run":[143,0,1,""],"CI_Migration::current":[28,0,1,""],"CI_Loader::config":[108,0,1,""],"CI_Output::set_status_header":[97,0,1,""],CI_Zip:[112,2,1,""],"CI_Loader::driver":[108,0,1,""],nl2br_except_pre:[46,1,1,""],random_string:[135,1,1,""],"CI_Cart::total_items":[130,0,1,""],CI_FTP:[148,2,1,""],"CI_Unit_test::report":[143,0,1,""],"CI_Cart::total":[130,0,1,""],redirect:[81,1,1,""],strip_quotes:[135,1,1,""],"CI_Email::print_debugger":[23,0,1,""],"CI_User_agent::is_mobile":[93,0,1,""],mb_strpos:[25,1,1,""],"CI_Security::get_random_bytes":[140,0,1,""],CI_Parser:[115,2,1,""],"CI_DB_result::set_row":[55,0,1,""],"CI_DB_query_builder::stop_cache":[149,0,1,""],"CI_DB_driver::last_query":[87,0,1,""],ascii_to_entities:[147,1,1,""],CI_DB_forge:[76,2,1,""],"CI_Xmlrpc::display_error":[96,0,1,""],"CI_User_agent::agent_string":[93,0,1,""],octal_permissions:[114,1,1,""],"CI_DB_forge::modify_column":[76,0,1,""],form_error:[92,1,1,""],"CI_DB_query_builder::update_batch":[149,0,1,""],"CI_Calendar::parse_template":[19,0,1,""],form_multiselect:[92,1,1,""],"CI_User_agent::charsets":[93,0,1,""],"CI_DB_result::result_object":[55,0,1,""],highlight_code:[147,1,1,""],"CI_Email::cc":[23,0,1,""],"CI_Cart::has_options":[130,0,1,""],"CI_Session::set_flashdata":[103,0,1,""],"CI_Input::post":[106,0,1,""],local_to_gmt:[91,1,1,""],"CI_Image_lib::watermark":[53,0,1,""],"CI_Session::get_flash_keys":[103,0,1,""],"CI_Form_validation::error_array":[50,0,1,""],"CI_Xmlrpc::display_response":[96,0,1,""],timezones:[91,1,1,""],"CI_User_agent::is_referral":[93,0,1,""],password_get_info:[25,1,1,""],"CI_DB_driver::primary":[87,0,1,""],send_email:[126,1,1,""],"CI_DB_driver::close":[87,0,1,""],"CI_Form_validation::reset_validation":[50,0,1,""],validation_errors:[92,1,1,""],"CI_Table::make_columns":[124,0,1,""],"CI_Loader::get_vars":[108,0,1,""],"CI_DB_query_builder::delete":[149,0,1,""],form_close:[92,1,1,""],"CI_DB_driver::initialize":[87,0,1,""],"CI_URI::ruri_string":[150,0,1,""],"CI_Xmlrpc::send_request":[96,0,1,""],"CI_Loader::add_package_path":[108,0,1,""],"CI_DB_query_builder::set_insert_batch":[149,0,1,""],"CI_Session::mark_as_temp":[103,0,1,""],"CI_Calendar::default_template":[19,0,1,""],"CI_Xmlrpc::request":[96,0,1,""],"CI_Form_validation::set_rules":[50,0,1,""],"CI_URI::total_rsegments":[150,0,1,""],"CI_Encryption::hkdf":[79,0,1,""],"CI_Output::enable_profiler":[97,0,1,""],"CI_Cache::delete":[66,0,1,""],"CI_DB_query_builder::or_like":[149,0,1,""],"CI_DB_result::row":[55,0,1,""],"CI_Cart::get_item":[130,0,1,""],"CI_Config::base_url":[7,0,1,""],"CI_Encryption::initialize":[79,0,1,""],img:[6,1,1,""],CI_Trackback:[121,2,1,""],"CI_User_agent::browser":[93,0,1,""],CI_Session:[103,2,1,""],"CI_DB_result::custom_result_object":[55,0,1,""],set_radio:[92,1,1,""],"CI_Security::get_csrf_token_name":[140,0,1,""],"CI_DB_forge::create_table":[76,0,1,""],"CI_DB_utility::optimize_database":[75,0,1,""],"CI_Cart::update":[130,0,1,""],"CI_Lang::load":[137,0,1,""],"CI_Loader::vars":[108,0,1,""],"CI_DB_forge::drop_table":[76,0,1,""],"CI_Table::set_empty":[124,0,1,""],"CI_Migration::error_string":[28,0,1,""],mailto:[81,1,1,""],hash_pbkdf2:[25,1,1,""],"CI_DB_query_builder::set_dbprefix":[149,0,1,""],reduce_multiples:[135,1,1,""],"CI_Form_validation::set_error_delimiters":[50,0,1,""],"CI_Email::subject":[23,0,1,""],"CI_FTP::upload":[148,0,1,""],"CI_Output::set_profiler_sections":[97,0,1,""],"CI_Zip::add_dir":[112,0,1,""],get_filenames:[114,1,1,""],"CI_Typography::format_characters":[20,0,1,""],unix_to_human:[91,1,1,""],array_replace:[25,1,1,""],"CI_DB_query_builder::like":[149,0,1,""],CI_Form_validation:[50,2,1,""],"CI_DB_query_builder::distinct":[149,0,1,""],"CI_Unit_test::use_strict":[143,0,1,""],CI_Upload:[128,2,1,""],"CI_DB_driver::trans_off":[87,0,1,""],form_upload:[92,1,1,""],hex2bin:[25,1,1,""],CI_Calendar:[19,2,1,""],parse_smileys:[13,1,1,""],"CI_DB_query_builder::select_avg":[149,0,1,""],anchor:[81,1,1,""],uri_string:[81,1,1,""],"CI_Form_validation::run":[50,0,1,""],"CI_DB_driver::cache_on":[87,0,1,""],"CI_Output::get_output":[97,0,1,""],"CI_DB_driver::escape_str":[87,0,1,""],"CI_DB_query_builder::or_group_start":[149,0,1,""],human_to_unix:[91,1,1,""],"CI_Output::set_header":[97,0,1,""],"CI_Input::request_headers":[106,0,1,""],"CI_Loader::file":[108,0,1,""],word_censor:[147,1,1,""],"CI_DB_driver::escape_identifiers":[87,0,1,""],CI_Xmlrpc:[96,2,1,""],form_fieldset:[92,1,1,""],"CI_Email::set_header":[23,0,1,""],"CI_Cart::insert":[130,0,1,""],"CI_Loader::remove_package_path":[108,0,1,""],"CI_Security::entity_decode":[140,0,1,""],"CI_Session::get_temp_keys":[103,0,1,""],"CI_DB_driver::escape":[87,0,1,""],"CI_FTP::move":[148,0,1,""],form_label:[92,1,1,""],"CI_DB_driver::protect_identifiers":[87,0,1,""],"CI_Cache::get":[66,0,1,""],"CI_DB_result::previous_row":[55,0,1,""],"CI_DB_query_builder::group_start":[149,0,1,""],"CI_Zip::download":[112,0,1,""],"CI_Config::system_url":[7,0,1,""],"CI_Loader::get_var":[108,0,1,""],"CI_User_agent::parse":[93,0,1,""],"CI_Encrypt::decode":[109,0,1,""],"CI_Cache::clean":[66,0,1,""],html_escape:[105,1,1,""],symbolic_permissions:[114,1,1,""],form_hidden:[92,1,1,""],log_message:[45,1,1,""],"CI_DB_driver::cache_set_path":[87,0,1,""],"CI_Unit_test::set_template":[143,0,1,""],"CI_DB_driver::field_data":[87,0,1,""],"CI_URI::rsegment":[150,0,1,""],"CI_Loader::language":[108,0,1,""],get_dir_file_info:[114,1,1,""],set_checkbox:[92,1,1,""],"CI_Input::cookie":[106,0,1,""],"CI_Cache::get_metadata":[66,0,1,""],"CI_URI::assoc_to_uri":[150,0,1,""],"CI_Benchmark::mark":[41,0,1,""],"CI_FTP::changedir":[148,0,1,""],"CI_Parser::parse":[115,0,1,""],"CI_Output::get_content_type":[97,0,1,""],entity_decode:[46,1,1,""],"CI_FTP::chmod":[148,0,1,""],do_hash:[69,1,1,""],password_verify:[25,1,1,""],safe_mailto:[81,1,1,""],"Some_class::some_method":[80,0,1,""],"CI_Image_lib::clear":[53,0,1,""],character_limiter:[147,1,1,""],"CI_DB_result::result":[55,0,1,""],"CI_DB_query_builder::or_not_like":[149,0,1,""],"CI_FTP::download":[148,0,1,""],"CI_Zip::read_file":[112,0,1,""],"CI_Unit_test::result":[143,0,1,""],"CI_Zip::archive":[112,0,1,""],"CI_DB_driver::is_write_type":[87,0,1,""],"CI_Calendar::generate":[19,0,1,""],"CI_Form_validation::set_data":[50,0,1,""],read_file:[114,1,1,""],word_wrap:[147,1,1,""],"CI_DB_driver::compile_binds":[87,0,1,""],password_needs_rehash:[25,1,1,""],"CI_DB_result::row_object":[55,0,1,""],"CI_Xmlrpc::initialize":[96,0,1,""],"CI_Upload::display_errors":[128,0,1,""],auto_typography:[46,1,1,""],CI_Table:[124,2,1,""],CI_Input:[106,2,1,""],"CI_Trackback::set_error":[121,0,1,""],"CI_Image_lib::initialize":[53,0,1,""],"CI_DB_forge::rename_table":[76,0,1,""],"CI_DB_result::custom_row_object":[55,0,1,""],CI_URI:[150,2,1,""],form_dropdown:[92,1,1,""],br:[6,1,1,""],"CI_DB_utility::optimize_table":[75,0,1,""],"CI_Input::valid_ip":[106,0,1,""],"CI_URI::ruri_to_assoc":[150,0,1,""],"CI_DB_query_builder::where_in":[149,0,1,""],ol:[6,1,1,""],"CI_Output::set_content_type":[97,0,1,""],"CI_User_agent::referrer":[93,0,1,""],"CI_Input::is_ajax_request":[106,0,1,""],quoted_printable_encode:[25,1,1,""],"CI_DB_driver::insert_string":[87,0,1,""],"CI_DB_query_builder::set":[149,0,1,""],"CI_Email::attachment_cid":[23,0,1,""],"CI_DB_driver::display_error":[87,0,1,""],"CI_DB_query_builder::order_by":[149,0,1,""],"CI_Input::method":[106,0,1,""],"CI_Xmlrpc::method":[96,0,1,""],"CI_Input::is_cli_request":[106,0,1,""],"CI_DB_result::row_array":[55,0,1,""],CI_User_agent:[93,2,1,""],"CI_Session::all_userdata":[103,0,1,""],"CI_Session::tempdata":[103,0,1,""],"CI_DB_query_builder::insert_batch":[149,0,1,""],"CI_Trackback::convert_xml":[121,0,1,""],"CI_Pagination::initialize":[62,0,1,""],"CI_Zip::read_dir":[112,0,1,""],"CI_DB_driver::escape_like_str":[87,0,1,""],"CI_Zip::add_data":[112,0,1,""],"CI_Email::send":[23,0,1,""],"CI_Loader::is_loaded":[108,0,1,""],repeater:[135,1,1,""],is_cli:[105,1,1,""],"CI_DB_query_builder::select_max":[149,0,1,""],"CI_Output::get_header":[97,0,1,""],get_mime_by_extension:[114,1,1,""],"CI_Trackback::get_id":[121,0,1,""],mb_strlen:[25,1,1,""],"CI_User_agent::accept_charset":[93,0,1,""],"CI_DB_query_builder::get_compiled_insert":[149,0,1,""],"CI_Email::clear":[23,0,1,""],"CI_DB_query_builder::group_by":[149,0,1,""],"CI_FTP::mkdir":[148,0,1,""],is_https:[105,1,1,""],ul:[6,1,1,""],"CI_Input::get":[106,0,1,""],meta:[6,1,1,""],"CI_DB_forge::create_database":[76,0,1,""],"CI_User_agent::robot":[93,0,1,""],get_mimes:[105,1,1,""],"CI_Pagination::create_links":[62,0,1,""],"CI_URI::rsegment_array":[150,0,1,""],timespan:[91,1,1,""],"CI_Loader::dbutil":[108,0,1,""],"CI_DB_driver::total_queries":[87,0,1,""],"CI_DB_query_builder::dbprefix":[149,0,1,""],"CI_Email::to":[23,0,1,""],"CI_Trackback::display_errors":[121,0,1,""],"CI_DB_result::num_fields":[55,0,1,""],"CI_Loader::get_package_paths":[108,0,1,""],"CI_Table::generate":[124,0,1,""],"CI_Config::set_item":[7,0,1,""],"CI_User_agent::platform":[93,0,1,""],"CI_DB_result::result_array":[55,0,1,""],"CI_Loader::library":[108,0,1,""],elements:[142,1,1,""],"CI_User_agent::languages":[93,0,1,""],"CI_Input::set_cookie":[106,0,1,""],CI_Typography:[20,2,1,""],"CI_Image_lib::crop":[53,0,1,""],function_usable:[105,1,1,""],lang:[85,1,1,""],"CI_Trackback::process":[121,0,1,""],"CI_Session::mark_as_flash":[103,0,1,""],"CI_Loader::clear_vars":[108,0,1,""],CI_DB_utility:[75,2,1,""],"CI_DB_query_builder::join":[149,0,1,""],CI_Migration:[28,2,1,""],form_radio:[92,1,1,""],"CI_FTP::list_files":[148,0,1,""],"CI_User_agent::is_browser":[93,0,1,""],"CI_Trackback::send_success":[121,0,1,""],"CI_Parser::parse_string":[115,0,1,""]}},titleterms:{all:[139,34],code:[125,111],chain:149,queri:[5,94,75,125,55,48,82,149,111],month:19,prefix:[9,27,48,110],row:[130,55],content:[0,76,78,125,49,50],privat:[125,0],specif:[50,79,149],depend:25,friendli:131,send:[23,96,121],form_prep:33,digit:62,string:[5,76,125,135,33,25],fals:[125,33],util:[9,75],verb:98,my_secur:99,word:23,fadeout:43,list:[47,75,110],upload:128,"try":[49,0,128,96,50],item:[43,33,22,56,7,130],adjust:101,quick:111,sign:141,design:52,cache_on:34,pass:[9,0,19,76],download:[42,144],slidetoggl:43,compat:[25,125,101,141],index:[71,5,37,3,100],what:[0,96,78,130,27,49,103],hide:[62,43,139],sub:[9,0,134],compar:125,section:[83,80,21],current:62,delet:[149,18],version:[9,111,4,29],xss_clean:33,method:[0,149,53,80,33,55,82,125,50],metadata:[47,103],hash:25,gener:[51,131,55,24,143],is_cli_request:33,punch:131,directory_map:33,let:[49,0],cart:[130,33],address:118,path:[43,107],modifi:76,encryption_kei:79,valu:[30,92,94,33,125],convert:101,memcach:[103,66],bbedit:125,credit:127,chang:[124,50,33,100,29],portabl:79,overrid:[23,33],via:49,display_error:139,prefer:[62,23,19,53,128,28,103,75],base_url:[30,33],deprec:33,instal:[51,54,132],redi:[103,66],total:41,select:149,from:[3,117,95,82,99,100,101,102,56,57,58,59,17,61,120,4,15,71,72,73,74,76,119,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],zip:112,memori:41,internation:137,upgrad:[3,95,117,99,100,101,102,56,57,58,59,17,61,120,4,15,71,72,73,74,119,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],next:[62,19],call:[0,2,99,101,129,50],type:[53,33,96],prep:50,toggl:43,form_valid:33,claus:33,benchmark:[41,83],agent:93,xss:[139,33,140,106],cach:[66,149,34,18],retriev:[47,103,75],setup:43,work:[148,79,34,48,7,103,18],uniqu:33,fetch:[137,7],aliv:146,control:[113,0,136,65,13,151,128,102,50],sqlite:33,stream:106,process:[53,0,128,96,121],time_to_upd:123,wincach:66,"404_overrid":33,templat:[143,19,115,32,33,131,155],topic:[51,24],captcha:145,tag:[125,151],system_url:33,read_fil:33,multipl:[137,27,134,33,14,129,130,111,146,132],goal:52,secur:[69,33,99,139,141,140,106],charset:39,ping:121,write:80,how:[50,79,34,103,18],url_titl:33,instead:33,csv:75,config:[43,3,7,128,50,53,100,101,102,56,57,123,62,71,23,30,31,33,37,118,119,39],updat:[130,117,99,100,101,102,56,57,58,59,17,61,120,15,71,72,73,74,149,119,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],remap:0,cache_delete_al:34,resourc:[9,44],after:33,global_xss_filt:33,random_str:33,date:[33,91],underscor:33,associ:[50,96],trim_slash:33,"short":[125,151],practic:139,light:131,issu:[33,141],alias:13,"switch":137,environ:[14,7],reloc:[3,132],callabl:50,order:149,origin:10,cache_delet:34,move:[99,101,33],autoload:[100,33,56,39,123],reconnect:146,system_path:155,digest:25,paramet:[9,79,96,146],style:[125,141],group:[50,149],cli:[49,32],fix:29,clickabl:13,main:[100,37],easier:82,good:141,"return":[125,33,134],handl:[137,139,45,14,48],auto:[137,27,78,7,44],initi:[43,9,128,130,93,96,53,103,143,19,20,109,111,112,148,75,76,115,79,83,121,124],"break":125,framework:[131,129,14],now:[27,33],introduct:51,drop_tabl:33,name:[113,0,28,75,125,33,9,50],anyth:50,edit:3,troubleshoot:64,drop:76,authent:79,separ:33,mode:[143,79,12],debug:125,register_glob:139,reset:149,weight:131,replac:[3,33,100,102,118,119,110,9],individu:50,"static":136,connect:[146,78],event:43,variabl:[113,43,125,115],ftp:148,typecast:125,space:125,miss:33,profil:[41,83],rel:62,determin:[47,75],watermark:53,migrat:28,manipul:53,free:131,standard:[25,111],cooki:[90,106],base:66,mime:[102,33,118,16],dblib:33,anchor_class:33,indent:125,befor:139,keep:146,filter:[139,33,140,106],length:[79,109],pagin:[62,33],codeignit:[5,155,141,9,131,132,51,12,117,99,100,101,102,56,57,138,58,59,17,61,120,153,68,74,104,26,15,71,72,73,38,119,30,31,32,33,80,16,35,36,37,118,60,39,67,123,42,154,84],timezon:91,first:62,oper:125,suffix:5,fetch_directori:33,arrai:[142,50,111,55,96],number:152,system:110,hook:129,instruct:[101,54],open:125,forgeri:140,convent:9,strict:[143,12],data:[19,134,79,149,139,101,96,103,50,106],licens:77,cache_off:34,messag:[25,50,79,109],statement:125,"final":95,slidedown:43,tool:80,fetch_method:33,user_ag:[100,119],third_parti:100,apppath:100,enclos:62,than:50,remov:[5,33,99,100,101,103,155],structur:[86,151],jqueri:43,store:[101,34,134],bind:48,consumpt:41,typographi:[46,20],ani:[101,33],dash:33,packag:108,reserv:[113,0,98],"null":[125,33],engin:131,callback:[50,98],ancillari:122,destroi:103,rout:[136,33,98,21,22],note:[62,96,115,121,101,103,75],exampl:[62,137,28,75,66,98,148,149,111,124,112,93],thoroughli:131,mit:77,singl:111,anatomi:[96,7,78],simplifi:48,sure:[30,33],who:84,chart:133,textmat:125,beta:[95,3,29],regular:[98,48],pair:115,segment:[0,5],why:49,fetch_class:33,avail:[85,1,126,90,91,92,11,69,135,13,6,142,144,107,145,146,147,114,46,81,152,40],renam:[56,76,132],url:[5,131,33,81,121],tempdata:103,request:[140,96],uri:[0,5,33,98,150,139],doe:[131,34,18],dummi:66,ext:[100,33],bracket:125,clean:131,pars:115,hmac:79,shop:130,show:[43,19,50],text:[53,125,33,137,147],concurr:103,syntax:[151,153],session:[100,33,153,103],corner:43,xml:[96,1,75],cell:19,transact:12,configur:[43,94,79,14],folder:[101,3],local:125,info:51,contribut:[51,141],get:[138,106],express:98,nativ:9,fadein:43,csrf:[139,140],"new":[21,22],report:[143,14,141],requir:[131,80,70],enabl:[5,12,143,34,83,129,18],organ:0,common:105,default_control:33,contain:33,where:101,view:[43,134,65,115,108,151],certif:10,set:[62,27,23,19,43,53,33,98,21,7,83,75,109,110,9,50,128,79],tablesort:43,mysql:33,highlight_phras:33,result:[75,111,55,149],respons:96,close:[125,146],calendar:[19,3,43],best:139,kei:[16,109,76],databas:[71,51,94,75,76,78,33,34,48,47,82,37,145,139,103,111,146,100,89,123],label:137,dynam:134,approach:12,email:[126,23,33],attribut:62,altern:[66,151],call_funct:2,extend:[9,27,129,110],all_userdata:33,javascript:[43,33],extens:[101,33,131],popul:50,protect:[139,48],last:62,delimit:50,plugin:[43,101],pdo:33,tutori:[50,63,13,51],logic:[125,136],improv:34,load:[85,137,1,126,7,9,90,91,92,11,69,134,135,13,99,101,6,44,142,144,147,107,145,27,78,114,46,81,152,40],point:[41,129,83],overview:[50,13,26],loader:108,header:155,rpc:96,guid:[125,128,51,101,56,57,15,16,17,123,39,71,72,73,74,35,36,37,119,120,67,153,154,155],empti:[30,33],github:42,basic:[51,48],magic_quotes_runtim:139,argument:125,present:47,look:[149,124],defin:[0,129],behavior:[79,14],error:[71,12,125,32,33,45,14,48,96,50,155],anchor:62,loop:134,pack:131,file:[114,5,86,58,3,125,7,128,74,9,50,151,117,53,14,137,99,100,101,102,56,57,103,15,16,17,61,62,120,66,108,28,139,71,72,73,23,75,119,30,31,32,33,34,59,35,36,37,118,60,39,67,123,153,154,155],helper:[85,1,126,88,90,91,92,50,51,11,69,135,13,55,101,6,142,144,147,107,145,27,114,33,46,81,82,152,40],slideup:43,tabl:[75,76,125,47,100,118,121,153,124],site:[140,34],inform:82,parent:101,inflector:40,develop:10,welcom:[51,84],get_post:33,perform:34,make:[30,82,33],cross:140,same:129,fragment:115,html:[6,33,124],document:[80,131,75,141],http:98,optim:75,driver:[86,38,87,66,33,79,103],effect:[43,14],user:[131,93,51,101,56,57,15,16,17,123,39,71,72,73,74,35,36,37,119,120,67,153,154,155],mani:33,php:[71,5,141,119,125,31,66,33,151,100,37,102,56,57,39,118,123,106],sha1:33,builder:[94,149,111],object:[111,55],anim:43,client:96,command:49,thi:[85,1,2,126,34,90,91,92,11,69,135,13,6,142,144,107,145,147,114,46,81,152,40],model:[74,78,65,21,22,123],explan:[50,94,96],comment:125,identifi:48,execut:[82,41],tip:[103,141],"_post":50,toggleclass:43,languag:[85,137,33,3,39],previous:33,web:18,get_dir_file_info:101,add:[3,39,123],valid:[50,33,153,139],guidelin:141,input:[139,33,106],save:50,applic:[133,31,101,108,83,131,132],format:[125,96],world:[49,0],password:[25,139],insert:[139,111,149],do_hash:33,success:[50,128],whitespac:125,manual:[12,48,7,146],server:[106,96,70],necessari:101,cascad:50,output:[0,97],manag:[12,34,132],subhead:80,parenthet:125,"export":75,bonu:103,apc:66,librari:[51,23,43,33,79,99,143,109,116,9,103,104],confirm:155,definit:93,per:125,unit:143,overlai:53,refer:[137,87,7,89,128,91,130,50,93,51,96,53,97,55,148,100,103,140,106,62,143,19,20,66,108,28,109,25,149,112,23,75,76,115,79,34,150,121,41,124],core:[101,33,129,110],previou:[62,19,4],run:[49,143,12,132],usag:[28,75,115,66,33,148,112],step:[3,117,99,100,101,102,56,57,58,59,17,61,120,15,71,72,73,74,119,30,31,32,33,16,35,36,37,118,60,39,67,123,153,154,155],post:[102,106],mssql:33,about:[82,103],column:76,commun:131,page:[62,0,78,136,80,128,18,49,50],cipher:79,modal:43,constructor:[0,101],backup:75,disabl:[62,143,83],repair:75,own:[27,38,96,98,110,9,50,104],within:[9,134],encod:112,automat:[151,146],two:53,wrap:23,storag:9,your:[0,58,3,43,119,79,47,9,50,132,96,82,98,83,99,100,101,102,56,57,139,15,16,17,61,19,120,72,67,21,74,104,109,110,146,71,27,73,38,75,78,30,31,32,33,34,59,35,36,37,118,60,39,121,154,41,123,153,117,155,124],log:[33,29],support:[151,79,141],fast:131,custom:[62,143,2,79,55,103],standard_d:33,start:[111,138],flashdata:103,add_column:33,"function":[85,1,2,125,126,34,90,91,92,11,69,135,13,6,105,142,144,147,107,145,25,113,27,114,33,46,81,152,40],head:80,form:[137,33,22,128,102,92,50,106],forg:[33,76],link:[62,19],translat:50,line:[49,125,33,137],"true":125,bug:29,conclus:8,count:149,"default":[125,0,79,14,102],bugfix:29,access:[103,106],displai:[130,143,41,19,21],limit:149,sampl:137,similar:149,featur:68,constant:[113,125,31,33,14,100,25,16],creat:[137,143,86,38,19,76,134,110,22,128,28,96,121,9,50,122,104],get_inst:122,multibyt:25,flow:133,parser:115,decrypt:79,exist:[47,75],glanc:131,check:[102,33],echo:151,encrypt:[101,33,16,109,79],when:9,field:[47,50,13,76,92],other:50,branch:141,test:[143,12],imag:53,architectur:52,repeat:33,wildcard:98,"class":[137,0,79,43,125,7,130,128,122,9,50,93,96,53,97,55,148,101,103,140,106,62,143,19,20,66,108,28,109,110,149,111,112,23,75,76,115,33,34,150,83,121,41,124],sql:125,trackback:121,smilei:[13,33],markup:62,receiv:121,algorithm:79,directori:[0,11,3,134,33,86,128,132],descript:75,rule:[50,33,98],potenti:33,time:41,escap:[92,139,48],hello:[49,0]}}) |
src/App.js | jnarowski/react-metropolis | require('./main.scss');
import Router from 'react-router';
import { DefaultRoute, Link, Route, RouteHandler } from 'react-router';
import React, { Component } from 'react';
import Show from './components/core/show.js';
import Index from './components/core/index.js';
export default class App extends Component {
render() {
return (
<div className="Detail">
<RouteHandler/>
</div>
);
}
}
let routes = (
<Route name="app" path="/" handler={App}>
<DefaultRoute handler={Index}/>
<Route name="show" path="/show/:component_name" handler={Show}/>
</Route>
);
Router.run(routes, function (Handler) {
React.render(<Handler/>, document.getElementById('root'));
}); |
examples/shared-root/app.js | bmathews/react-router | import React from 'react';
import { history } from 'react-router/lib/HashHistory';
import { Router, Route, Link } from 'react-router';
var App = React.createClass({
render() {
return (
<div>
<p>
This illustrates how routes can share UI w/o sharing the url,
when routes have no path, they never match themselves but their
children can, allowing "/signin" and "/forgot-password" to both
be render in the <code>SignedOut</code> component.
</p>
<ol>
<li><Link to="/home">Home</Link></li>
<li><Link to="/signin">Sign in</Link></li>
<li><Link to="/forgot-password">Forgot Password</Link></li>
</ol>
{this.props.children}
</div>
);
}
});
var SignedIn = React.createClass({
render() {
return (
<div>
<h2>Signed In</h2>
{this.props.children}
</div>
);
}
});
var Home = React.createClass({
render() {
return (
<h3>Welcome home!</h3>
);
}
});
var SignedOut = React.createClass({
render() {
return (
<div>
<h2>Signed Out</h2>
{this.props.children}
</div>
);
}
});
var SignIn = React.createClass({
render() {
return (
<h3>Please sign in.</h3>
);
}
});
var ForgotPassword = React.createClass({
render() {
return (
<h3>Forgot your password?</h3>
);
}
});
React.render((
<Router history={history}>
<Route path="/" component={App}>
<Route component={SignedOut}>
<Route path="signin" component={SignIn}/>
<Route path="forgot-password" component={ForgotPassword}/>
</Route>
<Route component={SignedIn}>
<Route path="home" component={Home}/>
</Route>
</Route>
</Router>
), document.getElementById('example'));
|
src/components/pc_product.js | YMFL/reactNews | /**
* Created by YangQianHui on 2017/4/8.
*/
import React from 'react';
class AppComponent extends React.Component {
render() {
return (
<div>
</div>
);
}
}
AppComponent.defaultProps = {
};
export default AppComponent;
|
src/views/UserDetail/UserDetailFullscreen.js | folio-org/ui-users | import React from 'react';
import { Paneset } from '@folio/stripes/components';
import UserDetail from './UserDetail';
export default function UserDetailFullscreen(props) {
return (
<Paneset>
<UserDetail paneWidth="fill" {...props} />
</Paneset>
);
}
|
src/js/components/icons/base/Descend.js | linde12/grommet | // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import CSSClassnames from '../../../utils/CSSClassnames';
import Intl from '../../../utils/Intl';
import Props from '../../../utils/Props';
const CLASS_ROOT = CSSClassnames.CONTROL_ICON;
const COLOR_INDEX = CSSClassnames.COLOR_INDEX;
export default class Icon extends Component {
render () {
const { className, colorIndex } = this.props;
let { a11yTitle, size, responsive } = this.props;
let { intl } = this.context;
const classes = classnames(
CLASS_ROOT,
`${CLASS_ROOT}-descend`,
className,
{
[`${CLASS_ROOT}--${size}`]: size,
[`${CLASS_ROOT}--responsive`]: responsive,
[`${COLOR_INDEX}-${colorIndex}`]: colorIndex
}
);
a11yTitle = a11yTitle || Intl.getMessage(intl, 'descend');
const restProps = Props.omit(this.props, Object.keys(Icon.propTypes));
return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeWidth="2" d="M2,8 L8,2 L14,8 M11,21 L22,21 M11,17 L19,17 M11,13 L16,13 M8,2 L8,22" transform="matrix(1 0 0 -1 0 24)"/></svg>;
}
};
Icon.contextTypes = {
intl: PropTypes.object
};
Icon.defaultProps = {
responsive: true
};
Icon.displayName = 'Descend';
Icon.icon = true;
Icon.propTypes = {
a11yTitle: PropTypes.string,
colorIndex: PropTypes.string,
size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']),
responsive: PropTypes.bool
};
|
app/javascript/mastodon/features/ui/components/audio_modal.js | lynlynlynx/mastodon | import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Audio from 'mastodon/features/audio';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { previewState } from './video_modal';
import Footer from 'mastodon/features/picture_in_picture/components/footer';
const mapStateToProps = (state, { statusId }) => ({
accountStaticAvatar: state.getIn(['accounts', state.getIn(['statuses', statusId, 'account']), 'avatar_static']),
});
export default @connect(mapStateToProps)
class AudioModal extends ImmutablePureComponent {
static propTypes = {
media: ImmutablePropTypes.map.isRequired,
statusId: PropTypes.string.isRequired,
accountStaticAvatar: PropTypes.string.isRequired,
options: PropTypes.shape({
autoPlay: PropTypes.bool,
}),
onClose: PropTypes.func.isRequired,
onChangeBackgroundColor: PropTypes.func.isRequired,
};
static contextTypes = {
router: PropTypes.object,
};
componentDidMount () {
if (this.context.router) {
const history = this.context.router.history;
history.push(history.location.pathname, previewState);
this.unlistenHistory = history.listen(() => {
this.props.onClose();
});
}
}
componentWillUnmount () {
if (this.context.router) {
this.unlistenHistory();
if (this.context.router.history.location.state === previewState) {
this.context.router.history.goBack();
}
}
}
render () {
const { media, accountStaticAvatar, statusId, onClose } = this.props;
const options = this.props.options || {};
return (
<div className='modal-root__modal audio-modal'>
<div className='audio-modal__container'>
<Audio
src={media.get('url')}
alt={media.get('description')}
duration={media.getIn(['meta', 'original', 'duration'], 0)}
height={150}
poster={media.get('preview_url') || accountStaticAvatar}
backgroundColor={media.getIn(['meta', 'colors', 'background'])}
foregroundColor={media.getIn(['meta', 'colors', 'foreground'])}
accentColor={media.getIn(['meta', 'colors', 'accent'])}
autoPlay={options.autoPlay}
/>
</div>
<div className='media-modal__overlay'>
{statusId && <Footer statusId={statusId} withOpenButton onClose={onClose} />}
</div>
</div>
);
}
}
|
src/modules/html/index.js | pborrego/demo-cep-base | import React from 'react';
function HTML({ html, assets }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link rel="stylesheet" href={assets.main.css} />
<link rel="stylesheet" href={assets.vendor.css} />
</head>
<body>
<div id="mount" dangerouslySetInnerHTML={{ __html: html }} />
<noscript>
<p>Please enable JavaScript for a better experience.</p>
</noscript>
<script type="text/javascript" src={assets.manifest.js} />
<script type="text/javascript" src={assets.vendor.js} />
<script type="text/javascript" src={assets.main.js} />
</body>
</html>
);
}
export default HTML;
|
src/components/Volunteer.js | RicardoG2016/WRFD-project-site | import React, { Component } from 'react';
import '../App.css';
class Volunteer extends Component {
componentDidMount(){
window.scrollTo(0, 0);
}
render() {
return (
<div id="about">
<div className="row">
<div className="col-md-6 col-2 bg-inverse text-white py-2 d-flex align-items-center justify-content-center" id="left">
<div className="l-sec">
<div className="volunteer">
<h5 className="hidden-xs-down l-content">Volunteer</h5>
</div>
</div>
</div>
<div className="col offset-2 offset-sm-6 py-2 text-muted" id="text">
<p>Blue bottle celiac disrupt, minim authentic banjo magna fam ethical consequat in hashtag keytar adaptogen. Before they sold out sed enim, blog hoodie kinfolk asymmetrical ugh put a bird on it fugiat succulents occupy ullamco. Reprehenderit mixtape semiotics exercitation, gastropub photo booth sunt art party cillum neutra minim la croix fashion axe roof party distillery. Duis craft beer reprehenderit synth yr. Officia photo booth post-ironic drinking vinegar, nisi ugh adaptogen mollit exercitation blue bottle salvia sriracha banjo poutine. Etsy crucifix tacos, affogato schlitz kombucha tofu mustache. Velit mollit locavore asymmetrical ugh.</p>
</div>
</div>
</div>
);
}
}
export default Volunteer; |
src/components/Nav/NavItem.js | wundery/wundery-ui-react | // React
import React from 'react';
// Utils
import classnames from 'classnames';
const NavItem = props => (
<div
className={classnames('ui-nav-navitem', {
'ui-nav-navitem-right': props.right,
'ui-nav-navitem-brand': props.brand,
})}
>
{props.children}
</div>
);
NavItem.propTypes = {
right: React.PropTypes.bool,
brand: React.PropTypes.bool,
children: React.PropTypes.node,
};
export default NavItem;
|
node_modules/react/lib/ReactChildReconciler.js | 15chrjef/mobileHackerNews | /**
* Copyright 2014-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.
*
* @providesModule ReactChildReconciler
*/
'use strict';
var ReactReconciler = require('./ReactReconciler');
var instantiateReactComponent = require('./instantiateReactComponent');
var KeyEscapeUtils = require('./KeyEscapeUtils');
var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
var traverseAllChildren = require('./traverseAllChildren');
var warning = require('fbjs/lib/warning');
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = require('./ReactComponentTreeHook');
}
function instantiateChild(childInstances, child, name, selfDebugID) {
// We found a component instance.
var keyUnique = childInstances[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = require('./ReactComponentTreeHook');
}
if (!keyUnique) {
process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
}
}
if (child != null && keyUnique) {
childInstances[name] = instantiateReactComponent(child, true);
}
}
/**
* ReactChildReconciler provides helpers for initializing or updating a set of
* children. Its output is suitable for passing it onto ReactMultiChild which
* does diffed reordering and insertion.
*/
var ReactChildReconciler = {
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildNodes Nested child maps.
* @return {?object} A set of child instances.
* @internal
*/
instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
) {
if (nestedChildNodes == null) {
return null;
}
var childInstances = {};
if (process.env.NODE_ENV !== 'production') {
traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
return instantiateChild(childInsts, child, name, selfDebugID);
}, childInstances);
} else {
traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
}
return childInstances;
},
/**
* Updates the rendered children and returns a new set of children.
*
* @param {?object} prevChildren Previously initialized set of children.
* @param {?object} nextChildren Flat child element maps.
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @return {?object} A new set of child instances.
* @internal
*/
updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
) {
// We currently don't have a way to track moves here but if we use iterators
// instead of for..in we can zip the iterators and check if an item has
// moved.
// TODO: If nothing has changed, return the prevChildren object so that we
// can quickly bailout if nothing has changed.
if (!nextChildren && !prevChildren) {
return;
}
var name;
var prevChild;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
prevChild = prevChildren && prevChildren[name];
var prevElement = prevChild && prevChild._currentElement;
var nextElement = nextChildren[name];
if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
nextChildren[name] = prevChild;
} else {
if (prevChild) {
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
// The child must be instantiated before it's mounted.
var nextChildInstance = instantiateReactComponent(nextElement, true);
nextChildren[name] = nextChildInstance;
// Creating mount image now ensures refs are resolved in right order
// (see https://github.com/facebook/react/pull/7101 for explanation).
var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
mountImages.push(nextChildMountImage);
}
}
// Unmount children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
prevChild = prevChildren[name];
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @param {?object} renderedChildren Previously initialized set of children.
* @internal
*/
unmountChildren: function (renderedChildren, safely) {
for (var name in renderedChildren) {
if (renderedChildren.hasOwnProperty(name)) {
var renderedChild = renderedChildren[name];
ReactReconciler.unmountComponent(renderedChild, safely);
}
}
}
};
module.exports = ReactChildReconciler; |
web/js/jquery-1.9.0.js | Jrbebel/Inra | /*!
* jQuery JavaScript Library v1.9.0
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-1-14
*/
(function( window, undefined ) {
"use strict";
var
// A central reference to the root jQuery(document)
rootjQuery,
// The deferred used on DOM ready
readyList,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.9.0",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// 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 = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/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();
},
// The ready event handler and self cleanup method
DOMContentLoaded = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
} else if ( document.readyState === "complete" ) {
// we're here because readyState === "complete" in oldIE
// which is good enough for us to call the dom ready!
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
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
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 rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_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 a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// 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 );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_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] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// 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 ( length === i ) {
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({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// 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.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// 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 ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// 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 &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// 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
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 ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
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;
},
noop: function() {},
// 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;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
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 {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_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 l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// 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
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_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 tmp, args, proxy;
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 = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_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;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
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;
},
now: function() {
return ( new Date() ).getTime();
}
});
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", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// 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 );
}
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// 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 ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// 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( core_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 // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// 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;
},
// Control if a given callback is in the list
has: function( fn ) {
return jQuery.inArray( fn, list ) > -1;
},
// Remove all callbacks from the list
empty: function() {
list = [];
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 ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
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 action = tuple[ 0 ],
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[ action + "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 = core_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 ? core_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();
}
});
jQuery.support = (function() {
var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
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)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// 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: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// 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";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.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()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// 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>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.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%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== "undefined" ) {
// 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.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
// Prevent IE 6 from affecting layout for positioned elements #11048
// Prevent IE from shrinking the body in IE 7 mode #12869
body.style.zoom = 1;
}
body.removeChild( container );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// 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)) && getByName && data === undefined ) {
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 ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].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 ( getByName ) {
// 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 /* For internal use only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, i, l,
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 ) );
}
for ( i = 0, l = name.length; i < l; 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 : 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)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
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, false );
},
removeData: function( elem, name ) {
return internalRemoveData( elem, name, false );
},
// For internal use only.
_data: function( elem, name, data ) {
return internalData( elem, name, data, true );
},
_removeData: function( elem, name ) {
return internalRemoveData( elem, name, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(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 jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
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;
}
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--;
}
hooks.cur = fn;
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 );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
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 );
};
});
},
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 nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.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 ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
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 ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === "undefined" || 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;
},
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,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.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 ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
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
( jQuery.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 values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var ret, hooks, notxml,
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 === "undefined" ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== "undefined" ) {
ret = elem.getAttribute( 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( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
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 ( !jQuery.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;
}
}
}
},
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( 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 ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return 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/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
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;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
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 = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
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)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
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 ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// 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 );
}
};
});
}
if ( !jQuery.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 + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( 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;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* 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 handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
// Don't attach events to noData or text/comment nodes (but allow plain objects)
elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem );
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 !== "undefined" && (!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
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// 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, origCount, tmp,
events, t, handleObj,
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( core_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 i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = event.type || event,
namespaces = 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 );
event.isTrigger = true;
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 && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && 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, j, ret, matched, handleObj,
handlerQueue = [],
args = core_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 i, matches, sel, handleObj,
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") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( 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,
originalEvent = event,
fixHook = jQuery.event.fixHooks[ event.type ] || {},
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 eventDoc, doc, body,
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
},
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;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && 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 === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
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 ] === "undefined" ) {
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.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? 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() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, 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 ( !jQuery.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 ( !jQuery.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 ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// 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 );
});
},
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 );
},
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 );
}
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
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 );
};
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
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;
},
// 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#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// 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 + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + 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" ),
// 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" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /\{\s*\[native code\]\s*\}/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( docElem.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
for ( ; (elem = this[i]); i++ ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* 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 cache,
keys = [];
return (cache = function( 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);
});
}
/**
* 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 {
// release memory in IE
div = null;
}
}
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 ( !documentIsXML && !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 #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, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = 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 ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
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 doc = node ? node.ownerDocument || node : preferredDoc;
// 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
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
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 {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
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.tagNameNoComments ?
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 === "*" ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(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 explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// 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 ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + 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 = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
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 = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
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;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
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;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
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']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !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 ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = a && b && a.nextSibling;
for ( ; cur; cur = cur.nextSibling ) {
if ( cur === b ) {
return -1;
}
}
return a ? 1 : -1;
}
// Returns a function to use in pseudos for input types
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
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
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]);
}
}
});
});
}
/**
* 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
for ( ; (node = elem[i]); 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 (see #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,
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[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[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// 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( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return 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( 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.substr( result.length - check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.substr( 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 identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.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 only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
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;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// 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;
})
}
};
// 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 );
}
function tokenize( 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 && combinator.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 data, cache, outerCache,
dirkey = 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 ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
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 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( tokens.slice( 0, i - 1 ) ).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 ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Nested matchers should use non-integer dirruns
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++matcherCachedRuns;
}
}
// 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
// `i` starts as a string, so matchedCount would equal "00" if there are no elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
for ( j = 0; (matcher = setMatchers[j]); 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, group /* 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 ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is 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" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; 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 ) && 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, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
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;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < self.length; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < this.length; i++ ) {
jQuery.find( selector, this[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( jQuery.unique( ret ) );
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
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;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// 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".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// 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 ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
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 ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
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;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
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,
manipulation_rcheckableType = /^(?:checkbox|radio)$/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: jQuery.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;
jQuery.fn.extend({
text: function( value ) {
return jQuery.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 );
},
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();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
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 jQuery.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 ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.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( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
jQuery( this ).remove();
if ( next ) {
next.parentNode.insertBefore( elem, next );
} else {
parent.appendChild( elem );
}
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var fragment, first, scripts, hasScripts, node, doc,
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" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
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(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
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 ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + 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, data, e;
// 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 ( !jQuery.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 ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_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.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()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== "undefined" ? 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 ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, srcElements, node, i, clone,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.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 ( (!jQuery.support.noCloneEvent || !jQuery.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 contains, elem, tag, tmp, wrap, tbody, j,
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 ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.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 ( !jQuery.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 data, id, elem, type,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
deleteExpando = jQuery.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 !== "undefined" ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var curCSS, getStyles, iframe,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// 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]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
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 isHidden( 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 );
}
function showHide( elements, show ) {
var elem,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = jQuery._data( elem, "olddisplay" );
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && elem.style.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", css_defaultDisplay(elem.nodeName) );
}
} else if ( !values[ index ] && !isHidden( elem ) ) {
jQuery._data( elem, "olddisplay", 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;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.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 ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
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;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": 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": jQuery.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 NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( 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 ( !jQuery.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 ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #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 val, num, 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 ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
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;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
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;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// 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;
}
}
return ret === "" ? "auto" : ret;
};
}
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 = jQuery.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 && ( jQuery.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";
}
// Try to determine the default display value of an element
function css_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'/>")
.css( "cssText", "display:block !important" )
).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;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
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 elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
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,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.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;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: 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" ] );
}
}
};
}
// 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
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: 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;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// 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;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
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 || !manipulation_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();
}
});
//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, "+" );
};
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 );
}
}
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
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+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* 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( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[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 key, deep,
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;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, type, response,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = 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;
};
// 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.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
});
};
});
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"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.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 transport,
// URL without anti-cache param
cacheURL,
// Response headers
responseHeadersString,
responseHeaders,
// timeout handle
timeoutTimer,
// Cross-domain detection vars
parts,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// 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( core_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 += ( ajax_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_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_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;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// 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 not modified
if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.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;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// 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
function ajaxConvert( s, response ) {
var conv, conv2, current, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
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.splice( i--, 0, current );
}
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 };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// 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 + "_" + ( ajax_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 += ( ajax_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";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( 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 ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.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 ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status,
statusText,
responseHeaders,
responses,
xml;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
xml = xhr.responseXML;
responseHeaders = xhr.getAllResponseHeaders();
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#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 && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.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 {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 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 );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
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;
}
}
createTweens( animation, props );
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 );
}
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;
}
}
}
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 );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// 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
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.done(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// 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 ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
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 a non 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, "auto" );
// 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;
}
}
}
};
// Remove in 2.0 - this supports IE8's 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.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 );
};
});
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 );
doAnimation.finish = function() {
anim.stop( true );
};
// 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.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// 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;
});
}
});
// 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;
}
// 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.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.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
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 ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
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
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.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 !== "undefined" ) {
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 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// 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({
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 it's 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 || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// 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 jQuery.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 );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// 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 jQuery.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 );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use 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.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window );
|
basic/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-for-of/node_modules/babel-runtime/helpers/jsx.js | jintoppy/react-training | "use strict";
exports.__esModule = true;
var _for = require("../core-js/symbol/for");
var _for2 = _interopRequireDefault(_for);
var _symbol = require("../core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (function () {
var REACT_ELEMENT_TYPE = typeof _symbol2.default === "function" && _for2.default && (0, _for2.default)("react.element") || 0xeac7;
return function createRawReactElement(type, props, key, children) {
var defaultProps = type && type.defaultProps;
var childrenLength = arguments.length - 3;
if (!props && childrenLength !== 0) {
props = {};
}
if (props && defaultProps) {
for (var propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
} else if (!props) {
props = defaultProps || {};
}
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 3];
}
props.children = childArray;
}
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key === undefined ? null : '' + key,
ref: null,
props: props,
_owner: null
};
};
})(); |
bower_components/tether/docs/welcome/js/jquery.js | sentryguides/sentry | /*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-2-4
*/
(function( window, undefined ) {
// 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+
//"use strict";
var
// The deferred used on DOM ready
readyList,
// A central reference to the root jQuery(document)
rootjQuery,
// Support: IE<9
// For `typeof node.method` instead of `node.method !== undefined`
core_strundefined = typeof undefined,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.9.1",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// 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 = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/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();
},
// The ready event handler
completed = function( event ) {
// 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();
}
},
// Clean-up method for dom ready events
detach = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
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
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 rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_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 a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// 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 );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_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] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
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;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// 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 ( length === i ) {
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({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// 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.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// 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 ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// 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 &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// 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
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 ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
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;
},
noop: function() {},
// 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;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
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 {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_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 l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// 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
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_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 = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_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;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
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;
},
now: function() {
return ( new Date() ).getTime();
}
});
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 );
};
// 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 ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// 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( core_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 = [];
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 ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
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 action = tuple[ 0 ],
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[ action + "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 = core_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 ? core_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();
}
});
jQuery.support = (function() {
var support, all, a,
input, select, fragment,
opt, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
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)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// 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: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// 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";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.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()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// 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>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.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%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== core_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.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
if ( support.inlineBlockNeedsLayout ) {
// 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 );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// 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)) && getByName && data === undefined ) {
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 ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].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 ( getByName ) {
// 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 i, l, thisCache,
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 ) );
}
for ( i = 0, l = name.length; i < l; 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 : 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)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
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 );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
// Do not set data on non-element because it will not be cleared (#8335).
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
return false;
}
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
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 jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
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;
}
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--;
}
hooks.cur = fn;
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 );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
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 );
};
});
},
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 nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.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 ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
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( core_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 + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
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 ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === core_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;
},
val: function( value ) {
var ret, hooks, 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,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.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 ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
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
( jQuery.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 values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var hooks, notxml, 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 === core_strundefined ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== core_strundefined ) {
ret = elem.getAttribute( 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( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
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 ( !jQuery.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;
}
}
}
},
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( 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 ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return 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/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
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;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
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 = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
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)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
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 ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// 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 );
}
};
});
}
if ( !jQuery.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 + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( 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;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* 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 !== core_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
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// 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( core_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 = core_hasOwn.call( event, "type" ) ? event.type : event,
namespaces = core_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 );
event.isTrigger = true;
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 && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && 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 = core_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") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// 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
},
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;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && 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 === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
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 ] === core_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.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? 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() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, 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 ( !jQuery.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 ( !jQuery.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 ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
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 );
});
},
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 );
},
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 );
}
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
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;
},
// 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#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// 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 + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + 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" ),
// 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" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /^[^{]+\{\s*\[native code/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
while ( (elem = this[i++]) ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* 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 cache,
keys = [];
return (cache = function( 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);
});
}
/**
* 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 {
// release memory in IE
div = null;
}
}
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 ( !documentIsXML && !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 #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, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = 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 ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
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 doc = node ? node.ownerDocument || node : preferredDoc;
// 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
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
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 {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
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.tagNameNoComments ?
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;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(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 explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// 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 ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + 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 = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
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 = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
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;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
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;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
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']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !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 ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && ( ~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
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
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
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]);
}
}
});
});
}
/**
* 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
for ( ; (node = elem[i]); 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 (see #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,
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[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[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// 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( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return 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( 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 identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.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 only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
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;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// 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;
})
}
};
// 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 );
}
function tokenize( 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 data, cache, outerCache,
dirkey = 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 ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
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 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( tokens.slice( 0, i - 1 ) ).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 ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
for ( ; (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;
cachedruns = ++matcherCachedRuns;
}
}
// 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, group /* 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 ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is 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" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
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 ) && 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, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
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;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self,
len = this.length;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, this[ 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;
return ret;
},
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;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// 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".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// 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 ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
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 ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
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;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
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,
manipulation_rcheckableType = /^(?:checkbox|radio)$/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: jQuery.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;
jQuery.fn.extend({
text: function( value ) {
return jQuery.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 );
},
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();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
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 jQuery.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 ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.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( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_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" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
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(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
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 ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + 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 ( !jQuery.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 ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_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.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()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== core_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 ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.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 ( (!jQuery.support.noCloneEvent || !jQuery.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 ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.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 ( !jQuery.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 = jQuery.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 !== core_strundefined ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var iframe, getStyles, curCSS,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// 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]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
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 isHidden( 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 );
}
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", css_defaultDisplay(elem.nodeName) );
}
} else {
if ( !values[ index ] ) {
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;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
var len, styles,
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 ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
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;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": 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": jQuery.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 NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( 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 ( !jQuery.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 ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #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;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
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;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
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;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// 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;
}
}
return ret === "" ? "auto" : ret;
};
}
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 = jQuery.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 && ( jQuery.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";
}
// Try to determine the default display value of an element
function css_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'/>")
.css( "cssText", "display:block !important" )
).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;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
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 elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
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,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.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;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: 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" ] );
}
}
};
}
// 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
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: 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;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
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 ||
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// 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;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
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 || !manipulation_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();
}
});
//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, "+" );
};
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 );
}
}
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.hover = function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
};
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
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+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* 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( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[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;
}
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 = 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;
};
// 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.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
});
};
});
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"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.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( core_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 += ( ajax_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_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_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;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// 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 ) {
isSuccess = true;
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data, let's convert it
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.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;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - 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,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// 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
function ajaxConvert( s, response ) {
var conv2, current, conv, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
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.splice( i--, 0, current );
}
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 };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// 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 + "_" + ( ajax_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 += ( ajax_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";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( 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 ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.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 ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status, responseHeaders, statusText, responses;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#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 && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.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 {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 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 );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
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;
}
}
createTweens( animation, props );
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 );
}
function propFilter( props, specialEasing ) {
var value, name, index, easing, 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;
}
}
}
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 );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var prop, index, length,
value, dataShow, toggle,
tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// 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
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.always(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// 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 ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
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;
}
}
}
};
// Remove in 2.0 - this supports IE8's 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.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 );
};
});
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 );
doAnimation.finish = function() {
anim.stop( true );
};
// 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.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// 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;
});
}
});
// 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;
}
// 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.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.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
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 ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
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
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.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 !== core_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 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// 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({
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 || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// 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 jQuery.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 );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// 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 jQuery.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 );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use 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.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window ); |
ajax/libs/zeroclipboard/2.0.0-beta.8/ZeroClipboard.js | jaywcjlove/cdnjs | /*!
* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2014 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v2.0.0-beta.8
*/
(function(window, undefined) {
"use strict";
/**
* Store references to critically important global functions that may be
* overridden on certain web pages.
*/
var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _encodeURIComponent = _window.encodeURIComponent, _slice = _window.Array.prototype.slice, _keys = _window.Object.keys, _hasOwn = _window.Object.prototype.hasOwnProperty, _defineProperty = _window.Object.defineProperty, _Math = _window.Math, _Date = _window.Date, _ActiveXObject = _window.ActiveXObject;
/**
* Convert an `arguments` object into an Array.
*
* @returns The arguments as an Array
* @private
*/
var _args = function(argumentsObj) {
return _slice.call(argumentsObj, 0);
};
/**
* Get the index of an item in an Array.
*
* @returns The index of an item in the Array, or `-1` if not found.
* @private
*/
var _inArray = function(item, array, fromIndex) {
if (typeof array.indexOf === "function") {
return array.indexOf(item, fromIndex);
}
var i, len = array.length;
if (typeof fromIndex === "undefined") {
fromIndex = 0;
} else if (fromIndex < 0) {
fromIndex = len + fromIndex;
}
for (i = fromIndex; i < len; i++) {
if (_hasOwn.call(array, i) && array[i] === item) {
return i;
}
}
return -1;
};
/**
* Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.
*
* @returns The target object, augmented
* @private
*/
var _extend = function() {
var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};
for (i = 1, len = args.length; i < len; i++) {
if ((arg = args[i]) != null) {
for (prop in arg) {
if (_hasOwn.call(arg, prop)) {
src = target[prop];
copy = arg[prop];
if (target === copy) {
continue;
}
if (copy !== undefined) {
target[prop] = copy;
}
}
}
}
}
return target;
};
/**
* Return a deep copy of the source object or array.
*
* @returns Object or Array
* @private
*/
var _deepCopy = function(source) {
var copy, i, len, prop;
if (typeof source !== "object" || source == null) {
copy = source;
} else if (typeof source.length === "number") {
copy = [];
for (i = 0, len = source.length; i < len; i++) {
if (_hasOwn.call(source, i)) {
copy[i] = _deepCopy(source[i]);
}
}
} else {
copy = {};
for (prop in source) {
if (_hasOwn.call(source, prop)) {
copy[prop] = _deepCopy(source[prop]);
}
}
}
return copy;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.
* The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to
* be kept.
*
* @returns A new filtered object.
* @private
*/
var _pick = function(obj, keys) {
var newObj = {};
for (var i = 0, len = keys.length; i < len; i++) {
if (keys[i] in obj) {
newObj[keys[i]] = obj[keys[i]];
}
}
return newObj;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.
* The inverse of `_pick`.
*
* @returns A new filtered object.
* @private
*/
var _omit = function(obj, keys) {
var newObj = {};
for (var prop in obj) {
if (_inArray(prop, keys) === -1) {
newObj[prop] = obj[prop];
}
}
return newObj;
};
/**
* Get all of an object's owned, enumerable property names. Does NOT include prototype properties.
*
* @returns An Array of property names.
* @private
*/
var _objectKeys = function(obj) {
if (obj == null) {
return [];
}
if (_keys) {
return _keys(obj);
}
var keys = [];
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
keys.push(prop);
}
}
return keys;
};
/**
* Remove all owned, enumerable properties from an object.
*
* @returns The original object without its owned, enumerable properties.
* @private
*/
var _deleteOwnProperties = function(obj) {
if (obj) {
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
delete obj[prop];
}
}
}
return obj;
};
/**
* Mark an existing property as read-only.
* @private
*/
var _makeReadOnly = function(obj, prop) {
if (prop in obj && typeof _defineProperty === "function") {
_defineProperty(obj, prop, {
value: obj[prop],
writable: false,
configurable: true,
enumerable: true
});
}
};
/**
* Get the current time in milliseconds since the epoch.
*
* @returns Number
* @private
*/
var _now = function(Date) {
return function() {
var time;
if (Date.now) {
time = Date.now();
} else {
time = new Date().getTime();
}
return time;
};
}(_Date);
/**
* Keep track of the state of the Flash object.
* @private
*/
var _flashState = {
bridge: null,
version: "0.0.0",
pluginType: "unknown",
disabled: null,
outdated: null,
unavailable: null,
deactivated: null,
overdue: null,
ready: null
};
/**
* The minimum Flash Player version required to use ZeroClipboard completely.
* @readonly
* @private
*/
var _minimumFlashVersion = "11.0.0";
/**
* Keep track of all event listener registrations.
* @private
*/
var _handlers = {};
/**
* Keep track of the currently activated element.
* @private
*/
var _currentElement;
/**
* Keep track of data for the pending clipboard transaction.
* @private
*/
var _clipData = {};
/**
* Keep track of data formats for the pending clipboard transaction.
* @private
*/
var _clipDataFormatMap = null;
/**
* The `message` store for events
* @private
*/
var _eventMessages = {
ready: "Flash communication is established",
error: {
"flash-disabled": "Flash is disabled or not installed",
"flash-outdated": "Flash is too outdated to support ZeroClipboard",
"flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript",
"flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate",
"flash-overdue": "Flash communication was established but NOT within the acceptable time limit"
}
};
/**
* The presumed location of the "ZeroClipboard.swf" file, based on the location
* of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.).
* @private
*/
var _swfPath = function() {
var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
if (!(_document.currentScript && (jsPath = _document.currentScript.src))) {
var scripts = _document.getElementsByTagName("script");
if ("readyState" in scripts[0]) {
for (i = scripts.length; i--; ) {
if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
break;
}
}
} else if (_document.readyState === "loading") {
jsPath = scripts[scripts.length - 1].src;
} else {
for (i = scripts.length; i--; ) {
tmpJsPath = scripts[i].src;
if (!tmpJsPath) {
jsDir = null;
break;
}
tmpJsPath = tmpJsPath.split("#")[0].split("?")[0];
tmpJsPath = tmpJsPath.slice(0, tmpJsPath.lastIndexOf("/") + 1);
if (jsDir == null) {
jsDir = tmpJsPath;
} else if (jsDir !== tmpJsPath) {
jsDir = null;
break;
}
}
if (jsDir !== null) {
jsPath = jsDir;
}
}
}
if (jsPath) {
jsPath = jsPath.split("#")[0].split("?")[0];
swfPath = jsPath.slice(0, jsPath.lastIndexOf("/") + 1) + swfPath;
}
return swfPath;
}();
/**
* ZeroClipboard configuration defaults for the Core module.
* @private
*/
var _globalConfig = {
swfPath: _swfPath,
trustedDomains: window.location.host ? [ window.location.host ] : [],
cacheBust: true,
forceEnhancedClipboard: false,
flashLoadTimeout: 3e4,
autoActivate: true,
bubbleEvents: true,
containerId: "global-zeroclipboard-html-bridge",
containerClass: "global-zeroclipboard-container",
swfObjectId: "global-zeroclipboard-flash-bridge",
hoverClass: "zeroclipboard-is-hover",
activeClass: "zeroclipboard-is-active",
forceHandCursor: false,
title: null,
zIndex: 999999999
};
/**
* The underlying implementation of `ZeroClipboard.config`.
* @private
*/
var _config = function(options) {
if (typeof options === "object" && options !== null) {
for (var prop in options) {
if (_hasOwn.call(options, prop)) {
if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) {
_globalConfig[prop] = options[prop];
} else if (_flashState.bridge == null) {
if (prop === "containerId" || prop === "swfObjectId") {
if (_isValidHtml4Id(options[prop])) {
_globalConfig[prop] = options[prop];
} else {
throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
}
} else {
_globalConfig[prop] = options[prop];
}
}
}
}
}
if (typeof options === "string" && options) {
if (_hasOwn.call(_globalConfig, options)) {
return _globalConfig[options];
}
return;
}
return _deepCopy(_globalConfig);
};
/**
* The underlying implementation of `ZeroClipboard.state`.
* @private
*/
var _state = function() {
return {
browser: _pick(_navigator, [ "userAgent", "platform", "appName" ]),
flash: _omit(_flashState, [ "bridge" ]),
zeroclipboard: {
version: ZeroClipboard.version,
config: ZeroClipboard.config()
}
};
};
/**
* The underlying implementation of `ZeroClipboard.isFlashUnusable`.
* @private
*/
var _isFlashUnusable = function() {
return !!(_flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.deactivated);
};
/**
* The underlying implementation of `ZeroClipboard.on`.
* @private
*/
var _on = function(eventType, listener) {
var i, len, events, added = {};
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.on(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].replace(/^on/, "");
added[eventType] = true;
if (!_handlers[eventType]) {
_handlers[eventType] = [];
}
_handlers[eventType].push(listener);
}
if (added.ready && _flashState.ready) {
ZeroClipboard.emit({
type: "ready"
});
}
if (added.error) {
var errorTypes = [ "disabled", "outdated", "unavailable", "deactivated", "overdue" ];
for (i = 0, len = errorTypes.length; i < len; i++) {
if (_flashState[errorTypes[i]] === true) {
ZeroClipboard.emit({
type: "error",
name: "flash-" + errorTypes[i]
});
break;
}
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.off`.
* @private
*/
var _off = function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers;
if (arguments.length === 0) {
events = _objectKeys(_handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.off(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].toLowerCase().replace(/^on/, "");
perEventHandlers = _handlers[eventType];
if (perEventHandlers && perEventHandlers.length) {
if (listener) {
foundIndex = _inArray(listener, perEventHandlers);
while (foundIndex !== -1) {
perEventHandlers.splice(foundIndex, 1);
foundIndex = _inArray(listener, perEventHandlers, foundIndex);
}
} else {
perEventHandlers.length = 0;
}
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.handlers`.
* @private
*/
var _listeners = function(eventType) {
var copy;
if (typeof eventType === "string" && eventType) {
copy = _deepCopy(_handlers[eventType]) || null;
} else {
copy = _deepCopy(_handlers);
}
return copy;
};
/**
* The underlying implementation of `ZeroClipboard.emit`.
* @private
*/
var _emit = function(event) {
var eventCopy, returnVal, tmp;
event = _createEvent(event);
if (!event) {
return;
}
if (_preprocessEvent(event)) {
return;
}
if (event.type === "ready" && _flashState.overdue === true) {
return ZeroClipboard.emit({
type: "error",
name: "flash-overdue"
});
}
eventCopy = _extend({}, event);
_dispatchCallbacks(eventCopy);
if (event.type === "copy") {
tmp = _mapClipDataToFlash(_clipData);
returnVal = tmp.data;
_clipDataFormatMap = tmp.formatMap;
}
return returnVal;
};
/**
* The underlying implementation of `ZeroClipboard.create`.
* @private
*/
var _create = function() {
if (typeof _flashState.ready !== "boolean") {
_flashState.ready = false;
}
if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
var maxWait = _globalConfig.flashLoadTimeout;
if (typeof maxWait === "number" && maxWait >= 0) {
_setTimeout(function() {
if (typeof _flashState.deactivated !== "boolean") {
_flashState.deactivated = true;
}
if (_flashState.deactivated === true) {
ZeroClipboard.emit({
type: "error",
name: "flash-deactivated"
});
}
}, maxWait);
}
_flashState.overdue = false;
_embedSwf();
}
};
/**
* The underlying implementation of `ZeroClipboard.destroy`.
* @private
*/
var _destroy = function() {
ZeroClipboard.clearData();
ZeroClipboard.deactivate();
ZeroClipboard.emit("destroy");
_unembedSwf();
ZeroClipboard.off();
};
/**
* The underlying implementation of `ZeroClipboard.setData`.
* @private
*/
var _setData = function(format, data) {
var dataObj;
if (typeof format === "object" && format && typeof data === "undefined") {
dataObj = format;
ZeroClipboard.clearData();
} else if (typeof format === "string" && format) {
dataObj = {};
dataObj[format] = data;
} else {
return;
}
for (var dataFormat in dataObj) {
if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) {
_clipData[dataFormat] = dataObj[dataFormat];
}
}
};
/**
* The underlying implementation of `ZeroClipboard.clearData`.
* @private
*/
var _clearData = function(format) {
if (typeof format === "undefined") {
_deleteOwnProperties(_clipData);
_clipDataFormatMap = null;
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
delete _clipData[format];
}
};
/**
* The underlying implementation of `ZeroClipboard.activate`.
* @private
*/
var _activate = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.activeClass);
if (_currentElement !== element) {
_removeClass(_currentElement, _globalConfig.hoverClass);
}
}
_currentElement = element;
_addClass(element, _globalConfig.hoverClass);
var newTitle = element.getAttribute("title") || _globalConfig.title;
if (typeof newTitle === "string" && newTitle) {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.setAttribute("title", newTitle);
}
}
var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
_setHandCursor(useHandCursor);
_reposition();
};
/**
* The underlying implementation of `ZeroClipboard.deactivate`.
* @private
*/
var _deactivate = function() {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.removeAttribute("title");
htmlBridge.style.left = "0px";
htmlBridge.style.top = "-9999px";
htmlBridge.style.width = "1px";
htmlBridge.style.top = "1px";
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.hoverClass);
_removeClass(_currentElement, _globalConfig.activeClass);
_currentElement = null;
}
};
/**
* Check if a value is a valid HTML4 `ID` or `Name` token.
* @private
*/
var _isValidHtml4Id = function(id) {
return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id);
};
/**
* Create or update an `event` object, based on the `eventType`.
* @private
*/
var _createEvent = function(event) {
var eventType;
if (typeof event === "string" && event) {
eventType = event;
event = {};
} else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
eventType = event.type;
}
if (!eventType) {
return;
}
_extend(event, {
type: eventType.toLowerCase(),
target: event.target || _currentElement || null,
relatedTarget: event.relatedTarget || null,
currentTarget: _flashState && _flashState.bridge || null,
timeStamp: event.timeStamp || _now() || null
});
var msg = _eventMessages[event.type];
if (event.type === "error" && event.name && msg) {
msg = msg[event.name];
}
if (msg) {
event.message = msg;
}
if (event.type === "ready") {
_extend(event, {
target: null,
version: _flashState.version
});
}
if (event.type === "error") {
if (/^flash-(outdated|unavailable|deactivated|overdue)$/.test(event.name)) {
_extend(event, {
target: null,
version: _flashState.version,
minimumVersion: _minimumFlashVersion
});
}
}
if (event.type === "copy") {
event.clipboardData = {
setData: ZeroClipboard.setData,
clearData: ZeroClipboard.clearData
};
}
if (event.type === "aftercopy") {
event = _mapClipResultsFromFlash(event, _clipDataFormatMap);
}
if (event.target && !event.relatedTarget) {
event.relatedTarget = _getRelatedTarget(event.target);
}
return _addMouseData(event);
};
/**
* Get a relatedTarget from the target's `data-clipboard-target` attribute
* @private
*/
var _getRelatedTarget = function(targetEl) {
var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
};
/**
* Add element and position data to `MouseEvent` instances
* @private
*/
var _addMouseData = function(event) {
if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
var srcElement = event.target;
var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
var pos = _getDOMObjectPosition(srcElement);
var screenLeft = _window.screenLeft || _window.screenX || 0;
var screenTop = _window.screenTop || _window.screenY || 0;
var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;
var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;
var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0);
var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0);
var clientX = pageX - scrollLeft;
var clientY = pageY - scrollTop;
var screenX = screenLeft + clientX;
var screenY = screenTop + clientY;
var moveX = typeof event.movementX === "number" ? event.movementX : 0;
var moveY = typeof event.movementY === "number" ? event.movementY : 0;
delete event._stageX;
delete event._stageY;
_extend(event, {
srcElement: srcElement,
fromElement: fromElement,
toElement: toElement,
screenX: screenX,
screenY: screenY,
pageX: pageX,
pageY: pageY,
clientX: clientX,
clientY: clientY,
x: clientX,
y: clientY,
movementX: moveX,
movementY: moveY,
offsetX: 0,
offsetY: 0,
layerX: 0,
layerY: 0
});
}
return event;
};
/**
* Determine if an event's registered handlers should be execute synchronously or asynchronously.
*
* @returns {boolean}
* @private
*/
var _shouldPerformAsync = function(event) {
var eventType = event && typeof event.type === "string" && event.type || "";
return !/^(?:(?:before)?copy|destroy)$/.test(eventType);
};
/**
* Control if a callback should be executed asynchronously or not.
*
* @returns `undefined`
* @private
*/
var _dispatchCallback = function(func, context, args, async) {
if (async) {
_setTimeout(function() {
func.apply(context, args);
}, 0);
} else {
func.apply(context, args);
}
};
/**
* Handle the actual dispatching of events to client instances.
*
* @returns `undefined`
* @private
*/
var _dispatchCallbacks = function(event) {
if (!(typeof event === "object" && event && event.type)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = _handlers["*"] || [];
var specificTypeHandlers = _handlers[event.type] || [];
var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
if (handlers && handlers.length) {
var i, len, func, context, eventCopy, originalContext = this;
for (i = 0, len = handlers.length; i < len; i++) {
func = handlers[i];
context = originalContext;
if (typeof func === "string" && typeof _window[func] === "function") {
func = _window[func];
}
if (typeof func === "object" && func && typeof func.handleEvent === "function") {
context = func;
func = func.handleEvent;
}
if (typeof func === "function") {
eventCopy = _extend({}, event);
_dispatchCallback(func, context, [ eventCopy ], async);
}
}
}
return this;
};
/**
* Preprocess any special behaviors, reactions, or state changes after receiving this event.
* Executes only once per event emitted, NOT once per client.
* @private
*/
var _preprocessEvent = function(event) {
var element = event.target || _currentElement || null;
var sourceIsSwf = event._source === "swf";
delete event._source;
switch (event.type) {
case "error":
if (_inArray(event.name, [ "flash-disabled", "flash-outdated", "flash-deactivated", "flash-overdue" ])) {
_extend(_flashState, {
disabled: event.name === "flash-disabled",
outdated: event.name === "flash-outdated",
unavailable: event.name === "flash-unavailable",
deactivated: event.name === "flash-deactivated",
overdue: event.name === "flash-overdue",
ready: false
});
}
break;
case "ready":
var wasDeactivated = _flashState.deactivated === true;
_extend(_flashState, {
disabled: false,
outdated: false,
unavailable: false,
deactivated: false,
overdue: wasDeactivated,
ready: !wasDeactivated
});
break;
case "copy":
var textContent, htmlContent, targetEl = event.relatedTarget;
if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
if (htmlContent !== textContent) {
event.clipboardData.setData("text/html", htmlContent);
}
} else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
}
break;
case "aftercopy":
ZeroClipboard.clearData();
if (element && element !== _safeActiveElement() && element.focus) {
element.focus();
}
break;
case "_mouseover":
ZeroClipboard.activate(element);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: "mouseover"
}));
_fireMouseEvent(_extend({}, event, {
type: "mouseenter",
bubbles: false
}));
}
break;
case "_mouseout":
ZeroClipboard.deactivate();
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: "mouseout"
}));
_fireMouseEvent(_extend({}, event, {
type: "mouseleave",
bubbles: false
}));
}
break;
case "_mousedown":
_addClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_mouseup":
_removeClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_click":
case "_mousemove":
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
}
if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
return true;
}
};
/**
* Dispatch a synthetic MouseEvent.
*
* @returns `undefined`
* @private
*/
var _fireMouseEvent = function(event) {
if (!(event && typeof event.type === "string" && event)) {
return;
}
var e, target = event.target || event.srcElement || null, doc = target && target.ownerDocument || _document, defaults = {
view: doc.defaultView || _window,
canBubble: true,
cancelable: true,
detail: event.type === "click" ? 1 : 0,
button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1
}, args = _extend(defaults, event);
if (!target) {
return;
}
if (doc.createEvent && target.dispatchEvent) {
args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];
e = doc.createEvent("MouseEvents");
if (e.initMouseEvent) {
e.initMouseEvent.apply(e, args);
target.dispatchEvent(e);
}
} else if (doc.createEventObject && target.fireEvent) {
e = doc.createEventObject(args);
target.fireEvent("on" + args.type, e);
}
};
/**
* Create the HTML bridge element to embed the Flash object into.
* @private
*/
var _createHtmlBridge = function() {
var container = _document.createElement("div");
container.id = _globalConfig.containerId;
container.className = _globalConfig.containerClass;
container.style.position = "absolute";
container.style.left = "0px";
container.style.top = "-9999px";
container.style.width = "1px";
container.style.height = "1px";
container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
return container;
};
/**
* Get the HTML element container that wraps the Flash bridge object/element.
* @private
*/
var _getHtmlBridge = function(flashBridge) {
var htmlBridge = flashBridge && flashBridge.parentNode;
while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) {
htmlBridge = htmlBridge.parentNode;
}
return htmlBridge || null;
};
/**
* Create the SWF object.
*
* @returns The SWF object reference.
* @private
*/
var _embedSwf = function() {
var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
if (!flashBridge) {
var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
var flashvars = _vars(_globalConfig);
var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);
container = _createHtmlBridge();
var divToBeReplaced = _document.createElement("div");
container.appendChild(divToBeReplaced);
_document.body.appendChild(container);
var tmpDiv = _document.createElement("div");
var oldIE = _flashState.pluginType === "activex";
tmpDiv.innerHTML = '<object id="' + _globalConfig.swfObjectId + '" name="' + _globalConfig.swfObjectId + '" ' + 'width="100%" height="100%" ' + (oldIE ? 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' : 'type="application/x-shockwave-flash" data="' + swfUrl + '"') + ">" + (oldIE ? '<param name="movie" value="' + swfUrl + '"/>' : "") + '<param name="allowScriptAccess" value="' + allowScriptAccess + '"/>' + '<param name="allowNetworking" value="' + allowNetworking + '"/>' + '<param name="menu" value="false"/>' + '<param name="wmode" value="transparent"/>' + '<param name="flashvars" value="' + flashvars + '"/>' + "</object>";
flashBridge = tmpDiv.firstChild;
tmpDiv = null;
flashBridge.ZeroClipboard = ZeroClipboard;
container.replaceChild(flashBridge, divToBeReplaced);
}
if (!flashBridge) {
flashBridge = _document[_globalConfig.swfObjectId];
if (flashBridge && (len = flashBridge.length)) {
flashBridge = flashBridge[len - 1];
}
if (!flashBridge && container) {
flashBridge = container.firstChild;
}
}
_flashState.bridge = flashBridge || null;
return flashBridge;
};
/**
* Destroy the SWF object.
* @private
*/
var _unembedSwf = function() {
var flashBridge = _flashState.bridge;
if (flashBridge) {
var htmlBridge = _getHtmlBridge(flashBridge);
if (htmlBridge) {
if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
flashBridge.style.display = "none";
(function removeSwfFromIE() {
if (flashBridge.readyState === 4) {
for (var prop in flashBridge) {
if (typeof flashBridge[prop] === "function") {
flashBridge[prop] = null;
}
}
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
} else {
_setTimeout(removeSwfFromIE, 10);
}
})();
} else {
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
}
}
_flashState.ready = null;
_flashState.bridge = null;
_flashState.deactivated = null;
}
};
/**
* Map the data format names of the "clipData" to Flash-friendly names.
*
* @returns A new transformed object.
* @private
*/
var _mapClipDataToFlash = function(clipData) {
var newClipData = {}, formatMap = {};
if (!(typeof clipData === "object" && clipData)) {
return;
}
for (var dataFormat in clipData) {
if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
switch (dataFormat.toLowerCase()) {
case "text/plain":
case "text":
case "air:text":
case "flash:text":
newClipData.text = clipData[dataFormat];
formatMap.text = dataFormat;
break;
case "text/html":
case "html":
case "air:html":
case "flash:html":
newClipData.html = clipData[dataFormat];
formatMap.html = dataFormat;
break;
case "application/rtf":
case "text/rtf":
case "rtf":
case "richtext":
case "air:rtf":
case "flash:rtf":
newClipData.rtf = clipData[dataFormat];
formatMap.rtf = dataFormat;
break;
default:
break;
}
}
}
return {
data: newClipData,
formatMap: formatMap
};
};
/**
* Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping).
*
* @returns A new transformed object.
* @private
*/
var _mapClipResultsFromFlash = function(clipResults, formatMap) {
if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) {
return clipResults;
}
var newResults = {};
for (var prop in clipResults) {
if (_hasOwn.call(clipResults, prop)) {
if (prop !== "success" && prop !== "data") {
newResults[prop] = clipResults[prop];
continue;
}
newResults[prop] = {};
var tmpHash = clipResults[prop];
for (var dataFormat in tmpHash) {
if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {
newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];
}
}
}
}
return newResults;
};
/**
* Will look at a path, and will create a "?noCache={time}" or "&noCache={time}"
* query param string to return. Does NOT append that string to the original path.
* This is useful because ExternalInterface often breaks when a Flash SWF is cached.
*
* @returns The `noCache` query param with necessary "?"/"&" prefix.
* @private
*/
var _cacheBust = function(path, options) {
var cacheBust = options == null || options && options.cacheBust === true;
if (cacheBust) {
return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now();
} else {
return "";
}
};
/**
* Creates a query string for the FlashVars param.
* Does NOT include the cache-busting query param.
*
* @returns FlashVars query string
* @private
*/
var _vars = function(options) {
var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
if (options.trustedDomains) {
if (typeof options.trustedDomains === "string") {
domains = [ options.trustedDomains ];
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
domains = options.trustedDomains;
}
}
if (domains && domains.length) {
for (i = 0, len = domains.length; i < len; i++) {
if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
domain = _extractDomain(domains[i]);
if (!domain) {
continue;
}
if (domain === "*") {
trustedOriginsExpanded = [ domain ];
break;
}
trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
}
}
}
if (trustedOriginsExpanded.length) {
str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
}
if (options.forceEnhancedClipboard === true) {
str += (str ? "&" : "") + "forceEnhancedClipboard=true";
}
if (typeof options.swfObjectId === "string" && options.swfObjectId) {
str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
}
return str;
};
/**
* Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or
* URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/").
*
* @returns the domain
* @private
*/
var _extractDomain = function(originOrUrl) {
if (originOrUrl == null || originOrUrl === "") {
return null;
}
originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
if (originOrUrl === "") {
return null;
}
var protocolIndex = originOrUrl.indexOf("//");
originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
var pathIndex = originOrUrl.indexOf("/");
originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
return null;
}
return originOrUrl || null;
};
/**
* Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.
*
* @returns The appropriate script access level.
* @private
*/
var _determineScriptAccess = function() {
var _extractAllDomains = function(origins, resultsArray) {
var i, len, tmp;
if (origins == null || resultsArray[0] === "*") {
return;
}
if (typeof origins === "string") {
origins = [ origins ];
}
if (!(typeof origins === "object" && typeof origins.length === "number")) {
return;
}
for (i = 0, len = origins.length; i < len; i++) {
if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {
if (tmp === "*") {
resultsArray.length = 0;
resultsArray.push("*");
break;
}
if (_inArray(tmp, resultsArray) === -1) {
resultsArray.push(tmp);
}
}
}
};
return function(currentDomain, configOptions) {
var swfDomain = _extractDomain(configOptions.swfPath);
if (swfDomain === null) {
swfDomain = currentDomain;
}
var trustedDomains = [];
_extractAllDomains(configOptions.trustedOrigins, trustedDomains);
_extractAllDomains(configOptions.trustedDomains, trustedDomains);
var len = trustedDomains.length;
if (len > 0) {
if (len === 1 && trustedDomains[0] === "*") {
return "always";
}
if (_inArray(currentDomain, trustedDomains) !== -1) {
if (len === 1 && currentDomain === swfDomain) {
return "sameDomain";
}
return "always";
}
}
return "never";
};
}();
/**
* Get the currently active/focused DOM element.
*
* @returns the currently active/focused element, or `null`
* @private
*/
var _safeActiveElement = function() {
try {
return _document.activeElement;
} catch (err) {
return null;
}
};
/**
* Add a class to an element, if it doesn't already have it.
*
* @returns The element, with its new class added.
* @private
*/
var _addClass = function(element, value) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.classList) {
if (!element.classList.contains(value)) {
element.classList.add(value);
}
return element;
}
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1) {
if (!element.className) {
element.className = value;
} else {
var className = " " + element.className + " ", setClass = element.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
element.className = setClass.replace(/^\s+|\s+$/g, "");
}
}
}
return element;
};
/**
* Remove a class from an element, if it has it.
*
* @returns The element, with its class removed.
* @private
*/
var _removeClass = function(element, value) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.classList) {
if (element.classList.contains(value)) {
element.classList.remove(value);
}
return element;
}
if (typeof value === "string" && value) {
var classNames = value.split(/\s+/);
if (element.nodeType === 1 && element.className) {
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
for (var c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
}
}
return element;
};
/**
* Convert standard CSS property names into the equivalent CSS property names
* for use by oldIE and/or `el.style.{prop}`.
*
* NOTE: oldIE has other special cases that are not accounted for here,
* e.g. "float" -> "styleFloat"
*
* @example _camelizeCssPropName("z-index") -> "zIndex"
*
* @returns The CSS property name for oldIE and/or `el.style.{prop}`
* @private
*/
var _camelizeCssPropName = function() {
var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
return group.toUpperCase();
};
return function(prop) {
return prop.replace(matcherRegex, replacerFn);
};
}();
/**
* Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`,
* then we assume that it should be a hand ("pointer") cursor if the element
* is an anchor element ("a" tag).
*
* @returns The computed style property.
* @private
*/
var _getStyle = function(el, prop) {
var value, camelProp, tagName;
if (_window.getComputedStyle) {
value = _window.getComputedStyle(el, null).getPropertyValue(prop);
} else {
camelProp = _camelizeCssPropName(prop);
if (el.currentStyle) {
value = el.currentStyle[camelProp];
} else {
value = el.style[camelProp];
}
}
if (prop === "cursor") {
if (!value || value === "auto") {
tagName = el.tagName.toLowerCase();
if (tagName === "a") {
return "pointer";
}
}
}
return value;
};
/**
* Get the zoom factor of the browser. Always returns `1.0`, except at
* non-default zoom levels in IE<8 and some older versions of WebKit.
*
* @returns Floating unit percentage of the zoom factor (e.g. 150% = `1.5`).
* @private
*/
var _getZoomFactor = function() {
var rect, physicalWidth, logicalWidth, zoomFactor = 1;
if (typeof _document.body.getBoundingClientRect === "function") {
rect = _document.body.getBoundingClientRect();
physicalWidth = rect.right - rect.left;
logicalWidth = _document.body.offsetWidth;
zoomFactor = _Math.round(physicalWidth / logicalWidth * 100) / 100;
}
return zoomFactor;
};
/**
* Get the DOM positioning info of an element.
*
* @returns Object containing the element's position, width, and height.
* @private
*/
var _getDOMObjectPosition = function(obj) {
var info = {
left: 0,
top: 0,
width: 0,
height: 0
};
if (obj.getBoundingClientRect) {
var rect = obj.getBoundingClientRect();
var pageXOffset, pageYOffset, zoomFactor;
if ("pageXOffset" in _window && "pageYOffset" in _window) {
pageXOffset = _window.pageXOffset;
pageYOffset = _window.pageYOffset;
} else {
zoomFactor = _getZoomFactor();
pageXOffset = _Math.round(_document.documentElement.scrollLeft / zoomFactor);
pageYOffset = _Math.round(_document.documentElement.scrollTop / zoomFactor);
}
var leftBorderWidth = _document.documentElement.clientLeft || 0;
var topBorderWidth = _document.documentElement.clientTop || 0;
info.left = rect.left + pageXOffset - leftBorderWidth;
info.top = rect.top + pageYOffset - topBorderWidth;
info.width = "width" in rect ? rect.width : rect.right - rect.left;
info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
}
return info;
};
/**
* Reposition the Flash object to cover the currently activated element.
*
* @returns `undefined`
* @private
*/
var _reposition = function() {
var htmlBridge;
if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
var pos = _getDOMObjectPosition(_currentElement);
_extend(htmlBridge.style, {
width: pos.width + "px",
height: pos.height + "px",
top: pos.top + "px",
left: pos.left + "px",
zIndex: "" + _getSafeZIndex(_globalConfig.zIndex)
});
}
};
/**
* Sends a signal to the Flash object to display the hand cursor if `true`.
*
* @returns `undefined`
* @private
*/
var _setHandCursor = function(enabled) {
if (_flashState.ready === true) {
if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
_flashState.bridge.setHandCursor(enabled);
} else {
_flashState.ready = false;
}
}
};
/**
* Get a safe value for `zIndex`
*
* @returns an integer, or "auto"
* @private
*/
var _getSafeZIndex = function(val) {
if (/^(?:auto|inherit)$/.test(val)) {
return val;
}
var zIndex;
if (typeof val === "number" && !_isNaN(val)) {
zIndex = val;
} else if (typeof val === "string") {
zIndex = _getSafeZIndex(_parseInt(val, 10));
}
return typeof zIndex === "number" ? zIndex : "auto";
};
/**
* Detect the Flash Player status, version, and plugin type.
*
* @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}
* @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}
*
* @returns `undefined`
* @private
*/
var _detectFlashSupport = function(ActiveXObject) {
var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
/**
* Derived from Apple's suggested sniffer.
* @param {String} desc e.g. "Shockwave Flash 7.0 r61"
* @returns {String} "7.0.61"
* @private
*/
function parseFlashVersion(desc) {
var matches = desc.match(/[\d]+/g);
matches.length = 3;
return matches.join(".");
}
function isPepperFlash(flashPlayerFileName) {
return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin");
}
function inspectPlugin(plugin) {
if (plugin) {
hasFlash = true;
if (plugin.version) {
flashVersion = parseFlashVersion(plugin.version);
}
if (!flashVersion && plugin.description) {
flashVersion = parseFlashVersion(plugin.description);
}
if (plugin.filename) {
isPPAPI = isPepperFlash(plugin.filename);
}
}
}
if (_navigator.plugins && _navigator.plugins.length) {
plugin = _navigator.plugins["Shockwave Flash"];
inspectPlugin(plugin);
if (_navigator.plugins["Shockwave Flash 2.0"]) {
hasFlash = true;
flashVersion = "2.0.0.11";
}
} else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {
mimeType = _navigator.mimeTypes["application/x-shockwave-flash"];
plugin = mimeType && mimeType.enabledPlugin;
inspectPlugin(plugin);
} else if (typeof ActiveXObject !== "undefined") {
isActiveX = true;
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e1) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
hasFlash = true;
flashVersion = "6.0.21";
} catch (e2) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e3) {
isActiveX = false;
}
}
}
}
_flashState.disabled = hasFlash !== true;
_flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);
_flashState.version = flashVersion || "0.0.0";
_flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown";
};
/**
* Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.
*/
_detectFlashSupport(_ActiveXObject);
/**
* A shell constructor for `ZeroClipboard` client instances.
*
* @constructor
*/
var ZeroClipboard = function() {
if (!(this instanceof ZeroClipboard)) {
return new ZeroClipboard();
}
if (typeof ZeroClipboard._createClient === "function") {
ZeroClipboard._createClient.apply(this, _args(arguments));
}
};
/**
* The ZeroClipboard library's version number.
*
* @static
* @readonly
* @property {string}
*/
ZeroClipboard.version = "2.0.0-beta.8";
_makeReadOnly(ZeroClipboard, "version");
/**
* Update or get a copy of the ZeroClipboard global configuration.
* Returns a copy of the current/updated configuration.
*
* @returns Object
* @static
*/
ZeroClipboard.config = function() {
return _config.apply(this, _args(arguments));
};
/**
* Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.
*
* @returns Object
* @static
*/
ZeroClipboard.state = function() {
return _state.apply(this, _args(arguments));
};
/**
* Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.
*
* @returns Boolean
* @static
*/
ZeroClipboard.isFlashUnusable = function() {
return _isFlashUnusable.apply(this, _args(arguments));
};
/**
* Register an event listener.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.on = function() {
return _on.apply(this, _args(arguments));
};
/**
* Unregister an event listener.
* If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.
* If no `eventType` is provided, it will unregister all listeners for every event type.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.off = function() {
return _off.apply(this, _args(arguments));
};
/**
* Retrieve event listeners for an `eventType`.
* If no `eventType` is provided, it will retrieve all listeners for every event type.
*
* @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
*/
ZeroClipboard.handlers = function() {
return _listeners.apply(this, _args(arguments));
};
/**
* Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.
*
* @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
* @static
*/
ZeroClipboard.emit = function() {
return _emit.apply(this, _args(arguments));
};
/**
* Create and embed the Flash object.
*
* @returns The Flash object
* @static
*/
ZeroClipboard.create = function() {
return _create.apply(this, _args(arguments));
};
/**
* Self-destruct and clean up everything, including the embedded Flash object.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.destroy = function() {
return _destroy.apply(this, _args(arguments));
};
/**
* Set the pending data for clipboard injection.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.setData = function() {
return _setData.apply(this, _args(arguments));
};
/**
* Clear the pending data for clipboard injection.
* If no `format` is provided, all pending data formats will be cleared.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.clearData = function() {
return _clearData.apply(this, _args(arguments));
};
/**
* Sets the current HTML object that the Flash object should overlay. This will put the global
* Flash object on top of the current element; depending on the setup, this may also set the
* pending clipboard text data as well as the Flash object's wrapping element's title attribute
* based on the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.activate = function() {
return _activate.apply(this, _args(arguments));
};
/**
* Un-overlays the Flash object. This will put the global Flash object off-screen; depending on
* the setup, this may also unset the Flash object's wrapping element's title attribute based on
* the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.deactivate = function() {
return _deactivate.apply(this, _args(arguments));
};
/**
* Keep track of the ZeroClipboard client instance counter.
*/
var _clientIdCounter = 0;
/**
* Keep track of the state of the client instances.
*
* Entry structure:
* _clientMeta[client.id] = {
* instance: client,
* elements: [],
* handlers: {}
* };
*/
var _clientMeta = {};
/**
* Keep track of the ZeroClipboard clipped elements counter.
*/
var _elementIdCounter = 0;
/**
* Keep track of the state of the clipped element relationships to clients.
*
* Entry structure:
* _elementMeta[element.zcClippingId] = [client1.id, client2.id];
*/
var _elementMeta = {};
/**
* Keep track of the state of the mouse event handlers for clipped elements.
*
* Entry structure:
* _mouseHandlers[element.zcClippingId] = {
* mouseover: function(event) {},
* mouseout: function(event) {},
* mousedown: function(event) {},
* mouseup: function(event) {}
* };
*/
var _mouseHandlers = {};
/**
* Extending the ZeroClipboard configuration defaults for the Client module.
*/
_extend(_globalConfig, {
autoActivate: true
});
/**
* The real constructor for `ZeroClipboard` client instances.
* @private
*/
var _clientConstructor = function(elements) {
var client = this;
client.id = "" + _clientIdCounter++;
_clientMeta[client.id] = {
instance: client,
elements: [],
handlers: {}
};
if (elements) {
client.clip(elements);
}
ZeroClipboard.on("*", function(event) {
return client.emit(event);
});
ZeroClipboard.on("destroy", function() {
client.destroy();
});
ZeroClipboard.create();
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.on`.
* @private
*/
var _clientOn = function(eventType, listener) {
var i, len, events, added = {}, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
this.on(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].replace(/^on/, "");
added[eventType] = true;
if (!handlers[eventType]) {
handlers[eventType] = [];
}
handlers[eventType].push(listener);
}
if (added.ready && _flashState.ready) {
this.emit({
type: "ready",
client: this
});
}
if (added.error) {
var errorTypes = [ "disabled", "outdated", "unavailable", "deactivated", "overdue" ];
for (i = 0, len = errorTypes.length; i < len; i++) {
if (_flashState[errorTypes[i]]) {
this.emit({
type: "error",
name: "flash-" + errorTypes[i],
client: this
});
break;
}
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.off`.
* @private
*/
var _clientOff = function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (arguments.length === 0) {
events = _objectKeys(handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
this.off(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].toLowerCase().replace(/^on/, "");
perEventHandlers = handlers[eventType];
if (perEventHandlers && perEventHandlers.length) {
if (listener) {
foundIndex = _inArray(listener, perEventHandlers);
while (foundIndex !== -1) {
perEventHandlers.splice(foundIndex, 1);
foundIndex = _inArray(listener, perEventHandlers, foundIndex);
}
} else {
perEventHandlers.length = 0;
}
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.
* @private
*/
var _clientListeners = function(eventType) {
var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (handlers) {
if (typeof eventType === "string" && eventType) {
copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
} else {
copy = _deepCopy(handlers);
}
}
return copy;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.emit`.
* @private
*/
var _clientEmit = function(event) {
if (_clientShouldEmit.call(this, event)) {
if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
event = _extend({}, event);
}
var eventCopy = _extend({}, _createEvent(event), {
client: this
});
_clientDispatchCallbacks.call(this, eventCopy);
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.clip`.
* @private
*/
var _clientClip = function(elements) {
elements = _prepClip(elements);
for (var i = 0; i < elements.length; i++) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
if (!elements[i].zcClippingId) {
elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++;
_elementMeta[elements[i].zcClippingId] = [ this.id ];
if (_globalConfig.autoActivate === true) {
_addMouseHandlers(elements[i]);
}
} else if (_inArray(this.id, _elementMeta[elements[i].zcClippingId]) === -1) {
_elementMeta[elements[i].zcClippingId].push(this.id);
}
var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements;
if (_inArray(elements[i], clippedElements) === -1) {
clippedElements.push(elements[i]);
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.unclip`.
* @private
*/
var _clientUnclip = function(elements) {
var meta = _clientMeta[this.id];
if (!meta) {
return this;
}
var clippedElements = meta.elements;
var arrayIndex;
if (typeof elements === "undefined") {
elements = clippedElements.slice(0);
} else {
elements = _prepClip(elements);
}
for (var i = elements.length; i--; ) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
arrayIndex = 0;
while ((arrayIndex = _inArray(elements[i], clippedElements, arrayIndex)) !== -1) {
clippedElements.splice(arrayIndex, 1);
}
var clientIds = _elementMeta[elements[i].zcClippingId];
if (clientIds) {
arrayIndex = 0;
while ((arrayIndex = _inArray(this.id, clientIds, arrayIndex)) !== -1) {
clientIds.splice(arrayIndex, 1);
}
if (clientIds.length === 0) {
if (_globalConfig.autoActivate === true) {
_removeMouseHandlers(elements[i]);
}
delete elements[i].zcClippingId;
}
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.elements`.
* @private
*/
var _clientElements = function() {
var meta = _clientMeta[this.id];
return meta && meta.elements ? meta.elements.slice(0) : [];
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.destroy`.
* @private
*/
var _clientDestroy = function() {
this.unclip();
this.off();
delete _clientMeta[this.id];
};
/**
* Inspect an Event to see if the Client (`this`) should honor it for emission.
* @private
*/
var _clientShouldEmit = function(event) {
if (!(event && event.type)) {
return false;
}
if (event.client && event.client !== this) {
return false;
}
var clippedEls = _clientMeta[this.id] && _clientMeta[this.id].elements;
var hasClippedEls = !!clippedEls && clippedEls.length > 0;
var goodTarget = !event.target || hasClippedEls && _inArray(event.target, clippedEls) !== -1;
var goodRelTarget = event.relatedTarget && hasClippedEls && _inArray(event.relatedTarget, clippedEls) !== -1;
var goodClient = event.client && event.client === this;
if (!(goodTarget || goodRelTarget || goodClient)) {
return false;
}
return true;
};
/**
* Handle the actual dispatching of events to a client instance.
*
* @returns `this`
* @private
*/
var _clientDispatchCallbacks = function(event) {
if (!(typeof event === "object" && event && event.type)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = _clientMeta[this.id] && _clientMeta[this.id].handlers["*"] || [];
var specificTypeHandlers = _clientMeta[this.id] && _clientMeta[this.id].handlers[event.type] || [];
var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
if (handlers && handlers.length) {
var i, len, func, context, eventCopy, originalContext = this;
for (i = 0, len = handlers.length; i < len; i++) {
func = handlers[i];
context = originalContext;
if (typeof func === "string" && typeof _window[func] === "function") {
func = _window[func];
}
if (typeof func === "object" && func && typeof func.handleEvent === "function") {
context = func;
func = func.handleEvent;
}
if (typeof func === "function") {
eventCopy = _extend({}, event);
_dispatchCallback(func, context, [ eventCopy ], async);
}
}
}
return this;
};
/**
* Prepares the elements for clipping/unclipping.
*
* @returns An Array of elements.
* @private
*/
var _prepClip = function(elements) {
if (typeof elements === "string") {
elements = [];
}
return typeof elements.length !== "number" ? [ elements ] : elements;
};
/**
* Add an event listener to a DOM element (because IE<9 sucks).
*
* @returns The element.
* @private
*/
var _addEventHandler = function(element, method, func) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.addEventListener) {
element.addEventListener(method, func, false);
} else if (element.attachEvent) {
element.attachEvent("on" + method, func);
}
return element;
};
/**
* Remove an event listener from a DOM element (because IE<9 sucks).
*
* @returns The element.
* @private
*/
var _removeEventHandler = function(element, method, func) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.removeEventListener) {
element.removeEventListener(method, func, false);
} else if (element.detachEvent) {
element.detachEvent("on" + method, func);
}
return element;
};
/**
* Add a `mouseover` handler function for a clipped element.
*
* @returns `undefined`
* @private
*/
var _addMouseHandlers = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var _elementMouseOver = function(event) {
if (!(event || _window.event)) {
return;
}
ZeroClipboard.activate(element);
};
_addEventHandler(element, "mouseover", _elementMouseOver);
_mouseHandlers[element.zcClippingId] = {
mouseover: _elementMouseOver
};
};
/**
* Remove a `mouseover` handler function for a clipped element.
*
* @returns `undefined`
* @private
*/
var _removeMouseHandlers = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var mouseHandlers = _mouseHandlers[element.zcClippingId];
if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
return;
}
if (typeof mouseHandlers.mouseover === "function") {
_removeEventHandler(element, "mouseover", mouseHandlers.mouseover);
}
delete _mouseHandlers[element.zcClippingId];
};
/**
* Creates a new ZeroClipboard client instance.
* Optionally, auto-`clip` an element or collection of elements.
*
* @constructor
*/
ZeroClipboard._createClient = function() {
_clientConstructor.apply(this, _args(arguments));
};
/**
* Register an event listener to the client.
*
* @returns `this`
*/
ZeroClipboard.prototype.on = function() {
return _clientOn.apply(this, _args(arguments));
};
/**
* Unregister an event handler from the client.
* If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
* If no `eventType` is provided, it will unregister all handlers for every event type.
*
* @returns `this`
*/
ZeroClipboard.prototype.off = function() {
return _clientOff.apply(this, _args(arguments));
};
/**
* Retrieve event listeners for an `eventType` from the client.
* If no `eventType` is provided, it will retrieve all listeners for every event type.
*
* @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
*/
ZeroClipboard.prototype.handlers = function() {
return _clientListeners.apply(this, _args(arguments));
};
/**
* Event emission receiver from the Flash object for this client's registered JavaScript event listeners.
*
* @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
*/
ZeroClipboard.prototype.emit = function() {
return _clientEmit.apply(this, _args(arguments));
};
/**
* Register clipboard actions for new element(s) to the client.
*
* @returns `this`
*/
ZeroClipboard.prototype.clip = function() {
return _clientClip.apply(this, _args(arguments));
};
/**
* Unregister the clipboard actions of previously registered element(s) on the page.
* If no elements are provided, ALL registered elements will be unregistered.
*
* @returns `this`
*/
ZeroClipboard.prototype.unclip = function() {
return _clientUnclip.apply(this, _args(arguments));
};
/**
* Get all of the elements to which this client is clipped.
*
* @returns array of clipped elements
*/
ZeroClipboard.prototype.elements = function() {
return _clientElements.apply(this, _args(arguments));
};
/**
* Self-destruct and clean up everything for a single client.
* This will NOT destroy the embedded Flash object.
*
* @returns `undefined`
*/
ZeroClipboard.prototype.destroy = function() {
return _clientDestroy.apply(this, _args(arguments));
};
/**
* Stores the pending plain text to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setText = function(text) {
ZeroClipboard.setData("text/plain", text);
return this;
};
/**
* Stores the pending HTML text to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setHtml = function(html) {
ZeroClipboard.setData("text/html", html);
return this;
};
/**
* Stores the pending rich text (RTF) to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setRichText = function(richText) {
ZeroClipboard.setData("application/rtf", richText);
return this;
};
/**
* Stores the pending data to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setData = function() {
ZeroClipboard.setData.apply(this, _args(arguments));
return this;
};
/**
* Clears the pending data to inject into the clipboard.
* If no `format` is provided, all pending data formats will be cleared.
*
* @returns `this`
*/
ZeroClipboard.prototype.clearData = function() {
ZeroClipboard.clearData.apply(this, _args(arguments));
return this;
};
if (typeof define === "function" && define.amd) {
define(function() {
return ZeroClipboard;
});
} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
module.exports = ZeroClipboard;
} else {
window.ZeroClipboard = ZeroClipboard;
}
})(function() {
return this;
}()); |
packages/flow-upgrade/src/upgrades/0.53.0/ReactComponentExplicitTypeArgs/__tests__/fixtures/DefaultPropsInferred.js | samwgoldman/flow | // @flow
import React from 'react';
class MyComponent extends React.Component {
static defaultProps = {};
props: Props;
defaultProps: T;
static props: T;
static state: T;
a: T;
b = 5;
c: T = 5;
method() {}
}
const expression = () =>
class extends React.Component {
static defaultProps = {};
props: Props;
defaultProps: T;
static props: T;
static state: T;
a: T;
b = 5;
c: T = 5;
method() {}
}
|
storybook/stories/character_counter.story.js | mecab/mastodon | import React from 'react';
import { storiesOf } from '@kadira/storybook';
import CharacterCounter from 'mastodon/features/compose/components/character_counter';
storiesOf('CharacterCounter', module)
.add('no text', () => {
const text = '';
return <CharacterCounter text={text} max={500} />;
})
.add('a few strings text', () => {
const text = '0123456789';
return <CharacterCounter text={text} max={500} />;
})
.add('the same text', () => {
const text = '01234567890123456789';
return <CharacterCounter text={text} max={20} />;
})
.add('over text', () => {
const text = '01234567890123456789012345678901234567890123456789';
return <CharacterCounter text={text} max={10} />;
});
|
src/example/App/index.js | remedux/subscription-container | import React from 'react';
import { SubContainer } from '../..';
import css from './App.css';
const App = () => (
<div className={css.app}>
<h1>subscription-container</h1>
<SubContainer />
</div>
);
export default App;
|
src/svg-icons/maps/train.js | frnk94/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsTrain = (props) => (
<SvgIcon {...props}>
<path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
</SvgIcon>
);
MapsTrain = pure(MapsTrain);
MapsTrain.displayName = 'MapsTrain';
MapsTrain.muiName = 'SvgIcon';
export default MapsTrain;
|
client/index.js | YMFE/yapi | import './styles/common.scss';
import './styles/theme.less';
import { LocaleProvider } from 'antd';
import './plugin';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './Application';
import { Provider } from 'react-redux';
import createStore from './reducer/create';
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
import zhCN from 'antd/lib/locale-provider/zh_CN';
const store = createStore();
ReactDOM.render(
<Provider store={store}>
<LocaleProvider locale={zhCN}>
<App />
</LocaleProvider>
</Provider>,
document.getElementById('yapi')
);
|
extensions/SemanticForms/libs/jquery-1.4.2.min.js | SuriyaaKudoIsc/wikia-app-test |
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this;}
if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}
if(selector==="body"&&!context){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this;}
if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true);}else{selector=[doc.createElement(ret[1])];}}else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes;}
return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector);}
this.length=1;this[0]=elem;}
this.context=document;this.selector=selector;return this;}}else if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector);}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return jQuery(context).find(selector);}}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);}
if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}
return jQuery.makeArray(selector,this);},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num]);},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems);}else{jQuery.merge(ret,elems);}
ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector;}else if(name){ret.selector=this.selector+"."+name+"("+selector+")";}
return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery);}else if(readyList){readyList.push(fn);}
return this;},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||jQuery(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}
if(length===i){target=this;--i;}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}
if(deep&©&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
return target;};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery;}
return jQuery;},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13);}
jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery);}
readyList=null;}
if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");}}},bindReady:function(){if(readyBound){return;}
readyBound=true;if(document.readyState==="complete"){return jQuery.ready();}
if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){}
if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false;}
if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false;}
var key;for(key in obj){}
return key===undefined||hasOwnProperty.call(obj,key);},isEmptyObject:function(obj){for(var name in obj){return false;}
return true;},error:function(msg){throw msg;},parseJSON:function(data){if(typeof data!=="string"||!data){return null;}
data=jQuery.trim(data);if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))();}else{jQuery.error("Invalid JSON: "+data);}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data));}else{script.text=data;}
head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}
return object;},trim:function(text){return(text||"").replace(rtrim,"");},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array);}else{jQuery.merge(ret,array);}}
return ret;},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem);}
for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}
return-1;},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}
first.length=i;return first;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i]);}}
return ret;},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}
return ret.concat.apply([],ret);},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined;}else if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined;}}
if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments);};}
if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++;}
return proxy;},uaMatch:function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version;}
if(jQuery.browser.webkit){jQuery.browser.safari=true;}
if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem);};}
rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready();};}else if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready();}};}
function doScrollCheck(){if(jQuery.isReady){return;}
try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return;}
jQuery.ready();}
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}
if(elem.parentNode){elem.parentNode.removeChild(elem);}}
function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value);}
return elems;}
if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass);}
return elems;}
return length?fn(elems[0],key):undefined;}
function now(){return(new Date).getTime();}
(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
try{delete script.test;}catch(e){jQuery.support.deleteExpando=false;}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click);});div.cloneNode(true).fireEvent("onclick");}
div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';div=null;});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function";}
el=null;return isSupported;};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null;})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{"embed":true,"object":true,"applet":true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}
elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null;}
if(!id){id=++uuid;}
if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name);}else if(!cache[id]){elem[expando]=id;cache[id]={};}
thisCache=cache[id];if(data!==undefined){thisCache[name]=data;}
return typeof name==="string"?thisCache[name]:thisCache;},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}
elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem);}}}else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}
delete cache[id];}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0]);}else if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}
var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);}
return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});jQuery.extend({queue:function(elem,type,data){if(!elem){return;}
type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[];}
if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data));}else{q.push(data);}
return q;},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift();}
if(fn){if(type==="fx"){queue.unshift("inprogress");}
fn.call(elem,function(){jQuery.dequeue(elem,type);});}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
if(data===undefined){return jQuery.queue(this[0],type);}
return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type);},time);});},clearQueue:function(type){return this.queue(type||"fx",[]);}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr);},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name);}});},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")));});}
if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value;}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c];}}
elem.className=jQuery.trim(setClass);}}}}
return this;},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")));});}
if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ");}
elem.className=jQuery.trim(className);}else{elem.className="";}}}}
return this;},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal);});}
return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className);}}else if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className);}
this.className=this.className||value===false?"":jQuery.data(this,"__className__")||"";}});},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true;}}
return false;},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text;}
if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;}
for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value;}
values.push(value);}}
return values;}
if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value;}
return(elem.value||"").replace(rreturn,"");}
return undefined;}
var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return;}
if(isFunction){val=value.call(this,i,self.val());}
if(typeof val==="number"){val+="";}
if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0;}else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0;});if(!values.length){this.selectedIndex=-1;}}else{this.value=val;}});}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}
if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);}
var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}
if(name in elem&¬xml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}
elem[name]=value;}
if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;}
if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}
return elem[name];}
if(!jQuery.support.style&¬xml&&name==="style"){if(set){elem.style.cssText=""+value;}
return elem.style.cssText;}
if(set){elem.setAttribute(name,""+value);}
var attr=!jQuery.support.hrefNormalized&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
return jQuery.style(elem,name,value);}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch;});};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return;}
if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window;}
var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;}
if(!handler.guid){handler.guid=jQuery.guid++;}
var elemData=jQuery.data(elem);if(!elemData){return;}
var events=elemData.events=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined;};}
eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".");}else{namespaces=[];handleObj.namespace="";}
handleObj.type=type;handleObj.guid=handler.guid;var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){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;}}
handlers.push(handleObj);jQuery.event.global[type]=true;}
elem=null;},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return;}
var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.data(elem),events=elemData&&elemData.events;if(!elemData||!events){return;}
if(types&&types.type){handler=types.handler;types=types.type;}
if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types);}
return;}
types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+
jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)")}
eventType=events[type];if(!eventType){continue;}
if(!handler){for(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1);}}
continue;}
special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1);}
if(special.remove){special.remove.call(elem,handleObj);}}
if(pos!=null){break;}}}
if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle);}
ret=null;delete events[type];}}
if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null;}
delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem);}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem);}});}}
if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}
event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data);}
var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false;}}}catch(e){}
if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true);}else if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null;}
jQuery.event.triggered=true;target[type]();}}catch(e){}
if(old){target["on"+type]=old;}
jQuery.event.triggered=false;}}},handle:function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}
var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
if(event.isImmediatePropagationStopped()){break;}}}}
return event.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event;}
var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
if(!event.target){event.target=event.srcElement||document;}
if(event.target.nodeType===3){event.target=event.target.parentNode;}
if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}
if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}
if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;}
if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}
if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));}
return event;},guid:1E8,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}));},remove:function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[],function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;return false;}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler);}}},beforeunload:{setup:function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle;}
return false;},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null;}}}}};var removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener(type,handle,false);}:function(elem,type,handle){elem.detachEvent("on"+type,handle);};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src);}
if(src&&src.type){this.originalEvent=src;this.type=src.type;}else{this.type=src;}
this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
function returnTrue(){return true;}
jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return;}
if(e.preventDefault){e.preventDefault();}
e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return;}
if(e.stopPropagation){e.stopPropagation();}
e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode;}
if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments);};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig);},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement);}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments);}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments);}});}else{return false;}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit");}};}
if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked;}else if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected;}).join("-"):"";}else if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex;}
return val;},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return;}
data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val);}
if(data===undefined||val===data){return;}
if(data!=null||val){e.type="change";return jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e);}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e);}},beforeactivate:function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem));}},setup:function(data,namespaces){if(this.type==="file"){return false;}
for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type]);}
return formElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return formElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;}
function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args);}
if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true);},teardown:function(){this.removeEventListener(orig,handler,true);}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e);}});}
jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn);}
return this;}
if(jQuery.isFunction(data)){fn=data;data=undefined;}
var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments);}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data);}}
return this;};});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key]);}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn);}}
return this;},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector);},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live");}else{return this.die(types,null,fn,selector);}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++]);}
return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined;}
types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"");}
if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue;}
preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces;}else{type=(liveMap[type]||type)+namespaces;}
if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType});});}else{context.unbind(liveConvert(type,selector),fn);}}
return this;}});function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return;}
event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector);}else{live.splice(j--,1);}}
match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0];}
if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj});}}}}
for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break;}}
return stop;}
function liveConvert(type,selector){return"live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g,"`").replace(/ /g,"&");}
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").split(" "),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem);}catch(e){}}}});}
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}
if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();}
set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}
if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}
if(!checkSet){checkSet=set;}
if(!checkSet){Sizzle.error(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}
return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue;}
if(curLoop===result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr===old){if(anyFound==null){Sizzle.error(expr);}else{break;}}
old=expr;}
return curLoop;};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem);}}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){return match[1].toLowerCase();},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}else{Sizzle.error("Syntax error, unrecognized expression: "+name);}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1){return false;}}
if(type==="first"){return true;}
node=elem;case'last':while((node=node.nextSibling)){if(node.nodeType===1){return false;}}
return true;case'nth':var first=match[2],last=match[3];if(first===1&&last===0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first===0){return diff===0;}else{return(diff%first===0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,function(all,num){return"\\"+(num-0+1);}));}
var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true;}
return a.compareDocumentPosition?-1:1;}
var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true;}
return a.sourceIndex?-1:1;}
var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true;}
return a.ownerDocument?-1:1;}
var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue;}else if(elem.nodeType!==8){ret+=getText(elem.childNodes);}}
return ret;}
(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}
div=null;})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}
div=null;})();}
(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return;}
div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return;}
Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName.toLowerCase()===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16);}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return;window.Sizzle=Sizzle;})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)===keep;});}else if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}}
return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break;}}}}}
return ret;},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector);},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector);},is:function(selector){return!!selector&&jQuery.filter(selector,this).length>0;},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector;}}
while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector];}}
cur=cur.parentNode;}}
return ret;}
var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur;}
cur=cur.parentNode;}
return null;});},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children());}
return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;}
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 jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"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.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until;}
if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}
ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}
return this.pushStack(ret,name,slice.call(arguments).join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}
return jQuery.find.matches(expr,elems);},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;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}}
return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}
return r;}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">";},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"];}
jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()));});}
if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));}
return jQuery.text(this);},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}
if(this[0]){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){return this.each(function(){jQuery(this).wrapAll(html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild);}});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});}else if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments);}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});}else if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set;}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem]);}
if(elem.parentNode){elem.parentNode.removeChild(elem);}}}
return this;},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));}
while(elem.firstChild){elem.removeChild(elem.firstChild);}}
return this;},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}
return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0];}else{return this.cloneNode(true);}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"));}
return ret;},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null;}else if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value;}}}catch(e){this.empty().append(value);}}else if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old);});});}else{this.empty().append(value);}
return this;},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old));});}
if(typeof value!=="string"){value=jQuery(value).detach();}
return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value);}else{jQuery(parent).append(value);}});}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value);}},detach:function(selector){return this.remove(selector,true);},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true);});}
if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback);});}
if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent};}else{results=buildFragment(args,this,scripts);}
fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild;}else{first=fragment.firstChild;}
if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment);}}
if(scripts.length){jQuery.each(scripts,evalScript);}}
return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return;}
var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}}});}
function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults;}}}
if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts);}
if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1;}
return{fragment:fragment,cacheable:cacheable};}
jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this;}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
return this.pushStack(ret,name,insert.selector);}};});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}
var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";}
if(!elem){continue;}
if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem);}else if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;}
if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}}
if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);}
elem=div.childNodes;}
if(elem.nodeType){ret.push(elem);}else{ret=jQuery.merge(ret,elem);}}
if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));}
fragment.appendChild(ret[i]);}}}
return ret;},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{removeEvent(elem,type,data.handle);}}}
if(deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}
delete cache[id];}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name);}
if(typeof value==="number"&&!rexclude.test(name)){value+="px";}
jQuery.style(elem,name,value);});};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}
if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined;}
var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity;}
return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":"";}
if(rfloat.test(name)){name=styleFloat;}
name=name.replace(rdashAlpha,fcamelCase);if(set&&value!=='NaNpx'&&value!=='nullpx'){style[name]=value;}
return style[name];},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return;}
jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;}
if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;}});}
if(elem.offsetWidth!==0){getWH();}else{jQuery.swap(elem,props,getWH);}
return Math.max(0,Math.round(val));}
return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret;}
if(rfloat.test(name)){name=styleFloat;}
if(!force&&style&&style[name]){ret=style[name];}else if(getComputedStyle){if(rfloat.test(name)){name="float";}
name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null;}
var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name);}
if(name==="opacity"&&ret===""){ret="1";}}else if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
return ret;},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
callback.call(elem);for(var name in options){elem.style[name]=old[name];}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none";};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};}
var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url);}else if(!this.length){return this;}
var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST";}}
var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText);}
if(callback){self.each(callback,[res.responseText,status,res]);}}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null;}
return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={};}
return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest();}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?";}}else if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}
s.dataType="json";}
if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");}
s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
if(head){head.removeChild(script);}};}
if(s.dataType==="script"&&s.cache===null){s.cache=false;}
if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}
if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data;}
if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");}
var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;}
if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script);}}};}
head.insertBefore(script,head.firstChild);return undefined;}
var requestDone=false;var xhr=s.xhr();if(!xhr){return;}
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);}else{xhr.open(type,s.url,s.async);}
try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType);}
if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]);}
if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url]);}}
if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}
xhr.abort();return false;}
if(s.global){trigger("ajaxSend",[xhr,s]);}
var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete();}
requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop;}}else if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(err){status="parsererror";errMsg=err;}}
if(status==="success"||status==="notmodified"){if(!jsonp){success();}}else{jQuery.handleError(s,xhr,status,errMsg);}
complete();if(isTimeout==="timeout"){xhr.abort();}
if(s.async){xhr=null;}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr);}
onreadystatechange("abort");};}catch(e){}
if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout");}},s.timeout);}
try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null);}catch(e){jQuery.handleError(s,xhr,null,e);complete();}
if(!s.async){onreadystatechange();}
function success(){if(s.success){s.success.call(callbackContext,data,status,xhr);}
if(s.global){trigger("ajaxSuccess",[xhr,s]);}}
function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status);}
if(s.global){trigger("ajaxComplete",[xhr,s]);}
if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}}
function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args);}
return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e);}
if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}catch(e){}
return false;},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified;}
if(etag){jQuery.etag[url]=etag;}
return xhr.status===304||xhr.status===0;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror");}
if(s&&s.dataFilter){data=s.dataFilter(data,type);}
if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data);}}
return data;},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;}
if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix]);}}
return s.join("&").replace(r20,"+");function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v);}});}else if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v);});}else{add(prefix,obj);}}
function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName];}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block";}
elem.remove();elemdisplay[nodeName]=display;}
jQuery.data(this[i],"olddisplay",display);}}
for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||"";}
return this;}},hide:function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}}
for(var j=0,k=this.length;j<k;j++){this[j].style.display="none";}
return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments);}else if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();});}else{this.animate(genFx("toggle",3),fn,fn2);}
return this;},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete);}
return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name;}
if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this);}
if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}
if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0];}}
if(opt.overflow!=null){this.style.overflow="hidden";}
opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop);}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start;}
e.custom(start,end,unit);}else{e.custom(start,val,"");}}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([]);}
this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true);}
timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}
return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?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:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();}
if(jQuery.isFunction(opt.old)){opt.old.call(this);}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={};}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}
(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}
var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13);}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;}}
if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block";}}
if(this.options.hide){jQuery(this.elem).hide();}
if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p]);}}
this.options.complete.call(this.elem);}
return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
return true;}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}
if(!timers.length){jQuery.fx.stop();}},stop:function(){clearInterval(timerId);timerId=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit;}else{fx.elem[fx.prop]=fx.now;}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}
function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
if("getBoundingClientRect"in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
if(!elem||!elem.ownerDocument){return null;}
if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}
var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
if(!elem||!elem.ownerDocument){return null;}
if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}
jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break;}
computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}
prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}
prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft;}
if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);}
return{top:top,left:left};};}
jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop;},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0;}
return{top:top,left:left};},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative";}
var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);}
var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return null;}
var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;}
return offsetParent;});}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null;}
if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop());}else{this[method]=val;}});}else{win=getWindow(elem);return win?("pageXOffset"in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];}};});function getWindow(elem){return("scrollTo"in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}
jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null;};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this;}
if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()));});}
return("scrollTo"in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px");};});window.jQuery=window.$=jQuery;})(window);$j=jQuery.noConflict(); |
packages/material-ui-icons/src/BugReport.js | AndriusBil/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from 'material-ui/SvgIcon';
let BugReport = props =>
<SvgIcon {...props}>
<path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z" />
</SvgIcon>;
BugReport = pure(BugReport);
BugReport.muiName = 'SvgIcon';
export default BugReport;
|